From 9ccd1852506cf180a378de83e30a12b24d7b7c88 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 22 Dec 2019 00:38:59 +0800 Subject: [PATCH 001/430] PRF @HankChow --- .../20191017 How to type emoji on Linux.md | 40 ++++++++----------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/translated/tech/20191017 How to type emoji on Linux.md b/translated/tech/20191017 How to type emoji on Linux.md index 86dc42d4ef..8ad80a62e0 100644 --- a/translated/tech/20191017 How to type emoji on Linux.md +++ b/translated/tech/20191017 How to type emoji on Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to type emoji on Linux) @@ -9,9 +9,10 @@ 如何在 Linux 系统中输入 emoji ====== -使用 GNOME 桌面可以让你在文字中轻松加入 emoji。 -![A cat under a keyboard.][1] +> 使用 GNOME 桌面可以让你在文字中轻松加入 emoji。 + +![](https://img.linux.net.cn/data/attachment/album/201912/22/003829tsuogoonoxunn33o.jpg) emoji 是潜藏在 Unicode 字符空间里的有趣表情图,它们已经风靡于整个互联网。emoji 可以用来在社交媒体上表示自己的心情状态,也可以作为重要文件名的视觉标签,总之它们的各种用法层出不穷。在 Linux 系统中有很多种方式可以输入 Unicode 字符,但 GNOME 桌面能让你更轻松地查找和输入 emoji。 @@ -25,7 +26,6 @@ emoji 是潜藏在 Unicode 字符空间里的有趣表情图,它们已经风 例如在 Fedora 上: - ``` $ sudo dnf search emoji emoji-picker.noarch : An emoji selection tool @@ -46,35 +46,29 @@ google-noto-emoji-color-fonts.noarch : Google “Noto Color Emoji” colored emo 要开始设置,首先打开 GNOME 的设置面板。 - 1. 在左边侧栏中,选择“地区与语言Region & Language”类别 - 2. 点击“输入源Input Sources”选项下方的加号(+)打开“添加输入源Add an Input Source”面板 - +1、在左边侧栏中,选择“地区与语言Region & Language”类别。 +2、点击“输入源Input Sources”选项下方的加号(+)打开“添加输入源Add an Input Source”面板。 ![Add a new input source][5] - 3. 在“添加输入源Add an Input Source”面板中,点击底部的菜单按钮 - - +3、在“添加输入源Add an Input Source”面板中,点击底部的菜单按钮。 ![Add an Input Source panel][6] - 4. 滑动到列表底部并选择“其它Other” - 5. 在“其它Other”列表中,找到“其它Other快速输入Typing Booster)” - +4、滑动到列表底部并选择“其它Other”。 +5、在“其它Other”列表中,找到“其它Other快速输入Typing Booster)”。 ![Find Other \(Typing Booster\) in inputs][7] - 6. 点击右上角的“添加Add”按钮,将输入源添加到 GNOME 桌面 - - +6、点击右上角的“添加Add”按钮,将输入源添加到 GNOME 桌面。 以上操作完成之后,就可以关闭设置面板了。 #### 切换到快速输入 -现在 GNOME 桌面的右上角会出现一个新的图标,一般情况下是当前语言的双字母缩写(例如英语是 en,世界语是 eo,西班牙语是 es,等等)。如果你按下了超级键Super key(也就是键盘上带有 Linux 企鹅/Windows 徽标/Mac Command 标志的键)+空格键的组合键,就会切换到输入列表中的下一个输入源。在这里,我们只有两个输入源,也就是默认语言和快速输入。 +现在 GNOME 桌面的右上角会出现一个新的图标,一般情况下是当前语言的双字母缩写(例如英语是 en,世界语是 eo,西班牙语是 es,等等)。如果你按下了超级键Super key(也就是键盘上带有 Linux 企鹅/Windows 徽标/Mac Command 标志的键)+ 空格键的组合键,就会切换到输入列表中的下一个输入源。在这里,我们只有两个输入源,也就是默认语言和快速输入。 你可以尝试使用一下这个组合键,观察图标的变化。 @@ -96,7 +90,7 @@ google-noto-emoji-color-fonts.noarch : Google “Noto Color Emoji” colored emo ### 使用其它切换方式 -如果你觉得超级键+空格键这个组合用起来不顺手,你也可以换成其它键的组合。在 GNOME 设置面板中选择“设备Device”→“键盘Keyboard”。 +如果你觉得“超级键+空格键”这个组合用起来不顺手,你也可以换成其它键的组合。在 GNOME 设置面板中选择“设备Device”→“键盘Keyboard”。 在“键盘Keyboard”页面中,将“切换到下一个输入源Switch to next input source”更改为你喜欢的组合键。 @@ -106,11 +100,9 @@ google-noto-emoji-color-fonts.noarch : Google “Noto Color Emoji” colored emo 实际上,现代键盘的设计只是为了输入 26 个字母以及尽可能多的数字和符号。但 ASCII 字符的数量已经比键盘上能看到的字符多得多了,遑论上百万个 Unicode 字符。因此,如果你想要在 Linux 应用程序中输入 Unicode,但又不想使用快速输入,你可以尝试一下 Unicode 输入。 - 1. 打开任意一种支持输入 Unicode 字符的软件,但仍然使用你的默认输入语言 - 2. 使用 ctrl+shift+U 组合键进入 Unicode 输入模式 - 3. 在 Unicode 输入模式下,只需要输入某个 Unicode 字符的对应序号,就实现了对这个 Unicode 字符的输入。例如 `1F44D` 对应的是 👍,而 `2620` 则对应了 ☠。想要查看所有 Unicode 字符的对应序号,可以参考 [Unicode 规范][11]。 - - +1. 打开任意一种支持输入 Unicode 字符的软件,但仍然使用你的默认输入语言 +2. 使用 `Ctrl+Shift+U` 组合键进入 Unicode 输入模式 +3. 在 Unicode 输入模式下,只需要输入某个 Unicode 字符的对应序号,就实现了对这个 Unicode 字符的输入。例如 `1F44D` 对应的是 👍,而 `2620` 则对应了 ☠。想要查看所有 Unicode 字符的对应序号,可以参考 [Unicode 规范][11]。 ### emoji 的实用性 @@ -127,7 +119,7 @@ via: https://opensource.com/article/19/10/how-type-emoji-linux 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 550d8e26291d24251247e1efba5425b17efdc068 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 22 Dec 2019 00:40:21 +0800 Subject: [PATCH 002/430] PUB @HankChow https://linux.cn/article-11702-1.html --- .../tech => published}/20191017 How to type emoji on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191017 How to type emoji on Linux.md (99%) diff --git a/translated/tech/20191017 How to type emoji on Linux.md b/published/20191017 How to type emoji on Linux.md similarity index 99% rename from translated/tech/20191017 How to type emoji on Linux.md rename to published/20191017 How to type emoji on Linux.md index 8ad80a62e0..7c11e45b76 100644 --- a/translated/tech/20191017 How to type emoji on Linux.md +++ b/published/20191017 How to type emoji on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11702-1.html) [#]: subject: (How to type emoji on Linux) [#]: via: (https://opensource.com/article/19/10/how-type-emoji-linux) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 59f1b4e9caad014636e6989ed2a41419d82700b4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 22 Dec 2019 00:53:08 +0800 Subject: [PATCH 003/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191220=20Why=20?= =?UTF-8?q?We=20Need=20Interoperable=20Service=20Identity=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191220 Why We Need Interoperable Service Identity.md --- ... We Need Interoperable Service Identity.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/tech/20191220 Why We Need Interoperable Service Identity.md diff --git a/sources/tech/20191220 Why We Need Interoperable Service Identity.md b/sources/tech/20191220 Why We Need Interoperable Service Identity.md new file mode 100644 index 0000000000..7ca8470bf7 --- /dev/null +++ b/sources/tech/20191220 Why We Need Interoperable Service Identity.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why We Need Interoperable Service Identity?) +[#]: via: (https://www.linux.com/articles/why-we-need-interoperable-identity/) +[#]: author: (TC CURRIE https://www.linux.com/author/tc_currie/) + +Why We Need Interoperable Service Identity? +====== + +[![][1]][2] + +[![][1]][2] + +Interoperable service identity is necessary to secure communication between different cloud providers and different platforms. This presents a challenge with multi-cloud and hybrid deployments. How do you secure service to service communication across those boundaries? + +Evan Gilman, Staff Engineer at  [Scytale.io][3] and co-author of _Zero Trust Networks_, illustrates this issue: when you’re in AWS, you’ll use an AWS IAM role in order to identify which instance a certain role should or should not have access to.  But in today’s multi-platform world, you can be communicating from AWS to GCP to your on-prem infrastructure. Those systems do not understand what IAM role is because it is AWS-specific. + +This is what Scytale is trying to address.  *“*We are bringing a platform-agnostic identity, meaning, an identity that is not specific to a cloud provider or a platform, or any specific kind of technology,” he said. + +**What’s SPIFFE?** + +[Secure Production Identity Framework for Everyone (SPIFFE)][4] is a set of specifications that define interoperability across all tech platforms, such as how to format the name, the shape of the document, how you validate documents, etc.  “This SPIFFE level is like a secure dial tone,” Gilman explains. “You pick up the phone, it rings the other side, doesn’t really matter what platform it is or where it’s running or anything like that. The SPIFFE authentication occurs and you get a nice little layer of encryption and some authenticity insurances as well.” + +But at the end of the day, SPIFFE is just a set of documents. SPIRE is the software implementation of the SPIFFE specifications. + +“Think about the way the passports work,” he said.  “If you look at passports from different countries, they may be slightly different, but they have similar characteristics like SPIFFE specifications.  They’re all the same size. They all have a picture in the same spot. They have the same funny-looking barcode at the bottom, and so on. So, when you show your passport at a country border, they know how to read your passport, no matter what country that passport is from.  SPIRE is the passport agency in this analogy. Where does this passport come from? Who gives it to you? How do you get it and how do you do that in an automated fashion?” + +SPIRE implements these SPIFFE specifications and enables workloads and services to get these passports as soon as they boot in a way that is very reliable, scalable, and very highly automated. + +**Zero Trust** + +Gilman is taking the philosophy of Zero Trust — don’t trust anybody whatsoever — and applying it to network infrastructure and service-to-service communication.  “We do this by removing all the security functions from the network and making no assumptions about what should or should not be allowed based on IP address,” he said. + +“Instead, we build systems in such a way that they don’t rely on that network to deliver trustworthy information.   We use protocols for strong authentication and authorization to try to mitigate any kind of funny business that might happen on the wire.” + +**Into the New Decade** + +For Scytale, Gilman’s biggest push for 2020 is to provide documentation with detailed examples of how to solve different use cases, and how to configure the software to solve those use cases. “Very clear-cut guidance,” he states.  “We have a lot of flexibility and features built into the software, but we don’t have conceptual guidelines that can teach people how the internals are working and stuff like that. We button everything up and make the experience really easy to pick up for folks who might not necessarily want to get in the weeds with it. They just want it to work.” + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/why-we-need-interoperable-identity/ + +作者:[TC CURRIE][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/tc_currie/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2019/12/computer-2930704_1280-696x413.jpg (computer-2930704_1280) +[2]: https://www.linux.com/wp-content/uploads/2019/12/computer-2930704_1280.jpg +[3]: http://scytale.io/ +[4]: https://spiffe.io/ From f6cfd66f0d1c73efb31e7ed477026e723db49739 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 22 Dec 2019 00:53:43 +0800 Subject: [PATCH 004/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191222=20How=20?= =?UTF-8?q?to=20Update=20Grub=20on=20Ubuntu=20and=20Other=20Linux=20Distri?= =?UTF-8?q?butions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md --- ...on Ubuntu and Other Linux Distributions.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md b/sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..a969c37867 --- /dev/null +++ b/sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Update Grub on Ubuntu and Other Linux Distributions) +[#]: via: (https://itsfoss.com/update-grub/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Update Grub on Ubuntu and Other Linux Distributions +====== + +In this tutorial, you’ll learn to update grub on Ubuntu or any other Linux distribution. You’ll also learn a thing or two about how this grub update process works. + +### How to update grub + +Ubuntu and many other Linux distributions provide a handy command line utility called update-grub. + +To update grub, all you have to do is to run this command in the terminal with sudo. + +``` +sudo update-grub +``` + +You should see an output like this: + +``` +[email protected]:~$ sudo update-grub +[sudo] password for abhishek: +Sourcing file `/etc/default/grub' +Generating grub configuration file ... +Found linux image: /boot/vmlinuz-5.0.0-37-generic +Found initrd image: /boot/initrd.img-5.0.0-37-generic +Found linux image: /boot/vmlinuz-5.0.0-36-generic +Found initrd image: /boot/initrd.img-5.0.0-36-generic +Found linux image: /boot/vmlinuz-5.0.0-31-generic +Found initrd image: /boot/initrd.img-5.0.0-31-generic +Found Ubuntu 19.10 (19.10) on /dev/sda4 +Found MX 19 patito feo (19) on /dev/sdb1 +Adding boot menu entry for EFI firmware configuration +done +``` + +You may see a similar command called update-grub2. No need to be alarmed or confused between update-grub and update-grub2. Both of these commands do the same action. + +Around ten years ago, when grub2 was just introduced, update-grub2 command was also introduced. Today, update-grub2 is just a symbolic link to update-grub and both update grub2 configuration (because grub2 is the default). + +#### Can’t find update-grub command? Here’s what to do in that case + +It’s possible that your Linux distribution might not have update-grub command available. + +What do you do in that case? How do you update grub on such a Linux distribution? + +There is no need to panic. The update-grub command is simply a stub for running ‘grub-mkconfig -o /boot/grub/grub.cfg’ to generate grub2 config file. + +Which means that you can update grub with the following command on any Linux distribution: + +``` +sudo grub-mkconfig -o /boot/grub/grub.cfg +``` + +Of course, remembering update-grub command is a lot easier than the above command and this is the reason why it was created in the first place. + +### How does update-grub work? + +When you install a Linux distribution, it (usually) asks you to install the [grub boot loader][1]. + +Part of grub is installed on the MBR/ESP partition. Rest of the grub lies in /boo/grub directory of the Linux distributions. + +As per its [man page][2], update-grub works by looking into the /boot directory. All the files starting with [vmlinuz-][3] will be treated as kernels and they will get a grub menu entry. It will also add initrd lines for [ramdisk][4] images found with the same version as kernels found. + +It also looks into all disk partitions for other operating systems with [os-prober][5]. If it finds other operating systems, it adds them to the grub menu. + +![Representational image of Grub Menu][6] + +### Why would you need to update grub? + +There could be a number of scenarios when you need to update grub. + +Suppose you changed the grub config file (/etc/default/grub) to [change the default boot order][7] or reduce the default boot time. Your changes won’t take into effect unless you update the grub. + +Another scenario is when you have multiple Linux distributions installed on the same system. + +For example, on my Intel NUC, I have two disks. The first disk had Ubuntu 19.10 and then I installed Ubuntu 18.04 on it. The second OS (Ubuntu 18.04) also installed its own grub and now the grub screen is controlled by Ubuntu 18.04 grub. + +On the second disk, I installed MX Linux but I didn’t install grub this time. I want the existing grub (controlled by Ubuntu 18.04) to handle all the OS entries. + +Now, in this scenario, the grub on Ubuntu 18.04 needs to be updated so that it can see [MX Linux][8]. + +![][9] + +As you can see in the image above, when I update the grub, it finds various Linux kernels installed on 18.04 along with Ubuntu 19.10 and MX Linux on different partition. + +If I want MX Linux to control the grub, I can install grub on MX Linux with [grub-install][10] command and then the grub on MX Linux will start controlling the grub screen. You get the gist, right? + +Using a GUI tool like [Grub Customizer][11] is a simpler way to make changes in grub. + +**In the end…** + +Initially, I had intended to keep it a short article as a quick tip. But then I thought of explaining a few things associated with it so that (relatively) new Linux users could learn more than just a simple command. + +Did you like it? Do you have some questions or suggestions? Please feel free to leave a comment. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/update-grub/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/GNU_GRUB +[2]: https://manpages.debian.org/testing/grub-legacy/update-grub.8.en.html +[3]: https://www.ibm.com/developerworks/community/blogs/mhhaque/entry/anatomy_of_the_initrd_and_vmlinuz?lang=en +[4]: https://en.wikipedia.org/wiki/Initial_ramdisk +[5]: https://packages.debian.org/sid/utils/os-prober +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/grub_screen.png?ssl=1 +[7]: https://itsfoss.com/grub-customizer-ubuntu/ +[8]: https://mxlinux.org/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/update_grub.png?ssl=1 +[10]: https://www.gnu.org/software/grub/manual/grub/html_node/Installing-GRUB-using-grub_002dinstall.html +[11]: https://itsfoss.com/customize-grub-linux/ From 011b92d683ad4bc32b89d14c746346bb6ac1f3ff Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 22 Dec 2019 00:54:29 +0800 Subject: [PATCH 005/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191221=20Custom?= =?UTF-8?q?ize=20your=20Linux=20desktop=20with=20KDE=20Plasma?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md --- ...mize your Linux desktop with KDE Plasma.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md diff --git a/sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md b/sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md new file mode 100644 index 0000000000..0baaf4747a --- /dev/null +++ b/sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Customize your Linux desktop with KDE Plasma) +[#]: via: (https://opensource.com/article/19/12/linux-kde-plasma) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Customize your Linux desktop with KDE Plasma +====== +This article is part of a special series of 24 days of Linux desktops. +If you think there's no such thing as too much opportunity to customize +your desktop, KDE Plasma may be for you. +![5 pengiuns floating on iceburg][1] + +The Plasma desktop by the KDE community is a pinnacle among open source desktops. KDE got into the Linux desktop market early, but since its foundational Qt toolkit did not have a fully open license at the time, the [GNOME][2] desktop was created. Since then, Qt has become open source, and KDE (and its derivatives, like the [Trinity desktop][3]) has thrived. + +You may find the KDE desktop in your distribution's software repository, or you can download and install a distribution that ships KDE as its default. Before you install, be aware that KDE provides a full, integrated, and robust desktop experience, so several KDE applications are installed along with it. If you're already running a different desktop, you will find yourself with redundant applications (two PDF readers, several media players, two or more file managers, and so on). If you just want to try the KDE desktop without committing to it, you can install a KDE-based distribution in a virtual machine, such as [GNOME Boxes][4], or you can try a bootable OS like [Porteus][5]. + +### KDE desktop tour + +The [KDE Plasma][6] desktop is relatively boring at first glance—but in a comforting way. It's got the industry-standard layout: pop-up application menu in the bottom-left corner, taskbar in the middle, system tray on the right. It's exactly what you'd expect from a standard household or business computer. + +![KDE Plasma desktop][7] + +What sets KDE apart, though, is that you can change nearly anything you want. The Qt toolkit can be taken apart and rearranged in some surprising ways, meaning you can essentially design your own desktop using KDE's parts as your foundation. The settings available for how your desktop behaves are vast, too. KDE can act as a standard desktop, a tiling window manager, and anything in between. You can create your own window rules by window class, role, type, title, or any combination thereof, so if you want specific applications to behave differently than everything else, you can create an exception to global settings. + +Furthermore, there's a rich collection of widgets to enable you to customize the way you interface with your desktop. There's a GNOME-like full-screen application launcher, a Unity-like dock launcher and icons-only taskbar, and a traditional taskbar. You can create and place panels on any edge of the screen you want. + +![A slightly customized KDE desktop][8] + +There's so much customization, in fact, that one of the most common critiques of KDE is that it's _too customizable_, so keep in mind that customization is optional. You can use the Plasma desktop in its default configuration, and change things gradually and only as you feel necessary. What matters most about Plasma desktop configuration options isn't their number, but that they're discoverable and intuitive, either in the System Settings application or with a right-click. + +The fact is, on KDE, there's almost never just one way to accomplish any given task, and its users see that as its greatest strength. There's no implied workflow in KDE, only a default. And all defaults can be changed, until everything you need to do with your desktop is second-nature. + +### Consistency and integration + +The KDE community prides itself on consistency and integration, made possible through great developer and community management and the KDE libraries. The developers of KDE aren't just developers of a desktop. They provide a [stunning collection of applications][9], each of them created with KDE libs that extend and standardize common Qt widgets. It's no accident that after using KDE for a few months, whether you open [DigiKam][10] for photo management or Kmail to check email or KTorrent to grab the latest ISO or Dolphin to manage files, your muscle memory takes you where you need to go in the UI before you consciously think about it. + +![KDE on Porteus][11] + +### Try KDE + +KDE has something for everyone. Use its default settings for a smooth, plain-vanilla desktop experience, or customize it to make it your own. It's a stable, attractive, and robust desktop environment that probably has everything you need for whatever you want to do on Linux. + +KDE originally stood for Kool Desktop Environment, but is now known by many as the K Desktop... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/linux-kde-plasma + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux31x_cc.png?itok=Pvim4U-B (5 pengiuns floating on iceburg) +[2]: https://opensource.com/article/19/12/gnome-linux-desktop +[3]: https://opensource.com/article/19/12/linux-trinity-desktop-environment-tde +[4]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization +[5]: https://opensource.com/article/19/6/linux-distros-to-try +[6]: https://kde.org/plasma-desktop +[7]: https://opensource.com/sites/default/files/uploads/advent-kde-presskit.jpg (KDE Plasma desktop) +[8]: https://opensource.com/sites/default/files/uploads/advent-kde-dock.jpg (A slightly customized KDE desktop) +[9]: https://kde.org/applications/ +[10]: https://opensource.com/life/16/5/how-use-digikam-photo-management +[11]: https://opensource.com/sites/default/files/uploads/advent-kde.jpg (KDE on Porteus) From e6a387edc957ae0d32f4bc5d5757cbc21e322f54 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 22 Dec 2019 00:54:59 +0800 Subject: [PATCH 006/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191221=20Elimin?= =?UTF-8?q?ating=20gender=20bias=20in=20open=20source=20software=20develop?= =?UTF-8?q?ment,=20a=20database=20of=20microbes,=20and=20more=20open=20sou?= =?UTF-8?q?rce=20news?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md --- ... of microbes, and more open source news.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md diff --git a/sources/tech/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md b/sources/tech/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md new file mode 100644 index 0000000000..3cf9d05097 --- /dev/null +++ b/sources/tech/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Eliminating gender bias in open source software development, a database of microbes, and more open source news) +[#]: via: (https://opensource.com/article/19/12/news-december-21) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +Eliminating gender bias in open source software development, a database of microbes, and more open source news +====== +Catch up on the biggest open source headlines from the past two weeks. +![Weekly news roundup with TV][1] + +In this edition of our open source news roundup, we take a look at eliminating gender bias in open source software development, an open source database of microbes, an open source index for cooperatives, and more! + +### Eliminating gender bias from open source development + +It's a sad fact that certain groups, among them women, are woefully underrepresented in open source projects. It's like a bug in the open source development process. Fortunately, there are initiatives to make that under representation a thing of the past. A study out of Oregon State University (OSU) intends to resolve the issue of the lack of women in open source development by "[finding these bugs and proposing redesigns around them][2], leading to more gender-inclusive tools used by software developers." + +The study will look at tools commonly used in open source development — including Eclipse, GitHub, and Hudson — to determine if they "significantly discourage newcomers, especially women, from joining OSS projects." According to Igor Steinmacher, one of the principal investigators of the study, the study will examine "how people use tools because the 'bugs' may be embedded in how the tool was designed, which may place people with different cognitive styles at a disadvantage." + +The developers of the tools being studied will walk through their software and answer questions based on specific personas. The researchers at OSU will suggest ways to redesign the software to eliminate gender bias and will "create a list of best practices for fixing gender-bias bugs in both products and processes." + +### Canadian university compiles open source microbial database + +What do you do when you have a vast amount of data but no way to effectively search and build upon it? You turn it into a database, of course. That's what researchers at Simon Fraser University in British Columbia, along with collaborators from around the globe, did with [information about chemical compounds created by bacteria and fungi][3]. Called the Natural Products Atlas, the database "holds information on nearly 25,000 natural compounds and serves as a knowledge base and repository for the global scientific community." + +Licensed under a Creative Commons Attribution 4.0 International License, the Natural Products Atlas "holds information on nearly 25,000 natural compounds and serves as a knowledge base and repository for the global scientific community." The [website for the Natural Products Atlas][4] hosts the database also includes a number of visualization tools and is fully searchable. + +Roger Linington, an associate professor at SFU who spearheaded the creation of the database, said that having "all the available data in one place and in a standardized format means we can now index natural compounds for anyone to freely access and learn more about." + +### Open source index for cooperatives + +Europe has long been a hotbed of both open source development and open source adoption. While European governments strongly advocate open source, non profits have been following suit. One of those is Cooperatives Europe, which is developing "[open source software to allow users to index co-op information and resources in a standardised way][5]." + +The idea behind the software, called Coop Starter, reinforces the [essential freedoms of free software][6]: it's intended to provide "education, training and information. The software may be used and repurposed by the public for their own needs and on their own infrastructure." Anyone can use it "to reference existing material on co-operative entrepreneurship" and can contribute "by sharing resources and information." + +The [code for Coop Starter][7], along with a related WordPress plugin, is available from Cooperative Europe's GitLab repository. + +#### In other news + + * [Nancy recognised as France’s top digital free and collaborative public service][8] + * [Open Source and AI: Ready for primetime in government?][9] + * [Open Software Means Kinder Science][10] + * [New Open-Source CoE to be launched by Wipro and Oman’s Ministry of Tech & Communication][11] + + + +_Thanks, as always, to Opensource.com staff members and [Correspondents][12] for their help this week._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/news-december-21 + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i (Weekly news roundup with TV) +[2]: https://techxplore.com/news/2019-12-professors-gender-biased-bugs-open-source-software.html +[3]: https://www.sfu.ca/sfunews/stories/2019/12/sfu-global-collaboration-creates-world-s-first-open-source-datab.html +[4]: https://www.npatlas.org/joomla/ +[5]: https://www.thenews.coop/144412/sector/regional-organisations/cooperatives-europe-builds-open-source-index-for-the-co-op-movement/ +[6]: https://www.gnu.org/philosophy/free-sw.en.html +[7]: https://git.happy-dev.fr/startinblox/applications/coop-starter +[8]: https://joinup.ec.europa.eu/collection/open-source-observatory-osor/news/territoire-numerique-libre +[9]: https://federalnewsnetwork.com/commentary/2019/12/open-source-and-ai-ready-for-primetime-in-government/ +[10]: https://blogs.scientificamerican.com/observations/open-software-means-kinder-science/ +[11]: https://www.indianweb2.com/2019/12/11/new-open-source-coe-to-be-launched-by-wipro-and-omans-ministry-of-tech-communication/ +[12]: https://opensource.com/correspondent-program From f3ab8f7fe89564930a36ca3f1c00b08894316c6e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 22 Dec 2019 00:55:41 +0800 Subject: [PATCH 007/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191221=20Testin?= =?UTF-8?q?g=20your=20Bash=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191221 Testing your Bash script.md --- .../tech/20191221 Testing your Bash script.md | 288 ++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 sources/tech/20191221 Testing your Bash script.md diff --git a/sources/tech/20191221 Testing your Bash script.md b/sources/tech/20191221 Testing your Bash script.md new file mode 100644 index 0000000000..4a8504cbe9 --- /dev/null +++ b/sources/tech/20191221 Testing your Bash script.md @@ -0,0 +1,288 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Testing your Bash script) +[#]: via: (https://opensource.com/article/19/12/testing-bash-script) +[#]: author: (David Both https://opensource.com/users/dboth) + +Testing your Bash script +====== +In the fourth and final article in this series on automation with shell +scripts, learn about initializing variables and ensuring your program +runs correctly. +![Team checklist and to dos][1] + +In the [first article][2] in this series, you created your first, very small, one-line Bash script and explored the reasons for creating shell scripts. In the [second article][3], you began creating a fairly simple template that can be a starting point for other Bash programs and began testing it. In the [third article][4], you created and used a simple Help function and learned about using functions and how to handle command-line options such as **-h**. + +This fourth and final article in the series gets into variables and initializing them as well as how to do a bit of sanity testing to help ensure the program runs under the proper conditions. Remember, the objective of this series is to build working code that will be used for a template for future Bash programming projects. The idea is to make getting started on new programming projects easy by having common elements already available in the template. + +### Variables + +The Bash shell, like all programming languages, can deal with variables. A variable is a symbolic name that refers to a specific location in memory that contains a value of some sort. The value of a variable is changeable, i.e., it is variable. If you are not familiar with using variables, read my article [_How to program with Bash: Syntax and tools_][5] before you go further. + +Done? Great! Let's now look at some good practices when using variables. + +I always set initial values for every variable used in my scripts. You can find this in your template script immediately after the procedures as the first part of the main program body, before it processes the options. Initializing each variable with an appropriate value can prevent errors that might occur with uninitialized variables in comparison or math operations. Placing this list of variables in one place allows you to see all of the variables that are supposed to be in the script and their initial values. + +Your little script has only a single variable, **$option**, so far. Set it by inserting the following lines as shown: + + +``` +################################################################################ +################################################################################ +# Main program                                                                 # +################################################################################ +################################################################################ +# Initialize variables +option="" +################################################################################ +# Process the input options. Add options as needed.                            # +################################################################################ +``` + +Test this to ensure that everything works as it should and that nothing has broken as the result of this change. + +### Constants + +Constants are variables, too—at least they should be. Use variables wherever possible in command-line interface (CLI) programs instead of hard-coded values. Even if you think you will use a particular value (such as a directory name, a file name, or a text string) just once, create a variable and use it where you would have placed the hard-coded name. + +For example, the message printed as part of the main body of the program is a string literal, **echo "Hello world!"**. Change that to a variable. First, add the following statement to the variable initialization section: + + +``` +`Msg="Hello world!"` +``` + +And now change the last line of the program from: + + +``` +`echo "Hello world!"` +``` + +to: + + +``` +`echo "$Msg"` +``` + +Test the results. + +### Sanity checks + +Sanity checks are simply tests for conditions that need to be true in order for the program to work correctly, such as: the program must be run as the root user, or it must run on a particular distribution and release of that distro. Add a check for _root_ as the running user in your simple program template. + +Testing that the root user is running the program is easy because a program runs as the user that launches it. + +The **id** command can be used to determine the numeric user ID (UID) the program is running under. It provides several bits of information when it is used without any options: + + +``` +[student@testvm1 ~]$ id +uid=1001(student) gid=1001(student) groups=1001(student),5000(dev) +``` + +Using the **-u** option returns just the user's UID, which is easily usable in your Bash program: + + +``` +[student@testvm1 ~]$ id -u +1001 +[student@testvm1 ~]$ +``` + +Add the following function to the program. I added it after the Help procedure, but you can place it anywhere in the procedures section. The logic is that if the UID is not zero, which is always the root user's UID, the program exits: + + +``` +################################################################################ +# Check for root.                                                              # +################################################################################ +CheckRoot() +{ +   if [ `id -u` != 0 ] +   then +      echo "ERROR: You must be root user to run this program" +      exit +   fi   +} +``` + +Now, add a call to the **CheckRoot** procedure just before the variable's initialization. Test this, first running the program as the student user: + + +``` +[student@testvm1 ~]$ ./hello +ERROR: You must be root user to run this program +[student@testvm1 ~]$ +``` + +then as the root user: + + +``` +[root@testvm1 student]# ./hello +Hello world! +[root@testvm1 student]# +``` + +You may not always need this particular sanity test, so comment out the call to **CheckRoot** but leave all the code in place in the template. This way, all you need to do to use that code in a future program is to uncomment the call. + +### The code + +After making the changes outlined above, your code should look like this: + + +``` +#!/usr/bin/bash +################################################################################ +#                              scriptTemplate                                  # +#                                                                              # +# Use this template as the beginning of a new program. Place a short           # +# description of the script here.                                              # +#                                                                              # +# Change History                                                               # +# 11/11/2019  David Both    Original code. This is a template for creating     # +#                           new Bash shell scripts.                            # +#                           Add new history entries as needed.                 # +#                                                                              # +#                                                                              # +################################################################################ +################################################################################ +################################################################################ +#                                                                              # +#  Copyright (C) 2007, 2019 David Both                                         # +#  [LinuxGeek46@both.org][6]                                                        # +#                                                                              # +#  This program is free software; you can redistribute it and/or modify        # +#  it under the terms of the GNU General Public License as published by        # +#  the Free Software Foundation; either version 2 of the License, or           # +#  (at your option) any later version.                                         # +#                                                                              # +#  This program is distributed in the hope that it will be useful,             # +#  but WITHOUT ANY WARRANTY; without even the implied warranty of              # +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # +#  GNU General Public License for more details.                                # +#                                                                              # +#  You should have received a copy of the GNU General Public License           # +#  along with this program; if not, write to the Free Software                 # +#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # +#                                                                              # +################################################################################ +################################################################################ +################################################################################ + +################################################################################ +# Help                                                                         # +################################################################################ +Help() +{ +   # Display Help +   echo "Add description of the script functions here." +   echo +   echo "Syntax: scriptTemplate [-g|h|v|V]" +   echo "options:" +   echo "g     Print the GPL license notification." +   echo "h     Print this Help." +   echo "v     Verbose mode." +   echo "V     Print software version and exit." +   echo +} + +################################################################################ +# Check for root.                                                              # +################################################################################ +CheckRoot() +{ +   # If we are not running as root we exit the program +   if [ `id -u` != 0 ] +   then +      echo "ERROR: You must be root user to run this program" +      exit +   fi +} + +################################################################################ +################################################################################ +# Main program                                                                 # +################################################################################ +################################################################################ + +################################################################################ +# Sanity checks                                                                # +################################################################################ +# Are we rnning as root? +# CheckRoot + +# Initialize variables +option="" +Msg="Hello world!" +################################################################################ +# Process the input options. Add options as needed.                            # +################################################################################ +# Get the options +while getopts ":h" option; do +   case $option in +      h) # display Help +         Help +         exit;; +     \?) # incorrect option +         echo "Error: Invalid option" +         exit;; +   esac +done + +echo "$Msg" +``` + +### A final exercise + +You probably noticed that the Help function in your code refers to features that are not in the code. As a final exercise, figure out how to add those functions to the code template you created. + +### Summary + +In this article, you created a couple of functions to perform a sanity test for whether your program is running as root. Your program is getting a little more complex, so testing is becoming more important and requires more test paths to be complete. + +This series looked at a very minimal Bash program and how to build a script up a bit at a time. The result is a simple template that can be the starting point for other, more useful Bash scripts and that contains useful elements that make it easy to start new scripts. + +By now, you get the idea: Compiled programs are necessary and fill a very important need. But for sysadmins, there is always a better way. Always use shell scripts to meet your job's automation needs. Shell scripts are open; their content and purpose are knowable. They can be readily modified to meet different requirements. I have never found anything that I need to do in my sysadmin role that cannot be accomplished with a shell script. + +What you have created so far in this series is just the beginning. As you write more Bash programs, you will find more bits of code that you use frequently and should be included in your program template. + +### Resources + + * [How to program with Bash: Syntax and tools][5] + * [How to program with Bash: Logical operators and shell expansions][7] + * [How to program with Bash: Loops][8] + + + +* * * + +_This series of articles is partially based on Volume 2, Chapter 10 of David Both's three-part Linux self-study course, [Using and Administering Linux—Zero to SysAdmin][9]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/testing-bash-script + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://opensource.com/article/19/12/introduction-automation-bash-scripts +[3]: https://opensource.com/article/19/12/creating-bash-script-template +[4]: https://opensource.com/article/19/12/give-your-bash-program-some-help +[5]: https://opensource.com/article/19/10/programming-bash-syntax-tools +[6]: mailto:LinuxGeek46@both.org +[7]: https://opensource.com/article/19/10/programming-bash-logical-operators-shell-expansions +[8]: https://opensource.com/article/19/10/programming-bash-loops +[9]: http://www.both.org/?page_id=1183 From f806cb316fd19aa6c811c80ceec8252e2558048d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 22 Dec 2019 07:01:39 +0800 Subject: [PATCH 008/430] Rename sources/tech/20191220 Why We Need Interoperable Service Identity.md to sources/talk/20191220 Why We Need Interoperable Service Identity.md --- .../20191220 Why We Need Interoperable Service Identity.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20191220 Why We Need Interoperable Service Identity.md (100%) diff --git a/sources/tech/20191220 Why We Need Interoperable Service Identity.md b/sources/talk/20191220 Why We Need Interoperable Service Identity.md similarity index 100% rename from sources/tech/20191220 Why We Need Interoperable Service Identity.md rename to sources/talk/20191220 Why We Need Interoperable Service Identity.md From 3c2cfc611c292e7846cd686e2b17b7b867219279 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 22 Dec 2019 07:39:02 +0800 Subject: [PATCH 009/430] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @mayunmeiyouming 恭喜您,完成了第一篇翻译贡献! --- ... fans love about the Mate Linux desktop.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/translated/tech/20191213 What GNOME 2 fans love about the Mate Linux desktop.md b/translated/tech/20191213 What GNOME 2 fans love about the Mate Linux desktop.md index 505c16110e..46bf53162b 100644 --- a/translated/tech/20191213 What GNOME 2 fans love about the Mate Linux desktop.md +++ b/translated/tech/20191213 What GNOME 2 fans love about the Mate Linux desktop.md @@ -1,38 +1,38 @@ [#]: collector: (lujun9972) [#]: translator: (mayunmeiyouming) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (What GNOME 2 fans love about the Mate Linux desktop) [#]: via: (https://opensource.com/article/19/12/mate-linux-desktop) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -GNOME 2粉丝喜欢Mate Linux桌面的什么 +GNOME 2 粉丝喜欢 Mate Linux 桌面的什么? ====== -本文是24天Linux桌面特别系列的一部分。如果您还记得GNOME 2,那么Mate Linux桌面将满足您的怀旧的情怀。 -![Linux keys on the keyboard for a desktop computer][1] -如果你以前听过这个:当GNOME3第一次发布时,很多GNOME用户还没有准备好放弃GNOME2。[Mate] [2](以yerba mate_ plant命名)项目的开始是为了延续GNOME 2桌面,刚开始时使用GTK 2(GNOME 2所基于的工具包),然后又合并了GTK 3。由于Linux Mint的简单易用,使得桌面变得非常流行,并且从那时起,它已经普遍用于Fedora、Ubuntu、Slackware、Arch和许多其他Linux发行版上。今天,Mate继续提供一个传统的桌面环境,它的外观和感觉与GNOME 2完全一样,使用GTK 3工具包。 +> 本文是 24 天 Linux 桌面特别系列的一部分。如果你还在怀念 GNOME 2,那么 Mate Linux 桌面将满足你的怀旧情怀。 -您可以在Linux发行版的软件仓库中找到Mate,也可以下载并[安装][3]把Mate作为默认桌面的发行版。不过,在你这样做之前,请注意它是为了提供完整的桌面体验,所以许多Mate应用程序都是随桌面一起安装的。如果您运行的是不同的桌面,您可能会发现自己有多余的应用程序(两个PDF阅读器、两个媒体播放器、两个文件管理器,等等)。如果您只想尝试Mate桌面,可以在虚拟机中安装基于Mate的发行版,例如[GNOME box][4]。 +![](https://img.linux.net.cn/data/attachment/album/201912/22/073751ugrt47kye0begk3k.jpg) -### Mate桌面之旅 +如果你以前听过这个传闻:当 GNOME3 第一次发布时,很多 GNOME 用户还没有准备好放弃 GNOME 2。[Mate][2](以马黛茶yerba mate植物命名)项目的开始是为了延续 GNOME 2 桌面,刚开始时它使用 GTK 2(GNOME 2 所基于的工具包),然后又合并了 GTK 3。由于 Linux Mint 的简单易用,使得该桌面变得非常流行,并且从那时起,它已经普遍用于 Fedora、Ubuntu、Slackware、Arch 和许多其他 Linux 发行版上。今天,Mate 继续提供一个传统的桌面环境,它的外观和感觉与 GNOME 2 完全一样,使用 GTK 3 工具包。 -Mate项目不仅仅唤起了GNOME 2;它是gnome2。如果你是00年代中期Linux桌面的粉丝,至少,你会发现Mate的怀旧情怀。我不是GNOME2的粉丝,我倾向于使用KDE,但是有一个地方我无法想象没有GNOME2:[OpenSolaris][5]。OpenSolaris项目并没有持续太久,当Ian Murdock在被Oracle并入Sun Microsystems之前加入Sun Microsystems时,它变得非常突出,但我当时是一个低级的Solaris管理员,并使用OpenSolaris来教自己更多关于Unix的那种风格。这是我使用GNOME2的唯一平台(因为我一开始不知道如何更改桌面,后来才习惯),而今天的[OpenIndiana project][6]是OpenSolaris的社区延续,它通过Mate桌面使用GNOME2。 +你可以在你的 Linux 发行版的软件仓库中找到 Mate,也可以下载并[安装][3]一个把 Mate 作为默认桌面的发行版。不过,在你这样做之前,请注意为了提供完整的桌面体验,所以许多 Mate 应用程序都是随该桌面一起安装的。如果你运行的是不同的桌面,你可能会发现自己有多余的应用程序(两个 PDF 阅读器、两个媒体播放器、两个文件管理器,等等)。所以如果你只想尝试 Mate 桌面,可以在虚拟机(例如 [GNOME box][4])中安装基于 Mate 的发行版。 + +### Mate 桌面之旅 + +Mate 项目不仅仅可以让你想起来 GNOME 2;它就是 GNOME 2。如果你是 00 年代中期 Linux 桌面的粉丝,至少,你会从中感受到 Mate 的怀旧情怀。我不是 GNOME 2 的粉丝,我更倾向于使用 KDE,但是有一个地方我无法想象没有 GNOME 2:[OpenSolaris][5]。OpenSolaris 项目并没有持续太久,在 Sun Microsystems 被并入 Oracle 之前,Ian Murdock 加入 Sun 时它就显得非常突出,我当时是一个初级的 Solaris 管理员,使用 OpenSolaris 来让自己更多学会那种 Unix 风格。这是我使用过 GNOME 2 的唯一平台(因为我一开始不知道如何更改桌面,后来习惯了它),而今天的 [OpenIndiana project][6] 是 OpenSolaris 的社区延续,它通过 Mate 桌面使用 GNOME 2。 ![Mate on OpenIndiana][7] -Mate的布局由左上角的三个菜单组成:应用程序、位置和系统。应用程序菜单提供对系统上安装的所有的应用程序的启动程序的快速访问。Places菜单提供对常用位置(如主目录、网络文件夹等)的快速访问。系统菜单包含全局选项,如关级和睡眠。右上角是一个系统托盘,屏幕底部有一个任务栏和一个虚拟桌面切换栏。 +Mate 的布局由左上角的三个菜单组成:应用程序、位置和系统。应用程序菜单提供对系统上安装的所有的应用程序启动器的快速访问。位置菜单提供对常用位置(如家目录、网络文件夹等)的快速访问。系统菜单包含全局选项,如关机和睡眠。右上角是一个系统托盘,屏幕底部有一个任务栏和一个虚拟桌面切换栏。 -就桌面设计而言,它是一种稍微有点奇怪的配置。它从早期的Linux桌面、MacFinder和Windows中借用了相同的部分,但是又创建了一个独特的配置,这种配置很直观,而且很熟悉。Mate故意抵制与这个模型的偏差,这正是它的用户喜欢的地方。 +就桌面设计而言,这是一种稍微有点奇怪的配置。它从早期的 Linux 桌面、MacFinder 和 Windows 中借用了一些相同的部分,但是又创建了一个独特的配置,这种配置很直观而有些熟悉。Mate 执意保持这个模型,而这正是它的用户喜欢的地方。 -### Mate和开源 +### Mate 和开源 -Mate是一个最直接的例子,展示了开源如何使开发人员能够对抗项目生命的终结。从理论上讲,GNOME2会被GNOME3所取代,但它依然存在,因为一个开发人员建立代码的一个分支并继续进行下去。势头越来越大,更多的开发人员加入进来,并且用户喜爱的桌面比以往任何时候都更好。并不是所有的软件都有第二次机会,但是开源永远是一个机会,否则就永远没有机会。 +Mate 是一个最直接的例子,展示了开源如何使开发人员能够对抗项目生命的终结。从理论上讲,GNOME 2 会被 GNOME 3 所取代,但它依然存在,因为一个开发人员建立了该代码的一个分支并继续发展了下去。它的发展势头越来越庞大,更多的开发人员加入进来,并且这个让用户喜爱的桌面比以往任何时候都要更好。并不是所有的软件都有第二次机会,但是开源永远是一个机会,否则就永远没有机会。 -使用和支持开源意味着支持用户和开发人员的自由。而且Mate桌面是它们的努力的有力证明。 - -探索不同的桌面是一件好事。我最近将开始使用为GNOME 3 +使用和支持开源意味着支持用户和开发人员的自由。而且 Mate 桌面是他们的努力的有力证明。 -------------------------------------------------------------------------------- @@ -41,7 +41,7 @@ via: https://opensource.com/article/19/12/mate-linux-desktop 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[mayunmeiyouming](https://github.com/mayunmeiyouming) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2bf87800293d6118337ec2948b9590a96391dd70 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 22 Dec 2019 07:40:21 +0800 Subject: [PATCH 010/430] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @mayunmeiyouming 本文首发地址: https://linux.cn/article-11703-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/mayunmeiyouming 请注册以领取 LCCN: https://lctt.linux.cn/ --- ...213 What GNOME 2 fans love about the Mate Linux desktop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191213 What GNOME 2 fans love about the Mate Linux desktop.md (98%) diff --git a/translated/tech/20191213 What GNOME 2 fans love about the Mate Linux desktop.md b/published/20191213 What GNOME 2 fans love about the Mate Linux desktop.md similarity index 98% rename from translated/tech/20191213 What GNOME 2 fans love about the Mate Linux desktop.md rename to published/20191213 What GNOME 2 fans love about the Mate Linux desktop.md index 46bf53162b..61f485fc27 100644 --- a/translated/tech/20191213 What GNOME 2 fans love about the Mate Linux desktop.md +++ b/published/20191213 What GNOME 2 fans love about the Mate Linux desktop.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (mayunmeiyouming) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11703-1.html) [#]: subject: (What GNOME 2 fans love about the Mate Linux desktop) [#]: via: (https://opensource.com/article/19/12/mate-linux-desktop) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From bde0dddb67f244206c534fa33bba161234365a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sun, 22 Dec 2019 08:59:58 +0800 Subject: [PATCH 011/430] Translated --- ...d 8.1 Oreo on Linux To Run Apps - Games.md | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) rename {sources => translated}/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md (55%) diff --git a/sources/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md b/translated/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md similarity index 55% rename from sources/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md rename to translated/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md index f20d24e5cf..c8263bd9e0 100644 --- a/sources/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md +++ b/translated/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md @@ -7,144 +7,144 @@ [#]: via: (https://fosspost.org/tutorials/install-android-8-1-oreo-on-linux) [#]: author: (Python Programmer;Open Source Software Enthusiast. Worked On Developing A Lot Of Free Software. The Founder Of Foss Post;Foss Project. Computer Science Major. ) -Install Android 8.1 Oreo on Linux To Run Apps & Games +在 Linux 上安装 Android 8.1 Oreo 来运行应用程序和游戏 ====== ![](https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/android-8.1-oreo-x86-on-linux.png?resize=1237%2C527&ssl=1) -[android x86][1] is a free and an open source project to port the android system made by Google from the ARM architecture to the x86 architecture, which allow users to run the android system on their desktop machines to enjoy all android functionalities + Apps & games. +[android x86][1] 是一个自由开放源码的项目,将谷歌制作的android系统从 ARM 架构移植到 x86 架构, 运行用户在他们的桌面机器上运行 android 系统来享受所有的 android 功能和应用程序及游戏。 -The android x86 project finished porting the android 8.1 Oreo system to the x86 architecture few weeks ago. In this post, we’ll explain how to install it on your Linux system so that you can use your android apps and games any time you want. +几周前,android x86 项目完成 android 8.1 Oreo 系统到 x86 架构的移植。在这篇文章中,我们将解释如何在你的 Linux 系统上安装它,以便你能够随时使用你的 android 应用程序和游戏。 -### Installing Android x86 8.1 Oreo on Linux +### 在 Linux 上安装 Android x86 8.1 Oreo -#### Preparing the Environment +#### 准备环境 -First, let’s download the android x86 8.1 Oreo system image. You can download it from [this page][2], just click on the “View” button under the android-x86_64-8.1-r1.iso file. +首先,让我们下载 android x86 8.1 Oreo 系统镜像。你可以从[这个页面][2]下载它,只需单击 android-x86_64-8.1-r1.iso 文件下 “View” 按钮。 -We are going to use QEMU to run android x86 on our Linux system. QEMU is a very good emulator software, which is also free and open source, and is available in all the major Linux distributions repositories. +我们将在我们的 Linux 系统上使用 QEMU 来运行 android x86 。QEMU 是一个非常好的模拟器软件,它也是自由和开放源码的,并且在所有主要的 Linux 发行版存储库中都是可用的。 -To install QEMU on Ubuntu/Linux Mint/Debian: +在 Ubuntu/Linux Mint/Debian 上安装 QEMU: ``` sudo apt-get install qemu qemu-kvm libvirt-bin ``` -To install QEMU on Fedora: +在 Fedora 上安装 QEMU: ``` sudo dnf install qemu qemu-kvm ``` -For other distributions, just search for the qemu and qemu-kvm packages and install them. +对于其它发行版,只需要搜索 qemu 和 qemu-kvm 软件包,并安装它们。 -After you have installed QEMU, we’ll need to run the following command to create the android.img file, which will be like some sort of an allocated disk space just for the android system. All android files and system will be inside that image file: +在你安装 QEMU 后,我们将需要运行下面的命令来创建 android.img 文件,它就像某种分配给 android 系统的磁盘空间。所有 android 文件和系统都将位于该镜像文件中: ``` qemu-img create -f qcow2 android.img 15G ``` -Here we are saying that we want to allocate a maximum of 15GB for android, but you can change it to any size you want (make sure it’s at least bigger than 5GB). +我们在这里说,我们想为 android 分配一个最大 15GB 的磁盘空间,但是,你可以更改它到你想要的任意大小(确保它至少大于5GB)。 -Now, to start running the android system for the first time, run: +现在,首次启动运行 android 系统,运行: ``` sudo qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img -cdrom /home/mhsabbagh/android-x86_64-8.1-r1.iso ``` -Replace /home/mhsabbagh/android-x86_64-8.1-r1.iso with the path of the file that you downloaded from the android x86 website. For explaination of other options we are using here, you may refer to [this article][3]. +将 /home/mhsabbagh/android-x86_64-8.1-r1.iso 替换为你从 android x86 网站下载的文件的路径。我们在这里正在使用的其它选项的解释,你可以参考[这篇文章][3]。 -After you run the above command, the android system will start: +在你运行上面的命令后,android 系统将启动: ![Install Android 8.1 Oreo on Linux To Run Apps & Games 39 android 8.1 oreo on linux][4] -#### Installing the System +#### 安装系统 -From this window, choose “Advanced options”, which should lead to the following menu, from which you should choose “Auto_installation” as follows: +从这个窗口中,选择 “Advanced options”, 它将引导到下面的菜单,你应如下在其中选择 “Auto_installation” : ![Install Android 8.1 Oreo on Linux To Run Apps & Games 41 android 8.1 oreo on linux][5] -After that, the installer will just tell you about whether you want to continue or not, choose Yes: +在这以后,安装器将告知你是否想要继续,选择 Yes : ![Install Android 8.1 Oreo on Linux To Run Apps & Games 43 android 8.1 oreo on linux][6] -And the installation will carry on without any further instructions from you: +接下来,安装器将无需你的指示而继续进行: ![Install Android 8.1 Oreo on Linux To Run Apps & Games 45 android 8.1 oreo on linux][7] -Finally you’ll receive this message, which indicates that you have successfully installed android 8.1: +最后,你将收到这个信息,它表示你已经成功安装 android 8.1 : ![Install Android 8.1 Oreo on Linux To Run Apps & Games 47 android 8.1 oreo on linux][8] -For now, just close the QEMU window completely. +现在,完全关闭 QEMU 窗口。 -#### Booting and Using Android 8.1 Oreo +#### 启动和使用 Android 8.1 Oreo -Now that the android system is fully installed in your android.img file, you should use the following QEMU command to start it instead of the previous one: +现在,android 系统已经完全安装在你的 android.img 文件中,你应该使用下面的 QEMU 命令来启动它,而不是前面的命令: ``` sudo qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img ``` -Notice that all we did was that we just removed the -cdrom option and its argument. This is to tell QEMU that we no longer want to boot from the ISO file that we downloaded, but from the installed android system. +注意,我们所做的只是移除 -cdrom 选项和它的参数。这是告诉 QEMU ,我们不再想从我们下载的 ISO 文件启动,相反,从安装的 android 系统启动。 -You should see the android booting menu now: +你现在能够看到 android 启动菜单: ![Install Android 8.1 Oreo on Linux To Run Apps & Games 49 android 8.1 oreo on linux][9] -Then you’ll be taken to the first preparation wizard, choose your language and continue: +然后,你将带去第一个准备向导,选择你的语言并继续: ![Install Android 8.1 Oreo on Linux To Run Apps & Games 51 android 8.1 oreo on linux][10] -From here, choose the “Set up as new” option: +从这里,选择 “Set up as new” 选项: ![Install Android 8.1 Oreo on Linux To Run Apps & Games 53 android 8.1 oreo on linux][11] -Then android will ask you about if you want to login to your current Google account. This step is optional, but important so that you can use the Play Store later: +然后,android 将询问你是否想登陆到你当前的谷歌账号。这步骤是可选的,但是这很重要,以便你随后可以使用 Play Store : ![Install Android 8.1 Oreo on Linux To Run Apps & Games 55 android 8.1 oreo on linux][12] -Then you’ll need to accept the terms and conditions: +然后,你将需要接受条款: ![Install Android 8.1 Oreo on Linux To Run Apps & Games 57 android 8.1 oreo on linux][13] -Now you can choose your current timezone: +现在,你可以选择你当前的时区: ![Install Android 8.1 Oreo on Linux To Run Apps & Games 59 android 8.1 oreo on linux][14] -The system will ask you now if you want to enable any data collection features. If I were you, I’d simply turn them all off like that: +系统将询问你是否想启动一些数据收集功能。如果我是你的话,我将简单地关闭它们,像这样: ![Install Android 8.1 Oreo on Linux To Run Apps & Games 61 android 8.1 oreo on linux][15] -Finally, you’ll have 2 launcher types to choose from, I recommend that you choose the Launcher3 option and make it the default: +最后,你将有两种启动类型可供选择,我建议你选择 Launcher3 选项,并使其成为默认项: ![Install Android 8.1 Oreo on Linux To Run Apps & Games 63 android 8.1 oreo on linux][16] -Then you’ll see your fully-working android system home screen: +然后,你将看到完整工作的 android 系统主屏幕: ![Install Android 8.1 Oreo on Linux To Run Apps & Games 65 android 8.1 oreo on linux][17] -From here now, you can do all the tasks you want; You can use the built-in android apps, or you may browse the settings of your system to adjust it however you like. You may change look and feeling of your system, or you can run Chrome for example: +从现在起,你可以做你想做的任何事情;你可以使用内置的 android 应用程序,或者你可以浏览你是系统设置来根据你的喜好进行调整。你可以更改你的系统的外观和体验,或者你可以像示例一样运行 Chrome : ![Install Android 8.1 Oreo on Linux To Run Apps & Games 67 android 8.1 oreo on linux][18] -You may start installing some apps like WhatsApp and others from the Google Play store for your own use: +你可以从 Google Play store 开始安装一些应用程序程序,像 WhatsApp 和其它的应用程序,以供你自己使用: ![Install Android 8.1 Oreo on Linux To Run Apps & Games 69 android 8.1 oreo on linux][19] -You can now do whatever you want with your system. Congratulations! +你现在可以用你的系统做任何你想做的事。恭喜! -### How to Easily Run Android 8.1 Oreo Later +### 以后如何轻松地运行 Android 8.1 Oreo -We don’t want to always have to open the terminal window and write that long QEMU command to run the android system, but we want to run it in just 1 click whenever we need that. +我们不想总是不得不打开终端窗口,并写那些长长的 QEMU 命令来运行 android 系统,相反,我们想在我们需要时一次单击就运行它。 -To do this, we’ll create a new file under /usr/share/applications called android.desktop with the following command: +为此,我们将使用下面的命令在 /usr/share/applications 下创建一个名为 android.desktop 的新文件: ``` sudo nano /usr/share/applications/android.desktop ``` -And paste the following contents inside it (Right click and then paste): +并在其中粘贴下面的内容(右键单击然后粘贴): ``` [Desktop Entry] @@ -158,19 +158,19 @@ StartupNotify=true Categories=GTK; ``` -Again, you have to replace /home/mhsabbagh/android.img with the path to the local image on your system. Then save the file (Ctrl + X, then press Y, then Enter). +再强调一次,你必需使用你系统上的本地镜像路径来替换 /home/mhsabbagh/android.img 。然后保存文件 (Ctrl + X ,然后按 Y ,然后按 Enter)。 -Notice that we needed to use “pkexec” to run QEMU with root privileges because starting from newer versions, accessing to the KVM technology via libvirt is not allowed for normal users; That’s why it will ask you for the root password each time. +注意,我们需要使用 “pkexec” 来使用 root 权限运行 QEMU ,因为从较新的版本开始,普通用户不允许通过 libvirt 访问 KVM 技术;这就是为什么它将每次要求你输入 root 密码的原因。 -Now, you’ll see the android icon in the applications menu all the time, you can simply click it any time you want to use android and the QEMU program will start: +现在,你将在应用程序菜单中看到 android 图标,你可以在你想使用 android 的任何时间来简单地单击图标,QEMU 程序将启动: ![Install Android 8.1 Oreo on Linux To Run Apps & Games 71 android 8.1 oreo on linux][20] -### Conclusion +### 总结 -We showed you how install and run android 8.1 Oreo on your Linux system. From now on, it should be much easier on you to do your android-based tasks without some other software like Blutsticks and similar methods. Here, you have a fully-working and functional android system that you can manipulate however you like, and if anything goes wrong, you can simply nuke the image file and run the installation all over again any time you want. +我们向你展示如何你的 Linux 系统上安装和运行 android 8.1 Oreo 。从现在起,在没有其它一些软件的(像 Blutsticks 和类似的方法)的情况下,你应该更容易地完成基于 android 的任务。在这里,你有一个完整工作和功能的 android 系统,你可以随心所欲地操作它,如果一些东西出差,你可以简单地核弹攻击镜像文件,然后随时再一次重新运行安装程序。 -Have you tried android x86 before? How was your experience with it? +你之前尝试过 android x86 吗?你的经验如何? -------------------------------------------------------------------------------- @@ -179,7 +179,7 @@ via: https://fosspost.org/tutorials/install-android-8-1-oreo-on-linux 作者:[Python Programmer;Open Source Software Enthusiast. Worked On Developing A Lot Of Free Software. The Founder Of Foss Post;Foss Project. Computer Science Major.][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[robsean](https://github.com/robsean) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d8fd8662c3c0a363f44ccf10f34edb1fc7d5cb4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sun, 22 Dec 2019 09:24:53 +0800 Subject: [PATCH 012/430] Translating --- ...ow to Update Grub on Ubuntu and Other Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md b/sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md index a969c37867..870ec17f6b 100644 --- a/sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2f1bd3e4930ba5f8704dbae50a399f5cd3c9f1db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sun, 22 Dec 2019 09:28:15 +0800 Subject: [PATCH 013/430] Translating --- ...to create an e-book chapter template in LibreOffice Writer.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md b/sources/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md index 8c6a5c8072..0d8bfed9ce 100644 --- a/sources/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md +++ b/sources/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md @@ -1,3 +1,4 @@ +Translating by robsean How to create an e-book chapter template in LibreOffice Writer ====== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_colorbooks.png?itok=vNhsYYyC) From c27980860e02ca99ae0af14516efa27ffaa4601b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 22 Dec 2019 23:41:28 +0800 Subject: [PATCH 014/430] Rename sources/tech/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md to sources/news/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md --- ...elopment, a database of microbes, and more open source news.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md (100%) diff --git a/sources/tech/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md b/sources/news/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md similarity index 100% rename from sources/tech/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md rename to sources/news/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md From 2aa7619083b4faabc9a878a11cff8d58b959c8b4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 23 Dec 2019 00:52:40 +0800 Subject: [PATCH 015/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191222=20Create?= =?UTF-8?q?=20a=20unique=20Linux=20experience=20with=20the=20Unix=20Deskto?= =?UTF-8?q?p=20Environment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191222 Create a unique Linux experience with the Unix Desktop Environment.md --- ...ience with the Unix Desktop Environment.md | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 sources/tech/20191222 Create a unique Linux experience with the Unix Desktop Environment.md diff --git a/sources/tech/20191222 Create a unique Linux experience with the Unix Desktop Environment.md b/sources/tech/20191222 Create a unique Linux experience with the Unix Desktop Environment.md new file mode 100644 index 0000000000..bf82680c8b --- /dev/null +++ b/sources/tech/20191222 Create a unique Linux experience with the Unix Desktop Environment.md @@ -0,0 +1,179 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create a unique Linux experience with the Unix Desktop Environment) +[#]: via: (https://opensource.com/article/19/12/linux-unix-desktop-environment-ude) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Create a unique Linux experience with the Unix Desktop Environment +====== +This article is part of a special series of 24 days of Linux desktops. +If you're in the mood for something completely unique, then UDE is the +desktop you need to try. +![Penguins][1] + +When the UDE project started in 1996, the developers took on a bold name—[Unix Desktop Environment (UDE)][2]—and held high hopes of reinventing what a desktop could be. They weren't just trying to redefine Unix desktops; they were trying to change the way users interacted with applications on their system. Windows 95 had just come out, so the idea of managing a make-believe "desktop" filled with "folders" and "windows" meant to mimic a real-world desktop had not won all computer users' mindshare (it still hasn't, but it does at least seem to be a reliably stable option now). There was still room for experimentation in computer user interfaces (UIs), and the UDE project introduced some truly innovative ideas. + +One of UDE's most intriguing concepts is that its windows have no title bars or handles. All window control is performed with a hex menu that appears when a window border is clicked. Windows are moved with a middle-click and resized with a right-click. + +![Unix Desktop Environment][3] + +If you're in the mood for something completely unique, then UDE is the desktop you need to try. + +### Installing UDE + +Your distribution probably doesn't have UDE in its software repository, but it's relatively easy to compile for someone who's used to building software from raw source code. + +I installed UDE on Slackware 14.2, but it doesn't rely on any libraries other than standard Xlibs, so it should work on any Linux or BSD system. The compile process requires build tools, which ship by default on Slackware but are often omitted on other distributions to save space on the initial download. The names of the packages you must install to build from source code vary depending on your distro, so refer to the documentation for specifics. For example, on Debian-based distributions, you can learn about build requirements in [Debian's BuildingTutorial][4] doc, and on Fedora-based distributions, refer to [Fedora's Installing software from source][5] doc. Once you have the build tools installed, you can build UDE the standard [GNU Automake][6] way: + + +``` +$ ./configure +$ make -j2 +$ sudo make install +``` + +The default location for installation is **/usr/local**, but you can adjust the paths during the configuration step. + +### Xinitrc and UDE + +The easiest way to get up and running with UDE is to let Xorg do the bulk of the work. First, you must create a **$HOME/.xinitrc** file. I adapted this from scripts bundled in Slackware: + + +``` +#!/bin/sh +# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $ + +userresources=$HOME/.Xresources +usermodmap=$HOME/.Xmodmap +sysresources=/etc/X11/xinit/.Xresources +sysmodmap=/etc/X11/xinit/.Xmodmap + +# merge in defaults and keymaps + +if [ -f $sysresources ]; then +    xrdb -merge $sysresources +fi + +if [ -f $sysmodmap ]; then +    xmodmap $sysmodmap +fi + +if [ -f $userresources ]; then +    xrdb -merge $userresources +fi + +if [ -f $usermodmap ]; then +    xmodmap $usermodmap +fi + +# window manager +exec /usr/local/bin/uwm +``` + +According to this file, the default action for the **startx** command is to launch the **uwm** window manager (which houses UDE). However, your distribution may have other ideas about what happens when your graphic server is launched (or killed to be restarted), so this file may do you little good. On many distributions, you can add a **.desktop** file to **/usr/share/xsessions** to have it listed in the GDM or KDM menu, so create a file called **uwm.desktop** and enter this text: + + +``` +[Desktop Entry] +Name=UDE +Comment=UNIX Desktop Environment +Exec=/usr/local/bin/uwm +Type=Application +``` + +Log out from your desktop session and log back into UDE. By default, your session manager (KDM, GDM, or LightDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging in. + +With GDM: + +![][7] + +With SDDM: + +![][8] + +#### Launching with brute force + +If UDE fails to start, try installing XDM, a lightweight session manager that doesn't look at **/usr/share/xsessions** and instead just does whatever the authenticated user's **.xinitrc** prescribes. + +### Desktop tour + +When UDE first launches, you may find yourself staring at a black screen. That's the default primary desktop for UDE, and it's blank because no background wallpaper has been set. You can set one for yourself with the **feh** command (you may need to install it from your repository). This command has a few options for setting the background, including **\--bg-fill** to fill the screen with your wallpaper of choice, **\--bg-scale** to scale it to fit, and so on. + + +``` +`$ feh --bg-fill ~/Pictures/wallpapers/mybackground.jpg` +``` + +### Interacting with the desktop + +The next task is to launch an application. UDE provides an application menu, which you can bring up at your mouse pointer's position with a right-click on the desktop. Because you haven't customized the menu yet, your best bet is to launch an **xterm** window so that you can issue arbitrary commands. + +Once you have an xterm window open, you might notice that there's no window decoration. This is the central idea behind UDE: windows are manipulated primarily with a "honeycomb" or hex menu that appears when you left-click on the border of any window. + +![UDE honeycomb menu][9] + +Clockwise from the top hex, the options are: + + * Close + * Kill (confirm by selecting the pop-up hex that appears upon mouseover) + * Make sticky or send to a different desktop + * Maximize + * Send behind other windows + * Minimize + + + +Most of them are self-explanatory, but the minimize option can be confusing because there's no place for windows to be minimized _to_ because there's no taskbar, no docklet, and no desktop icons. To retrieve a minimized window, middle-click on the desktop. + +![UDE middle-click menu][10] + +This presents a menu of virtual desktops, one of which is your current desktop and therefore contains even your minimized applications. Select the minimized application to restore it to your screen. + +### Menus and configuration + +There are example and default config files in **/usr/local/share/uwm/config**, including one for the right-click application menu configuration. The syntax for the menu is simple and well-documented at the top of the file. This code sample changes the browser option from Netscape to Firefox: + + +``` +LINE; +% ITEM "Netscape":"netscape"; +ITEM "Firefox":"firefox"; +LINE; +``` + +To see your changes, restart UDE from the left-click menu. The **uwmrc** configuration files dictate the layout of UDE, including the size of window borders, fonts, and other stylistic choices. They are + +also well-documented in comments, so look through them and make changes to experiment and find what works best for you. + +### Old innovations, new again + +UDE's interface is strange and new and—if you're intrigued by UI design—very exciting. UDE's design exemplifies the advantages and disadvantages of creating standards in computing. On the one hand, something like UDE is so alien to most users that it's bound to get in the way, yet on the other hand, it's fresh and different and forces users to re-evaluate their workflows, which may result in several unexpected improvements. The reaction you probably have when trying UDE is the same one you're likely to see when you introduce a friend to Linux: What's an old, familiar GNOME or KDE desktop to you is a puzzle to them. But deep down, most of us know the potential benefits of changing the way we look at something we take for granted. + +That said, UDE is unquestionably an experiment, not a finished project. It probably isn't going to be your primary desktop, but it's well worth exploring. This is innovation. It's sometimes messy, sometimes slow, sometimes tumultuous. But it's important, bold, and a heck of a lot of fun. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/linux-unix-desktop-environment-ude + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux-penguins.png?itok=yKOpaJM_ (Penguins) +[2]: http://udeproject.sourceforge.net/ +[3]: https://opensource.com/sites/default/files/uploads/advent-ude.jpg (Unix Desktop Environment) +[4]: https://wiki.debian.org/BuildingTutorial +[5]: https://docs.pagure.org/docs-fedora/installing-software-from-source.html +[6]: https://opensource.com/article/19/7/introduction-gnu-autotools +[7]: https://opensource.com/sites/default/files/advent-gdm_2.jpg +[8]: https://opensource.com/sites/default/files/advent-kdm_1.jpg +[9]: https://opensource.com/sites/default/files/uploads/advent-ude-hex.jpg (UDE honeycomb menu) +[10]: https://opensource.com/sites/default/files/uploads/advent-ude-middle.jpg (UDE middle-click menu) From 3f75faa782a35c7f7bb450a65b110e2619326081 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 23 Dec 2019 00:53:08 +0800 Subject: [PATCH 016/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191222=20Why=20?= =?UTF-8?q?your=20Python=20code=20needs=20to=20be=20beautiful=20and=20expl?= =?UTF-8?q?icit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md --- ...code needs to be beautiful and explicit.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md diff --git a/sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md b/sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md new file mode 100644 index 0000000000..00417f38ef --- /dev/null +++ b/sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why your Python code needs to be beautiful and explicit) +[#]: via: (https://opensource.com/article/19/12/zen-python-beauty-clarity) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Why your Python code needs to be beautiful and explicit +====== +Welcome to Pythonukkah, a special series about the Zen of Python. On the +first day, we celebrate the first two principles: beauty and +explicitness. +![Searching for code][1] + +Python contributor Tim Peters introduced us to the [Zen of Python][2] in 1999. Twenty years later, its 19 guiding principles continue to be relevant within the community. We start our Pythonukkah celebration—like Hanukkah, a festival of lights—with the first two principles in the Zen of Python: on beauty and explicitness. + +> "Hanukkah is the Festival of Lights, +> Instead of one day of presents, we get eight crazy nights." +> —Adam Sandler, [_The Hanukkah Song_][3] + +### Beautiful is better than ugly. + +It was in _[Structure and Interpretation of Computer Programs][4]_ (_SICP_) that the point was made: "Programs must be written for people to read and only incidentally for machines to execute." Machines do not care about beauty, but people do. + +A beautiful program is one that is enjoyable to read. This means first that it is consistent. Tools like [Black][5], [flake8][6], and [Pylint][7] are great for making sure things are reasonable on a surface layer. + +But even more important, only humans can judge what humans find beautiful. Code reviews and a collaborative approach to writing code are the only realistic way to build beautiful code. Listening to other people is an important skill in software development. + +Finally, all the tools and processes are moot if the _will_ is not there. Without an appreciation for the importance of beauty, there will never be an emphasis on writing beautiful code. + +This is why this is the first principle: it is a way of making "beauty" a value in the Python community. It immediately answers: "Do we _really_ care about beauty?" We do. + +### Explicit is better than implicit. + +We humans celebrate light and fear the dark. Light helps us make sense of vague images. In the same way, programming with more explicitness helps us make sense of abstract ideas. It is often tempting to make things implicit. + +"Why is **self** explicitly there as the first parameter of methods?" + +There are many technical explanations, but all of them are wrong. It is almost a Python programmer's rite of passage to write a metaclass that makes explicitly listing **self** unnecessary. (If you have never done this before, do so; it makes a great metaclass learning exercise!) + +The reason **self** is explicit is not because the Python core developers did not want to make a metaclass like that the "default" metaclass. The reason it is explicit is because there is one less special case to teach: the first argument is _explicit_. + +Even when Python does allow non-explicit things, such as context variables, we must always ask: Are we sure we need them? Could we not just pass arguments explicitly? Sometimes, for many reasons, this is not feasible. But prioritizing explicitness means, at the least, asking the question and estimating the effort. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-beauty-clarity + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_python_programming.png?itok=ynSL8XRV (Searching for code) +[2]: https://www.python.org/dev/peps/pep-0020/ +[3]: https://en.wikipedia.org/wiki/The_Chanukah_Song +[4]: https://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Computer_Programs +[5]: https://opensource.com/article/19/5/python-black +[6]: https://opensource.com/article/19/5/python-flake8 +[7]: https://opensource.com/article/19/10/python-pylint-introduction From a206cbd5b233c902089fb2fa8e2ebe0883545bc0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Dec 2019 06:24:44 +0800 Subject: [PATCH 017/430] PRF @Valoniakim --- ... to overcome cultural communication challenges.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/translated/talk/20181018 Think global- How to overcome cultural communication challenges.md b/translated/talk/20181018 Think global- How to overcome cultural communication challenges.md index 2e6ef612b5..5b214ec331 100644 --- a/translated/talk/20181018 Think global- How to overcome cultural communication challenges.md +++ b/translated/talk/20181018 Think global- How to overcome cultural communication challenges.md @@ -1,11 +1,13 @@ 全球化思考:怎样克服交流中的文化差异 ====== -这有一些建议帮助你的全球化开发团队能够更好地理解你们的讨论并能参与其中。 + +> 这有一些建议帮助你的全球化开发团队能够更好地理解你们的讨论并能参与其中。 + ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/people_remote_teams_world.png?itok=_9DCHEel) 几周前,我见证了两位同事之间一次有趣的互动,他们分别是 Jason,我们的一位美国员工,和 Raj,一位来自印度的访问工作人员。 -Raj 在印度时,他一般会通过电话参加美国中部时间上午 9 点的每日立会,现在他到美国工作了,就可以和组员们坐在同一间会议室里开会了。Jason 拦下了 Raj,说:“ Raj 你要去哪?你不是一直和我们开电话会议吗?你突然出现在会议室里我还不太适应。” Raj 听了说,“是这样吗?没问题。”就回到自己工位前准备和以前一样参加电话会议了。 +Raj 在印度时,他一般会通过电话参加美国中部时间上午 9 点的每日立会,现在他到美国工作了,就可以和组员们坐在同一间会议室里开会了。Jason 拦下了 Raj,说:“Raj 你要去哪?你不是一直和我们开电话会议吗?你突然出现在会议室里我还不太适应。” Raj 听了说,“是这样吗?没问题。”就回到自己工位前准备和以前一样参加电话会议了。 我去找 Raj,问他为什么不去参加每日立会,Raj 说 Jason 让自己给组员们打电话参会,而与此同时,Jason 也在会议室等着 Raj 来参加立会。 @@ -19,7 +21,7 @@ Jason 明显是在开玩笑,但 Raj 把它当真了。这就是在两人互相 现在是全球化时代,我们的同事很可能不跟我们面对面接触,甚至不在同一座城市,来自不同的国家。越来越多的技术公司拥有全球化的工作场所,和来自世界各地的员工,他们有着不同的背景和经历。这种多样性使得技术公司能够在这个快速发展的科技大环境下拥有更强的竞争力。 -但是这种地域的多样性也会给团队带来挑战。管理和维持团高性能的团队发展对于同地协作的团队来说就有着很大难度,对于有着多样背景成员的全球化团队来说,无疑更加困难。成员之间的交流会发生延迟,误解时有发生,成员之间甚至会互相怀疑,这些都会影响着公司的成功。 +但是这种地域的多样性也会给团队带来挑战。管理和维持高性能的团队发展对于同地协作的团队来说就有着很大难度,对于有着多样背景成员的全球化团队来说,无疑更加困难。成员之间的交流会发生延迟,误解时有发生,成员之间甚至会互相怀疑,这些都会影响着公司的成功。 到底是什么因素让全球化交流间发生误解呢?我们可以参照 Erin Meyer 的书《[文化地图][2]》,她在书中将全球文化分为八个类型,其中美国文化被分为低语境文化,与之相对的,日本为高语境文化。 @@ -71,7 +73,7 @@ Jason 明显是在开玩笑,但 Raj 把它当真了。这就是在两人互相 保持长久关系最好的方法是和你的组员们单独见面。如果你的公司可以报销这些费用,那么努力去和组员们见面吧。和一起工作了很长时间的组员们见面能够使你们的关系更加坚固。我所在的公司就有着周期性交换员工的传统,每隔一段时间,世界各地的员工就会来到美国工作,美国员工再到其他分部工作。 -另一种聚齐组员们的机会的研讨会。研讨会创造的不仅是学习和培训的机会,你还可以挤出一些时间和组员们培养感情。 +另一种聚齐组员们的机会是研讨会。研讨会创造的不仅是学习和培训的机会,你还可以挤出一些时间和组员们培养感情。 在如今,全球化经济不断发展,拥有来自不同国家和地区的员工对维持一个公司的竞争力来说越来越重要。即使组员们来自世界各地,团队中会出现一些交流问题,但拥有一支国际化的高绩效团队不是问题。如果你在工作中有什么促进团队交流的小窍门,请在评论中告诉我们吧。 @@ -83,7 +85,7 @@ via: https://opensource.com/article/18/10/think-global-communication-challenges 作者:[Avindra Fernando][a] 选题:[lujun9972][b] 译者:[Valoniakim](https://github.com/Valoniakim) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e86057173a0c0ecd1944b2218c182ac9763f6172 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Dec 2019 06:25:17 +0800 Subject: [PATCH 018/430] PUB @Valoniakim https://linux.cn/article-11705-1.html --- ...k global- How to overcome cultural communication challenges.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20181018 Think global- How to overcome cultural communication challenges.md (100%) diff --git a/translated/talk/20181018 Think global- How to overcome cultural communication challenges.md b/published/20181018 Think global- How to overcome cultural communication challenges.md similarity index 100% rename from translated/talk/20181018 Think global- How to overcome cultural communication challenges.md rename to published/20181018 Think global- How to overcome cultural communication challenges.md From e8d5c030448e19454e928d6c518cf5b8417324f8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Dec 2019 07:07:35 +0800 Subject: [PATCH 019/430] PRF @geekpi --- ...rted with Lumina for your Linux desktop.md | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/translated/tech/20191214 Get started with Lumina for your Linux desktop.md b/translated/tech/20191214 Get started with Lumina for your Linux desktop.md index d1520e3b5c..f43acfac03 100644 --- a/translated/tech/20191214 Get started with Lumina for your Linux desktop.md +++ b/translated/tech/20191214 Get started with Lumina for your Linux desktop.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Get started with Lumina for your Linux desktop) @@ -9,12 +9,14 @@ 在 Linux 桌面中开始使用 Lumina ====== -本文是 24 天 Linux 桌面特别系列的一部分。Lumina 是快速、合理的基于 Fluxbox 的快捷方式桌面,它具有你无法缺少的所有功能。 -![Lightbulb][1] -多年来,有一个基于 FreeBSD 的桌面操作系统(OS),称为 PC-BSD。它旨在作为一般使用的系统,因此值得注意,因为 BSD 主要用于服务器。大多数时候,PC-BSD 默认带 KDE 桌面,但是 KDE 越来越依赖于 Linux 特定的技术,因此有越来越多的 PC-BSD 从中迁移出来。PC-BSD 变成了 [Trident][2],它的默认桌面是 [Lumina][3],它是一组小部件,它们使用与 KDE 相同的基于 Qt 的工具箱,运行在 Fluxbox 窗口管理器中。 +> 本文是 24 天 Linux 桌面特别系列的一部分。Lumina 桌面是让你使用快速、合理的基于 Fluxbox 桌面的捷径,它具有你无法缺少的所有功能。 -你可以在 Linux 发行版的软件仓库或 BSD 的 port 树中找到 Lumina 桌面。如果你安装了 Lumina 并且已经在运行另一个桌面,那么你可能会发现有冗余的应用(两个 PDF 阅读器、两个文件管理器,等等),因为 Lumina 包含一些集成的应用。如果你只想尝试 Lumina 桌面,那么可以在虚拟机如 [GNOME Boxes][4] 中安装基于 Lumina 的 BSD 发行版。 +![](https://img.linux.net.cn/data/attachment/album/201912/23/070658vtgg3wkrpg5g36rs.jpg) + +多年来,有一个名为 PC-BSD 的基于 FreeBSD 的桌面操作系统(OS)。它旨在作为一个常规使用的系统,因此值得注意,因为 BSD 主要用于服务器。大多数时候,PC-BSD 默认带 KDE 桌面,但是 KDE 越来越依赖于 Linux 特定的技术,因此 PC-BSD 越来越从 KDE 迁离。PC-BSD 变成了 [Trident][2],它的默认桌面是 [Lumina][3],它是一组小部件,它们使用与 KDE 相同的基于 Qt 的工具包,运行在 Fluxbox 窗口管理器上。 + +你可以在 Linux 发行版的软件仓库或 BSD 的 ports 树中找到 Lumina 桌面。如果你安装了 Lumina 并且已经在运行另一个桌面,那么你可能会发现有冗余的应用(两个 PDF 阅读器、两个文件管理器,等等),因为 Lumina 包含一些集成的应用。如果你只想尝试 Lumina 桌面,那么可以在虚拟机如 [GNOME Boxes][4] 中安装基于 Lumina 的 BSD 发行版。 如果在当前的操作系统上安装 Lumina,那么必须注销当前的桌面会话,才能登录到新的会话。默认情况下,会话管理器(SDDM、GDM、LightDM 或 XDM,取决于你的设置)将继续登录到以前的桌面,因此你必须在登录之前覆盖该桌面。 @@ -34,13 +36,13 @@ Lumina 提供了一个简单而轻巧的桌面环境。屏幕底部有一个面 ![Lumina desktop running on Project Trident][7] -Lumina 与几个 Linux 轻量级桌面非常相似,尤其是 LXQT,不同之处在于 Lumina 完全不依赖于基于 Linux 的桌面框架,例如 ConsoleKit、PolicyKit、D-Bus 或 systemd。对于你而言,这是否具有优势取决于所运行的操作系统。毕竟,如果你运行的是可以访问这些功能的 Linux,那么使用不使用这些特性的桌面可能就没有多大意义,还会减少功能。如果你运行的是 BSD,那么在 Fluxbox 中运行 Lumina 部件意味着你不必从 port 安装 Linux 兼容库。 +Lumina 与几个 Linux 轻量级桌面非常相似,尤其是 LXQT,不同之处在于 Lumina 完全不依赖于基于 Linux 的桌面框架(例如 ConsoleKit、PolicyKit、D-Bus 或 systemd)。对于你而言,这是否具有优势取决于所运行的操作系统。毕竟,如果你运行的是可以访问这些功能的 Linux,那么使用不使用这些特性的桌面可能就没有多大意义,还会减少功能。如果你运行的是 BSD,那么在 Fluxbox 中运行 Lumina 部件意味着你不必从 ports 安装 Linux 兼容库。 ### 为什么要使用 Lumina -Lumina 设计简单,没有很多功能,你无法通过安装 Fluxbox 以及自己喜欢的组件来实现([PCManFM][8] 用于文件管理、各种 [LXQt 应用][9 ]、[Tint2][10] 面板等)。但它是开源的,开源用户喜欢寻找避免重复发明轮子的方法(几乎与我们喜欢重新发明轮子一样多)。 +Lumina 设计简单,它没有很多功能,但是你可以安装 Fluxbox 你喜欢的组件(用于文件管理的 [PCManFM][8]、各种 [LXQt 应用][9]、[Tint2][10] 面板等)。在开源中,开源用户喜欢寻找不要重复发明轮子的方法(几乎与我们喜欢重新发明轮子一样多)。 -Lumina 桌面是快速而合理的基于 Fluxbox 的桌面快捷方式,它具有你无法缺少的所有功能,并且你很少需要调整细节。试一试 Lumina 桌面,看看它是否适合你。 +Lumina 桌面是让你使用快速、合理的基于 Fluxbox 桌面的捷径,它具有你无法缺少的所有功能,并且你很少需要调整细节。试一试 Lumina 桌面,看看它是否适合你。 -------------------------------------------------------------------------------- @@ -49,7 +51,7 @@ via: https://opensource.com/article/19/12/linux-lumina-desktop 作者:[Seth Kenlon][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 1c58ef8e95498ab5b3c0c5cde4dce724ceb610f4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Dec 2019 07:09:09 +0800 Subject: [PATCH 020/430] PUB @geekpi https://linux.cn/article-11706-1.html --- ...20191214 Get started with Lumina for your Linux desktop.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191214 Get started with Lumina for your Linux desktop.md (98%) diff --git a/translated/tech/20191214 Get started with Lumina for your Linux desktop.md b/published/20191214 Get started with Lumina for your Linux desktop.md similarity index 98% rename from translated/tech/20191214 Get started with Lumina for your Linux desktop.md rename to published/20191214 Get started with Lumina for your Linux desktop.md index f43acfac03..213e4eff5b 100644 --- a/translated/tech/20191214 Get started with Lumina for your Linux desktop.md +++ b/published/20191214 Get started with Lumina for your Linux desktop.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11706-1.html) [#]: subject: (Get started with Lumina for your Linux desktop) [#]: via: (https://opensource.com/article/19/12/linux-lumina-desktop) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From e9ce568296f6a1b430e2c137ee092baeb919f807 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 23 Dec 2019 08:55:00 +0800 Subject: [PATCH 021/430] translated --- ... Customize your Linux desktop with FVWM.md | 78 ------------------- ... Customize your Linux desktop with FVWM.md | 75 ++++++++++++++++++ 2 files changed, 75 insertions(+), 78 deletions(-) delete mode 100644 sources/tech/20191210 Customize your Linux desktop with FVWM.md create mode 100644 translated/tech/20191210 Customize your Linux desktop with FVWM.md diff --git a/sources/tech/20191210 Customize your Linux desktop with FVWM.md b/sources/tech/20191210 Customize your Linux desktop with FVWM.md deleted file mode 100644 index f238fdc121..0000000000 --- a/sources/tech/20191210 Customize your Linux desktop with FVWM.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Customize your Linux desktop with FVWM) -[#]: via: (https://opensource.com/article/19/12/fvwm-linux-desktop) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Customize your Linux desktop with FVWM -====== -This article is part of a special series of 24 days of Linux desktops. -If you're looking for a lightweight, fast, and simple Linux window -manager, FVWM qualifies. But if you're looking for something to dig -into, explore, and hack, then FVWM is a must. -![Coding on a computer][1] - -The [FVWM][2] window manager started out as modifications to [TWM][3], back in 1993. After several years of iteration, what emerged is an extremely customizable environment where any behavior, action, or event is configurable. It has support for custom key bindings, mouse gestures, theming, scripting, and much more. - -While FVWM is usable immediately after installation, its default distribution provides only the absolute minimum configuration. It's a great foundation to start your own custom desktop environment, but if you just want to use it as a desktop, then you probably want to install a full configuration distributed by another user. There are a few different distributions of FVWM, including FVWM95, which mimics Windows 95 (at least in appearance and layout). I tried [FVWM-Crystal][4], a modern-looking theme with some common Linux desktop conventions. - -Install the FVWM distribution you want to try from your Linux distribution's software repository. If you can't find a specific FVWM distribution, it's safe to install the base FVWM2 package and then go to [Box-Look.org][5] to download a theme package manually. It's a little more work that way, but not nearly as much as building your own workspace from scratch. - -After installing, log out of your current desktop session so you can log into FVWM. By default, your session manager (KDM, GDM, LightDM, or XDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging in. - -To do so with GDM: - -![Select your desktop session in GDM][6] - -And with KDM: - -![Select your desktop session with KDM][7] - -### FVWM desktop - -Regardless of what theme and configuration you're using, FVWM, at minimum, provides a menu when you left-click on the desktop. The contents of this menu vary depending on what you've installed. The menu in the FVWM-Crystal distribution contains quick access to common preferences, such as screen resolution, wallpaper settings, window decorations, and so on. - -As with pretty much everything in FVWM, the menu can be edited to include whatever you want, but FVWM-Crystal favors the application menu bar. The application menu is located at the top-left of the screen, and each icon contains a menu of related application launchers. For example, the GIMP icon reveals image editors, the KDevelop icon reveals integrated development environments (IDEs), the GNU icon reveals text editors, and so on, depending on what you have installed on your system. - -![FVWM-crystal running on Slackware 14.2][8] - -FVWM-Crystal also provides virtual desktops, a taskbar, a clock, and an application bar. - -For your background, you can use the wallpapers bundled with FVWM-Crystal or set your own with the **feh** command (you may need to install it from your repository). This command has a few options for setting the background, including **\--bg-scale** to fill the screen with a scaled version of your wallpaper of choice, **\--bg-fill** to fill the screen without adjusting the size of the image, and so on. - - -``` -`$ feh --bg-scale ~/Pictures/wallpapers/mybackground.jpg` -``` - -Most configuration files are contained in **$HOME/.fvwm-crystal**, with some systemwide defaults located in **/usr/share/fvwm-crystal**. - -### Do it yourself - -FVWM is as much a desktop-building platform as it is a window manager. It doesn't do anything for you, and it expects you to configure anything—and possibly everything. -If you're looking for a lightweight, fast, and simple window manager, FVWM qualifies. But if you're looking for something to dig into, explore, and hack, then FVWM is a must. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/fvwm-linux-desktop - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) -[2]: http://www.fvwm.org/ -[3]: https://en.wikipedia.org/wiki/Twm -[4]: https://www.box-look.org/p/1018270/ -[5]: http://box-look.org -[6]: https://opensource.com/sites/default/files/advent-gdm_0.jpg (Select your desktop session in GDM) -[7]: https://opensource.com/sites/default/files/advent-kdm.jpg (Select your desktop session with KDM) -[8]: https://opensource.com/sites/default/files/advent-fvwm-crystal.jpg (FVWM-crystal running on Slackware 14.2) diff --git a/translated/tech/20191210 Customize your Linux desktop with FVWM.md b/translated/tech/20191210 Customize your Linux desktop with FVWM.md new file mode 100644 index 0000000000..90d2fa7604 --- /dev/null +++ b/translated/tech/20191210 Customize your Linux desktop with FVWM.md @@ -0,0 +1,75 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Customize your Linux desktop with FVWM) +[#]: via: (https://opensource.com/article/19/12/fvwm-linux-desktop) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +使用 FVWM 自定义 Linux 桌面 +====== +本文是 24 天 Linux 桌面特别系列的一部分。如果你正在寻找轻巧,快速且简单的 Linux 窗口管理器,那么 FVWM 可以胜任。但是,如果你正在寻找可以深入,探索和破解,那么 FVWM 是必须的。 +![Coding on a computer][1] + +[FVWM][2] 窗口管理器最早是对早在 1993 年的 [TWM][3] 的修改。经过几年的迭代,出现了一个可高度自定义的环境,它可以配置任何行为、动作或事件。它支持自定义键绑定、鼠标手势、主题、脚本等。 + +尽管 FVWM 在安装后即可使用,但默认发行版仅提供最小的配置。这是开始自定义桌面环境的良好基础,但是,如果你只想将其用作桌面,那么可能要安装另一个用户发布的完整配置。FVWM 有几种不同的发行版,包括模仿 Windows 95 的 FVWM95(至少在外观和布局上)。我尝试了 [FVWM-Crystal][4],这是一个具有一些现代 Linux 桌面约定的现代主题。 + +从 Linux 发行版的软件仓库中安装要尝试的 FVWM 发行版。如果找不到特定的 FVWM 发行版,那么可以安装基础的 FVWM2 包,然后进入 [Box-Look.org][5] 手动下载主题包。这样就需要更多的工作,但比从头开始构建要少。 + +安装后,请注销当前的桌面会话,以便你可以登录 FVWM。默认情况下,会话管理器(KDM、GDM、LightDM 或 XDM,取决于你的设置)将继续登录到以前的桌面,因此你必须在登录之前覆盖该桌面。 + +对于 GDM: + +![Select your desktop session in GDM][6] + +对于 KDM: + +![Select your desktop session with KDM][7] + +### FVWM 桌面 + +无论你使用什么主题和配置,当你在桌面上单击鼠标左键时,FVWM 至少会显示一个菜单。菜单的内容取决于你所安装的。FVWM-Crystal 分发中的菜单包含对常用首选项的快速访问,例如屏幕分辨率、壁纸设置、窗口装饰等。 + +与 FVWM 中的几乎所有东西一样,你可以在菜单中编辑你要想的内容,但 FVWM-Crystal 倾向应用菜单栏。应用菜单位于屏幕的左上角,每个图标都包含相关应用启动器的菜单。例如,GIMP 图标表示图像编辑器,KDevelop 图标表示集成开发环境(IDE),GNU 图标表示文本编辑器,等等,具体取决于你在系统上安装的程序。 + +![FVWM-crystal running on Slackware 14.2][8] + +FVWM-Crystal 还提供虚拟桌面、任务栏、时钟和应用栏。 + +关于背景,你可以使用与 FVWM-Crystal 捆绑在一起的壁纸,也可以使用 **feh** 命令设置自己的壁纸(你可能需要从仓库中安装它)。此命令有一些设置背景的选项,包括 **\-bg-scale** 使用缩放填充屏幕,**\-bg-fill** 直接填充而不缩放图片,等等。 + + +``` +`$ feh --bg-scale ~/Pictures/wallpapers/mybackground.jpg` +``` + +大多数配置文件都包含在 **$HOME/.fvwm-crystal** 中,某些系统范围的默认文件位于 **/usr/share/fvwm-crystal**。 + +### 自己尝试一下 + +FVWM 是桌面构建平台,也是窗口管理器。它不会为你做什么事情,它期望你来配置尽可能的一切。 +如果你正在寻找轻巧,快速且简单的窗口管理器,那么 FVWM 可以胜任。但是,如果你正在寻找可以深入,探索和破解,那么 FVWM 是必须的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/fvwm-linux-desktop + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) +[2]: http://www.fvwm.org/ +[3]: https://en.wikipedia.org/wiki/Twm +[4]: https://www.box-look.org/p/1018270/ +[5]: http://box-look.org +[6]: https://opensource.com/sites/default/files/advent-gdm_0.jpg (Select your desktop session in GDM) +[7]: https://opensource.com/sites/default/files/advent-kdm.jpg (Select your desktop session with KDM) +[8]: https://opensource.com/sites/default/files/advent-fvwm-crystal.jpg (FVWM-crystal running on Slackware 14.2) From 8f0ad60a4842ff8d38642eafe24e0c110b8f862b Mon Sep 17 00:00:00 2001 From: runningwater Date: Mon, 23 Dec 2019 09:08:16 +0800 Subject: [PATCH 022/430] =?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 --- ...20191007 Using the Java Persistence API.md | 273 ------------------ ...20191007 Using the Java Persistence API.md | 272 +++++++++++++++++ 2 files changed, 272 insertions(+), 273 deletions(-) delete mode 100644 sources/tech/20191007 Using the Java Persistence API.md create mode 100644 translated/tech/20191007 Using the Java Persistence API.md diff --git a/sources/tech/20191007 Using the Java Persistence API.md b/sources/tech/20191007 Using the Java Persistence API.md deleted file mode 100644 index 6b16213fc1..0000000000 --- a/sources/tech/20191007 Using the Java Persistence API.md +++ /dev/null @@ -1,273 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (runningwater) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Using the Java Persistence API) -[#]: via: (https://opensource.com/article/19/10/using-java-persistence-api) -[#]: author: (Stephon Brown https://opensource.com/users/stephb) - -Using the Java Persistence API -====== -Learn how to use the JPA by building an example app for a bike store. -![Coffee beans][1] - -The Java Persistence API (JPA) is an important Java functionality for application developers to understand. It translates exactly how Java developers turn method calls on objects into accessing, persisting, and managing data stored in NoSQL and relational databases. - -This article examines the JPA in detail through a tutorial example of building a bicycle loaning service. This example will create a create, read, update, and delete (CRUD) layer for a larger application using the Spring Boot framework, the MongoDB database (which is [no longer open source][2]), and the Maven package manager. I also use NetBeans 11 as my IDE of choice. - -This tutorial focuses on the open source angle of the Java Persistence API, rather than the tools, to show how it works. This is all about learning the pattern of programming applications, but it's still smart to understand the software. You can access the full code in my [GitHub repository][3]. - -### Java: More than 'beans' - -Java is an object-oriented language that has gone through many changes since the Java Development Kit (JDK) was released in 1996. Understanding the language's various pathways and its virtual machine is a history lesson in itself; in brief, the language has forked in many directions, similar to the Linux kernel, since its release. There are standard editions that are free to the community, enterprise editions for business, and an open source alternatives contributed to by multiple vendors. Major versions are released at six-month intervals; since there are often major differences in features, you may want to do some research before choosing a version. - -All and all, Java is steeped in history. This tutorial focuses on [JDK 11][4], which is the open source implementation of Java 11, because it is one of the long-term-support versions that is still active. - - * **Spring Boot: **Spring Boot is a module from the larger Spring framework developed by Pivotal. Spring is a very popular framework for working with Java. It allows for a variety of architectures and configurations. Spring also offers support for web applications and security. Spring Boot offers basic configurations for bootstrapping various types of Java projects quickly. This tutorial uses Spring Boot to quickly write a console application and test functionality against the database. - * **Maven:** Maven is a project/package manager developed by Apache. Maven allows for the management of packages and various dependencies within its POM.xml file. If you have used NPM, you may be familiar with how package managers function. Maven also manages build and reporting functionality. - * **Lombok:** Lombok is a library that allows the creation of object getters/setters through annotation within the object file. This is already present in languages like C#, and Lombok introduces this functionality into Java. - * **NetBeans: **NetBeans is a popular open source IDE that focuses specifically on Java development. Many of its tools provide an implementation for the latest Java SE and EE updates. - - - -This group of tools will be used to create a simple application for a fictional bike store. It will implement functionality for inserting collections for "Customer" and "Bike" objects. - -### Brewed to perfection - -Navigate to the [Spring Initializr][5]. This website enables you to generate basic project needs for Spring Boot and the dependencies you will need for the project. Select the following options: - - 1. **Project:** Maven Project - 2. **Language:** Java - 3. **Spring Boot:** 2.1.8 (or the most stable release) - 4. **Project Metadata:** Whatever your naming conventions are (e.g., **com.stephb**) - * You can keep Artifact as "Demo" - 5. **Dependencies:** Add: - * Spring Data MongoDB - * Lombok - - - -Click **Download** and open the new project in your chosen IDE (e.g., NetBeans). - -#### Model outline - -The models represent information collected about specific objects in the program that will be persisted in your database. Focus on two objects: **Customer** and **Bike**. First, create a **dto** folder within the **src** folder. Then, create the two Java class objects named **Customer.java** and **Bike.java**. They will be structured in the program as follows: - -**Customer. Java** - - -``` - 1 package com.stephb.JavaMongo.dto; - 2  - 3 import lombok.Getter; - 4 import lombok.Setter; - 5 import org.springframework.data.annotation.Id; - 6  - 7 /** - 8  * - 9  * @author stephon -10  */ -11 @Getter @Setter -12 public class Customer { -13  -14         private @Id [String][6] id; -15         private [String][6] emailAddress; -16         private [String][6] firstName; -17         private [String][6] lastName; -18         private [String][6] address; -19          -20 } -``` - -**Bike.java** - - -``` - 1 package com.stephb.JavaMongo.dto; - 2  - 3 import lombok.Getter; - 4 import lombok.Setter; - 5 import org.springframework.data.annotation.Id; - 6  - 7 /** - 8  * - 9  * @author stephon -10  */ -11 @Getter @Setter -12 public class Bike { -13         private @Id [String][6] id; -14         private [String][6] modelNumber; -15         private [String][6] color; -16         private [String][6] description; -17  -18         @Override -19         public [String][6] toString() { -20                 return "This bike model is " + this.modelNumber + " is the color " + this.color + " and is " + description; -21         } -22 } -``` - -As you can see, Lombok annotation is used within the object to generate the getters/setters for the properties/attributes. Properties can specifically receive the annotations if you do not want all of the attributes to have getters/setters within that class. These two classes will form the container carrying your data to wherever you want to display information. - -#### Set up a database - -I used a [Mongo Docker][7] container for testing. If you have MongoDB installed on your system, you do not have to run an instance in Docker. You can install MongoDB from its website by selecting your system information and following the installation instructions. - -After installing, you can interact with your new MongoDB server through the command line, a GUI such as MongoDB Compass, or IDE drivers for connecting to data sources. Now you can define your data layer to pull, transform, and persist your data. To set your database access properties, navigate to the **applications.properties** file in your application and provide the following: - - -``` - 1 spring.data.mongodb.host=localhost - 2 spring.data.mongodb.port=27017 - 3 spring.data.mongodb.database=BikeStore -``` - -#### Define the data access object/data access layer - -The data access objects (DAO) in the data access layer (DAL) will define how you will interact with data in the database. The awesome thing about using a **spring-boot-starter** is that most of the work for querying the database is already done. - -Start with the **Customer** DAO. Create an interface in a new **dao** folder within the **src** folder, then create another Java class name called **CustomerRepository.java**. The class should look like: - - -``` - 1 package com.stephb.JavaMongo.dao; - 2  - 3 import com.stephb.JavaMongo.dto.Customer; - 4 import java.util.List; - 5 import org.springframework.data.mongodb.repository.MongoRepository; - 6  - 7 /** - 8  * - 9  * @author stephon -10  */ -11 public interface CustomerRepository extends MongoRepository<Customer, String>{ -12         @Override -13         public List<Customer> findAll(); -14         public List<Customer> findByFirstName([String][6] firstName); -15         public List<Customer> findByLastName([String][6] lastName); -16 } -``` - -This class is an interface that extends or inherits from the **MongoRepository** class with your DTO (**Customer.java**) and a string because they will be used for querying with your custom functions. Because you have inherited from this class, you have access to many functions that allow persistence and querying of your object without having to implement or reference your own functions. For example, after you instantiate the **CustomerRepository** object, you can use the **Save** function immediately. You can also override these functions if you need more extended functionality. I created a few custom queries to search my collection, given specific elements of my object. - -The **Bike** object also has a repository for interacting with the database. Implement it very similarly to the **CustomerRepository**. It should look like: - - -``` - 1 package com.stephb.JavaMongo.dao; - 2  - 3 import com.stephb.JavaMongo.dto.Bike; - 4 import java.util.List; - 5 import org.springframework.data.mongodb.repository.MongoRepository; - 6  - 7 /** - 8  * - 9  * @author stephon -10  */ -11 public interface BikeRepository extends MongoRepository<Bike,String>{ -12         public Bike findByModelNumber([String][6] modelNumber); -13         @Override -14         public List<Bike> findAll(); -15         public List<Bike> findByColor([String][6] color); -16 } -``` - -#### Run your program - -Now that you have a way to structure your data and a way to pull, transform, and persist it, run your program! - -Navigate to your **Application.java** file (it may have a different name, depending on what you named your application, but it should include "application"). Where the class is defined, include an **implements CommandLineRunner** afterward. This will allow you to implement a **run** method to create a command-line application. Override the **run** method provided by the **CommandLineRunner** interface and include the following to test the **BikeRepository**: - - -``` - 1 package com.stephb.JavaMongo; - 2  - 3 import com.stephb.JavaMongo.dao.BikeRepository; - 4 import com.stephb.JavaMongo.dao.CustomerRepository; - 5 import com.stephb.JavaMongo.dto.Bike; - 6 import java.util.Scanner; - 7 import org.springframework.beans.factory.annotation.Autowired; - 8 import org.springframework.boot.CommandLineRunner; - 9 import org.springframework.boot.SpringApplication; -10 import org.springframework.boot.autoconfigure.SpringBootApplication; -11  -12  -13 @SpringBootApplication -14 public class JavaMongoApplication implements CommandLineRunner { -15                 @Autowired -16                 private BikeRepository bikeRepo; -17                 private CustomerRepository custRepo; -18                  -19     public static void main([String][6][] args) { -20                         SpringApplication.run(JavaMongoApplication.class, args); -21     } -22         @Override -23         public void run([String][6]... args) throws [Exception][8] { -24                 Scanner scan = new Scanner([System][9].in); -25                 [String][6] response = ""; -26                 boolean running = true; -27                 while(running){ -28                         [System][9].out.println("What would you like to create? \n C: The Customer \n B: Bike? \n X:Close"); -29                         response = scan.nextLine(); -30                         if ("B".equals(response.toUpperCase())) { -31                                 [String][6][] bikeInformation = new [String][6][3]; -32                                 [System][9].out.println("Enter the information for the Bike"); -33                                 [System][9].out.println("Model Number"); -34                                 bikeInformation[0] = scan.nextLine(); -35                                 [System][9].out.println("Color"); -36                                 bikeInformation[1] = scan.nextLine(); -37                                 [System][9].out.println("Description"); -38                                 bikeInformation[2] = scan.nextLine(); -39  -40                                 Bike bike = new Bike(); -41                                 bike.setModelNumber(bikeInformation[0]); -42                                 bike.setColor(bikeInformation[1]); -43                                 bike.setDescription(bikeInformation[2]); -44  -45                                 bike = bikeRepo.save(bike); -46                                 [System][9].out.println(bike.toString()); -47  -48  -49                         } else if ("X".equals(response.toUpperCase())) { -50                                 [System][9].out.println("Bye"); -51                                 running = false; -52                         } else { -53                                 [System][9].out.println("Sorry nothing else works right now!"); -54                         } -55                 } -56                  -57         } -58 } -``` - -The **@Autowired** annotation allows automatic dependency injection of the **BikeRepository** and **CustomerRepository** beans. You will use these classes to persist and gather data from the database. - -There you have it! You have created a command-line application that connects to a database and is able to perform CRUD operations with minimal code on your part. - -### Conclusion - -Translating from programming language concepts like objects and classes into calls to store, retrieve, or change data in a database is essential to building an application. The Java Persistence API (JPA) is an important tool in the Java developer's toolkit to solve that challenge. What databases are you exploring in Java? Please share in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/10/using-java-persistence-api - -作者:[Stephon Brown][a] -选题:[lujun9972][b] -译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/stephb -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-beans.jpg?itok=3hkjX5We (Coffee beans) -[2]: https://www.techrepublic.com/article/mongodb-ceo-tells-hard-truths-about-commercial-open-source/ -[3]: https://github.com/StephonBrown/SpringMongoJava -[4]: https://openjdk.java.net/projects/jdk/11/ -[5]: https://start.spring.io/ -[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string -[7]: https://hub.docker.com/_/mongo -[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+exception -[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system diff --git a/translated/tech/20191007 Using the Java Persistence API.md b/translated/tech/20191007 Using the Java Persistence API.md new file mode 100644 index 0000000000..6c44f50290 --- /dev/null +++ b/translated/tech/20191007 Using the Java Persistence API.md @@ -0,0 +1,272 @@ +[#]: collector: (lujun9972) +[#]: translator: (runningwater) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Using the Java Persistence API) +[#]: via: (https://opensource.com/article/19/10/using-java-persistence-api) +[#]: author: (Stephon Brown https://opensource.com/users/stephb) + +使用 Java 持久化 API +====== +我们通过为自行车商店构建示例应用程序来学习如何使用 JPA。 +![Coffee beans][1] + +对应用开发者来说,Java 持久化 API (JPA)是一项重要的技能,需要透彻理解。它为 Java 开发人员定义了如何将对象的方法调用转换为访问、持久化及管理 NoSQL 和关系型数据库数据存储的问题的方案。 + +本文通过构建自行车借贷服务的教程示例来详细研究 JPA。此示例会使用 Spring Boot 框架、MongoDB 数据库([已经不开源][2])和 Maven 包管理来构建一个大型应用程序,并且创建一个创建、读取、更新和删除(CRUD) 层。这儿我选择 NetBeans 11 作为我的 IDE。 + +此教程仅从开源的角度来介绍 Java 持久化的工作原理,不涉及其作为工具的使用说明。这全是关于编写应用程序模式的学习,但对于理解具体的软件实现也很益处。可以从我的[ GitHub 源仓库][3] 来获取相关代码。 + +### Java: 不仅仅是 'beans' + +Java 是一门面向对象的编程语言,自 1996 年发布第一版 Java 开发工具(JDK)起,已经变化了很多很多。要了解其特性和其虚拟机本身就是个很长的历史。简而言之,和 Linux 内核很相似,自发布以来,该语言已经向多个方向分支发展。有对社区免费的标准版本、有针对企业的企业版本及由多家供应商提供的开源替代品。主要版本每六个月发布一次,其功能往往差异很大,所以确认选用版本前得先做些研究。 + +总而言之,Java 的历史很悠久。本教程重点介绍 Java 11 的开源实现 [JDK 11][4]。因其是扔然有效的长期支持版本之一。 + + * **Spring Boot: ** Spring Boot 是由 Pivotal 公司开发大型 Spring 框架的一个模块。Spring 是 Java 开发中一个非常流行的框架。它支持各种框架和配置,也支持 WEB 应用程序及提供了应用安全保障功能。Spring Boot 为快速启动项目集成了基本的配置。本教程使用 Spring Boot 来快速编写控制台应用程序并针对数据库编写测试用例。 + * **Maven:** Maven 是由 Apache 开发的项目/包管理工具。Maven 通过 `POM.xml` 文件来管理包及其依赖项。如果你们使用过 NPM 的话,可能会非常熟悉包管理器的功能。此外 Maven 也用来进行项目构建及生成功能报告。 + * **Lombok:** Lombok 是一个库,它通过在对象文件里面添加注解来自动创建 getters/setters 方法。像 C# 这些语言已经实现了此功能,Lombok 只是把此功能引入 Java 语言而已。 + * **NetBeans: ** NetBeans 是一款很流行的开源 IDE,专门用于 Java 开发。它的许多工具都随着 Java SE 和 EE 的版本更新而更新。 + + + +我们会这组工具来创建一个简单的虚构自行车商店应用程序。会实现对 "Customer" 和 "Bike" 对象集合的的插入操作。 + +### 酿造完美 + +导航到 [Spring Initializr][5] 页面。该网站可以生成基于 Spring Boot 和其依赖项的基本项目。选择以下选项: + + 1. **项目:** Maven 工程 + 2. **语言:** Java + 3. **Spring Boot:** 2.1.8 (或最稳定版本) + 4. **项目元数据:** 无论你使用什么名字,其命名约定都是像 **com.stephb** 这样的。 + * 你可以保留 Artifact 名字为 “Demo”。 + 5. **依赖项:** 添加: + * Spring Data MongoDB + * Lombok + + + +点击 **下载**,然后用你的 IDE(例如 NetBeans) 打开此新项目。 + +#### 模型层(Model)概要 + +项目里面,模型代表从数据库里取出的信息的具体对象。我们关注两个对象:**Customer** 和 **Bike**。首先,在 **src** 目录创建 **dto** 目录;然后,创建两个名为 **Customer.java** 和 **Bike.java** 的 Java 类对象文件。其结构如下示: + +**Customer.Java** + + +``` + 1 package com.stephb.JavaMongo.dto; + 2  + 3 import lombok.Getter; + 4 import lombok.Setter; + 5 import org.springframework.data.annotation.Id; + 6  + 7 /** + 8  * + 9  * @author stephon +10  */ +11 @Getter @Setter +12 public class Customer { +13  +14         private @Id String id; +15         private String emailAddress; +16         private String firstName; +17         private String lastName; +18         private String address; +19          +20 } +``` + +**Bike.java** + + +```Java + 1 package com.stephb.JavaMongo.dto; + 2  + 3 import lombok.Getter; + 4 import lombok.Setter; + 5 import org.springframework.data.annotation.Id; + 6  + 7 /** + 8  * + 9  * @author stephon +10  */ +11 @Getter @Setter +12 public class Bike { +13         private @Id String id; +14         private String modelNumber; +15         private String color; +16         private String description; +17  +18         @Override +19         public String toString() { +20                 return "This bike model is " + this.modelNumber + " is the color " + this.color + " and is " + description; +21         } +22 } +``` + +如你所见,对象中使用 Lombok 注解来为定义的属性(特性)生成 getters/setters 方法。如果你不想对所有属于都生成 getters/setters 方法,可以在属性上定义这些注解。这两个类会变成容器,里面携带有数据,无论在何处想显示信息都可以使用。 + +#### 配置数据库 + +我使用 [Mongo Docker][7] 容器来进行此次测试。如果你的系统上已经安装了 MongoDB,则不必运行 Docker 实例。你也可以登陆其官网,然后按照安装说明,选择系统信息来安装 MongoDB。 + +安装后,就可以使用命令行、GUI(例如 MongoDB Compass)或用于连接数据源的 IDE 驱动程序来与新的 MongoDB 服务进行交互。到目前为止,可以开始定义数据层了,用来拉取、转换和持久化数据。需要设置数据库访问属性,请导航到程序中的 **applications.properties** 文件,然后添加如下内容: + + +``` + 1 spring.data.mongodb.host=localhost + 2 spring.data.mongodb.port=27017 + 3 spring.data.mongodb.database=BikeStore +``` + +#### 定义数据访问对象(数据)层 + +数据访问层(DAL)中的数据访问对象(DAO)定义了与数据库中的数据的交互过程。令人惊叹的就是在使用 **spring-boot-starter** 后,查询数据库的大部分工作已经完成。 + +让我们从 **Customer** DAO 开始。在 **src** 下的新目录 **dao** 中创建一个接口文件,然后再创建一个名为 **CustomerRepository.java** 的 Java 类文件,其内容如下示: + + +``` + 1 package com.stephb.JavaMongo.dao; + 2  + 3 import com.stephb.JavaMongo.dto.Customer; + 4 import java.util.List; + 5 import org.springframework.data.mongodb.repository.MongoRepository; + 6  + 7 /** + 8  * + 9  * @author stephon +10  */ +11 public interface CustomerRepository extends MongoRepository{ +12         @Override +13         public ListStringCustomer> findAll(); +14         public List findByFirstName(String firstName); +15         public List findByLastName(String lastName); +16 } +``` + +这个类是一个接口,扩展或继承于 **MongoRepository** 类,而 MongoRepository 类依赖于 DTO (**Customer.java**)和一个字符串,它们用来实现自定义函数查询功能。因为您已继承自此类,所以您可以访问许多方法函数,这些函数允许持久化和查询对象,而无需实现或引用自己定义的方法函数。例如,在实例化 **CustomerRepository** 对象后,你就可以直接使用 **Save** 功能。如果你需要扩展更多的功能,也可以重写这些方法。我创建了一些自定义查询来搜索我的集合,这些集合对象是我自定义的元素。 + +**Bike** 对象也有一个存储源负责与数据库交互。与 **CustomerRepository** 的实现非常类似。其实现如下所示: + +``` + 1 package com.stephb.JavaMongo.dao; + 2  + 3 import com.stephb.JavaMongo.dto.Bike; + 4 import java.util.List; + 5 import org.springframework.data.mongodb.repository.MongoRepository; + 6  + 7 /** + 8  * + 9  * @author stephon +10  */ +11 public interface BikeRepository extends MongoRepository{ +12         public Bike findByModelNumber(String modelNumber); +13         @Override +14         public List findAll(); +15         public List findByColor(String color); +16 } +``` + +#### 运行程序 + +现在,你已经有了一种结构化数据的方式,可以对数据进行提取、转换和持久化,然后运行这个程序。 + +找到 **Application.java** 文件(有可能不是此名称,具体取决于你的应用程序名称,但都会包含有 “application” )。在定义此类的地方,在后面加上 **CommandLineRunner 的实现**。这将允许你实现 **run** 方法来创建命令行应用程序。重写 **CommandLineRunner** 接口提供的 **run** 方法,并包含如下内容用来测试 **BikeRepository** : + + +``` + 1 package com.stephb.JavaMongo; + 2  + 3 import com.stephb.JavaMongo.dao.BikeRepository; + 4 import com.stephb.JavaMongo.dao.CustomerRepository; + 5 import com.stephb.JavaMongo.dto.Bike; + 6 import java.util.Scanner; + 7 import org.springframework.beans.factory.annotation.Autowired; + 8 import org.springframework.boot.CommandLineRunner; + 9 import org.springframework.boot.SpringApplication; +10 import org.springframework.boot.autoconfigure.SpringBootApplication; +11  +12  +13 @SpringBootApplication +14 public class JavaMongoApplication implements CommandLineRunner { +15                 @Autowired +16                 private BikeRepository bikeRepo; +17                 private CustomerRepository custRepo; +18                  +19     public static void main(String[] args) { +20                         SpringApplication.run(JavaMongoApplication.class, args); +21     } +22         @Override +23         public void run(String... args) throws [Exception] { +24                 Scanner scan = new Scanner(System.in); +25                 String response = ""; +26                 boolean running = true; +27                 while(running){ +28                         System.out.println("What would you like to create? \n C: The Customer \n B: Bike? \n X:Close"); +29                         response = scan.nextLine(); +30                         if ("B".equals(response.toUpperCase())) { +31                                 String[] bikeInformation = new String; +32                                 System.out.println("Enter the information for the Bike"); +33                                 System.out.println("Model Number"); +34                                 bikeInformation[0] = scan.nextLine(); +35                                 System.out.println("Color"); +36                                 bikeInformation[1] = scan.nextLine(); +37                                 System.out.println("Description"); +38                                 bikeInformation[2] = scan.nextLine(); +39  +40                                 Bike bike = new Bike(); +41                                 bike.setModelNumber(bikeInformation[0]); +42                                 bike.setColor(bikeInformation[1]); +43                                 bike.setDescription(bikeInformation[2]); +44  +45                                 bike = bikeRepo.save(bike); +46                                 System.out.println(bike.toString()); +47  +48  +49                         } else if ("X".equals(response.toUpperCase())) { +50                                 System.out.println("Bye"); +51                                 running = false; +52                         } else { +53                                 System.out.println("Sorry nothing else works right now!"); +54                         } +55                 } +56                  +57         } +58 } +``` + +其中的 **@Autowired** 注解会自动依赖注入 **BikeRepository** 和 **CustomerRepository** Bean。我们将使用这些类来从数据库持久化和采集数据。 + +已经好了。你已经创建了一个命令行应用程序。该应用程序连接到数据库,并且能够以最少的代码执行 CRUD 操作 + +### 结论 + +从诸如对象和类之类的编程语言概念转换为用于在数据库中存储、检索或更改数据的调用对于构建应用程序至关重要。Java 持久化 API (JPA)正是为 Java 开发人员解决这一难题的重要工具。 你正在使用 Java 操纵哪些数据库呢? 请在评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/10/using-java-persistence-api + +作者:[Stephon Brown][a] +选题:[lujun9972][b] +译者:[runningwater](https://github.com/runningwater) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/stephb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-beans.jpg?itok=3hkjX5We (Coffee beans) +[2]: https://www.techrepublic.com/article/mongodb-ceo-tells-hard-truths-about-commercial-open-source/ +[3]: https://github.com/StephonBrown/SpringMongoJava +[4]: https://openjdk.java.net/projects/jdk/11/ +[5]: https://start.spring.io/ +[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[7]: https://hub.docker.com/_/mongo +[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+exception +[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system From 8551f20e1b00d2e62ff57e609bd08629fcac067e Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 23 Dec 2019 09:56:05 +0800 Subject: [PATCH 023/430] translating --- ... Restart Services in Ubuntu and Other Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md b/sources/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md index 7026071748..ab88f9198d 100644 --- a/sources/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 015b65037a85312c5b144c489ec311f719be2a74 Mon Sep 17 00:00:00 2001 From: Hank Chow <280630620@qq.com> Date: Mon, 23 Dec 2019 11:20:09 +0800 Subject: [PATCH 024/430] hankchow translating --- ...2 Why your Python code needs to be beautiful and explicit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md b/sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md index 00417f38ef..10fecd9694 100644 --- a/sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md +++ b/sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (HankChow) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0435c78fdd0d7cf26b3117c6209546ad21fa6464 Mon Sep 17 00:00:00 2001 From: chen ni Date: Mon, 23 Dec 2019 22:46:40 +0800 Subject: [PATCH 025/430] =?UTF-8?q?=E7=94=B3=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20191218 How tracking pixels work.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20191218 How tracking pixels work.md b/sources/tech/20191218 How tracking pixels work.md index 596d007175..11ac17be73 100644 --- a/sources/tech/20191218 How tracking pixels work.md +++ b/sources/tech/20191218 How tracking pixels work.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chen-ni) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -106,7 +106,7 @@ via: https://jvns.ca/blog/how-tracking-pixels-work/ 作者:[Julia Evans][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/chen-ni) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ccc461c71c1c445cece7650b81a85a9aef621db5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Dec 2019 22:48:53 +0800 Subject: [PATCH 026/430] PRF @robsean --- .../tech/20190225 Netboot a Fedora Live CD.md | 143 +++++++++--------- 1 file changed, 69 insertions(+), 74 deletions(-) diff --git a/translated/tech/20190225 Netboot a Fedora Live CD.md b/translated/tech/20190225 Netboot a Fedora Live CD.md index 6cae3ce9d4..ffd4e51bfc 100644 --- a/translated/tech/20190225 Netboot a Fedora Live CD.md +++ b/translated/tech/20190225 Netboot a Fedora Live CD.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Netboot a Fedora Live CD) @@ -12,40 +12,38 @@ ![](https://fedoramagazine.org/wp-content/uploads/2019/02/netboot-livecd-816x345.jpg) -[Live CD][1] 对于很多任务是很有用的,例如: +[Live CD][1] 对于很多任务是很有用的,例如: - * 将操作系统安装到一个硬盘驱动器 - * 修复一个启动加载程序或执行其它救援模式操作 - * 为网络浏览提供一个相适应的最小环境 - * …以及[更多的东西][2]。 +* 将操作系统安装到一个硬盘驱动器 +* 修复一个启动加载程序或执行其它救援模式操作 +* 为 Web 浏览提供一个相适应的最小环境 +* …以及[更多的东西][2]。 - - -因为使用 DVD 和 USB 驱动器来存储你的 Live CD 镜像是一个替代方案,你可以上传它们到一个不太可能丢失或损坏的 [iSCSI][3] 服务器中。这个指南向你展示如何加载你的 Live CD 镜像到一个 ISCSI 服务器上,并使用 [iPXE][4] 启动加载程序来访问它们。 +作为使用 DVD 和 USB 驱动器来存储你的 Live CD 镜像是一个替代方案,你可以上传它们到一个不太可能丢失或损坏的 [iSCSI][3] 服务器中。这个指南向你展示如何加载你的 Live CD 镜像到一个 ISCSI 服务器上,并使用 [iPXE][4] 启动加载程序来访问它们。 ### 下载一个 Live CD 镜像 ``` $ MY_RLSE=27 $ MY_LIVE=$(wget -q -O - https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/$MY_RLSE/Workstation/x86_64/iso | perl -ne '/(Fedora[^ ]*?-Live-[^ ]*?\.iso)(?{print $^N})/;') -$ MY_NAME=fc$MY_RLSE +$ MY_NAME=fc$MY_RLSE $ wget -O $MY_NAME.iso https://dl.fedoraproject.org/pub/archive/fedora/linux/releases/$MY_RLSE/Workstation/x86_64/iso/$MY_LIVE ``` -上面的命令下载 Fedora-Workstation-Live-x86_64-27-1.6.iso Fedora Live 镜像,并保存为 fc27.iso 。更改 MY_RLSE 的值来下载其它档案版本。或者,你可以浏览 来下载最新的 Fedora live 镜像。在21之前的版本使用不同的命名约定,必需[在这里手动下载][5]。如果你手动下载一个 Live CD 镜像,设置 MY_NAME 变量为不带有扩展名的文件的基本名称。用此方法,下面部分中命令将引用正确的文件。 +上面的命令下载 `Fedora-Workstation-Live-x86_64-27-1.6.iso` Fedora Live 镜像,并保存为 `fc27.iso`。更改 `MY_RLSE` 的值来下载其它档案版本。或者,你可以浏览 来下载最新的 Fedora live 镜像。在 21 之前的版本使用不同的命名约定,必需[在这里手动下载][5]。如果你手动下载一个 Live CD 镜像,设置 `MY_NAME` 变量为不带有扩展名的文件的基本名称。用此方法,下面部分中命令将引用正确的文件。 ### 转换 Live CD 镜像 -使用 livecd-iso-to-disk 工具来转换 ISO 文件为一个磁盘镜像,并添加 netroot 参数到嵌入的内核命令行: +使用 `livecd-iso-to-disk` 工具来转换 ISO 文件为一个磁盘镜像,并添加 `netroot` 参数到嵌入的内核命令行: ``` $ sudo dnf install -y livecd-tools $ MY_SIZE=$(du -ms $MY_NAME.iso | cut -f 1) -$ dd if=/dev/zero of=$MY_NAME.img bs=1MiB count=0 seek=$(($MY_SIZE+512)) -$ MY_SRVR=server-01.example.edu -$ MY_RVRS=$(echo $MY_SRVR | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_SRVR}) -$ MY_LOOP=$(sudo losetup --show --nooverlap --find $MY_NAME.img) -$ sudo livecd-iso-to-disk --format --extra-kernel-args netroot=iscsi:$MY_SRVR:::1:iqn.$MY_RVRS:$MY_NAME $MY_NAME.iso $MY_LOOP +$ dd if=/dev/zero of=$MY_NAME.img bs=1MiB count=0 seek=$(($MY_SIZE+512)) +$ MY_SRVR=server-01.example.edu +$ MY_RVRS=$(echo $MY_SRVR | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_SRVR}) +$ MY_LOOP=$(sudo losetup --show --nooverlap --find $MY_NAME.img) +$ sudo livecd-iso-to-disk --format --extra-kernel-args netroot=iscsi:$MY_SRVR:::1:iqn.$MY_RVRS:$MY_NAME $MY_NAME.iso $MY_LOOP $ sudo losetup -d $MY_LOOP ``` @@ -53,21 +51,21 @@ $ sudo losetup -d $MY_LOOP 在你的 ISCSI 服务器上创建一个目录来存储你的 live 镜像,随后上传你修改的镜像到其中。 -**对于 21 及更高发布版本:** +对于 21 及更高发布版本: ``` -$ MY_FLDR=/images +$ MY_FLDR=/images $ scp $MY_NAME.img $MY_SRVR:$MY_FLDR/ ``` -**对于 21 以前发布版本:** +对于 21 以前发布版本: ``` -$ MY_FLDR=/images -$ MY_LOOP=$(sudo losetup --show --nooverlap --find --partscan $MY_NAME.img) -$ sudo tune2fs -O ^has_journal ${MY_LOOP}p1 -$ sudo e2fsck ${MY_LOOP}p1 -$ sudo dd status=none if=${MY_LOOP}p1 | ssh $MY_SRVR "dd of=$MY_FLDR/$MY_NAME.img" +$ MY_FLDR=/images +$ MY_LOOP=$(sudo losetup --show --nooverlap --find --partscan $MY_NAME.img) +$ sudo tune2fs -O ^has_journal ${MY_LOOP}p1 +$ sudo e2fsck ${MY_LOOP}p1 +$ sudo dd status=none if=${MY_LOOP}p1 | ssh $MY_SRVR "dd of=$MY_FLDR/$MY_NAME.img" $ sudo losetup -d $MY_LOOP ``` @@ -76,89 +74,86 @@ $ sudo losetup -d $MY_LOOP 在你的 iSCSI 服务器上运行下面的命令: ``` -$ sudo -i -# MY_NAME=fc27 -# MY_FLDR=/images -# MY_SRVR=`hostname` -# MY_RVRS=$(echo $MY_SRVR | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_SRVR}) -# cat << END > /etc/tgt/conf.d/$MY_NAME.conf +$ sudo -i +# MY_NAME=fc27 +# MY_FLDR=/images +# MY_SRVR=`hostname` +# MY_RVRS=$(echo $MY_SRVR | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_SRVR}) +# cat << END > /etc/tgt/conf.d/$MY_NAME.conf - backing-store $MY_FLDR/$MY_NAME.img - readonly 1 - allow-in-use yes - -END + backing-store $MY_FLDR/$MY_NAME.img + readonly 1 + allow-in-use yes + +END # tgt-admin --update ALL ``` ### 创建一个可启动 USB 驱动器 -[iPXE][4] 启动加载程序有一个 [sanboot][6] 命令,你可以使用它来连接,并启动你 ISCSI 服务器上运行的live 镜像。它可以用很多不同的[格式][7]编译。最好的工作格式依赖于你正在运行的硬件。例如,下面的说明向你展示如何在一个 USB 驱动器上从 [syslinux][9] 中 [链式加载][8] iPXE。 +[iPXE][4] 启动加载程序有一个 [sanboot][6] 命令,你可以使用它来连接并启动托管于你 ISCSI 服务器上运行的 live 镜像。它可以以很多不同的[格式][7]编译。最好的工作格式依赖于你正在运行的硬件。例如,下面的说明向你展示如何在一个 USB 驱动器上从 [syslinux][9] 中 [链式加载][8] iPXE。 -首先,下载 iPXE ,并以它的 lkrn 格式构建。这应该作为一个工作站上的普通用户完成: +首先,下载 iPXE,并以它的 lkrn 格式构建。这应该作为一个工作站上的普通用户完成: ``` -$ sudo dnf install -y git -$ git clone http://git.ipxe.org/ipxe.git $HOME/ipxe +$ sudo dnf install -y git +$ git clone http://git.ipxe.org/ipxe.git $HOME/ipxe $ sudo dnf groupinstall -y "C Development Tools and Libraries" -$ cd $HOME/ipxe/src -$ make clean -$ make bin/ipxe.lkrn +$ cd $HOME/ipxe/src +$ make clean +$ make bin/ipxe.lkrn $ cp bin/ipxe.lkrn /tmp ``` 接下来,准备一个带有一个 MSDOS 分区表和一个 FAT32 文件系统的 USB 驱动器。下面的命令假设你已经连接将要格式化的 USB 驱动器。**注意:你要格式正确的驱动器!** ``` -$ sudo -i -# dnf install -y parted util-linux dosfstools +$ sudo -i +# dnf install -y parted util-linux dosfstools # echo; find /dev/disk/by-id ! -regex '.*-part.*' -name 'usb-*' -exec readlink -f {} \; | xargs -i bash -c "parted -s {} unit MiB print | perl -0 -ne '/^Model: ([^(]*).*\n.*?([0-9]*MiB)/i && print \"Found: {} = \$2 \$1\n\"'"; echo; read -e -i "$(find /dev/disk/by-id ! -regex '.*-part.*' -name 'usb-*' -exec readlink -f {} \; -quit)" -p "Drive to format: " MY_USB -# umount $MY_USB? -# wipefs -a $MY_USB -# parted -s $MY_USB mklabel msdos mkpart primary fat32 1MiB 100% set 1 boot on +# umount $MY_USB? +# wipefs -a $MY_USB +# parted -s $MY_USB mklabel msdos mkpart primary fat32 1MiB 100% set 1 boot on # mkfs -t vfat -F 32 ${MY_USB}1 ``` -最后,在 USB 驱动器上安装并配置 syslinux ,来链式加载 iPXE : +最后,在 USB 驱动器上安装并配置 syslinux ,来链式加载 iPXE: ``` -# dnf install -y syslinux-nonlinux -# syslinux -i ${MY_USB}1 -# dd if=/usr/share/syslinux/mbr.bin of=${MY_USB} -# MY_MNT=$(mktemp -d) -# mount ${MY_USB}1 $MY_MNT -# MY_NAME=fc27 -# MY_SRVR=server-01.example.edu -# MY_RVRS=$(echo $MY_SRVR | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_SRVR}) +# dnf install -y syslinux-nonlinux +# syslinux -i ${MY_USB}1 +# dd if=/usr/share/syslinux/mbr.bin of=${MY_USB} +# MY_MNT=$(mktemp -d) +# mount ${MY_USB}1 $MY_MNT +# MY_NAME=fc27 +# MY_SRVR=server-01.example.edu +# MY_RVRS=$(echo $MY_SRVR | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_SRVR}) # cat << END > $MY_MNT/syslinux.cfg ui menu.c32 default $MY_NAME timeout 100 menu title SYSLINUX label $MY_NAME - menu label ${MY_NAME^^} - kernel ipxe.lkrn - append dhcp && sanboot iscsi:$MY_SRVR:::1:iqn.$MY_RVRS:$MY_NAME -END -# cp /usr/share/syslinux/menu.c32 $MY_MNT -# cp /usr/share/syslinux/libutil.c32 $MY_MNT -# cp /tmp/ipxe.lkrn $MY_MNT + menu label ${MY_NAME^^} + kernel ipxe.lkrn + append dhcp && sanboot iscsi:$MY_SRVR:::1:iqn.$MY_RVRS:$MY_NAME +END +# cp /usr/share/syslinux/menu.c32 $MY_MNT +# cp /usr/share/syslinux/libutil.c32 $MY_MNT +# cp /tmp/ipxe.lkrn $MY_MNT # umount ${MY_USB}1 ``` -通过简单地编辑 syslinux.cfg 文件,并添加附加的菜单入口,你应该能够使用这同一个 USB 驱动器来网络启动附加的 ISCSI 目标。 +通过简单地编辑 `syslinux.cfg` 文件,并添加附加的菜单项,你应该能够使用这同一个 USB 驱动器来网络启动附加的 ISCSI 目标。 -这仅是加载 IPXE 的一种方法。你可以直接在你的工作站上安装 syslinux 。再一种选项是编译 iPXE 为一个 EFI 可执行文件,并直接放置它到你的 [ESP][10]中。又一种选项是编译 iPXE 为一个 PXE 加载器,并放置它到你的能够被 DHCP 引用的 TFTP 服务器。最佳的选项依赖于的环境 +这仅是加载 IPXE 的一种方法。你可以直接在你的工作站上安装 syslinux 。再一种选项是编译 iPXE 为一个 EFI 可执行文件,并直接放置它到你的 [ESP][10] 中。又一种选项是编译 iPXE 为一个 PXE 加载器,并放置它到你的能够被 DHCP 引用的 TFTP 服务器。最佳的选项依赖于的环境 ### 最后说明 - * 如果你以 IPXE 的 EFI 格式编译 IPXE ,你可能想添加 –filename \EFI\BOOT\grubx64.efi 参数到 sanboot 命令。 - * 能够创建自定义 live 镜像。更多信息参考[创建和使用 live CD][11] 。 - * 有可能添加 –overlay-size-mb 和 –home-size-mb 参数到 livecd-iso-to-disk 命令来创建永久存储的 live 镜像。然而,如果你有多个并发用户,你将需要设置你的 ISCSI 服务器来管理独立的每个用户可写覆盖。这与 “[如何构建一个网络启动服务器,部分 4][12]” 一文所示类似。 - * Live 镜像在它们的内核命令行中支持一个 persistenthome 选项(例如, persistenthome=LABEL=HOME)。与经过 CHAP 身份验证的 iSCSI 目标一起使用,对于集权控制主目录,persistenthome 选项为 NFS 提供一个有趣的替代方案。 - - - +* 如果你以 IPXE 的 EFI 格式编译 IPXE ,你可能想添加 `–filename \EFI\BOOT\grubx64.efi` 参数到 `sanboot` 命令。 +* 能够创建自定义 live 镜像。更多信息参考[创建和使用 live CD][11]。 +* 可以添加 `–overlay-size-mb` 和 `–home-size-mb` 参数到 `livecd-iso-to-disk` 命令来创建永久存储的 live 镜像。然而,如果你有多个并发用户,你将需要设置你的 ISCSI 服务器来管理独立的每个用户的可写覆盖。这与 “[如何构建一个网络启动服务器,部分 4][12]” 一文所示类似。 +* Live 镜像在它们的内核命令行中支持一个 `persistenthome` 选项(例如, `persistenthome=LABEL=HOME`)。与经过 CHAP 身份验证的 iSCSI 目标一起使用,对于中心控制主目录,`persistenthome` 选项为 NFS 提供一个有趣的替代方案。 -------------------------------------------------------------------------------- @@ -167,7 +162,7 @@ via: https://fedoramagazine.org/netboot-a-fedora-live-cd/ 作者:[Gregory Bartholomew][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6f2aa0a9d70955b659ed2b5d96bd1435339bffc8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Dec 2019 22:49:16 +0800 Subject: [PATCH 027/430] PUB @robsean https://linux.cn/article-11708-1.html --- .../tech => published}/20190225 Netboot a Fedora Live CD.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190225 Netboot a Fedora Live CD.md (99%) diff --git a/translated/tech/20190225 Netboot a Fedora Live CD.md b/published/20190225 Netboot a Fedora Live CD.md similarity index 99% rename from translated/tech/20190225 Netboot a Fedora Live CD.md rename to published/20190225 Netboot a Fedora Live CD.md index ffd4e51bfc..928f1eeed8 100644 --- a/translated/tech/20190225 Netboot a Fedora Live CD.md +++ b/published/20190225 Netboot a Fedora Live CD.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11708-1.html) [#]: subject: (Netboot a Fedora Live CD) [#]: via: (https://fedoramagazine.org/netboot-a-fedora-live-cd/) [#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/) From e51900f9d7d230bf67b9042e82624a036eeea716 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Dec 2019 23:19:22 +0800 Subject: [PATCH 028/430] PRF @lxbwolf --- ...How To Set Password Complexity On Linux.md | 69 +++++++++---------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/translated/tech/20190513 How To Set Password Complexity On Linux.md b/translated/tech/20190513 How To Set Password Complexity On Linux.md index 9e70171824..8fe167bbac 100644 --- a/translated/tech/20190513 How To Set Password Complexity On Linux.md +++ b/translated/tech/20190513 How To Set Password Complexity On Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How To Set Password Complexity On Linux?) @@ -12,13 +12,12 @@ Linux 如何设置密码复杂度? 对于 Linux 系统管理员来说,用户管理是最重要的事之一。这涉及到很多因素,实现强密码策略是用户管理的其中一个方面。移步后面的 URL 查看如何 [在 Linux 上生成一个强密码][1]。它会限制系统未授权的用户的访问。 -所有人都知道 Linux 的默认策略很安全,然而我们还是要做一些微调,这样才更安全。弱密码有安全隐患,因此,请特别注意。移步后面的 URL 查看生成的强密码的 [密码长度和分值][2]。本文将教你在 Linux 中如何实现最安全的策略。 +所有人都知道 Linux 的默认策略很安全,然而我们还是要做一些微调,这样才更安全。弱密码有安全隐患,因此,请特别注意。移步后面的 URL 查看生成的强密码的[密码长度和分值][2]。本文将教你在 Linux 中如何实现最安全的策略。 -在大多数 Linux 系统中,我们可以用 PAM(pluggable authentication module,译注:可插拔认证模块)来加强密码策略。在下面的路径可以找到这个文件。 +在大多数 Linux 系统中,我们可以用 PAM(可插拔认证模块pluggable authentication module)来加强密码策略。在下面的路径可以找到这个文件。 -在红帽系列的系统中,路径:`/etc/pam.d/system-auth`。 - -Debian 系列的系统中,路径:`/etc/pam.d/common-password`。 +- 在红帽系列的系统中,路径:`/etc/pam.d/system-auth`。 +- Debian 系列的系统中,路径:`/etc/pam.d/common-password`。 关于默认的密码过期时间,可以在 `/etc/login.defs` 文件中查看详细信息。 @@ -33,32 +32,30 @@ PASS_MIN_LEN 5 PASS_WARN_AGE 7 ``` -**详细解释:** - - * **`PASS_MAX_DAYS:`**` ` 一个密码可使用的最大天数。 - * **`PASS_MIN_DAYS:`**` ` 两次密码修改之间最小的间隔天数。 - * **`PASS_MIN_LEN:`**` ` 密码最小长度。 - * **`PASS_WARN_AGE:`**` ` 密码过期前给出警告的天数。 - +详细解释: +* `PASS_MAX_DAYS`:一个密码可使用的最大天数。 +* `PASS_MIN_DAYS`:两次密码修改之间最小的间隔天数。 +* `PASS_MIN_LEN`:密码最小长度。 +* `PASS_WARN_AGE`:密码过期前给出警告的天数。 我们将会展示在 Linux 中如何实现下面的 11 个密码策略。 - * 一个密码可使用的最大天数 - * 两次密码修改之间最小的间隔天数 - * 密码过期前给出警告的天数 - * 密码历史记录/拒绝重复使用密码 - * 密码最小长度 - * 最少的大写字母个数 - * 最少的小写字母个数 - * 最少的数字个数 - * 最少的其他字符(符号)个数 - * 账号锁定 — 重试 - * 账号解锁时间 +* 一个密码可使用的最大天数 +* 两次密码修改之间最小的间隔天数 +* 密码过期前给出警告的天数 +* 密码历史记录/拒绝重复使用密码 +* 密码最小长度 +* 最少的大写字母个数 +* 最少的小写字母个数 +* 最少的数字个数 +* 最少的其他字符(符号)个数 +* 账号锁定 — 重试 +* 账号解锁时间 ### 密码可使用的最大天数是什么? -这一参数限制一个密码可使用的最大天数。它强制用户在过期前修改他/她的密码。如果他们忘记修改,那么他们会登录不了系统。他们需要联系管理员才能正常登录。这个参数可以在 `/etc/login.defs` 文件中设置。我把这个参数设置为 `90 天`。 +这一参数限制一个密码可使用的最大天数。它强制用户在过期前修改他/她的密码。如果他们忘记修改,那么他们会登录不了系统。他们需要联系管理员才能正常登录。这个参数可以在 `/etc/login.defs` 文件中设置。我把这个参数设置为 90 天。 ``` # vi /etc/login.defs @@ -68,7 +65,7 @@ PASS_MAX_DAYS 90 ### 密码最小天数是什么? -这个参数限制两次修改之间的最少天数。举例来说,如果这个参数被设置为 15 天,用户今天修改了密码,那么在 15 天之内他都不能修改密码。这个参数可以在 `/etc/login.defs` 文件中设置。我设置为 `15 天`。 +这个参数限制两次修改之间的最少天数。举例来说,如果这个参数被设置为 15 天,用户今天修改了密码,那么在 15 天之内他都不能修改密码。这个参数可以在 `/etc/login.defs` 文件中设置。我设置为 15 天。 ``` # vi /etc/login.defs @@ -78,7 +75,7 @@ PASS_MIN_DAYS 15 ### 密码警告天数是什么? -这个参数控制密码警告的前置天数,在密码即将过期时会给用户警告提示。在警告天数结束前,用户会收到日常警告提示。这可以提醒用户在密码过期前修改他们的密码,否则我们就需要联系管理员来解锁密码。这个参数可以在 `/etc/login.defs` 文件中设置。我设置为 `10 天`。 +这个参数控制密码警告的前置天数,在密码即将过期时会给用户警告提示。在警告天数结束前,用户会收到日常警告提示。这可以提醒用户在密码过期前修改他们的密码,否则我们就需要联系管理员来解锁密码。这个参数可以在 `/etc/login.defs` 文件中设置。我设置为 10 天。 ``` # vi /etc/login.defs @@ -90,7 +87,7 @@ PASS_WARN_AGE 10 ### 密码历史或拒绝重复使用密码是什么? -这个参数控制密码历史。它记录曾经使用过的密码(禁止使用的曾用密码的个数)。当用户设置新的密码时,它会检查密码历史,如果他们要设置的密码是一个曾经使用过的旧密码,将会发出警告提示。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。我设置密码历史为 `5`。 +这个参数控制密码历史。它记录曾经使用过的密码(禁止使用的曾用密码的个数)。当用户设置新的密码时,它会检查密码历史,如果他们要设置的密码是一个曾经使用过的旧密码,将会发出警告提示。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。我设置密码历史为 5。 ``` # vi /etc/pam.d/system-auth @@ -100,7 +97,7 @@ password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok r ### 密码最小长度是什么? -这个参数表示密码的最小长度。当用户设置新密码时,系统会检查这个参数,如果新设的密码长度小于这个参数设置的值,会收到警告提示。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。我设置最小密码长度为 `12`。 +这个参数表示密码的最小长度。当用户设置新密码时,系统会检查这个参数,如果新设的密码长度小于这个参数设置的值,会收到警告提示。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。我设置最小密码长度为 12。 ``` # vi /etc/pam.d/system-auth @@ -108,11 +105,11 @@ password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok r password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 ``` -**try_first_pass retry=3** : 在密码设置交互界面,用户有 3 次机会重设密码。 +`try_first_pass retry=3`:在密码设置交互界面,用户有 3 次机会重设密码。 ### 设置最少的大写字母个数? -这个参数表示密码中至少需要的大写字母的个数。这些是密码长度增长参数,可以让密码更长。当用户设置新密码时,系统会检查这个参数,如果密码中没有大写字母,会收到警告提示。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。我设置密码(中大写字母)的最小长度为 `1` 个字母。 +这个参数表示密码中至少需要的大写字母的个数。这些是密码强度参数,可以让密码更健壮。当用户设置新密码时,系统会检查这个参数,如果密码中没有大写字母,会收到警告提示。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。我设置密码(中的大写字母)的最小长度为 1 个字母。 ``` # vi /etc/pam.d/system-auth @@ -122,7 +119,7 @@ password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 ucredit= ### 设置最少的小写字母个数? -这个参数表示密码中至少需要的小写字母的个数。这些是密码长度增长参数,可以让密码更长。当用户设置新密码时,系统会检查这个参数,如果密码中没有小写字母,会收到警告提示。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。我设置为 `1` 个字母。 +这个参数表示密码中至少需要的小写字母的个数。这些是密码强度参数,可以让密码更健壮。当用户设置新密码时,系统会检查这个参数,如果密码中没有小写字母,会收到警告提示。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。我设置为 1 个字母。 ``` # vi /etc/pam.d/system-auth @@ -132,7 +129,7 @@ password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 lcred ### 设置密码中最少的数字个数? -这个参数表示密码中至少需要的数字的个数。这些是密码长度增长参数,可以让密码更长。当用户设置新密码时,系统会检查这个参数,如果密码中没有数字,会收到警告提示。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。我设置为 `1`。 +这个参数表示密码中至少需要的数字的个数。这些是密码强度参数,可以让密码更健壮。当用户设置新密码时,系统会检查这个参数,如果密码中没有数字,会收到警告提示。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。我设置为 1 个数字。 ``` # vi /etc/pam.d/system-auth @@ -142,7 +139,7 @@ password requisite pam_cracklib.so try_first_pass retry=3 minlen=12 dcred ### 设置密码中最少的其他字符(符号)个数? -这个参数表示密码中至少需要的特殊符号的个数。这些是密码长度增长参数,可以让密码更长。当用户设置新密码时,系统会检查这个参数,如果密码中没有特殊符号,会收到警告提示。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。我设置为 `1` 个字符。 +这个参数表示密码中至少需要的特殊符号的个数。这些是密码强度参数,可以让密码更健壮。当用户设置新密码时,系统会检查这个参数,如果密码中没有特殊符号,会收到警告提示。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。我设置为 1 个字符。 ``` # vi /etc/pam.d/system-auth @@ -163,7 +160,7 @@ account required pam_tally2.so ### 设定账号解锁时间? -这个参数表示用户解锁时间。如果一个用户账号在连续认证失败后被锁定了,当过了设定的解锁时间后,就会解锁。设置被锁定中的账号的解锁时间(900 秒 = 15分钟)。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。 +这个参数表示用户解锁时间。如果一个用户账号在连续认证失败后被锁定了,当过了设定的解锁时间后,才会解锁。设置被锁定中的账号的解锁时间(900 秒 = 15分钟)。这个参数可以在 `/etc/pam.d/system-auth` 文件中设置。 ``` # vi /etc/pam.d/system-auth @@ -179,7 +176,7 @@ via: https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8bed80c54082f46d47fbde3c013044fad2e3ec72 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Dec 2019 23:19:50 +0800 Subject: [PATCH 029/430] PUB @lxbwolf https://linux.cn/article-11709-1.html --- .../20190513 How To Set Password Complexity On Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190513 How To Set Password Complexity On Linux.md (99%) diff --git a/translated/tech/20190513 How To Set Password Complexity On Linux.md b/published/20190513 How To Set Password Complexity On Linux.md similarity index 99% rename from translated/tech/20190513 How To Set Password Complexity On Linux.md rename to published/20190513 How To Set Password Complexity On Linux.md index 8fe167bbac..f9dfca1e8e 100644 --- a/translated/tech/20190513 How To Set Password Complexity On Linux.md +++ b/published/20190513 How To Set Password Complexity On Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11709-1.html) [#]: subject: (How To Set Password Complexity On Linux?) [#]: via: (https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From c47d3a6ba6cc0d7afebb9225825576b51ce77a89 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 24 Dec 2019 00:55:43 +0800 Subject: [PATCH 030/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191223=20Best?= =?UTF-8?q?=20of=202019:=20Fedora=20for=20system=20administrators?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191223 Best of 2019- Fedora for system administrators.md --- ... 2019- Fedora for system administrators.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20191223 Best of 2019- Fedora for system administrators.md diff --git a/sources/tech/20191223 Best of 2019- Fedora for system administrators.md b/sources/tech/20191223 Best of 2019- Fedora for system administrators.md new file mode 100644 index 0000000000..5e57ff2912 --- /dev/null +++ b/sources/tech/20191223 Best of 2019- Fedora for system administrators.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Best of 2019: Fedora for system administrators) +[#]: via: (https://fedoramagazine.org/best-of-2019-fedora-for-system-administrators/) +[#]: author: (Paul W. Frields https://fedoramagazine.org/author/pfrields/) + +Best of 2019: Fedora for system administrators +====== + +![][1] + +The end of the year is a perfect time to look back on some of the Magazine’s most popular articles of 2019. One of the Fedora operating systems’s many strong points is its wide array of tools for system administrators. As your skills progress, you’ll find that the Fedora OS has even more to offer. And because Linux is the sysadmin’s best friend, you’ll always be in good company. In 2019, there were quite a few articles about sysadmin tools our readers enjoyed. Here’s a sampling. + +### Introducing Fedora CoreOS + +If you follow modern IT topics, you know that containers are a hot topic — and [containers mean Linux][2]. This summer brought the first preview release of [Fedora CoreOS][3]. This new edition of Fedora can run containerized workloads. You can use it to deploy apps and services in a modern way. + +> [Introducing Fedora CoreOS][4] + +### InitRAMFS, dracut and the dracut emergency shell + +To be a good sysadmin, you need to understand system startup and the boot process. From time to time, you’ll encounter software errors, configuration problems, or other issues that keep your system from starting normally. With the information in the article below, you can do some life-saving surgery on your system, and restore it to working order. + +> [InitRAMFS, Dracut, and the Dracut Emergency Shell][5] + +### How to reset your root password + +Although this article was published a few years ago, it continues to be one of the most popular. Apparently, we’re not the only people who sometimes get locked out of our own system! If this happens to you, and you need to reset the root password, the article below should do the trick. + +> [How to reset a root password on Fedora][6] + +### Systemd: unit dependencies and order + +This article is part of [an entire series][7] on systemd, the modern system and process manager in Fedora and other distributions. As you may know, systemd has sophisticated but easy to use methods to start up or shut own services in the right order. This article shows you how they work. That way you can apply the right options to unit files you create for systemd. + +> [systemd: Unit dependencies and order][8] + +### Setting kernel command line arguments + +Fedora 30 introduced new ways to change the boot options for your kernel. This article from Laura Abbott on the Fedora kernel team explains the new Bootloader Spec (BLS). It also tells you how to use it to set options on your kernel for boot time. + +> [Setting kernel command line arguments with Fedora 30][9] + +Stay tuned to the Magazine for other upcoming “Best of 2019” categories. All of us at the Magazine hope you have a great end of year and holiday season. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/best-of-2019-fedora-for-system-administrators/ + +作者:[Paul W. Frields][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/pfrields/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/12/2019top-sysadmins.png-816x345.jpg +[2]: https://www.redhat.com/en/blog/containers-are-linux +[3]: https://getfedora.org/coreos/ +[4]: https://fedoramagazine.org/introducing-fedora-coreos/ +[5]: https://fedoramagazine.org/initramfs-dracut-and-the-dracut-emergency-shell/ +[6]: https://fedoramagazine.org/reset-root-password-fedora/ +[7]: https://fedoramagazine.org/series/systemd-series/ +[8]: https://fedoramagazine.org/systemd-unit-dependencies-and-order/ +[9]: https://fedoramagazine.org/setting-kernel-command-line-arguments-with-fedora-30/ From 5c1d712ac48e50f9f49eddd6e7e744eb91de5a2d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 24 Dec 2019 00:56:30 +0800 Subject: [PATCH 031/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191224=20App=20?= =?UTF-8?q?Highlight:=20Falkon=20Open=20Source=20Web=20Browser=20from=20KD?= =?UTF-8?q?E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md --- ...Falkon Open Source Web Browser from KDE.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md diff --git a/sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md b/sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md new file mode 100644 index 0000000000..42439f33c1 --- /dev/null +++ b/sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (App Highlight: Falkon Open Source Web Browser from KDE) +[#]: via: (https://itsfoss.com/falkon-browser/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +App Highlight: Falkon Open Source Web Browser from KDE +====== + +_**Formerly known as Qupzilla, Falkon is a web browser based on QtWebEngine. In this week’s App Highlight, we take a look at this open source software.**_ + +### Falkon: Open Source Web Browser for Linux (and Windows) + +![][1] + +First thing first, [Falkon][2] is not a new web browser. It has been in development since 2010 but it was known as Qupzilla. + +In 2017, QupZilla moved under KDE umbrella and changed its name to Falkon. Being under KDE umbrella means that project is actively maintained following KDE standards. + +It uses the [QtWebEngine][3] rendering engine – which is a striped down version of Chromium core. + +In this article, I shall take a closer look at what it offers and how it’s different than other dominant web browsers on Linux out there. + +### Features of Falkon Browser + +Thought it may not be a popular browser, I did find it capable enough to browse modern web services. + +Let me highlight the key features of Falkon and if you find it interesting enough, give it a try. + +#### Simple User Interface + +![][4] + +I know it’s not exactly a “feature” but the user experience (UX) matters a lot. Despite being a lightweight browser, you have a decent looking interface here. You won’t feel like you are using a browser from the early 2000’s. + +#### AdBlock Extension + +![][5] + +It comes packed in with the AdBlock extension that works pretty well if you want to get rid of the advertisements while browsing a website. You can also customize the behavior of the AdBlock extension. + +#### DuckDuckGo Default Search Engine + +It’s a good thing to have one of the [privacy-oriented search engines][6] as the default search engine if you do not like using Google. + +#### Session Manager + +![][7] + +Falkon includes a useful session manager from the available options in the browser menu. You can restore a specific recent session using this – which should come in handy. + +#### Extension Support + +![][8] + +It does support adding extensions but you cannot add extensions from Chrome/Firefox add-on marketplace. You have a limited set of extensions to choose from. + +#### Theme Support + +Falkon also lets you customize the appearance to some extent. You can try them out if you want to change the appearance of the browser. + +![][9] + +#### Other Essential Settings + +![][10] + +I also explored other settings/functionalities like adding a bookmark or being able to manage the passwords. + +Or, maybe manage the notification access of a webpage. + +Oh, I also tried using YouTube – with no problems whatsoever. + +Of course, this isn’t an extensive review – but yes, Falkon does have all the essential options that you will need in a browser (unless you have a specific requirements). + +### Installing Falkon Browser + +You can easily find Falkon browser available in your Software Center. + +In case you don’t, you can find Flatpak/Snap packages available from its [official download page][11]. You’ll also find Windows installer files on the download page. + +[Download Falkon Browser][11] + +**Wrapping Up** + +As a KDE product, Falkon is tailored for KDE desktop environment. Some KDE distributions like OpenMandriva use Falkon as the default web browser. + +Falkon browser is for the ones looking for a lightweight and feature-rich web browser. An alternative worth taking a look is [Midori][12]. + +In my opinion, it is a good alternative browser – unless you need tons of extensions, cross-platform synchronization and require to access some browser-specific websites. + +What do you think about the Falkon browser? Let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/falkon-browser/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-screenshot.jpg?ssl=1 +[2]: https://www.falkon.org/ +[3]: https://wiki.qt.io/QtWebEngine +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser.png?ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-adblock.jpg?ssl=1 +[6]: https://itsfoss.com/privacy-search-engines/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/session-manager-falkon.jpg?ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-extensions.png?ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-theme.png?ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-preference.png?ssl=1 +[11]: https://www.falkon.org/download/ +[12]: https://itsfoss.com/midori-browser/ From cd1ad3ba2be103e6daf335499289cb8ba1d0223c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 24 Dec 2019 00:57:02 +0800 Subject: [PATCH 032/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191223=20Get=20?= =?UTF-8?q?back=20to=20basics=20with=20the=20TWM=20Linux=20desktop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191223 Get back to basics with the TWM Linux desktop.md --- ...ck to basics with the TWM Linux desktop.md | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 sources/tech/20191223 Get back to basics with the TWM Linux desktop.md diff --git a/sources/tech/20191223 Get back to basics with the TWM Linux desktop.md b/sources/tech/20191223 Get back to basics with the TWM Linux desktop.md new file mode 100644 index 0000000000..19b16daf6f --- /dev/null +++ b/sources/tech/20191223 Get back to basics with the TWM Linux desktop.md @@ -0,0 +1,109 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get back to basics with the TWM Linux desktop) +[#]: via: (https://opensource.com/article/19/12/twm-linux-desktop) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Get back to basics with the TWM Linux desktop +====== +This article is part of a special series of 24 days of Linux desktops. +TWM may be bare-bones by default, but it's a great foundation for a +customized Linux desktop that has all your favorite bits and pieces. +![Penguin driving a car with a yellow background][1] + +The most humble of window managers, TWM, is a little akin to those sample photographs you get when you buy a picture frame. It's basic, almost a bare-minimum proof of concept that Xorg ships with the [X11][2] Windows System to demonstrate that a desktop can indeed be created for a graphical user interface (GUI). + +Some distributions treat it as a fallback window manager that can be launched in a pinch if you break your usual desktop and need a terminal just long enough for repairs. Now that Xorg is basically bulletproof and moving aside for [Wayland][3], sometimes TWM isn't even included at all. And yet, amazingly, TWM, short for either _Timeless Window Manager_ or _Tabbed Window Manager_, depending on who you ask, has some fun features and configuration options. + +![TWM][4] + +Your distribution (XQuartz on Mac OS included) may discreetly include TWM as a fallback window manager. Otherwise, you are likely to find it in your software repository, and you can also get it from the [Freedesktop][5] GitHub repository. If you're already running a different desktop, it's safe to install TWM on the same system because it doesn't include any bundled applications aside from a few configuration panels. + +After installing, log out of your current desktop session so you can log into TWM. By default, your session manager (KDM, GDM, LightDM, or XDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging into your new one. + +With GDM: + +![Selecting your desktop in GDM][6] + +With SDDM: + +![Selecting your desktop in KDM][7] + +### Desktop tour + +TWM's basic configuration is usually unspectacular. Here's TWM on my Slackware system: + +![TWM by default][8] + +You can get a pop-up menu with a left-click on the desktop. By default, it has one application listed: xterm. When you launch xterm, the outline of a window appears until you click to place it on the desktop. + +More actions are available with a right-click or a middle-click on the desktop or a window's title bar. For instance, to resize a window, you can middle-click the title bar and select **Resize**; this places you into resize mode so you can drag your mouse across the edge of the window you want to make smaller or larger. Click again to confirm the new size. + +When you right-click the icon in the upper-left corner of any window, that window is minimized into a desktop icon (a precursor to the OS X dock). You can drag this icon anywhere on your desktop and right-click on it to restore it back to a full-sized window. + +These are all old Unix conventions; tricks of the visual interface that long-time Unix users will remember fondly but are utterly baffling at first to new users. You can learn to love them by using TWM, but if you do that, you'll no doubt want something a little prettier and more tailored to your daily workflow. + +### TWM configuration + +One of my favorite sites is [Linux Questions][9], a tried-and-true Linux support forum. I stumbled across a post there about TWM, where user **rkfb** was, apparently in all seriousness, praising TWM as his favorite lightweight window manager. What's more, **rkfb** had [the config file to prove it][10]. + +I downloaded the sample **.twmrc** file and discovered that there are a surprising number of options and features in TWM. Like other "building-block" window managers, such as [FVWM][11] or [MLVWM][12], it takes a lot of work to customize it and bring it up to modern expectations. You can also add the usual laundry list of applications to TWM. For instance, you could run [Tint2][13] or [Xfce-panel][14] to provide a traditional taskbar and other applets, or [stalonetray][15] for a system tray, and [vdesk][16] to provide virtual desktops, but then again, TWM isn't meant to be a _modern_ window manager, but a _timeless_ window manager. You may not want to make it too modern. + +There are _lots_ of options and definitions in the config file for TWM. Two of my favorites are **RandomPlacement** (an option to activate random placement of windows, so you don't have to manually click to set the location of each window you launch) and **ShowIconManager** (which displays a vertical taskbar). + +The syntax to define the contents of the menus is pretty easy to understand: + + +``` +menu "Shells" { +   "Shells"     f.title +   "rxvt"               f.exec "urxvt -fg cyan -bg black -cr white &" +   "Konsole"    f.exec "konsole &" +} +``` + +Color themes are similarly intuitive from the sample file. + +You can set a background using the **feh** command (you probably need to install it first): + + +``` +`$ feh --bg-fill ~/christopher-burns_unsplash.jpg` +``` + +### Old TWM is new TWM + +TWM looks and feels like an artifact of a bygone era, when desktops were simpler in design but complex in configuration. It's probably not the best or the most flexible window manager available, but it's surprisingly configurable. You can use it as the foundation of a customized desktop consisting of all your favorite desktop bits and pieces. You can spend the time to make TWM something you enjoy using, and you'll learn a lot about interface design, Unix history, and pixmap bit depth along the way. Give TWM another look, and make that look beautiful. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/twm-linux-desktop + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) +[2]: https://en.wikipedia.org/wiki/X_Window_System +[3]: https://wayland.freedesktop.org/ +[4]: https://opensource.com/sites/default/files/uploads/advent-twm.jpg (TWM) +[5]: https://github.com/freedesktop/twm +[6]: https://opensource.com/sites/default/files/uploads/advent-gdm_3.jpg (Selecting your desktop in GDM) +[7]: https://opensource.com/sites/default/files/uploads/advent-kdm_2.jpg (Selecting your desktop in KDM) +[8]: https://opensource.com/sites/default/files/uploads/advent-twm-basic.jpg (TWM by default) +[9]: http://linuxquestions.org +[10]: https://www.linuxquestions.org/questions/linux-desktop-74/share-your-configuration-file-of-twm-best-x-windows-manager-4175585974 +[11]: https://opensource.com/article/19/12/fvwm-linux-desktop +[12]: https://opensource.com/article/19/12/linux-mlvwm-desktop +[13]: https://opensource.com/article/19/1/productivity-tool-tint2 +[14]: https://opensource.com/article/19/12/xfce-linux-desktop +[15]: http://stalonetray.sourceforge.net/ +[16]: https://offog.org/code/vdesk From f69ba8c0361123a8902f76a66a6e02bd7d87c4eb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 24 Dec 2019 00:57:37 +0800 Subject: [PATCH 033/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191223=2010=20a?= =?UTF-8?q?rticles=20to=20learn=20Linux=20your=20way?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191223 10 articles to learn Linux your way.md --- ...223 10 articles to learn Linux your way.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/tech/20191223 10 articles to learn Linux your way.md diff --git a/sources/tech/20191223 10 articles to learn Linux your way.md b/sources/tech/20191223 10 articles to learn Linux your way.md new file mode 100644 index 0000000000..0ef668ad28 --- /dev/null +++ b/sources/tech/20191223 10 articles to learn Linux your way.md @@ -0,0 +1,96 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 articles to learn Linux your way) +[#]: via: (https://opensource.com/article/19/12/learn-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +10 articles to learn Linux your way +====== +It's been a good year for Linux, so take a look back at the top 10 Linux +articles on Opensource.com from 2019. +![Penguins gathered together in the Artic][1] + +The year 2019 has been good for Linux with Opensource.com readers. Obviously, the term "Linux" itself is weighted: Does it refer to the kernel or the desktop or the ecosystem? In this look back at the top Linux articles of the year, I've intentionally taken a broad view in defining the top 10 Linux articles (for some definition of "top" and some definition of "Linux"). Here they are, offered in no particular order. + +### A beginner's guide to Linux permissions + +[_A beginner's guide to Linux permissions_][2] by Bryant Son introduces new users to the concept of file permissions with graphics and charts to illustrate each point. It can be hard to come up with visuals for concepts that are, at their core, purely text-based, and this article is friendly for the visual learners out there. I also like how Bryant stays focused. Any discussion of file permissions can lead to several related topics (like ownership and access control lists and so on), but this article is dedicated to explaining one thing and explaining it well. + +### Why I made the switch from Mac to Linux + +Matthew Broberg offers an insightful and honest look at his migration to Linux from MacOS in [_Why I made the switch from Mac to Linux_][3]. Changing platforms is always tough, and it's important to record what's behind the decision to switch. Matt's article, I think, serves several purposes, but the two most important for me: it's an invitation for the Linux community to support him by answering questions and offering potential solutions, and it's a good data point for others who are considering Linux adoption. + +### Troubleshooting slow WiFi on Linux + +In [_Troubleshooting slow WiFi on Linux_][4], David Clinton provides a useful analysis of a problem everyone has on every platform—and has tips on how to solve it. It's a good example of an "incidentally Linux" tip that not only helps everyday people with everyday problems but also shows non-Linux users how approachable troubleshooting (on any platform) is. + +### How GNOME uses Git + +[_How GNOME uses Git_][5] by Molly de Blanc takes a look behind the scenes, revealing how one of the paragons of open source software (the GNOME desktop) uses one of the other paragons of open source (Git) for development. It's always heartening to me to hear about an open source project that defaults to an open source solution for whatever needs to be done. Believe it or not, this isn't always the case, but for GNOME, it's an important and welcoming part of the project's identity. + +### Virtual filesystems in Linux: Why we need them and how they work + +Alison Chaiken masterfully explains what is considered incomprehensible to many users in [_Virtual filesystems in Linux: Why we need them and how they work_][6]. Understanding what a filesystem is and what it does is one thing, but _virtual_ ones aren't even, by definition, real. And yet Linux delivers them in a way that even casual users can benefit from, and Alison's article explains it in a way that anyone can understand. As a bonus, Alison goes even deeper in the second half of the article and demonstrates how to use bcc scripts to monitor everything she just taught you. + +### Understanding file paths and how to use them + +I thought [_Understanding file paths and how to use them_][7] was important to write about because it's a concept most users (on any platform) don't seem to be taught. It's a strange phenomenon, because now, more than ever, the _file path_ is something people see literally on a daily basis: Nearly all internet URLs contain a file path telling you exactly where within the domain you are. I often wonder why computer education doesn't start with the internet, the most familiar app of all and arguably the most heavily used supercomputer in existence, and use it to explain the appliances we interface with each day. (I guess it would help if those appliances were running Linux, but we're working on that.) + +### Inter-process communication in Linux + +[_Inter-process communication in Linux: Shared storage_][8] by Marty Kalin delves into the developer side of Linux, explaining IPC and how to interact with it in your code. I'm cheating by including this article because it's actually a three-part series, but it's the best explanation of its kind. There is very little documentation that manages to explain how Linux handles IPC, much less what IPC is, why it's important, or how to take advantage of it when programming. It's normally a topic you work your way up to in university. Now you can read all about it here instead. + +### Understanding system calls on Linux with strace + +[_Understanding system calls on Linux with strace_][9] by Gaurav Kamathe is highly technical in ways I wish that every conference talk I've ever seen about **strace** was. This is a clear and helpful demonstration of a complex but amazingly useful command. To my surprise, the command I've found myself using since this article isn't the titular command, but **ltrace** (to see which functions are called by a command). Obviously, this article's packed with information and is a handy reference for developers and QA testers. + +### How the Linux desktop has grown + +[_How the Linux desktop has grown_][10] by Jim Hall is a visual journey through the history of the Linux desktop. It starts with [TWM][11] and passes by [FVWM][12], [GNOME][13], [KDE][14], and others. If you're new to Linux, this is a fascinating history lesson from someone who was there (and has the screenshots to prove it). If you've been with Linux for many years, then this will definitely bring back memories. In the end, though, one thing is certain: Anyone who can still locate screenshots from 20 years ago is a superhuman data archivist. + +### Create your own video streaming server with Linux + +[_Create your own video streaming server with Linux_][15] by Aaron J. Prisk breaks down more than just a few preconceptions most of us have about the services we take for granted. Because services like YouTube and Twitch exist, many people assume that those are the only gateways to broadcasting video to the world. Of course, people used to think that Windows and Mac were the only gateways into computing, and that, thankfully, turned out to be a gross miscalculation. In this article, Aaron sets up a video-streaming server and even manages to find space to talk about [OBS][16] in so you can create videos to stream. Is it a fun weekend project or the start of a new career? You decide. + +### 10 moments that shaped Linux history + +[_10 moments that shaped Linux history_][17] by Alan Formy-Duval attempts the formidable task of choosing just 10 things to highlight in the history of Linux. It's an exercise in futility, of course, because there have been so many important moments, so I love how Alan filters it through his own experience. For example, when was it obvious that Linux was going to last? When Alan realized that all the systems he maintained at work were running Linux. There's a beauty to interpreting history this way because the moments of importance will differ for each person. There's no definitive list for Linux, or articles about Linux, or for open source. You make your own list, and you make yourself a part of it. + +### What do you want to learn? + +What else do you want to know about Linux? Please tell us about it in the comments, or [write an article][18] for Opensource.com about your experience with Linux. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/learn-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_Penguin_Image_520x292_12324207_0714_mm_v1a.png?itok=p7cWyQv9 (Penguins gathered together in the Artic) +[2]: https://opensource.com/article/19/6/understanding-linux-permissions +[3]: https://opensource.com/article/19/10/why-switch-mac-linux +[4]: http://opensource.com/article/19/4/troubleshooting-wifi-linux +[5]: https://opensource.com/article/19/10/how-gnome-uses-git +[6]: https://opensource.com/article/19/3/virtual-filesystems-linux +[7]: https://opensource.com/article/19/8/understanding-file-paths-linux +[8]: https://opensource.com/article/19/4/interprocess-communication-linux-storage +[9]: https://opensource.com/article/19/2/linux-backup-solutions +[10]: https://opensource.com/article/19/8/how-linux-desktop-grown +[11]: https://github.com/freedesktop/twm +[12]: http://www.fvwm.org/ +[13]: http://gnome.org +[14]: http://kde.org +[15]: https://opensource.com/article/19/1/basic-live-video-streaming-server +[16]: https://opensource.com/life/15/12/real-time-linux-video-editing-with-obs-studio +[17]: https://opensource.com/article/19/4/top-moments-linux-history +[18]: https://opensource.com/how-submit-article From e25b656c7351bedf64a60486bcf90acf68455c00 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 24 Dec 2019 00:58:03 +0800 Subject: [PATCH 034/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191223=2010=20r?= =?UTF-8?q?esources=20to=20become=20a=20better=20Bash=20user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191223 10 resources to become a better Bash user.md --- ... resources to become a better Bash user.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20191223 10 resources to become a better Bash user.md diff --git a/sources/tech/20191223 10 resources to become a better Bash user.md b/sources/tech/20191223 10 resources to become a better Bash user.md new file mode 100644 index 0000000000..b00f359d4d --- /dev/null +++ b/sources/tech/20191223 10 resources to become a better Bash user.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 resources to become a better Bash user) +[#]: via: (https://opensource.com/article/19/12/bash-resources) +[#]: author: (David Both https://opensource.com/users/dboth) + +10 resources to become a better Bash user +====== +Take a look through our top 10 Bash articles from 2019. +![bash logo on green background][1] + +As another great year wraps up at Opensource.com, my fascination with all things [Bash][2] has me looking back at the top 10 Bash articles we published in 2019. These articles include basic how-to articles, tools, shortcuts, and even a way to build your own command-line game with Bash. + +I didn't select these articles based solely on the number of hits they had but rather on a number of criteria. In the true spirit of top 10 countdowns, the top Bash article from 2019 is at the end for the final reveal. + + 10. [_Bash vs. Python: Which language should you use?_][3] by Archit Modi looks at the strengths and weaknesses of these popular languages. Although both have many good points, the bottom line—as with most things Linux—is, "it depends." + + + 9. [_How to program with Bash: Logical operators and shell expansions_][4] is the second in a three-part series I wrote about Bash programming. This article lists all of the Bash logical operators and provides some easy examples for using them. It also discusses five of the seven types of shell expansions and includes easy-to-understand examples that help to clarify how these expansions work. + + + 8. Abhishek Tamrakar shows us how to _[Hone advanced Bash skills by building Minesweeper][5]._ This is an interesting, fun, and informative way to improve the Bash skills you already have. When finished, you have a working command-line game of Minesweeper and some serious skills. This article is one of my favorites because it not only stretches our skills, but it illustrates the power of Bash as a programming language. + + + 7. [_How to program with Bash: Syntax and tools_][6] is the first article in my Bash programming series. In addition to introducing Bash as a programming language, it looks at the basic syntax of Bash programming, the use of variables, and flow control. + + + 6. Matthew Broberg's [_The birth of the Bash shell_][7] delves into the history of the Bash shell with a look at how it all started with Unix and the original (Ken) Thompson shell. As someone who appreciates the historical roots of Linux and many of its components, I gained some new insights from this article. + + + 5. Seth Kenlon contributed _[How to write a loop in Bash][8],_ which explores the _for_ loop in some detail. A _for_ loop is a recipe detailing what actions you want your computer to take for each data object (such as a file) you specify. This article has some excellent examples to get you started and shows the power that loops can bring to Bash scripts. + + + 4. _[7 Bash history shortcuts you will actually use][9]_ shows how to save time on the command line by using Bash shortcuts. Ian Miell describes time-saving tools that go far beyond just simple command-line recall. These are very cool, and I especially like the easy method for reissuing the previous command while reordering the arguments. + + + 3. Seth Kenlon also shows some [_Bash aliases you can't live without_][10] that will save even more time. This article takes us through one of the ways that we "lazy sysadmins" can become even more efficient than we already are. This is all about less typing while getting more results. + + + 2. I always recommend testing scripts to ensure that they do what they are intended to—and that they don't create any other problems while doing so. Darin London introduces us to _[Testing Bash with BATS][11],_ the Bash Automated Testing System, a TAP-compliant testing framework for Bash. The [Test Anything Protocol][12] is also used for testing many other Unix languages. This article is loaded with examples and recommendations for structuring Bash programs so that they can be tested easily with this tool. + + + 1. Our number 1 spot for 2019 is—drum-roll—Seth Kenlon with [_3 command line games for learning Bash the fun way_][13]. Learning is work, but it can be fun. If you are into games (and it seems that we sysadmins like to have fun), this article looks at three tools for learning more about Bash for everyone from noobs to gurus. Everything you do in the game of Bashcrawl, for example, is a valid Bash command that you can use later in real life, and playing the game provides Bash practice because the "game" is made out of actual directories and files on your computer. + + + +These articles can help you learn Bash and some of its many powerful features. I have certainly learned a lot from them. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/bash-resources + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: https://opensource.com/downloads/bash-cheat-sheet +[3]: https://opensource.com/article/19/4/bash-vs-python +[4]: https://opensource.com/article/19/10/programming-bash-logical-operators-shell-expansions +[5]: https://opensource.com/article/19/9/advanced-bash-building-minesweeper +[6]: https://opensource.com/article/19/10/programming-bash-syntax-tools +[7]: https://opensource.com/19/9/command-line-heroes-bash +[8]: https://opensource.com/article/19/6/how-write-loop-bash +[9]: https://opensource.com/article/19/10/bash-history-shortcuts +[10]: https://opensource.com/article/19/7/bash-aliases +[11]: https://opensource.com/article/19/2/testing-bash-bats +[12]: https://testanything.org/producers.html +[13]: https://opensource.com/article/19/10/learn-bash-command-line-games From 9333f151d3e9a6513649b0e5e396d449b90ea924 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 24 Dec 2019 00:58:25 +0800 Subject: [PATCH 035/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191223=20Priori?= =?UTF-8?q?tizing=20simplicity=20in=20your=20Python=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191223 Prioritizing simplicity in your Python code.md --- ...ritizing simplicity in your Python code.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/tech/20191223 Prioritizing simplicity in your Python code.md diff --git a/sources/tech/20191223 Prioritizing simplicity in your Python code.md b/sources/tech/20191223 Prioritizing simplicity in your Python code.md new file mode 100644 index 0000000000..53662a8f1c --- /dev/null +++ b/sources/tech/20191223 Prioritizing simplicity in your Python code.md @@ -0,0 +1,59 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Prioritizing simplicity in your Python code) +[#]: via: (https://opensource.com/article/19/12/zen-python-simplicity-complexity) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Prioritizing simplicity in your Python code +====== +This is the second part of a special series about the Zen of Python +focusing on the third and fourth principles: simplicity and complexity. +![Person reading a book and digital copy][1] + +> "Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y plus rien à retrancher." +> +> "It seems that perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away." +> —Antoine de Saint-Exupéry, _[Terre des Hommes][2]_, 1939 + +A common concern in programming is the struggle with complexity. It is easy for any programmer to make a program so complicated no expert can debug it or modify it. The [Zen of Python][3] would not be complete if it did not touch on this. + +### Simple is better than complex. + +When it is possible to choose at all, choose the simple solution. Python is rarely in the business of _disallowing_ things. This means it is possible, and even straightforward, to design baroque programs to solve straightforward problems. + +It is worthwhile to remember at each point that simplicity is one of the easiest things to lose and the hardest to regain when writing code. + +This can mean choosing to write something as a function, rather than introducing an extraneous class. This can mean avoiding a robust third-party library in favor of writing a two-line function that is perfect for the immediate use-case. Most often, it means avoiding predicting the future in favor of solving the problem at hand. + +It is much easier to change the program later, especially if simplicity and beauty were among its guiding principles than to load the code down with all possible future variations. + +### Complex is better than complicated. + +This is possibly the most misunderstood principle because understanding the precise meanings of the words is crucial. Something is _complex_ when it is composed of multiple parts. Something is _complicated_ when it has a lot of different, often hard to predict, behaviors. + +When solving a hard problem, it is often the case that no simple solution will do. In that case, the most Pythonic strategy is to go "bottom-up." Build simple tools and combine them to solve the problem. + +This is where techniques like _object composition_ shine. Instead of having a complicated inheritance hierarchy, have objects that forward some method calls to a separate object. Each of those can be tested and developed separately and then finally put together. + +Another example of "building up" is using [singledispatch][4], so that instead of one complicated object, we have a simple, mostly behavior-less object and separate behaviors. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-simplicity-complexity + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (Person reading a book and digital copy) +[2]: https://en.wikipedia.org/wiki/Wind,_Sand_and_Stars +[3]: https://www.python.org/dev/peps/pep-0020/ +[4]: https://opensource.com/article/19/5/python-singledispatch From f799306115690661058b3d43bb8a0d1561ca7093 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 24 Dec 2019 01:06:47 +0800 Subject: [PATCH 036/430] =?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 --- .../20190711 DevOps for introverted people.md | 73 ------------------- .../20190711 DevOps for introverted people.md | 72 ++++++++++++++++++ 2 files changed, 72 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20190711 DevOps for introverted people.md create mode 100644 translated/tech/20190711 DevOps for introverted people.md diff --git a/sources/tech/20190711 DevOps for introverted people.md b/sources/tech/20190711 DevOps for introverted people.md deleted file mode 100644 index da1778573c..0000000000 --- a/sources/tech/20190711 DevOps for introverted people.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( XLCYun ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (DevOps for introverted people) -[#]: via: (https://opensource.com/article/19/7/devops-introverted-people) -[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg/users/don-watkins/users/shawnhcorey/users/mbbroberg/users/marcobravo) - -DevOps for introverted people -====== -We asked the Opensource.com DevOps team to talk about their experience -as DevOps introverts and to give DevOps extroverts some advice. Here are -their answers. -![Q and A letters][1] - -We asked members of our [DevOps team][2] to talk about their experience as introverts and to give extroverts some advice. Before we get into their responses, though, let’s first define the term. - -### What does being introverted mean? - -Being an introvert is commonly defined as someone who finds it more energy depleting, as opposed to energizing, to be around people. It can be a helpful term when we think about how we recharge: introverted people may require more alone time to recharge, especially after spending a lot of time around groups of people. A big myth about introverts is that they are necessarily shy, but [science suggests][3] that is a separate personality trait. - -Introversion and extraversion were popularized by the [Myers Briggs Type Indicators][4] and are now more commonly referred to as two ends of the same [spectrum][5]. Even though it may seem that there are more extroverted people in the world than introverts, psychologists tend to believe that a majority of us fall along the spectrum closer to [ambiverts or introverts][6]. - -Now, on to the questions and answers. - -### What are some techniques DevOps leaders can use to make sure introverts feel like part of the team and increase their willingness to share ideas? - -"Everyone is a little different, so it’s important to be observant. Someone from GitLab once told me their philosophy is that if you aren’t offering your opinion, then they’re being exclusionary. If someone isn’t offering an opinion in a meeting, then find ways to include them. **When I know an introvert is interested in a topic we’re meeting about, I’ll ask in advance for written input. A lot of meetings can be avoided by moving the discussion to slack or GitLab where introverts are more willing to engage.** In stand-up, everyone gives an update, and introverts seem to do fine in this context. So we sometimes do the same thing in other meetings just to make sure everyone has time to speak. I also encourage introverts to speak in front of small groups either at work or in the community in order to build those skills." —Dan Barker - -"**I think the best thing that anyone ever did for me was to make sure I had the skills necessary to answer the big questions when they came.** As a very young enlisted Air Force member I was giving status briefings to my units’ senior leadership. That required that I have a number of data points available at any given moment as well as the why behind any delays or deviations on the way towards established objectives. That propelled me from a behind the scenes person into being willing to share my opinion and thoughts with others." —Chris Short - -"**Lead through culture. Design and try out a ritual for your co-workers.** You can design a smaller weekly ritual for groups or teams or a bigger yearly event for your department or organization. The point is to try something and observe your leadership role in it. Identify gaps or tensions in your culture. Look back at the beliefs and behaviors of teams. Where do you observe tension? What’s missing from your culture? Start with a simple statement 'I see a tension between X and Y'. Or 'My team is missing Z'. Next, flip the gap or tension into a question: write down 3 'How might we’s (HMWs)'." —Catherine Louis - -"Introverts are not a different class of people, they are either people who think or wait too much before they share their mind or people who have no idea what's going on. I was one among the first category, I thought too much and sometimes worried about what if my opinion is laughed upon or not entertained or thought otherwise. It was hard coming up of that kind of mindset but it was also eating my chances of learning better things. Once, we were discussing in the team about an implementation issue. My then manager asked me one on one, why I am not participating as I am one of the more experienced people on the team, and I opened up (after I gathered all the power in the universe to say something) saying everything I wanted to say was already shared. He suggested 'I could use a repetition sometimes, as there are many things going on, it would be helpful if you just repeat your thought even if it is discussed'. Well, that was not a very persuasive way but that gave me a bit of confidence that someone at-least wants to hear me. - -"Now, the way I used to make people speak in my team, is **I often ask the introvert person for help, even if I know the resolution, and appreciate them in team meetings and discussions to boost up their confidence encouraging them to share more knowledge with the team, by slowly giving them time to come out of their reserved nature**. They may still remain a bit isolated in the outer world but within a team, some emerge a player we can count on." —Abhishek Tamrakar - -"My advice to introverts when participating in conferences is to find friends/colleagues who are also attending so you have people to talk to comfortably, reach out prior to the event to schedule some smaller meetings/meals with other attendees (friends, industry contacts, former colleagues, etc.), **be mindful of your exhaustion level and take care of yourself**: skip the social/evening events if you need to recharge, write about your experience in a post-event retrospective." —Elizabeth Joseph - -### What are some tips for increasing productivity when working with a teammate who tends to be more of an introvert? - -"Productivity is increasingly challenging to really qualify. In many cases, a break from work or a casual conversation can be the spark needed in our creative endeavors. Again, I find slack and GitLab to be very helpful mediums for exchanging ideas and interacting with others when you have introverts on your team. **I also find pair programming to be very useful for most introverts as one on one interactions aren’t usually as taxing but the product quality and efficiency gains are substantial.** However, when an introvert is working alone, everyone on the team should be discouraged from interrupting them. It’s best to send them an email or some non-intrusive medium." —Dan Barker - -"Give them great tools for doing and documenting their work. **Enable them to be the best they can be at their job.** Check in with them frequently enough to make sure they’re on the right track but also be mindful it’s a bigger distraction to them than it is more extroverted people." —Chris Short - -"**Don’t interrupt me when I am heads down.** Really, don’t. It could take me 2 hours minimally to get my brain back to where I was when I was knee deep in something. It feels painful. Really. Instead, email me and ask me to come to a place where there is a whiteboard. Share the problem from the customer's point of view—draw it—not from your point of view. I may have dozens of customer issues niggling in the back of my brain. If your issues sound like 'make me look good to my upper management', it will get less attention from me than the true customer's issues I already have. Draw a picture. Give me time to think. Make sure there is more than one marker in case I am ready to share. Be prepared that your hypothesis about the problem is completely wrong." —Catherine Louis - -"Appreciation and encouragement is the way out, appreciation may not be an appraisal, but an appreciation that encourages people to feel comfortable in presence of more than one living entities, **so that everyone feels heard and not laughed or underrated**." —Abhishek Tamrakar - -### Final thoughts - -The biggest takeaway from our conversations on introverted DevOps enthusiasts is one of equity: Treat people as they need to be treated, and ask people to treat you as you want to be treated. Whether you are extroverted or introverted, we all need to respect the fact that we do not all experience the world in the same way. Our colleagues deserve the space they need to get the work done, and knowing how to support them starts with a discussion on their needs. Our differences are what make our communities so special and it makes our work more useful for more people. The most effective way to communicate with others is to communicate in a style that works well for both of you. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/7/devops-introverted-people - -作者:[Matthew Broberg][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mbbroberg/users/don-watkins/users/shawnhcorey/users/mbbroberg/users/marcobravo -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_QandAorange_520x292_0311LL.png?itok=qa3hHSou (Q and A letters) -[2]: https://opensource.com/devops-team -[3]: https://www.inc.com/melanie-curtin/are-you-shy-or-introverted-science-says-this-is-1-primary-difference.html -[4]: https://www.myersbriggs.org/my-mbti-personality-type/mbti-basics/extraversion-or-introversion.htm?bhcp=1 -[5]: https://lifehacker.com/lets-quit-it-with-the-introvert-extrovert-nonsense-1713772952 -[6]: https://www.psychologytoday.com/us/blog/the-gen-y-guide/201710/the-majority-people-are-not-introverts-or-extroverts diff --git a/translated/tech/20190711 DevOps for introverted people.md b/translated/tech/20190711 DevOps for introverted people.md new file mode 100644 index 0000000000..78ab1667b4 --- /dev/null +++ b/translated/tech/20190711 DevOps for introverted people.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: (XLCYun) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (DevOps for introverted people) +[#]: via: (https://opensource.com/article/19/7/devops-introverted-people) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg/users/don-watkins/users/shawnhcorey/users/mbbroberg/users/marcobravo) + +内向者的 DevOps +====== +我们请求 Opensource.com 的 DevOps 团队,希望他们能够谈一谈作为 DevOps 内向者的休验,同时给 DevOps 外向者一些建议。下面是他们的回答。 + +![问答][1] + +我们请求我们的 [DevOps 团队][2] 谈一谈他们作为一个内向者的体验,并给外向者们一些建议。但是在我们开始了解他们的回答之前,让我们先来定义一下这些词汇。 + +### “内向者”是什么意思? + +内向者通常指的是一部分人群,当他们和别人相处的时候,会使他们的能量耗尽,而不是激发他们更多的能量。当我们思考我们是如何恢复能量时,这是一个非常有用的词汇:内向者通常需要更多的独处时间来恢复能量,特别是和一群人在一起很长时间后。关于内向者的一个非常大的误解就是他们一定是“害羞的”,但是科学表明,那不过是另一种不同的性格特征。 + +内向性与外向性是通过 [Myers Briggs 类型指标][4] 而为人所知的,现在也常常被称作一个 [光谱][5] 的两端。虽然这个世界看起来好像外向者比内向者要多,但是心理学者则倾向于认为大部分人在光谱上的位置是落在 [中间性格或偏内向性格的][6]。 + +现在,我们来看看问答。 + +### DevOps 技术主管可以通过哪些方式来让内向者感觉他们是团队的一部分并且愿意分享他们的想法? + +“每个人都会不大一样,所以观察敏锐就很重要了。从 GitLab 过来的一个人告诉我,他们的哲学就是如果他们没有提供任何意见,那么他们就是被排除在外的。如果有人在一个会议上没有提供任何的意见,那就想办法让他们加入进来。**当我知道一个内向者对我们将要讨论的会议论题感兴趣的时候,我会提前请他写一些书面文本。有非常多的会议其实是可以避免的,只要通过把讨论放到 Slack 或者 GitLab 上就行了,内向者会更愿意参与进来**。在站立会议中,每个人都会交代最新的进展,在这个环境下,内向者表现得很好。有时候我们在其实会议上会重复做一些事情,仅仅是为了保证每个人都有时间发言。我同时也会鼓励内向者在工作小组或者社区小组面前发言,以此来锻炼他们的这些技能。—— 丹·巴克 + +“**我觉得别人对我做的最好的事情,就是他们保证了当重大问题来临的时候,我拥有必要的技能去回答它**。彼时,我作为一名非常年轻的入伍空军的一员,我需要给我们部队的高级领导做状态简报的汇报。我必须在任何时候都有一些可用的数据点,以及在实现我们确立的目标的过程中,产生延误以及偏差的背后的原因。那样的经历推动着我从一个“幕后人员”逐渐变得更加愿意和别人分享自己的观点和想法。 + +“**通过文化去领导。为你的同僚一起设计和尝试仪式。**你可以为给你的小组或团队设计一个小的每周仪式,甚至给你的部门或组织设计一个年度的大仪式。它的意义在于去尝试一些事物,并观察你在其中的领导角色。去找到你们文化当中的代沟以及对立。回顾团队的信仰和行为。你能从哪里观察到对立?你们的文化中缺失了什么?从一个小陈述开始‘我从 X 和 Y 之间看到了对立’,或者‘我的团队缺少了 Z’。接着,将代沟与对立转换为问题:写下三个‘我们如何能……(How might we's, HMWs)’。”——凯瑟琳·路易斯 + +“内向者不是一个不同的群体,他们要么是在分享他们的想法之前想得太多或等得太久的一些人,要么就是一些根本不知道发生了什么的人。我就是第一种,我想太多了,有时候还担心我的意见会被其他人嘲笑,或者没有什么意思,或者想偏了。形成那样的思维方式很难,但它同时也在吞噬着我学习更好事物的机会。有一次,我们团队在讨论一个实现问题。我当时的老大一次又一次地问我,为什么我没有作为团队中更具经验的人参与进来,然后我就(集齐了全宇宙的力量之后)开口说我想说的大家都已经说过了。他说,有时候我可以重复说一次,事情纷繁,如果你能够重复一遍你的想法,即使它已经被讨论过了,也会大有裨益。好吧,虽然它不是一种特别信服的方式,但是我知道了至少有人想听听我怎么说,它给了我一点信心。 + +“现在,我所使用的让团队中的人发言的方法是**我经常向内向的人求助,即使我知道解决方法,并且在团队会议和讨论中感谢他们来建立他们的自信心,通过给他们时间让他们一点一点的从他们寡言的本性中走出来,从而跟团队分享很多的知识**。他们在外面的世界中可能仍然会有一点点孤立,但是在团队里面,有些会成为我们可以信赖的人。——阿布希什克·塔姆拉卡尔 + +“我给参加会议的内向者的建议是,找一个同样要参加会议的朋友或者同事,这样到时你就会有人可以跟你一起舒服地交谈,在会议开始之前,提前跟其他的与会者(朋友,行业联系人,前同事等等)约着见个面或者吃顿饭,**要注意你的疲劳程度,并且照顾好自己**:如果你需要重新恢复能量,就跳过那些社交或者夜晚的活动,在事后回顾中记录一下自己的感受。”——伊丽莎白·约瑟夫 + +### 和一个内向者倾向的同事一起工作时,有什么提高生产效率的小建议? + +“在保证质量时,生产效率会越来越具备挑战性。在大多数时候,工作中的一个小憩或者轻松随意的交谈,可能正是我们的创造性活动中需要的一个火花。再说一次,我发现当你的团队中有内向者时, Slack 和 Github 会是一个非常有用的用于交换想法以及和其他人互动的媒介。**我同时也发现,结对编程对于大部分的内向者也非常有用,虽然一对一的交流对于他们来说,并不像交税那么频繁,但是生产质量和效率的提升却是重大的**。但是,当一个内向者在独自工作的时间,团队中的所有人都不应该去打断他们。最好是发个邮件,或者使用没有那么强的侵入性的媒介。——丹·巴克 + +“给他们趁手的工具,让他们工作并归档他们的工作。**让他们能够在他们的工作上做到最好**。要足够经常地去检查一下,保证他们没有走偏路,但是要记住,相比外向者而言,这样做是更大的一种让人分心的困扰。 + +“**当我低着头的时候,不要打断我。真的,别打断我**!当我沉浸在某件事物中时,这样做会造成我至少需要花费两个小时,才能让我的大脑重新回到之前的状态。感觉很痛苦。真的。你可以发个邮件让我去有白板的地方。然后从客户的角度而不是你的角度——通过画图的方式——分享下有什么问题。要知道,可能同时会有十几个客户问题缠绕在我的脑海中,如果你的问题听起来就是“这样子做会让我在我的领导面前显得很好”的那一类问题,那么相比我脑袋中已经有的真正的客户问题而言,它不会得到更多的关注的。画个图,给我点时间思考。当我准备分享我的看法的时候,保证有多支马克笔可以使用。准备好接受你对问题的假设有可能完全是错误的。”——凯瑟琳·路易斯 + +“感谢和鼓励就是解决的方法,感谢可能不是一份工作评估,但是感谢能让人舒服地感受到自己并不仅仅是一个活着的独立实体,**因而每个人都能够感觉到自己是被倾听的,而不是被嘲笑或者低估的**。”——阿布希什克·塔姆拉卡尔 + +### 结语 + +在与内向的 DevOps 爱好者的这次交谈中,我们最大的启迪就是平等:其他人需要被怎样对待,就怎样对待他们,同时你想被怎样对待,就去要求别人怎样对待你。无论你是内向还是外向,我们都需要承认我们并非全以相同的一种方式体验这个世界。我们的同事应当被给予足够的空间以完成他们的工作,通过讨论他们的需求作为了解如何支持他们的开始。我们的差异正是我们的社区如此特别的原因,它让我们的工作对更多的人更加的有用。与别人沟通最有效的方式,就是对于你们两者而言都可行的方式。 + +-------------------------------------------------------------------------------- + +转载自: https://opensource.com/article/19/7/devops-introverted-people + +作者:[Matthew Broberg][a] +选题:[lujun9972][b] +译者:[XLCYun](https://github.com/XLCYun) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mbbroberg/users/don-watkins/users/shawnhcorey/users/mbbroberg/users/marcobravo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_QandAorange_520x292_0311LL.png?itok=qa3hHSou (Q and A letters) +[2]: https://opensource.com/devops-team +[3]: https://www.inc.com/melanie-curtin/are-you-shy-or-introverted-science-says-this-is-1-primary-difference.html +[4]: https://www.myersbriggs.org/my-mbti-personality-type/mbti-basics/extraversion-or-introversion.htm?bhcp=1 +[5]: https://lifehacker.com/lets-quit-it-with-the-introvert-extrovert-nonsense-1713772952 +[6]: https://www.psychologytoday.com/us/blog/the-gen-y-guide/201710/the-majority-people-are-not-introverts-or-extroverts From 37730c659bf00ccedb52cce84909fb5bdf83c9a1 Mon Sep 17 00:00:00 2001 From: XLCYun Date: Tue, 24 Dec 2019 01:07:26 +0800 Subject: [PATCH 037/430] Update 20190711 DevOps for introverted people.md --- translated/tech/20190711 DevOps for introverted people.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20190711 DevOps for introverted people.md b/translated/tech/20190711 DevOps for introverted people.md index 78ab1667b4..8422b1fb87 100644 --- a/translated/tech/20190711 DevOps for introverted people.md +++ b/translated/tech/20190711 DevOps for introverted people.md @@ -9,7 +9,7 @@ 内向者的 DevOps ====== -我们请求 Opensource.com 的 DevOps 团队,希望他们能够谈一谈作为 DevOps 内向者的休验,同时给 DevOps 外向者一些建议。下面是他们的回答。 +我们邀请 Opensource.com 的 DevOps 团队,希望他们能够谈一谈作为 DevOps 内向者的休验,同时给 DevOps 外向者一些建议。下面是他们的回答。 ![问答][1] From 5c6f3915ce8c8d2cf6a7b90e694e3758164d2173 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 24 Dec 2019 08:49:52 +0800 Subject: [PATCH 038/430] translated --- ...etro Apple desktop with the Linux MLVWM.md | 220 ------------------ ...etro Apple desktop with the Linux MLVWM.md | 218 +++++++++++++++++ 2 files changed, 218 insertions(+), 220 deletions(-) delete mode 100644 sources/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md create mode 100644 translated/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md diff --git a/sources/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md b/sources/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md deleted file mode 100644 index 4090744fb8..0000000000 --- a/sources/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md +++ /dev/null @@ -1,220 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Build a retro Apple desktop with the Linux MLVWM) -[#]: via: (https://opensource.com/article/19/12/linux-mlvwm-desktop) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Build a retro Apple desktop with the Linux MLVWM -====== -This article is part of a special series of 24 days of Linux desktops. -What if old-school Apple computers were built around open source POSIX? -You can find out by building the Macintosh-like Virtual Window Manager. -![Person typing on a 1980's computer][1] - -Imagine traveling into an alternate history where the Apple II GS and MacOS 7 were built upon open source [POSIX][2], using all the same conventions as modern Linux, like plain-text configuration files and modular system design. What would such an OS have enabled for its users? You can answer these questions (and more!) with the [Macintosh-like Virtual Window Manager (MLVWM)][3]. - -![MLVWM running on Slackware 14.2][4] - -### Installing MLVWM - -MLVWM is not an easy installation, and it's probably not in your distribution's software repository. If you have the time to decipher a poorly translated README file, edit some configuration files, gather and resize some old **.xpm** images, and edit an Xorg preference or two, then you can experience MLVWM. Otherwise, this is a novelty window manager with its latest release back in 2000. - -To compile MLVWM, you must have **imake** installed, which provides the **xmkmf** command. You can install imake from your distribution's software repository, or get it directly from [Freedesktop.org][5]. Assuming you have the **xmkmf** command, change into the directory containing the MLVWM source code, and run these commands to build it: - - -``` -$ xmkmf -a -$ make -``` - -After building, the compiled **mlvwm** binary is located in the **mlvwm** directory. Move it to any location [in your path][6] to install it: - - -``` -`$ mv mlvwm/mlvwm /usr/local/bin/` -``` - -#### Editing the config files - -MLVWM is now installed, but it won't launch correctly without adjusting several configuration files and carefully arranging required image files. Sample config files are located in the **sample_rc** directory of the source code you downloaded. Copy the files **Mlvwm-Netscape** and **Mlvwm-Xterm** to your home directory: - - -``` -`$ cp sample_rc/Mlvwm-{Netscape,Xterm} $HOME` -``` - -Move the **Mlvwmrc** file to **$HOME/.mlvwmrc** (yes, you must use a lower-case "m" even though the sample file deceptively begins with a capital letter): - - -``` -`$ cp sample_rc/Mlvwmrc $HOME/.mlvwmrc` -``` - -Open **.mlwmrc** and find lines 54–55, which define the path (the "IconPath") for the pixmap images that MLVWM uses in its menus and UI: - - -``` -# Set icon search path. It needs before "Style". -IconPath /usr/local/include/X11/pixmaps:/home2/tak/bin/pixmap -``` - -Adjust the path to match a directory you will fill with your own images (I suggest using **$HOME/.local/share/pixmaps**). MLVWM doesn't provide pixmaps, so it's up to you to provide pixmap icons for the desktop you're building. - -Do this even if you have pixmaps located elsewhere on your system (such as **/usr/share/pixmaps**), because you're going to have to adjust the size of the pixmaps, and you probably don't want to do that on a system-wide level. - - -``` -# Set icon search path. It needs before "Style". -IconPath /home/seth/.local/share/pixmaps -``` - -#### Choosing the pixmaps - -You've defined the **.local/share/pixmaps** directory as the source of pixmaps, but neither the directory nor the images exist yet. Create the directory: - - -``` -`$ mkdir -p $HOME/.local/share/pixmaps` -``` - -Right now, the config file assigns images to menu entries and UI elements, but none of those images exist on your system. To fix this, read through the configuration file and locate every **.xpm** image. For each image listed in the config, add an image with the same file name (or change the file name in the config file) to your IconPath directory. - -The **.mlvwmrc** file is well commented, so you can get a general idea of what you're editing. This is just a first pass, anyway. You can always come back and change the look of your desktop later. - -Here are some examples. - -This code block sets the icon in the upper-left corner of the screen: - - -``` -# Register the menu -Menu Apple, Icon label1.xpm, Stick -``` - -The **label1.xpm** image is actually provided in the source code download's **pixmap** directory, but I prefer to use **Penguin.xpm** from **/usr/share/pixmaps** (on Slackware). Whatever you use, you must place your custom pixmap in **~/.local/share/pixmaps** and either change the pixmap's name in the configuration or rename the pixmap file to match what's currently in the config file. - -This code block defines the applications listed in the left menu: - - -``` -"About this Workstation..." NonSelect, Gray, Action About -"" NonSelect -"Terminal"      Icon mini-display.xpm, Action Exec "kterm" exec kterm -ls -"Editor"  Action Exec "mule" exec mule, Icon mini-edit.xpm -"calculator" Action Exec "xcal" exec xcalc, Icon mini-calc.xpm -END -``` - -By following the same syntax as what you see in the configuration file, you can customize the pixmaps and add your own applications to the menu (for instance, I changed **mule** to **emacs**). This is your gateway to your applications in the MLVWM GUI, so list everything you want quick access to. You may also wish to include a shortcut to your **/usr/share/applications** folder. - - -``` -`"Applications" Icon Penguin.xpm, Action Exec "thunar /usr/share/applications" exec thunar /usr/share/applications` -``` - -Once you're finished editing the configuration file and adding your own images to your IconPath directory, your pixmaps must all be resized to roughly 16x16 pixels. (MLVWM isn't consistent in its defaults, so there's room for variation.) You can do this as a bulk action using ImageMagick: - - -``` -`$ for i in ~/.local/share/mlvwm-pixmaps/*xpm ; do convert -resize '16x16^' $i; done` -``` - -### Starting MLVWM - -The easiest way to get up and running with MLVWM is to let Xorg do the bulk of the work. First, you must create a **$HOME/.xinitrc** file. I borrowed this one from Slackware, which borrowed it from Xorg: - - -``` -#!/bin/sh -# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $ - -userresources=$HOME/.Xresources -usermodmap=$HOME/.Xmodmap -sysresources=/etc/X11/xinit/.Xresources -sysmodmap=/etc/X11/xinit/.Xmodmap - -# merge in defaults and keymaps - -if [ -f $sysresources ]; then -    xrdb -merge $sysresources -fi - -if [ -f $sysmodmap ]; then -    xmodmap $sysmodmap -fi - -if [ -f $userresources ]; then -    xrdb -merge $userresources -fi - -if [ -f $usermodmap ]; then -    xmodmap $usermodmap -fi - -# Start the window manager: -if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then -  exec ck-launch-session /usr/local/bin/mlvwm -else -  exec /usr/local/bin/mlvwm -fi -``` - -According to this file, the default action for the **startx** command is to launch MLVWM. However, your distribution may have other ideas about what happens when your graphic server launches (or is killed to be restarted), so this file may do you little good. On many distributions, you can add a **.desktop** file to **/usr/share/xsessions** to have it listed in the GDM or KDM menu, so create a file called **mlvwm.desktop** and enter this text: - - -``` -[Desktop Entry] -Name=Mlvwm -Comment=Macintosh-like virtual window manager -Exec=/usr/local/bin/mlvwm -TryExec=ck-launch-session /usr/local/bin/mlvwm -Type=Application -``` - -Log out from your desktop session and log back into MLVWM. By default, your session manager (KDM, GDM, or LightDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging in. - -With GDM: - -![][7] - -With SDDM: - -![][8] - -#### Launching with brute force - -If MLVWM fails to start, try installing XDM, a lightweight session manager that doesn't look at **/usr/share/xsessions** and instead just does whatever the authenticated user's **.xinitrc** proscribes. - -![MLVWM][9] - -### Build your own retro Apple - -The MLVWM desktop is unpolished, imperfect, accurate, and loads of fun. Many of the menu options you see are unimplemented, but you can make them active and meaningful. - -This is your chance to step back in time, change history, and make the old-school Apple line of computers a bastion of open source. Be a revisionist, design your own retro Apple desktop, and, most importantly, have fun. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/linux-mlvwm-desktop - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) -[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[3]: http://www2u.biglobe.ne.jp/~y-miyata/mlvwm.html -[4]: https://opensource.com/sites/default/files/uploads/advent-mlvwm-file.jpg (MLVWM running on Slackware 14.2) -[5]: http://cgit.freedesktop.org/xorg/util/imake -[6]: https://opensource.com/article/17/6/set-path-linux -[7]: https://opensource.com/sites/default/files/advent-gdm_2.jpg -[8]: https://opensource.com/sites/default/files/advent-kdm_1.jpg -[9]: https://opensource.com/sites/default/files/uploads/advent-mlvwm-chess.jpg (MLVWM) diff --git a/translated/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md b/translated/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md new file mode 100644 index 0000000000..6b43924213 --- /dev/null +++ b/translated/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md @@ -0,0 +1,218 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Build a retro Apple desktop with the Linux MLVWM) +[#]: via: (https://opensource.com/article/19/12/linux-mlvwm-desktop) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +使用 Linux MLVWM 打造复古苹果桌面 +====== +本文是 24 天 Linux 桌面特别系列的一部分。如果老式的苹果电脑用开源 POSIX 构建如何?你可以通过构建类 Macintosh 虚拟窗口管理器来实现。 +![Person typing on a 1980's computer][1] + +想象一下进入另外一个历史,Apple II GS 和 MacOS 7 是基于开源 [POSIX][2] 构建的,它使用了与现代 Linux 相同的所有约定,例如纯文本配置文件和模块化系统设计。这样的操作系统将为其用户带来什么?你可以使用[类 Macintosh 虚拟窗口管理器(MLVWM)][3]来回答这些问题(甚至更多!)。 + +![MLVWM running on Slackware 14.2][4] + +### 安装 MLVWM + +MLVWM 安装并不容易,并且可能不在发行版的软件仓库中。如果你有时间理解翻译不佳的 README 文件,编辑一些配置文件,收集并调整一些旧的 **.xpm**图像,编辑一两个 Xorg 选项,那么你就可以体验 MLVWM。否则,这是一个新奇的窗口管理器,其最新版本可以追溯到 2000 年。 + + +要编译 MLVWM,你必须安装 **imake**,它提供 **xmkmf** 命令。你可以从发行版的软件仓库中安装 imake,也可以直接从 [Freedesktop.org][5] 获得。假设你已经有 **xmkmf**命令,请进入包含 MLVWM 源码的目录,然后运行以下命令进行构建: + + +``` +$ xmkmf -a +$ make +``` + +构建后,编译后的 **mlvwm** 二进制文件位于 **mlvwm** 目录中。将其移动到[你的 PATH ][6]的任何位置: + + +``` +`$ mv mlvwm/mlvwm /usr/local/bin/` +``` + +#### 编辑配置文件 + +现在已经安装 MLVWM,但是如果不调整几个配置文件并仔细排列所需的图像文件,它将无法正确启动。示例配置文件位于你下载的源代码的 **sample_rc** 目录中。将文件 **Mlvwm-Netscape** 和 **Mlvwm-Xterm** 复制到你的主目录: + + +``` +`$ cp sample_rc/Mlvwm-{Netscape,Xterm} $HOME` +``` + +将 **Mlvwmrc** 移动到 **$HOME/.mlvwmrc**(是的,即使示例文件的名称看似是大写字母,但你也必须使用小写的 “m”): + + +``` +`$ cp sample_rc/Mlvwmrc $HOME/.mlvwmrc` +``` + +打开 **.mlwmrc** 并找到第 54-55 行,它们定义了 MLVWM 在菜单和 UI 中使用的像素图的路径(“IconPath”): + + +``` +# Set icon search path. It needs before "Style". +IconPath /usr/local/include/X11/pixmaps:/home2/tak/bin/pixmap +``` + +调整路径以匹配你填充图像的路径(我建议使用 **$HOME/.local/share/pixmaps**)。MLVWM 不提供像素图,因此需要你提供构建桌面所需图标。 + +即使你有位于系统其他位置的像素图(例如 **/usr/share/pixmaps**)),也要这样做,因为你需要调整像素图的大小,你可能也不想在系统范围内执行此操作。 + + +``` +# Set icon search path. It needs before "Style". +IconPath /home/seth/.local/share/pixmaps +``` + +#### 选择像素图 + +你已将 **.local/share/pixmaps** 目录定义为像素图源路径,但是该目录和图像均不存在。创建目录: + + +``` +`$ mkdir -p $HOME/.local/share/pixmaps` +``` + +现在,配置文件将图像分配给菜单项和 UI 元素,但是系统中不存在这些图像。要解决此问题,请通读配置文件并找到每个 **.xpm** 图像。对于配置中列出的每个图像,将具有相同文件名的图像(或更改配置文件中的文件名)添加到你的 IconPath 目录。 + +**.mlvwmrc** 文件的注释很好,因此你可以大致了解要编辑的内容。无论如何,这只是第一步。你可以随时回来更改桌面外观。 + +这有些例子 + +此代码块设置屏幕左上角的图标: + +``` +# Register the menu +Menu Apple, Icon label1.xpm, Stick +``` + +**label1.xpm** 图像实际上在源代码的 **pixmap**目录中,但我更喜欢使用来自 **/usr/share/pixmaps** 的 **Penguin.xpm**(在 Slackware 上)。无论使用什么,都必须将自定义像素图放在 **~/.local/share/pixmaps** 中,并在配置中更改像素图的名称,或者重命名像素图以匹配配置文件中当前的名称。 + +此代码块定义了左侧菜单中列出的应用: + + +``` +"About this Workstation..." NonSelect, Gray, Action About +"" NonSelect +"Terminal"      Icon mini-display.xpm, Action Exec "kterm" exec kterm -ls +"Editor"  Action Exec "mule" exec mule, Icon mini-edit.xpm +"calculator" Action Exec "xcal" exec xcalc, Icon mini-calc.xpm +END +``` + +通过遵循与配置文件中相同的语法,你可以自定义像素图并将自己的应用添加到菜单中(例如,我将 **mule** 更改为 **emacs**)。 这是你在 MLVWM GUI 中打开应用的入口,因此请列出你要快速访问的所有内容。你可能还希望包括指向 **/usr/share/applications** 文件夹的快捷方式。 + + +``` +`"Applications" Icon Penguin.xpm, Action Exec "thunar /usr/share/applications" exec thunar /usr/share/applications` +``` + +完成编辑配置文件并将自己的图像添加到 IconPath 目录后,必须将所有像素图的大小都调整为大约 16x16 像素。(MLVWM 的默认设置不一致,因此存在变化空间。)你可以使用 ImageMagick 进行批量操作: + + +``` +`$ for i in ~/.local/share/mlvwm-pixmaps/*xpm ; do convert -resize '16x16^' $i; done` +``` + +### 启动 MLVWM + +最简单的运行 MLVWM 的方式是让 Xorg 完成大部分工作。首先,你必须创建一个 **$HOME/.xinitrc** 文件。我从 Slackware 复制了这个,它也是从 Xorg 来的: + + +``` +#!/bin/sh +# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $ + +userresources=$HOME/.Xresources +usermodmap=$HOME/.Xmodmap +sysresources=/etc/X11/xinit/.Xresources +sysmodmap=/etc/X11/xinit/.Xmodmap + +# merge in defaults and keymaps + +if [ -f $sysresources ]; then +    xrdb -merge $sysresources +fi + +if [ -f $sysmodmap ]; then +    xmodmap $sysmodmap +fi + +if [ -f $userresources ]; then +    xrdb -merge $userresources +fi + +if [ -f $usermodmap ]; then +    xmodmap $usermodmap +fi + +# Start the window manager: +if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then +  exec ck-launch-session /usr/local/bin/mlvwm +else +  exec /usr/local/bin/mlvwm +fi +``` + +根据此文件,**startx** 命令的默认操作是启动 MLVWM。但是,你的发行版可能对于图形服务器启动(或被终止重新启动)时会发生的情况有其他做法,因此此文件可能对你没有什么帮助。在许多发行版上,你可以添加 **.desktop** 文件到 **/usr/share/xsessions** 中,以将其列在 GDM 或 KDM 菜单中,因此创建名为 **mlvwm.desktop** 的文件并输入: + + +``` +[Desktop Entry] +Name=Mlvwm +Comment=Macintosh-like virtual window manager +Exec=/usr/local/bin/mlvwm +TryExec=ck-launch-session /usr/local/bin/mlvwm +Type=Application +``` + +从桌面会话注销并重新登录到 MLVWM。默认情况下,会话管理器(KDM、GDM 或 LightDM,具体取决于你的设置)将继续登录到以前的桌面,因此在登录之前必须覆盖它。 + +对于 GDM: + +![][7] + +对于 SDDM: + +![][8] + +#### 强制启动 + +如果 MLVWM 无法启动,请尝试安装 XDM,这是一个轻量级会话管理器,它不会查询 **/usr/share/xsessions** 的内容,而是执行经过身份验证用户的所有 **.xinitrc** 操作。 + +![MLVWM][9] + +### 打造自己的复古苹果 + +MLVWM 桌面未经打磨、不完美、准确且充满乐趣。你看到的许多菜单项都是未实现的,但你可以使它们变得活跃且有意义。 + +这是一次让你时光倒流,改变历史,让老式苹果系列电脑成为开源堡垒的机会。成为一名修正主义者,设计你自己的复古苹果桌面,最重要的是,它有乐趣。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/linux-mlvwm-desktop + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) +[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[3]: http://www2u.biglobe.ne.jp/~y-miyata/mlvwm.html +[4]: https://opensource.com/sites/default/files/uploads/advent-mlvwm-file.jpg (MLVWM running on Slackware 14.2) +[5]: http://cgit.freedesktop.org/xorg/util/imake +[6]: https://opensource.com/article/17/6/set-path-linux +[7]: https://opensource.com/sites/default/files/advent-gdm_2.jpg +[8]: https://opensource.com/sites/default/files/advent-kdm_1.jpg +[9]: https://opensource.com/sites/default/files/uploads/advent-mlvwm-chess.jpg (MLVWM) From 2ca34652033b536aeff239cc7de84b452ad41686 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 24 Dec 2019 08:55:03 +0800 Subject: [PATCH 039/430] translating --- ...0 Why Vim fans love the Herbstluftwm Linux window manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md b/sources/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md index 94f7ecc281..47218849e3 100644 --- a/sources/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md +++ b/sources/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5080ddb0f1c6b80b8b1bc90dfba8eac67864b8a0 Mon Sep 17 00:00:00 2001 From: runningwater Date: Tue, 24 Dec 2019 14:23:26 +0800 Subject: [PATCH 040/430] =?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 --- ...Create and manage MacOS LaunchAgents using Go.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sources/tech/20180130 Create and manage MacOS LaunchAgents using Go.md b/sources/tech/20180130 Create and manage MacOS LaunchAgents using Go.md index 8bd6b8bf64..b9a477824c 100644 --- a/sources/tech/20180130 Create and manage MacOS LaunchAgents using Go.md +++ b/sources/tech/20180130 Create and manage MacOS LaunchAgents using Go.md @@ -1,3 +1,12 @@ +[#]: collector: (lujun9972) +[#]: translator: (runningwater) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create and manage MacOS LaunchAgents using Go) +[#]: via: (https://ieftimov.com/post/create-manage-macos-launchd-agents-golang/) +[#]: author: (https://ieftimov.com/about) + Create and manage MacOS LaunchAgents using Go ============================================================ @@ -287,7 +296,7 @@ This is where I write about software development, programming languages and ever via: https://ieftimov.com/create-manage-macos-launchd-agents-golang 作者:[Ilija Eftimov ][a] -译者:[译者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/) 荣誉推出 @@ -302,4 +311,4 @@ via: https://ieftimov.com/create-manage-macos-launchd-agents-golang [7]:https://golang.org/x/sys [8]:https://docs.google.com/document/d/1QXzI9I1pOfZPujQzxhyRy6EeHYTQitKKjHfpq0zpxZs/edit [9]:https://golang.org/x/sys -[10]:https://github.com/jteeuwen/go-bindata \ No newline at end of file +[10]:https://github.com/jteeuwen/go-bindata From 37f47e3b9e3885b2fe549d2ea20674b9ae656efc Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 24 Dec 2019 16:58:04 +0800 Subject: [PATCH 041/430] translating --- .../20191221 Customize your Linux desktop with KDE Plasma.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md b/sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md index 0baaf4747a..0fe21db27b 100644 --- a/sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md +++ b/sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 708e13d6d7052ecf43d395a3bb359f94f2cb3197 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 24 Dec 2019 23:32:39 +0800 Subject: [PATCH 042/430] PRF @robsean --- ...d 8.1 Oreo on Linux To Run Apps - Games.md | 111 +++++++++--------- 1 file changed, 55 insertions(+), 56 deletions(-) diff --git a/translated/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md b/translated/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md index c8263bd9e0..e9b05a8757 100644 --- a/translated/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md +++ b/translated/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md @@ -1,28 +1,28 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Install Android 8.1 Oreo on Linux To Run Apps & Games) [#]: via: (https://fosspost.org/tutorials/install-android-8-1-oreo-on-linux) [#]: author: (Python Programmer;Open Source Software Enthusiast. Worked On Developing A Lot Of Free Software. The Founder Of Foss Post;Foss Project. Computer Science Major. ) -在 Linux 上安装 Android 8.1 Oreo 来运行应用程序和游戏 +在 Linux 上安装安卓 8.1 Oreo 来运行应用程序和游戏 ====== ![](https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/android-8.1-oreo-x86-on-linux.png?resize=1237%2C527&ssl=1) -[android x86][1] 是一个自由开放源码的项目,将谷歌制作的android系统从 ARM 架构移植到 x86 架构, 运行用户在他们的桌面机器上运行 android 系统来享受所有的 android 功能和应用程序及游戏。 +[android x86][1] 是一个自由而开源的项目,将谷歌制作的安卓系统从 ARM 架构移植到了 x86 架构,可以让用户在他们的桌面电脑上运行安卓系统来享受所有的安卓功能和应用程序及游戏。 -几周前,android x86 项目完成 android 8.1 Oreo 系统到 x86 架构的移植。在这篇文章中,我们将解释如何在你的 Linux 系统上安装它,以便你能够随时使用你的 android 应用程序和游戏。 +在前一段时间,android x86 项目完成了安卓 8.1 Oreo 系统的 x86 架构移植。在这篇文章中,我们将解释如何在你的 Linux 系统上安装它,以便你能够随时使用你的安卓 用程序和游戏。 -### 在 Linux 上安装 Android x86 8.1 Oreo +### 在 Linux 上安装安卓 x86 8.1 Oreo #### 准备环境 -首先,让我们下载 android x86 8.1 Oreo 系统镜像。你可以从[这个页面][2]下载它,只需单击 android-x86_64-8.1-r1.iso 文件下 “View” 按钮。 +首先,让我们下载 android x86 8.1 Oreo 系统镜像。你可以从[这个页面][2]下载它,只需单击 “android-x86_64-8.1-r1.iso” 文件下的 “View” 按钮。 -我们将在我们的 Linux 系统上使用 QEMU 来运行 android x86 。QEMU 是一个非常好的模拟器软件,它也是自由和开放源码的,并且在所有主要的 Linux 发行版存储库中都是可用的。 +我们将在我们的 Linux 系统上使用 QEMU 来运行 android x86。QEMU 是一个非常好的模拟器软件,它也是自由而开源的,并且在所有主要的 Linux 发行版存储库中都是可用的。 在 Ubuntu/Linux Mint/Debian 上安装 QEMU: @@ -36,115 +36,115 @@ sudo apt-get install qemu qemu-kvm libvirt-bin sudo dnf install qemu qemu-kvm ``` -对于其它发行版,只需要搜索 qemu 和 qemu-kvm 软件包,并安装它们。 +对于其它发行版,只需要搜索 “qemu” 和 “qemu-kvm” 软件包,并安装它们。 -在你安装 QEMU 后,我们将需要运行下面的命令来创建 android.img 文件,它就像某种分配给 android 系统的磁盘空间。所有 android 文件和系统都将位于该镜像文件中: +在你安装 QEMU 后,我们将需要运行下面的命令来创建 `android.img` 文件,它就像某种分配给安卓系统的磁盘空间。所有安卓文件和系统都将位于该镜像文件中: ``` qemu-img create -f qcow2 android.img 15G ``` -我们在这里说,我们想为 android 分配一个最大 15GB 的磁盘空间,但是,你可以更改它到你想要的任意大小(确保它至少大于5GB)。 +我们在这里的意思是,我们想为该安卓系统分配一个最大 15GB 的磁盘空间,但是,你可以更改它到你想要的任意大小(确保它至少大于 5GB)。 -现在,首次启动运行 android 系统,运行: +现在,首次启动运行该安卓系统,运行: ``` sudo qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img -cdrom /home/mhsabbagh/android-x86_64-8.1-r1.iso ``` -将 /home/mhsabbagh/android-x86_64-8.1-r1.iso 替换为你从 android x86 网站下载的文件的路径。我们在这里正在使用的其它选项的解释,你可以参考[这篇文章][3]。 +将 `/home/mhsabbagh/android-x86_64-8.1-r1.iso` 替换为你从 android x86 网站下载的文件的路径。关于我们在这里正在使用的其它选项的解释,你可以参考[这篇文章][3]。 -在你运行上面的命令后,android 系统将启动: +在你运行上面的命令后,该安卓系统将启动: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 39 android 8.1 oreo on linux][4] +![][4] #### 安装系统 从这个窗口中,选择 “Advanced options”, 它将引导到下面的菜单,你应如下在其中选择 “Auto_installation” : -![Install Android 8.1 Oreo on Linux To Run Apps & Games 41 android 8.1 oreo on linux][5] +![][5] -在这以后,安装器将告知你是否想要继续,选择 Yes : +在这以后,安装器将告知你是否想要继续,选择 “Yes”: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 43 android 8.1 oreo on linux][6] +![][6] 接下来,安装器将无需你的指示而继续进行: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 45 android 8.1 oreo on linux][7] +![][7] -最后,你将收到这个信息,它表示你已经成功安装 android 8.1 : +最后,你将收到这个信息,它表示你已经成功安装安卓 8.1 : -![Install Android 8.1 Oreo on Linux To Run Apps & Games 47 android 8.1 oreo on linux][8] +![][8] -现在,完全关闭 QEMU 窗口。 +现在,关闭 QEMU 窗口即可。 -#### 启动和使用 Android 8.1 Oreo +#### 启动和使用 安卓 8.1 Oreo -现在,android 系统已经完全安装在你的 android.img 文件中,你应该使用下面的 QEMU 命令来启动它,而不是前面的命令: +现在,安卓系统已经完全安装在你的 `android.img` 文件中,你应该使用下面的 QEMU 命令来启动它,而不是前面的命令: ``` sudo qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img ``` -注意,我们所做的只是移除 -cdrom 选项和它的参数。这是告诉 QEMU ,我们不再想从我们下载的 ISO 文件启动,相反,从安装的 android 系统启动。 +注意,我们所做的只是移除 `-cdrom` 选项及其参数。这是告诉 QEMU,我们不再想从我们下载的 ISO 文件启动,相反,从这个安装的安卓系统启动。 -你现在能够看到 android 启动菜单: +你现在能够看到安卓的启动菜单: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 49 android 8.1 oreo on linux][9] +![][9] -然后,你将带去第一个准备向导,选择你的语言并继续: +然后,你将进入第一个准备向导,选择你的语言并继续: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 51 android 8.1 oreo on linux][10] +![][10] 从这里,选择 “Set up as new” 选项: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 53 android 8.1 oreo on linux][11] +![][11] -然后,android 将询问你是否想登陆到你当前的谷歌账号。这步骤是可选的,但是这很重要,以便你随后可以使用 Play Store : +然后,安卓将询问你是否想登录到你当前的谷歌账号。这步骤是可选的,但是这很重要,以便你随后可以使用谷歌 Play 商店: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 55 android 8.1 oreo on linux][12] +![][12] 然后,你将需要接受条款: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 57 android 8.1 oreo on linux][13] +![][13] 现在,你可以选择你当前的时区: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 59 android 8.1 oreo on linux][14] +![][14] -系统将询问你是否想启动一些数据收集功能。如果我是你的话,我将简单地关闭它们,像这样: +系统将询问你是否想启动一些数据收集功能。如果我是你的话,我将简单地全部关闭它们,像这样: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 61 android 8.1 oreo on linux][15] +![][15] 最后,你将有两种启动类型可供选择,我建议你选择 Launcher3 选项,并使其成为默认项: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 63 android 8.1 oreo on linux][16] +![][16] -然后,你将看到完整工作的 android 系统主屏幕: +然后,你将看到完整工作的安卓系统主屏幕: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 65 android 8.1 oreo on linux][17] +![][17] -从现在起,你可以做你想做的任何事情;你可以使用内置的 android 应用程序,或者你可以浏览你是系统设置来根据你的喜好进行调整。你可以更改你的系统的外观和体验,或者你可以像示例一样运行 Chrome : +从现在起,你可以做你想做的任何事情;你可以使用内置的安卓应用程序,或者你可以浏览你的系统设置来根据你的喜好进行调整。你可以更改你的系统的外观和体验,或者你可以像示例一样运行 Chrome : -![Install Android 8.1 Oreo on Linux To Run Apps & Games 67 android 8.1 oreo on linux][18] +![][18] -你可以从 Google Play store 开始安装一些应用程序程序,像 WhatsApp 和其它的应用程序,以供你自己使用: +你可以开始从谷歌 Play 商店安装一些应用程序程序,像 WhatsApp 和其它的应用程序,以供你自己使用: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 69 android 8.1 oreo on linux][19] +![][19] 你现在可以用你的系统做任何你想做的事。恭喜! -### 以后如何轻松地运行 Android 8.1 Oreo +### 以后如何轻松地运行安卓 8.1 Oreo -我们不想总是不得不打开终端窗口,并写那些长长的 QEMU 命令来运行 android 系统,相反,我们想在我们需要时一次单击就运行它。 +我们不想总是不得不打开终端窗口,并写那些长长的 QEMU 命令来运行安卓系统,相反,我们想在我们需要时一次单击就运行它。 -为此,我们将使用下面的命令在 /usr/share/applications 下创建一个名为 android.desktop 的新文件: +为此,我们将使用下面的命令在 `/usr/share/applications` 下创建一个名为 `android.desktop` 的新文件: ``` sudo nano /usr/share/applications/android.desktop ``` -并在其中粘贴下面的内容(右键单击然后粘贴): +并在其中粘贴下面的内容(右键单击然后粘贴): ``` [Desktop Entry] @@ -158,33 +158,32 @@ StartupNotify=true Categories=GTK; ``` -再强调一次,你必需使用你系统上的本地镜像路径来替换 /home/mhsabbagh/android.img 。然后保存文件 (Ctrl + X ,然后按 Y ,然后按 Enter)。 +再强调一次,你必需使用你系统上的本地镜像路径来替换 `/home/mhsabbagh/android.img` 。然后保存文件(`Ctrl+X`,然后按 `Y`,然后按回车)。 -注意,我们需要使用 “pkexec” 来使用 root 权限运行 QEMU ,因为从较新的版本开始,普通用户不允许通过 libvirt 访问 KVM 技术;这就是为什么它将每次要求你输入 root 密码的原因。 +注意,我们需要使用 `pkexec` 来使用 root 权限运行 QEMU ,因为从较新的版本开始,普通用户不允许通过 libvirt 访问 KVM 技术;这就是为什么它将每次要求你输入 root 密码的原因。 -现在,你将在应用程序菜单中看到 android 图标,你可以在你想使用 android 的任何时间来简单地单击图标,QEMU 程序将启动: +现在,你将在应用程序菜单中看到安卓图标,你可以在你想使用安卓的任何时间来简单地单击该图标,QEMU 程序将启动: -![Install Android 8.1 Oreo on Linux To Run Apps & Games 71 android 8.1 oreo on linux][20] +![][20] ### 总结 -我们向你展示如何你的 Linux 系统上安装和运行 android 8.1 Oreo 。从现在起,在没有其它一些软件的(像 Blutsticks 和类似的方法)的情况下,你应该更容易地完成基于 android 的任务。在这里,你有一个完整工作和功能的 android 系统,你可以随心所欲地操作它,如果一些东西出差,你可以简单地核弹攻击镜像文件,然后随时再一次重新运行安装程序。 - -你之前尝试过 android x86 吗?你的经验如何? +我们向你展示如何在你的 Linux 系统上安装和运行安卓 8.1 Oreo 。从现在起,在没有其它一些软件的(像 Blutsticks 和类似的方法)的情况下,你可以更容易地完成基于安卓的任务。在这里,你有一个完整工作和功能的安卓系统,你可以随心所欲地操作它,如果一些东西出错,你可以简单地干掉该镜像文件,然后随时再一次重新运行安装程序。 +你之前尝试过 android x86 吗?你的体验如何? -------------------------------------------------------------------------------- via: https://fosspost.org/tutorials/install-android-8-1-oreo-on-linux -作者:[Python Programmer;Open Source Software Enthusiast. Worked On Developing A Lot Of Free Software. The Founder Of Foss Post;Foss Project. Computer Science Major.][a] +作者:[M.Hanny Sabbagh][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]: +[a]: https://fosspost.org/author/mhsabbagh [b]: https://github.com/lujun9972 [1]: http://www.android-x86.org/ [2]: http://www.android-x86.org/download From 765cafa8409fd89236054e6c64da8561693bb50d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 24 Dec 2019 23:35:24 +0800 Subject: [PATCH 043/430] PUB @robsean https://linux.cn/article-11711-1.html --- ...7 Install Android 8.1 Oreo on Linux To Run Apps - Games.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md (99%) diff --git a/translated/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md b/published/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md similarity index 99% rename from translated/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md rename to published/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md index e9b05a8757..3babf263f3 100644 --- a/translated/tech/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md +++ b/published/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11711-1.html) [#]: subject: (Install Android 8.1 Oreo on Linux To Run Apps & Games) [#]: via: (https://fosspost.org/tutorials/install-android-8-1-oreo-on-linux) [#]: author: (Python Programmer;Open Source Software Enthusiast. Worked On Developing A Lot Of Free Software. The Founder Of Foss Post;Foss Project. Computer Science Major. ) From b7c8eb327e45917e999d9063a15d6f51a0530f1f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 25 Dec 2019 00:52:26 +0800 Subject: [PATCH 044/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191225=208=20Co?= =?UTF-8?q?mmands=20to=20Check=20Memory=20Usage=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191225 8 Commands to Check Memory Usage on Linux.md --- ...Commands to Check Memory Usage on Linux.md | 416 ++++++++++++++++++ 1 file changed, 416 insertions(+) create mode 100644 sources/tech/20191225 8 Commands to Check Memory Usage on Linux.md diff --git a/sources/tech/20191225 8 Commands to Check Memory Usage on Linux.md b/sources/tech/20191225 8 Commands to Check Memory Usage on Linux.md new file mode 100644 index 0000000000..89108b5ded --- /dev/null +++ b/sources/tech/20191225 8 Commands to Check Memory Usage on Linux.md @@ -0,0 +1,416 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (8 Commands to Check Memory Usage on Linux) +[#]: via: (https://www.2daygeek.com/linux-commands-check-memory-usage/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +8 Commands to Check Memory Usage on Linux +====== + +Linux is not like Windows and you will not get a GUI always, especially in a server environment. + +As a Linux administrator, it is important to know how to check your available and used resources, such as memory, CPU, disk space, etc. + +If there are any applications that use too much resources on the system to run your system at the optimum level you need to find and fix. + +If you want to **[find out the top 10 memory (RAM) consumption processes in Linux][1]**, go to the following article. + +In Linux, there are commands for everything, so use the corresponding commands. + +In this tutorial, we will show you eight powerful commands to check memory usage on a Linux system, including RAM and swap. + +**[Creating swap space on a Linux system][2]** is very important. + +The following commands can help you check memory usage in Linux in different ways. + + * free Command + * /proc/meminfo File + * vmstat Command + * ps_mem Command + * smem Command + * top Command + * htop Command + * glances Command + + + +### 1) How to Check Memory Usage on Linux Using the free Command + +**[Free command][3]** is the most powerful command widely used by the Linux administrator. But it provides very little information compared to the “/proc/meminfo” file. + +Free command displays the total amount of free and used physical and swap memory on the system, as well as buffers and caches used by the kernel. + +These information is gathered from the “/proc/meminfo” file. + +``` +# free -m + total used free shared buff/cache available +Mem: 15867 9199 1702 3315 4965 3039 +Swap: 17454 666 16788 +``` + + * **total:** Total installed memory + * **used:** Memory is currently in use by running processes (used= total – free – buff/cache) + * **free:** Unused memory (free= total – used – buff/cache) + * **shared:** Memory shared between two or more processes (multiple processes) + * **buffers:** Memory reserved by the kernel to hold a process queue request. + * **cache:** Size of the page cache that holds recently used files in RAM + * **buff/cache:** Buffers + Cache + * **available:** Estimation of how much memory is available for starting new applications, without swapping. + + + +### 2) How to Check Memory Usage on Linux Using the /proc/meminfo File + +The “/proc/meminfo” file is a virtual file that contains various real-time information about memory usage. + +It shows memory stats in kilobytes, most of which are somewhat difficult to understand. + +However it contains useful information about memory usage. + +``` +# cat /proc/meminfo + +MemTotal: 16248572 kB +MemFree: 1764576 kB +MemAvailable: 3136604 kB +Buffers: 234132 kB +Cached: 4731288 kB +SwapCached: 28516 kB +Active: 9004412 kB +Inactive: 3552416 kB +Active(anon): 8094128 kB +Inactive(anon): 2896064 kB +Active(file): 910284 kB +Inactive(file): 656352 kB +Unevictable: 80 kB +Mlocked: 80 kB +SwapTotal: 17873388 kB +SwapFree: 17191328 kB +Dirty: 252 kB +Writeback: 0 kB +AnonPages: 7566736 kB +Mapped: 3692368 kB +Shmem: 3398784 kB +Slab: 278976 kB +SReclaimable: 125480 kB +SUnreclaim: 153496 kB +KernelStack: 23936 kB +PageTables: 73880 kB +NFS_Unstable: 0 kB +Bounce: 0 kB +WritebackTmp: 0 kB +CommitLimit: 25997672 kB +Committed_AS: 24816804 kB +VmallocTotal: 34359738367 kB +VmallocUsed: 0 kB +VmallocChunk: 0 kB +Percpu: 3392 kB +HardwareCorrupted: 0 kB +AnonHugePages: 0 kB +ShmemHugePages: 0 kB +ShmemPmdMapped: 0 kB +HugePages_Total: 0 +HugePages_Free: 0 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +Hugepagesize: 2048 kB +Hugetlb: 0 kB +DirectMap4k: 1059088 kB +DirectMap2M: 14493696 kB +DirectMap1G: 2097152 kB +``` + +### 3) How to Check Memory Usage on Linux Using the vmstat Command + +The **[vmstat command][4]** is another useful tool for reporting virtual memory statistics. + +vmstat reports information about processes, memory, paging, block IO, traps, disks, and cpu functionality. + +vmstat does not require special permissions, and it can help identify system bottlenecks. + +``` +# vmstat + +procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- + r b swpd free buff cache si so bi bo in cs us sy id wa st + 1 0 682060 1769324 234188 4853500 0 3 25 91 31 16 34 13 52 0 0 +``` + +If you want to understand this in detail, read the field description below. + +**Procs** + + * **r:** The number of runnable processes (running or waiting for run time). + * **b:** The number of processes in uninterruptible sleep. + + + +**Memory** + + * **swpd:** the amount of virtual memory used. + * **free:** the amount of idle memory. + * **buff:** the amount of memory used as buffers. + * **cache:** the amount of memory used as cache. + * **inact:** the amount of inactive memory. (-a option) + * **active:** the amount of active memory. (-a option) + + + +**Swap** + + * **si:** Amount of memory swapped in from disk (/s). + * **so:** Amount of memory swapped to disk (/s). + + + +**IO** + + * **bi:** Blocks received from a block device (blocks/s). + * **bo:** Blocks sent to a block device (blocks/s). + + + +**System** + + * **in:** The number of interrupts per second, including the clock. + * **cs:** The number of context switches per second. + + + +**CPU : These are percentages of total CPU time.** + + * **us:** Time spent running non-kernel code. (user time, including nice time) + * **sy:** Time spent running kernel code. (system time) + * **id:** Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time. + * **wa:** Time spent waiting for IO. Prior to Linux 2.5.41, included in idle. + * **st:** Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown. + + + +Run the following command for detailed information. + +``` +# vmstat -s + + 16248580 K total memory + 2210256 K used memory + 2311820 K active memory + 2153352 K inactive memory + 11368812 K free memory + 107584 K buffer memory + 2561928 K swap cache + 17873388 K total swap + 0 K used swap + 17873388 K free swap + 44309 non-nice user cpu ticks + 164 nice user cpu ticks + 14332 system cpu ticks + 382418 idle cpu ticks + 1248 IO-wait cpu ticks + 1407 IRQ cpu ticks + 2147 softirq cpu ticks + 0 stolen cpu ticks + 1022437 pages paged in + 260296 pages paged out + 0 pages swapped in + 0 pages swapped out + 1424838 interrupts + 4979524 CPU context switches + 1577163147 boot time + 3318 forks +``` + +### 4) How to Check Memory Usage on Linux Using the ps_mem Command + +**[ps_mem][5]** is a simple Python script that allows you to get core memory usage accurately for a program in Linux. + +This can determine how much RAM is used per program (not per process). + +It calculates the total amount of memory used per program, total = sum (private RAM for program processes) + sum (shared RAM for program processes). + +The shared RAM is problematic to calculate, and the tool automatically selects the most accurate method available for the running kernel. + +``` +# ps_mem + + Private + Shared = RAM used Program +180.0 KiB + 30.0 KiB = 210.0 KiB xf86-video-intel-backlight-helper (2) +192.0 KiB + 66.0 KiB = 258.0 KiB cat (2) +312.0 KiB + 38.5 KiB = 350.5 KiB lvmetad +380.0 KiB + 25.5 KiB = 405.5 KiB crond +392.0 KiB + 32.5 KiB = 424.5 KiB rtkit-daemon +852.0 KiB + 117.0 KiB = 969.0 KiB gnome-session-ctl (2) +928.0 KiB + 56.5 KiB = 984.5 KiB gvfs-mtp-volume-monitor + 1.0 MiB + 42.5 KiB = 1.0 MiB dconf-service + 1.0 MiB + 106.5 KiB = 1.1 MiB gvfs-goa-volume-monitor + 1.0 MiB + 180.5 KiB = 1.2 MiB gvfsd +. +. + 5.3 MiB + 3.0 MiB = 8.3 MiB evolution-addressbook-factory + 8.5 MiB + 1.2 MiB = 9.7 MiB gnome-session-binary (4) + 7.5 MiB + 3.1 MiB = 10.5 MiB polkitd + 7.4 MiB + 3.3 MiB = 10.7 MiB pulseaudio (2) + 7.0 MiB + 7.0 MiB = 14.0 MiB msm_notifier + 12.7 MiB + 2.3 MiB = 15.0 MiB evolution-source-registry + 13.3 MiB + 2.5 MiB = 15.8 MiB gnome-terminal-server + 15.8 MiB + 1.0 MiB = 16.8 MiB tracker-miner-fs + 18.7 MiB + 1.8 MiB = 20.5 MiB python3.7 + 16.6 MiB + 4.0 MiB = 20.5 MiB evolution-calendar-factory + 22.3 MiB + 753.0 KiB = 23.0 MiB gsd-keyboard (2) + 22.4 MiB + 832.0 KiB = 23.2 MiB gsd-wacom (2) + 20.8 MiB + 2.5 MiB = 23.3 MiB blueman-tray + 22.0 MiB + 1.8 MiB = 23.8 MiB blueman-applet + 23.1 MiB + 934.0 KiB = 24.0 MiB gsd-xsettings (2) + 23.7 MiB + 1.2 MiB = 24.9 MiB gsd-media-keys (2) + 23.4 MiB + 1.6 MiB = 25.0 MiB gsd-color (2) + 23.9 MiB + 1.2 MiB = 25.1 MiB gsd-power (2) + 16.5 MiB + 8.9 MiB = 25.4 MiB evolution-alarm-notify + 27.2 MiB + 2.0 MiB = 29.2 MiB systemd-journald + 28.7 MiB + 2.8 MiB = 31.5 MiB c + 29.6 MiB + 2.2 MiB = 31.8 MiB chrome-gnome-sh (2) + 43.9 MiB + 6.8 MiB = 50.7 MiB WebExtensions + 46.7 MiB + 6.7 MiB = 53.5 MiB goa-daemon + 86.5 MiB + 55.2 MiB = 141.7 MiB Xorg (2) +191.4 MiB + 24.1 MiB = 215.4 MiB notepadqq-bin +306.7 MiB + 29.0 MiB = 335.7 MiB gnome-shell (2) +601.6 MiB + 77.7 MiB = 679.2 MiB firefox + 1.0 GiB + 109.7 MiB = 1.1 GiB chrome (15) + 2.3 GiB + 123.1 MiB = 2.5 GiB Web Content (8) +---------------------------------- + 5.6 GiB +================================== +``` + +### 5) How to Check Memory Usage on Linux Using the smem Command + +**[smem][6]** is a tool that can provide numerous reports of memory usage on Linux systems. Unlike existing tools, smem can report Proportional Set Size (PSS), Unique Set Size (USS) and Resident Set Size (RSS). + +Proportional Set Size (PSS): refers to the amount of memory used by libraries and applications in the virtual memory system. + +Unique Set Size (USS) : Unshared memory is reported as USS (Unique Set Size). + +Resident Set Size (RSS) : The standard measure of physical memory (it typically shared among multiple applications) usage known as resident set size (RSS) will significantly overestimate memory usage. + +``` +# smem -tk + + PID User Command Swap USS PSS RSS +3383 daygeek cat 0 92.0K 123.0K 1.7M +3384 daygeek cat 0 100.0K 129.0K 1.7M +1177 daygeek /usr/lib/gnome-session-ctl 0 436.0K 476.0K 4.6M +1171 daygeek /usr/bin/dbus-daemon --conf 0 524.0K 629.0K 3.8M +1238 daygeek /usr/lib/xdg-permission-sto 0 592.0K 681.0K 5.9M +1350 daygeek /usr/lib/gsd-screensaver-pr 0 652.0K 701.0K 5.8M +1135 daygeek /usr/lib/gdm-x-session --ru 0 648.0K 723.0K 6.0M +. +. +1391 daygeek /usr/lib/evolution-data-ser 0 16.5M 25.2M 63.3M +1416 daygeek caffeine-ng 0 28.7M 31.4M 66.2M +4855 daygeek /opt/google/chrome/chrome - 0 38.3M 46.3M 120.6M +2174 daygeek /usr/lib/firefox/firefox -c 0 44.0M 50.7M 120.3M +1254 daygeek /usr/lib/goa-daemon 0 46.7M 53.3M 80.4M +3416 daygeek /opt/google/chrome/chrome - 0 44.7M 54.2M 103.3M +4782 daygeek /opt/google/chrome/chrome - 0 57.2M 65.8M 142.3M +1137 daygeek /usr/lib/Xorg vt2 -displayf 0 77.2M 129.6M 192.3M +3376 daygeek /opt/google/chrome/chrome 0 117.8M 131.0M 210.9M +4448 daygeek /usr/lib/firefox/firefox -c 0 124.4M 133.8M 224.1M +3558 daygeek /opt/google/chrome/chrome - 0 157.3M 165.7M 242.2M +2310 daygeek /usr/lib/firefox/firefox -c 0 159.6M 169.4M 259.6M +4331 daygeek /usr/lib/firefox/firefox -c 0 176.8M 186.2M 276.8M +4034 daygeek /opt/google/chrome/chrome - 0 179.3M 187.9M 264.6M +3911 daygeek /opt/google/chrome/chrome - 0 183.1M 191.8M 269.4M +3861 daygeek /opt/google/chrome/chrome - 0 199.8M 208.2M 285.2M +2746 daygeek /usr/bin/../lib/notepadqq/n 0 193.5M 217.5M 261.5M +1194 daygeek /usr/bin/gnome-shell 0 203.7M 219.0M 285.1M +2945 daygeek /usr/lib/firefox/firefox -c 0 294.5M 308.0M 410.2M +2786 daygeek /usr/lib/firefox/firefox -c 0 341.2M 354.3M 459.1M +4193 daygeek /usr/lib/firefox/firefox -c 0 417.4M 427.6M 519.3M +2651 daygeek /usr/lib/firefox/firefox -c 0 417.0M 430.1M 535.6M +2114 daygeek /usr/lib/firefox/firefox -c 0 430.6M 473.9M 610.9M +2039 daygeek /usr/lib/firefox/firefox -- 0 601.3M 677.5M 840.6M +------------------------------------------------------------------------------- + 90 1 0 4.8G 5.2G 8.0G +``` + +### 6) How to Check Memory Usage on Linux Using the top Command + +**[top command][7]** is one of the most frequently used commands by Linux administrators to understand and view the resource usage for a process on a Linux system. + +It displays the total memory of the system, current memory usage, free memory and total memory used by the buffers. + +In addition, it displays total swap memory, current swap usage, free swap memory, and total cached memory by the system. + +``` +# top -b | head -10 + +top - 11:04:39 up 40 min, 1 user, load average: 1.59, 1.42, 1.28 +Tasks: 288 total, 2 running, 286 sleeping, 0 stopped, 0 zombie +%Cpu(s): 13.3 us, 1.5 sy, 0.0 ni, 84.4 id, 0.0 wa, 0.3 hi, 0.5 si, 0.0 st +KiB Mem : 16248572 total, 7755928 free, 4657736 used, 3834908 buff/cache +KiB Swap: 17873388 total, 17873388 free, 0 used. 9179772 avail Mem + + PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND + 2114 daygeek 20 3182736 616624 328228 R 83.3 3.8 7:09.72 Web Content + 2039 daygeek 20 4437952 849616 261364 S 13.3 5.2 7:58.54 firefox + 1194 daygeek 20 4046856 291288 165460 S 4.2 1.8 1:57.68 gnome-shell + 4034 daygeek 20 808556 273244 88676 S 4.2 1.7 1:44.72 chrome + 2945 daygeek 20 3309832 416572 150112 S 3.3 2.6 4:04.60 Web Content + 1137 daygeek 20 564316 197292 183380 S 2.5 1.2 2:55.76 Xorg + 2651 daygeek 20 3098420 547260 275700 S 1.7 3.4 2:15.96 Web Content + 2786 daygeek 20 2957112 463912 240744 S 1.7 2.9 3:22.29 Web Content + 1 root 20 182756 10208 7760 S 0.8 0.1 0:04.51 systemd + 442 root -51 S 0.8 0:05.02 irq/141-iw+ + 1426 daygeek 20 373660 48948 29820 S 0.8 0.3 0:03.55 python3 + 2174 daygeek 20 2466680 122196 78604 S 0.8 0.8 0:17.75 WebExtensi+ +``` + +### 7) How to Check Memory Usage on Linux Using the htop Command + +The **[htop command][8]** is an interactive process viewer for Linux/Unix systems. It is a text-mode application and requires the ncurses library, it was developed by Hisham. + +It is designed as an alternative to the top command. + +This is similar to the top command, but allows you to scroll vertically and horizontally to see all the processes running the system. + +htop comes with Visual Colors, which have added benefits and are very evident when it comes to tracking system performance. + +You are free to carry out any tasks related to processes, such as process killing and renicing without entering their PIDs. + +[![][9]][10] + +### 8) How to Check Memory Usage on Linux Using the glances Command + +**[Glances][11]** is a cross-platform system monitoring tool written in Python. + +You can see all information in one place such as CPU usage, Memory usage, running process, Network interface, Disk I/O, Raid, Sensors, Filesystem info, Docker, System info, Uptime, etc,. + +![][9] + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/linux-commands-check-memory-usage/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/how-to-find-high-cpu-consumption-processes-in-linux/ +[2]: https://www.2daygeek.com/add-extend-increase-swap-space-memory-file-partition-linux/ +[3]: https://www.2daygeek.com/free-command-to-check-memory-usage-statistics-in-linux/ +[4]: https://www.2daygeek.com/linux-vmstat-command-examples-tool-report-virtual-memory-statistics/ +[5]: https://www.2daygeek.com/ps_mem-report-core-memory-usage-accurately-in-linux/ +[6]: https://www.2daygeek.com/smem-linux-memory-usage-statistics-reporting-tool/ +[7]: https://www.2daygeek.com/linux-top-command-linux-system-performance-monitoring-tool/ +[8]: https://www.2daygeek.com/linux-htop-command-linux-system-performance-resource-monitoring-tool/ +[9]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[10]: https://www.2daygeek.com/wp-content/uploads/2019/12/linux-commands-check-memory-usage-2.jpg +[11]: https://www.2daygeek.com/linux-glances-advanced-real-time-linux-system-performance-monitoring-tool/ From 4cf6327947196a1075cca14f39d9e2f0f2deebd2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 25 Dec 2019 00:57:09 +0800 Subject: [PATCH 045/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191225=20Khadas?= =?UTF-8?q?=20VIM3L:=20An=20Open=20Source=20HTPC=20Device?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191225 Khadas VIM3L- An Open Source HTPC Device.md --- ...hadas VIM3L- An Open Source HTPC Device.md | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 sources/tech/20191225 Khadas VIM3L- An Open Source HTPC Device.md diff --git a/sources/tech/20191225 Khadas VIM3L- An Open Source HTPC Device.md b/sources/tech/20191225 Khadas VIM3L- An Open Source HTPC Device.md new file mode 100644 index 0000000000..9d25522d26 --- /dev/null +++ b/sources/tech/20191225 Khadas VIM3L- An Open Source HTPC Device.md @@ -0,0 +1,149 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Khadas VIM3L: An Open Source HTPC Device) +[#]: via: (https://itsfoss.com/vim3l/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +Khadas VIM3L: An Open Source HTPC Device +====== + +If you’ve read our list of [Raspberry Pi alternatives][1], you might have come across VIM by Khadas. + +China-based [Khadas][2] is becoming increasingly popular for its single board computers (SCB). Apart from the generic do-it-yourself (DIY) VIM series, Khadas also has [Tone boards][3] that can be utilized for DJing and [Edge][4] boards for AI and other related projects. + +As discussed in [Raspberry Pi projects][5], one of the most popular use of a single board computer is to use it as a media center. You can turn your TV in more than just a smart TV (without being monitored) and play local music, videos, pictures and even games on your TV. You can also watch streaming services through these media center. + +You can always configure VIm (or any other SCB) as a media center. It’s a good DIY exercise but not everyone would like it. + +This is why Khadas has introduced [VIM3L][6] which is a ready to use media center device based on VIM 3. In this article, we’ll have a look at this device and see how to set it up. + +### VIM 3L specifications + +One of the strong point of Khadas is its emphasis on open source. All their source code, including [U-Boot][7], mainline Linux and Android is available on [their GitHub repository][8]. + +VIM3L comes with [CoreELEC][9] operating system. CoreELEC is a custom Linux distribution that comes with software like [Kodi][10] and its add-ons to give you a complete HTPC (home theatre PC) experience. + +![][11] + +You are not restricted to CoreELEC though. You can get the barebon version of VIM 3L and use Android or install your a Linux distribution of your choice. + + * Amlogic S905D3 SoC with quad-core Cortex-A55 CPU clocked at 1.9GHz + * 16GB eMMC + * 2GB RAM + * 2x WiFi antennas + * PCIe 2.0 and M.2 NVMe SSD support + * HDMI port + * Dolby Audio + + + +The HTPC version costs slightly more than the bare board but it consists of some additional hardware along with CoreELEC operating system: + + * Transparent DIY case + * Metal DIY case + * Heatsink + * IR Remote + + + +![VIM3L HTPC Kit][12] + +VIM3L is capable of running 4K video at 75 fps. It also includes TrustZone based security for DRM video streaming. Both Android and CoreELEC are capable of [OTA updates][13]. + +[VIM3L HTPC version costs $89.99][14] and the bare board (with Android) costs $69.99. It’s FOSS readers can _**get $6 off with itsfossfuns coupon code**_ that can be used at the checkout page of Khadas shop. + +[Khadas VIM3 Series][15] + +You may opt for the free shipping option but it will take 2-3 weeks for the device to reach you from China. You can pay $20 extra for an express DHL shipping. The shipping options are available at checkout. I think you might have to pay custom tax depending on your country’s rules so ordering one from Amazon would be better in such a case but you won’t get the It’s FOSS special discount on Amazon. + +Now that you are aware of the specifications, let me show you how to set it up and how was my experience with it. + +_The amazon links in this article are affiliate links. Please read our [affiliate policy][16]._ + +### Setting up VIM3L and using it as home theatre PC + +Initially, when you start VIM3L, a window appears on the screen which consists of a series of questions and options. Everything you choose determines the initial state of its operation. In each case, however, you can modify your options from the settings menu. Better not to rush through the settings, since the multitude of options you have at startup seem to turn the VIM3L into a superpower device. + +![Setting up proxy network][17] + +The addition of the proxy connectivity in the internet settings is a welcome option. As a enthusiast of user privacy, I enabled it to connect through the [Tor network][18]. The choice is of course yours. + +![Peripheral devices][19] + +You can modify how many and which peripheral devices you have on that device. For example, in addition to the handheld control, you can mount a keyboard or even a console controller. Correct! A console controller that will allow you to play games. + +![Option to save logs][20] + +An important addition is the log storage option. With this, the users can consult the logs in case of an event of an error or malfunction. This could help in troubleshooting the issue. + +![Plenty of add-ons][21] + +On the left, a user can see options such as music, videos, radio, photos, games and many other options that we would like to take some time to cover. + +Add-ons further extends the capabilities of your HTPC. Here, you can find music libraries, documentaries, games, open-source software and more. The software includes various graphics, audio, and video editors, simulators etc. + +You have the freedom to choose whether you want to download them through 3rd party repositories, or from the environment of the accessory. Also, if you try to install software, you will most likely notice that along with the program, appropriate libraries and software are also installed. As you can see, this is not an accessory from scratch, but an accessory that is ready to cope with its users’ choices. + +VIM3L has different configuration profile consisting of a standard, intermediate, expert profile. As you climb into difficulty, your choices are multiplied, giving you total freedom. + +### Thoughts on VIM3L + +![][22] + +I liked VIM3L for what it offers. This is not to say that it is a perfect device. + +I found that some point, the controller is not fully accurate in signal transmission. As a result, after pressing a button twice, the signal is sent later and there is a quick change of screen. Maybe the controller I received was faulty. + +In conclusion, I would like to say that it’s not an expensive device and the feature it offers are good enough to provide you with entertainment, fun, productivity, and creativity. Most importantly, the software it offers are free and open source. + +If you like what you see here, you can either order it from [its own shop that ships from China][6] or get it from [Amazon][23]. + +Preview | Product | Price | +---|---|---|--- +![Khadas Amlogic S905D3 VIM3L HTPC Kit][24] ![Khadas Amlogic S905D3 VIM3L HTPC Kit][24] | [Khadas Amlogic S905D3 VIM3L HTPC Kit][25] | $89.99[][26] | [Buy on Amazon][27] + +Have you used VIM3L or any other pre-built media center device? Or do you prefer making your own HTPC? Do share your views. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/vim3l/ + +作者:[Community][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/raspberry-pi-alternatives/ +[2]: https://www.khadas.com/ +[3]: https://www.amazon.com/dp/B07K6GQNH3?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Tone boards) +[4]: https://www.khadas.com/edge +[5]: https://itsfoss.com/raspberry-pi-projects/ +[6]: https://www.khadas.com/vim3l +[7]: https://www.denx.de/wiki/U-Boot +[8]: https://github.com/khadas +[9]: https://coreelec.org/ +[10]: https://itsfoss.com/install-kodi-ubuntu/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/VIM3L_OS_Freedom_graphic.jpg?ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/VIM3L-Htpc-Kit.jpg?ssl=1 +[13]: https://source.android.com/devices/tech/ota +[14]: https://www.amazon.com/dp/B081H66D7Q?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (VIM3L HTPC version costs $89.99) +[15]: https://www.khadas.com/shop-vim3 +[16]: https://itsfoss.com/affiliate-policy/ +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/khadas_vim3l_3.jpg?ssl=1 +[18]: https://itsfoss.com/tor-guide/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/khadas_vim3l_2.jpg?ssl=1 +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/khadas_vim3l_4.jpg?ssl=1 +[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/khadas_vim3l_1.jpg?ssl=1 +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/VIM3L.jpg?ssl=1 +[23]: https://www.amazon.com/dp/B081H66D7Q?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Amazon) +[24]: https://i0.wp.com/m.media-amazon.com/images/I/41YC-mlA2PL._SL160_.jpg?ssl=1 +[25]: https://www.amazon.com/dp/B081H66D7Q?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Khadas Amlogic S905D3 VIM3L HTPC Kit) +[26]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[27]: https://www.amazon.com/dp/B081H66D7Q?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) From e7a2ac3753e4da8249b95ee7a53688abe14c7f46 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 25 Dec 2019 00:57:48 +0800 Subject: [PATCH 046/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191224=20Chill?= =?UTF-8?q?=20out=20with=20the=20Linux=20Equinox=20Desktop=20Environment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md --- ...h the Linux Equinox Desktop Environment.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md diff --git a/sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md b/sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md new file mode 100644 index 0000000000..3d207d33cb --- /dev/null +++ b/sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Chill out with the Linux Equinox Desktop Environment) +[#]: via: (https://opensource.com/article/19/12/ede-linux-desktop) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Chill out with the Linux Equinox Desktop Environment +====== +This article is part of a special series of 24 days of Linux desktops. +EDE is not the most glamorous, minimal, nor efficient desktop. But its +soft, muted tones are calming, its familiarity soothing, and its icon +theme fun. +![Linux penguin at the north pole beside an igloo][1] + +I haven't used the Fast Light Toolkit ([FLTK][2]) for anything serious yet, but I'm a fan of the C++ GUI toolkit that's pretty simple to learn and (in my experience) reliable even across updates. When I found out that there was a desktop environment built with FLTK, I was eager to try it—and I was quickly glad I did. The [Equinox Desktop Environment (EDE)][3] is a fast and simple desktop written in C++ and FLTK for Unix desktops. It uses common desktop conventions, so it looks and feels familiar right away, and after only a few days of using it, I found its simplicity provides a minimal elegance that I enjoy. + +![EDE desktop][4] + +### Installing EDE + +You are likely to find EDE included in your distribution's software repository, but you can also find it in its [SourceForge repository][5]. If you're already running a different desktop, it's safe to install EDE on the same system because it brings along just a few extra applications, which are specific to EDE so they won't get in your way on other desktops. + +EDE is only the desktop, and it uses the [Pekwm][6] window manager to handle layout. + +After installing EDE, log out of your current desktop session so you can log into your new one. By default, your session manager (KDM, GDM, LightDM, or XDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging in. + +With GDM: + +![][7] + +With SDDM: + +![][8] + +When EDE first boots, you might be prompted to confirm some startup tasks. On my Slackware workstation, KDE had marked some services as startup tasks (such as the HPLIP print monitor and a Bluetooth daemon), and EDE imported them with just one confirmation box. + +![Importing desktop services in EDE][9] + +After setting it up once, you won't need to do it again. + +### EDE desktop tour + +EDE's layout is exactly what most people expect from a desktop: application menu on the left, taskbar in the middle, system tray on the right. It's the standard off-the-shelf layout that confuses nobody; this is a desktop that's safe to install on a Linux computer and hand over, with confidence, to someone who's never used Linux in their life. They'll fall right into this desktop with a soft and gentle landing. + +You can bring up a small desktop menu with a right-click. This allows you to make an application launcher on the desktop, create a folder, and set some theme options. + +The panel at the bottom of the screen is retractable, so you can work full-screen if you prefer. Click the clock in the bottom-right of the screen to bring up a calendar and time-zone settings. + +EDE has a small Configuration Place application that provides access to a few simple preferences: + + * Background and icon settings + * Screensaver settings + * Time and clock + * System bell + * Keyboard + * Preferred applications + + + +![EDE Configuration Place][10] + +There's not much more to EDE. There's no file manager, no text editor, or paint program, or game of solitaire. You must bring anything you want to run on your desktop. That means you get to pick and choose from the wide array of Linux applications and use whatever you love the most. + +### EDE as a statement + +I found the simplicity of EDE oddly comforting, at least as a kind of "holiday" desktop; it's a nice place to visit. It's not the most glamorous desktop available, nor the most minimal, nor the most efficient. But its soft, muted tones are calming, its familiarity soothing, and its icon theme fun and exuberant. EDE is a desktop that's proud of its slow and steady pace. + +If you're in the mood to put your feet up and enjoy a clean and pleasant interface, try EDE. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/ede-linux-desktop + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/penguin.igloo_.png?itok=K92O7H6b (Linux penguin at the north pole beside an igloo) +[2]: https://www.fltk.org/ +[3]: https://sourceforge.net/projects/ede/ +[4]: https://opensource.com/sites/default/files/uploads/advent-ede.jpg (EDE desktop) +[5]: http://ede.sf.net +[6]: https://opensource.com/article/19/12/pekwm-linux-desktop +[7]: https://opensource.com/sites/default/files/advent-gdm_2.jpg +[8]: https://opensource.com/sites/default/files/advent-kdm_1.jpg +[9]: https://opensource.com/sites/default/files/uploads/advent-ede-init.jpg (Importing desktop services in EDE) +[10]: https://opensource.com/sites/default/files/uploads/advent-ede-conf.jpg (EDE Configuration Place) From ea8a1122d71eeea59066100e1bb2129f8ffab394 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 25 Dec 2019 00:58:07 +0800 Subject: [PATCH 047/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191224=20Top=20?= =?UTF-8?q?articles=20for=20learning=20Python=20in=202020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191224 Top articles for learning Python in 2020.md --- ...op articles for learning Python in 2020.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20191224 Top articles for learning Python in 2020.md diff --git a/sources/tech/20191224 Top articles for learning Python in 2020.md b/sources/tech/20191224 Top articles for learning Python in 2020.md new file mode 100644 index 0000000000..3b0ba8b166 --- /dev/null +++ b/sources/tech/20191224 Top articles for learning Python in 2020.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top articles for learning Python in 2020) +[#]: via: (https://opensource.com/article/19/12/learn-python) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg) + +Top articles for learning Python in 2020 +====== +No matter where you are in your Python programming journey, +Opensource.com's top Python articles from 2019 will help you along the +way. +![Hands on a keyboard with a Python book ][1] + +Python had a big year in 2019. According to popular resources like [GitHub][2] and [Stack Overflow][3], it's trending as the second most popular language in the world. + +> "Python, the fastest-growing major programming language, has risen in the ranks of programming languages in our survey yet again, edging out Java this year and standing as the second most loved language (behind Rust)." +> — [Stack Overflow Insights][3] + +Similarly, Python grew in readership on Opensource.com by leaps and bounds. Here are the top Python articles from 2019, grouped by topic, for your perusal. + +### Why choose Python? + +There are many languages out there, so what makes Python such a destination? If the most-read articles tell us anything, it's that people enjoy its flexibility. There are [multiple paradigms][4] that are accessible to Python developers, as Jigyasa Grover explains, including the popular [object-oriented programming][5] Seth Kenlon's tutorial shows. + +If you're a long-time user and looking for advanced examples of why Python is a perfect language, Moshe Zadka covers his [top 5 reasons for loving Python][6]. If that's not enough, you can also use it play around with powerful tools without a lot of code, like in Parul Pandey's tutorial on [image manipulation][7]. + +### Configuring Python + +As Python's popularity continues to rise, more people are starting with the language than ever before. Many of those first-timers are doing so on the Mac operating system and are using a [guide to setting up Python 3][8] that Moshe and I wrote. + +After installing Python, decisions on where to write your code come next. There are many options when it comes to text editors and integrated development environments (IDEs), but readers appear to favor graphical options, as Stephan Avenwedde's article about [Pythonic][9] and my article on [JupyterLab][10] were the most read articles on that topic in 2019. + +On the path to getting confident with the language, developers will have to face the multitude of options available for how to manage versions of the language and project dependencies. Luckily, László Kiss Kollár's article makes [managing Python packages][11] a bit simpler. + +When you're ready to configure an IDE with all of the features you'll want to make the most of the language, be sure to give the [opinionated linter Black][12] a try, as Moshe explains, to keep your code clean. + +### Wrapping up + +No matter where you are in your path to enjoying Python programming, the top Python articles from 2019 are here to help you along the way. I can't wrap this up without at least one acknowledgment of the importance of testing, and Moshe offers another well-read article [on tox][13] for that purpose. + +Thank you to all the authors who wrote for Opensource.com in 2019! If you're just learning to program in Python, let us know in the comments what you want to know. And, if you're a seasoned veteran, consider sharing your tips and tricks with us by [writing an article][14] about your favorite Python topic. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/learn-python + +作者:[Matthew Broberg][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mbbroberg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) +[2]: https://octoverse.github.com/#top-languages +[3]: https://insights.stackoverflow.com/survey/2019 +[4]: https://opensource.com/article/19/10/python-programming-paradigms +[5]: https://opensource.com/article/19/7/get-modular-python-classes +[6]: https://opensource.com/article/19/10/why-love-python +[7]: https://opensource.com/article/19/3/python-image-manipulation-tools +[8]: https://opensource.com/article/19/5/python-3-default-mac +[9]: https://opensource.com/article/19/5/graphically-programming-pythonic +[10]: https://opensource.com/article/19/5/jupyterlab-python-developers-magic +[11]: https://opensource.com/article/19/4/managing-python-packages +[12]: https://opensource.com/article/19/5/python-black +[13]: https://opensource.com/article/19/5/python-tox +[14]: https://opensource.com/how-submit-article From 70cbf86ec9f7401665b7c54ade52ad0eaf53f200 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 25 Dec 2019 00:58:40 +0800 Subject: [PATCH 048/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191224=20Why=20?= =?UTF-8?q?your=20Python=20code=20should=20be=20flat=20and=20sparse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191224 Why your Python code should be flat and sparse.md --- ...r Python code should be flat and sparse.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20191224 Why your Python code should be flat and sparse.md diff --git a/sources/tech/20191224 Why your Python code should be flat and sparse.md b/sources/tech/20191224 Why your Python code should be flat and sparse.md new file mode 100644 index 0000000000..0e447c5d8e --- /dev/null +++ b/sources/tech/20191224 Why your Python code should be flat and sparse.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why your Python code should be flat and sparse) +[#]: via: (https://opensource.com/article/19/12/zen-python-flat-sparse) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Why your Python code should be flat and sparse +====== +This is part of a special series about the Zen of Python focusing on the +fifth and sixth principles: flatness and sparseness. +![Digital creative of a browser on the internet][1] + +The [Zen of Python][2] is called that for a reason. It was never supposed to provide easy-to-follow guidelines for programming. The rules are specified tersely and are designed to engage the reader in deep thought. + +In order to properly appreciate the Zen of Python, you must read it and then meditate upon the meanings. If the Zen was designed to be a set of clear rules, it would be a fault that it has rules that contradict each other. However, as a tool to help you meditate on the best solution, contradictions are powerful. + +### Flat is better than nested. + +Nowhere is the pressure to be "flat" more obvious than in Python's strong insistence on indentation. Other languages will often introduce an implementation that "cheats" on the nested structure by reducing indentation requirements. To appreciate this point, let's take a look at JavaScript. + +JavaScript is natively async, which means that programmers write code in JavaScript using a lot of callbacks. + + +``` +a(function(resultsFromA) { +  b(resultsFromA, function(resultsfromB) { +    c(resultsFromC, function(resultsFromC) { +      console.log(resultsFromC) +   } +  } +} +``` + +Ignoring the code, observe the pattern and the way indentation leads to a right-most point. This distinctive "arrow" shape is tough on the eye to quickly walk through the code, so it's seen as undesirable and even nicknamed "callback hell." However, in JavaScript, it is possible to "cheat" and not have indentation reflect nesting. + + +``` +a(function(resultsFromA) { +b(resultsFromA, +  function(resultsfromB) { +c(resultsFromC, +  function(resultsFromC) { +    console.log(resultsFromC) +}}} +``` + +Python affords no such options to cheat: every nesting level in the program must be reflected in the indentation level. So deep nesting in Python _looks_ deeply nested. That makes "callback hell" was a worse problem in Python than in JavaScript: nesting callbacks mean indenting with no options to "cheat" with braces. + +This challenge, in combination with the Zen principle, has led to an elegant solution by a library I worked on. In the [Twisted][3] framework, we came up with the _deferred_ abstraction, which would later inspire the popular JavaScript _promise_ abstraction. In this way, Python's unwavering commitment to clear code forces Python developers to discover new, powerful abstractions. + + +``` +future_value = future_result() +future_value.addCallback(a) +future_value.addCallback(b) +future_value.addCallback(c) +``` + +(This might look familiar to modern JavaScript programmers: Promises were heavily influenced by Twisted's deferreds.) + +### Sparse is better than dense. + +The easiest way to make something less dense is to introduce nesting. This habit is why the principle of sparseness follows the previous one: after we have reduced nesting as much as possible, we are often left with _dense_ code or data structures. Density, in this sense, is jamming too much information into a small amount of code, making it difficult to decipher when something goes wrong. + +Reducing that denseness requires creative thinking, and there are no simple solutions. The Zen of Python does not offer simple solutions. All it offers are ways to find what can be improved in the code, without always giving guidance for "how." + +Take a walk. Take a shower. Smell the flowers. Sit in a lotus position and think hard, until finally, inspiration strikes. When you are finally enlightened, it is time to write the code. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-flat-sparse + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://www.python.org/dev/peps/pep-0020/ +[3]: https://twistedmatrix.com/trac/ From ca3dd31f745900cf7297e5ccc1a3fe1704e6529b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 25 Dec 2019 00:59:50 +0800 Subject: [PATCH 049/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191224=20Unix?= =?UTF-8?q?=20is=20turning=2050.=20What=20does=20that=20mean=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191224 Unix is turning 50. What does that mean.md --- ...Unix is turning 50. What does that mean.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20191224 Unix is turning 50. What does that mean.md diff --git a/sources/tech/20191224 Unix is turning 50. What does that mean.md b/sources/tech/20191224 Unix is turning 50. What does that mean.md new file mode 100644 index 0000000000..c01821ea28 --- /dev/null +++ b/sources/tech/20191224 Unix is turning 50. What does that mean.md @@ -0,0 +1,119 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Unix is turning 50. What does that mean?) +[#]: via: (https://www.networkworld.com/article/3511428/unix-is-turning-50-what-does-that-mean.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Unix is turning 50. What does that mean? +====== +Unix time, also known as 'epoch time,' is the number of seconds that have passed since Jan 1, 1970. As Unix turns 50, let's take a look at what worries kernel developers. +[cbaquiran][1] [(CC0)][2] + +2020 is a significant year for Unix. At the very start of the year, Unix turns 50. + +While some of the early development of Unix predates the official start of its "epoch," Jan 1, 1970 remains the zero-point in POSIX time and the recognized beginning of all things Unix. Jan 1, 2020 will mark 50 years since that moment. + +### Unix time vs human time + +In terms of human time, 50 years is a big deal. In terms of Unix time, there's nothing particularly special about 50 years. 48.7 years would be no less significant. + +[][3] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][3] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +Unix (including Linux) systems store date/time values as the number of seconds that have elapsed since 1970-01-01 00:00:00 UTC in 32 bits. To determine how many seconds have passed since that time and, thus, what right now looks like as a Unix time value, you can issue a command like this: + +``` +$ date +%s +1576883876 +``` + +The **%s** argument tells the date command to display the current date/time as the number of seconds since the start of 1970-01-01. + +### How much time can Unix systems manage? + +To understand how much time Unix systems can accommodate, we need to look at the capacity of a 32-bit field. It can be calculated like this: + +``` +$ echo '2^32' | bc +4294967296 +``` + +However, since Unix needs to accommodate negative numbers, it reserves one bit for a number's sign, thus reducing this to: + +``` +$ echo '2^31' | bc +2147483648 +``` + +And, since Unix numbering begins with 0, that means we have 2,147,483,648 values, but the largest possible value is 2,147,483,647. Unix date/time values cannot exceed that number – just like the odometer on your car probably can't exceed 999,999 miles. Add 1 and the value turns to 0. + +### How long is a year in seconds? + +The number of seconds in most years can be calculated like this – hours/day multiplied by minutes/hour multiplied by seconds/minute multiplied by the number of days in a year: + +``` +$ expr 24 \* 60 \* 60 \* 365 +31536000 +``` + +In leap years, we just add another day: + +``` +$ expr 24 \* 60 \* 60 \* 366 +31622400 +``` + +### **How will Unix see its 50 year birthday?** + +12:00 AM on Jan 1, 2020 will be **1577836800** in epoch time. The calculation is a little tricky, but mostly because we have to accommodate leap years. Since the start of the epoch, we've had 12 leap years, starting in 1972, the last in 2016. And, when we reach 2020, we will have had 38 regular years. + +Here’s a calculation using the **expr** command to count the seconds in these 50 years: + +``` +$ expr 24 \* 60 \* 60 \* 365 \* 38 + 24 \* 60 \* 60 \* 366 \* 12 +1577836800 +``` + +The first half of that is calculating the seconds in the 38 non-leap years. We then add a similar calculation for leap years with their 366 days. Conversely, you could use the seconds per year figures presented earlier and just do this: + +``` +$ expr 31536000 \* 38 + 31622400 \* 12 +1577836800 +``` + +This way of tracking dates and times made Unix systems fairly impervious to the Y2K scare that had people in late 1999 worried that moving into the year 2000 would wreak havoc on computer systems. Far fewer problems were experienced than people feared. In fact, only applications which stored years in a two-digit format would see the year going to 00 as a sign that time jumping backwards. Still, lots of application developers had some tedious extra work piled onto their plates to ensure that their systems wouldn’t run into serious problems when 2000 hit. + +### When Unix time will run into problems + +Unix systems won’t run into a **Y2K** type of problem until **2038** when dates stored as described above will overrun their 32-bit space allotments. But that’s 18 years from now, and kernel developers are already working on how they will avert disaster. It’s a bit too early to start panicking. + +The year 2038 problem is sometimes referred to as the **Y2K38** problem. We have until Tuesday, January 19, 2038 to address it. If the problem isn’t resolved, systems after that date may think it’s 1901. One way to address the problem would be to switch to 64-bit representations of date/time information. Some people believe that even that will be a lot more complex than it sounds. In any case, it’s probably still too early to panic. And, in the meantime, maybe after singing "Auld Lang Syne" this New Year’s Eve, you can sing "Happy Birthday" to Unix. It’s turning 50, and that’s still a very big deal. + +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/3511428/unix-is-turning-50-what-does-that-mean.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://pixabay.com/en/birthday-cake-cake-birthday-380178/ +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 5275d21971ecdc630d6e5c44ce8c6744e835316d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 25 Dec 2019 06:28:39 +0800 Subject: [PATCH 050/430] PRF --- ... Customize your Linux desktop with FVWM.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/translated/tech/20191210 Customize your Linux desktop with FVWM.md b/translated/tech/20191210 Customize your Linux desktop with FVWM.md index 90d2fa7604..013ec7ad06 100644 --- a/translated/tech/20191210 Customize your Linux desktop with FVWM.md +++ b/translated/tech/20191210 Customize your Linux desktop with FVWM.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Customize your Linux desktop with FVWM) @@ -9,14 +9,16 @@ 使用 FVWM 自定义 Linux 桌面 ====== -本文是 24 天 Linux 桌面特别系列的一部分。如果你正在寻找轻巧,快速且简单的 Linux 窗口管理器,那么 FVWM 可以胜任。但是,如果你正在寻找可以深入,探索和破解,那么 FVWM 是必须的。 -![Coding on a computer][1] -[FVWM][2] 窗口管理器最早是对早在 1993 年的 [TWM][3] 的修改。经过几年的迭代,出现了一个可高度自定义的环境,它可以配置任何行为、动作或事件。它支持自定义键绑定、鼠标手势、主题、脚本等。 +> 本文是 24 天 Linux 桌面特别系列的一部分。如果你正在寻找轻巧、快速且简单的 Linux 窗口管理器,那么 FVWM 可以胜任。但是,如果你正在寻找可以深入、探索和魔改的窗口管理器,那么 FVWM 是必须的。 -尽管 FVWM 在安装后即可使用,但默认发行版仅提供最小的配置。这是开始自定义桌面环境的良好基础,但是,如果你只想将其用作桌面,那么可能要安装另一个用户发布的完整配置。FVWM 有几种不同的发行版,包括模仿 Windows 95 的 FVWM95(至少在外观和布局上)。我尝试了 [FVWM-Crystal][4],这是一个具有一些现代 Linux 桌面约定的现代主题。 +![](https://img.linux.net.cn/data/attachment/album/201912/25/062800dwh3yhfcpx3ggjxp.jpg) -从 Linux 发行版的软件仓库中安装要尝试的 FVWM 发行版。如果找不到特定的 FVWM 发行版,那么可以安装基础的 FVWM2 包,然后进入 [Box-Look.org][5] 手动下载主题包。这样就需要更多的工作,但比从头开始构建要少。 +[FVWM][2] 窗口管理器最早脱胎于对 1993 年的 [TWM][3] 的修改。经过几年的迭代,诞生了一个可高度自定义的环境,它可以配置任何行为、动作或事件。它支持自定义键绑定、鼠标手势、主题、脚本等。 + +尽管 FVWM 在安装后即可投入使用,但默认分发版本仅提供了极其少的配置。这是开始自定义桌面环境的良好基础,但是,如果你只想将其用作桌面,那么可能要安装由其它用户发布的完整配置版本。FVWM 有几种不同的分发版,包括模仿 Windows 95 的 FVWM95(至少在外观和布局上)。我尝试了 [FVWM-Crystal][4],这是一个具有一些现代 Linux 桌面约定的现代主题。 + +可以从 Linux 发行版的软件仓库中安装要尝试的 FVWM 分发版。如果找不到特定的 FVWM 分发版,那么可以安装基础的 FVWM2 包,然后进入 [Box-Look.org][5] 手动下载主题包。这样就需要更多的工作,但比从头开始构建要少。 安装后,请注销当前的桌面会话,以便你可以登录 FVWM。默认情况下,会话管理器(KDM、GDM、LightDM 或 XDM,取决于你的设置)将继续登录到以前的桌面,因此你必须在登录之前覆盖该桌面。 @@ -30,27 +32,27 @@ ### FVWM 桌面 -无论你使用什么主题和配置,当你在桌面上单击鼠标左键时,FVWM 至少会显示一个菜单。菜单的内容取决于你所安装的。FVWM-Crystal 分发中的菜单包含对常用首选项的快速访问,例如屏幕分辨率、壁纸设置、窗口装饰等。 +无论你使用什么主题和配置,当你在桌面上单击鼠标左键时,FVWM 至少会显示一个菜单。菜单的内容取决于你所安装的内容。FVWM-Crystal 分发版中的菜单包含对常用首选项的快速访问,例如屏幕分辨率、壁纸设置、窗口装饰等。 -与 FVWM 中的几乎所有东西一样,你可以在菜单中编辑你要想的内容,但 FVWM-Crystal 倾向应用菜单栏。应用菜单位于屏幕的左上角,每个图标都包含相关应用启动器的菜单。例如,GIMP 图标表示图像编辑器,KDevelop 图标表示集成开发环境(IDE),GNU 图标表示文本编辑器,等等,具体取决于你在系统上安装的程序。 +同 FVWM 中的几乎所有东西一样,你可以编辑菜单中你要想的内容,但 FVWM-Crystal 的特色在于其应用菜单栏。应用菜单位于屏幕的左上角,每个图标都包含了相关的应用启动器的菜单。例如,GIMP 图标表示图像编辑器,KDevelop 图标表示集成开发环境(IDE),GNU 图标表示文本编辑器,等等,具体取决于你在系统上安装的程序。 ![FVWM-crystal running on Slackware 14.2][8] -FVWM-Crystal 还提供虚拟桌面、任务栏、时钟和应用栏。 - -关于背景,你可以使用与 FVWM-Crystal 捆绑在一起的壁纸,也可以使用 **feh** 命令设置自己的壁纸(你可能需要从仓库中安装它)。此命令有一些设置背景的选项,包括 **\-bg-scale** 使用缩放填充屏幕,**\-bg-fill** 直接填充而不缩放图片,等等。 +FVWM-Crystal 还提供了虚拟桌面、任务栏、时钟和应用栏。 +关于背景,你可以使用与 FVWM-Crystal 捆绑在一起的壁纸,也可以使用 `feh` 命令设置自己的壁纸(你可能需要从仓库中安装它)。此命令有一些设置背景的选项,包括 `--bg-scale` 使用你选择的图片缩放填充屏幕,`--bg-fill` 直接填充而不缩放图片,等等。 ``` -`$ feh --bg-scale ~/Pictures/wallpapers/mybackground.jpg` +$ feh --bg-scale ~/Pictures/wallpapers/mybackground.jpg ``` -大多数配置文件都包含在 **$HOME/.fvwm-crystal** 中,某些系统范围的默认文件位于 **/usr/share/fvwm-crystal**。 +大多数配置文件都包含在 `$HOME/.fvwm-crystal` 中,某些系统范围的默认文件位于 `/usr/share/fvwm-crystal`。 ### 自己尝试一下 -FVWM 是桌面构建平台,也是窗口管理器。它不会为你做什么事情,它期望你来配置尽可能的一切。 -如果你正在寻找轻巧,快速且简单的窗口管理器,那么 FVWM 可以胜任。但是,如果你正在寻找可以深入,探索和破解,那么 FVWM 是必须的。 +FVWM 是大多作为一个桌面构建平台,它也是窗口管理器。它不会为你做到面面俱到,它期望你来配置尽可能的一切。 + +如果你正在寻找轻巧、快速且简单的窗口管理器,那么 FVWM 可以胜任。但是,如果你正在寻找可以深入、探索和魔改的窗口管理器,那么 FVWM 是必须的。 -------------------------------------------------------------------------------- @@ -59,7 +61,7 @@ via: https://opensource.com/article/19/12/fvwm-linux-desktop 作者:[Seth Kenlon][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 46a554451f27c4b3d2bd7315cfe9982e2aa630d5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 25 Dec 2019 06:29:15 +0800 Subject: [PATCH 051/430] PUB @geekpi https://linux.cn/article-11712-1.html --- .../20191210 Customize your Linux desktop with FVWM.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191210 Customize your Linux desktop with FVWM.md (98%) diff --git a/translated/tech/20191210 Customize your Linux desktop with FVWM.md b/published/20191210 Customize your Linux desktop with FVWM.md similarity index 98% rename from translated/tech/20191210 Customize your Linux desktop with FVWM.md rename to published/20191210 Customize your Linux desktop with FVWM.md index 013ec7ad06..d53602de31 100644 --- a/translated/tech/20191210 Customize your Linux desktop with FVWM.md +++ b/published/20191210 Customize your Linux desktop with FVWM.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11712-1.html) [#]: subject: (Customize your Linux desktop with FVWM) [#]: via: (https://opensource.com/article/19/12/fvwm-linux-desktop) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From fd109a9529b4d6d64cc7afc27c67e4cb466392d5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 25 Dec 2019 08:53:00 +0800 Subject: [PATCH 052/430] translated --- ...in Ubuntu and Other Linux Distributions.md | 183 ------------------ 1 file changed, 183 deletions(-) delete mode 100644 sources/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md b/sources/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md deleted file mode 100644 index ab88f9198d..0000000000 --- a/sources/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md +++ /dev/null @@ -1,183 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Start, Stop & Restart Services in Ubuntu and Other Linux Distributions) -[#]: via: (https://itsfoss.com/start-stop-restart-services-linux/) -[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) - -How to Start, Stop & Restart Services in Ubuntu and Other Linux Distributions -====== - -Services are essential background processes that are usually run while booting up and shut down with the OS. - -If you are a sysadmin, you’ll deal with the service regularly. - -If you are a normal desktop user, you may come across the need to restart a service like [setting up Barrier for sharing mouse and keyboard between computers][1]. or when you are [using ufw to setup firewall][2]. - -Today I will show you two different ways you can manage services. You’ll learn to start, stop and restart services in Ubuntu or any other Linux distribution. - -systemd vs init - -Ubuntu and many other distributions these days use systemd instead of the good old init. - -In systemd, you manage sevices with systemctl command. - -In init, you manage service with service command. - -You’ll notice that even though your Linux system uses systemd, it is still able to use the service command (intended to be used with init system). This is because service command is actually redirect to systemctl. It’s sort of backward compatibility introduced by systemd because sysadmins were habitual of using the service command. - -I’ll show both systemctl and service command in this tutorial. - -_I am Ubuntu 18.04 here, but the process (no pun intended) is the same for other versions._ - -### Method 1: Managing services in Linux with systemd - -I am starting with systemd because of the obvious reason of its widespread adoption. - -#### 1\. List all services - -In order to manage the services, you first need to know what services are available on your system. - -You can use the systemd command to list all the services on your Linux system: - -``` -systemctl list-unit-files --type service -all -``` - -![systemctl list-unit-files][3] - -This command will output the state of all services. The value of a service’s state can be enabled, disabled, masked (inactive until mask is unset), static and generated. - -Combine it with the [grep command][4] and you can **display just the running services**: - -``` -sudo systemctl | grep running -``` - -![Display running services systemctl][5] - -Now that you know how to reference all different services, you can start actively managing them. - -**Note:** ***<service-***_**name>**_ _in the commands should be replaced by the name of the service you wish to manage (e.g. network-manager, ufw etc.)._ - -#### **2\. Start a** service - -To start a service in Linux, you just need to use its name like this: - -``` -systemctl start -``` - -#### 3\. **Stop** a service - -To stop a systemd service, you can use the stop option of systemctl command: - -``` -systemctl stop -``` - -#### 4\. Re**start** a service - -To restart a service in Linux with systemd, you can use: - -``` -systemctl restart -``` - -#### 5\. Check the status of a service - -You can confirm that you have successfully executed a certain action by printing the service status: - -``` -systemctl status -``` - -This will output information in the following manner: - -![systemctl status][6] - -That was systemd. Let’s switch to init now. - -### Method 2: Managing services in Linux with init - -The commands in init are also as simple as system. - -#### 1\. List all services - -To list all the Linux services, use - -``` -service --status-all -``` - -![service –status-all][7] - -The services preceded by **[ – ]** are **disabled** and those with **[ + ]** are **enabled**. - -#### **2\. Start** a service - -To start a service in Ubuntu and other distributions, use this command: - -``` -service start -``` - -#### **3\. Stop** a service - -Stopping a service is equally easy. - -``` -service stop -``` - -#### 4\. Re**start** a service - -If you want to restart a service, the command is: - -``` -service restart -``` - -#### 5\. Check the status of a service - -Furthermore, to check if your intended result was achieved, you can output the service ****status**:** - -``` -service status -``` - -This will output information in the following manner: - -![service status][8] - -This will, most importantly, tell you if a certain service is active **(**running**)** or not. - -**Wrapping Up** - -Today I detailed two very simple methods of managing services on Ubuntu or any other Linux system. I hope this article was helpful to you. - -Which method do you prefer? Let us know in the comment section below! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/start-stop-restart-services-linux/ - -作者:[Sergiu][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/sergiu/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/keyboard-mouse-sharing-between-computers/ -[2]: https://itsfoss.com/set-up-firewall-gufw/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/systemctl_list_services.png?ssl=1 -[4]: https://linuxhandbook.com/grep-command-examples/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/systemctl_grep_running.jpg?ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/systemctl_status.jpg?ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/service_status_all.png?ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/service_status.jpg?ssl=1 From 13b71fdd21ee33187fcceb85c10a56c987412bb3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 25 Dec 2019 08:53:12 +0800 Subject: [PATCH 053/430] translated --- ...in Ubuntu and Other Linux Distributions.md | 183 ++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 translated/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md diff --git a/translated/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md b/translated/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..ec3367d6ef --- /dev/null +++ b/translated/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md @@ -0,0 +1,183 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Start, Stop & Restart Services in Ubuntu and Other Linux Distributions) +[#]: via: (https://itsfoss.com/start-stop-restart-services-linux/) +[#]: author: (Sergiu https://itsfoss.com/author/sergiu/) + +如何在 Ubuntu 和其他 Linux 发行版中启动、停止和重启服务 +====== + +服务是必不可少的后台进程,它通常随系统启动,并在关机时关闭。 + +如果你是系统管理员,那么你会定期处理服务。 + +如果你是普通桌面用户,你可能会遇到需要重启服务的情况,例如[安装 Barrier 来用于在计算机之间共享鼠标和键盘][1]。或[在使用 ufw 设置防火墙][2]时。 + +今天,我将向你展示两种管理服务的方式。你将学习在 Ubuntu 或任何其他 Linux 发行版中启动、停止和重启服务。 + +systemd 与 init + +如今,Ubuntu 和许多其他发行版都使用 systemd 而不是旧的 init。 + +在 systemd 中,可以使用 systemctl 命令管理服务。 + +在 init 中,你可以使用 service 命令管理服务。 + +你会注意到,即使你的 Linux 系统使用 systemd,它仍然可以使用 service 命令(为了与 init 系统一起使用)。这是因为 service 命令实际上已重定向到 systemctl。systemd 引入了向后兼容性,因为系统管理员们习惯使用 service 命令。 + +在本教程中,我将同时展示 systemctl 和 service 命令。 + +_我的是 Ubuntu 18.04,但其他版本的过程也一样_。 + +### 方法 1:使用 systemd 在 Linux 中管理服务 + +我从 systemd 开始,因为它被广泛接受。 + +#### 1\. 列出所有服务 + +为了管理服务,你首先需要知道系统上有哪些服务可用。 + +你可以使用 systemd 命令列出 Linux 系统上的所有服务: + +``` +systemctl list-unit-files --type service -all +``` + +![systemctl list-unit-files][3] + +此命令将输出所有服务的状态。服务状态有启用、禁用、屏蔽(在取消掩码之前处于非活动状态)、静态和已生成。 + +与 [grep 命令][4] 结合,你可以**仅显示正在运行的服务**: + +``` +sudo systemctl | grep running +``` + +![Display running services systemctl][5] + +现在,你知道了如何引用所有不同的服务,你可以开始主动管理它们。 + +**注意:** 命令中的 **<service-name>** 应该用你想管理的服务名代替。(比如:network-manager、ufw 等) + +#### 2\. 启动服务 + +要在 Linux 中启动服务,你只需使用它的名字: + +``` +systemctl start +``` + +#### 3\. 停止服务 + +要停止 systemd 服务,可以使用 systemctl 命令的 stop 选项: + +``` +systemctl stop +``` + +#### 4\. 重启服务 + +要重启 systemd 服务,可以使用: + +``` +systemctl restart +``` + +#### 5\. 检查服务状态 + +你可以通过打印服务状态来确认你已经成功执行特定操作: + +``` +systemctl status +``` + +这将以以下方式输出: + +![systemctl status][6] + +这是 systemd 的内容。现在切换到 init。 + +### 方法 2:使用 init 在 Linux 中管理服务 + +init 的命令和 systemd 的一样简单。 + +#### 1\. 列出所有服务 + +要列出所有 Linux 服务,使用: + +``` +service --status-all +``` + +![service –status-all][7] + +前面的 **[ – ]** 代表**禁用**,**[ + ]** 代表**启用**。 + +#### 2\. 启动服务 + +要在 Ubuntu 和其他发行版中启动服务,使用命令: + +``` +service start +``` + +#### 3\. 停止服务 + +停止服务同样简单。 + +``` +service stop +``` + +#### 4\. 重启服务 + +如果你想重启服务,命令是: + +``` +service restart +``` + +#### 5\. 检查服务状态 + +此外,要检查是否达到了预期的结果,你可以输出服务**状态**: + +``` +service status +``` + +这将以以下方式输出: + +![service status][8] + +最重要的是,这将告诉你某项服务是否处于活跃状态(**正在运行**)。 + +**总结** + +今天,我详细介绍了两种在 Ubuntu 或任何其他 Linux 系统上管理服务的非常简单的方法。 希望本文对你有所帮助。 + +你更喜欢哪种方法? 让我在下面的评论中知道! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/start-stop-restart-services-linux/ + +作者:[Sergiu][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/sergiu/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/keyboard-mouse-sharing-between-computers/ +[2]: https://itsfoss.com/set-up-firewall-gufw/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/systemctl_list_services.png?ssl=1 +[4]: https://linuxhandbook.com/grep-command-examples/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/systemctl_grep_running.jpg?ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/systemctl_status.jpg?ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/service_status_all.png?ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/service_status.jpg?ssl=1 From b55e746027448aaa5c36e8cbeec650d11c7b8629 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 25 Dec 2019 09:34:04 +0800 Subject: [PATCH 054/430] translating --- ...24 App Highlight- Falkon Open Source Web Browser from KDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md b/sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md index 42439f33c1..7f3ec34562 100644 --- a/sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md +++ b/sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d0717e53ebe8c7e0628580003a7b80bac5140017 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 25 Dec 2019 15:56:40 +0800 Subject: [PATCH 055/430] APL --- .../tech/20191224 Unix is turning 50. What does that mean.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191224 Unix is turning 50. What does that mean.md b/sources/tech/20191224 Unix is turning 50. What does that mean.md index c01821ea28..259eecb964 100644 --- a/sources/tech/20191224 Unix is turning 50. What does that mean.md +++ b/sources/tech/20191224 Unix is turning 50. What does that mean.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 85605b3c5c6d58c2b6faf9fe82f090deb4b169e8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 25 Dec 2019 16:44:31 +0800 Subject: [PATCH 056/430] TSL --- ...Unix is turning 50. What does that mean.md | 119 ------------------ ...Unix is turning 50. What does that mean.md | 111 ++++++++++++++++ 2 files changed, 111 insertions(+), 119 deletions(-) delete mode 100644 sources/tech/20191224 Unix is turning 50. What does that mean.md create mode 100644 translated/tech/20191224 Unix is turning 50. What does that mean.md diff --git a/sources/tech/20191224 Unix is turning 50. What does that mean.md b/sources/tech/20191224 Unix is turning 50. What does that mean.md deleted file mode 100644 index 259eecb964..0000000000 --- a/sources/tech/20191224 Unix is turning 50. What does that mean.md +++ /dev/null @@ -1,119 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Unix is turning 50. What does that mean?) -[#]: via: (https://www.networkworld.com/article/3511428/unix-is-turning-50-what-does-that-mean.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -Unix is turning 50. What does that mean? -====== -Unix time, also known as 'epoch time,' is the number of seconds that have passed since Jan 1, 1970. As Unix turns 50, let's take a look at what worries kernel developers. -[cbaquiran][1] [(CC0)][2] - -2020 is a significant year for Unix. At the very start of the year, Unix turns 50. - -While some of the early development of Unix predates the official start of its "epoch," Jan 1, 1970 remains the zero-point in POSIX time and the recognized beginning of all things Unix. Jan 1, 2020 will mark 50 years since that moment. - -### Unix time vs human time - -In terms of human time, 50 years is a big deal. In terms of Unix time, there's nothing particularly special about 50 years. 48.7 years would be no less significant. - -[][3] - -BrandPost Sponsored by HPE - -[Take the Intelligent Route with Consumption-Based Storage][3] - -Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. - -Unix (including Linux) systems store date/time values as the number of seconds that have elapsed since 1970-01-01 00:00:00 UTC in 32 bits. To determine how many seconds have passed since that time and, thus, what right now looks like as a Unix time value, you can issue a command like this: - -``` -$ date +%s -1576883876 -``` - -The **%s** argument tells the date command to display the current date/time as the number of seconds since the start of 1970-01-01. - -### How much time can Unix systems manage? - -To understand how much time Unix systems can accommodate, we need to look at the capacity of a 32-bit field. It can be calculated like this: - -``` -$ echo '2^32' | bc -4294967296 -``` - -However, since Unix needs to accommodate negative numbers, it reserves one bit for a number's sign, thus reducing this to: - -``` -$ echo '2^31' | bc -2147483648 -``` - -And, since Unix numbering begins with 0, that means we have 2,147,483,648 values, but the largest possible value is 2,147,483,647. Unix date/time values cannot exceed that number – just like the odometer on your car probably can't exceed 999,999 miles. Add 1 and the value turns to 0. - -### How long is a year in seconds? - -The number of seconds in most years can be calculated like this – hours/day multiplied by minutes/hour multiplied by seconds/minute multiplied by the number of days in a year: - -``` -$ expr 24 \* 60 \* 60 \* 365 -31536000 -``` - -In leap years, we just add another day: - -``` -$ expr 24 \* 60 \* 60 \* 366 -31622400 -``` - -### **How will Unix see its 50 year birthday?** - -12:00 AM on Jan 1, 2020 will be **1577836800** in epoch time. The calculation is a little tricky, but mostly because we have to accommodate leap years. Since the start of the epoch, we've had 12 leap years, starting in 1972, the last in 2016. And, when we reach 2020, we will have had 38 regular years. - -Here’s a calculation using the **expr** command to count the seconds in these 50 years: - -``` -$ expr 24 \* 60 \* 60 \* 365 \* 38 + 24 \* 60 \* 60 \* 366 \* 12 -1577836800 -``` - -The first half of that is calculating the seconds in the 38 non-leap years. We then add a similar calculation for leap years with their 366 days. Conversely, you could use the seconds per year figures presented earlier and just do this: - -``` -$ expr 31536000 \* 38 + 31622400 \* 12 -1577836800 -``` - -This way of tracking dates and times made Unix systems fairly impervious to the Y2K scare that had people in late 1999 worried that moving into the year 2000 would wreak havoc on computer systems. Far fewer problems were experienced than people feared. In fact, only applications which stored years in a two-digit format would see the year going to 00 as a sign that time jumping backwards. Still, lots of application developers had some tedious extra work piled onto their plates to ensure that their systems wouldn’t run into serious problems when 2000 hit. - -### When Unix time will run into problems - -Unix systems won’t run into a **Y2K** type of problem until **2038** when dates stored as described above will overrun their 32-bit space allotments. But that’s 18 years from now, and kernel developers are already working on how they will avert disaster. It’s a bit too early to start panicking. - -The year 2038 problem is sometimes referred to as the **Y2K38** problem. We have until Tuesday, January 19, 2038 to address it. If the problem isn’t resolved, systems after that date may think it’s 1901. One way to address the problem would be to switch to 64-bit representations of date/time information. Some people believe that even that will be a lot more complex than it sounds. In any case, it’s probably still too early to panic. And, in the meantime, maybe after singing "Auld Lang Syne" this New Year’s Eve, you can sing "Happy Birthday" to Unix. It’s turning 50, and that’s still a very big deal. - -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/3511428/unix-is-turning-50-what-does-that-mean.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://pixabay.com/en/birthday-cake-cake-birthday-380178/ -[2]: https://creativecommons.org/publicdomain/zero/1.0/ -[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) -[4]: https://www.facebook.com/NetworkWorld/ -[5]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20191224 Unix is turning 50. What does that mean.md b/translated/tech/20191224 Unix is turning 50. What does that mean.md new file mode 100644 index 0000000000..f68c48ffd6 --- /dev/null +++ b/translated/tech/20191224 Unix is turning 50. What does that mean.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Unix is turning 50. What does that mean?) +[#]: via: (https://www.networkworld.com/article/3511428/unix-is-turning-50-what-does-that-mean.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Unix 即将迎来 50 岁 +====== + +Unix 时间(又称为“纪元时间epoch time”)是自 1970 年 1 月 1 日以来经过的秒数。当 Unix 即将 50 岁时,让我们看一下让内核开发人员担心的地方。 + +[cbaquiran][1] + +对于 Unix 而言,2020 年是重要的一年。在这一年年初,Unix 进入 50 岁。 + +尽管 Unix 的某些早期开发早于其“纪元”的正式开始,但 1970 年 1 月 1 日仍然是 POSIX 时间的零点,也是公认的 Unix 的万物之始。自那一刻算起,2020 年 1 月 1 日将是其 50 周年。 + +### Unix 时间与人类时间 + +就人类时间而言,50 年是很重要的。就 Unix 时间而言,50 年没有什么特别的。48.7 年同样重要。 + +Unix(包括 Linux)系统将日期/时间值存储为自 1970-01-01 00:00:00 UTC 以来经过的秒数(32 位二进制)。要确定自该时间以来经过了几秒钟,看看 Unix 时间值是什么样子,你可以发出如下命令: + +``` +$ date +%s +1576883876 +``` + +`%s` 参数告诉 `date` 命令将当前日期/时间显示为自 1970-01-01 开始以来的秒数。 + +### Unix 系统可以管理多少时间? + +要了解 Unix 系统可以容纳多少时间,我们需要查看 32 位字段的容量。可以这样计算: + +``` +$ echo '2^32' | bc +4294967296 +``` + +但是,由于 Unix 需要容纳负数,因此它会为数字的符号保留一位,从而将其减少为: + +``` +$ echo '2^31' | bc +2147483648 +``` + +并且,由于 Unix 计数以 0 开头,这意味着我们有 2,147,483,648 个值,但最大的可能值为 2,147,483,647 个。Unix 日期/时间值不能超过该数字——就像汽车上的里程表可能不能超过 999,999 英里一样。加 1 该值就变为了 -2147483648。(LCTT 译注:此处原文描述有误,已修改。在达到最大值之后,即 2018/1/19 03:14:07,下 1 秒导致符号位变为 1,其余 31 位为 0,即 -2147483648,时间变为 1901/12/13 20:45:52,这就是 Y2K38 问题。) + +### 一年有多少秒? + +大多数年份的秒数可以这样计算:每天的小时数乘以每小时的分钟数乘以每分钟的秒数乘以一年中的天数: + +``` +$ expr 24 \* 60 \* 60 \* 365 +31536000 +``` + +在闰年,我们再增加一天: + +``` +$ expr 24 \* 60 \* 60 \* 366 +31622400 +``` + +### Unix 将如何庆祝其 50 岁生日? + +2020 年 1 月 1 日中午 12:00 是纪元时间的 1577836800。这个计算有些棘手,但主要是因为我们必须适应闰年。自该纪元开始以来,我们经历了 12 个闰年,从 1972 年开始,到上一个闰年是 2016 年。而且,当我们达到 2020 年时,我们将有 38 个常规年份。 + +这是使用 `expr` 命令进行的计算,以计算这 50 年的秒数: + +``` +$ expr 24 \* 60 \* 60 \* 365 \* 38 + 24 \* 60 \* 60 \* 366 \* 12 +1577836800 +``` + +前半部分是计算 38 个非闰年的秒数。然后,我们加上闰年的 366 天的类似计算。或者,你可以使用前面介绍的每年秒数,然后执行以下操作: + +``` +$ expr 31536000 \* 38 + 31622400 \* 12 +1577836800 +``` + +这种跟踪日期和时间的方式使 Unix 系统完全不受 Y2K 恐慌的影响,1999 年末人们开始担心进入 2000 年会对计算机系统造成严重破坏。但是实际遇到的问题比人们担心的少得多。实际上,只有以两位数格式存储年份的应用程序才会将年份变为 00,以表示时间倒退。尽管如此,许多应用程序开发人员还是做了很多额外的繁琐工作,以确保 2000 年到来时,他们的系统不会出现严重问题。 + +### Unix 时间何时会遇到问题? + +在 2038 年之前,Unix 系统不会遇到 Y2K 类型的问题,直到如上所述存储的日期将超过其 32 位空间分配。但这距离现在已经只有 18 年了,内核开发人员已经在研究如何避免灾难。但现在开始恐慌还为时过早。 + +2038 年的问题有时称为 Y2K38 问题。我们必须在 2038 年 1 月 19 日星期二之前解决这个问题。如果问题到时候仍未解决,则该日期之后的系统可能会认为是 1901 年。解决该问题的一种方法是切换为日期/时间信息的 64 位表示形式。有些人认为,即使那样,也会有比听起来更复杂的问题。无论如何,恐慌还为时过早。并且,与此同时,也许在新年前夜演唱了《Auld Lang Syne》之后,你可以向 Unix 唱《生日快乐》歌了。Unix 50 岁了,这仍然是大事。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3511428/unix-is-turning-50-what-does-that-mean.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2017/10/birthday-cake-candles-100739452-large.jpg +[2]: https://creativecommons.org/publicdomain/zero/1.0/ +[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From e329b96dcb28b3e3a666893ba519ecd5d030fb45 Mon Sep 17 00:00:00 2001 From: chen ni Date: Wed, 25 Dec 2019 19:04:11 +0800 Subject: [PATCH 057/430] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20191218 How tracking pixels work.md | 94 +++++++++---------- 1 file changed, 43 insertions(+), 51 deletions(-) diff --git a/sources/tech/20191218 How tracking pixels work.md b/sources/tech/20191218 How tracking pixels work.md index 11ac17be73..851652c129 100644 --- a/sources/tech/20191218 How tracking pixels work.md +++ b/sources/tech/20191218 How tracking pixels work.md @@ -7,98 +7,90 @@ [#]: via: (https://jvns.ca/blog/how-tracking-pixels-work/) [#]: author: (Julia Evans https://jvns.ca/) -How tracking pixels work +追踪像素是如何工作的? ====== -I spent some time talking to a reporter yesterday about how advertisers track people on the internet. We had a really fun time looking at Firefox’s developer tools together (I’m not an internet privacy expert, but I do know how to use the network tab in developer tools!) and I learned a few things about how tracking pixels actually work in practice! +昨天,我和一名记者谈到了一个问题:广告商是如何在互联网上对人们进行追踪的?我们津津有味地查看了 Firefox 的开发者工具(虽然我不是一个互联网隐私专家,但至少还会使用开发者工具中的“network”标签页),从中我终于弄明白追踪像素在实际中是如何工作的了。 -### the question: how does Facebook know that you went to Old Navy? +### 问题:Facebook 怎么知道你逛了 Old Navy? -I often hear about this slightly creepy internet experience: you’re looking at a product online, and a day later see an ad for the same boots or whatever that you were looking at. This is called “retargeting”, but how does it actually work exactly in practice? +我时常听人们说起这种有些诡异的上网经历:你在线上浏览了一个商品,一天之后,竟然看到了同一款靴子(或者是别的什么你当时浏览的商品)的广告。这就是所谓的“再营销”,但它到底是如何实现的呢? -In this post we’ll experiment a bit and see exactly how Facebook can know what products you’ve looked at online! I’m using Facebook as an example in this blog post just because it’s easy to find websites with Facebook tracking pixels on them but of course almost every internet advertising company does this kind of tracking. +在本文中,我们来进行一个小实验,看看 Facebook 究竟是怎么知道你在线上浏览了什么商品的。这里使用 Facebook 作为示例,只是因为很容易找到投放了 Facebook 追踪像素的网站;其实,几乎所有互联网广告公司都会使用类似的追踪技术。 -### the setup: allow third party trackers, turn off my adblocker +### 准备:允许第三方追踪器,同时关闭广告拦截器 -I use Firefox, and by default Firefox blocks a lot of this kind of tracking. So I needed to modify my Firefox privacy settings to get this tracking to work. +我使用的浏览器是 Firefox,但是 Firefox 默认拦截了很多这种类型的追踪,所以需要修改 Firefox 的隐私设置,才能让这种追踪生效。 -I changed my privacy settings from the default ([screenshot][1]) to a custom setting that allows third-party trackers ([screenshot][2]). I also disabled some privacy extensions I usually have running. +首先,我将隐私设置从默认设置([截图][1])修改为允许第三方追踪器的个性化设置([截图][2]),然后禁用了一些平时运行的隐私保护扩展。 -### tracking pixels: it’s not the gif, it’s the query parameters +### 追踪像素:关键不在于 gif,而在于请求参数 -A tracking pixel is a 1x1 gif that sites use to track you. By itself, obviously a tiny 1x1 gif doesn’t do too much. So how do tracking pixels track you? 2 ways: +追踪像素是网站用来追踪你的一个 1x1 大小的 gif。就其本身而言,一个小小的 1x1 gif 显然起不到什么作用。那么,追踪像素到底是如何进行追踪的?其中涉及两个方面: - 1. Sites use the **query parameters** in the tracking pixel to add extra information like the URL of the page you’re visiting. So instead of just requesting `https://www.facebook.com/tr/` (which is a 44-byte 1x1 gif), it’ll request `https://www.facebook.com/tr/?the_website_you're_on`. (email marketers use similar tricks to figure out if you’ve opened an email, by giving the tracking pixel a unique URL) - 2. Sites send **cookies** with the tracking pixel so that they can tell that the person who visited oldnavy.com is the same as the person who’s using Facebook on the same computer. + 1. 通过使用追踪像素上的**请求参数**,网站可以添加额外的信息,比如你正在访问的页面。这样一来,请求的就不是 `https://www.facebook.com/tr/`(这个链接是一个 44 字节大小的 1x1 gif),而是 `https://www.facebook.com/tr/?the_website_you're_on`。(邮件营销人员会使用类似的技巧,通过为追踪像素指定一个独特的 URL,弄清楚你是否打开了某一封邮件。) + 2. 在发送该请求的同时,还发送了相应的 cookie。这样一来广告商就可以知道,访问 oldnavy.com 的这个人和在同一台电脑上使用 Facebook 的是同一个人。 +### Old Navy 网站上的 Facebook 追踪像素 +为了对此进行验证,我在 Old Navy(GAP 旗下的一个服装品牌)网站上浏览了一个商品,相应的URL是 [https://oldnavy.gap.com/browse/product.do?pid=504753002&cid=1125694&pcid=1135640&vid=1&grid=pds_0_109_1][3](这是一件“男款短绒格子花呢大衣”)。 -### the Facebook tracking pixel on Old Navy’s website - -To test this out, I went to look at a product on the Old Navy site with the URL [https://oldnavy.gap.com/browse/product.do?pid=504753002&cid=1125694&pcid=1135640&vid=1&grid=pds_0_109_1][3] (a “Soft-Brushed Plaid Topcoat for Men”). - -When I did that, the Javascript running on that page (presumably [this code][4]) sent a request to facebook.com that looks like this in Developer tools: (I censored most of the cookie values because some of them are my login cookies :) ) +在我浏览这个商品的同时,页面上运行的 Javascript(用的应该是[这段代码][4])向 facebook.com 发送了一个请求。在开发者工具中,该请求看上去是这样的:(我屏蔽了大部分 cookie 值,因为其中有一些是我的登录 cookie) ![][5] -Let’s break down what’s happening: +下面对其进行拆解分析: - 1. My browser sends a request to ` https://www.facebook.com/tr/?id=937725046402747&ev=PageView&dl=https%3A%2F%2Foldnavy.gap.com%2Fbrowse%2Fproduct.do%3Fpid%3D504753002%26cid%3D1125694%26pcid%3Dxxxxxx0%26vid%3D1%26grid%3Dpds_0_109_1%23pdp-page-content&rl=https%3A%2F%2Foldnavy.gap.com%2Fbrowse%2Fcategory.do%3Fcid%3D1135640%26mlink%3D5155%2Cm_mts_a&if=false&ts=1576684838096&sw=1920&sh=1080&v=2.9.15&r=stable&a=tmtealium&ec=0&o=30&fbp=fb.1.1576684798512.1946041422&it=15xxxxxxxxxx4&coo=false&rqm=GET` - 2. With that request, it sends a cookie called `fr` which is set to `10oGXEcKfGekg67iy.AWVdJq5MG3VLYaNjz4MTNRaU1zg.Bd-kxt.KU.F36.0.0.Bd-kx6.` (which I guess is my Facebook ad tracking ID) + 1. 我的浏览器向 ` https://www.facebook.com/tr/?id=937725046402747&ev=PageView&dl=https%3A%2F%2Foldnavy.gap.com%2Fbrowse%2Fproduct.do%3Fpid%3D504753002%26cid%3D1125694%26pcid%3Dxxxxxx0%26vid%3D1%26grid%3Dpds_0_109_1%23pdp-page-content&rl=https%3A%2F%2Foldnavy.gap.com%2Fbrowse%2Fcategory.do%3Fcid%3D1135640%26mlink%3D5155%2Cm_mts_a&if=false&ts=1576684838096&sw=1920&sh=1080&v=2.9.15&r=stable&a=tmtealium&ec=0&o=30&fbp=fb.1.1576684798512.1946041422&it=15xxxxxxxxxx4&coo=false&rqm=GET` 发送了一个请求; + 2. 与该请求同时发送的,还有一个名为 `fr` 的 cookie,取值为 `10oGXEcKfGekg67iy.AWVdJq5MG3VLYaNjz4MTNRaU1zg.Bd-kxt.KU.F36.0.0.Bd-kx6.`(估计是我的 Facebook 广告追踪 ID) +在所发送的追踪像素查询字符串里,有三个值得注意的地方: + * 我当前访问的页面:[https://oldnavy.gap.com/browse/product.do?pid=504753002&cid=1125694&pcid=1135640&vid=1&grid=pds_0_109_1#pdp-page-content][6] + * 引导我来到当前页面的上一级页面:[https://oldnavy.gap.com/browse/category.do?cid=1135640&mlink=5155,m_mts_a][7]; + * 作为我的身份标识的 cookie:`10oGXEcKfGekg67iy.AWVdJq5MG3VLYaNjz4MTNRaU1zg.Bd-kxt.KU.F36.0.0.Bd-kx6.` -So the three most notable things that are being sent in the tracking pixel query string are: +### 下面来逛逛 Facebook! - * the page I visited: [https://oldnavy.gap.com/browse/product.do?pid=504753002&cid=1125694&pcid=1135640&vid=1&grid=pds_0_109_1#pdp-page-content][6] - * the page that referred me to that page: [https://oldnavy.gap.com/browse/category.do?cid=1135640&mlink=5155,m_mts_a][7] - * an identifier cookie for me: `10oGXEcKfGekg67iy.AWVdJq5MG3VLYaNjz4MTNRaU1zg.Bd-kxt.KU.F36.0.0.Bd-kx6.` +下面来逛逛 Facebook 吧。我之前已经登入了 Facebook,猜猜看,我的浏览器发送给 Facebook 的 cookie 是什么? +不出所料,正是之前见过的 `fr` cookie:`10oGXEcKfGekg67iy.AWVdJq5MG3VLYaNjz4MTNRaU1zg.Bd-kxt.KU.F36.0.0.Bd-kx6.`。Facebook 现在一定知道我(Julia Evans,这个 Facebook 账号所关联的人)在几分钟之前访问了 Old Navy 网站,并且浏览了“男款短绒格子花呢大衣”,因为他们可以使用这个 cookie 将数据串联起来。 +### 这里涉及到的是第三方 cookie -### now let’s visit Facebook! +Facebook 用来追踪我访问了哪些网站的 cookie,属于所谓的“第三方 cookie”,因为 Old Navy 的网站使用它为一个第三方(即 facebook.com)确认我的身份。这和用来维持登录状态的“第一方 cookie”有所不同。 -Next, let’s visit Facebook, where I’m logged in. What cookies is my browser sending Facebook? +Safari 和 Firefox 默认都会拦截许多第三方 cookie(所以需要更改 Firefox 的隐私设置,才能够进行这个实验),而 Chrome 目前并不进行拦截(很可能是因为 Chrome 的所有者正是一个广告公司)。 -Unsurprisingly, it’s the same `fr` cookie from before: `10oGXEcKfGekg67iy.AWVdJq5MG3VLYaNjz4MTNRaU1zg.Bd-kxt.KU.F36.0.0.Bd-kx6.`. So Facebook now definitely knows that I (Julia Evans, the person with this Facebook account) visited the Old Navy website a couple of minutes ago and looked at a “Soft-Brushed Plaid Topcoat for Men”, because they can use that identifier to match up the data. +### 网站上有很多追踪像素 -### these cookies are third-party cookies +如我所料,网站上有 **很多** 追踪像素。比如,wrangler.com 在我的浏览器里加载了来自不同域的 19 个不同的追踪像素。wrangler.com 上的追踪像素分别来自:`ct.pinterest.com`、`af.monetate.net`、`csm.va.us.criteo.net`、`google-analytics.com`、`dpm.demdex.net`、`google.ca`、`a.tribalfusion.com`、`data.photorank.me`、`stats.g.doubleclick.net`、`vfcorp.dl.sc.omtrdc.net`、`ib.adnxs.com`、`idsync.rlcdn.com`、`p.brsrvr.com`,以及`adservice.google.com`。 -The `fr` cookie that Facebook is using to track what websites I go to is called a “third party cookie”, because Old Navy’s website is using it to identify me to a third party (facebook.com). This is different from first-party cookies, which are used to keep you logged in. - -Safari and Firefox both block many third-party cookies by default (which is why I had to change Firefox’s privacy settings to get this experiment to work), and as of today Chrome doesn’t (presumably because Chrome is owned by an ad company). - -### sites have lots of tracking pixels - -Like I expected, sites have **lots** of tracking pixels. For example, wrangler.com loaded 19 different tracking pixels in my browser from a bunch of different domains. The tracking pixels on wrangler.com came from: `ct.pinterest.com`, `af.monetate.net`, `csm.va.us.criteo.net`, `google-analytics.com`, `dpm.demdex.net`, `google.ca`, `a.tribalfusion.com`, `data.photorank.me`, `stats.g.doubleclick.net`, `vfcorp.dl.sc.omtrdc.net`, `ib.adnxs.com`, `idsync.rlcdn.com`, `p.brsrvr.com`, and `adservice.google.com`. - -For most of these trackers, Firefox helpfully pointed out that it would have blocked them if I was using the standard Firefox privacy settings: +Firefox 贴心地指出,如果使用 Firefox 的标准隐私设置,其中的大部分追踪器都会被拦截: ![][8] -### why browsers matter +### 浏览器的重要性 -The reason browsers matter so much is that your browser has the final word on what information it sends about you to which websites. The Javascript on the Old Navy’s website can ask your browser to send tracking information about you to Facebook, but your browser doesn’t have to do it! It can decide “oh yeah, I know that facebook.com/tr/ is a tracking pixel, I don’t want my users to be tracked, I’m just not going to send that request”. +浏览器之所以如此重要,是因为你的浏览器最终决定了发送你的什么信息、发送到哪些网站。Old Navy 网站上的 Javascript 可以请求你的浏览器向 Facebook 发送关于你的追踪信息,但浏览器可以拒绝执行。浏览器的决定可以是:“哈,我知道 facebook.com/tr/ 是一个追踪像素,我不想让我的用户被追踪,所以我不会发送这个请求”。 -And it can make that behaviour configurable by changing browser settings or installing browser extensions, which is why there are lots of privacy extensions. +浏览器还可以允许用户对上述行为进行配置,方法包括更改浏览器设置,以及安装浏览器扩展(所以才会有如此多的隐私保护扩展)。 -### it’s fun to see how this works! +### 摸清其中原理,实为一件趣事 -I think it’s fun to see how cookies / tracking pixels are used to track you in practice, even if it’s kinda creepy! I sort of knew how this worked before but I’d never actually looked at the cookies on a tracking pixel myself or what kind of information it was sending in its query parameters exactly. +在我看来,弄清楚 cookie / 追踪像素是怎么用于对你进行追踪的,实在是一件趣事(尽管显得有点阴险)。我之前大概明白其中的道理,但是并没有亲自查看过追踪像素上的 cookie,也没有看过发送的查询参数上究竟包含什么样的信息。 -And if you know how it works, it’s a easier to figure out how to be tracked less! +当然,明白了其中的原理,也就更容易降低被追踪的概率了。 -### what can you do? +### 可以采取的措施 -I do a few small things to get tracked on the internet a little less: +为了尽量避免在互联网上被追踪,我采取了几种简单的措施: - * install an adblocker (like ublock origin or something), which will block a lot of tracker domains - * use Firefox/Safari instead of Chrome (which have stronger default privacy settings right now) - * use the [Facebook Container][9] Firefox extension, which takes extra steps to specifically prevent Facebook from tracking you + * 安装一个广告拦截器(比如 ublock origin 之类)。广告拦截器可以对许多追踪器的域进行拦截。 + * 使用目前默认隐私保护强度更高的 Firefox/Safari,而不是 Chrome。 + * 使用 [Facebook Container][9] 这个 Firefox 扩展。该扩展针对 Facebook 进一步采取了防止追踪的措施。 - - -There are still lots of other ways to be tracked on the internet (especially when using mobile apps where you don’t have the same kind of control as with your browser), but I like understanding how this one method of tracking works and think it’s nice to be tracked a little bit less. +虽然在互联网上被追踪的方式还有很多(尤其是在使用手机应用的时候,因为在这种情况下,你没有和像对浏览器一样的控制程度),但是能够理解这种追踪方法的工作原理,稍微减少一些被追踪的可能性,也总归是一件好事。 -------------------------------------------------------------------------------- From e788516a3e5d7d166b8f5f0384756bd297f1e199 Mon Sep 17 00:00:00 2001 From: chen ni Date: Wed, 25 Dec 2019 19:11:03 +0800 Subject: [PATCH 058/430] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20191218 How tracking pixels work.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/tech/20191218 How tracking pixels work.md b/sources/tech/20191218 How tracking pixels work.md index 851652c129..9be6ed4049 100644 --- a/sources/tech/20191218 How tracking pixels work.md +++ b/sources/tech/20191218 How tracking pixels work.md @@ -62,9 +62,9 @@ Facebook 用来追踪我访问了哪些网站的 cookie,属于所谓的“第 Safari 和 Firefox 默认都会拦截许多第三方 cookie(所以需要更改 Firefox 的隐私设置,才能够进行这个实验),而 Chrome 目前并不进行拦截(很可能是因为 Chrome 的所有者正是一个广告公司)。 -### 网站上有很多追踪像素 +### 网站上的追踪像素有很多 -如我所料,网站上有 **很多** 追踪像素。比如,wrangler.com 在我的浏览器里加载了来自不同域的 19 个不同的追踪像素。wrangler.com 上的追踪像素分别来自:`ct.pinterest.com`、`af.monetate.net`、`csm.va.us.criteo.net`、`google-analytics.com`、`dpm.demdex.net`、`google.ca`、`a.tribalfusion.com`、`data.photorank.me`、`stats.g.doubleclick.net`、`vfcorp.dl.sc.omtrdc.net`、`ib.adnxs.com`、`idsync.rlcdn.com`、`p.brsrvr.com`,以及`adservice.google.com`。 +如我所料,网站上的追踪像素有 **很多**。比如,wrangler.com 在我的浏览器里加载了来自不同域的 19 个不同的追踪像素。wrangler.com 上的追踪像素分别来自:`ct.pinterest.com`、`af.monetate.net`、`csm.va.us.criteo.net`、`google-analytics.com`、`dpm.demdex.net`、`google.ca`、`a.tribalfusion.com`、`data.photorank.me`、`stats.g.doubleclick.net`、`vfcorp.dl.sc.omtrdc.net`、`ib.adnxs.com`、`idsync.rlcdn.com`、`p.brsrvr.com`,以及`adservice.google.com`。 Firefox 贴心地指出,如果使用 Firefox 的标准隐私设置,其中的大部分追踪器都会被拦截: @@ -86,7 +86,7 @@ Firefox 贴心地指出,如果使用 Firefox 的标准隐私设置,其中的 为了尽量避免在互联网上被追踪,我采取了几种简单的措施: - * 安装一个广告拦截器(比如 ublock origin 之类)。广告拦截器可以对许多追踪器的域进行拦截。 + * 安装一个广告拦截器(比如 ublock origin 之类)。广告拦截器可以针对许多追踪器的域进行拦截。 * 使用目前默认隐私保护强度更高的 Firefox/Safari,而不是 Chrome。 * 使用 [Facebook Container][9] 这个 Firefox 扩展。该扩展针对 Facebook 进一步采取了防止追踪的措施。 From df0e39e61fdbbb1361179f65fa58274834e64e21 Mon Sep 17 00:00:00 2001 From: chen ni Date: Wed, 25 Dec 2019 19:14:13 +0800 Subject: [PATCH 059/430] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {sources => translated}/tech/20191218 How tracking pixels work.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20191218 How tracking pixels work.md (100%) diff --git a/sources/tech/20191218 How tracking pixels work.md b/translated/tech/20191218 How tracking pixels work.md similarity index 100% rename from sources/tech/20191218 How tracking pixels work.md rename to translated/tech/20191218 How tracking pixels work.md From 0c9a9661430d5e6f7322a0177feeea39ff151ebb Mon Sep 17 00:00:00 2001 From: Hank Chow <280630620@qq.com> Date: Wed, 25 Dec 2019 21:02:12 +0800 Subject: [PATCH 060/430] hankchow translated --- ...code needs to be beautiful and explicit.md | 66 ------------------- ...code needs to be beautiful and explicit.md | 65 ++++++++++++++++++ 2 files changed, 65 insertions(+), 66 deletions(-) delete mode 100644 sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md create mode 100644 translated/tech/20191222 Why your Python code needs to be beautiful and explicit.md diff --git a/sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md b/sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md deleted file mode 100644 index 10fecd9694..0000000000 --- a/sources/tech/20191222 Why your Python code needs to be beautiful and explicit.md +++ /dev/null @@ -1,66 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (HankChow) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why your Python code needs to be beautiful and explicit) -[#]: via: (https://opensource.com/article/19/12/zen-python-beauty-clarity) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -Why your Python code needs to be beautiful and explicit -====== -Welcome to Pythonukkah, a special series about the Zen of Python. On the -first day, we celebrate the first two principles: beauty and -explicitness. -![Searching for code][1] - -Python contributor Tim Peters introduced us to the [Zen of Python][2] in 1999. Twenty years later, its 19 guiding principles continue to be relevant within the community. We start our Pythonukkah celebration—like Hanukkah, a festival of lights—with the first two principles in the Zen of Python: on beauty and explicitness. - -> "Hanukkah is the Festival of Lights, -> Instead of one day of presents, we get eight crazy nights." -> —Adam Sandler, [_The Hanukkah Song_][3] - -### Beautiful is better than ugly. - -It was in _[Structure and Interpretation of Computer Programs][4]_ (_SICP_) that the point was made: "Programs must be written for people to read and only incidentally for machines to execute." Machines do not care about beauty, but people do. - -A beautiful program is one that is enjoyable to read. This means first that it is consistent. Tools like [Black][5], [flake8][6], and [Pylint][7] are great for making sure things are reasonable on a surface layer. - -But even more important, only humans can judge what humans find beautiful. Code reviews and a collaborative approach to writing code are the only realistic way to build beautiful code. Listening to other people is an important skill in software development. - -Finally, all the tools and processes are moot if the _will_ is not there. Without an appreciation for the importance of beauty, there will never be an emphasis on writing beautiful code. - -This is why this is the first principle: it is a way of making "beauty" a value in the Python community. It immediately answers: "Do we _really_ care about beauty?" We do. - -### Explicit is better than implicit. - -We humans celebrate light and fear the dark. Light helps us make sense of vague images. In the same way, programming with more explicitness helps us make sense of abstract ideas. It is often tempting to make things implicit. - -"Why is **self** explicitly there as the first parameter of methods?" - -There are many technical explanations, but all of them are wrong. It is almost a Python programmer's rite of passage to write a metaclass that makes explicitly listing **self** unnecessary. (If you have never done this before, do so; it makes a great metaclass learning exercise!) - -The reason **self** is explicit is not because the Python core developers did not want to make a metaclass like that the "default" metaclass. The reason it is explicit is because there is one less special case to teach: the first argument is _explicit_. - -Even when Python does allow non-explicit things, such as context variables, we must always ask: Are we sure we need them? Could we not just pass arguments explicitly? Sometimes, for many reasons, this is not feasible. But prioritizing explicitness means, at the least, asking the question and estimating the effort. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/zen-python-beauty-clarity - -作者:[Moshe Zadka][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_python_programming.png?itok=ynSL8XRV (Searching for code) -[2]: https://www.python.org/dev/peps/pep-0020/ -[3]: https://en.wikipedia.org/wiki/The_Chanukah_Song -[4]: https://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Computer_Programs -[5]: https://opensource.com/article/19/5/python-black -[6]: https://opensource.com/article/19/5/python-flake8 -[7]: https://opensource.com/article/19/10/python-pylint-introduction diff --git a/translated/tech/20191222 Why your Python code needs to be beautiful and explicit.md b/translated/tech/20191222 Why your Python code needs to be beautiful and explicit.md new file mode 100644 index 0000000000..ae5568bd13 --- /dev/null +++ b/translated/tech/20191222 Why your Python code needs to be beautiful and explicit.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: (HankChow) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why your Python code needs to be beautiful and explicit) +[#]: via: (https://opensource.com/article/19/12/zen-python-beauty-clarity) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +为什么 Python 代码要写得美观而明确 +====== +欢迎阅读“Python 光明节(Pythonukkah)”系列文章,这个系列文章将会讨论《Python 之禅》。我们首先来看《Python 之禅》里的前两个原则:美观与明确。 +![Searching for code][1] + +早在 1999 年,Python 的贡献者之一,Tim Peters 就提出了《[Python 之禅][2]》,直到二十年后的今天,《Python 之禅》中的 19 条原则仍然对整个社区都产生着深远的影响。为此,我们举行了这一次的“Python 光明节”。首先,我们会讨论《Python 之禅》中的前两个原则:美观和明确。 + +> "Hanukkah is the Festival of Lights, +> Instead of one day of presents, we get eight crazy nights." +> —亚当·桑德勒, [光明节之歌][3] + +### 美观胜于丑陋 + +著名的《[计算机程序的构造和解释Structure and Interpretation of Computer Programs][4]》中有这么一句话:代码是写给人看的,只是恰好能让机器运行(Programs must be written for people to read and only incidentally for machines to execute.)。毕竟机器并不在乎代码的美观性,但人类在乎。 + +阅读美观的代码对人们来说是一种享受,这就要求在整套代码中保持一致的风格。使用诸如 [Black][5]、[flake8][6]、[Pylint][7] 这一类工具能够有效地接近这一个目标。 + +但实际上,只有人类自己才知道什么才是真正的美观。因此,代码审查和协同开发是其中的不二法门,同时,在开发过程中倾听别人的意见也是必不可少的。 + +最后,个人的主观能动性也很重要,否则一切工具和流程都会变得毫无意义。只有意识到美观的重要性,才能主动编写出美观的代码。 + +这就是为什么美观在众多原则当中排到了首位,它让“美”成为了 Python 社区的一种价值。如果有人要问,”我们真的在乎美吗?“社区会以代码给出肯定的答案。 + +### 明确胜于隐晦 + +人类会欢庆光明、惧怕黑暗,那是因为光能够让我们看到难以看清的事物。同样地,尽管有些时候我们会不自觉地把代码写得含糊不清,但明确地编写代码确实能够让我们理解很多抽象的概念。 + +“为什么类方法中要将 `self` 显式指定为第一个参数?” + +这个问题已经是老生常谈了,但网络上很多流传已久的回答都是不准确的。在编写元类metaclass时,显式指定 `self` 参数就显得毫无意义。如果你没有编写过元类,希望你可以尝试一下,这是很多 Python 程序员的必经之路。 + +显式指定 `self` 参数的原因并不是 Python 的设计者不想将这样的元类视为“默认”元类,而是因为第一个参数必须是显式的。 + +即使 Python 中确实允许非显式的情况存在(例如上下文变量),但我们还是应该提出疑问:某个东西是不是有存在的必要呢?如果非显式地传递参数会不会出现问题呢?有些时候,由于种种原因,这是会有问题的。总之,在写代码时一旦能够优先考虑到明确性,至少意味着能对不明确的地方提出疑问并对结果作出有效的估计。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-beauty-clarity + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[HankChow](https://github.com/HankChow) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_python_programming.png?itok=ynSL8XRV "Searching for code" +[2]: https://www.python.org/dev/peps/pep-0020/ +[3]: https://en.wikipedia.org/wiki/The_Chanukah_Song +[4]: https://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Computer_Programs +[5]: https://opensource.com/article/19/5/python-black +[6]: https://opensource.com/article/19/5/python-flake8 +[7]: https://opensource.com/article/19/10/python-pylint-introduction + From 7fb86b2226829deb1b8493a49a2b25a121776d02 Mon Sep 17 00:00:00 2001 From: chen ni Date: Wed, 25 Dec 2019 23:01:44 +0800 Subject: [PATCH 061/430] =?UTF-8?q?=E7=94=B3=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190724 How to make an old computer useful again.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190724 How to make an old computer useful again.md b/sources/tech/20190724 How to make an old computer useful again.md index 68748a93b6..7048848930 100644 --- a/sources/tech/20190724 How to make an old computer useful again.md +++ b/sources/tech/20190724 How to make an old computer useful again.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chen-ni) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -144,7 +144,7 @@ via: https://opensource.com/article/19/7/how-make-old-computer-useful-again 作者:[Howard Fosdick][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/chen-ni) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 997e996747bcfc77d2f98edaa6f594d9cb05bc31 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 25 Dec 2019 23:26:41 +0800 Subject: [PATCH 062/430] PRF --- ...0191023 How to program with Bash- Loops.md | 93 +++++++++---------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/translated/tech/20191023 How to program with Bash- Loops.md b/translated/tech/20191023 How to program with Bash- Loops.md index 5d051aafcd..81b8ff093a 100644 --- a/translated/tech/20191023 How to program with Bash- Loops.md +++ b/translated/tech/20191023 How to program with Bash- Loops.md @@ -7,32 +7,34 @@ [#]: via: (https://opensource.com/article/19/10/programming-bash-loops) [#]: author: (David Both https://opensource.com/users/dboth) -Bash 编程教程之循环 +怎样用 Bash 编程:循环 ====== -本文是 bash 编程系列(3 部分)的最后一篇,来学习使用循环执行迭代的操作。 + +> 本文是 Bash 编程系列三篇中的最后一篇,来学习使用循环执行迭代的操作。 + ![arrows cycle symbol for failing faster][1] -Bash 是一种强大的用于命令行和 shell 脚本里的编程语言。本系列的三部分都是基于我的 [Linux 自学课程三卷][2] 写的,探索怎么用 CLI(command-line interface)进行 bash 编程。本系列的 [第一篇文章][3] 讨论了 bash 编程的一些简单命令行操作,如使用变量和控制操作符。[第二篇文章][4] 探讨了文件、字符串、数字等类型和各种各样在执行流中提供控制逻辑的的逻辑运算符,还有 bash 中不同种类的扩展。本文是第三篇(也是最后一篇),意在考察在各种迭代的操作中使用循环以及怎么合理控制循环。 +Bash 是一种强大的用于命令行和 shell 脚本的编程语言。本系列的三部分都是基于我的三集 [Linux 自学课程][2] 写的,探索怎么用 CLI 进行 bash 编程。 + +本系列的 [第一篇文章][3] 讨论了 bash 编程的一些简单命令行操作,如使用变量和控制操作符。[第二篇文章][4] 探讨了文件、字符串、数字等类型和各种各样在执行流中提供控制逻辑的的逻辑运算符,还有 bash 中不同种类的扩展。本文是第三篇(也是最后一篇),意在考察在各种迭代的操作中使用循环以及怎么合理控制循环。 ### 循环 -我使用过的所有编程语言都有很多种循环结构来用来执行重复的操作。我经常使用 for 循环,然而我发现 while 和 until 循环也很有用处。 +我使用过的所有编程语言都至少有两种循环结构来用来执行重复的操作。我经常使用 `for` 循环,然而我发现 `while` 和 `until` 循环也很有用处。 #### for 循环 -我的理解是,**for** 命令在 bash 中的实现比大部分语言灵活,因为它可以处理非数字的值;与之形成对比的是,诸如标准 C 语言的 **for** 循环只能处理数字类型的值。 - -Bash 版的 **for** 命令基本的结构很简单: +我的理解是,在 bash 中实现的 `for` 命令比大部分语言灵活,因为它可以处理非数字的值;与之形成对比的是,诸如标准 C 语言的 `for` 循环只能处理数字类型的值。 +Bash 版的 `for` 命令基本的结构很简单: ``` -`for Var in list1 ; do list2 ; done` +for Var in list1 ; do list2 ; done ``` -解释一下:“对于 list1 中的每一个值,把 **$Var** 设置为那个值,使用该值执行 list2 中的程序语句;list1 中的值都执行完后,整个循环结束,退出循环。” list1 中的值可以是一个简单的显式字符串值,也可以是一个命令执行后的结果(译注:**\` \`** 包含的命令执行的结果,本系列第二篇文章中有描述)。我经常使用这种结构。 - -确认 **~/testdir** 仍然是当前的工作目录(PWD)。删除目录下所有东西,来看下这个显式写出值列表的 **for** 循环的简单的示例。这个列表中的值是字母值 — 但是不要忘了,在 bash 中所有的变量都是 string 或者可以被当成 string 来处理。 +解释一下:“对于 `list1` 中的每一个值,把 `$Var` 设置为那个值,使用该值执行 `list2` 中的程序语句;`list1` 中的值都执行完后,整个循环结束,退出循环。” `list1` 中的值可以是一个简单的显式字符串值,也可以是一个命令执行后的结果(`` 包含其内的命令执行的结果,本系列第二篇文章中有描述)。我经常使用这种结构。 +要测试它,确认 `~/testdir` 仍然是当前的工作目录(PWD)。删除目录下所有东西,来看下这个显式写出值列表的 `for` 循环的简单的示例。这个列表混合了字母和数字 — 但是不要忘了,在 bash 中所有的变量都是字符串或者可以被当成字符串来处理。 ``` [student@studentvm1 testdir]$ rm * @@ -49,7 +51,6 @@ d 给变量赋予更有意义的名字,变成前面版本的进阶版: - ``` [student@studentvm1 testdir]$ for Dept in "Human Resources" Sales Finance "Information Technology" Engineering Administration Research ; do echo "Department $Dept" ; done Department Human Resources @@ -63,7 +64,6 @@ Department Research 创建几个目录(创建时显示一些处理信息): - ``` [student@studentvm1 testdir]$ for Dept in "Human Resources" Sales Finance "Information Technology" Engineering Administration Research ; do echo "Working on Department $Dept" ; mkdir "$Dept"  ; done Working on Department Human Resources @@ -84,10 +84,9 @@ drwxrwxr-x 2 student student 4096 Apr  8 15:45  Research drwxrwxr-x 2 student student 4096 Apr  8 15:45  Sales ``` -在 **mkdir** 语句中 **$Dept** 变量必须用引号包裹起来;否则名字中间有空格(如 `Information Technology`)会被当做两个独立的目录处理。我一直信奉的一条实践规则:所有的文件和目录都应该为一个单词(中间没有空格)。虽然大部分现代的操作系统可以处理名字中间有空格的情况,但是系统管理员需要花费额外的精力去确保脚本和 CLI 程序能正确处理这些特例。(尽管你因为不知道将要处理什么样的文件而烦恼,但是脚本和 CLI 应该已经把这些特例考虑在内了。) - -再次删除 **~/testdir** 下的所有东西 — 再运行一次下面的命令: +在 `mkdir` 语句中 `$Dept` 变量必须用引号包裹起来;否则名字中间有空格(如 `Information Technology`)会被当做两个独立的目录处理。我一直信奉的一条实践规则:所有的文件和目录都应该为一个单词(中间没有空格)。虽然大部分现代的操作系统可以处理名字中间有空格的情况,但是系统管理员需要花费额外的精力去确保脚本和 CLI 程序能正确处理这些特例。(即使它们很烦人,也务必考虑它们,因为你永远不知道将拥有哪些文件。) +再次删除 `~/testdir` 下的所有东西 — 再运行一次下面的命令: ``` [student@studentvm1 testdir]$ rm -rf * ; ll @@ -111,10 +110,11 @@ drwxrwxr-x 2 student student 4096 Apr  8 15:52 Research drwxrwxr-x 2 student student 4096 Apr  8 15:52 Sales ``` -假设现在有个需求,需要列出一台 Linux 机器上所有的 RPM 包并对每个包附上简短的描述。我为North Carolina 州工作的时候,曾经遇到过这种需求。由于当时州代理处不允许使用开源的工具,而且我对 Linux 不够熟悉,对技术一窍不通的老板(PHB)需要我列出我计算机上安装的所有软件,这样他们就可以“查看“计算机上有没有安装异常的软件了。 +假设现在有个需求,需要列出一台 Linux 机器上所有的 RPM 包并对每个包附上简短的描述。我为北卡罗来纳州工作的时候,曾经遇到过这种需求。由于当时开源尚未得到州政府的“批准”,而且我只在台式机上使用 Linux,对技术一窍不通的老板(PHB)需要我列出我计算机上安装的所有软件,以便他们可以“批准”一个特例。 -你怎么实现它?有一种方法是,已知 **rpm –qa** 命令提供了 RPM 包的完整描述,包括 PHB 想要的东西:软件名称和概要描述。一步步执行出最后的结果。首先,列出所有的 RPM 包: +你怎么实现它?有一种方法是,已知 `rpm –qa` 命令提供了 RPM 包的完整描述,包括了白痴老板想要的东西:软件名称和概要描述。 +让我们一步步执行出最后的结果。首先,列出所有的 RPM 包: ``` [student@studentvm1 testdir]$ rpm -qa @@ -131,7 +131,7 @@ libfontenc-1.1.3-9.fc29.x86_64 <snip> ``` -用 **sort** 和 **uniq** 命令对列表进行排序和打印去重后的结果(有些已安装的 RPM 包具有相同的名字:) +用 `sort` 和 `uniq` 命令对列表进行排序和打印去重后的结果(有些已安装的 RPM 包具有相同的名字): ``` @@ -151,13 +151,11 @@ abrt-addon-vmcore-2.11.0-1.fc29.x86_64 以上命令得到了想要的 RPM 列表,因此你可以把这个列表作为一个循环的输入信息,循环最终会打印每个 RPM 包的详细信息: - ``` [student@studentvm1 testdir]$ for RPM in `rpm -qa | sort | uniq` ; do rpm -qi $RPM ; done ``` -这段代码产出了多余的信息。当循环结束后, 下一步就是提取出 PHB 需要的信息。因此,添加一个 **egrep** 命令用来搜索匹配 **^Name** 或 **^Summary** 的行。脱字符(^)表示行首,整个命令表示显示所有以 Name 或 Summary 开头的行。 - +这段代码产出了多余的信息。当循环结束后,下一步就是提取出白痴老板需要的信息。因此,添加一个 `egrep` 命令用来搜索匹配 `^Name` 或 `^Summary` 的行。脱字符(`^`)表示行首,整个命令表示显示所有以 Name 或 Summary 开头的行。 ``` [student@studentvm1 testdir]$ for RPM in `rpm -qa | sort | uniq` ; do rpm -qi $RPM ; done | egrep -i "^Name|^Summary" @@ -174,39 +172,39 @@ Summary     : Automatic bug detection and reporting tool <snip> ``` -在上面的命令中你可以试试用 **grep** 代替 **egrep** ,你会发现用 **grep** 不能得到正确的结果。你可以通过管道把命令结果用 **less** 过滤下。最终命令像这样: - +在上面的命令中你可以试试用 `grep` 代替 `egrep` ,你会发现用 `grep` 不能得到正确的结果。你也可以通过管道把命令结果用 `less` 过滤器来查看。最终命令像这样: ``` [student@studentvm1 testdir]$ for RPM in `rpm -qa | sort | uniq` ; do rpm -qi $RPM ; done | egrep -i "^Name|^Summary" > RPM-summary.txt ``` -这个命令行程序在同一行中用到了管道、重定向和 **for** 循环。它把你 CLI 程序的结果重定向到了一个文件,这个文件可以在邮件中使用或在其他地方作为输入使用。这个一次一步构建程序的过程让你能看到每步的结果,以此来确保整个程序以你期望的流程进行且输出你想要的结果。 +这个命令行程序用到了管道、重定向和 `for` 循环,这些全都在一行中。它把你的 CLI 程序的结果重定向到了一个文件,这个文件可以在邮件中使用或在其他地方作为输入使用。 -PHB 最终收到了超过 1900 个独立 RPM 包的清单,我严重怀疑根本就没人去读它。我给了他们想要的东西,没有从他们嘴里听到过任何关于 RPM 包的信息。 +这个一次一步构建程序的过程让你能看到每步的结果,以此来确保整个程序以你期望的流程进行且输出你想要的结果。 + +白痴老板最终收到了超过 1900 个不同的 RPM 包的清单,我严重怀疑根本就没人读过这个列表。我给了他们想要的东西,没有从他们嘴里听到过任何关于 RPM 包的信息。 ### 其他循环 -Bash 中还有两种其他类型的循环结构:**while** 和 **until** 结构,两者在语法和功能上都类似。这些循环结构的基础语法很简单: - +Bash 中还有两种其他类型的循环结构:`while` 和 `until` 结构,两者在语法和功能上都类似。这些循环结构的基础语法很简单: ``` while [ expression ] ; do list ; done ``` -逻辑解释:表达式(expression)结果为 true 时,执行程序语句 `list`。表达式结果为 false 时,退出循环。 - +逻辑解释:表达式(`expression`)结果为 true 时,执行程序语句 `list`。表达式结果为 false 时,退出循环。 ``` until [ expression ] ; do list ; done ``` -逻辑解释:直到表达式的结果为 true,执行程序语句 `list`。当表达式结果为 true 时,退出循环。 +逻辑解释:执行程序语句 `list`,直到表达式的结果为 true。当表达式结果为 true 时,退出循环。 #### While 循环 -**while** 循环用于当逻辑表达式结果为 true 时执行一系列程序语句。假设你的 PWD 仍是 **~/testdir** 。最简单的 **while** 循环会一直运行下去。下面格式的条件语句永远以 `true` 作为返回。你也可以用简单的 `1` 代替 `true` — 结果一样 — 但是这解释了 true 表达式的用法。 +`while` 循环用于当逻辑表达式结果为 true 时执行一系列程序语句。假设你的 PWD 仍是 `~/testdir`。 +最简单的 `while` 循环形式是这个会一直运行下去的循环。下面格式的条件语句永远以 `true` 作为返回。你也可以用简单的 `1` 代替 `true`,结果一样,但是这解释了 true 表达式的用法。 ``` [student@studentvm1 testdir]$ X=0 ; while [ true ] ; do echo $X ; X=$((X+1)) ; done | head @@ -223,10 +221,9 @@ until [ expression ] ; do list ; done [student@studentvm1 testdir]$ ``` -既然你已经学了 CLI 的各部分知识,那就让它变得更有用处。首先,为了防止变量 **$X** 在前面的程序或 CLI 命令执行后有遗留的值,设置 **$X** 的值为 0。然后,因为逻辑表达式 **[ true ]** 的结果永远是 1,即 true,在 **do** 和 **done** 中间的程序指令列表会一直执行 — 或者直到你按下 **Ctrl+C** 抑或发送一个 `signal 2` 给程序。那些程序指令是算法扩展,用来打印变量 **$X** 当前的值并加 1. - -[系统管理员的 Linux 哲学][5] 的信条之一是追求优雅,实现优雅的一种方式就是简化。你可以用操作符 **++** 来简化这个程序。在第一个例子中,变量当前的值被打印出来,然后变量的值增加了。可以在变量后加一个 **++** 来表示这个逻辑: +既然你已经学了 CLI 的各部分知识,那就让它变得更有用处。首先,为了防止变量 `$X` 在前面的程序或 CLI 命令执行后有遗留的值,设置 `$X` 的值为 0。然后,因为逻辑表达式 `[ true ]` 的结果永远是 1,即 true,在 `do` 和 `done` 中间的程序指令列表会一直执行 — 或者直到你按下 `Ctrl+C` 抑或发送一个 2 号信号给程序。那些程序指令是算数扩展,用来打印变量 `$X` 当前的值并加 1. +《[系统管理员的 Linux 哲学][5]》的信条之一是追求优雅,实现优雅的一种方式就是简化。你可以用操作符 `++` 来简化这个程序。在第一个例子中,变量当前的值被打印出来,然后变量的值增加了。可以在变量后加一个 `++` 来表示这个逻辑: ``` [student@studentvm1 ~]$ X=0 ; while [ true ] ; do echo $((X++)) ; done | head @@ -242,8 +239,9 @@ until [ expression ] ; do list ; done 9 ``` -现在删掉程序最后的 **| head** 再运行一次。在这个版本中,变量在值被打印之前就自增了。这是通过在变量之前添加 **++** 操作符实现的。你能看出区别吗? +现在删掉程序最后的 `| head` 再运行一次。 +在下面这个版本中,变量在值被打印之前就自增了。这是通过在变量之前添加 `++` 操作符实现的。你能看出区别吗? ``` [student@studentvm1 ~]$ X=0 ; while [ true ] ; do echo $((++X)) ; done | head @@ -258,8 +256,9 @@ until [ expression ] ; do list ; done 9 ``` -你已经把打印变量的值和自增简化到了一条语句。类似 **++** 操作符, 也有 **--** 操作符。你需要一个在循环到某个特定数字时终止循环的方法。把 true 表达式换成一个数字比较表达式来实现它。写一个循环到 5 终止的程序。在下面的示例代码中,你可以看到 **-le** 是 ”小于或等于“ 的数字逻辑操作符。整个语句的意思:只要 **$X** 的值小于或等于 5,循环就一直运行。当 **$X** 增加到 6时,循环终止。 +你已经把打印变量的值和自增简化到了一条语句。类似 `++` 操作符,也有 `--` 操作符。 +你需要一个在循环到某个特定数字时终止循环的方法。把 true 表达式换成一个数字比较表达式来实现它。这里有一个循环到 5 终止的程序。在下面的示例代码中,你可以看到 `-le` 是 “小于或等于” 的数字逻辑操作符。整个语句的意思:只要 `$X` 的值小于或等于 5,循环就一直运行。当 `$X` 增加到 6 时,循环终止。 ``` [student@studentvm1 ~]$ X=0 ; while [ $X -le 5 ] ; do echo $((X++)) ; done @@ -274,10 +273,7 @@ until [ expression ] ; do list ; done #### Until 循环 - - -*until** 命令非常像 **while** 命令。不同之处是,它直到逻辑表达式的值是 `true` 之前,会一直循环。看一下这种结构最简单的格式: - +`until` 命令非常像 `while` 命令。不同之处是,它直到逻辑表达式的值是 `true` 之前,会一直循环。看一下这种结构最简单的格式: ``` [student@studentvm1 ~]$ X=0 ; until false  ; do echo $((X++)) ; done | head @@ -294,8 +290,7 @@ until [ expression ] ; do list ; done [student@studentvm1 ~]$ ``` -它用一个逻辑比较表达式来数到一个特定的值: - +它用一个逻辑比较表达式来计数到一个特定的值: ``` [student@studentvm1 ~]$ X=0 ; until [ $X -eq 5 ]  ; do echo $((X++)) ; done @@ -313,9 +308,13 @@ until [ expression ] ; do list ; done [student@studentvm1 ~]$ ``` -### 总结: +### 总结 -本系列探讨了构建 bash 命令行程序和 shell 脚本的很多强大的工具。但是这仅仅是你能用 Bash 做的很多有意思的事中的冰山一角,接下来就看你的了。我发现学习 Bash 编程最好的方法就是实践。找一个需要多个 Bash 命令的简单项目然后写一个 CLI 程序。系统管理员们做了很多工作让任务变成 CLI 编程,因此我确信你很容易能找到自动化的任务。很多年前,尽管我对其他的 Shell 语言和 Perl 很熟悉,但还是决定用 Bash 做所有系统管理员的自动化任务。我发现 — 有时稍微搜索一下 — 我可以用 Bash 实现我需要的所有事情。 +本系列探讨了构建 Bash 命令行程序和 shell 脚本的很多强大的工具。但是这仅仅是你能用 Bash 做的很多有意思的事中的冰山一角,接下来就看你的了。 + +我发现学习 Bash 编程最好的方法就是实践。找一个需要多个 Bash 命令的简单项目然后写一个 CLI 程序。系统管理员们要做很多适合 CLI 编程的工作,因此我确信你很容易能找到自动化的任务。 + +很多年前,尽管我对其他的 Shell 语言和 Perl 很熟悉,但还是决定用 Bash 做所有系统管理员的自动化任务。我发现,有时稍微搜索一下,我可以用 Bash 实现我需要的所有事情。 -------------------------------------------------------------------------------- @@ -332,6 +331,6 @@ via: https://opensource.com/article/19/10/programming-bash-loops [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fail_progress_cycle_momentum_arrow.png?itok=q-ZFa_Eh (arrows cycle symbol for failing faster) [2]: http://www.both.org/?page_id=1183 -[3]: https://opensource.com/article/19/10/programming-bash-part-1 -[4]: https://opensource.com/article/19/10/programming-bash-part-2 +[3]: https://linux.cn/article-11552-1.html +[4]: https://linux.cn/article-11687-1.html [5]: https://www.apress.com/us/book/9781484237298 From 9ba6322718253b6166439152d966be21a7d31157 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 26 Dec 2019 00:52:51 +0800 Subject: [PATCH 063/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191226=20Darkta?= =?UTF-8?q?ble=203=20Released=20With=20GUI=20Rework=20and=20New=20Features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191226 Darktable 3 Released With GUI Rework and New Features.md --- ...leased With GUI Rework and New Features.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20191226 Darktable 3 Released With GUI Rework and New Features.md diff --git a/sources/tech/20191226 Darktable 3 Released With GUI Rework and New Features.md b/sources/tech/20191226 Darktable 3 Released With GUI Rework and New Features.md new file mode 100644 index 0000000000..9463a07712 --- /dev/null +++ b/sources/tech/20191226 Darktable 3 Released With GUI Rework and New Features.md @@ -0,0 +1,112 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Darktable 3 Released With GUI Rework and New Features) +[#]: via: (https://itsfoss.com/darktable-3-release/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Darktable 3 Released With GUI Rework and New Features +====== + +Here’s the Christmas gift for the photography enthusiasts. Darktable 3.0 has just released. + +[Darktable][1] is one of the [best applications for editing RAW images on Linux][2]. You can consider it as a [free and open source alternative to Adobe Lightroom][3]. + +Darktable 3 is a major new release with tons of feature improvements and a complete rework of the user interface. The GUI is now completely controlled by GTK+ CSS rules, which makes the whole GUI themable. There are eight themes available by default. + +With the help of over 3000 commits and 553 pull requests, the new release has fixed 66 bugs and added many new features. + +Let’s see what features this new release brings. + +### New features in Darktable 3.0 + +![Darktable 3.0 Screenshot][4] + +Here are the highlighted new features: + + * Reworked UI + * A new module for handling 3D RGB Lut transformations + * Many improvements to the ‘denoise (profiled)’ module + * A new ‘culling’ mode and timeline view added + * Many improvements to the ‘denoise (profiled)’ module + * New tone equalizer’ basic and filmic RGB modules + * Better 4K/5K display support + * Undo/redo support for more operations + * Many code optimizations for CPU and SSE paths + * Support for exporting to Google Photos + * More camera support, white balance presets, and noise profiles + * Plenty of bug fixes and feature improvements + + + +You can read about all the changes in the [release notes on GitHub][5]. + +### Installing Darktable 3.0 on Linux + +Let’s see how to get the latest Darktable release. + +#### Installing Darktable 3.0 on Ubuntu-based distributions + +Darktable is available in Ubuntu but you won’t get the latest release immediately. For the LTS version, it may take months before you have this version update. + +Worry not! Darktable provides its [own PPA][6] to install the latest release on Ubuntu-based distributions. + +Unfortuntaley, That Darktable PPA has not been updated with the new release. + +Worry not (again)! Thanks to our friend [Ji M of Ubuntu Handbook][7], we have an unofficial PPA for easily installing Darktable 3.0 on Ubuntu and other Ubuntu based distributions. + +Open a terminal and use these commands one by one: + +``` +sudo add-apt-repository ppa:ubuntuhandbook1/darktable +sudo apt update +sudo apt install darktable +``` + +#### Uninstall Darktable 3 + +To remove Darktable installed via this PPA, you can first uninstall the application: + +``` +sudo apt remove darktable +``` + +And then [remove the PPA][8] as well: + +``` +sudo add-apt-repository -r ppa:ubuntuhandbook1/darktable +``` + +#### Installing Darktable on other Linux distributions + +You may wait for your distribution to provide this new release through the software manager. + +You may also download the tarball or the entire source code from the GitHub release page (it’s at the bottom of the page). + +[Download Darktable 3.0][5] + +With Darktable 3, you can edit your holiday pictures better :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/darktable-3-release/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.darktable.org/ +[2]: https://itsfoss.com/raw-image-tools-linux/ +[3]: https://itsfoss.com/open-source-photoshop-alternatives/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/darktable_3_screenshot.jpg?ssl=1 +[5]: https://github.com/darktable-org/darktable/releases/tag/release-3.0.0 +[6]: https://launchpad.net/~pmjdebruijn/+archive/ubuntu/darktable-release +[7]: http://ubuntuhandbook.org/index.php/2019/12/install-darktable-3-0-0-ubuntu-18-04-19-10/ +[8]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ From 171da4ddb69c73d97d4c28c75f7a0e63b395b8f6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 26 Dec 2019 00:53:43 +0800 Subject: [PATCH 064/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191225=20How=20?= =?UTF-8?q?to=20run=20a=20business=20with=20open=20source:=20Top=20reads?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191225 How to run a business with open source- Top reads.md --- ... a business with open source- Top reads.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/tech/20191225 How to run a business with open source- Top reads.md diff --git a/sources/tech/20191225 How to run a business with open source- Top reads.md b/sources/tech/20191225 How to run a business with open source- Top reads.md new file mode 100644 index 0000000000..f857738495 --- /dev/null +++ b/sources/tech/20191225 How to run a business with open source- Top reads.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to run a business with open source: Top reads) +[#]: via: (https://opensource.com/article/19/12/business-open-source) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) + +How to run a business with open source: Top reads +====== +Open source software is open for business, as evidenced in the these top +5 articles from 2019. +![Open for business][1] + +Open source is ready to get to work, and in 2019, Opensource.com had many great articles about how organizations have adopted open source software or open methods to drive their business. As open source matures, we've seen open source not just replace proprietary software, but create entirely new business models. + +Check out this list of five outstanding articles from Opensource.com in 2019 about running a business with open source. + +### Get your business up and running with these open source tools + +In [_Get your business up and running with these open source tools_][2], I explain: "Yes, you really can operate a business using open source software." In this article, I review the key open source software tools that I use to run my company, including Inkscape, GIMP, LibreOffice, and Scribus. + +### What's your favorite open source BI software? + +As Lauren Maffeo explains in _[What's your favorite open source BI software?][3]_ "Open source business intelligence (BI) software helps users upload, visualize, and make decisions based on data that is pulled from several sources... BI involves turning data into insights that help your business make better decisions... Before choosing which open source BI tool to adopt, it's worth weighing the pros and cons of each tool against your business needs." The article's accompanying poll asks readers whether they prefer Pentaho, Logz.io, Cluvio, Qlikview, Sisense, or another BI application. Answer the poll to let us know which is your favorite and to see what other readers say. + +### Scrum vs. kanban: Which agile framework is better? + +Because scrum and kanban both fall under the agile framework umbrella, many people confuse them or think they're the same thing. There are differences, however. In [_Scrum vs. kanban: Which agile framework is better?_][4] Taz Brown explains the differences between scrum and kanban and helps you decide which one may be best for your team. + +### What is Small Scale Scrum? + +"Agile is fast becoming a mainstream way industries act, behave, and work as they look to improve efficiency, minimize costs, and empower staff. Most software developers naturally think, act, and work this way, and alignment towards agile software methodologies has gathered pace in recent years," write Agnieszka Gancarczyk and Leigh Griffin in [_What is Small Scale Scrum?_][5] In this article, they explain how the scrum agile methodology can help small teams work more efficiently. + +### What does DevOps mean to you? + +In *[What does DevOps mean to you?][6] *Girish Managoli offers one answer to this article's headline: "DevOps is a process of software development focusing on communication and collaboration to facilitate rapid application and product deployment." But there are a range of opinions and expectations around DevOps. To help explain DevOps and how to leverage it in organizations, Girish interviewed six experts to break down DevOps and the key practices and philosophies in making DevOps work for you. + +### Open source is open for business + +As open source plays an increasingly important role in business, there's more to learn about the topic. What do you want to know about it in 2020? Please share your ideas for articles in the comments—or even share your own experiences with running a business on open source software by [writing an article for Opensource.com][7]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/business-open-source + +作者:[Jim Hall][a] +选题:[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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_openseries.png?itok=rCtTDz5G (Open for business) +[2]: https://opensource.com/article/19/9/business-creators-open-source-tools +[3]: https://opensource.com/article/19/8/favorite-open-source-bi-software +[4]: https://opensource.com/article/19/8/scrum-vs-kanban +[5]: https://opensource.com/article/19/1/what-small-scale-scrum +[6]: https://opensource.com/article/19/1/what-does-devops-mean-you +[7]: https://opensource.com/how-submit-article From 88c6415afe8a0cfaa6cf99df8798af31f9e43978 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 26 Dec 2019 00:54:09 +0800 Subject: [PATCH 065/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191225=2012=20o?= =?UTF-8?q?pen=20source=20resources=20for=20kids=20and=20young=20adults?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191225 12 open source resources for kids and young adults.md --- ...rce resources for kids and young adults.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20191225 12 open source resources for kids and young adults.md diff --git a/sources/tech/20191225 12 open source resources for kids and young adults.md b/sources/tech/20191225 12 open source resources for kids and young adults.md new file mode 100644 index 0000000000..48ca3107a4 --- /dev/null +++ b/sources/tech/20191225 12 open source resources for kids and young adults.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (12 open source resources for kids and young adults) +[#]: via: (https://opensource.com/article/19/12/kids-students-education) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +12 open source resources for kids and young adults +====== +Explore new technologies with Opensource.com's top 12 articles from 2019 +about learning an open source technology. +![Person reading a book and digital copy][1] + +Are you looking to challenge your children (or even yourself) to learn new things about open source technologies? Whether you're in elementary school, high school, or college, or even a parent or teacher, Opensource.com has some great reading about open source technologies suitable for the younger generation. Here are our top 12 articles from 2019 on open source for students (and those who love them). + +### Hacking math education with Python + +As a student, I had difficulty with the abstraction of mathematics. Traditional classroom instruction didn't work for me. Peter Farrell has another approach for learners who are challenged by conventional mathematics instruction. His unique approach, which teaches math using Python, resonated with me when I interviewed him about how he is [_Hacking math education with Python_][2]. + +### 5 open source tools for teaching young children to read + +No doubt, you have seen how easy it is for children to master today's electronic devices—but what about traditional literacy? Are today's children getting the foundation in reading, writing, and arithmetic that they need to be successful? Laura Janusek's [_5 open source tools for teaching young children to read_][3] may help. She says, "Access to literary environments has been shown to impact literacy and attitudes towards reading. Why not strive to create a digital literacy environment for our kids by filling our devices with educational technologies, just like our shelves are filled with books?" + +### What programming language would you teach a kid first? + +Coding has become a hot area for schools and parents. Opinions abound on the best computer language to teach and when to begin teaching it. Lauren Pritchett celebrated Ada Lovelace Day 2019 by exploring [_What programming language would you teach kids first?_][4] Be sure to take the accompanying poll, too. + +### Getting started with the BBC Microbit + +Learning to code should be fun, and one of the ways to ensure a great early experience is by using an inexpensive open hardware board. In [_Getting started with the BBC Microbit_][5], I provide step-by-step directions and some code examples so your child can learn to program with MicroPython. + +### Introducing kids to computational thinking with Python + +Coding can be the key that lifts children out of poverty and empowers them to gain new skills, confidence, and the knowledge necessary to break free from socioeconomic disadvantages. In [_Introducing kids to computational thinking with Python_][6], I interviewed librarian Qumisha Goss, who is leveraging the power of Python to transform children's lives in Detroit. + +### A dozen ways to learn Python + +Do you know someone who really wants to learn to Python but is looking for the right hook to get started? Removing abstraction has been key to my best learning experiences, and I share some of the resources I've found in [_A dozen ways to learn Python_][7]. They will start you on your journey to Python proficiency and sustain your learning over the long haul. + +### 100 ways to learn Python and R for data science + +Many people want to learn data science but are drowning in the deluge of information available online, leaving them confused about where to find the best book, tutorial, or other learning resources. Where would you turn to learn the skills necessary to play a role in this rapidly growing field? Chris Englehardt, Dorris Scott, and Annu Singh share their suggestions in [_100 ways to learn Python and_ _R for data science_][8]. + +### How a trip to China inspired Endless OS and teaching kids to hack + +I've long been interested in inexpensive, Linux-based computers that help children around the world learn how to code. One of these is Endless' Hack, a low-cost laptop, and an accompanying series of video games designed to get kids coding and become creative problem solvers while they're having fun. In 2019, I got to interview Endless' founder Matt Dalio, where he shares [_How a trip to China inspired Endless OS and teaching kids to hack_][9]. + +### How to use the internet to learn IT skills + +Looking to do something meaningful in the new year? How about helping a few young people take their first steps in an IT career? You can follow the lead of David Clinton, a systems administrator, teacher, and writer, who shares [_How to use the internet to learn IT skills_][10]. Giving students access to open source tools and letting them explore and iterate creates a rich learning experience, he explains. + +### Digital divide? How the Asian Penguins share Linux at Minnesota charter school + +Stu Keroff is an educator who has turned his passion for Linux and open source into a school–community outreach program that serves a large number of immigrant families in Minnesota. He is a husband, father, teacher, speaker, and advocate for Linux in K-12 education and a winner of the [2016 Opensource.com Readers Choice Award][11]. In [_Digital divide? How the Asian Penguins share Linux at Minnesota charter school_][12], Stu shares his Linux-powered solution to expand digital literacy in his community. + +### 13 books for picking up new tech in 2019 + +If you (or someone you know) learn best by reading, my [_13 books for picking up new tech in 2019_][13] may help you discover a new skill that piques your curiosity. The list includes books on everything from Python to Linux to developing games on a Raspberry Pi. + +### 11 surprising ways you use Linux every day + +If you, like me, wonder what powers all the electronic gadgets that power our day-to-day lives today, read my article on [_11 surprising ways you use Linux every day_][14]. You might be amazed at how much we depend on open source to get us through our days. + +### A lifetime of learning + +What would you like to know to help the children in your life expand their tech knowledge and skills? Please share your ideas in the comments, or even consider sharing your own experiences with Opensource.com readers by [submitting an article][15] about your favorite open source education topic. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/kids-students-education + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/read_book_guide_tutorial_teacher_student_apaper.png?itok=_GOufk6N (Person reading a book and digital copy) +[2]: https://opensource.com/article/19/1/hacking-math +[3]: https://opensource.com/article/19/4/early-literacy-tools +[4]: https://opensource.com/article/19/10/first-programming-language-kids +[5]: https://opensource.com/article/19/8/getting-started-bbc-microbit +[6]: https://opensource.com/article/19/2/break-down-stereotypes-python +[7]: https://opensource.com/article/19/8/dozen-ways-learn-python +[8]: https://opensource.com/article/19/5/learn-python-r-data-science +[9]: https://opensource.com/article/19/6/endless-digital-literacy +[10]: https://opensource.com/article/19/5/it-skills-internet +[11]: https://opensource.com/community/16/2/winners-2016-community-awards +[12]: https://opensource.com/article/19/2/asian-penguins-close-digital-divide +[13]: https://opensource.com/article/19/1/tech-books-new-skils +[14]: https://opensource.com/article/19/8/everyday-tech-runs-linux +[15]: https://opensource.com/how-submit-article From 852b09ff77014a887671d07b29939148461d8d39 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 26 Dec 2019 00:54:40 +0800 Subject: [PATCH 066/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191225=20Making?= =?UTF-8?q?=20trade-offs=20when=20writing=20Python=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191225 Making trade-offs when writing Python code.md --- ...ing trade-offs when writing Python code.md | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 sources/tech/20191225 Making trade-offs when writing Python code.md diff --git a/sources/tech/20191225 Making trade-offs when writing Python code.md b/sources/tech/20191225 Making trade-offs when writing Python code.md new file mode 100644 index 0000000000..47da30cb93 --- /dev/null +++ b/sources/tech/20191225 Making trade-offs when writing Python code.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Making trade-offs when writing Python code) +[#]: via: (https://opensource.com/article/19/12/zen-python-trade-offs) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Making trade-offs when writing Python code +====== +This is part of a special series about the Zen of Python focusing on the +seventh, eighth, and ninth principles: readability, special cases, and +practicality. +![Brick wall between two people, a developer and an operations manager][1] + +Software development is a discipline rife with trade-offs. For every choice, there is an equally defensible but opposite choice. Make a method private? You're encouraging copy-paste. Make a method public? You're committing prematurely to an interface. + +Software developers make hard choices every minute. While all the principles in the [Zen of Python][2] cover trade-offs to some extent, the following principles take the hardest, coldest look at some trade-offs. + +### Readability counts. + +In some sense, this middle principle is indeed the center of the entire Zen of Python. The Zen is not about writing efficient programs. It is not even about writing robust programs, for the most part. It is about writing programs that _other people can read_. + +Reading code, by its nature, happens after the code has been added to the system. Often, it happens long after. Neglecting readability is the easiest choice since it does not hurt right now. Whatever the reason for adding new code—a painful bug or a highly requested feature—it does hurt. Right now. + +In the face of immense pressure to throw readability to the side and just "solve the problem," the Zen of Python reminds us: readability counts. Writing the code so it can be read is a form of compassion for yourself and others. + +### Special cases aren't special enough to break the rules. + +There is always an excuse. This bug is particularly painful; let's not worry about simplicity. This feature is particularly urgent; let's not worry about beauty. The domain rules covering this case are particularly hairy; let's not worry about nesting levels. + +Once we allow special pleading, the dam wall breaks, and there are no more principles; things devolve into a Mad Max dystopia with every programmer for themselves, trying to find the best excuses. + +Discipline requires commitment. It is only when things are hard, when there is a strong temptation, that a software developer is tested. There is always a valid excuse to break the rules, and that's why the rules must be kept the rules. Discipline is the art of saying no to exceptions. No amount of explanation can change that. + +### Although, practicality beats purity. + +> "If you think only of hitting, springing, striking, or touching the enemy, you will not be able actually to cut him." +> — Miyamoto Musashi, _[The Book of Water][3]_ + +Ultimately, software development is a practical discipline. Its goal is to solve real problems, faced by real people. Practicality beats purity: above all else, we must _solve the problem_. If we think only about readability, simplicity, or beauty, we will not be able to actually _solve the problem_. + +As Musashi suggested, the primary goal of every code change should be to _solve a problem_. The problem must be foremost in our minds. If we waver from it and think only of the Zen of Python, we have failed the Zen of Python. This is another one of those contradictions inherent in the Zen of Python. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-trade-offs + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/devops_confusion_wall_questions.png?itok=zLS7K2JG (Brick wall between two people, a developer and an operations manager) +[2]: https://www.python.org/dev/peps/pep-0020/ +[3]: https://en.wikipedia.org/wiki/The_Book_of_Five_Rings#The_Book_of_Water From e3de43d0ff5cd060eb3a11dd9c7525bba9d6fcef Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 26 Dec 2019 00:55:12 +0800 Subject: [PATCH 067/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191225=205=20se?= =?UTF-8?q?curity=20tips=20from=20Santa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191225 5 security tips from Santa.md --- .../20191225 5 security tips from Santa.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20191225 5 security tips from Santa.md diff --git a/sources/tech/20191225 5 security tips from Santa.md b/sources/tech/20191225 5 security tips from Santa.md new file mode 100644 index 0000000000..1c2f83c02a --- /dev/null +++ b/sources/tech/20191225 5 security tips from Santa.md @@ -0,0 +1,84 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 security tips from Santa) +[#]: via: (https://opensource.com/article/19/12/security-tips) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) + +5 security tips from Santa +====== +Stay off Santa's (and your employer's) naughty list by following this +list of useful security tips and practices. +![Security monster][1] + +If you're reading this in 2019, it's almost Christmas (as celebrated according to the Western Christian calendar), and, like all children and IT professionals, it's time to write your letter to Santa/St. Nick/Father Christmas. Don't forget: those who have been good get nice presents and those who haven't get coal. Coal is _not_ a clean-burning fuel, and with climate change well and truly upon us,[1][2] you don't want to be going for the latter option. + +Think back to all of the good security practices you've adopted over the past 11 or so months. And then think back to all of the bad security practices you've adopted when you should have been doing the _right_ thing. Oh, dear. It's not looking good for you, is it? + +Here's the good news, though: because Santa is a benevolent soul, there's time to make amends (unless you're reading this after Christmas[2][3]). Here's a list of useful security tips and practices that Santa follows and therefore are bound to put you on his "good" side. + +### 1\. Use a password manager + +Santa is very careful with his passwords. Here's a little secret: from time to time, rather than have his elves handcraft every little present, he sources his gifts from other parties. I'm not suggesting that he pays market rates (he's ordering in bulk, and he has a very, very good credit rating), but he uses lots of different suppliers, and he's aware that not all of them take security as seriously as he does. He doesn't want all his account logins to be leaked if one of his suppliers is hacked, so he uses separate passwords for each account. Now, Santa, being Santa, could remember all of these details if he wanted to—and even generate unique passwords that meet all the relevant complexity requirements for each site—but he uses an open source [password manager][4] for safety and for succession planning.[3][5] + +### 2\. Manage personal information properly + +You may work for a large company, organisation, or government, and you may think you have lots of customers and associated data, but consider Santa. He manages (or has managed) names, birth dates, addresses, hobbies, shoe sizes, colour preferences, and other personal data for literally every person on Earth. That's an awful lot of sensitive data, and it needs to be protected. When people grow too old for presents from Santa,[4][6] he needs to delete their data securely. In fact, Santa may well be the archetypal [GDPR][7] data controller, and he needs to be very careful who and what can access the data that he holds. Of course, he encrypts all the data and is very careful about key management. He's also very aware of the dangers associated with cold boot attacks (given the average temperature around his residence), so he ensures data is properly wiped before shutdown. + +### 3\. Measure and mitigate risk + +Santa knows all about [risk][8]. He has complex systems for ordering, fulfillment, travel planning, logistics, and delivery that are the envy of most of the world. He understands what impact failure in any part of the supply chain can have on his customers: mainly children and IT professionals. He quantifies risk, recalculating it on a regular basis to ensure that he is up to date with possible vulnerabilities and ready with mitigations. + +### 4\. Patch frequently but carefully + +Santa absolutely cannot afford for his systems to go down, particularly around his most busy period. He has established processes to ensure that the [concerns of security are balanced with the needs of the business][9].[5][10] He knows that sometimes business continuity must take priority, and on other occasions, the impact of a security breach would be so major that patches just _have_ to be applied. He tells people what he wants and listens to their views, taking them into account where he can. In other words, he embraces open management, delegating decisions where possible to the people who are best positioned to make the call, and only intervenes when asked for an executive decision or when exceptions arise. Santa is a _very_ enlightened manager. + +### 5\. Embrace diversity + +One of the useful consequences of running a global operation is that Santa values diversity. Old or young (at heart); male, female, or gender-neutral; neurotypical or neurodiverse; of any culture, sexuality, race, ability, creed, or nose colour, Santa takes into account his stakeholders and their views on what might go wrong. What a fantastic set of viewpoints Santa has available to him! And he's surprisingly hip to the opportunities for security practices that a wide and [diverse set of opinions and experiences][11] can bring[6][12] not to mention the multiple [positive impacts][13] on his organisation. + +### Summary + +Here's my advice: Be like Santa, and adopt at least some of his security practices. You'll have a much better opportunity of getting onto his good side, and that's going to go down well—not just with him, but also with your employer, who is just certain to give you a nice bonus, right? And if not, well, it's not too late to write that letter directly to Santa himself. + +* * * + + 1. If you have a problem with this statement, then either you need to find another article, or you're reading this in the far future where all our climate problems have been solved. I hope. + 2. Or you dwell in one of those cultures where Santa visits quite early in December. + 3. A high-flying goose in the face can do terrible damage to a fast-moving reindeer, and if the sleigh were to crash, what then...? + 4. Not me! + 5. Santa doesn't refer to it as a "business," but he's happy for us to call it that, so we can model our own experience on his. He's nice like that. + 6. Though Santa would never use the phrase "hip to the opportunities." He's way too cool for that. + + + +Download the free All Things Open interview series eBook Jessica McKellar is an entrepreneur,... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/security-tips + +作者:[Mike Bursell][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mikecamel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security_password_chaos_engineer_monster.png?itok=J31aRccu (Security monster) +[2]: tmp.PgLkHLx1Uz#1 +[3]: tmp.PgLkHLx1Uz#2 +[4]: https://opensource.com/article/18/4/3-password-managers-linux-command-line +[5]: tmp.PgLkHLx1Uz#3 +[6]: tmp.PgLkHLx1Uz#4 +[7]: https://opensource.com/article/18/1/being-open-about-data-privacy +[8]: http://aliceevebob.com/2019/03/12/dont-talk-security-talk-risk/ +[9]: http://aliceevebob.com/2017/10/17/stop-reading-start-patching/ +[10]: tmp.PgLkHLx1Uz#5 +[11]: http://aliceevebob.com/2017/08/08/diversity-in-it-security-not-just-a-canine-issue/ +[12]: tmp.PgLkHLx1Uz#6 +[13]: https://opensource.com/article/19/11/diversity-and-inclusion-strategies From 9debd9ea1465d8ecb63bb3af83fdc6646dd9ef75 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 26 Dec 2019 11:09:14 +0800 Subject: [PATCH 068/430] translated --- ...mize your Linux desktop with KDE Plasma.md | 72 ------------------- ...mize your Linux desktop with KDE Plasma.md | 70 ++++++++++++++++++ 2 files changed, 70 insertions(+), 72 deletions(-) delete mode 100644 sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md create mode 100644 translated/tech/20191221 Customize your Linux desktop with KDE Plasma.md diff --git a/sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md b/sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md deleted file mode 100644 index 0fe21db27b..0000000000 --- a/sources/tech/20191221 Customize your Linux desktop with KDE Plasma.md +++ /dev/null @@ -1,72 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Customize your Linux desktop with KDE Plasma) -[#]: via: (https://opensource.com/article/19/12/linux-kde-plasma) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Customize your Linux desktop with KDE Plasma -====== -This article is part of a special series of 24 days of Linux desktops. -If you think there's no such thing as too much opportunity to customize -your desktop, KDE Plasma may be for you. -![5 pengiuns floating on iceburg][1] - -The Plasma desktop by the KDE community is a pinnacle among open source desktops. KDE got into the Linux desktop market early, but since its foundational Qt toolkit did not have a fully open license at the time, the [GNOME][2] desktop was created. Since then, Qt has become open source, and KDE (and its derivatives, like the [Trinity desktop][3]) has thrived. - -You may find the KDE desktop in your distribution's software repository, or you can download and install a distribution that ships KDE as its default. Before you install, be aware that KDE provides a full, integrated, and robust desktop experience, so several KDE applications are installed along with it. If you're already running a different desktop, you will find yourself with redundant applications (two PDF readers, several media players, two or more file managers, and so on). If you just want to try the KDE desktop without committing to it, you can install a KDE-based distribution in a virtual machine, such as [GNOME Boxes][4], or you can try a bootable OS like [Porteus][5]. - -### KDE desktop tour - -The [KDE Plasma][6] desktop is relatively boring at first glance—but in a comforting way. It's got the industry-standard layout: pop-up application menu in the bottom-left corner, taskbar in the middle, system tray on the right. It's exactly what you'd expect from a standard household or business computer. - -![KDE Plasma desktop][7] - -What sets KDE apart, though, is that you can change nearly anything you want. The Qt toolkit can be taken apart and rearranged in some surprising ways, meaning you can essentially design your own desktop using KDE's parts as your foundation. The settings available for how your desktop behaves are vast, too. KDE can act as a standard desktop, a tiling window manager, and anything in between. You can create your own window rules by window class, role, type, title, or any combination thereof, so if you want specific applications to behave differently than everything else, you can create an exception to global settings. - -Furthermore, there's a rich collection of widgets to enable you to customize the way you interface with your desktop. There's a GNOME-like full-screen application launcher, a Unity-like dock launcher and icons-only taskbar, and a traditional taskbar. You can create and place panels on any edge of the screen you want. - -![A slightly customized KDE desktop][8] - -There's so much customization, in fact, that one of the most common critiques of KDE is that it's _too customizable_, so keep in mind that customization is optional. You can use the Plasma desktop in its default configuration, and change things gradually and only as you feel necessary. What matters most about Plasma desktop configuration options isn't their number, but that they're discoverable and intuitive, either in the System Settings application or with a right-click. - -The fact is, on KDE, there's almost never just one way to accomplish any given task, and its users see that as its greatest strength. There's no implied workflow in KDE, only a default. And all defaults can be changed, until everything you need to do with your desktop is second-nature. - -### Consistency and integration - -The KDE community prides itself on consistency and integration, made possible through great developer and community management and the KDE libraries. The developers of KDE aren't just developers of a desktop. They provide a [stunning collection of applications][9], each of them created with KDE libs that extend and standardize common Qt widgets. It's no accident that after using KDE for a few months, whether you open [DigiKam][10] for photo management or Kmail to check email or KTorrent to grab the latest ISO or Dolphin to manage files, your muscle memory takes you where you need to go in the UI before you consciously think about it. - -![KDE on Porteus][11] - -### Try KDE - -KDE has something for everyone. Use its default settings for a smooth, plain-vanilla desktop experience, or customize it to make it your own. It's a stable, attractive, and robust desktop environment that probably has everything you need for whatever you want to do on Linux. - -KDE originally stood for Kool Desktop Environment, but is now known by many as the K Desktop... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/linux-kde-plasma - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux31x_cc.png?itok=Pvim4U-B (5 pengiuns floating on iceburg) -[2]: https://opensource.com/article/19/12/gnome-linux-desktop -[3]: https://opensource.com/article/19/12/linux-trinity-desktop-environment-tde -[4]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization -[5]: https://opensource.com/article/19/6/linux-distros-to-try -[6]: https://kde.org/plasma-desktop -[7]: https://opensource.com/sites/default/files/uploads/advent-kde-presskit.jpg (KDE Plasma desktop) -[8]: https://opensource.com/sites/default/files/uploads/advent-kde-dock.jpg (A slightly customized KDE desktop) -[9]: https://kde.org/applications/ -[10]: https://opensource.com/life/16/5/how-use-digikam-photo-management -[11]: https://opensource.com/sites/default/files/uploads/advent-kde.jpg (KDE on Porteus) diff --git a/translated/tech/20191221 Customize your Linux desktop with KDE Plasma.md b/translated/tech/20191221 Customize your Linux desktop with KDE Plasma.md new file mode 100644 index 0000000000..402fcd0e3b --- /dev/null +++ b/translated/tech/20191221 Customize your Linux desktop with KDE Plasma.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Customize your Linux desktop with KDE Plasma) +[#]: via: (https://opensource.com/article/19/12/linux-kde-plasma) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +使用 KDE Plasma 定制 Linux 桌面 +====== +本文是 24 天 Linux 桌面特别系列的一部分。如果你认为没有太多机会进行自定义桌面,KDE Plasma 可能适合你。 +![5 pengiuns floating on iceburg][1] + +KDE 社区的 Plasma 桌面是开源桌面中的巅峰之作。KDE 很早就进入了 Linux 桌面市场,但是由于它的 基础 Qt 工具包当时没有完全开放的许可证,因此才有 [GNOME][2] 桌面。在此之后,Qt 开源了,并且 KDE(及其衍生产品,例如 [Trinity桌面][3])开始蓬勃发展。 + +你可能会在发行版的软件仓库中找到 KDE 桌面,或者可以下载并安装将 KDE 作为默认桌面的发行版。在安装之前,请注意,KDE 提供了完整、集成且强大的桌面体验,因此会同时安装几个 KDE 应用。如果你已经在运行其他桌面,那么将发现有几个冗余的应用(两个 PDF 阅读器、多个媒体播放器、两个或多个文件管理器,等等)。如果你只想尝试而不是一直使用 KDE 桌面,那么可以在虚拟机,如[GNOME Boxes][4]中安装基于 KDE 的发行版,也可以尝试使用可引导的操作系统,例如 [Porteus][5]。 + +### KDE 桌面之旅 + +乍一看,[KDE Plasma][6] 桌面相对无聊,但让人感到舒适。它有行业标准的布局:左下角弹出应用菜单,中间是任务栏,右边是系统托盘。这正是你对标准家用或商用计算机的期望。 + +![KDE Plasma desktop][7] + +但是,使 KDE 与众不同的是,你几乎可以更改任何想要的东西。Qt 工具包可以以令人惊讶的方式分割和重新排列,这意味着你实质上可以使用 KDE 的部件作为基础来设计自己的桌面。桌面行为的可用设置也很多。KDE 可以充当标准桌面,平铺窗口管理器以及两者之间的任意形式。你可以通过窗口类、角色、类型、标题或它们的任意组合来创建自己的窗口规则,因此,如果希望特定应用的行为不同于其他行为,那么可以创建全局设置的例外。 + +此外,它还有丰富的小部件集合,使你可以自定义与桌面交互的方式。它有一个类似 GNOME 的全屏应用启动器,一个类似 Unity 的 dock 启动器和仅有图标的任务栏,一个传统的任务栏。你可以在屏幕的任何边缘上创建和放置面板。 + +![A slightly customized KDE desktop][8] + +实际上,它有太多的自定义项了,因此 KDE 最常见的批评之一是它的_太过可定制化_,所以请记住,自定义项是可选的。你可以在默认配置下使用 Plasma 桌面,并仅在你认为必要时逐步进行更改。Plasma 桌面配置选项最重要的不是它们的数目,而是它们容易发现和直观,它们都在系统设置应用或者右键单击中。 + +事实是,在 KDE 上,几乎绝不会只有一种方法可以完成任何给定的任务,并且它的用户将其视为其最大的优势。KDE 中没有隐含的工作流,只有默认的。并且可以更改所有默认设置,直到你需要桌面做的成为你的习惯。 + +### 一致性和集成 + +KDE 社区以一致性和集成为荣,出色的开发人员、社区管理以及 KDE 库使其成为可能。KDE 的开发人员不只是桌面开发人员。它们提供了[惊人的应用集合][9],每个应用都使用 KDE 库创建,这些库扩展并标准化了常见的 Qt 小部件。使用 KDE 几个月后,无论是打开 [DigiKam][10] 进行照片管理,还是打开 Kmail 来检查电子邮件,还是打开 KTorrent 来获取最新的 ISO 或者使用 Dolphin 管理文件,你的肌肉记忆会在你思考之前直接带你进入对应 UI。 + +![KDE on Porteus][11] + +### 尝试 KDE + +KDE 适合所有人。使用其默认设置可获得流畅、原始的桌面体验,或对其进行自定义以使其成为自己专属。它是一个稳定、有吸引力且强大的桌面环境,可能有你想要在 Linux 完成要做的事的一切。 + +KDE 最初代表 Kool Desktop Environment,但现在被许多人称为 K Desktop。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/linux-kde-plasma + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux31x_cc.png?itok=Pvim4U-B (5 pengiuns floating on iceburg) +[2]: https://opensource.com/article/19/12/gnome-linux-desktop +[3]: https://opensource.com/article/19/12/linux-trinity-desktop-environment-tde +[4]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization +[5]: https://opensource.com/article/19/6/linux-distros-to-try +[6]: https://kde.org/plasma-desktop +[7]: https://opensource.com/sites/default/files/uploads/advent-kde-presskit.jpg (KDE Plasma desktop) +[8]: https://opensource.com/sites/default/files/uploads/advent-kde-dock.jpg (A slightly customized KDE desktop) +[9]: https://kde.org/applications/ +[10]: https://opensource.com/life/16/5/how-use-digikam-photo-management +[11]: https://opensource.com/sites/default/files/uploads/advent-kde.jpg (KDE on Porteus) \ No newline at end of file From 791cc851d7735fb0d03e18e760ebab4d345c4ae2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 26 Dec 2019 11:16:18 +0800 Subject: [PATCH 069/430] PUB @lxbwolf https://linux.cn/article-11714-1.html --- .../20191023 How to program with Bash- Loops.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20191023 How to program with Bash- Loops.md (98%) diff --git a/translated/tech/20191023 How to program with Bash- Loops.md b/published/20191023 How to program with Bash- Loops.md similarity index 98% rename from translated/tech/20191023 How to program with Bash- Loops.md rename to published/20191023 How to program with Bash- Loops.md index 81b8ff093a..6a4d3ae653 100644 --- a/translated/tech/20191023 How to program with Bash- Loops.md +++ b/published/20191023 How to program with Bash- Loops.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11714-1.html) [#]: subject: (How to program with Bash: Loops) [#]: via: (https://opensource.com/article/19/10/programming-bash-loops) [#]: author: (David Both https://opensource.com/users/dboth) @@ -12,7 +12,7 @@ > 本文是 Bash 编程系列三篇中的最后一篇,来学习使用循环执行迭代的操作。 -![arrows cycle symbol for failing faster][1] +![](https://img.linux.net.cn/data/attachment/album/201912/26/111437f9pa3zqqwcc9wwg1.jpg) Bash 是一种强大的用于命令行和 shell 脚本的编程语言。本系列的三部分都是基于我的三集 [Linux 自学课程][2] 写的,探索怎么用 CLI 进行 bash 编程。 From b90b51dd6542f96656efe07ddc4ecb5fa7ad372e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 26 Dec 2019 11:39:34 +0800 Subject: [PATCH 070/430] PRF @geekpi --- ...virtual machines with Cockpit in Fedora.md | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/translated/tech/20191127 Create virtual machines with Cockpit in Fedora.md b/translated/tech/20191127 Create virtual machines with Cockpit in Fedora.md index ed0fd20db9..cf25b2d5b0 100644 --- a/translated/tech/20191127 Create virtual machines with Cockpit in Fedora.md +++ b/translated/tech/20191127 Create virtual machines with Cockpit in Fedora.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Create virtual machines with Cockpit in Fedora) @@ -12,19 +12,19 @@ ![][1] -本文向你展示如何在 Fedora 31 上使用安装 Cockpit 所需软件来创建和管理虚拟机。Cockpit 是一个[交互式管理界面][2],可让你在任何受支持的 Web 浏览器上访问和管理系统。随着 [virt-manager 正逐渐废弃][3],用户被鼓励使用 Cockpit 来替换它。 +本文向你展示如何在 Fedora 31 上使用安装 Cockpit 所需软件来创建和管理虚拟机。Cockpit 是一个[交互式管理界面][2],可让你在任何受支持的 Web 浏览器上访问和管理系统。随着 [virt-manager 逐渐被废弃][3],鼓励用户使用 Cockpit 来替换它。 -Cockpit 是一个积极开发的项目,它有许多扩展其工作的插件。例如,其中一个是 “Machines”,它与 libvirtd 交互并允许用户创建和管理虚拟机。 +Cockpit 是一个正在活跃开发的项目,它有许多扩展其工作的插件。例如,其中一个是 “Machines”,它与 libvirtd 交互并允许用户创建和管理虚拟机。 ### 安装软件 -先决所需软件是 _libvirt _、_ cockpit_ 和 _cockpit-machines_。要将它们安装在 Fedora 31 上,请在终端[使用 sudo][4] 运行以下命令: +先决所需软件是 `libvirt`、`cockpit` 和 `cockpit-machines`。要将它们安装在 Fedora 31 上,请在终端[使用 sudo][4] 运行以下命令: ``` $ sudo dnf install libvirt cockpit cockpit-machines ``` -Cockpit 也在 “Headless Management” 软件包组中。该组对于仅通过网络访问的基于 Fedora 的服务器很有用。在这里,请使用以下命令进行安装: +Cockpit 也在 “Headless Management” 软件包组中。该软件组对于仅通过网络访问的基于 Fedora 的服务器很有用。在这里,请使用以下命令进行安装: ``` $ sudo dnf groupinstall "Headless Management" @@ -32,7 +32,7 @@ $ sudo dnf groupinstall "Headless Management" ### 设置 Cockpit 服务 -安装了必要的软件包后,就该启用服务了。 _libvirtd_ 服务运行虚拟机,而 Cockpit 有一个激活的套接字服务,可让你访问 Web GUI: +安装了必要的软件包后,就该启用服务了。`libvirtd` 服务运行虚拟机,而 Cockpit 有一个激活的套接字服务,可让你访问 Web GUI: ``` $ sudo systemctl enable libvirtd --now @@ -59,35 +59,31 @@ $ sudo systemctl status cockpit.socket 使用系统的用户名和密码登录界面。你还可以选择是否允许在此会话中将密码用于管理任务。 -选择 _Virtual Machines_,然后选择_ Create VM_ 来创建一台新的虚拟机。控制台为你提供几个选项: +选择 “Virtual Machines”,然后选择 “Create VM” 来创建一台新的虚拟机。控制台为你提供几个选项: * 使用 Cockpit 的内置库下载操作系统 * 使用系统上已下载的安装媒体 * 指向系统安装树的 URL * 通过 [PXE][5] 协议通过网络引导媒体 - - -输入所有必要的参数。然后选择 _Create_ 启动新虚拟机。 +输入所有必要的参数。然后选择 “Create” 启动新虚拟机。 此时,将出现一个图形控制台。大多数现代 Web 浏览器都允许你使用键盘和鼠标与 VM 控制台进行交互。现在,你可以完成安装并使用新的 VM,就像[过去通过 virt-manager][6] 一样。 -* * * - -_照片由 [Miguel Teixeira][7] 发布于 [Flickr][8](CC BY-SA 2.0)_ +*照片由 [Miguel Teixeira][7] 发布于 [Flickr][8](CC BY-SA 2.0)* -------------------------------------------------------------------------------- via: https://fedoramagazine.org/create-virtual-machines-with-cockpit-in-fedora/ -作者:[Karlis KavacisPaul W. Frields][a] +作者:[Karlis Kavacis][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]: https://fedoramagazine.org/author/karlisk/https://fedoramagazine.org/author/pfrields/ +[a]: https://fedoramagazine.org/author/karlisk/ [b]: https://github.com/lujun9972 [1]: https://fedoramagazine.org/wp-content/uploads/2019/11/create-vm-cockpit-816x345.jpg [2]: https://cockpit-project.org/ From 3c9430e10da5a196abe5ef68e0b91e60836b5d16 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 26 Dec 2019 11:40:00 +0800 Subject: [PATCH 071/430] PUB @geekpi https://linux.cn/article-11716-1.html --- ...20191127 Create virtual machines with Cockpit in Fedora.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191127 Create virtual machines with Cockpit in Fedora.md (98%) diff --git a/translated/tech/20191127 Create virtual machines with Cockpit in Fedora.md b/published/20191127 Create virtual machines with Cockpit in Fedora.md similarity index 98% rename from translated/tech/20191127 Create virtual machines with Cockpit in Fedora.md rename to published/20191127 Create virtual machines with Cockpit in Fedora.md index cf25b2d5b0..c4de8df42f 100644 --- a/translated/tech/20191127 Create virtual machines with Cockpit in Fedora.md +++ b/published/20191127 Create virtual machines with Cockpit in Fedora.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11716-1.html) [#]: subject: (Create virtual machines with Cockpit in Fedora) [#]: via: (https://fedoramagazine.org/create-virtual-machines-with-cockpit-in-fedora/) [#]: author: (Karlis KavacisPaul W. Frields https://fedoramagazine.org/author/karlisk/https://fedoramagazine.org/author/pfrields/) From 8cde5f2ad52a0374be325758e01749b61c478af5 Mon Sep 17 00:00:00 2001 From: chenmu-kk <53132802+chenmu-kk@users.noreply.github.com> Date: Thu, 26 Dec 2019 19:29:35 +0800 Subject: [PATCH 072/430] Update 20180503 How the four components of a distributed tracing system work together.md --- ...r components of a distributed tracing system work together.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180503 How the four components of a distributed tracing system work together.md b/sources/tech/20180503 How the four components of a distributed tracing system work together.md index 56239fc872..68ba97e989 100644 --- a/sources/tech/20180503 How the four components of a distributed tracing system work together.md +++ b/sources/tech/20180503 How the four components of a distributed tracing system work together.md @@ -1,3 +1,4 @@ +chenmu-kk is translating. How the four components of a distributed tracing system work together ====== ![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/touch-tracing.jpg?itok=rOmsY-nU) From 606061bb51e7f3f6259cd766ddc2754acfe7956a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 26 Dec 2019 21:49:42 +0800 Subject: [PATCH 073/430] Rename sources/tech/20191226 Darktable 3 Released With GUI Rework and New Features.md to sources/news/20191226 Darktable 3 Released With GUI Rework and New Features.md --- ...91226 Darktable 3 Released With GUI Rework and New Features.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20191226 Darktable 3 Released With GUI Rework and New Features.md (100%) diff --git a/sources/tech/20191226 Darktable 3 Released With GUI Rework and New Features.md b/sources/news/20191226 Darktable 3 Released With GUI Rework and New Features.md similarity index 100% rename from sources/tech/20191226 Darktable 3 Released With GUI Rework and New Features.md rename to sources/news/20191226 Darktable 3 Released With GUI Rework and New Features.md From fc32328cb1559eb96804bf76045a34071b1e6902 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 26 Dec 2019 21:51:01 +0800 Subject: [PATCH 074/430] Rename sources/tech/20191225 How to run a business with open source- Top reads.md to sources/talk/20191225 How to run a business with open source- Top reads.md --- .../20191225 How to run a business with open source- Top reads.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20191225 How to run a business with open source- Top reads.md (100%) diff --git a/sources/tech/20191225 How to run a business with open source- Top reads.md b/sources/talk/20191225 How to run a business with open source- Top reads.md similarity index 100% rename from sources/tech/20191225 How to run a business with open source- Top reads.md rename to sources/talk/20191225 How to run a business with open source- Top reads.md From 9efb96ed7a394fc3614ca0c29e89d47217d4ce56 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 26 Dec 2019 23:58:15 +0800 Subject: [PATCH 075/430] PRF @runningwater --- ...20191007 Using the Java Persistence API.md | 359 +++++++++--------- 1 file changed, 176 insertions(+), 183 deletions(-) diff --git a/translated/tech/20191007 Using the Java Persistence API.md b/translated/tech/20191007 Using the Java Persistence API.md index 6c44f50290..056d138caf 100644 --- a/translated/tech/20191007 Using the Java Persistence API.md +++ b/translated/tech/20191007 Using the Java Persistence API.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (runningwater) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using the Java Persistence API) @@ -9,244 +9,237 @@ 使用 Java 持久化 API ====== -我们通过为自行车商店构建示例应用程序来学习如何使用 JPA。 + +> 我们通过为自行车商店构建示例应用程序来学习如何使用 JPA。 + ![Coffee beans][1] -对应用开发者来说,Java 持久化 API (JPA)是一项重要的技能,需要透彻理解。它为 Java 开发人员定义了如何将对象的方法调用转换为访问、持久化及管理 NoSQL 和关系型数据库数据存储的问题的方案。 +对应用开发者来说,Java 持久化 APIJava Persistence API(JPA)是一项重要的 java 功能,需要透彻理解。它为 Java 开发人员定义了如何将对象的方法调用转换为访问、持久化及管理存储在 NoSQL 和关系型数据库中的数据的方案。 -本文通过构建自行车借贷服务的教程示例来详细研究 JPA。此示例会使用 Spring Boot 框架、MongoDB 数据库([已经不开源][2])和 Maven 包管理来构建一个大型应用程序,并且创建一个创建、读取、更新和删除(CRUD) 层。这儿我选择 NetBeans 11 作为我的 IDE。 +本文通过构建自行车借贷服务的教程示例来详细研究 JPA。此示例会使用 Spring Boot 框架、MongoDB 数据库([已经不开源][2])和 Maven 包管理来构建一个大型应用程序,并且构建一个创建、读取、更新和删除(CRUD)层。这儿我选择 NetBeans 11 作为我的 IDE。 -此教程仅从开源的角度来介绍 Java 持久化的工作原理,不涉及其作为工具的使用说明。这全是关于编写应用程序模式的学习,但对于理解具体的软件实现也很益处。可以从我的[ GitHub 源仓库][3] 来获取相关代码。 +此教程仅从开源的角度来介绍 Java 持久化 API 的工作原理,不涉及其作为工具的使用说明。这全是关于编写应用程序模式的学习,但对于理解具体的软件实现也很益处。可以从我的 [GitHub 仓库][3]来获取相关代码。 -### Java: 不仅仅是 'beans' +### Java: 不仅仅是“豆子” -Java 是一门面向对象的编程语言,自 1996 年发布第一版 Java 开发工具(JDK)起,已经变化了很多很多。要了解其特性和其虚拟机本身就是个很长的历史。简而言之,和 Linux 内核很相似,自发布以来,该语言已经向多个方向分支发展。有对社区免费的标准版本、有针对企业的企业版本及由多家供应商提供的开源替代品。主要版本每六个月发布一次,其功能往往差异很大,所以确认选用版本前得先做些研究。 +Java 是一门面向对象的编程语言,自 1996 年发布第一版 Java 开发工具(JDK)起,已经变化了很多很多。要了解其各种发展及其虚拟机本身就是一堂历史课。简而言之,和 Linux 内核很相似,自发布以来,该语言已经向多个方向分支发展。有对社区免费的标准版本、有针对企业的企业版本及由多家供应商提供的开源替代品。主要版本每六个月发布一次,其功能往往差异很大,所以确认选用版本前得先做些研究。 -总而言之,Java 的历史很悠久。本教程重点介绍 Java 11 的开源实现 [JDK 11][4]。因其是扔然有效的长期支持版本之一。 +总而言之,Java 的历史很悠久。本教程重点介绍 Java 11 的开源实现 [JDK 11][4]。因其是仍然有效的长期支持版本之一。 - * **Spring Boot: ** Spring Boot 是由 Pivotal 公司开发大型 Spring 框架的一个模块。Spring 是 Java 开发中一个非常流行的框架。它支持各种框架和配置,也支持 WEB 应用程序及提供了应用安全保障功能。Spring Boot 为快速启动项目集成了基本的配置。本教程使用 Spring Boot 来快速编写控制台应用程序并针对数据库编写测试用例。 - * **Maven:** Maven 是由 Apache 开发的项目/包管理工具。Maven 通过 `POM.xml` 文件来管理包及其依赖项。如果你们使用过 NPM 的话,可能会非常熟悉包管理器的功能。此外 Maven 也用来进行项目构建及生成功能报告。 - * **Lombok:** Lombok 是一个库,它通过在对象文件里面添加注解来自动创建 getters/setters 方法。像 C# 这些语言已经实现了此功能,Lombok 只是把此功能引入 Java 语言而已。 - * **NetBeans: ** NetBeans 是一款很流行的开源 IDE,专门用于 Java 开发。它的许多工具都随着 Java SE 和 EE 的版本更新而更新。 + * **Spring Boot** 是由 Pivotal 公司开发的大型 Spring 框架的一个模块。Spring 是 Java 开发中一个非常流行的框架。它支持各种框架和配置,也为 WEB 应用程序及安全提供了保障。Spring Boot 为快速构建各种类型的 Java 项目提供了基本的配置。本教程使用 Spring Boot 来快速编写控制台应用程序并针对数据库编写测试用例。 + * **Maven** 是由 Apache 开发的项目/包管理工具。Maven 通过 `POM.xml` 文件来管理包及其依赖项。如果你使用过 NPM 的话,可能会非常熟悉包管理器的功能。此外 Maven 也用来进行项目构建及生成功能报告。 + * **Lombok** 是一个库,它通过在对象文件里面添加注解来自动创建 getters/setters 方法。像 C# 这些语言已经实现了此功能,Lombok 只是把此功能引入 Java 语言而已。 + * **NetBeans** 是一款很流行的开源 IDE,专门用于 Java 开发。它的许多工具都随着 Java SE 和 EE 的版本更新而更新。 - - -我们会这组工具来创建一个简单的虚构自行车商店应用程序。会实现对 "Customer" 和 "Bike" 对象集合的的插入操作。 +我们会用这组工具为一个虚构自行车商店创建一个简单的应用程序。会实现对 `Customer` 和 `Bike` 对象集合的的插入操作。 ### 酿造完美 导航到 [Spring Initializr][5] 页面。该网站可以生成基于 Spring Boot 和其依赖项的基本项目。选择以下选项: - 1. **项目:** Maven 工程 - 2. **语言:** Java - 3. **Spring Boot:** 2.1.8 (或最稳定版本) - 4. **项目元数据:** 无论你使用什么名字,其命名约定都是像 **com.stephb** 这样的。 + 1. **项目:** Maven 工程 + 2. **语言:** Java + 3. **Spring Boot:** 2.1.8(或最稳定版本) + 4. **项目元数据:** 无论你使用什么名字,其命名约定都是像 `com.stephb` 这样的。 * 你可以保留 Artifact 名字为 “Demo”。 - 5. **依赖项:** 添加: + 5. **依赖项:** 添加: * Spring Data MongoDB * Lombok - - 点击 **下载**,然后用你的 IDE(例如 NetBeans) 打开此新项目。 -#### 模型层(Model)概要 - -项目里面,模型代表从数据库里取出的信息的具体对象。我们关注两个对象:**Customer** 和 **Bike**。首先,在 **src** 目录创建 **dto** 目录;然后,创建两个名为 **Customer.java** 和 **Bike.java** 的 Java 类对象文件。其结构如下示: - -**Customer.Java** - - -``` - 1 package com.stephb.JavaMongo.dto; - 2  - 3 import lombok.Getter; - 4 import lombok.Setter; - 5 import org.springframework.data.annotation.Id; - 6  - 7 /** - 8  * - 9  * @author stephon -10  */ -11 @Getter @Setter -12 public class Customer { -13  -14         private @Id String id; -15         private String emailAddress; -16         private String firstName; -17         private String lastName; -18         private String address; -19          -20 } -``` - -**Bike.java** +#### 模型层概要 +在项目里面,模型model代表从数据库里取出的信息的具体对象。我们关注两个对象:`Customer` 和 `Bike`。首先,在 `src` 目录创建 `dto` 目录;然后,创建两个名为 `Customer.java` 和 `Bike.java` 的 Java 类对象文件。其结构如下示: ```Java - 1 package com.stephb.JavaMongo.dto; - 2  - 3 import lombok.Getter; - 4 import lombok.Setter; - 5 import org.springframework.data.annotation.Id; - 6  - 7 /** - 8  * - 9  * @author stephon -10  */ -11 @Getter @Setter -12 public class Bike { -13         private @Id String id; -14         private String modelNumber; -15         private String color; -16         private String description; -17  -18         @Override -19         public String toString() { -20                 return "This bike model is " + this.modelNumber + " is the color " + this.color + " and is " + description; -21         } -22 } +package com.stephb.JavaMongo.dto; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.data.annotation.Id; + +/** + * + * @author stephon + */ +@Getter @Setter +public class Customer { + + private @Id String id; + private String emailAddress; + private String firstName; + private String lastName; + private String address; + +} ``` -如你所见,对象中使用 Lombok 注解来为定义的属性(特性)生成 getters/setters 方法。如果你不想对所有属于都生成 getters/setters 方法,可以在属性上定义这些注解。这两个类会变成容器,里面携带有数据,无论在何处想显示信息都可以使用。 +*Customer.Java* + +```Java +package com.stephb.JavaMongo.dto; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.data.annotation.Id; + +/** + * + * @author stephon + */ +@Getter @Setter +public class Bike { + private @Id String id; + private String modelNumber; + private String color; + private String description; + + @Override + public String toString() { + return "This bike model is " + this.modelNumber + " is the color " + this.color + " and is " + description; + } +} +``` + +*Bike.java* + +如你所见,对象中使用 Lombok 注解来为定义的属性properties/特性attributes生成 getters/setters 方法。如果你不想对该类的所有特性都生成 getters/setters 方法,可以在属性上专门定义这些注解。这两个类会变成容器,里面携带有数据,无论在何处想显示信息都可以使用。 #### 配置数据库 -我使用 [Mongo Docker][7] 容器来进行此次测试。如果你的系统上已经安装了 MongoDB,则不必运行 Docker 实例。你也可以登陆其官网,然后按照安装说明,选择系统信息来安装 MongoDB。 - -安装后,就可以使用命令行、GUI(例如 MongoDB Compass)或用于连接数据源的 IDE 驱动程序来与新的 MongoDB 服务进行交互。到目前为止,可以开始定义数据层了,用来拉取、转换和持久化数据。需要设置数据库访问属性,请导航到程序中的 **applications.properties** 文件,然后添加如下内容: +我使用 [Mongo Docker][7] 容器来进行此次测试。如果你的系统上已经安装了 MongoDB,则不必运行 Docker 实例。你也可以登录其官网,选择系统信息,然后按照安装说明来安装 MongoDB。 +安装后,就可以使用命令行、GUI(例如 MongoDB Compass)或用于连接数据源的 IDE 驱动程序来与新的 MongoDB 服务器进行交互。到目前为止,可以开始定义数据层了,用来拉取、转换和持久化数据。需要设置数据库访问属性,请导航到程序中的 `applications.properties` 文件,然后添加如下内容: ``` - 1 spring.data.mongodb.host=localhost - 2 spring.data.mongodb.port=27017 - 3 spring.data.mongodb.database=BikeStore +spring.data.mongodb.host=localhost +spring.data.mongodb.port=27017 +spring.data.mongodb.database=BikeStore ``` -#### 定义数据访问对象(数据)层 +#### 定义数据访问对象/数据访问层 -数据访问层(DAL)中的数据访问对象(DAO)定义了与数据库中的数据的交互过程。令人惊叹的就是在使用 **spring-boot-starter** 后,查询数据库的大部分工作已经完成。 - -让我们从 **Customer** DAO 开始。在 **src** 下的新目录 **dao** 中创建一个接口文件,然后再创建一个名为 **CustomerRepository.java** 的 Java 类文件,其内容如下示: +数据访问层data access layer(DAL)中的数据访问对象data access objects(DAO)定义了与数据库中的数据的交互过程。令人惊叹的就是在使用 `spring-boot-starter` 后,查询数据库的大部分工作已经完成。 +让我们从 `Customer` DAO 开始。在 `src` 下的新目录 `dao` 中创建一个接口文件,然后再创建一个名为 `CustomerRepository.java` 的 Java 类文件,其内容如下示: ``` - 1 package com.stephb.JavaMongo.dao; - 2  - 3 import com.stephb.JavaMongo.dto.Customer; - 4 import java.util.List; - 5 import org.springframework.data.mongodb.repository.MongoRepository; - 6  - 7 /** - 8  * - 9  * @author stephon -10  */ -11 public interface CustomerRepository extends MongoRepository{ -12         @Override -13         public ListStringCustomer> findAll(); -14         public List findByFirstName(String firstName); -15         public List findByLastName(String lastName); -16 } +package com.stephb.JavaMongo.dao; + +import com.stephb.JavaMongo.dto.Customer; +import java.util.List; +import org.springframework.data.mongodb.repository.MongoRepository; + +/** + * + * @author stephon + */ +public interface CustomerRepository extends MongoRepository{ + @Override + public List findAll(); + public List findByFirstName(String firstName); + public List findByLastName(String lastName); +} ``` -这个类是一个接口,扩展或继承于 **MongoRepository** 类,而 MongoRepository 类依赖于 DTO (**Customer.java**)和一个字符串,它们用来实现自定义函数查询功能。因为您已继承自此类,所以您可以访问许多方法函数,这些函数允许持久化和查询对象,而无需实现或引用自己定义的方法函数。例如,在实例化 **CustomerRepository** 对象后,你就可以直接使用 **Save** 功能。如果你需要扩展更多的功能,也可以重写这些方法。我创建了一些自定义查询来搜索我的集合,这些集合对象是我自定义的元素。 +这个类是一个接口,扩展或继承于 `MongoRepository` 类,而 `MongoRepository` 类依赖于 DTO (`Customer.java`)和一个字符串,它们用来实现自定义函数查询功能。因为你已继承自此类,所以你可以访问许多方法函数,这些函数允许持久化和查询对象,而无需实现或引用自己定义的方法函数。例如,在实例化 `CustomerRepository` 对象后,你就可以直接使用 `Save` 函数。如果你需要扩展更多的功能,也可以重写这些函数。我创建了一些自定义查询来搜索我的集合,这些集合对象是我自定义的元素。 -**Bike** 对象也有一个存储源负责与数据库交互。与 **CustomerRepository** 的实现非常类似。其实现如下所示: +`Bike` 对象也有一个存储源负责与数据库交互。与 `CustomerRepository` 的实现非常类似。其实现如下所示: ``` - 1 package com.stephb.JavaMongo.dao; - 2  - 3 import com.stephb.JavaMongo.dto.Bike; - 4 import java.util.List; - 5 import org.springframework.data.mongodb.repository.MongoRepository; - 6  - 7 /** - 8  * - 9  * @author stephon -10  */ -11 public interface BikeRepository extends MongoRepository{ -12         public Bike findByModelNumber(String modelNumber); -13         @Override -14         public List findAll(); -15         public List findByColor(String color); -16 } +package com.stephb.JavaMongo.dao; + +import com.stephb.JavaMongo.dto.Bike; +import java.util.List; +import org.springframework.data.mongodb.repository.MongoRepository; + +/** + * + * @author stephon + */ +public interface BikeRepository extends MongoRepository{ + public Bike findByModelNumber(String modelNumber); + @Override + public List findAll(); + public List findByColor(String color); +} ``` #### 运行程序 现在,你已经有了一种结构化数据的方式,可以对数据进行提取、转换和持久化,然后运行这个程序。 -找到 **Application.java** 文件(有可能不是此名称,具体取决于你的应用程序名称,但都会包含有 “application” )。在定义此类的地方,在后面加上 **CommandLineRunner 的实现**。这将允许你实现 **run** 方法来创建命令行应用程序。重写 **CommandLineRunner** 接口提供的 **run** 方法,并包含如下内容用来测试 **BikeRepository** : - +找到 `Application.java` 文件(有可能不是此名称,具体取决于你的应用程序名称,但都会包含有 “application” )。在定义此类的地方,在后面加上 `implements CommandLineRunner`。这将允许你实现 `run` 方法来创建命令行应用程序。重写 `CommandLineRunner` 接口提供的 `run` 方法,并包含如下内容用来测试 `BikeRepository` : ``` - 1 package com.stephb.JavaMongo; - 2  - 3 import com.stephb.JavaMongo.dao.BikeRepository; - 4 import com.stephb.JavaMongo.dao.CustomerRepository; - 5 import com.stephb.JavaMongo.dto.Bike; - 6 import java.util.Scanner; - 7 import org.springframework.beans.factory.annotation.Autowired; - 8 import org.springframework.boot.CommandLineRunner; - 9 import org.springframework.boot.SpringApplication; -10 import org.springframework.boot.autoconfigure.SpringBootApplication; -11  -12  -13 @SpringBootApplication -14 public class JavaMongoApplication implements CommandLineRunner { -15                 @Autowired -16                 private BikeRepository bikeRepo; -17                 private CustomerRepository custRepo; -18                  -19     public static void main(String[] args) { -20                         SpringApplication.run(JavaMongoApplication.class, args); -21     } -22         @Override -23         public void run(String... args) throws [Exception] { -24                 Scanner scan = new Scanner(System.in); -25                 String response = ""; -26                 boolean running = true; -27                 while(running){ -28                         System.out.println("What would you like to create? \n C: The Customer \n B: Bike? \n X:Close"); -29                         response = scan.nextLine(); -30                         if ("B".equals(response.toUpperCase())) { -31                                 String[] bikeInformation = new String; -32                                 System.out.println("Enter the information for the Bike"); -33                                 System.out.println("Model Number"); -34                                 bikeInformation[0] = scan.nextLine(); -35                                 System.out.println("Color"); -36                                 bikeInformation[1] = scan.nextLine(); -37                                 System.out.println("Description"); -38                                 bikeInformation[2] = scan.nextLine(); -39  -40                                 Bike bike = new Bike(); -41                                 bike.setModelNumber(bikeInformation[0]); -42                                 bike.setColor(bikeInformation[1]); -43                                 bike.setDescription(bikeInformation[2]); -44  -45                                 bike = bikeRepo.save(bike); -46                                 System.out.println(bike.toString()); -47  -48  -49                         } else if ("X".equals(response.toUpperCase())) { -50                                 System.out.println("Bye"); -51                                 running = false; -52                         } else { -53                                 System.out.println("Sorry nothing else works right now!"); -54                         } -55                 } -56                  -57         } -58 } +package com.stephb.JavaMongo; + +import com.stephb.JavaMongo.dao.BikeRepository; +import com.stephb.JavaMongo.dao.CustomerRepository; +import com.stephb.JavaMongo.dto.Bike; +import java.util.Scanner; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +@SpringBootApplication +public class JavaMongoApplication implements CommandLineRunner { + @Autowired + private BikeRepository bikeRepo; + private CustomerRepository custRepo; + + public static void main(String[] args) { + SpringApplication.run(JavaMongoApplication.class, args); + } + @Override + public void run(String... args) throws Exception { + Scanner scan = new Scanner(System.in); + String response = ""; + boolean running = true; + while(running){ + System.out.println("What would you like to create? \n C: The Customer \n B: Bike? \n X:Close"); + response = scan.nextLine(); + if ("B".equals(response.toUpperCase())) { + String[] bikeInformation = new String[3]; + System.out.println("Enter the information for the Bike"); + System.out.println("Model Number"); + bikeInformation[0] = scan.nextLine(); + System.out.println("Color"); + bikeInformation[1] = scan.nextLine(); + System.out.println("Description"); + bikeInformation[2] = scan.nextLine(); + + Bike bike = new Bike(); + bike.setModelNumber(bikeInformation[0]); + bike.setColor(bikeInformation[1]); + bike.setDescription(bikeInformation[2]); + + bike = bikeRepo.save(bike); + System.out.println(bike.toString()); + + + } else if ("X".equals(response.toUpperCase())) { + System.out.println("Bye"); + running = false; + } else { + System.out.println("Sorry nothing else works right now!"); + } + } + + } +} ``` -其中的 **@Autowired** 注解会自动依赖注入 **BikeRepository** 和 **CustomerRepository** Bean。我们将使用这些类来从数据库持久化和采集数据。 +其中的 `@Autowired` 注解会自动依赖注入 `BikeRepository` 和 `CustomerRepository` Bean。我们将使用这些类来从数据库持久化和采集数据。 已经好了。你已经创建了一个命令行应用程序。该应用程序连接到数据库,并且能够以最少的代码执行 CRUD 操作 ### 结论 -从诸如对象和类之类的编程语言概念转换为用于在数据库中存储、检索或更改数据的调用对于构建应用程序至关重要。Java 持久化 API (JPA)正是为 Java 开发人员解决这一难题的重要工具。 你正在使用 Java 操纵哪些数据库呢? 请在评论中分享。 +从诸如对象和类之类的编程语言概念转换为用于在数据库中存储、检索或更改数据的调用对于构建应用程序至关重要。Java 持久化 API(JPA)正是为 Java 开发人员解决这一难题的重要工具。你正在使用 Java 操纵哪些数据库呢?请在评论中分享。 -------------------------------------------------------------------------------- @@ -255,7 +248,7 @@ via: https://opensource.com/article/19/10/using-java-persistence-api 作者:[Stephon Brown][a] 选题:[lujun9972][b] 译者:[runningwater](https://github.com/runningwater) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5dafc97faf08ad209a99b8cd648183135fdf9164 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Dec 2019 00:08:09 +0800 Subject: [PATCH 076/430] PUB @runningwater https://linux.cn/article-11717-1.html --- .../20191007 Using the Java Persistence API.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20191007 Using the Java Persistence API.md (98%) diff --git a/translated/tech/20191007 Using the Java Persistence API.md b/published/20191007 Using the Java Persistence API.md similarity index 98% rename from translated/tech/20191007 Using the Java Persistence API.md rename to published/20191007 Using the Java Persistence API.md index 056d138caf..8f5c20d3cc 100644 --- a/translated/tech/20191007 Using the Java Persistence API.md +++ b/published/20191007 Using the Java Persistence API.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (runningwater) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11717-1.html) [#]: subject: (Using the Java Persistence API) [#]: via: (https://opensource.com/article/19/10/using-java-persistence-api) [#]: author: (Stephon Brown https://opensource.com/users/stephb) @@ -12,7 +12,7 @@ > 我们通过为自行车商店构建示例应用程序来学习如何使用 JPA。 -![Coffee beans][1] +![](https://img.linux.net.cn/data/attachment/album/201912/27/000705dymv92hnba2a2322.jpg) 对应用开发者来说,Java 持久化 APIJava Persistence API(JPA)是一项重要的 java 功能,需要透彻理解。它为 Java 开发人员定义了如何将对象的方法调用转换为访问、持久化及管理存储在 NoSQL 和关系型数据库中的数据的方案。 From 54aff5668fcd18a6d005fc723cbcfd3dd21a9df1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Dec 2019 00:53:08 +0800 Subject: [PATCH 077/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191227=20Explai?= =?UTF-8?q?ned!=20Why=20Your=20Distribution=20Still=20Using=20an=20?= =?UTF-8?q?=E2=80=98Outdated=E2=80=99=20Linux=20Kernel=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md --- ... Still Using an ‘Outdated- Linux Kernel.md | 120 ++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md diff --git a/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md b/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md new file mode 100644 index 0000000000..224f848f2d --- /dev/null +++ b/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md @@ -0,0 +1,120 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Explained! Why Your Distribution Still Using an ‘Outdated’ Linux Kernel?) +[#]: via: (https://itsfoss.com/why-distros-use-old-kernel/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Explained! Why Your Distribution Still Using an ‘Outdated’ Linux Kernel? +====== + +[Check your Linux kernel version][1]. Chances are that you’ll find that the kernel version your system is using has already reached end of life (EOL) as listed on Linux Kernel website. + +End of life means a software won’t get bug fixes and support anymore. + +That poses some valid questions. Why is my Linux distribution using a kernel that has reached end of life? Is this not a security risk? Is my system safe? + +Let me explain all these questions in this article. + +Summary + +The upstream kernel support and the your distribution’s kernel support are two different things. + +For example, Linux kernel 4.15 might have reached end of life (as per the official Linux kernel website) but Ubuntu 18.04 LTS release will use it and maintain it till April 2023 by backporting security patches and bug fixes. + +### Checking Linux kernel version and finding its end of life status + +Let’s first check the Linux kernel version on your system: + +``` +uname -r +``` + +I am using Ubuntu 18.04 here and it shows the Linux kernel version like this: + +``` +[email protected]:~$ uname -r +5.0.0-37-generic +``` + +Now, you may go to the official Linux kernel website and see what Linux kernels are still being supported. It’s displayed on the homepage itself. + +[Linux Kernel Official Website][2] + +You should see a status like this: + +![Linux Kernel Status][3] + +If you don’t see a kernel version listed on the homepage of kernel website, it means that specific version has reached end of life. + +As you can see, kernel 5.0 is not listed here. It indicates that this kernel version is not being supported anymore. Actually, it [reached end of life in June 2019][4]. + +The life cycle of a Linux kernel doesn’t follow a set pattern, unfortunately. It’s NOT like a regular kernel stable release will be supported for X months and a long term support(LTS) kernel will be supported for Y years. + +Based on the demand and requirements, there could be several LTS kernel versions with different EOL. You can find them along with their projected EOL on [this page][5]. + +Now comes the big question. Why is Ubuntu providing kernel 5.0 if the Linux kernel website shows that it has reached its end of life? + +### Your distribution uses an EOL Linux kernel but that’s Okay! + +![][6] + +Have you ever wondered why Ubuntu/Debian/Fedora etc are called Linux distributions? It’s because they ‘distribute’ the Linux kernel. + +They have their own modification of the Linux kernel, they add the GUI elements (desktop environment, display server etc) and software and they make it available to their users. + +In the typical workflow, a Linux distribution will choose a kernel to provide to its users. And then it will hold on to this kernel for months or years even after the kernel has reached end of life. + +How is it safe then? It’s because the _**distribution maintains the kernel by backporting all the important fixes to its kernel**_. + +In other words, your Linux distribution makes sure that your Linux kernel is patched well and has all the bug fixes and important new features backported to it. There will be thousands of changes on top of the ‘old outdated Linux kernel’. + +When the Linux kernel website says that a certain kernel version has reached EOL, it means that the core Linux kernel maintainers are not going to update/patch that kernel version anymore. + +But at the same time, the developers at Debian/Ubuntu or other distributions work to keep the same old version alive by bringing the relevant changes from the newer kernel versions (being maintained by the core kernel team) to your distribution’s old kernel. + +Bottom line is that even if it seems like your distribution is using an outdated Linux kernel, it is actually being well maintained and not really outdated. + +### Should you use the latest stable kernel version? + +![][7] + +A new stable Linux kernel version is released every 2-3 months. And this makes many users wonder who they can get their hands on that new shiny thing. + +To be frank, you should not do that unless you have a pretty good reason for it. Your distribution doesn’t provide it to you. You cannot just use ‘_sudo apt give-me-the-latest-stable-kernel_‘. + +Now, manually [installing the mainline Linux kernel version][8] could be a challenge in itself. Even if you manage to install it, it is now up to you to make sure that this kernel is updated every time there is a bug fix. And when this new kernel reaches end of life, it becomes your responsibility to upgrade to the newer kernel version. It won’t be handled with apt upgrade like regular [Ubuntu updates][9]. + +You should also keep in mind that your distribution also has drivers and patches which you may not be able to use if you switch to the mainline kernel. + +As [Greg Kroah-Hartman][10] puts it, “_**the best kernel you can use is one that someone else supports**_“. And who can be better at this job then your Linux distribution! + +I hope you have a better understanding on this topic and you won’t panic the next time you find out that the kernel version your system is using has reached end of life. + +I welcome your questions and suggestions. Please feel free to use the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/why-distros-use-old-kernel/ + +作者:[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/find-which-kernel-version-is-running-in-ubuntu/ +[2]: https://www.kernel.org/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/linux-kernel-status.jpg?ssl=1 +[4]: http://lkml.iu.edu/hypermail/linux/kernel/1906.0/02354.html +[5]: https://www.kernel.org/category/releases.html +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/Keep_Calm_and_Trust_Your_Distribution.png?ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/using_latest_kernel.png?ssl=1 +[8]: https://wiki.ubuntu.com/Kernel/MainlineBuilds +[9]: https://itsfoss.com/update-ubuntu/ +[10]: https://en.wikipedia.org/wiki/Greg_Kroah-Hartman From 692eb4ff11e1356fc480a2ec37f4ded85255070a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Dec 2019 00:53:53 +0800 Subject: [PATCH 078/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191226=2010=20L?= =?UTF-8?q?inux=20command=20tutorials=20for=20beginners=20and=20experts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191226 10 Linux command tutorials for beginners and experts.md --- ...and tutorials for beginners and experts.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20191226 10 Linux command tutorials for beginners and experts.md diff --git a/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md b/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md new file mode 100644 index 0000000000..3172f26ea1 --- /dev/null +++ b/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 Linux command tutorials for beginners and experts) +[#]: via: (https://opensource.com/article/19/12/linux-commands) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +10 Linux command tutorials for beginners and experts +====== +Learn how to make Linux do what you need it to do in Opensource.com's +top 10 articles about Linux commands from 2019. +![Penguin driving a car with a yellow background][1] + +Using Linux _well_ means understanding what commands are available and what they're capable of doing for you. We have covered a lot of them on Opensource.com during 2019, and here are 10 favorites from the bunch. + +### Using the force at the Linux command line + +The Force has a light side and a dark side. Properly understanding that is crucial to true mastery. In his article [_Using the force at the Linux command line_][2], Alan Formy-Duval explains the **-f** option (also known as **\--force**) for several popular and sometimes dangerous commands. + +### Intro to the Linux useradd command + +Sharing accounts is a bad idea. Instead, give separate accounts to different people (and even different roles) with the quintessential **useradd** command. Part of his venerable series on basic Linux administration, Alan Formy-Duval provides an [_Intro to the Linux useradd command_][3], and, as usual, he explains it in _plain English_ so that both new and experienced admins can understand it. + +### Linux commands to display your hardware information + +What's _inside_ the box? Sometimes it's useful to inspect your hardware without using a screwdriver. In [_Linux commands to display your hardware information_][4], Howard Fosdick provides both popular and obscure commands to help you dig deep into the computer you're using, the computer you're testing at the store before buying, or the computer you're trying to repair. + +### How to encrypt files with gocryptfs on Linux + +Our files hold lots of private data, from social security numbers to personal letters to loved ones. In [_How to encrypt files with gocryptfs on Linux_][5], Brian "Bex" Exelbierd explains how to keep *private *what's meant to be private. As a bonus, he demonstrates encrypting files in a way that has little to no impact on your existing workflow. This isn't a complex PGP-style puzzle of key management and background key agents; this is quick, seamless, and secure file encryption. + +### How to use advanced rsync for large Linux backups + +In the New Year, many people will resolve to be more diligent about making backups. Alan Formy-Duval must have made that resolution years ago, because in [_How to use advanced rsync for large Linux backups_][6], he displays remarkable familiarity with the file synchronization command. You might not remember all the syntax right away, but the idea is to read and process the options, construct your backup command, and then automate it. That's the smart way to use **rsync**, and it's the _only_ way to do backups reliably. + +### Using more to view text files at the Linux command line + +In Scott Nesbitt's article [_Using more to view text files at the Linux command line_][7], the good old default pager **more** finally gets the spotlight. Many people install and use **less**, because it's more flexible than **more**. However, with more and more systems being implemented in the sparsest of containers, the luxury of fancy new tools like **less** or **most** sometimes just doesn't exist. Knowing and using **more** is simple, it's a common default, and it's the production system's debugging tool of last resort. + +### What you probably didn't know about sudo + +The **sudo** command is famous to a fault. People know the **sudo** term, and most of us believe we know what it does. And we're a little bit correct, but as Peter Czanik reveals in his article [_What you probably didn't know about sudo_][8], there's a lot more to the command than just "Simon says." Like that classic childhood game, the **sudo** command is powerful and also prone to silly mistakes—only with greater potential for horrible consequences. This is one game you do not want to lose! + +### How to program with Bash: Syntax and tools + +If you're a Linux, BSD, or Mac (and lately, Windows) user, you may have used the Bash shell interactively. It's a great shell for quick, one-off commands, which is why so many Linux users love to use it as their primary user interface. However, Bash is much more than just a command prompt. It's also a programming language, and if you're already using Bash commands, then the path to automation has never been more straightforward. Learn all about it in David Both's excellent [_How to program with Bash: Syntax and tools_][9]. + +### Master the Linux ls command + +The **ls** command is one of those commands that merits a two-letter name; one-letter commands are an optimization for slow terminals where each letter causes a significant delay and also a nice bonus for lazy typists. Seth Kenlon explains how you can [_Master the Linux ls command_][10] and he does so with his usual clarity and pragmatism. Most significantly, in a system where "everything is a file," being able to list the files is crucial. + +### Getting started with the Linux cat command + +The **cat** command (short for con_cat_enate) is deceptively simple. Whether you use it to quickly see the contents of a file or to pipe the contents to another command, you may not be using **cat** to its full potential. Alan Formy-Duval's elucidating [_Getting started with the Linux cat command_][11] offers new ideas to take advantage of a command that lets you open a file without feeling like you've opened it. As a bonus, learn all about **zcat** so you can decompress files without all the trouble of decompression! It's a small and simple thing, but _this_ is what makes Linux great. + +### Continue the journey + +Don't let Opensource.com's 10 best articles about Linux commands of 2019 be the end of your journey. There's much more to discover about Linux and its versatile prompt, so stay tuned in 2020 for more insights. And, if there's a Linux command you want us to know about, please tell us about it in the comments, or share your knowledge with Opensource.com readers by [submitting an article][12] about your favorite Linux command. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/linux-commands + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) +[2]: https://opensource.com/article/19/5/may-the-force-linux +[3]: https://opensource.com/article/19/10/linux-useradd-command +[4]: https://opensource.com/article/19/9/linux-commands-hardware-information +[5]: https://opensource.com/article/19/8/how-encrypt-files-gocryptfs +[6]: https://opensource.com/article/19/5/advanced-rsync +[7]: https://opensource.com/article/19/1/more-text-files-linux +[8]: https://opensource.com/article/19/10/know-about-sudo +[9]: https://opensource.com/article/19/10/programming-bash-syntax-tools +[10]: https://opensource.com/article/19/7/master-ls-command +[11]: https://opensource.com/article/19/2/getting-started-cat-command +[12]: https://opensource.com/how-submit-article From be9e44f95cd8a5987439fef193ae223248dbd537 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Dec 2019 00:54:22 +0800 Subject: [PATCH 079/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191226=2010=20a?= =?UTF-8?q?rticles=20to=20become=20more=20data=20science=20savvy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191226 10 articles to become more data science savvy.md --- ...icles to become more data science savvy.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20191226 10 articles to become more data science savvy.md diff --git a/sources/tech/20191226 10 articles to become more data science savvy.md b/sources/tech/20191226 10 articles to become more data science savvy.md new file mode 100644 index 0000000000..f334c7451a --- /dev/null +++ b/sources/tech/20191226 10 articles to become more data science savvy.md @@ -0,0 +1,123 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 articles to become more data science savvy) +[#]: via: (https://opensource.com/article/19/12/data-science-resources) +[#]: author: (Lauren Maffeo https://opensource.com/users/lmaffeo) + +10 articles to become more data science savvy +====== +Boost your data science game in 2020 with Opensource.com's top 10 +most-read articles on the topic from 2019. +![Open data brain][1] + +When LinkedIn released its third annual [Emerging Jobs report][2], engineers everywhere said, "Amen." More than half the list consists of engineering roles, with new fields like robotics appearing for the first time. + +But data science had a strong showing as well. The role shows 37% annual growth, topping that aspect of the Emerging Jobs list for the third year in a row. + +Looking at the core skills a data scientist needs—including R, Python, and Apache Spark—it's easy to find overlaps with open source. So, we're not surprised that data science was one of the most popular topics at Opensource.com in 2019. + +We saw a need for knowledge about diverse data science topics. And our community of authors delivered answers. + +For your reading pleasure, we've listed the top 10 data science articles of 2019. We define "top" as the data science articles that were published in 2019 and earned the most page views, starting with the most popular. + +Whether you want to use Kubernetes for batch jobs or query 10 years' worth of GitHub data, these articles will boost your data science game in 2020. + +### Why data scientists love Kubernetes + +Kubernetes is having more than a moment. That's due in no small part to its versatility. You might already know that Kubernetes helps software developers and system operators deploy applications in Linux containers. But did you know how helpful it can be for data science as well? + +In [_Why data scientists love Kubernetes_][3], our most popular data science article in 2019, William Benton and Sophie Watson share how Kubernetes supports the data science workflow. From repeatable batch jobs to debugging ML models, this article shares several ways for data scientists to leverage Kubernetes. + +### How to use Spark SQL: A hands-on tutorial + +Wondering how to use a cloud service for big data analytics? [_How to use Spark SQL: A hands-on tutorial_][4] uses Spark DataFrames to show how to use relational databases at scale. DJ Sarkar uses a real-world dataset to walk readers through the process of using Spark SQL. + +Rich with screenshots and code, Sarkar's tutorial is the ideal sequel to [his first piece][5] on this subject. He shares several ways that you can use Spark to manage structured data obtained from flat files or databases. + +### 9 resources for data science projects + +The growth of data science in open source—from machine learning to neural networks—has left many engineers wanting to learn more. In [_9 resources for data science projects_][6], Dan Barker shares the books, tools, and online courses he thinks are a must for any engineer who wants to get started. + +Barker is especially keen on Cathy O'Neil's book [_Weapons of Math Destruction_][7], which shares how bias creeps into data and how you can stop it. He also shares a range of websites for newbies to explore. + +### Getting started with data science using Python + +Alongside the rise of data science techniques, Python has seen a meteoric rise. It's now one of the most popular programming languages. When used with libraries like pandas and Seaborn, Python is an ideal entry to data science. + +In [_Getting started with data science using Python_][8], a follow-up to his [intro to Python][9] article, Seth Kenlon shares how to create a Python virtual environment; install pandas and NumPy; create a sample dataset; and much more. This article is an especially good read if you want to learn more about data visualization. + +### How to analyze log data with Python and Apache Spark + +Like many articles in our top 10 list, [_How to analyze log data with Python and Apache Spark_][10] is a sequel to [an earlier article][11] on using Python and Apache Spark to wrangle data. Once you've learned how to put your data into a clean, structured format, DJ Sarkar offers this piece to help you analyze that data. + +Whether you want to see the top 10 error endpoints or content size statistics, Sarkar shows you how to analyze several types of log data in your [DataFrame][12]. The data that he uses isn't "big data" from a size or volume standpoint. But these techniques can scale for use with larger datasets. + +### How to wrangle log data with Python and Apache Spark + +[_How to wrangle log data with Python and Apache Spark_][11], DJ Sarkar's prequel to his piece on analyzing log data, also made our top 10 list. It's no surprise since most organizations use a range of systems and infrastructure that run constantly. Data logs are an ideal way to make sure that everything keeps working effectively. + +In this tutorial, Sarkar shows how to use Apache Spark on real-world production logs from NASA. He walks through the process of using Spark to do log analytics at scale on semi-structured log data. This ranges from setting up dependencies to data wrangling. + +### Querying 10 years of GitHub data with GHTorrent and Libraries.io + +Did you know that you can use Kibana or the Elasticsearch API to turn Amazon S3 object-storage data into a searchable Elasticsearch-type cluster? Likewise, did you know about the project that aims to build an offline version of all data available through GitHub APIs? + +In [_Querying 10 years of GitHub data with GHTorrent and Libraries.io_][13], Pete Cheslock explores how to access and query GHTorrent data. You can do it using several formats, including CSV and Google Big Query. Cheslock uses the latter to search indexed GHTorrent data to learn which software languages, licenses, and rates of growth are most popular for GitHub projects. + +### Predicting NFL play outcomes with Python and data science + +Want to increase your machine learning skills in Python? With the NFL playoff season upon us, it's a great time to read [_Predicting NFL play outcomes with Python and data science_][14], which shares some data science tips to predict plays. + +Christa Hayes shows how to spot weird values, predict downs and play types, make regression plots, and train models. Once you've read her article on [how to format data for training][15], this one is the ideal next step. + +### Analyzing the Stack Overflow Survey with Python and Pandas + +Stack Overflow's annual developer survey is a tech behemoth. Nearly 90,000 developers took this year's 20-minute survey and left a lot of data in their wake. + +To find certain results, Moshe Zadka used the pandas library to search the survey's [anonymized results][16]. If you want to filter Stack Overflow's dataset for certain details (like seeing how many developers use certain languages or contribute to open source projects), Moshe's [_Analyzing the Stack Overflow Survey with Python and Pandas_][17] tutorial shows you how. + +### 4 Python tools for getting started with astronomy + +For readers with their heads in the clouds, NumFOCUS republished some of its blog posts on Opensource.com this year. In [_4 Python tools for getting started with astronomy_][18], Dr. Gina Helfrich shares how you can get involved in astronomy. + +Intimidated? Don't be: Dr. Helfrich says Python packages are so advanced that building data-reduction scripts is much easier than ever before. If you want to play with astronomy imaging datasets, this piece will steer you in the right direction. + +### What do you want to know about data science? + +Data science is an exciting field with countless things to explore. If there's something you want to know about data science, please tell us about it in the comments so we can try to cover it in 2020. Or, if you are so inclined, please share your knowledge with Opensource.com readers by [submitting an article][19] about your favorite data science topic. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/data-science-resources + +作者:[Lauren Maffeo][a] +选题:[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/lmaffeo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_520x292_opendata_0613mm.png?itok=UIjD_jhK (Open data brain) +[2]: https://business.linkedin.com/content/dam/me/business/en-us/talent-solutions/emerging-jobs-report/Emerging_Jobs_Report_U.S._FINAL.pdf +[3]: https://opensource.com/article/19/1/why-data-scientists-love-kubernetes +[4]: https://opensource.com/article/19/3/apache-spark-and-dataframes-tutorial +[5]: https://opensource.com/article/19/3/sql-scale-apache-spark-sql-and-dataframes +[6]: https://opensource.com/article/19/2/learn-data-science-ai +[7]: https://www.amazon.com/Weapons-Math-Destruction-Increases-Inequality/dp/0553418815 +[8]: https://opensource.com/article/19/9/get-started-data-science-python +[9]: https://opensource.com/article/17/10/python-101 +[10]: https://opensource.com/article/19/5/visualize-log-data-apache-spark +[11]: https://opensource.com/article/19/5/log-data-apache-spark +[12]: https://pandas.pydata.org/pandas-docs/stable/getting_started/dsintro.html#dataframe +[13]: https://opensource.com/article/19/5/chaossearch-github-ghtorrent +[14]: https://opensource.com/article/19/10/predicting-nfl-plays-python +[15]: https://opensource.com/article/19/10/formatting-nfl-data-python +[16]: https://insights.stackoverflow.com/survey +[17]: https://opensource.com/article/19/9/stack-overflow-survey-python-pandas +[18]: https://opensource.com/article/19/10/python-astronomy-open-data +[19]: https://opensource.com/how-submit-article From 2b8c1ceb5580b22ea1b7e76760d4efd87a7e3aa3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Dec 2019 00:54:53 +0800 Subject: [PATCH 080/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191226=20How=20?= =?UTF-8?q?the=20Zen=20of=20Python=20handles=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191226 How the Zen of Python handles errors.md --- ...26 How the Zen of Python handles errors.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sources/tech/20191226 How the Zen of Python handles errors.md diff --git a/sources/tech/20191226 How the Zen of Python handles errors.md b/sources/tech/20191226 How the Zen of Python handles errors.md new file mode 100644 index 0000000000..030c889db3 --- /dev/null +++ b/sources/tech/20191226 How the Zen of Python handles errors.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How the Zen of Python handles errors) +[#]: via: (https://opensource.com/article/19/12/zen-python-errors) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +How the Zen of Python handles errors +====== +This is part of a special series about the Zen of Python focusing on the +10th and 11th principles: on the silence (or not) of errors. +![a checklist for a team][1] + +Handling "exceptional conditions" is one of the most debated issues in programming. That could be because the stakes are high: mishandled error values can bring down even the largest systems. Since "exception conditions," by nature, are the least tested but occur with unpleasant frequency, correctly handling them can often distinguish a system that horror stories are told about to a system that "just works." + +From Java's **checked** exceptions through Erlang's fault isolation to Haskell's **Maybe**, different languages have remarkably different attitudes to error handling. + +The [Zen][2] offers Python's meditation on the topic. + +### Errors should never pass silently… + +Before the Zen of Python was a twinkle in Tim Peters' eye, before Wikipedia became informally known as "wiki," the first WikiWiki site, [C2][3], existed as a trove of programming guidelines. These are principles that mostly came out of a [Smalltalk][4] programming community. Smalltalk's ideas influenced many object-oriented languages, Python included. + +The C2 wiki defines the Samurai Principle: "return victorious, or not at all." In Pythonic terms, it encourages eschewing sentinel values, such as returning **None** or **-1** to indicate an inability to complete the task, in favor of raising exceptions. A **None** is silent: it looks like a value and can be put in a variable and passed around. Sometimes, it is even a _valid_ return value. + +The principle here is that if a function cannot accomplish its contract, it should "fail loudly": raise an exception. The raised exception will never look like a possible value. It will skip past the **returned_value = call_to_function(parameter)** line and go up the stack, potentially crashing the program. + +A crash is straightforward to debug: there is a stack trace indicating the problem as well as the call stack. The failure might mean that a necessary condition for the program was not met, and human intervention is needed. It might mean that the program's logic is faulty. In either case, the loud failure is better than a hidden, "missing" value, infecting the program's valid data with **None**, until it is used somewhere and an error message says "**None does not have method split**," which you probably already knew. + +### Unless explicitly silenced. + +Exceptions sometimes need to be explicitly caught. We might anticipate some of the lines in a file are misformatted and want to handle those in a special way, maybe by putting them in a "lines to be looked at by a human" file, instead of crashing the entire program. + +Python allows us to catch exceptions with **except**. This means errors can be _explicitly_ silenced. This explicitness means that the **except** line is visible in code reviews. It makes sense to question why this is the right place to silence, and potentially recover from, the exception. It makes sense to ask if we are catching too many exceptions or too few. + +Because this is all explicit, it is possible for someone to read the code and understand which exceptional conditions are recoverable. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-errors + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team) +[2]: https://www.python.org/dev/peps/pep-0020/ +[3]: https://wiki.c2.com/ +[4]: https://en.wikipedia.org/wiki/Smalltalk From ee42fcddaae55a618fb08dc32f32b22b06b79ec0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Dec 2019 00:55:16 +0800 Subject: [PATCH 081/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191226=20Top=20?= =?UTF-8?q?10=20Raspberry=20Pi=20articles=20of=202019?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191226 Top 10 Raspberry Pi articles of 2019.md --- ...26 Top 10 Raspberry Pi articles of 2019.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20191226 Top 10 Raspberry Pi articles of 2019.md diff --git a/sources/tech/20191226 Top 10 Raspberry Pi articles of 2019.md b/sources/tech/20191226 Top 10 Raspberry Pi articles of 2019.md new file mode 100644 index 0000000000..e4fae2c6ca --- /dev/null +++ b/sources/tech/20191226 Top 10 Raspberry Pi articles of 2019.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top 10 Raspberry Pi articles of 2019) +[#]: via: (https://opensource.com/article/19/12/raspberry-pi-2019) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) + +Top 10 Raspberry Pi articles of 2019 +====== +Take a look back at the year in Raspberry Pi and get excited for what's +to come in 2020. +![Raspberries with pi symbol overlay][1] + +Since its introduction, the Raspberry Pi has been one of the hottest topics on Opensource.com. This trend continued in 2019 with an impressive list of over 30 articles about various Raspberry Pi projects. The top 10 articles are covered below, but if you are a true Raspberry Pi aficionado, I encourage you to check out out our entire selection of [Raspberry Pi articles][2]. + + 1. _[Turn a Raspberry Pi 3B+ into a PriTunl VPN][3]_ by Stephen Bancroft demonstrates how to set up a PriTunl virtual private networking (VPN) on a Raspberry Pi 3B+. There are several sticky points about the process that Bancroft helpfully and clearly explains. Following his instructions, you can easily turn a Raspberry Pi into a VPN server. + + 2. In _[Let’s get physical: How to use GPIO pins on the Raspberry Pi][4]_, Anderson Silva provides a brief introduction to using the GPIO pins on a Raspberry Pi. The article is full of links to other resources, including some of Silva’s other pieces, for those who want to dig deeper into the topic. + + 3. Sam Bocetta’s article _[How to use your Raspberry Pi as a VPN server][5]_, demonstrates how to install and configure PiVPN on a Raspberry Pi to create a VPN server. The article covers every aspect of the installation and configuration process, so if the reader has followed all the instructions provided, they will end up with their own Raspberry Pi-powered VPN. + + 4. _[Program the real world using Rust on Raspberry Pi][6]_ by Rahul Thakoor explores how to use the Rust programming language on the Raspberry Pi. By adding **rust_gpiozero** to a Rust project, it is possible to write code in Rust that can interact with buttons, servos, and other hardware connected to a Raspberry Pi. This article shows you how to get started. + + 5. Ben Nuttall, Raspberry Pi community manager, proclaims _[Raspberry Pi 4 is here!][7]_ in this article covering the release of the Raspberry Pi 4. The Raspberry Pi 4 features many improvements over previous Raspberry Pi models, and Nuttall walks through them in detail. From the new hardware features to the software updates in the updated release of Raspbian, this article brings you up to speed on what the Raspberry Pi 4 brings to the Raspberry Pi ecosystem. + + 6. _[How to build a WiFi picture frame with a Raspberry Pi][8]_ by Manuel Dewald shows you how to create a WiFi-connected digital picture frame using a Raspberry Pi 3. This step-by-step tutorial provides all the instructions needed to configure the software, but if you want to make a fancy case for your digital picture frame, that part is up to you. + + 7. Anderson Silva’s _[How to boot up a new Raspberry Pi][9]_ explains what you need to do to boot an operating system on a Raspberry Pi. This article primarily provides an overview of NOOBS (New Out Of Box Software) and contains links to the official Raspberry Pi website for the most up-to-date installation instructions. + + 8. _[How to build a mobile particulate matter sensor with a Raspberry Pi][10]_ by Stephan Tetzel illustrates how to build a sensor that can monitor your air quality using a Raspberry Pi, a small LCD display, and an inexpensive sensor. The particulate matter sensor you create can be used anywhere when paired with a power bank. + + 9. _[3 popular programming languages you can learn with Raspberry Pi][11]_ by Anderson Silva looks at programming Python, Java, and JavaScript on the Raspberry Pi. The Thonny IDE for Python and the BlueJ IDE for Java are briefly covered. The article also encourages users who are interested in other programming languages with the assurance that "there’s a high likelihood that you can use your Raspberry Pi to compile or interpret any language of choice, including C, C++, PHP, and Ruby." + + 10. Take a trip down memory lane by _[Resurrecting the Amiga on the Raspberry Pi][12]_ with this guide by Sarah Thornton. Using the instructions provided, you can experience the Amiga again on a Raspberry Pi or several other devices. Thornton even provides a helpful set of links for those interested in learning more about the history of the Amiga. + + + + +I hope these articles encourage you to explore the possibilities of the Raspberry Pi. Maybe they have even inspired you to [share your own Raspberry Pi story][13] with us? Your story could end up on this list next year! + +In this month's Raspberry Pi column, Ben Nuttall introduces readers to five projects that you might... + +Owning a little cloud has a lot of benefits and can save you over $100 per month. In this step-by-... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/raspberry-pi-2019 + +作者:[Joshua Allen Holm][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-raspberrypi_0.png?itok=Kczz87J2 (Raspberries with pi symbol overlay) +[2]: https://opensource.com/tags/raspberry-pi +[3]: https://opensource.com/article/19/1/pritunl-vpn-raspberry-pi +[4]: https://opensource.com/article/19/3/gpio-pins-raspberry-pi +[5]: https://opensource.com/article/19/6/raspberry-pi-vpn-server +[6]: https://opensource.com/article/19/3/physical-computing-rust-raspberry-pi +[7]: https://opensource.com/article/19/6/raspberry-pi-4 +[8]: https://opensource.com/article/19/2/wifi-picture-frame-raspberry-pi +[9]: https://opensource.com/article/19/3/how-boot-new-raspberry-pi +[10]: https://opensource.com/article/19/3/mobile-particulate-matter-sensor +[11]: https://opensource.com/article/19/3/programming-languages-raspberry-pi +[12]: https://opensource.com/article/19/3/amiga-raspberry-pi +[13]: https://opensource.com/how-submit-article From f670913b2bd66a2321d0e05bdd98c450015714c9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 27 Dec 2019 08:59:20 +0800 Subject: [PATCH 082/430] translated --- ...e the Herbstluftwm Linux window manager.md | 105 ------------------ ...e the Herbstluftwm Linux window manager.md | 104 +++++++++++++++++ 2 files changed, 104 insertions(+), 105 deletions(-) delete mode 100644 sources/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md create mode 100644 translated/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md diff --git a/sources/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md b/sources/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md deleted file mode 100644 index 47218849e3..0000000000 --- a/sources/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md +++ /dev/null @@ -1,105 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why Vim fans love the Herbstluftwm Linux window manager) -[#]: via: (https://opensource.com/article/19/12/herbstluftwm-linux-desktop) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Why Vim fans love the Herbstluftwm Linux window manager -====== -This article is part of a special series of 24 days of Linux desktops. -If you're a Vim fan, check out herbstluftwm, a tile-based Linux window -manager that takes the "Vim way" as inspiration. -![OpenStack source code \(Python\) in VIM][1] - -Everybody loves Vim (aside from Dvorak and Emacs users). Vim is so popular that there are entire web browsers dedicated to navigating the web with Vim keybindings, a Vim mode in the wildly popular [Zsh][2] terminal emulator, and even a text editor. There's also a window manager called [herbstluftwm][3] that models itself partly after the "Vim way." Herbstluftwm does away with windows, as such, and replaces them with tiles, or quadrants, into which applications are loaded and used. You use the keyboard (**Alt+h**, **Alt+j**, **Alt+k**, and **Alt+l**) to navigate from one tile to another. - -![Herbstluftwm][4] - -Install herbstluftwm from your distribution's software repository. After installing it, log out of your current desktop session so you can log into your new one. By default, your session manager (KDM, GDM, LightDM, or XDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging in. - -With GDM: - -![][5] - -With SDDM: - -![][6] - -### Herbstluftwm desktop tour - -The first time you log into herbstluftwm, you are greeted with nothing but a green screen with a darker green border around the edges. What you're seeing is the initial tile with no application loaded into it. To start the default application, xterm, press **Alt+Return**. - -The documentation emphasizes the **$HOME/.config/herbstluftwm/autostart** configuration file as a way to start important applications when you log in. For applications you don't necessarily want to start every time you log in, you can use xterm as your launch daemon. As usual, placing an ampersand (**&**) symbol after the command returns control of the shell to you. To start Emacs, for instance: - - -``` -`% emacs &` -``` - -This launches an Emacs window in a new tile and returns you to a prompt. - -![Emacs running in Herbstluftwm][7] - -#### Switching tiles - -To move from one tile to another, use the classic Vim navigation combination of **h**, **j**, **k**, or **l**, along with the **Alt** key. For example, to switch from the terminal to an application in a tile below it (i.e., at the bottom of the screen), press **Alt+j**. To navigate back up, **Alt+k**. Left and right navigations are **Alt+h** and **Alt+l**, respectively. - -#### Split screen - -You can manually split a screen vertically with **Alt+o** and horizontally with **Alt+u**. - -To remove an empty tile, navigate into it and press **Alt+r**. - -### Configuring herbstluftwm - -Aside from the **Alt** keybindings, you communicate with herbstluftwm through the **herbstclient** command. This command can be used interactively from a shell, or you can preserve your preferences in a configuration file. - -You can view all attributes available in Herbstluftwm with: - - -``` -`$ herbstclient attr` -``` - -Herbstluftwm's default behavior is defined in the default config file, which you can copy to your home directory and modify. Upon launch, herbstluftwm executes the commands contained in the config file. For instance, if you find it awkward to use keybindings centered around the **Alt** key, which is traditionally a key reserved for in-application shortcuts, you can change the key used to trigger herbstluftwm actions in the config file: - - -``` -% mkdir ~/.config/herbstluftwm -% cp /usr/xdg/herbstluftwm/autostart \ -~/.config/herbstluftwm -% sed -i 's/Mod=Mod1/Mod=Mod4/' ~/.config/herbstluftwm -% herbstclient reload -``` - -This changes the herbstluftwm modifier to the Super key (the "Windows" or "Tux" key, depending on your keyboard). - -Using the autostart file, you can set custom keybindings, create tags for applications of a specific type so you can tile applications in a consistent way, and do much more. - -### Why you need to try herbstluftwm - -Herbstluftwm is a fine example of a tiling window manager. It tiles windows by default and lets the user define exceptions to global rules. It uses Vim-like navigation but allows for quick and easy overrides. It's very likely the tiling manager you've been looking for, so try it soon. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/herbstluftwm-linux-desktop - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_2.jpg?itok=4fza48WU (OpenStack source code (Python) in VIM) -[2]: https://opensource.com/article/19/9/getting-started-zsh -[3]: https://herbstluftwm.org -[4]: https://opensource.com/sites/default/files/uploads/advent-herbsluftwm.png (Herbstluftwm) -[5]: https://opensource.com/sites/default/files/advent-gdm_1.jpg -[6]: https://opensource.com/sites/default/files/advent-kdm_0.jpg -[7]: https://opensource.com/sites/default/files/uploads/advent-herbsluftwm-emacs.jpg (Emacs running in Herbstluftwm) diff --git a/translated/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md b/translated/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md new file mode 100644 index 0000000000..cba33f5166 --- /dev/null +++ b/translated/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why Vim fans love the Herbstluftwm Linux window manager) +[#]: via: (https://opensource.com/article/19/12/herbstluftwm-linux-desktop) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +为什么 Vim 爱好者喜欢 Herbstluftwm Linux 窗口管理器 +====== +本文是 24 天 Linux 桌面特别系列的一部分。如果你是Vim爱好者,请试试 Herbstluftwm,这是一个受到 ”Vim 方式“启发的基于平铺的 Linux 窗口管理器。 +![OpenStack source code \(Python\) in VIM][1] + +每个人都喜欢 Vim(除了 Dvorak 和 Emacs 用户)。Vim 非常流行,以至于有整个 Web 浏览器都使用 Vim 键绑定来浏览网页,非常流行的 [Zsh][2] 终端仿真器中的 Vim 模式,甚至是文本编辑器。 还有一个名为 [herbstluftwm][3] 的窗口管理器,它部分模仿了 “Vim 方式”。Herbstluftwm 取消了窗口,在程序载入和使用时使用平铺或者象限代替。 你可以使用键盘(**Alt+h**、**Alt+j**、**Alt+k** 和 **Alt+l**)从一个平铺块移动到另一个平铺块。 + +![Herbstluftwm][4] + +从发行版软件仓库安装 Herbstluftwm。安装后,请退出当前桌面会话,以便可以登录到新会话。默认情况下,会话管理器(KDM、GDM、LightDM 或 XDM,具体取决于你的设置)将继续登录到以前的桌面,因此在登录之前必须覆盖它。 + +在 GDM 中: + +![][5] + +在 SDDM 中: + +![][6] + +### Herbstluftwm 桌面之旅 + +第一次登录 Herbstluftwm 时,你只会看到绿屏,边缘有深绿色边框。你所看到的是初始平铺,其中没有加载任何应用程序。要启动默认应用,请按 **Alt+回车**。 + +文档中强调使用 **$HOME/.config/herbstluftwm/autostart** 作为登录时启动应用的配置文件。对于不必在每次登录时启动的应用,可以使用 xterm 作为启动守护进程。与往常一样,在命令将 shell 的控制权返回给你后加一个 **amp;** 符号。例如,要启动 Emacs: + + + +``` +`% emacs &` +``` + +这将在新平铺中启动 Emacs 窗口,然后返回命令行。 + +![Emacs running in Herbstluftwm][7] + +#### 切换平铺 + +要从一个平铺块移动到另一个平铺块,请使用经典的 **h**、**j**、**k** 或 **l** 与 **Alt** 的 Vim 导航组合键。例如,要从终端切换到其下方平铺中的应用(即屏幕底部),请按 **Alt+j**。要返回,请按 **Alt+k**。左移和右移分别为 **Alt+h** 和 **Alt+l**。 + +#### 分割屏幕 + +你可以使用 **Alt+o** 垂直分割屏幕,使用 **Alt+u** 水平分割屏幕。 + +要删除空白平铺块,请移动到该平铺块,然后按 **Alt+r**。 + +### 配置 herbstluftwm + +除了 **Alt** 键绑定外,你还可通过 **herbstclient** 命令与 Herbstluftwm 进行通信。此命令可以在 shell 中交互,或者你可在配置文件中保留你的首选项。 + +你可以查看 Herbstluftwm 中的所有可用属性: + + +``` +`$ herbstclient attr` +``` + +Herbstluftwm 的默认行为在默认配置文件中定义,你可以将其复制到家目录并进行修改。启动后,Herbstluftwm 执行配置文件中包含的命令。例如,你觉得使用以 **Alt** 为中心的键绑定很笨拙(它传统上是应用内保留快捷键),那你可以在配置文件中更改触发 Herbstluftwm 操作的键: + + +``` +% mkdir ~/.config/herbstluftwm +% cp /usr/xdg/herbstluftwm/autostart \ +~/.config/herbstluftwm +% sed -i 's/Mod=Mod1/Mod=Mod4/' ~/.config/herbstluftwm +% herbstclient reload +``` + +这将使 Herbstluftwm 的修饰键更改为 Super 键(”Windows“或 ”Tux“ 键,具体取决于你的键盘)。 + +使用自动启动文件,你可以设置自定义键绑定,为特定类型的应用创建标签,以便以一致的方式平铺应用,并执行更多操作。 + +### 为何你要尝试 herbstluftwm + +Herbstluftwm 是一个平铺窗口管理器的很好例子。它默认平铺窗口,并允许用户定义全局规则例外。它使用类似 Vim 的导航,但可以快速简单地覆盖它。你可能是你一直在寻找的平铺管理器,所以请尽快尝试一下。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/herbstluftwm-linux-desktop + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_2.jpg?itok=4fza48WU (OpenStack source code (Python) in VIM) +[2]: https://opensource.com/article/19/9/getting-started-zsh +[3]: https://herbstluftwm.org +[4]: https://opensource.com/sites/default/files/uploads/advent-herbsluftwm.png (Herbstluftwm) +[5]: https://opensource.com/sites/default/files/advent-gdm_1.jpg +[6]: https://opensource.com/sites/default/files/advent-kdm_0.jpg +[7]: https://opensource.com/sites/default/files/uploads/advent-herbsluftwm-emacs.jpg (Emacs running in Herbstluftwm) From a56735ab7fc615b569b1b29f8c8a01fc79f50bb7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 27 Dec 2019 09:07:03 +0800 Subject: [PATCH 083/430] translating --- ...1224 Chill out with the Linux Equinox Desktop Environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md b/sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md index 3d207d33cb..59abeb92b8 100644 --- a/sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md +++ b/sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 08e116279ad8ea586fd44e6564dcf06679f4cec9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Dec 2019 09:17:01 +0800 Subject: [PATCH 084/430] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @HankChow 翻译的很好! --- ...code needs to be beautiful and explicit.md | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/translated/tech/20191222 Why your Python code needs to be beautiful and explicit.md b/translated/tech/20191222 Why your Python code needs to be beautiful and explicit.md index ae5568bd13..747efed262 100644 --- a/translated/tech/20191222 Why your Python code needs to be beautiful and explicit.md +++ b/translated/tech/20191222 Why your Python code needs to be beautiful and explicit.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Why your Python code needs to be beautiful and explicit) @@ -9,18 +9,22 @@ 为什么 Python 代码要写得美观而明确 ====== -欢迎阅读“Python 光明节(Pythonukkah)”系列文章,这个系列文章将会讨论《Python 之禅》。我们首先来看《Python 之禅》里的前两个原则:美观与明确。 -![Searching for code][1] -早在 1999 年,Python 的贡献者之一,Tim Peters 就提出了《[Python 之禅][2]》,直到二十年后的今天,《Python 之禅》中的 19 条原则仍然对整个社区都产生着深远的影响。为此,我们举行了这一次的“Python 光明节”。首先,我们会讨论《Python 之禅》中的前两个原则:美观和明确。 +> 欢迎阅读“Python 光明节(Pythonukkah)”系列文章,这个系列文章将会讨论《Python 之禅》。我们首先来看《Python 之禅》里的前两个原则:美观与明确。 -> "Hanukkah is the Festival of Lights, -> Instead of one day of presents, we get eight crazy nights." -> —亚当·桑德勒, [光明节之歌][3] +![](https://img.linux.net.cn/data/attachment/album/201912/27/091634drq96c2fojzp6okr.png) + +早在 1999 年,Python 的贡献者之一,Tim Peters 就提出了《[Python 之禅][2]》,直到二十年后的今天,《Python 之禅》中的 19 条原则仍然对整个社区都产生着深远的影响。为此,就像庆典光明的光明节Hanukkah一样,我们举行了这一次的“Python 光明节Pythonukkah”。首先,我们会讨论《Python 之禅》中的前两个原则:美观和明确。 + +> “Hanukkah is the Festival of Lights, +> +> Instead of one day of presents, we get eight crazy nights.” +> +> —亚当·桑德勒,[光明节之歌][3] ### 美观胜于丑陋 -著名的《[计算机程序的构造和解释Structure and Interpretation of Computer Programs][4]》中有这么一句话:代码是写给人看的,只是恰好能让机器运行(Programs must be written for people to read and only incidentally for machines to execute.)。毕竟机器并不在乎代码的美观性,但人类在乎。 +著名的《[计算机程序的构造和解释Structure and Interpretation of Computer Programs][4]》中有这么一句话:代码是写给人看的,只是恰好能让机器运行。Programs must be written for people to read and only incidentally for machines to execute.机器并不在乎代码的美观性,但人类在乎。 阅读美观的代码对人们来说是一种享受,这就要求在整套代码中保持一致的风格。使用诸如 [Black][5]、[flake8][6]、[Pylint][7] 这一类工具能够有效地接近这一个目标。 @@ -28,7 +32,7 @@ 最后,个人的主观能动性也很重要,否则一切工具和流程都会变得毫无意义。只有意识到美观的重要性,才能主动编写出美观的代码。 -这就是为什么美观在众多原则当中排到了首位,它让“美”成为了 Python 社区的一种价值。如果有人要问,”我们真的在乎美吗?“社区会以代码给出肯定的答案。 +这就是为什么美观在众多原则当中排到了首位,它让“美”成为了 Python 社区的一种价值。如果有人要问,”我们*真的*在乎美吗?“社区会以代码给出肯定的答案。 ### 明确胜于隐晦 @@ -38,7 +42,7 @@ 这个问题已经是老生常谈了,但网络上很多流传已久的回答都是不准确的。在编写元类metaclass时,显式指定 `self` 参数就显得毫无意义。如果你没有编写过元类,希望你可以尝试一下,这是很多 Python 程序员的必经之路。 -显式指定 `self` 参数的原因并不是 Python 的设计者不想将这样的元类视为“默认”元类,而是因为第一个参数必须是显式的。 +显式指定 `self` 参数的原因并不是 Python 的设计者不想将这样的元类视为“默认”元类,而是因为第一个参数必须是*显式*的。 即使 Python 中确实允许非显式的情况存在(例如上下文变量),但我们还是应该提出疑问:某个东西是不是有存在的必要呢?如果非显式地传递参数会不会出现问题呢?有些时候,由于种种原因,这是会有问题的。总之,在写代码时一旦能够优先考虑到明确性,至少意味着能对不明确的地方提出疑问并对结果作出有效的估计。 @@ -49,7 +53,7 @@ via: https://opensource.com/article/19/12/zen-python-beauty-clarity 作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[HankChow](https://github.com/HankChow) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9204628ecff08e4cf2ebbf27887cbe9765a54c13 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Dec 2019 09:17:39 +0800 Subject: [PATCH 085/430] PUB @HankChow https://linux.cn/article-11718-1.html --- ...Why your Python code needs to be beautiful and explicit.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191222 Why your Python code needs to be beautiful and explicit.md (98%) diff --git a/translated/tech/20191222 Why your Python code needs to be beautiful and explicit.md b/published/20191222 Why your Python code needs to be beautiful and explicit.md similarity index 98% rename from translated/tech/20191222 Why your Python code needs to be beautiful and explicit.md rename to published/20191222 Why your Python code needs to be beautiful and explicit.md index 747efed262..4afb58bbb0 100644 --- a/translated/tech/20191222 Why your Python code needs to be beautiful and explicit.md +++ b/published/20191222 Why your Python code needs to be beautiful and explicit.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (HankChow) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11718-1.html) [#]: subject: (Why your Python code needs to be beautiful and explicit) [#]: via: (https://opensource.com/article/19/12/zen-python-beauty-clarity) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 8078b8159cd372419ff1357dab343d59c2918782 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Dec 2019 20:18:38 +0800 Subject: [PATCH 086/430] PRF @geekpi --- ...etro Apple desktop with the Linux MLVWM.md | 85 ++++++++----------- 1 file changed, 37 insertions(+), 48 deletions(-) diff --git a/translated/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md b/translated/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md index 6b43924213..70986e19af 100644 --- a/translated/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md +++ b/translated/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Build a retro Apple desktop with the Linux MLVWM) @@ -9,61 +9,56 @@ 使用 Linux MLVWM 打造复古苹果桌面 ====== -本文是 24 天 Linux 桌面特别系列的一部分。如果老式的苹果电脑用开源 POSIX 构建如何?你可以通过构建类 Macintosh 虚拟窗口管理器来实现。 + +> 本文是 24 天 Linux 桌面特别系列的一部分。如果老式的苹果电脑是用开源 POSIX 构建的呢?你可以通过构建 Macintosh 式的虚拟窗口管理器来实现。 + ![Person typing on a 1980's computer][1] -想象一下进入另外一个历史,Apple II GS 和 MacOS 7 是基于开源 [POSIX][2] 构建的,它使用了与现代 Linux 相同的所有约定,例如纯文本配置文件和模块化系统设计。这样的操作系统将为其用户带来什么?你可以使用[类 Macintosh 虚拟窗口管理器(MLVWM)][3]来回答这些问题(甚至更多!)。 +想象一下穿越到另一段平行历史,Apple II GS 和 MacOS 7 是基于开源 [POSIX][2] 构建的,它使用了与现代 Linux 相同的所有惯例,例如纯文本配置文件和模块化系统设计。这样的操作系统将为其用户带来什么?你可以使用 [Macintosh 式的虚拟窗口管理器(MLVWM)][3]来回答这些问题(甚至更多!)。 ![MLVWM running on Slackware 14.2][4] ### 安装 MLVWM -MLVWM 安装并不容易,并且可能不在发行版的软件仓库中。如果你有时间理解翻译不佳的 README 文件,编辑一些配置文件,收集并调整一些旧的 **.xpm**图像,编辑一两个 Xorg 选项,那么你就可以体验 MLVWM。否则,这是一个新奇的窗口管理器,其最新版本可以追溯到 2000 年。 - - -要编译 MLVWM,你必须安装 **imake**,它提供 **xmkmf** 命令。你可以从发行版的软件仓库中安装 imake,也可以直接从 [Freedesktop.org][5] 获得。假设你已经有 **xmkmf**命令,请进入包含 MLVWM 源码的目录,然后运行以下命令进行构建: +MLVWM 安装并不容易,并且可能不在你的发行版软件仓库中。如果你有时间理解翻译不佳的 README 文件,编辑一些配置文件,收集并调整一些旧的 .xpm 图片,编辑一两个 Xorg 选项,那么你就可以体验 MLVWM。不管怎么说,这是一个新奇的窗口管理器,其最新版本可以追溯到 2000 年。 +要编译 MLVWM,你必须安装 imake,它提供了 `xmkmf` 命令。你可以从发行版的软件仓库中安装 imake,也可以直接从 [Freedesktop.org][5] 获得。假设你已经有 `xmkmf` 命令,请进入包含 MLVWM 源码的目录,然后运行以下命令进行构建: ``` $ xmkmf -a $ make ``` -构建后,编译后的 **mlvwm** 二进制文件位于 **mlvwm** 目录中。将其移动到[你的 PATH ][6]的任何位置: - +构建后,编译后的 `mlvwm` 二进制文件位于 `mlvwm` 目录中。将其移动到[你的 PATH][6] 的任何位置: ``` -`$ mv mlvwm/mlvwm /usr/local/bin/` +$ mv mlvwm/mlvwm /usr/local/bin/ ``` #### 编辑配置文件 -现在已经安装 MLVWM,但是如果不调整几个配置文件并仔细排列所需的图像文件,它将无法正确启动。示例配置文件位于你下载的源代码的 **sample_rc** 目录中。将文件 **Mlvwm-Netscape** 和 **Mlvwm-Xterm** 复制到你的主目录: - +现在已经安装好 MLVWM,但是如果不调整几个配置文件并仔细放好所需的图像文件,它将无法正确启动。示例配置文件位于你下载的源代码的 `sample_rc` 目录中。将文件 `Mlvwm-Netscape` 和 `Mlvwm-Xterm` 复制到你的主目录: ``` -`$ cp sample_rc/Mlvwm-{Netscape,Xterm} $HOME` +$ cp sample_rc/Mlvwm-{Netscape,Xterm} $HOME ``` -将 **Mlvwmrc** 移动到 **$HOME/.mlvwmrc**(是的,即使示例文件的名称看似是大写字母,但你也必须使用小写的 “m”): - +将 `Mlvwmrc` 改名为 `$HOME/.mlvwmrc`(是的,即使示例文件的名称看似是大写字母,但你也必须使用小写的 “m”): ``` -`$ cp sample_rc/Mlvwmrc $HOME/.mlvwmrc` +$ cp sample_rc/Mlvwmrc $HOME/.mlvwmrc ``` -打开 **.mlwmrc** 并找到第 54-55 行,它们定义了 MLVWM 在菜单和 UI 中使用的像素图的路径(“IconPath”): - +打开 `.mlwmrc` 并找到第 54-55 行,它们定义了 MLVWM 在菜单和 UI 中使用的像素图的路径(`IconPath`): ``` # Set icon search path. It needs before "Style". IconPath /usr/local/include/X11/pixmaps:/home2/tak/bin/pixmap ``` -调整路径以匹配你填充图像的路径(我建议使用 **$HOME/.local/share/pixmaps**)。MLVWM 不提供像素图,因此需要你提供构建桌面所需图标。 - -即使你有位于系统其他位置的像素图(例如 **/usr/share/pixmaps**)),也要这样做,因为你需要调整像素图的大小,你可能也不想在系统范围内执行此操作。 +调整路径以匹配你填充图像的路径(我建议使用 `$HOME/.local/share/pixmaps`)。MLVWM 不提供像素图,因此需要你提供构建桌面所需图标。 +即使你有位于系统其他位置的像素图(例如 `/usr/share/pixmaps`),也要这样做,因为你需要调整像素图的大小,你可能也不想在系统范围内执行此操作。 ``` # Set icon search path. It needs before "Style". @@ -72,18 +67,17 @@ IconPath /home/seth/.local/share/pixmaps #### 选择像素图 -你已将 **.local/share/pixmaps** 目录定义为像素图源路径,但是该目录和图像均不存在。创建目录: - +你已将 `.local/share/pixmaps` 目录定义为像素图源路径,但是该目录和图像均不存在。创建目录: ``` -`$ mkdir -p $HOME/.local/share/pixmaps` +$ mkdir -p $HOME/.local/share/pixmaps ``` -现在,配置文件将图像分配给菜单项和 UI 元素,但是系统中不存在这些图像。要解决此问题,请通读配置文件并找到每个 **.xpm** 图像。对于配置中列出的每个图像,将具有相同文件名的图像(或更改配置文件中的文件名)添加到你的 IconPath 目录。 +现在,配置文件将图像分配给菜单项和 UI 元素,但是系统中不存在这些图像。要解决此问题,请通读配置文件并找到每个 .xpm 图像。对于配置中列出的每个图像,将具有相同文件名的图像(或更改配置文件中的文件名)添加到你的 IconPath 目录。 -**.mlvwmrc** 文件的注释很好,因此你可以大致了解要编辑的内容。无论如何,这只是第一步。你可以随时回来更改桌面外观。 +`.mlvwmrc` 文件的注释很好,因此你可以大致了解要编辑的内容。无论如何,这只是第一步。你可以随时回来更改桌面外观。 -这有些例子 +这有些例子。 此代码块设置屏幕左上角的图标: @@ -92,11 +86,10 @@ IconPath /home/seth/.local/share/pixmaps Menu Apple, Icon label1.xpm, Stick ``` -**label1.xpm** 图像实际上在源代码的 **pixmap**目录中,但我更喜欢使用来自 **/usr/share/pixmaps** 的 **Penguin.xpm**(在 Slackware 上)。无论使用什么,都必须将自定义像素图放在 **~/.local/share/pixmaps** 中,并在配置中更改像素图的名称,或者重命名像素图以匹配配置文件中当前的名称。 +`label1.xpm` 图像实际上在源代码的 `pixmap` 目录中,但我更喜欢使用来自 `/usr/share/pixmaps` 的 `Penguin.xpm`(在 Slackware 上)。无论使用什么,都必须将自定义像素图放在 `~/.local/share/pixmaps` 中,并在配置中更改像素图的名称,或者重命名像素图以匹配配置文件中当前的名称。 此代码块定义了左侧菜单中列出的应用: - ``` "About this Workstation..." NonSelect, Gray, Action About "" NonSelect @@ -106,24 +99,21 @@ Menu Apple, Icon label1.xpm, Stick END ``` -通过遵循与配置文件中相同的语法,你可以自定义像素图并将自己的应用添加到菜单中(例如,我将 **mule** 更改为 **emacs**)。 这是你在 MLVWM GUI 中打开应用的入口,因此请列出你要快速访问的所有内容。你可能还希望包括指向 **/usr/share/applications** 文件夹的快捷方式。 - +通过遵循与配置文件中相同的语法,你可以自定义像素图并将自己的应用添加到菜单中(例如,我将 `mule` 更改为 `emacs`)。这是你在 MLVWM GUI 中打开应用的入口,因此请列出你要快速访问的所有内容。你可能还希望包括指向 `/usr/share/applications` 文件夹的快捷方式。 ``` -`"Applications" Icon Penguin.xpm, Action Exec "thunar /usr/share/applications" exec thunar /usr/share/applications` +"Applications" Icon Penguin.xpm, Action Exec "thunar /usr/share/applications" exec thunar /usr/share/applications ``` 完成编辑配置文件并将自己的图像添加到 IconPath 目录后,必须将所有像素图的大小都调整为大约 16x16 像素。(MLVWM 的默认设置不一致,因此存在变化空间。)你可以使用 ImageMagick 进行批量操作: - ``` -`$ for i in ~/.local/share/mlvwm-pixmaps/*xpm ; do convert -resize '16x16^' $i; done` +$ for i in ~/.local/share/mlvwm-pixmaps/*xpm ; do convert -resize '16x16^' $i; done ``` ### 启动 MLVWM -最简单的运行 MLVWM 的方式是让 Xorg 完成大部分工作。首先,你必须创建一个 **$HOME/.xinitrc** 文件。我从 Slackware 复制了这个,它也是从 Xorg 来的: - +最简单的运行 MLVWM 的方式是让 Xorg 完成大部分工作。首先,你必须创建一个 `$HOME/.xinitrc` 文件。我从 Slackware 复制了这个,它也是从 Xorg 拿来的: ``` #!/bin/sh @@ -137,31 +127,30 @@ sysmodmap=/etc/X11/xinit/.Xmodmap # merge in defaults and keymaps if [ -f $sysresources ]; then -    xrdb -merge $sysresources + xrdb -merge $sysresources fi if [ -f $sysmodmap ]; then -    xmodmap $sysmodmap + xmodmap $sysmodmap fi if [ -f $userresources ]; then -    xrdb -merge $userresources + xrdb -merge $userresources fi if [ -f $usermodmap ]; then -    xmodmap $usermodmap + xmodmap $usermodmap fi # Start the window manager: if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then -  exec ck-launch-session /usr/local/bin/mlvwm + exec ck-launch-session /usr/local/bin/mlvwm else -  exec /usr/local/bin/mlvwm + exec /usr/local/bin/mlvwm fi ``` -根据此文件,**startx** 命令的默认操作是启动 MLVWM。但是,你的发行版可能对于图形服务器启动(或被终止重新启动)时会发生的情况有其他做法,因此此文件可能对你没有什么帮助。在许多发行版上,你可以添加 **.desktop** 文件到 **/usr/share/xsessions** 中,以将其列在 GDM 或 KDM 菜单中,因此创建名为 **mlvwm.desktop** 的文件并输入: - +根据此文件,`startx` 命令的默认操作是启动 MLVWM。但是,你的发行版可能对于图形服务器启动(或被终止以重新启动)时会发生的情况有其他做法,因此此文件可能对你没有什么帮助。在许多发行版上,你可以添加 .desktop 文件到 `/usr/share/xsessions` 中,以将其列在 GDM 或 KDM 菜单中,因此创建名为 `mlvwm.desktop` 的文件并输入: ``` [Desktop Entry] @@ -184,15 +173,15 @@ Type=Application #### 强制启动 -如果 MLVWM 无法启动,请尝试安装 XDM,这是一个轻量级会话管理器,它不会查询 **/usr/share/xsessions** 的内容,而是执行经过身份验证用户的所有 **.xinitrc** 操作。 +如果 MLVWM 无法启动,请尝试安装 XDM,这是一个轻量级会话管理器,它不会查询 `/usr/share/xsessions` 的内容,而是执行经过身份验证用户的所有 `.xinitrc` 操作。 ![MLVWM][9] ### 打造自己的复古苹果 -MLVWM 桌面未经打磨、不完美、准确且充满乐趣。你看到的许多菜单项都是未实现的,但你可以使它们变得活跃且有意义。 +MLVWM 桌面未经打磨、不完美、模仿到位且充满乐趣。你看到的许多菜单项都是未实现的,但你可以使它们变得活跃且有意义。 -这是一次让你时光倒流,改变历史,让老式苹果系列电脑成为开源堡垒的机会。成为一名修正主义者,设计你自己的复古苹果桌面,最重要的是,它有乐趣。 +这是一次让你时光倒流、改变历史,让老式苹果系列电脑成为开源堡垒的机会。成为一名修正主义者,设计你自己的复古苹果桌面,最重要的是,它有乐趣。 -------------------------------------------------------------------------------- @@ -201,7 +190,7 @@ via: https://opensource.com/article/19/12/linux-mlvwm-desktop 作者:[Seth Kenlon][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 462dee3fec9108ee85ce219237721329c1c23f10 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Dec 2019 20:50:28 +0800 Subject: [PATCH 087/430] PUB @geekpi https://linux.cn/article-11720-1.html --- ...191217 Build a retro Apple desktop with the Linux MLVWM.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191217 Build a retro Apple desktop with the Linux MLVWM.md (99%) diff --git a/translated/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md b/published/20191217 Build a retro Apple desktop with the Linux MLVWM.md similarity index 99% rename from translated/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md rename to published/20191217 Build a retro Apple desktop with the Linux MLVWM.md index 70986e19af..6aee6a3fec 100644 --- a/translated/tech/20191217 Build a retro Apple desktop with the Linux MLVWM.md +++ b/published/20191217 Build a retro Apple desktop with the Linux MLVWM.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11720-1.html) [#]: subject: (Build a retro Apple desktop with the Linux MLVWM) [#]: via: (https://opensource.com/article/19/12/linux-mlvwm-desktop) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 8542d65d3312d0e4e3ccbfb52ea089295bf9e853 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Dec 2019 21:42:58 +0800 Subject: [PATCH 088/430] PRF @chen-ni --- .../tech/20191218 How tracking pixels work.md | 67 ++++++++++++------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/translated/tech/20191218 How tracking pixels work.md b/translated/tech/20191218 How tracking pixels work.md index 9be6ed4049..4b8ba216c2 100644 --- a/translated/tech/20191218 How tracking pixels work.md +++ b/translated/tech/20191218 How tracking pixels work.md @@ -1,22 +1,24 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How tracking pixels work) [#]: via: (https://jvns.ca/blog/how-tracking-pixels-work/) [#]: author: (Julia Evans https://jvns.ca/) -追踪像素是如何工作的? +网络广告商的像素追踪是如何工作的? ====== -昨天,我和一名记者谈到了一个问题:广告商是如何在互联网上对人们进行追踪的?我们津津有味地查看了 Firefox 的开发者工具(虽然我不是一个互联网隐私专家,但至少还会使用开发者工具中的“network”标签页),从中我终于弄明白追踪像素在实际中是如何工作的了。 +![](https://img.linux.net.cn/data/attachment/album/201912/27/214125hvpv4e5ijepa0aqj.jpg) + +昨天,我和一名记者谈到了一个问题:广告商是如何在互联网上对人们进行追踪的?我们津津有味地查看了 Firefox 的开发者工具(虽然我不是一个互联网隐私专家,但至少还会使用开发者工具中的“network”标签页),从中我终于弄明白像素追踪tracking pixels在实际中是如何工作的了。 ### 问题:Facebook 怎么知道你逛了 Old Navy? 我时常听人们说起这种有些诡异的上网经历:你在线上浏览了一个商品,一天之后,竟然看到了同一款靴子(或者是别的什么你当时浏览的商品)的广告。这就是所谓的“再营销”,但它到底是如何实现的呢? -在本文中,我们来进行一个小实验,看看 Facebook 究竟是怎么知道你在线上浏览了什么商品的。这里使用 Facebook 作为示例,只是因为很容易找到投放了 Facebook 追踪像素的网站;其实,几乎所有互联网广告公司都会使用类似的追踪技术。 +在本文中,我们来进行一个小实验,看看 Facebook 究竟是怎么知道你在线上浏览了什么商品的。这里使用 Facebook 作为示例,只是因为很容易找到使用了 Facebook 像素追踪技术的网站;其实,几乎所有互联网广告公司都会使用类似的追踪技术。 ### 准备:允许第三方追踪器,同时关闭广告拦截器 @@ -24,16 +26,20 @@ 首先,我将隐私设置从默认设置([截图][1])修改为允许第三方追踪器的个性化设置([截图][2]),然后禁用了一些平时运行的隐私保护扩展。 -### 追踪像素:关键不在于 gif,而在于请求参数 +![截图][1] -追踪像素是网站用来追踪你的一个 1x1 大小的 gif。就其本身而言,一个小小的 1x1 gif 显然起不到什么作用。那么,追踪像素到底是如何进行追踪的?其中涉及两个方面: +![截图][2] - 1. 通过使用追踪像素上的**请求参数**,网站可以添加额外的信息,比如你正在访问的页面。这样一来,请求的就不是 `https://www.facebook.com/tr/`(这个链接是一个 44 字节大小的 1x1 gif),而是 `https://www.facebook.com/tr/?the_website_you're_on`。(邮件营销人员会使用类似的技巧,通过为追踪像素指定一个独特的 URL,弄清楚你是否打开了某一封邮件。) - 2. 在发送该请求的同时,还发送了相应的 cookie。这样一来广告商就可以知道,访问 oldnavy.com 的这个人和在同一台电脑上使用 Facebook 的是同一个人。 +### 像素追踪:关键不在于 gif,而在于请求参数 -### Old Navy 网站上的 Facebook 追踪像素 +像素追踪是网站用来追踪你的一个 1x1 大小的 gif。就其本身而言,一个小小的 1x1 gif 显然起不到什么作用。那么,像素追踪到底是如何进行追踪的?其中涉及两个方面: -为了对此进行验证,我在 Old Navy(GAP 旗下的一个服装品牌)网站上浏览了一个商品,相应的URL是 [https://oldnavy.gap.com/browse/product.do?pid=504753002&cid=1125694&pcid=1135640&vid=1&grid=pds_0_109_1][3](这是一件“男款短绒格子花呢大衣”)。 +1. 通过使用像素追踪上的**请求参数**,网站可以添加额外的信息,比如你正在访问的页面。这样一来,请求的就不是 `https://www.facebook.com/tr/`(这个链接是一个 44 字节大小的 1x1 gif),而是 `https://www.facebook.com/tr/?the_website_you're_on`。(邮件营销人员会使用类似的技巧,通过为像素追踪指定一个独特的 URL,弄清楚你是否打开了某一封邮件。) +2. 在发送该请求的同时,还发送了相应的 cookie。这样一来广告商就可以知道,访问 oldnavy.com 的这个人和在同一台电脑上使用 Facebook 的是同一个人。 + +### Old Navy 网站上的 Facebook 像素追踪 + +为了对此进行验证,我在 Old Navy(GAP 旗下的一个服装品牌)网站上浏览了一个商品,相应的 URL 是 `https://oldnavy.gap.com/browse/product.do?pid=504753002&cid=1125694&pcid=1135640&vid=1&grid=pds_0_109_1`(这是一件“男款短绒格子花呢大衣”)。 在我浏览这个商品的同时,页面上运行的 Javascript(用的应该是[这段代码][4])向 facebook.com 发送了一个请求。在开发者工具中,该请求看上去是这样的:(我屏蔽了大部分 cookie 值,因为其中有一些是我的登录 cookie) @@ -41,14 +47,23 @@ 下面对其进行拆解分析: - 1. 我的浏览器向 ` https://www.facebook.com/tr/?id=937725046402747&ev=PageView&dl=https%3A%2F%2Foldnavy.gap.com%2Fbrowse%2Fproduct.do%3Fpid%3D504753002%26cid%3D1125694%26pcid%3Dxxxxxx0%26vid%3D1%26grid%3Dpds_0_109_1%23pdp-page-content&rl=https%3A%2F%2Foldnavy.gap.com%2Fbrowse%2Fcategory.do%3Fcid%3D1135640%26mlink%3D5155%2Cm_mts_a&if=false&ts=1576684838096&sw=1920&sh=1080&v=2.9.15&r=stable&a=tmtealium&ec=0&o=30&fbp=fb.1.1576684798512.1946041422&it=15xxxxxxxxxx4&coo=false&rqm=GET` 发送了一个请求; - 2. 与该请求同时发送的,还有一个名为 `fr` 的 cookie,取值为 `10oGXEcKfGekg67iy.AWVdJq5MG3VLYaNjz4MTNRaU1zg.Bd-kxt.KU.F36.0.0.Bd-kx6.`(估计是我的 Facebook 广告追踪 ID) +1. 我的浏览器向如下 URL 发送了一个请求; -在所发送的追踪像素查询字符串里,有三个值得注意的地方: + ``` +https://www.facebook.com/tr/?id=937725046402747&ev=PageView&dl=https%3A%2F%2Foldnavy.gap.com%2Fbrowse%2Fproduct.do%3Fpid%3D504753002%26cid%3D1125694%26pcid%3Dxxxxxx0%26vid%3D1%26grid%3Dpds_0_109_1%23pdp-page-content&rl=https%3A%2F%2Foldnavy.gap.com%2Fbrowse%2Fcategory.do%3Fcid%3D1135640%26mlink%3D5155%2Cm_mts_a&if=false&ts=1576684838096&sw=1920&sh=1080&v=2.9.15&r=stable&a=tmtealium&ec=0&o=30&fbp=fb.1.1576684798512.1946041422&it=15xxxxxxxxxx4&coo=false&rqm=GET +``` +2. 与该请求同时发送的,还有一个名为 `fr` 的 cookie,取值为 - * 我当前访问的页面:[https://oldnavy.gap.com/browse/product.do?pid=504753002&cid=1125694&pcid=1135640&vid=1&grid=pds_0_109_1#pdp-page-content][6] - * 引导我来到当前页面的上一级页面:[https://oldnavy.gap.com/browse/category.do?cid=1135640&mlink=5155,m_mts_a][7]; - * 作为我的身份标识的 cookie:`10oGXEcKfGekg67iy.AWVdJq5MG3VLYaNjz4MTNRaU1zg.Bd-kxt.KU.F36.0.0.Bd-kx6.` + ``` +10oGXEcKfGekg67iy.AWVdJq5MG3VLYaNjz4MTNRaU1zg.Bd-kxt.KU.F36.0.0.Bd-kx6. +``` +(估计是我的 Facebook 广告追踪 ID) + +在所发送的像素追踪查询字符串里,有三个值得注意的地方: + +* 我当前访问的页面:`https://oldnavy.gap.com/browse/product.do?pid=504753002&cid=1125694&pcid=1135640&vid=1&grid=pds_0_109_1#pdp-page-content` +* 引导我来到当前页面的上一级页面:`https://oldnavy.gap.com/browse/category.do?cid=1135640&mlink=5155,m_mts_a`; +* 作为我的身份标识的 cookie:`10oGXEcKfGekg67iy.AWVdJq5MG3VLYaNjz4MTNRaU1zg.Bd-kxt.KU.F36.0.0.Bd-kx6.` ### 下面来逛逛 Facebook! @@ -60,11 +75,11 @@ Facebook 用来追踪我访问了哪些网站的 cookie,属于所谓的“第三方 cookie”,因为 Old Navy 的网站使用它为一个第三方(即 facebook.com)确认我的身份。这和用来维持登录状态的“第一方 cookie”有所不同。 -Safari 和 Firefox 默认都会拦截许多第三方 cookie(所以需要更改 Firefox 的隐私设置,才能够进行这个实验),而 Chrome 目前并不进行拦截(很可能是因为 Chrome 的所有者正是一个广告公司)。 +Safari 和 Firefox 默认都会拦截许多第三方 cookie(所以需要更改 Firefox 的隐私设置,才能够进行这个实验),而 Chrome 目前并不进行拦截(很可能是因为 Chrome 的所有者正是一个广告公司)。(LCTT 译注:Chrome 可以设置阻拦) -### 网站上的追踪像素有很多 +### 网站上的像素追踪有很多 -如我所料,网站上的追踪像素有 **很多**。比如,wrangler.com 在我的浏览器里加载了来自不同域的 19 个不同的追踪像素。wrangler.com 上的追踪像素分别来自:`ct.pinterest.com`、`af.monetate.net`、`csm.va.us.criteo.net`、`google-analytics.com`、`dpm.demdex.net`、`google.ca`、`a.tribalfusion.com`、`data.photorank.me`、`stats.g.doubleclick.net`、`vfcorp.dl.sc.omtrdc.net`、`ib.adnxs.com`、`idsync.rlcdn.com`、`p.brsrvr.com`,以及`adservice.google.com`。 +如我所料,网站上的像素追踪有 **很多**。比如,wrangler.com 在我的浏览器里加载了来自不同域的 19 个不同的像素追踪。wrangler.com 上的像素追踪分别来自:`ct.pinterest.com`、`af.monetate.net`、`csm.va.us.criteo.net`、`google-analytics.com`、`dpm.demdex.net`、`google.ca`、`a.tribalfusion.com`、`data.photorank.me`、`stats.g.doubleclick.net`、`vfcorp.dl.sc.omtrdc.net`、`ib.adnxs.com`、`idsync.rlcdn.com`、`p.brsrvr.com`,以及 `adservice.google.com`。 Firefox 贴心地指出,如果使用 Firefox 的标准隐私设置,其中的大部分追踪器都会被拦截: @@ -72,13 +87,13 @@ Firefox 贴心地指出,如果使用 Firefox 的标准隐私设置,其中的 ### 浏览器的重要性 -浏览器之所以如此重要,是因为你的浏览器最终决定了发送你的什么信息、发送到哪些网站。Old Navy 网站上的 Javascript 可以请求你的浏览器向 Facebook 发送关于你的追踪信息,但浏览器可以拒绝执行。浏览器的决定可以是:“哈,我知道 facebook.com/tr/ 是一个追踪像素,我不想让我的用户被追踪,所以我不会发送这个请求”。 +浏览器之所以如此重要,是因为你的浏览器最终决定了发送你的什么信息、发送到哪些网站。Old Navy 网站上的 Javascript 可以请求你的浏览器向 Facebook 发送关于你的追踪信息,但浏览器可以拒绝执行。浏览器的决定可以是:“哈,我知道 facebook.com/tr/ 是一个像素追踪,我不想让我的用户被追踪,所以我不会发送这个请求”。 浏览器还可以允许用户对上述行为进行配置,方法包括更改浏览器设置,以及安装浏览器扩展(所以才会有如此多的隐私保护扩展)。 ### 摸清其中原理,实为一件趣事 -在我看来,弄清楚 cookie / 追踪像素是怎么用于对你进行追踪的,实在是一件趣事(尽管显得有点阴险)。我之前大概明白其中的道理,但是并没有亲自查看过追踪像素上的 cookie,也没有看过发送的查询参数上究竟包含什么样的信息。 +在我看来,弄清楚 cookie/像素追踪是怎么用于对你进行追踪的,实在是一件趣事(尽管有点吓人)。我之前大概明白其中的道理,但是并没有亲自查看过像素追踪上的 cookie,也没有看过发送的查询参数上究竟包含什么样的信息。 当然,明白了其中的原理,也就更容易降低被追踪的概率了。 @@ -86,9 +101,9 @@ Firefox 贴心地指出,如果使用 Firefox 的标准隐私设置,其中的 为了尽量避免在互联网上被追踪,我采取了几种简单的措施: - * 安装一个广告拦截器(比如 ublock origin 之类)。广告拦截器可以针对许多追踪器的域进行拦截。 - * 使用目前默认隐私保护强度更高的 Firefox/Safari,而不是 Chrome。 - * 使用 [Facebook Container][9] 这个 Firefox 扩展。该扩展针对 Facebook 进一步采取了防止追踪的措施。 +* 安装一个广告拦截器(比如 ublock origin 之类)。广告拦截器可以针对许多追踪器的域进行拦截。 +* 使用目前默认隐私保护强度更高的 Firefox/Safari,而不是 Chrome。 +* 使用 [Facebook Container][9] 这个 Firefox 扩展。该扩展针对 Facebook 进一步采取了防止追踪的措施。 虽然在互联网上被追踪的方式还有很多(尤其是在使用手机应用的时候,因为在这种情况下,你没有和像对浏览器一样的控制程度),但是能够理解这种追踪方法的工作原理,稍微减少一些被追踪的可能性,也总归是一件好事。 @@ -98,8 +113,8 @@ via: https://jvns.ca/blog/how-tracking-pixels-work/ 作者:[Julia Evans][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/chen-ni) -校对:[校对者ID](https://github.com/校对者ID) +译者:[chen-ni](https://github.com/chen-ni) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6af316f30ce157e6f4b94e15e67b6c04f91abcd0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Dec 2019 21:43:46 +0800 Subject: [PATCH 089/430] PUB @chen-ni https://linux.cn/article-11721-1.html --- .../tech => published}/20191218 How tracking pixels work.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191218 How tracking pixels work.md (99%) diff --git a/translated/tech/20191218 How tracking pixels work.md b/published/20191218 How tracking pixels work.md similarity index 99% rename from translated/tech/20191218 How tracking pixels work.md rename to published/20191218 How tracking pixels work.md index 4b8ba216c2..5a47b5197f 100644 --- a/translated/tech/20191218 How tracking pixels work.md +++ b/published/20191218 How tracking pixels work.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11721-1.html) [#]: subject: (How tracking pixels work) [#]: via: (https://jvns.ca/blog/how-tracking-pixels-work/) [#]: author: (Julia Evans https://jvns.ca/) From d43fe702f8991a69c291add54d9d7d6c938a8296 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 28 Dec 2019 01:00:21 +0800 Subject: [PATCH 090/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191227=20Top=20?= =?UTF-8?q?CI/CD=20resources=20to=20set=20you=20up=20for=20success?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191227 Top CI-CD resources to set you up for success.md --- ...-CD resources to set you up for success.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 sources/tech/20191227 Top CI-CD resources to set you up for success.md diff --git a/sources/tech/20191227 Top CI-CD resources to set you up for success.md b/sources/tech/20191227 Top CI-CD resources to set you up for success.md new file mode 100644 index 0000000000..77d2391a5d --- /dev/null +++ b/sources/tech/20191227 Top CI-CD resources to set you up for success.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top CI/CD resources to set you up for success) +[#]: via: (https://opensource.com/article/19/12/cicd-resources) +[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) + +Top CI/CD resources to set you up for success +====== +Continuous integration and continuous deployment were key topics in 2019 +as organizations look to achieve seamless, flexible, and scalable +deployments. +![Plumbing tubes in many directions][1] + +This has been a fantastic year for continuous integration/continuous deployment (CI/CD) and the world of DevOps. Opensource.com authors shared how they're moving toward agile and scrum as they focus on seamless, flexible, and scalable deployments. Here are some of the big themes in the CI/CD articles we published this year. + +### Learning and improving your CI/CD skills + +Some of our favorite articles focus on hands-on CI/CD experience and cover a lot of ground as they do. The place to start is always with [Jenkins][2] pipelines, and Bryant Son's [_Building CI/CD pipelines with Jenkins_][3] will give you enough experience to get started building your first pipelines. Daniel Oh's [_Automate user acceptance testing with your DevOps pipeline_][4] provides great information on acceptance testing, including various CI/CD applications you can use for testing in its own right. And my article on [_Security scanning your DevOps pipeline_][5] is a very short, to the point tutorial on how to set up security in a pipeline using the Jenkins platform. + +### Delivery workflow + +While learning how to use and improve your skills with CI/CD, the workflow matters, especially when it comes to pipelines, as Jithin Emmanuel shares in [_Screwdriver: A scalable build platform for continuous delivery_][6]. Emily Burns explains having the flexibility to build exactly what you need with your CI/CD workflow in [_Why Spinnaker matters to CI/CD_][7]. And Willy-Peter Schaub extols the idea of creating a unified pipeline for everything to build consistently in [_One CI/CD pipeline per product to rule them all_][8]. These articles will give you a good sense of what happens after you onboard team members to the workflow process. + +### How CI/CD affects organizations + +2019 was also the year of recognizing CI/CD's business impact and how it affects day-to-day operations. Agnieszka Gancarczyk shares the results of Red Hat's [_Small Scale Scrum vs. Large Scale Scrum_][9] survey, including respondents' differing opinions on scrums, the agile movement, and the impact on teams. Will Kelly covers [_How continuous deployment impacts the entire organization_][10], including the importance of open communication, and Daniel Oh emphasizes the importance of metrics and observability in [_3 types of metric dashboards for DevOps teams_][11]. Last, but far from least, Ann Marie Fred's great article [_Don't test in production? Test in production!_][12] details why it's important for you to test in production—before your customers do. + +We are thankful to the many contributing authors who shared their insights with Opensource.com readers in 2019, and I look forward to learning more from them about the evolution of CI/CD in 2020. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/cicd-resources + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jrepka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/plumbing_pipes_tutorial_how_behind_scenes.png?itok=F2Z8OJV1 (Plumbing tubes in many directions) +[2]: https://jenkins.io/ +[3]: https://opensource.com/article/19/9/intro-building-cicd-pipelines-jenkins +[4]: https://opensource.com/article/19/4/devops-pipeline-acceptance-testing +[5]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline +[6]: https://opensource.com/article/19/3/screwdriver-cicd +[7]: https://opensource.com/article/19/8/why-spinnaker-matters-cicd +[8]: https://opensource.com/article/19/7/cicd-pipeline-rule-them-all +[9]: https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum +[10]: https://opensource.com/article/19/7/organizational-impact-continuous-deployment +[11]: https://opensource.com/article/19/7/dashboards-devops-teams +[12]: https://opensource.com/article/19/5/dont-test-production From 65dd7883d11294135f3d686e4b2d34b3d8961504 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 28 Dec 2019 01:01:03 +0800 Subject: [PATCH 091/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191227=20The=20?= =?UTF-8?q?importance=20of=20consistency=20in=20your=20Python=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191227 The importance of consistency in your Python code.md --- ...ance of consistency in your Python code.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20191227 The importance of consistency in your Python code.md diff --git a/sources/tech/20191227 The importance of consistency in your Python code.md b/sources/tech/20191227 The importance of consistency in your Python code.md new file mode 100644 index 0000000000..812a4df058 --- /dev/null +++ b/sources/tech/20191227 The importance of consistency in your Python code.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The importance of consistency in your Python code) +[#]: via: (https://opensource.com/article/19/12/zen-python-consistency) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +The importance of consistency in your Python code +====== +This is part of a special series about the Zen of Python focusing on the +12th, 13th, and 14th principles: the roles of ambiguity and obviousness. +![Two animated computers waving one missing an arm][1] + +The principle of least surprise is [a guideline][2] when designing user interfaces. It says that when the user performs an action, the program should do whatever would surprise the user the least. This is for the same reason kids love reading the same book over and over again: there is nothing more comforting to people than the ability to predict and have those predictions come true. + +A critical insight in the development of the [ABC language][3], Python's inspiration, was that programming languages are user interfaces and need to be designed with the same tools that UI designers use. Thankfully, since then, more languages have adopted the concepts of affordance and ergonomics from UI design, even if they apply them less strictly. + +This brings us to the next three principles in the [Zen of Python][4]. + +### In the face of ambiguity, refuse the temptation to guess. + +What should the result of **1 + "1"** be? Both **"11"** and **2** would be valid guesses. This expression is _ambiguous_: there is no single thing it can do that would not be a surprise to at least some people. + +Some languages choose to guess. In JavaScript, the result is **"11"**. In Perl, the result is **2**. In C, naturally, the result is the empty string. In the face of ambiguity, JavaScript, Perl, and C all guess. + +In Python, this raises a **TypeError**: an error that is not silent. It is atypical to catch **TypeError**: it will usually terminate the program or at least the current task (for example, in most web frameworks, it will terminate the handling of the current request). + +Python refuses to guess what **1 + "1"** means. The programmer is forced to write code with clear intention: either **1 + int("1")**, which would be **2**; or **str(1) + "1"**, which would be **"11"**; or **"1"[1:]**, which would be an empty string. By refusing to guess, Python makes programs more predictable. + +### There should be one—and preferably only one—obvious way to do it. + +Prediction also goes the other way. Given a task, can you predict the code that will be written to achieve it? It is impossible, of course, to predict perfectly. Programming, after all, is a creative task. + +However, there is no reason to intentionally provide multiple, redundant ways to achieve the same thing. There is a sense in which some solutions are "better" or "more Pythonic." + +Part of the appreciation for the Pythonic aesthetic is that it is OK to have healthy debates about which solution is better. It is even OK to disagree and keep programming. It is even OK to agree to disagree for the sake of harmony. But beneath it all, there has to be a feeling that, eventually, the right solution will come to light. There must be the hope that eventually we can live in true harmony by agreeing on the best way to achieve a goal. + +### Although that way may not be obvious at first (unless you're Dutch). + +This is an important caveat: It is often _not_ obvious, at first, what is the best way to achieve a task. Ideas are evolving. _Python_ is evolving. The best way to read a file block-by-block is, probably, to wait until Python 3.8 and use the [walrus operator][5]. + +This common task, reading a file block-by-block, did not have a "single best way to do it" for almost _30 years_ of Python's existence. + +When I started using Python in 1998 with Python 1.5.2, there was no single best way to read a file line-by-line. For many years, the best way to know if a dictionary had a key was to use **.haskey**, until the **in** operator became the best way. + +It is only by appreciating that sometimes, finding the one (and only one) way of achieving a goal can take 30 years of trying out alternatives that Python can keep aiming to find those ways. This view of history, where 30 years is an acceptable time for something to take, often feels foreign to people in the United States, when the country has existed for just over 200 years. + +The Dutch, whether it's Python creator [Guido van Rossum][6] or famous computer scientist [Edsger W. Dijkstra][7], have a different worldview according to this part of the Zen of Python. A certain European appreciation for time is essential to appreciate it. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-consistency + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_other11x_cc.png?itok=I_kCDYj0 (Two animated computers waving one missing an arm) +[2]: https://www.uxpassion.com/blog/the-principle-of-least-surprise/ +[3]: https://en.wikipedia.org/wiki/ABC_(programming_language) +[4]: https://www.python.org/dev/peps/pep-0020/ +[5]: https://www.python.org/dev/peps/pep-0572/#abstract +[6]: https://en.wikipedia.org/wiki/Guido_van_Rossum +[7]: http://en.wikipedia.org/wiki/Edsger_W._Dijkstra From 8edacd4abd6dbe74a770a0bfbc03d5c6a06af281 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 28 Dec 2019 01:01:59 +0800 Subject: [PATCH 092/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191227=2010=20r?= =?UTF-8?q?esources=20to=20boost=20your=20Git=20skills?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191227 10 resources to boost your Git skills.md --- ...7 10 resources to boost your Git skills.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/tech/20191227 10 resources to boost your Git skills.md diff --git a/sources/tech/20191227 10 resources to boost your Git skills.md b/sources/tech/20191227 10 resources to boost your Git skills.md new file mode 100644 index 0000000000..b05f363e14 --- /dev/null +++ b/sources/tech/20191227 10 resources to boost your Git skills.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 resources to boost your Git skills) +[#]: via: (https://opensource.com/article/19/12/git-resources) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) + +10 resources to boost your Git skills +====== +Wrap up the year with a review of the best in Git. Here are the top 10 +articles about surprising ways you can use Git in the new year. +![open source button on keyboard][1] + +As we near the end of 2019, it is time to look back at the top 10 articles we published about Git this year. + +These articles range from use cases and tutorials to some very interesting, if somewhat unconventional, ways to use Git. All of these articles can help you improve your Git skills, but if you really need a Git 101 introduction, be sure to check out our _[Getting started with Git: Terminology 101][2]_ article and download our [Git cheat sheet][3]. + + 1. _[How GNOME uses Git][4]_ by Molly de Blanc looks at the GNOME project’s adoption of a self-hosted GitLab instance as the GNOME project’s centralized location for contributing to GNOME. De Blanc works in a non-coding position, so her article also explores how the switch to GitLab benefits contributors whose primary role is not writing code. + + 2. Ahmad Awais’ _[Emoji-Log: A new way to write Git commit messages][5]_ explains how to use Emoji-Log, "a straightforward, open source Git commit log standard," to write better, more user-friendly, Git commit messages. The article contains an overview of the theory behind Emoji-Log and configuration examples that can be added to **.bashrc, .zshrc, or .gitconfig** to quickly start using Emoji-Log. + + 3. In _[Manage your daily schedule with Git][6]_, Seth Kenlon explains how to use Git to manage your calendar. By combining Org mode, Git, and a few other tools, Kenlon describes how to create a Git-based calendar workflow that can be synced across devices. + + 4. [_Use Git as the backend for chat_][7] by Seth Kenlon explores another unconventional way to use Git. In this article, he explores GIC, which is a chat client written in Node.js with Git functioning as the backend database. GIC is proof of concept, not something intended for production use, but it provides an interesting example of a really unique way to use Git. + + 5. Alan Formy-Duval’s _[A practical learning exercise for Git][8]_ is a chronicle of his effort to improve his Git skills. He shares his experience for others to benefit from what he learned, and Git novices will gain a lot from this excellent overview of Git’s core functionality. + + 6. _[How writers can get work done better with Git][9]_ by Seth Kenlon looks at how writers can benefit from a Git-based workflow. The article explains how to use Git and Atom to write using Markdown. By following the examples in this article, writers can easily add a complex revision control system to their writing workflow. + + 7. In _[How to use Magit to manage Git projects][10]_, Sachin Patil explains how to use Emacs’ Magit extension to manage Git repositories. The article provides clear examples of how to perform a selection of key Git tasks inside Emacs. The examples are supported by screenshots illustrating the various tasks. + + 8. _[Move your dotfiles to version control][11]_ by Matthew Broberg shows how to use Git to store the dotfiles in your home directory. Storing your dotfiles in a Git repository makes it easier to share your system configuration between computers and, if you so choose, share your configurations with others. The article does come with a warning about what not to share because sharing the wrong dotfiles can expose others. + + 9. Austin Dewey’s _[4 secrets management tools for Git encryption][12]_ compares Git-crypt, BlackBox, SOPS, and Transcrypt in this article examining tools for storing secrets in Git. The article covers four major areas: encryption types supported, the goals of each project, the projects’ workflows and differences, and other features. + + 10. _[Run a server with Git][13]_ by Seth Kenlon explains how Gitolite can be used to manage a Git server. Gitolite is "a backend application managing the fiddly bits" involved in using Git to manage a Git server. The article demonstrates how to install, configure, and use Gitolite, with clear examples detailing each step the process. + + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/git-resources + +作者:[Joshua Allen Holm][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx (open source button on keyboard) +[2]: https://opensource.com/article/19/2/git-terminology +[3]: https://opensource.com/downloads/cheat-sheet-git +[4]: https://opensource.com/article/19/10/how-gnome-uses-git +[5]: https://opensource.com/article/19/2/emoji-log-git-commit-messages +[6]: https://opensource.com/article/19/4/calendar-git +[7]: https://opensource.com/article/19/4/git-based-chat +[8]: https://opensource.com/article/19/5/practical-learning-exercise-git +[9]: https://opensource.com/article/19/4/write-git +[10]: https://opensource.com/article/19/1/how-use-magit +[11]: https://opensource.com/article/19/3/move-your-dotfiles-version-control +[12]: https://opensource.com/article/19/2/secrets-management-tools-git +[13]: https://opensource.com/article/19/4/server-administration-git From 624324d0a90eb698d13351a5727d2cd720ee5c8d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 28 Dec 2019 01:02:28 +0800 Subject: [PATCH 093/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191226=20"serve?= =?UTF-8?q?r"=20is=20hard=20to=20define?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191226 -server- is hard to define.md --- .../20191226 -server- is hard to define.md | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 sources/tech/20191226 -server- is hard to define.md diff --git a/sources/tech/20191226 -server- is hard to define.md b/sources/tech/20191226 -server- is hard to define.md new file mode 100644 index 0000000000..e53338857b --- /dev/null +++ b/sources/tech/20191226 -server- is hard to define.md @@ -0,0 +1,196 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: ("server" is hard to define) +[#]: via: (https://jvns.ca/blog/2019/12/26/whats-a-server/) +[#]: author: (Julia Evans https://jvns.ca/) + +"server" is hard to define +====== + +Somebody asked me recently what a server was, and I had a harder time explaining it than I expected! I thought I was going to be able to give some kind of simple pithy answer but it kind of got away from me. So here’s an short exploration of what the word “server” can mean: + +### a server responds to requests + +A server definitely responds to requests. A few examples: + +webserver: + +``` +Me: "please give me google.com" +Server: "here is the HTML for that webpage" +``` + +bittorrent server: + +``` +Me: "I would like this chunk of the good wife season 2" +Server: "here are some of the bytes from that .avi file!" +``` + +mail server: + +``` +Me: "can you send this email to [email protected]" +Server: "I sent it!" +``` + +But what is a server actually specifically exactly? + +### a server is a program + +My first instinct is to say “a server is a program” because for example a “the wordpress server” is a PHP program, so let’s start with that. + +A server is usually a program that listens on a **port** (like 80). For example, if we’re talking about a Rails webserver, then the program is a Ruby program that’s listening on a port for HTTP requests. + +For example, we can start a Python server to serve files out of the current directory. + +``` +$ python3 -m http.server & +Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) .. +``` + +and send requests to it with `curl`: + +``` +$ curl localhost:8000/config.yaml +baseurl: https://jvns.ca +disablePathToLower: true +languageCode: en-us +title: Julia Evans +author: Julia Evans +... +``` + +### a server might be a virtual machine + +But often when I talk about “a server” at work, I’ll use it in a sentence like “I’m going to SSH to that server to see what’s going on with it”, or “wow, that server is swapping a lot, that’s bad!“. + +So in those cases clearly I don’t mean a program when I say “that server” (you can’t ssh to a program, though the ssh server that runs on the VM is itself a program!), I mean the AWS instance that the server program is running on. That AWS instance is a virtual machine, which looks like a computer in a lot of ways (it’s running an operating system!) but it isn’t a physical computer. + +### a server might be a container + +Similarly to how your server might be a virtual machine, it could also be a container running in a virtual machine. So “the server is running out of memory” could mean “the container is running out of memory and crashing” which really means “we set a cgroup memory limit on this container and the programs in the container with that cgroup exceeded the limit so the Linux kernel OOM killed them”. + +But containers make everything a lot more complicated so I think we should stop there for now. + +### a server is a computer + +But also when you **buy** a server from Dell or some other computer company, you’re not buying a virtual machine, you’re buying an actual physical machine. + +Usually these computers are in building datacenters. For example in this video you can see thousands of servers in a Google datacenter. + +The computers in this datacenter don’t look like the computers in my house! They’re short and wide because they’re designed to fit into these giant racks of servers. For example if you search Newegg for [1U server][1] you’ll find servers that are 1 “[rack unit][2]” high, and a rack unit is 1.75 inches. There are also 2U servers which are twice as high. + +Here’s a picture of a 1U server I found on Newegg: + +![][3] + +I’ve only seen a server rack once at the [Internet Archive][4] which is in what used to be a church in San Francisco, and it was really cool to realize – wow, when I use the Wayback Machine it’s using the actual computers in this room! + +### “the server” might be 1000 computers + +Next, let’s say we’re talking about how Gmail works. You might ask “hey, when I search my email to find my boarding pass, does that happen in the frontend or on the server?”. + +The answer is “it happens on the server”, but what’s “the server” here? There’s not just one computer or program or virtual machine that searches your Gmail, there are probably lots of computers and programs at Google that are reponsible for that and they’re probably distributed across many datacenters all over the world. + +And even if we’re just talking about doing 1 search, there could easily be 20 different computers in 3 different countries involved in just running that 1 search. + +So the words “the server” in “oh yeah, that happens on the server” mean something kind of complicated here – what you’re actually saying is something “well the browser makes a request, and that request does _something_, but I’m not really going to worry about what because the important thing is just that the browser made a request and got some kind of response back.” + +### what happens when I search my email for a boarding pass? + +When I search for “boarding” in my email, the Javascript running on the frontend puts together this request. It’s mostly indecipherable but it definitely contains the word “boarding”: + +``` +{ + "1": { + "1": 79, + "2": 101, + "4": "boarding", + "5": { + "5": 0, + "12": "1577376926313", + "13": -18000000 + }, + "6": "itemlist-ViewType(79)-5", + "7": 1, + "8": 2000, + "10": 0, + "14": 1, + "16": { + "1": 1, + "2": 0, + "3": 0, + "7": 1 + }, + "19": 1 + }, + "3": { + "1": "0", + "2": 5, + "5": 1, + "6": 1, + "7": 1 + } +} +``` + +We get a response back which is large and complicated and definitely contains search results from my email about boarding passes. Here’s an excerpt: + +``` +"your electronic boarding pass. You could also be asked to display this \nmessage to airport security. * PLEASE NOTE: A printable", +"the attached boarding pass to present at the airport. Manage your booking \nBooking Details Passenger: JULIA EVANS Booking", +"Electronic boarding pass is not offered for your flight. Click the link \nbelow to access the PRINTABLE VERSION of your boarding", +"Save time at the airport Save time at the airport Web version", +"GET YOUR BOARDING PASS IN ADVANCE > You can now check in for your flight \nand you will receive a boarding pass > allowing", +"Save time at the airport Save time at the airport Web version", +"Booking Confirmation Booking Reference: xxxxxx Date of issue: xxxxxxxxxxxx \nSelect Seats eUpgrade", +"your electronic boarding pass. You could also be asked to display this \nmessage to airport security. * PLEASE NOTE: A printable", +"your electronic boarding pass. You could also be asked to display this \nmessage to airport security. * PLEASE NOTE: A printable", +"Save time at the airport Save time at the airport Web version", +"house was boarded up during the last round of bombings. I have no spatial \nimagination and cannot picture the house in three", +"Booking Confirmation Booking Reference: xxxxxx Date of issue: xxxxxxxxxxxx \nSelect Seats eUpgrade" +"required when boarding a flight to Canada. For more details, please visit \nCanada.ca/eTA . - Terms and Conditions of Sale", +"Your KLM boarding pass(s) on XXXXXX To: [image: KLM SkyTeam] Boarding \ninformation Thank you for checking in! Attached you", +"Boarding information Thank you for checking in! Attached you will find your \nboarding pass and/or other documents. Below", +"jetBlue® Your upcoming trip to SEATTLE, WA on xxxxxxxxxxx Flight status \nBaggage info Airport info TAG", +"your electronic boarding pass. You could also be asked to display this \nmessage to airport security. * PLEASE NOTE: A printable" +``` + +That request got sent to 172.217.13.197:443, which corresponds to some edge server near me. There were probably many other computers involved in searching my email than just the first one who got my request, but the nice thing about this is that we don’t need to care exactly what happened behind the scenes! The browser sent a request, and it got search results back, and it doesn’t need to know what servers. + +We can just say “it happens on the server” and not worry too much about the ambiguity of what exactly that means (until something weird goes wrong :)). + +### the meaning of “server” depends on the context + +So we’ve arrived somewhere a little bit interesting – at first when I thought about the question “what’s a server?” I really thought there was going to be a single simple answer! But it turns out that if you look at sentences where we use the word “server” it can actually refer to a lot of different things in a way that can be confusing: + + * “Let me just ssh into the server and see what’s going on” => a virtual machine (or possibly a computer) + * “I sent a SIGTERM to the server and that fixed the problem” => a program + * “Let’s look at the server code” => a program + * “Let’s buy 20 of those 2U servers” => a computer + * “We need to add more server capacity” => a program and a virtual machine probably + * “That happens on the server” => possibly some complex distributed system + + + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2019/12/26/whats-a-server/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://www.newegg.com/p/pl?d=1u+server +[2]: https://en.wikipedia.org/wiki/Rack_unit +[3]: https://c1.neweggimages.com/NeweggImage/ProductImage/11-152-136-02.jpg +[4]: https://archive.org/ From b9586be1c97ec8c378f1eb522335af7d42ff1458 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Dec 2019 08:17:17 +0800 Subject: [PATCH 094/430] PRF @geekpi --- ...in Ubuntu and Other Linux Distributions.md | 74 +++++++++---------- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/translated/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md b/translated/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md index ec3367d6ef..fab4be3462 100644 --- a/translated/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md +++ b/translated/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Start, Stop & Restart Services in Ubuntu and Other Linux Distributions) @@ -10,37 +10,33 @@ 如何在 Ubuntu 和其他 Linux 发行版中启动、停止和重启服务 ====== -服务是必不可少的后台进程,它通常随系统启动,并在关机时关闭。 +![](https://img.linux.net.cn/data/attachment/album/201912/28/081645vee5lkult55kituu.jpg) -如果你是系统管理员,那么你会定期处理服务。 - -如果你是普通桌面用户,你可能会遇到需要重启服务的情况,例如[安装 Barrier 来用于在计算机之间共享鼠标和键盘][1]。或[在使用 ufw 设置防火墙][2]时。 +服务是必不可少的后台进程,它通常随系统启动,并在关机时关闭。如果你是系统管理员,那么你会定期处理服务。如果你是普通桌面用户,你可能会遇到需要重启服务的情况,例如[安装 Barrier 来用于在计算机之间共享鼠标和键盘][1]。或[在使用 ufw 设置防火墙][2]时。 今天,我将向你展示两种管理服务的方式。你将学习在 Ubuntu 或任何其他 Linux 发行版中启动、停止和重启服务。 -systemd 与 init +> systemd 与 init +> +> 如今,Ubuntu 和许多其他发行版都使用 systemd 而不是旧的 init。 +> +> 在 systemd 中,可以使用 `systemctl` 命令管理服务。 +> +> 在 init 中,你可以使用 `service` 命令管理服务。 +> +> 你会注意到,即使你的 Linux 系统使用 systemd,它仍然可以使用 `service` 命令(与 init 系统一起使用的)。这是因为 `service` 命令实际上已重定向到 `systemctl`。systemd 引入了向后兼容性,因为系统管理员们习惯使用 `service` 命令。 +> +> 在本教程中,我将同时展示 `systemctl` 和 `service` 命令。 -如今,Ubuntu 和许多其他发行版都使用 systemd 而不是旧的 init。 - -在 systemd 中,可以使用 systemctl 命令管理服务。 - -在 init 中,你可以使用 service 命令管理服务。 - -你会注意到,即使你的 Linux 系统使用 systemd,它仍然可以使用 service 命令(为了与 init 系统一起使用)。这是因为 service 命令实际上已重定向到 systemctl。systemd 引入了向后兼容性,因为系统管理员们习惯使用 service 命令。 - -在本教程中,我将同时展示 systemctl 和 service 命令。 - -_我的是 Ubuntu 18.04,但其他版本的过程也一样_。 +我用的是 Ubuntu 18.04,但其他版本的过程也一样。 ### 方法 1:使用 systemd 在 Linux 中管理服务 我从 systemd 开始,因为它被广泛接受。 -#### 1\. 列出所有服务 +#### 1、列出所有服务 -为了管理服务,你首先需要知道系统上有哪些服务可用。 - -你可以使用 systemd 命令列出 Linux 系统上的所有服务: +为了管理服务,你首先需要知道系统上有哪些服务可用。你可以使用 systemd 的命令列出 Linux 系统上的所有服务: ``` systemctl list-unit-files --type service -all @@ -48,9 +44,9 @@ systemctl list-unit-files --type service -all ![systemctl list-unit-files][3] -此命令将输出所有服务的状态。服务状态有启用、禁用、屏蔽(在取消掩码之前处于非活动状态)、静态和已生成。 +此命令将输出所有服务的状态。服务状态有启用enabled禁用disabled屏蔽masked(在取消屏蔽之前处于非活动状态)、静态static已生成generated。 -与 [grep 命令][4] 结合,你可以**仅显示正在运行的服务**: +与 [grep 命令][4] 结合,你可以仅显示正在运行的服务: ``` sudo systemctl | grep running @@ -60,9 +56,9 @@ sudo systemctl | grep running 现在,你知道了如何引用所有不同的服务,你可以开始主动管理它们。 -**注意:** 命令中的 **<service-name>** 应该用你想管理的服务名代替。(比如:network-manager、ufw 等) +**注意:** 下列命令中的 `` 应该用你想管理的服务名代替。(比如:network-manager、ufw 等) -#### 2\. 启动服务 +#### 2、启动服务 要在 Linux 中启动服务,你只需使用它的名字: @@ -70,15 +66,15 @@ sudo systemctl | grep running systemctl start ``` -#### 3\. 停止服务 +#### 3、停止服务 -要停止 systemd 服务,可以使用 systemctl 命令的 stop 选项: +要停止 systemd 服务,可以使用 `systemctl` 命令的 `stop` 选项: ``` systemctl stop ``` -#### 4\. 重启服务 +#### 4、重启服务 要重启 systemd 服务,可以使用: @@ -86,7 +82,7 @@ systemctl stop systemctl restart ``` -#### 5\. 检查服务状态 +#### 5、检查服务状态 你可以通过打印服务状态来确认你已经成功执行特定操作: @@ -104,7 +100,7 @@ systemctl status init 的命令和 systemd 的一样简单。 -#### 1\. 列出所有服务 +#### 1、列出所有服务 要列出所有 Linux 服务,使用: @@ -114,9 +110,9 @@ service --status-all ![service –status-all][7] -前面的 **[ – ]** 代表**禁用**,**[ + ]** 代表**启用**。 +前面的 `[ – ]` 代表**禁用**,`[ + ]` 代表**启用**。 -#### 2\. 启动服务 +#### 2、启动服务 要在 Ubuntu 和其他发行版中启动服务,使用命令: @@ -124,7 +120,7 @@ service --status-all service start ``` -#### 3\. 停止服务 +#### 3、停止服务 停止服务同样简单。 @@ -132,7 +128,7 @@ service start service stop ``` -#### 4\. 重启服务 +#### 4、重启服务 如果你想重启服务,命令是: @@ -140,9 +136,9 @@ service stop service restart ``` -#### 5\. 检查服务状态 +#### 5、检查服务状态 -此外,要检查是否达到了预期的结果,你可以输出服务**状态**: +此外,要检查是否达到了预期的结果,你可以输出服务状态: ``` service status @@ -152,9 +148,9 @@ service status ![service status][8] -最重要的是,这将告诉你某项服务是否处于活跃状态(**正在运行**)。 +最重要的是,这将告诉你某项服务是否处于活跃状态(正在运行)。 -**总结** +### 总结 今天,我详细介绍了两种在 Ubuntu 或任何其他 Linux 系统上管理服务的非常简单的方法。 希望本文对你有所帮助。 @@ -167,7 +163,7 @@ via: https://itsfoss.com/start-stop-restart-services-linux/ 作者:[Sergiu][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 6b7bc4de1a625a00374d34913137c2ac83f0bfaa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Dec 2019 08:17:47 +0800 Subject: [PATCH 095/430] PUB @geekpi https://linux.cn/article-11722-1.html --- ...estart Services in Ubuntu and Other Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md (98%) diff --git a/translated/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md b/published/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md similarity index 98% rename from translated/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md rename to published/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md index fab4be3462..bcb25f74e6 100644 --- a/translated/tech/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md +++ b/published/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11722-1.html) [#]: subject: (How to Start, Stop & Restart Services in Ubuntu and Other Linux Distributions) [#]: via: (https://itsfoss.com/start-stop-restart-services-linux/) [#]: author: (Sergiu https://itsfoss.com/author/sergiu/) From 2699a2ee63d19c22dd6d7dc436e8cd707be46712 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Dec 2019 12:03:37 +0800 Subject: [PATCH 096/430] PRF --- ...Unix is turning 50. What does that mean.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/translated/tech/20191224 Unix is turning 50. What does that mean.md b/translated/tech/20191224 Unix is turning 50. What does that mean.md index f68c48ffd6..862eebb460 100644 --- a/translated/tech/20191224 Unix is turning 50. What does that mean.md +++ b/translated/tech/20191224 Unix is turning 50. What does that mean.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Unix is turning 50. What does that mean?) @@ -12,17 +12,17 @@ Unix 即将迎来 50 岁 Unix 时间(又称为“纪元时间epoch time”)是自 1970 年 1 月 1 日以来经过的秒数。当 Unix 即将 50 岁时,让我们看一下让内核开发人员担心的地方。 -[cbaquiran][1] +![](https://img.linux.net.cn/data/attachment/album/201912/28/120311hzghpxux1hp5t4xo.jpg) 对于 Unix 而言,2020 年是重要的一年。在这一年年初,Unix 进入 50 岁。 -尽管 Unix 的某些早期开发早于其“纪元”的正式开始,但 1970 年 1 月 1 日仍然是 POSIX 时间的零点,也是公认的 Unix 的万物之始。自那一刻算起,2020 年 1 月 1 日将是其 50 周年。 +尽管 Unix 的某些早期开发早于其“纪元”的正式开始,但 1970 年 1 月 1 日仍然是 POSIX 时间的零点,也是公认的 Unix 的万物之始。自那一刻算起,2020 年 1 月 1 日将是其 50 周年。(LCTT 译注:实际上,在 1971/11/3 出版的第一版《Unix 程序员手册》中,将 1971/1/1 作为 Unix 纪元的开始,并且一秒钟记录 60 个数,但是后来发现这样 32 位整型数字只能记录两年多,后来这个纪元被一再重新定义,改为从 1970/1/1 开始,每秒 1 个数。) ### Unix 时间与人类时间 就人类时间而言,50 年是很重要的。就 Unix 时间而言,50 年没有什么特别的。48.7 年同样重要。 -Unix(包括 Linux)系统将日期/时间值存储为自 1970-01-01 00:00:00 UTC 以来经过的秒数(32 位二进制)。要确定自该时间以来经过了几秒钟,看看 Unix 时间值是什么样子,你可以发出如下命令: +Unix(包括 Linux)系统将日期/时间值存储为自 1970-01-01 00:00:00 UTC 以来经过的秒数(32 位整型)。要确定自该时间以来经过了多少秒钟,看看 Unix 时间值是什么样子,你可以发出如下命令: ``` $ date +%s @@ -47,7 +47,7 @@ $ echo '2^31' | bc 2147483648 ``` -并且,由于 Unix 计数以 0 开头,这意味着我们有 2,147,483,648 个值,但最大的可能值为 2,147,483,647 个。Unix 日期/时间值不能超过该数字——就像汽车上的里程表可能不能超过 999,999 英里一样。加 1 该值就变为了 -2147483648。(LCTT 译注:此处原文描述有误,已修改。在达到最大值之后,即 2018/1/19 03:14:07,下 1 秒导致符号位变为 1,其余 31 位为 0,即 -2147483648,时间变为 1901/12/13 20:45:52,这就是 Y2K38 问题。) +并且,由于 Unix 计数以 0 开头,这意味着我们有 2,147,483,648 个值,但最大的可能值为 2,147,483,647 个。Unix 日期/时间值不能超过该数字——就像汽车上的里程表可能不能超过 999,999 英里一样。加 1 该值就变为了 -2147483648。(LCTT 译注:此处原文描述有误,已修改。在达到最大值之后,即 2038/1/19 03:14:07,下 1 秒导致符号位变为 1,其余 31 位为 0,即 -2147483648,时间变为 1901/12/13 20:45:52,这就是 Y2K38 问题。) ### 一年有多少秒? @@ -65,6 +65,8 @@ $ expr 24 \* 60 \* 60 \* 366 31622400 ``` +(LCTT 译注:Unix 时间将一天精确定义为 24 * 60 * 60 = 86400 秒,忽略闰秒。) + ### Unix 将如何庆祝其 50 岁生日? 2020 年 1 月 1 日中午 12:00 是纪元时间的 1577836800。这个计算有些棘手,但主要是因为我们必须适应闰年。自该纪元开始以来,我们经历了 12 个闰年,从 1972 年开始,到上一个闰年是 2016 年。而且,当我们达到 2020 年时,我们将有 38 个常规年份。 @@ -83,7 +85,7 @@ $ expr 31536000 \* 38 + 31622400 \* 12 1577836800 ``` -这种跟踪日期和时间的方式使 Unix 系统完全不受 Y2K 恐慌的影响,1999 年末人们开始担心进入 2000 年会对计算机系统造成严重破坏。但是实际遇到的问题比人们担心的少得多。实际上,只有以两位数格式存储年份的应用程序才会将年份变为 00,以表示时间倒退。尽管如此,许多应用程序开发人员还是做了很多额外的繁琐工作,以确保 2000 年到来时,他们的系统不会出现严重问题。 +这种跟踪日期和时间的方式使 Unix 系统完全不受 Y2K 恐慌的影响,1999 年末人们开始担心进入 2000 年会对计算机系统造成严重破坏,但是实际遇到的问题比人们担心的少得多。实际上,只有以两位数格式存储年份的应用程序才会将年份变为 00,以表示时间倒退。尽管如此,许多应用程序开发人员还是做了很多额外的繁琐工作,以确保 2000 年到来时,他们的系统不会出现严重问题。 ### Unix 时间何时会遇到问题? @@ -91,6 +93,8 @@ $ expr 31536000 \* 38 + 31622400 \* 12 2038 年的问题有时称为 Y2K38 问题。我们必须在 2038 年 1 月 19 日星期二之前解决这个问题。如果问题到时候仍未解决,则该日期之后的系统可能会认为是 1901 年。解决该问题的一种方法是切换为日期/时间信息的 64 位表示形式。有些人认为,即使那样,也会有比听起来更复杂的问题。无论如何,恐慌还为时过早。并且,与此同时,也许在新年前夜演唱了《Auld Lang Syne》之后,你可以向 Unix 唱《生日快乐》歌了。Unix 50 岁了,这仍然是大事。 +(LCTT 译注:建议阅读一下 Unix 时间的[维基百科][6]页面,有更多有趣和不为人知的信息。) + -------------------------------------------------------------------------------- via: https://www.networkworld.com/article/3511428/unix-is-turning-50-what-does-that-mean.html @@ -98,7 +102,7 @@ via: https://www.networkworld.com/article/3511428/unix-is-turning-50-what-does-t 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -109,3 +113,4 @@ via: https://www.networkworld.com/article/3511428/unix-is-turning-50-what-does-t [3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) [4]: https://www.facebook.com/NetworkWorld/ [5]: https://www.linkedin.com/company/network-world +[6]: https://en.wikipedia.org/wiki/Unix_time From 19e8014531cc3918169e33400e7db51c43cfc05f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Dec 2019 12:04:58 +0800 Subject: [PATCH 097/430] PUB @wxy https://linux.cn/article-11724-1.html --- .../20191224 Unix is turning 50. What does that mean.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191224 Unix is turning 50. What does that mean.md (98%) diff --git a/translated/tech/20191224 Unix is turning 50. What does that mean.md b/published/20191224 Unix is turning 50. What does that mean.md similarity index 98% rename from translated/tech/20191224 Unix is turning 50. What does that mean.md rename to published/20191224 Unix is turning 50. What does that mean.md index 862eebb460..948adc58bf 100644 --- a/translated/tech/20191224 Unix is turning 50. What does that mean.md +++ b/published/20191224 Unix is turning 50. What does that mean.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11724-1.html) [#]: subject: (Unix is turning 50. What does that mean?) [#]: via: (https://www.networkworld.com/article/3511428/unix-is-turning-50-what-does-that-mean.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From 7d6594f51dc98e31549d8d03206cf0474c812da2 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Sat, 28 Dec 2019 13:46:25 +0800 Subject: [PATCH 098/430] translating --- sources/tech/20191219 Kubernetes namespaces for beginners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191219 Kubernetes namespaces for beginners.md b/sources/tech/20191219 Kubernetes namespaces for beginners.md index 18839c3f4f..9813b3740f 100644 --- a/sources/tech/20191219 Kubernetes namespaces for beginners.md +++ b/sources/tech/20191219 Kubernetes namespaces for beginners.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1cc5b6dbc1279e743c4bd6807bcbab4b91217cc8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Dec 2019 18:01:07 +0800 Subject: [PATCH 099/430] PRF --- sources/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md b/sources/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md index dfa07d8896..d7f51003b6 100644 --- a/sources/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md +++ b/sources/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3c27ac9b5a8325237e65f578e96364fd85e492cd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Dec 2019 18:50:39 +0800 Subject: [PATCH 100/430] TSL --- ... Pop-_OS vs Ubuntu- Which One is Better.md | 154 ------------------ ... Pop-_OS vs Ubuntu- Which One is Better.md | 154 ++++++++++++++++++ 2 files changed, 154 insertions(+), 154 deletions(-) delete mode 100644 sources/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md create mode 100644 translated/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md diff --git a/sources/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md b/sources/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md deleted file mode 100644 index d7f51003b6..0000000000 --- a/sources/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md +++ /dev/null @@ -1,154 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Pop!_OS vs Ubuntu: Which One is Better?) -[#]: via: (https://itsfoss.com/pop-os-vs-ubuntu/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Pop!_OS vs Ubuntu: Which One is Better? -====== - -Well, you might find it easy to pick one from the list of [best Linux distributions][1]. However, it is often confusing to compare two similar Linux distros, just like Pop!_OS vs Ubuntu. - -Interestingly, Pop!_OS is based on [Ubuntu][2]. So, what is the difference between Pop!_OS and Ubuntu? Why should you choose one over other? - -In this article, I’m going to compare Pop!_OS and Ubuntu (both of which happen to be my favorites). - -**Note:** _You might find some of the points opinionated, this article is just a reference for the comparison. With constant developments and updates to Linux distros, a lot can change over time._ - -### Comparing Ubuntu and Pop!_OS - -![Pop!_OS Vs Ubuntu][3] - -Spotting the similarity helps you distinguish other differences. So, let me start noting down some of the obvious similarities. - -Like I mentioned, Pop!_OS is a Linux distribution on top of Ubuntu. So, you get all the benefits of using Ubuntu (technically the same thing at its core) when you use Pop!_OS. - -They both ship with the [GNOME desktop environment][4] by default and hence they feature a similar user interface (UI). - -Without going into all the under-the-hood differences, I will be highlighting some important ones here. - -#### User Experience & Theming - -![Pop!_OS][5] - -A lot of users think that Pop!_OS is just Ubuntu with a different skin. - -From my experience, I’ll mention that it is not entirely true. - -Yes, they both rock [GNOME desktop environment][4] – however, Pop!_OS just feels more polished. - -In addition to the look and feel, [Ubuntu customizes the GNOME experience][6] by adding a dock and a few more tricks. You might find it better if you like a customized GNOME experience. - -But, if you prefer a pure GNOME experience, Pop!_OS gives you that by default. - -I cannot convince you enough until you try it out for yourself. But, the overall color scheme, icons, and the theme that goes on in Pop!_OS is arguably more pleasing as a superior user experience. - -It can be a subjective thing – but it is what I observed. You can also check out the video tour for Ubuntu 19.10 to check it out for yourself: - -#### Ease of Installing Third-Party Apps - -![Pop Os PPA][7] - -Ubuntu puts a lot of emphasis on Snap packages. This increases the number of application it offers. - -But there are some major issues with Snap packages. They take too much of disk space and they take a lot of time to start. - -This is why I prefer using the APT version of any application. - -Why am I telling you this? - -Because Pop!_OS has its [own official PPA][8] which is enabled by default. You’ll find some useful applications like Android Studio, TensorFlow in here. No need to download a 1 GB snap package for the Android Studio. Just use [apt-get install][9] and get done with it. - -#### Pre-installed Applications - -![Ubuntu installation slideshow][10] - -It may not be the biggest deal-breaker for some but having a lot of pre-installed apps could affect the experience and performance. Even if it does not affect the performance – some users just prefer fewer pre-installed apps. - -Pop!_OS comes bundled with fewer default apps (potentially less bloatware, if I may call it that) when compared to Ubuntu. - -Yet again, this is something subjective. If you want to have more apps pre-installed, you may consider Ubuntu over Pop!_OS. - -#### Snap Package Support - -![][11] - -For users comfortable with the snap packages, Ubuntu’s software center is a slightly better solution to Pop!_OS shop because you can have snap packages listed right in your software center. - -You cannot filter the snap packages in the software center but it will be easier to install a snap package when you notice one (look at the details for the source of the app as ‘_Snap store_‘ / ‘_Snapcraft_‘) in the Software Center. - -Pop!_OS does support snap packages as well – if you’re confused. But, you won’t find them through the Pop!_OS shop, that’s the only difference here. - -If you are not sure what a snap package is and what it does, you can check out our article on [installing snap apps on Linux][12]. - -#### Separate NVIDIA/AMD ISO File - -![ISOs][13] - -Technically, it isn’t a part of the comparison internally but it is a factor that some users care for. - -So, it is worth highlighting that Pop!_OS provides separate ISOs. One for the systems with NVIDIA graphics card and another for systems with/without AMD graphics. - -With Ubuntu 19.10, you get NVIDIA drivers on the Ubuntu ISO but there is no such thing for AMD graphics. - -#### Reliability & Issues - -Unquestionably, both the [distributions are beginner-friendly][14] and quite reliable. You might want to hold on to a Long Term Support (LTS) release if you want better reliability and fewer issues. - -When a new version of Ubuntu comes up, Pop!_OS works on it and potentially fixes the issues that users encounter on Ubuntu’s original release before making the new upgrade available. This gives them a slight edge but that’s nothing substantial because those fixes eventually reach Ubuntu. - -#### Performance - -The performance will highly depend on what you have installed and the hardware configuration you install it on. - -Unless you have a super old system, both distributions seem to perform very well. - -I’m rocking an i5-7400 processor coupled with 16 Gigs of RAM (with a GTX 1050ti Graphics Card) and I find the experience good enough on both the distros. - -Of course, you could manually do a few optimization tweaks to fit your requirements – if either of them does not work out for your hardware configuration. - -But, if you want to get your hands on a System76 laptop, Pop!_OS will prove to be [the Apple of Linux space][15] because Pop!_OS has been tailored for their hardware, unlike Ubuntu. - -#### Hardware Compatibility - -This is definitely something to consider when comparing other Linux distributions. However, in this case, there’s really no significant difference. - -You might consider Pop!_OS to constantly work with newer hardware configurations because they primarily tailor the OS for their laptops with a variety of configurations. And, it’s just an observation – not a fact. - -**Wrapping Up** - -I know it’s not easy to choose one among the two popular Linux distro without trying them out. If it’s a possibility, I’ll recommend you to give them both a try while keeping this comparison for reference. - -What’s your choice between these two? Did I miss something in the comparison? Let me know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/pop-os-vs-ubuntu/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/best-linux-distributions/ -[2]: https://ubuntu.com/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/pop_os_vs_ubuntu.png?ssl=1 -[4]: https://www.gnome.org/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/pop-os-UI.jpg?ssl=1 -[6]: https://itsfoss.com/gnome-tricks-ubuntu/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/11/pop-os-ppa.jpg?ssl=1 -[8]: https://launchpad.net/~system76/+archive/ubuntu/pop/ -[9]: https://itsfoss.com/apt-get-linux-guide/ -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/install-ubuntu-linux-on-intel-nuc-14_tutorial.jpg?resize=800%2C516&ssl=1 -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/11/snapcraft.jpg?ssl=1 -[12]: https://itsfoss.com/install-snap-linux/ -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/iso-amd-nvidia-pop-os.jpg?ssl=1 -[14]: https://itsfoss.com/best-linux-beginners/ -[15]: https://www.phoronix.com/scan.php?page=news_item&px=System76-Integrated-Vision diff --git a/translated/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md b/translated/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md new file mode 100644 index 0000000000..3693d00e22 --- /dev/null +++ b/translated/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md @@ -0,0 +1,154 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Pop!_OS vs Ubuntu: Which One is Better?) +[#]: via: (https://itsfoss.com/pop-os-vs-ubuntu/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Pop!_OS 与 Ubuntu:哪个更棒? +====== + +好吧,你可能会发现从[最佳 Linux 发行版][1]列表中选择一个发行版很容易,但是,将两个类似的 Linux 发行版进行比较通常会令人困惑,就像 Pop!_OS 与 Ubuntu 一样。 + +有趣的是,Pop!\_OS 基于 [Ubuntu][2]。那么,Pop!\_OS 和 Ubuntu 之间有什么区别呢?为什么要从中选择一个呢? + +在本文中,我将比较 Pop!_OS 和 Ubuntu(两者都是我的最爱)。 + +**注意:**你可能会发现一些武断的观点,而本文只是一份比较的参考。随着 Linux 发行版的不断开发和更新,随着时间的流逝,很多事情都会改变。 + +### 比较 Ubuntu 和 Pop!_OS + +![Pop!_OS Vs Ubuntu][3] + +发现相似之处可帮助你区分其他差异之处。因此,让我们从一些明显的相似之处开始。 + +就像我提到的,Pop!\_OS 是基于 Ubuntu 之上的 Linux 发行版。因此,当你使用 Pop!_OS 时,你将获得使用 Ubuntu 的所有好处(从技术上说,其核心是一样的)。 + +它们都默认带有 [GNOME 桌面环境][4],因此它们具有相似的用户界面(UI)。 + +在不讨论所有底层差异的情况下,我将在这里重点介绍一些重要的差异。 + +#### 用户体验及主题 + +![Pop!_OS][5] + +许多用户认为 Pop!_OS 只是具有不同外观的 Ubuntu。 + +根据我的经验,我觉得这并非完全正确。 + +是的,它们俩都很喜欢 [GNOME 桌面环境][4] —— 但是,Pop!_OS 让人感觉更加优美。 + +除了外观之外,[Ubuntu 还通过添加程序坞和其他一些小花巧来定制了 GNOME 的体验][6]。如果你喜欢定制的 GNOME 体验,可能会发现它更好。 + +但是,如果你更喜欢纯粹的 GNOME 体验,默认情况下 Pop!_OS 会为你提供。 + +在你亲自尝试之前,我无法说服你。但是,Pop!_OS 中的总体配色方案、图标和主题可以说是令人愉悦的高级用户体验。 + +这可能是一个主观的事情,但这是我所观察到的。你还可以查看 Ubuntu 19.10 的视频教程,亲自感受一下。 + +#### 易于安装第三方应用 + +![Pop Os PPA][7] + +Ubuntu 非常重视 Snap 软件包。这增加了它提供的应用程序的数量。 + +但是 Snap 软件包存在一些重要的问题。它们占用了过多的磁盘空间,并且启动要花费大量的时间。 + +这就是为什么我更喜欢使用应用程序的 APT 版本的原因。 + +我为什么要说这个呢? + +因为 Pop!_OS 具有其[自己的官方 PPA][8],并在默认情况下已启用。你会在此处找到一些有用的应用程序,例如 Android Studio、TensorFlow。无需下载 Android Studio 的 1GB 大的 Snap 程序包。只需使用 [apt-get install][9]就可以了。 + +#### 预装应用 + +![Ubuntu installation slideshow][10] + +对于某些人来说,它可能不是最大的问题,但是拥有大量预安装的应用程序可能会影响体验和性能。即使不影响性能,某些用户也只喜欢较少的预装应用程序。 + +与 Ubuntu 相比,Pop!_OS 捆绑了更少的默认应用程序(潜在地减少了胖软件)。 + +再一次提醒,这是主观的看法。如果你希望预安装更多应用程序,则可以考虑使用 Ubuntu 而不是 Pop!_OS。 + +#### Snap 软件包支持 + +![][11] + +对于熟悉 Snap 程序包的用户来说,Ubuntu 的软件中心是比 Pop!_OS 商店更好的解决方案,因为你可以在软件中心中列出快照程序包。 + +你无法在软件中心中过滤快照包,但是当你在软件中心中发现一个 Snap 包(查看应用程序来源的详细信息为“ Snap store ”/“Snapcraft”)时安装它就更容易了。 + +如果你感到困惑,Pop!\_OS 也确实支持快照包。但是,你不会在 Pop!_OS 商店中找到它们,这是唯一的区别。 + +如果不确定什么是 Snap 软件包及其功能,可以查看我们的文章[在 Linux 上安装 Snap 应用][12]。 + +#### 单独的 NVIDIA/AMD ISO 文件 + +![ISOs][13] + +从技术上讲,它不是内部比较的一部分,而是某些用户关心的一个因素。 + +因此,值得强调的是 Pop!_OS 提供了单独的 ISO。一个用于带 NVIDIA 显卡的系统,另一个用于带/不带 AMD 显卡的系统。 + +使用 Ubuntu 19.10,你可以在 Ubuntu ISO 上获得 NVIDIA 驱动程序,但 AMD 显卡没有这个。 + +#### 可靠性与问题 + +毫无疑问,这两个[发行版都适合初学者][14],并且相当可靠。如果你想要更好的可靠性和更少的问题,则可能希望一直用长期支持(LTS)版本。 + +当出现新版本的 Ubuntu 时,Pop!_OS 将在其上开发,并有可能解决用户在 Ubuntu 原始发行版上遇到的问题,然后再进行新的升级。这给他们带来了一点优势,但这没什么实质性的不同,因为这些修复最终都可以运用于 Ubuntu。 + +#### 性能 + +性能将高度取决于你所安装的内容以及所安装的硬件配置。 + +除非你有一个超级旧的系统,否则这两个发行版似乎都表现良好。 + +我的机器是 i5-7400 处理器和 16GB 的 RAM(带有 GTX 1050ti 显卡),我发现两种发行版上的体验都足够好。 + +当然,你可以手动进行一些优化调整以满足要求——无论它们中的哪个不满足你的硬件配置。 + +但是,如果你想使用 System76 笔记本电脑,那么 Pop!\_OS 将可以证明自己是 [Linux 领域的苹果][15],因为 Pop!_OS 是针对其硬件量身定制的,与 Ubuntu 有所不同。 + +#### 硬件兼容性 + +在比较其他 Linux 发行版时,这绝对是要考虑的事情。但是,在这种情况下,实际上并没有太大的区别。 + +你可能会考虑 Pop!_OS 一直在使用较新的硬件配置,因为他们主要是为他们的笔记本电脑量身定制具有各种配置的 OS。而且,这只是一个观察,而不是事实。 + +### 结语 + +我知道在不亲自尝试的情况下从两个流行的 Linux 发行版中选择一个并不容易。如果可能的话,我建议你在进行比较的同时尝试两者,以供参考。 + +你在这两者之间有何选择?我在比较中错过了什么吗?在下面的评论中让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/pop-os-vs-ubuntu/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-linux-distributions/ +[2]: https://ubuntu.com/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/pop_os_vs_ubuntu.png?ssl=1 +[4]: https://www.gnome.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/pop-os-UI.jpg?ssl=1 +[6]: https://itsfoss.com/gnome-tricks-ubuntu/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/11/pop-os-ppa.jpg?ssl=1 +[8]: https://launchpad.net/~system76/+archive/ubuntu/pop/ +[9]: https://itsfoss.com/apt-get-linux-guide/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/install-ubuntu-linux-on-intel-nuc-14_tutorial.jpg?resize=800%2C516&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/11/snapcraft.jpg?ssl=1 +[12]: https://itsfoss.com/install-snap-linux/ +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/iso-amd-nvidia-pop-os.jpg?ssl=1 +[14]: https://itsfoss.com/best-linux-beginners/ +[15]: https://www.phoronix.com/scan.php?page=news_item&px=System76-Integrated-Vision From cfec9bfa5b459aa4deccc4410a774a4e06d2b3b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Sat, 28 Dec 2019 19:16:55 +0800 Subject: [PATCH 101/430] Translated --- ...on Ubuntu and Other Linux Distributions.md | 127 ------------------ ...on Ubuntu and Other Linux Distributions.md | 127 ++++++++++++++++++ 2 files changed, 127 insertions(+), 127 deletions(-) delete mode 100644 sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md create mode 100644 translated/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md b/sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md deleted file mode 100644 index 870ec17f6b..0000000000 --- a/sources/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md +++ /dev/null @@ -1,127 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Update Grub on Ubuntu and Other Linux Distributions) -[#]: via: (https://itsfoss.com/update-grub/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Update Grub on Ubuntu and Other Linux Distributions -====== - -In this tutorial, you’ll learn to update grub on Ubuntu or any other Linux distribution. You’ll also learn a thing or two about how this grub update process works. - -### How to update grub - -Ubuntu and many other Linux distributions provide a handy command line utility called update-grub. - -To update grub, all you have to do is to run this command in the terminal with sudo. - -``` -sudo update-grub -``` - -You should see an output like this: - -``` -[email protected]:~$ sudo update-grub -[sudo] password for abhishek: -Sourcing file `/etc/default/grub' -Generating grub configuration file ... -Found linux image: /boot/vmlinuz-5.0.0-37-generic -Found initrd image: /boot/initrd.img-5.0.0-37-generic -Found linux image: /boot/vmlinuz-5.0.0-36-generic -Found initrd image: /boot/initrd.img-5.0.0-36-generic -Found linux image: /boot/vmlinuz-5.0.0-31-generic -Found initrd image: /boot/initrd.img-5.0.0-31-generic -Found Ubuntu 19.10 (19.10) on /dev/sda4 -Found MX 19 patito feo (19) on /dev/sdb1 -Adding boot menu entry for EFI firmware configuration -done -``` - -You may see a similar command called update-grub2. No need to be alarmed or confused between update-grub and update-grub2. Both of these commands do the same action. - -Around ten years ago, when grub2 was just introduced, update-grub2 command was also introduced. Today, update-grub2 is just a symbolic link to update-grub and both update grub2 configuration (because grub2 is the default). - -#### Can’t find update-grub command? Here’s what to do in that case - -It’s possible that your Linux distribution might not have update-grub command available. - -What do you do in that case? How do you update grub on such a Linux distribution? - -There is no need to panic. The update-grub command is simply a stub for running ‘grub-mkconfig -o /boot/grub/grub.cfg’ to generate grub2 config file. - -Which means that you can update grub with the following command on any Linux distribution: - -``` -sudo grub-mkconfig -o /boot/grub/grub.cfg -``` - -Of course, remembering update-grub command is a lot easier than the above command and this is the reason why it was created in the first place. - -### How does update-grub work? - -When you install a Linux distribution, it (usually) asks you to install the [grub boot loader][1]. - -Part of grub is installed on the MBR/ESP partition. Rest of the grub lies in /boo/grub directory of the Linux distributions. - -As per its [man page][2], update-grub works by looking into the /boot directory. All the files starting with [vmlinuz-][3] will be treated as kernels and they will get a grub menu entry. It will also add initrd lines for [ramdisk][4] images found with the same version as kernels found. - -It also looks into all disk partitions for other operating systems with [os-prober][5]. If it finds other operating systems, it adds them to the grub menu. - -![Representational image of Grub Menu][6] - -### Why would you need to update grub? - -There could be a number of scenarios when you need to update grub. - -Suppose you changed the grub config file (/etc/default/grub) to [change the default boot order][7] or reduce the default boot time. Your changes won’t take into effect unless you update the grub. - -Another scenario is when you have multiple Linux distributions installed on the same system. - -For example, on my Intel NUC, I have two disks. The first disk had Ubuntu 19.10 and then I installed Ubuntu 18.04 on it. The second OS (Ubuntu 18.04) also installed its own grub and now the grub screen is controlled by Ubuntu 18.04 grub. - -On the second disk, I installed MX Linux but I didn’t install grub this time. I want the existing grub (controlled by Ubuntu 18.04) to handle all the OS entries. - -Now, in this scenario, the grub on Ubuntu 18.04 needs to be updated so that it can see [MX Linux][8]. - -![][9] - -As you can see in the image above, when I update the grub, it finds various Linux kernels installed on 18.04 along with Ubuntu 19.10 and MX Linux on different partition. - -If I want MX Linux to control the grub, I can install grub on MX Linux with [grub-install][10] command and then the grub on MX Linux will start controlling the grub screen. You get the gist, right? - -Using a GUI tool like [Grub Customizer][11] is a simpler way to make changes in grub. - -**In the end…** - -Initially, I had intended to keep it a short article as a quick tip. But then I thought of explaining a few things associated with it so that (relatively) new Linux users could learn more than just a simple command. - -Did you like it? Do you have some questions or suggestions? Please feel free to leave a comment. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/update-grub/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/GNU_GRUB -[2]: https://manpages.debian.org/testing/grub-legacy/update-grub.8.en.html -[3]: https://www.ibm.com/developerworks/community/blogs/mhhaque/entry/anatomy_of_the_initrd_and_vmlinuz?lang=en -[4]: https://en.wikipedia.org/wiki/Initial_ramdisk -[5]: https://packages.debian.org/sid/utils/os-prober -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/grub_screen.png?ssl=1 -[7]: https://itsfoss.com/grub-customizer-ubuntu/ -[8]: https://mxlinux.org/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/update_grub.png?ssl=1 -[10]: https://www.gnu.org/software/grub/manual/grub/html_node/Installing-GRUB-using-grub_002dinstall.html -[11]: https://itsfoss.com/customize-grub-linux/ diff --git a/translated/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md b/translated/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..25c811519d --- /dev/null +++ b/translated/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Update Grub on Ubuntu and Other Linux Distributions) +[#]: via: (https://itsfoss.com/update-grub/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Ubuntu 和其它 Linux 发行版上更新 Grub +====== + +在这篇文章中,你将学习在 Ubuntu 或任何其它 Linux 发行版上更新 grub 。你也将学习一个或两个关于如何更新这个 grub 过程的工作的事情。 + +### 如何更新 grub + +Ubuntu 和很多其它的 Linux 发行版提供一个易使用的称为 update-grub 命令行实用程序。 + +为更新 grub ,你所要的全部工作就是使用 sudo 在终端中运行这个命令。 + +``` +sudo update-grub +``` + +你应该看到一个像这样的输出: + +``` +[email protected]:~$ sudo update-grub +[sudo] password for abhishek: +Sourcing file `/etc/default/grub' +Generating grub configuration file ... +Found linux image: /boot/vmlinuz-5.0.0-37-generic +Found initrd image: /boot/initrd.img-5.0.0-37-generic +Found linux image: /boot/vmlinuz-5.0.0-36-generic +Found initrd image: /boot/initrd.img-5.0.0-36-generic +Found linux image: /boot/vmlinuz-5.0.0-31-generic +Found initrd image: /boot/initrd.img-5.0.0-31-generic +Found Ubuntu 19.10 (19.10) on /dev/sda4 +Found MX 19 patito feo (19) on /dev/sdb1 +Adding boot menu entry for EFI firmware configuration +done +``` + +你可能看到一个类似的称为 update-grub2 的命令。不需要在 update-grub 和 update-grub2 之间感到害怕或不知所措。这两个命令执行相同的动作。 + +大约在10年前,当 grub2 刚刚被引进时,update-grub2 命令也被引进。现在,update-grub2 只是一个链接到 update-grub 的符号,它们都更新 grub2 配置(因为 grub2 是默认的)。 + +#### 不能找到 update-grub 命令?这里是在这种情况下该做什么 + +它可能是,你的 Linux 发行版可能没有可用的 update-grub 命令。 + +在这种情况下你该做什么?你如何在这样一个 Linux 发行版上更新 grub ? + +在这里不需要惊慌。update-grub 命令只是一个存根,用于运行 ‘grub-mkconfig -o /boot/grub/grub.cfg’ 来生成 grub2 配置文件。 + +这意味着你可以在任意 Linux 发行版上使用下面的命令更新 grub : + +``` +sudo grub-mkconfig -o /boot/grub/grub.cfg +``` + +当然,记住 update-grub 命令比上面的命令容易很多,这是为什么它在一开始被创建的原因。 + +### update-grub 是如何工作的? + +当你安装一个 Linux 发行版时,它(通常)要求你安装 [grub 启动引导程序][1]。 + +grub 的一部分安装在 MBR/ESP 分区上。grub 的剩余部分保留在 Linux 发行版的 /boo/grub 目录中。 + +依据它的 [man 页面][2],update-grub 通过查找 /boot 目录来工作。所有以 [vmlinuz-][3] 开头的文件将被作为内核来对待,并且它们将得到一个 grub 菜单项。它也将为与所找到内核版本相同的 [ramdisk][4] 镜像添加 initrd 行。 + +它也使用 [os-prober][5] 为其它操作系统查找所有磁盘分区。如果找到其它操作系统,它添加它们到 grub 菜单。 + +![Representational image of Grub Menu][6] + +### 为什么你需要更新 grub ? + +当你需要更新 grub 时,可能有很多方案。 + +假设你更改 grub 配置文件 (/etc/default/grub) 为 [更改默认启动顺序][7] 或减少默认启动时间。除非你更新 grub ,否则你的更改将不会生效。 + +另一种情况是,你在同一个电脑系统上安装多个 Linux 发行。 + +例如,在我的 Intel NUC 上,我有两个磁盘。第一个磁盘有 Ubuntu 19.10 ,并且我在其上面安装了 Ubuntu 18.04 。第二个操作系统 (Ubuntu 18.04) 也安装其自己的 grub ,现在 grub 启动屏幕由 Ubuntu 18.04 grub 控制。 + +在第二个磁盘上,我安装了 MX Linux ,但是这次我没有安装 grub 。我希望现有的 grub (由 Ubuntu 18.04 控制) 来处理所有的操作系统项目。 + +现在,在这种情况中,在 Ubuntu 18.04 上的 grub 需要更新,以便它能够看到 [MX Linux][8] 。 + +![][9] + +如上图所示,当我更新 grub 时,它在 18.04 上找到很多安装的 Linux 内核, 以及在不同的分区上 Ubntu 19.10 和 MX Linux 。 + +如果你想 MX Linux 控制 grub ,我可以使用 [grub-install][10] 命令来在 MX Linux 上安装 grub,然后在 MX Linux 上的 grub 将开始控制 grub 启动屏幕。你已经明白这点,对吧? + +Using a GUI tool like使用一个像 [Grub Customizer][11] 的 GUI 工具是在 grub 中进行更改的一种简单的方法。 + +**最后…** + +最初,我打算保持它为一篇短文作为一种快速提示。但是后来我想解释一些与之相关的东西,以便(相对地)新的 Linux 用户能够学到更多,而不仅仅是一个简单命令。 + +你喜欢它吗?你有一些问题或建议吗?请随意发表评论。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/update-grub/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/GNU_GRUB +[2]: https://manpages.debian.org/testing/grub-legacy/update-grub.8.en.html +[3]: https://www.ibm.com/developerworks/community/blogs/mhhaque/entry/anatomy_of_the_initrd_and_vmlinuz?lang=en +[4]: https://en.wikipedia.org/wiki/Initial_ramdisk +[5]: https://packages.debian.org/sid/utils/os-prober +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/grub_screen.png?ssl=1 +[7]: https://itsfoss.com/grub-customizer-ubuntu/ +[8]: https://mxlinux.org/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/update_grub.png?ssl=1 +[10]: https://www.gnu.org/software/grub/manual/grub/html_node/Installing-GRUB-using-grub_002dinstall.html +[11]: https://itsfoss.com/customize-grub-linux/ From 52e259ed9070b8d42ecbda3388f188b9f072511d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Dec 2019 00:53:49 +0800 Subject: [PATCH 102/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191228=20Most-r?= =?UTF-8?q?ead=20open=20source=20news=20stories=20of=202019?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191228 Most-read open source news stories of 2019.md --- ...t-read open source news stories of 2019.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/tech/20191228 Most-read open source news stories of 2019.md diff --git a/sources/tech/20191228 Most-read open source news stories of 2019.md b/sources/tech/20191228 Most-read open source news stories of 2019.md new file mode 100644 index 0000000000..6c5955bc84 --- /dev/null +++ b/sources/tech/20191228 Most-read open source news stories of 2019.md @@ -0,0 +1,90 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Most-read open source news stories of 2019) +[#]: via: (https://opensource.com/article/19/12/open-source-news) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +Most-read open source news stories of 2019 +====== +Here are some of the big news items from the year and a look at the +future of open source. +![Radio wave.][1] + +A great deal happened in the world of open source in 2019. Once upon a time, you would have been hard-pressed to find news about Linux, free software, and open source software outside of a small handful of specialist publications. Today, though, news about open source is everywhere; the online edition of Forbes even has its own [Linux columnist][2]. + +We regularly round up many of the most interesting and topical news articles in [fortnightly articles][3]. Of those, we’ve compiled the top 10 most read (by you, our readers) stories we curated during 2019. + +### Google's trusted hardware project + +Many of us take the security of our software seriously but, at the same time, take the security of our hardware for granted. How do we know if the hardware we’re using is secure and trusted? To help ensure that it is, Google [announced OpenTitan][4], a secure, open source chip design project. The project builds upon a chip that Google developed called Titan, and the search giant has recruited several hardware manufacturers to join this initiative. + +### Database makers embrace open source licenses + +Over the last 18 months or so, several open source database firms moved to less open licenses for the software they develop in an attempt to stay competitive in a tough market. Cloudera and YugaByte, however, went in the opposite direction in 2019. Cloudera put the proprietary portions of its products under the umbrella of the [AGPL and Apache 2.0 licenses][5], while YugaByte [announced it was adopting][6] the Apache 2.0 license for its wares. + +### GNOME and KDE agree to work together + +It’s always great when two rivals put aside their differences to work for a greater good; especially when that greater good is the further advancement of the Linux desktop. That’s what happened when the GNOME Foundation and KDE [announced they were going to work together][7]. The goal is to bring the GNOME and KDE communities together "to build an application ecosystem that transcends individual distros and broadens the market for everyone." + +### System76 announces Linux laptops with Coreboot firmware + +While there are several small companies selling Linux-powered computers, not all components of those computers are open source. That’s especially true for their firmware. Computer maker System76 is trying to change that. The company announced that it will [ship two of its most popular laptops][8] with the lightweight Coreboot open source firmware. According to Forbes Online, by adopting Coreboot (which helps computers start faster) System76 is taking another step in "the company’s steady march toward offering open source software and hardware." + +### Open source platform spans the globe to help local communities + +Open source knows no borders. Proof of that is at the St. Francis Neighborhood Center in West Baltimore, which [adopted the Lutèce platform][9] to help deliver its programs and services. While Lutèce was developed in France and runs services in French cities like Paris, Lyon, and Marseille, the implementation in West Baltimore is the first time the platform has been used outside of its country of origin. + +### Australian government uses open source to build notification platform + +When Australia’s Digital Transformation Agency (DTA) need to quickly deploy an email and text message notification system, it turned to software developed by the Government Digital Service in the UK. The result was a platform called Notify. Using existing software enabled the DTA to [get the platform up and running][10] in eight weeks. Notify is now being used by over 100 government departments across the country. + +### Dutch city to further embrace open source + +Like many cities in Europe, Nijmegen in the eastern part of the Netherlands has long been an advocate of using open source in government. Unfortunately, the city’s procurement processes still favored proprietary solutions. That’s starting to change, thanks to a [resolution passed in 2019][11] which requires the city to "deploy both the mandatory and the recommended open standards listed by the Dutch Standardisation Forum." The municipal government hopes that the resolution will spur wider use of open source software to avoid vendor lock-in. + +### Acquia buys Mautic + +Acquia, the company behind the popular open source content management system Drupal, took a big step in its ambition to create the first "open digital experience platform" by acquiring open source marketing automation firm Mautic. The idea behind the acquisition is to give companies that use Acquia’s offerings "the freedom they need to own their digital destiny without the constraint of vendor lock-in." + +### Mozilla Labs makes a return + +A few years ago, Mozilla had seemed to abandoned Mozilla Labs. Labs, you might remember, was the home of various beta features for Firefox that users could test drive. In early 2019, Mozilla [brought Labs back][12] with more experimental goodness. The new edition of Mozilla Labs is aimed at sharing ways to expand the capabilities of Firefox. It also showcases technologies that make it easier for anyone interact with virtual reality and the Internet of Things. + +### Making it easier to announce software's end of life + +Like many things, older versions of software have a use-by date - a date after which it won’t be supported or be compatible with its supporting software or operating systems. That information often gets buried on a project’s website. That’s where [endoflife.date][13] comes in. It’s a repository of information that "aims to overcome the complexity of end of life (EOL) announcements for software." + +### Predictions for 2020 + +What Linux and open source projects and news do you predict being big stories in 2020? Let us know about them in the comments, or send a story proposal to [open@opensource.com][14]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/open-source-news + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/news-radio-wave-lead_520.png?itok=J86HG1Vg (Radio wave.) +[2]: https://opensource.com/article/19/9/found-linux-video-gaming +[3]: https://opensource.com/tags/news +[4]: https://techcrunch.com/2019/11/05/google-opentitan-secure-chip/ +[5]: https://www.cbronline.com/news/cloudera-open-source +[6]: http://www.dbta.com/Editorial/News-Flashes/YugaByte-Becomes-100-percent-Open-Source-Under-Apache-20-License-133083.aspx +[7]: https://www.zdnet.com/article/gnome-and-kde-work-together-on-the-linux-desktop/ +[8]: https://www.forbes.com/sites/jasonevangelho/2019/10/10/system76-will-begin-shipping-2-linux-laptops-with-coreboot-based-open-source-firmware/#3c5fb7294e64 +[9]: https://technical.ly/baltimore/2019/04/19/paris-lutece-open-source-platform-city-services-west-baltimore-community-center-st-francis/ +[10]: https://www.zdnet.com/article/open-source-notify-gov-au-delivered-in-eight-weeks-for-a-cost-of-au150k/ +[11]: https://joinup.ec.europa.eu/collection/open-source-observatory-osor/news/not-having-choose +[12]: https://betanews.com/2018/12/28/mozilla-labs-is-back/ +[13]: https://endoflife.date/ +[14]: mailto:open@opensource.com From 553938366dd2747aba247815acdc729262a8b5f6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Dec 2019 10:37:23 +0800 Subject: [PATCH 103/430] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @XLCYun 许久不见啊! --- .../20190711 DevOps for introverted people.md | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/translated/tech/20190711 DevOps for introverted people.md b/translated/tech/20190711 DevOps for introverted people.md index 8422b1fb87..5873f488b9 100644 --- a/translated/tech/20190711 DevOps for introverted people.md +++ b/translated/tech/20190711 DevOps for introverted people.md @@ -1,19 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (XLCYun) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (DevOps for introverted people) [#]: via: (https://opensource.com/article/19/7/devops-introverted-people) -[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg/users/don-watkins/users/shawnhcorey/users/mbbroberg/users/marcobravo) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg) 内向者的 DevOps ====== -我们邀请 Opensource.com 的 DevOps 团队,希望他们能够谈一谈作为 DevOps 内向者的休验,同时给 DevOps 外向者一些建议。下面是他们的回答。 -![问答][1] +> 我们邀请 Opensource.com 的 DevOps 团队,希望他们能够谈一谈作为 DevOps 内向者的休验,同时给 DevOps 外向者一些建议。下面是他们的回答。 -我们请求我们的 [DevOps 团队][2] 谈一谈他们作为一个内向者的体验,并给外向者们一些建议。但是在我们开始了解他们的回答之前,让我们先来定义一下这些词汇。 +![](https://img.linux.net.cn/data/attachment/album/201912/29/103642jmzt6t6mggjjx5yt.jpg) + +我们邀请我们的 [DevOps 团队][2] 谈一谈他们作为一个内向者的体验,并给外向者们一些建议。但是在我们开始了解他们的回答之前,让我们先来定义一下这些词汇。 ### “内向者”是什么意思? @@ -25,27 +26,27 @@ ### DevOps 技术主管可以通过哪些方式来让内向者感觉他们是团队的一部分并且愿意分享他们的想法? -“每个人都会不大一样,所以观察敏锐就很重要了。从 GitLab 过来的一个人告诉我,他们的哲学就是如果他们没有提供任何意见,那么他们就是被排除在外的。如果有人在一个会议上没有提供任何的意见,那就想办法让他们加入进来。**当我知道一个内向者对我们将要讨论的会议论题感兴趣的时候,我会提前请他写一些书面文本。有非常多的会议其实是可以避免的,只要通过把讨论放到 Slack 或者 GitLab 上就行了,内向者会更愿意参与进来**。在站立会议中,每个人都会交代最新的进展,在这个环境下,内向者表现得很好。有时候我们在其实会议上会重复做一些事情,仅仅是为了保证每个人都有时间发言。我同时也会鼓励内向者在工作小组或者社区小组面前发言,以此来锻炼他们的这些技能。—— 丹·巴克 +“每个人都会不大一样,所以观察敏锐就很重要了。从 GitLab 过来的一个人告诉我,他们的哲学就是如果他们没有提供任何意见,那么他们就是被排除在外的。如果有人在一个会议上没有提供任何的意见,那就想办法让他们加入进来。**当我知道一个内向者对我们将要讨论的会议论题感兴趣的时候,我会提前请他写一些书面文本。有非常多的会议其实是可以避免的,只要通过把讨论放到 Slack 或者 GitLab 上就行了,内向者会更愿意参与进来**。在站立会议中,每个人都会交代最新的进展,在这个环境下,内向者表现得很好。有时候我们在其实会议上会重复做一些事情,仅仅是为了保证每个人都有时间发言。我同时也会鼓励内向者在工作小组或者社区小组面前发言,以此来锻炼他们的这些技能。”—— 丹·巴克 -“**我觉得别人对我做的最好的事情,就是他们保证了当重大问题来临的时候,我拥有必要的技能去回答它**。彼时,我作为一名非常年轻的入伍空军的一员,我需要给我们部队的高级领导做状态简报的汇报。我必须在任何时候都有一些可用的数据点,以及在实现我们确立的目标的过程中,产生延误以及偏差的背后的原因。那样的经历推动着我从一个“幕后人员”逐渐变得更加愿意和别人分享自己的观点和想法。 +“**我觉得别人对我做的最好的事情,就是他们保证了当重大问题来临的时候,我拥有必要的技能去回答它**。彼时,我作为一名非常年轻的入伍空军的一员,我需要给我们部队的高级领导做状态简报的汇报。我必须在任何时候都有一些可用的数据点,以及在实现我们确立的目标的过程中,产生延误以及偏差的背后的原因。那样的经历推动着我从一个‘幕后人员’逐渐变得更加愿意和别人分享自己的观点和想法。”—— 克里斯·肖特 -“**通过文化去领导。为你的同僚一起设计和尝试仪式。**你可以为给你的小组或团队设计一个小的每周仪式,甚至给你的部门或组织设计一个年度的大仪式。它的意义在于去尝试一些事物,并观察你在其中的领导角色。去找到你们文化当中的代沟以及对立。回顾团队的信仰和行为。你能从哪里观察到对立?你们的文化中缺失了什么?从一个小陈述开始‘我从 X 和 Y 之间看到了对立’,或者‘我的团队缺少了 Z’。接着,将代沟与对立转换为问题:写下三个‘我们如何能……(How might we's, HMWs)’。”——凯瑟琳·路易斯 +“**通过文化去领导。为你的同僚一起设计和尝试仪式。**你可以为给你的小组或团队设计一个小的每周仪式,甚至给你的部门或组织设计一个年度的大仪式。它的意义在于去尝试一些事物,并观察你在其中的领导角色。去找到你们文化当中的代沟以及对立。回顾团队的信仰和行为。你能从哪里观察到对立?你们的文化中缺失了什么?从一个小陈述开始‘我从 X 和 Y 之间看到了对立’,或者‘我的团队缺少了 Z’。接着,将代沟与对立转换为问题:写下三个‘我们如何能……(How might we's, HMWs)’。”—— 凯瑟琳·路易斯 “内向者不是一个不同的群体,他们要么是在分享他们的想法之前想得太多或等得太久的一些人,要么就是一些根本不知道发生了什么的人。我就是第一种,我想太多了,有时候还担心我的意见会被其他人嘲笑,或者没有什么意思,或者想偏了。形成那样的思维方式很难,但它同时也在吞噬着我学习更好事物的机会。有一次,我们团队在讨论一个实现问题。我当时的老大一次又一次地问我,为什么我没有作为团队中更具经验的人参与进来,然后我就(集齐了全宇宙的力量之后)开口说我想说的大家都已经说过了。他说,有时候我可以重复说一次,事情纷繁,如果你能够重复一遍你的想法,即使它已经被讨论过了,也会大有裨益。好吧,虽然它不是一种特别信服的方式,但是我知道了至少有人想听听我怎么说,它给了我一点信心。 -“现在,我所使用的让团队中的人发言的方法是**我经常向内向的人求助,即使我知道解决方法,并且在团队会议和讨论中感谢他们来建立他们的自信心,通过给他们时间让他们一点一点的从他们寡言的本性中走出来,从而跟团队分享很多的知识**。他们在外面的世界中可能仍然会有一点点孤立,但是在团队里面,有些会成为我们可以信赖的人。——阿布希什克·塔姆拉卡尔 +“现在,我所使用的让团队中的人发言的方法是**我经常向内向的人求助,即使我知道解决方法,并且在团队会议和讨论中感谢他们来建立他们的自信心,通过给他们时间让他们一点一点的从他们寡言的本性中走出来,从而跟团队分享很多的知识**。他们在外面的世界中可能仍然会有一点点孤立,但是在团队里面,有些会成为我们可以信赖的人。”—— 阿布希什克·塔姆拉卡尔 -“我给参加会议的内向者的建议是,找一个同样要参加会议的朋友或者同事,这样到时你就会有人可以跟你一起舒服地交谈,在会议开始之前,提前跟其他的与会者(朋友,行业联系人,前同事等等)约着见个面或者吃顿饭,**要注意你的疲劳程度,并且照顾好自己**:如果你需要重新恢复能量,就跳过那些社交或者夜晚的活动,在事后回顾中记录一下自己的感受。”——伊丽莎白·约瑟夫 +“我给参加会议的内向者的建议是,找一个同样要参加会议的朋友或者同事,这样到时你就会有人可以跟你一起舒服地交谈,在会议开始之前,提前跟其他的与会者(朋友、行业联系人、前同事等等)约着见个面或者吃顿饭,**要注意你的疲劳程度,并且照顾好自己**:如果你需要重新恢复能量,就跳过那些社交或者夜晚的活动,在事后回顾中记录一下自己的感受。”—— 伊丽莎白·约瑟夫 ### 和一个内向者倾向的同事一起工作时,有什么提高生产效率的小建议? -“在保证质量时,生产效率会越来越具备挑战性。在大多数时候,工作中的一个小憩或者轻松随意的交谈,可能正是我们的创造性活动中需要的一个火花。再说一次,我发现当你的团队中有内向者时, Slack 和 Github 会是一个非常有用的用于交换想法以及和其他人互动的媒介。**我同时也发现,结对编程对于大部分的内向者也非常有用,虽然一对一的交流对于他们来说,并不像交税那么频繁,但是生产质量和效率的提升却是重大的**。但是,当一个内向者在独自工作的时间,团队中的所有人都不应该去打断他们。最好是发个邮件,或者使用没有那么强的侵入性的媒介。——丹·巴克 +“在保证质量时,生产效率会越来越具备挑战性。在大多数时候,工作中的一个小憩或者轻松随意的交谈,可能正是我们的创造性活动中需要的一个火花。再说一次,我发现当你的团队中有内向者时, Slack 和 Github 会是一个非常有用的用于交换想法以及和其他人互动的媒介。**我同时也发现,结对编程对于大部分的内向者也非常有用,虽然一对一的交流对于他们来说,并不像交税那么频繁,但是生产质量和效率的提升却是重大的**。但是,当一个内向者在独自工作的时间,团队中的所有人都不应该去打断他们。最好是发个邮件,或者使用没有那么强的侵入性的媒介。”—— 丹·巴克 -“给他们趁手的工具,让他们工作并归档他们的工作。**让他们能够在他们的工作上做到最好**。要足够经常地去检查一下,保证他们没有走偏路,但是要记住,相比外向者而言,这样做是更大的一种让人分心的困扰。 +“给他们趁手的工具,让他们工作并归档他们的工作。**让他们能够在他们的工作上做到最好**。要足够经常地去检查一下,保证他们没有走偏路,但是要记住,相比外向者而言,这样做是更大的一种让人分心的困扰。”—— 克里斯·肖特 -“**当我低着头的时候,不要打断我。真的,别打断我**!当我沉浸在某件事物中时,这样做会造成我至少需要花费两个小时,才能让我的大脑重新回到之前的状态。感觉很痛苦。真的。你可以发个邮件让我去有白板的地方。然后从客户的角度而不是你的角度——通过画图的方式——分享下有什么问题。要知道,可能同时会有十几个客户问题缠绕在我的脑海中,如果你的问题听起来就是“这样子做会让我在我的领导面前显得很好”的那一类问题,那么相比我脑袋中已经有的真正的客户问题而言,它不会得到更多的关注的。画个图,给我点时间思考。当我准备分享我的看法的时候,保证有多支马克笔可以使用。准备好接受你对问题的假设有可能完全是错误的。”——凯瑟琳·路易斯 +“**当我低着头的时候,不要打断我。真的,别打断我!**当我沉浸在某件事物中时,这样做会造成我至少需要花费两个小时,才能让我的大脑重新回到之前的状态。感觉很痛苦。真的。你可以发个邮件让我去有白板的地方。然后从客户的角度而不是你的角度——通过画图的方式——分享下有什么问题。要知道,可能同时会有十几个客户问题缠绕在我的脑海中,如果你的问题听起来就是‘这样子做会让我在我的领导面前显得很好’的那一类问题,那么相比我脑袋中已经有的真正的客户问题而言,它不会得到更多的关注的。画个图,给我点时间思考。当我准备分享我的看法的时候,保证有多支马克笔可以使用。准备好接受你对问题的假设有可能完全是错误的。”—— 凯瑟琳·路易斯 -“感谢和鼓励就是解决的方法,感谢可能不是一份工作评估,但是感谢能让人舒服地感受到自己并不仅仅是一个活着的独立实体,**因而每个人都能够感觉到自己是被倾听的,而不是被嘲笑或者低估的**。”——阿布希什克·塔姆拉卡尔 +“感谢和鼓励就是解决的方法,感谢可能不是一份工作评估,但是感谢能让人舒服地感受到自己并不仅仅是一个活着的独立实体,**因而每个人都能够感觉到自己是被倾听的,而不是被嘲笑或者低估的**。”—— 阿布希什克·塔姆拉卡尔 ### 结语 @@ -53,16 +54,16 @@ -------------------------------------------------------------------------------- -转载自: https://opensource.com/article/19/7/devops-introverted-people +via: https://opensource.com/article/19/7/devops-introverted-people 作者:[Matthew Broberg][a] 选题:[lujun9972][b] 译者:[XLCYun](https://github.com/XLCYun) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]: https://opensource.com/users/mbbroberg/users/don-watkins/users/shawnhcorey/users/mbbroberg/users/marcobravo +[a]: https://opensource.com/users/mbbroberg [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_QandAorange_520x292_0311LL.png?itok=qa3hHSou (Q and A letters) [2]: https://opensource.com/devops-team From 3a17956117e75661800d26da02b617fcd724e00f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Dec 2019 10:37:55 +0800 Subject: [PATCH 104/430] PUB @XLCYun https://linux.cn/article-11725-1.html --- .../20190711 DevOps for introverted people.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190711 DevOps for introverted people.md (99%) diff --git a/translated/tech/20190711 DevOps for introverted people.md b/published/20190711 DevOps for introverted people.md similarity index 99% rename from translated/tech/20190711 DevOps for introverted people.md rename to published/20190711 DevOps for introverted people.md index 5873f488b9..e18b27da4f 100644 --- a/translated/tech/20190711 DevOps for introverted people.md +++ b/published/20190711 DevOps for introverted people.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (XLCYun) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11725-1.html) [#]: subject: (DevOps for introverted people) [#]: via: (https://opensource.com/article/19/7/devops-introverted-people) [#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg) From 6893ebbb01f3808c20a20880b9950338cadd1442 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Dec 2019 11:02:32 +0800 Subject: [PATCH 105/430] PRF @robsean --- ...on Ubuntu and Other Linux Distributions.md | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/translated/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md b/translated/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md index 25c811519d..8c8925feab 100644 --- a/translated/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md +++ b/translated/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md @@ -1,22 +1,24 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Update Grub on Ubuntu and Other Linux Distributions) [#]: via: (https://itsfoss.com/update-grub/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何在 Ubuntu 和其它 Linux 发行版上更新 Grub +如何在 Ubuntu 和其它 Linux 发行版上更新 grub ====== -在这篇文章中,你将学习在 Ubuntu 或任何其它 Linux 发行版上更新 grub 。你也将学习一个或两个关于如何更新这个 grub 过程的工作的事情。 +![](https://img.linux.net.cn/data/attachment/album/201912/29/110155d51bhogs5ezp5p71.png) + +在这篇文章中,你将学习在 Ubuntu 或任何其它 Linux 发行版上更新 grub 。你也将学习一个或两个关于更新这个 grub 过程如何工作的事情。 ### 如何更新 grub -Ubuntu 和很多其它的 Linux 发行版提供一个易使用的称为 update-grub 命令行实用程序。 +Ubuntu 和很多其它的 Linux 发行版提供一个易使用的称为 `update-grub` 命令行实用程序。 -为更新 grub ,你所要的全部工作就是使用 sudo 在终端中运行这个命令。 +为更新 grub ,你所要的全部工作就是使用 `sudo` 在终端中运行这个命令。 ``` sudo update-grub @@ -41,17 +43,17 @@ Adding boot menu entry for EFI firmware configuration done ``` -你可能看到一个类似的称为 update-grub2 的命令。不需要在 update-grub 和 update-grub2 之间感到害怕或不知所措。这两个命令执行相同的动作。 +你可能看到一个类似的称为 `update-grub2` 的命令。不需要在 `update-grub` 和 `update-grub2` 之间感到害怕或不知所措。这两个命令执行相同的动作。 -大约在10年前,当 grub2 刚刚被引进时,update-grub2 命令也被引进。现在,update-grub2 只是一个链接到 update-grub 的符号,它们都更新 grub2 配置(因为 grub2 是默认的)。 +大约在 10 年前,当 grub2 刚刚被引进时,`update-grub2` 命令也被引进。现在,`update-grub2` 只是一个链接到 `update-grub` 的符号,它们都更新 grub2 配置(因为 grub2 是默认的)。 #### 不能找到 update-grub 命令?这里是在这种情况下该做什么 -它可能是,你的 Linux 发行版可能没有可用的 update-grub 命令。 +它可能是,你的 Linux 发行版可能没有可用的 `update-grub` 命令。 在这种情况下你该做什么?你如何在这样一个 Linux 发行版上更新 grub ? -在这里不需要惊慌。update-grub 命令只是一个存根,用于运行 ‘grub-mkconfig -o /boot/grub/grub.cfg’ 来生成 grub2 配置文件。 +在这里不需要惊慌。`update-grub` 命令只是一个入口,用于运行 `grub-mkconfig -o /boot/grub/grub.cfg` 来生成 grub2 配置文件。 这意味着你可以在任意 Linux 发行版上使用下面的命令更新 grub : @@ -59,15 +61,15 @@ done sudo grub-mkconfig -o /boot/grub/grub.cfg ``` -当然,记住 update-grub 命令比上面的命令容易很多,这是为什么它在一开始被创建的原因。 +当然,记住 `update-grub` 命令比上面的命令容易很多,这是为什么它在一开始被创建的原因。 ### update-grub 是如何工作的? -当你安装一个 Linux 发行版时,它(通常)要求你安装 [grub 启动引导程序][1]。 +当你安装一个 Linux 发行版时,它(通常)要求你安装 [grub 启动引导程序][1]。 -grub 的一部分安装在 MBR/ESP 分区上。grub 的剩余部分保留在 Linux 发行版的 /boo/grub 目录中。 +grub 的一部分安装在 MBR/ESP 分区上。grub 的剩余部分保留在 Linux 发行版的 `/boot/grub` 目录中。 -依据它的 [man 页面][2],update-grub 通过查找 /boot 目录来工作。所有以 [vmlinuz-][3] 开头的文件将被作为内核来对待,并且它们将得到一个 grub 菜单项。它也将为与所找到内核版本相同的 [ramdisk][4] 镜像添加 initrd 行。 +依据它的 [man 页面][2],`update-grub` 通过查找 `/boot` 目录来工作。所有以 [vmlinuz-][3] 开头的文件将被作为内核来对待,并且它们将得到一个 grub 菜单项。它也将为与所找到内核版本相同的 [ramdisk][4] 镜像添加 initrd 行。 它也使用 [os-prober][5] 为其它操作系统查找所有磁盘分区。如果找到其它操作系统,它添加它们到 grub 菜单。 @@ -75,15 +77,15 @@ grub 的一部分安装在 MBR/ESP 分区上。grub 的剩余部分保留在 Lin ### 为什么你需要更新 grub ? -当你需要更新 grub 时,可能有很多方案。 +在有很多场景下你需要更新 grub。 -假设你更改 grub 配置文件 (/etc/default/grub) 为 [更改默认启动顺序][7] 或减少默认启动时间。除非你更新 grub ,否则你的更改将不会生效。 +假设你修改 grub 配置文件(`/etc/default/grub`)以 [更改默认启动顺序][7] 或减少默认启动时间。除非你更新 grub ,否则你的修改将不会生效。 -另一种情况是,你在同一个电脑系统上安装多个 Linux 发行。 +另一种情况是,你在同一个电脑系统上安装多个 Linux 发行版。 -例如,在我的 Intel NUC 上,我有两个磁盘。第一个磁盘有 Ubuntu 19.10 ,并且我在其上面安装了 Ubuntu 18.04 。第二个操作系统 (Ubuntu 18.04) 也安装其自己的 grub ,现在 grub 启动屏幕由 Ubuntu 18.04 grub 控制。 +例如,在我的 Intel NUC 上,我有两个磁盘。第一个磁盘有 Ubuntu 19.10 ,并且我在其上面安装了 Ubuntu 18.04 。第二个操作系统(Ubuntu 18.04)安装了其自己的 grub ,现在 grub 启动屏幕由 Ubuntu 18.04 grub 控制。 -在第二个磁盘上,我安装了 MX Linux ,但是这次我没有安装 grub 。我希望现有的 grub (由 Ubuntu 18.04 控制) 来处理所有的操作系统项目。 +在第二个磁盘上,我安装了 MX Linux ,但是这次我没有安装 grub。我希望现有的 grub(由 Ubuntu 18.04 控制)来处理所有的操作系统项目。 现在,在这种情况中,在 Ubuntu 18.04 上的 grub 需要更新,以便它能够看到 [MX Linux][8] 。 @@ -91,13 +93,13 @@ grub 的一部分安装在 MBR/ESP 分区上。grub 的剩余部分保留在 Lin 如上图所示,当我更新 grub 时,它在 18.04 上找到很多安装的 Linux 内核, 以及在不同的分区上 Ubntu 19.10 和 MX Linux 。 -如果你想 MX Linux 控制 grub ,我可以使用 [grub-install][10] 命令来在 MX Linux 上安装 grub,然后在 MX Linux 上的 grub 将开始控制 grub 启动屏幕。你已经明白这点,对吧? +如果你想让 MX Linux 控制 grub ,我可以使用 [grub-install][10] 命令来在 MX Linux 上安装 grub,然后在 MX Linux 上的 grub 将开始控制 grub 启动屏幕。你已经明白这点,对吧? -Using a GUI tool like使用一个像 [Grub Customizer][11] 的 GUI 工具是在 grub 中进行更改的一种简单的方法。 +使用一个像 [Grub Customizer][11] 的 GUI 工具是在 grub 中进行更改的一种简单的方法。 -**最后…** +### 最后… -最初,我打算保持它为一篇短文作为一种快速提示。但是后来我想解释一些与之相关的东西,以便(相对地)新的 Linux 用户能够学到更多,而不仅仅是一个简单命令。 +最初,我打算保持它为一篇短文作为一种快速提示。但是后来我想解释一些与之相关的东西,以便(相对)新的 Linux 用户能够学到更多,而不仅仅是一个简单命令。 你喜欢它吗?你有一些问题或建议吗?请随意发表评论。 @@ -108,7 +110,7 @@ via: https://itsfoss.com/update-grub/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 22403789b8a59d50c516f193960e2c5ae8d31ffb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Dec 2019 11:03:06 +0800 Subject: [PATCH 106/430] PUB @robsean https://linux.cn/article-11726-1.html --- ... to Update Grub on Ubuntu and Other Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md (98%) diff --git a/translated/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md b/published/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md similarity index 98% rename from translated/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md rename to published/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md index 8c8925feab..c422b4d808 100644 --- a/translated/tech/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md +++ b/published/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11726-1.html) [#]: subject: (How to Update Grub on Ubuntu and Other Linux Distributions) [#]: via: (https://itsfoss.com/update-grub/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 7c26ead27eae79daea3b2b46b71485b238d6c0a1 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Sun, 29 Dec 2019 11:36:32 +0800 Subject: [PATCH 107/430] translated --- ...219 Kubernetes namespaces for beginners.md | 192 ------------------ ...219 Kubernetes namespaces for beginners.md | 189 +++++++++++++++++ 2 files changed, 189 insertions(+), 192 deletions(-) delete mode 100644 sources/tech/20191219 Kubernetes namespaces for beginners.md create mode 100644 translated/tech/20191219 Kubernetes namespaces for beginners.md diff --git a/sources/tech/20191219 Kubernetes namespaces for beginners.md b/sources/tech/20191219 Kubernetes namespaces for beginners.md deleted file mode 100644 index 9813b3740f..0000000000 --- a/sources/tech/20191219 Kubernetes namespaces for beginners.md +++ /dev/null @@ -1,192 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Kubernetes namespaces for beginners) -[#]: via: (https://opensource.com/article/19/12/kubernetes-namespaces) -[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) - -Kubernetes namespaces for beginners -====== -What is a namespace and why do you need it? -![Ship captain sailing the Kubernetes seas][1] - -What is in a Kubernetes namespace? As Shakespeare once wrote, which we call a namespace, by any other name, would still be a virtual cluster. By virtual cluster, I mean Kubernetes can offer multiple Kubernetes clusters on a single cluster, much like a virtual machine is an abstraction of its host. According to the [Kubernetes docs][2]: - -> Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces. - -Why do you need to use namespaces? In one word: isolation. - -Isolation has many advantages, including that it supports secure and clean environments. If you are the owner of the infrastructure and are supporting developers, isolation is fairly important. The last thing you need is someone who is unfamiliar with how your cluster is built going and changing the system configuration—and possibly disabling everyone's ability to log in. - -### The namespaces that start it all - -The first three namespaces created in a cluster are always **default**, **kube-system**, and **kube-public**. While you can technically deploy within these namespaces, I recommend leaving these for system configuration and not for your projects.  - - * **Default** is for deployments that are not given a namespace, which is a quick way to create a mess that will be hard to clean up if you do too many deployments without the proper information. I leave this alone because it serves that one purpose and has confused me on more than one occasion. - * **Kube-system** is for all things relating to, you guessed it, the Kubernetes system. Any deployments to this namespace are playing a dangerous game and can accidentally cause irreparable damage to the system itself. Yes, I have done it; I do not recommend it. - * **Kube-public** is readable by everyone, but the namespace is reserved for system usage. - - - -### Using namespaces for isolation - -I have used namespaces for isolation in a couple of ways. I use them most often to split many users' projects into separate environments. This is useful in preventing cross-project contamination since namespaces provide independent environments. Users can install multiple versions of Jenkins, for example, and their environmental variables won't collide if they are in different namespaces. - -This separation also helps with cleanup. If development groups are working on various projects that suddenly become obsolete, you can delete the namespace and remove everything in one swift movement with **kubectl delete ns <$NAMESPACENAME>**. (Please make sure it's the right namespace. I deleted the wrong one in production once, and it's not pretty.) - -Be aware that this can cause damage across teams and problems for you if you are the infrastructure owner. For example, if you create a namespace with some special, extra-secure DNS functions and the wrong person deletes it, all of your pods and their running applications will be removed with the namespace. Any use of **delete** should be reviewed by a peer (through [GitOps][3]) before hitting the cluster. - -While the official documentation suggests not using multiple namespaces [with 10 or fewer users][2], I still use them in my own cluster for architectural purposes. The cleaner the cluster, the better. - -### What admins need to know about namespaces - -For starters, namespaces cannot be nested in other namespaces. There can be only one namespace with deployments in it. You don't have to use namespaces for versioned projects, but you can always use the labels to separate versioned apps with the same name. Namespaces divide resources between users using resource quotas; for example, _this namespace can only have x_ _number_ _of nodes_. Finally, all namespaces scope down to a unique name for the resource type. - -### Namespace commands in action - -To try out the following namespace commands, you need to have [Minikube][4], [Helm][5], and the [kubectl][6] command line installed. For information about installing them, see my article [_Security scanning your DevOps pipeline_][7] or each project's homepage. I am using the most recent release of Minikube. The manual installation is fast and has consistently worked correctly the first time. - -To get your first set of namespaces: - - -``` -jess@Athena:~$ kubectl get namespace -NAME            STATUS   AGE -default         Active   5m23s -kube-public     Active   5m24s -kube-system     Active   5m24s -``` - -To create a namespace: - - -``` -jess@Athena:~$ kubectl create namespace athena -namespace/athena created -``` - -Now developers can deploy to the namespace you created; for example, here's a small and easy Helm chart: - - -``` -jess@Athena:~$ helm install teset-deploy stable/redis --namespace athena -NAME: teset-deploy -LAST DEPLOYED: Sat Nov 23 13:47:43 2019 -NAMESPACE: athena -STATUS: deployed -REVISION: 1 -TEST SUITE: None -NOTES: -** Please be patient while the chart is being deployed ** -Redis can be accessed via port 6379 on the following DNS names from within your cluster: - -teset-deploy-redis-master.athena.svc.cluster.local for read/write operations -teset-deploy-redis-slave.athena.svc.cluster.local for read-only operations -``` - -To get your password: - - -``` -`export REDIS_PASSWORD=$(kubectl get secret --namespace athena teset-deploy-redis -o jsonpath="{.data.redis-password}" | base64 --decode)` -``` - -To connect to your Redis server: - - 1. Run a Redis pod that you can use as a client: [code] kubectl run --namespace athena teset-deploy-redis-client --rm --tty -i --restart='Never' \ -        --env REDIS_PASSWORD=$REDIS_PASSWORD \ -\--image docker.io/bitnami/redis:5.0.7-debian-9-r0 -- bash -``` - 2. Connect using the Redis CLI: [code] redis-cli -h teset-deploy-redis-master -a $REDIS_PASSWORD -redis-cli -h teset-deploy-redis-slave -a $REDIS_PASSWORD -``` - - - -To connect to your database from outside the cluster: - - -``` -kubectl port-forward --namespace athena svc/teset-deploy-redis-master 6379:6379 & -redis-cli -h 127.0.0.1 -p 6379 -a $REDIS_PASSWORD -``` - -Now that this deployment is out, you have a chart deployed in your namespace named **test-deploy**. - -To look at what pods are in your namespace: - - -``` -jess@Athena:~$ kubectl get pods --namespace athena -NAME                            READY   STATUS  RESTARTS   AGE -teset-deploy-redis-master-0   1/1       Running   0             2m38s -teset-deploy-redis-slave-0      1/1     Running   0             2m38s -teset-deploy-redis-slave-1      1/1     Running   0             90s -``` - -At this point, you have officially isolated your application to a single namespace and created one virtual cluster that talks internally only to itself. - -Delete everything with a single command: - - -``` -jess@Athena:~$ kubectl delete namespace athena -namespace "athena" deleted -``` - -Because this deletes the application's entire internal configuration, the delete may take some time, depending on how large your deployment is. - -Double-check that everything has been removed: - - -``` -jess@Athena:~$ kubectl get pods --all-namespaces -NAMESPACE       NAME                            READY   STATUS  RESTARTS   AGE -kube-system   coredns-5644d7b6d9-4vxv6          1/1     Running   0             32m -kube-system   coredns-5644d7b6d9-t5wn7          1/1     Running   0             32m -kube-system   etcd-minikube                     1/1     Running   0             31m -kube-system   kube-addon-manager-minikube       1/1     Running   0             32m -kube-system   kube-apiserver-minikube           1/1     Running   0             31m -kube-system   kube-controller-manager-minikube  1/1     Running   0             31m -kube-system   kube-proxy-5tdmh                  1/1     Running   0             32m -kube-system   kube-scheduler-minikube           1/1     Running   0             31m -kube-system   storage-provisioner               1/1     Running   0             27m -``` - -This is a list of all the pods and all the known namespaces where they live. As you can see, the application and namespace you previously made are now gone. - -### Namespaces in practice - -I currently use namespaces for security purposes, including reducing the privileges of users with limitations. You can limit everything—from which roles can access a namespace to their quota levels for cluster resources, like CPUs. For example, I use resource quotas and role-based access control (RBAC) configurations to confirm that a namespace is accessible only by the appropriate service accounts. - -On the isolation side of security, I don't want my home Jenkins application to be accessible over a trusted local network as secure images that have public IP addresses (and thus, I have to assume, could be compromised). - -Namespaces can also be helpful for budgeting purposes if you have a hard budget on how much you can use in your cloud platform for nodes (or, in my case, how much I can deploy before [segfaulting][8] my home server). Although this is out of scope for this article, and it's complicated, it is worth researching and taking advantage of to prevent overextending your cluster. - -### Conclusion - -Namespaces are a great way to isolate projects and applications. This is just a quick introduction to the topic, so I encourage you to do more advanced research on namespaces and use them more in your work. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/kubernetes-namespaces - -作者:[Jessica Cherry][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jrepka -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) -[2]: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ -[3]: https://www.weave.works/blog/gitops-operations-by-pull-request -[4]: https://kubernetes.io/docs/tasks/tools/install-minikube/ -[5]: https://helm.sh/ -[6]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ -[7]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline -[8]: https://en.wikipedia.org/wiki/Segmentation_fault diff --git a/translated/tech/20191219 Kubernetes namespaces for beginners.md b/translated/tech/20191219 Kubernetes namespaces for beginners.md new file mode 100644 index 0000000000..5c1f6267b0 --- /dev/null +++ b/translated/tech/20191219 Kubernetes namespaces for beginners.md @@ -0,0 +1,189 @@ +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Kubernetes namespaces for beginners) +[#]: via: (https://opensource.com/article/19/12/kubernetes-namespaces) +[#]: author: (Jessica Cherry https://opensource.com/users/jrepka) + +Kubernetes 命名空间入门 +====== +命名空间是什么?你为什么需要它? +![Ship captain sailing the Kubernetes seas][1] + +kubernetes 命名空间是什么?Shakespeare 以前写过,我们声称的命名空间,或者任何其他名字,仍是一个虚拟集群。命名空间,意味着 kubernetes 可以在单个集群上提供多个 kubernetes 的集群,类似一个对其主机进行抽象的虚拟机。[kubernetes 文档][2] 中的解释: + +> kubernetes 在一个物理集群上提供了多个虚拟集群。这些虚拟集群被称为命名空间。 + +你为什么需要命名空间?一句话概括:隔离。 + +隔离有很多优点,如它提供了安全和干净的环境。如果你是基础设施的所属者,并且为开发者提供环境,隔离就相当重要。你最不需要的就是,一个不熟悉你集群是如何搭建的人去修改系统配置 — 这可能导致所有人都无法登录。 + +### 初始命名空间 + + 一个集群的三个初始命名空间:**default**、**kube-system** 和 **kube-public**。虽然你可以用这三个命名空间作技术部署,但我还是推荐你把这三个命名空间留作系统配置用,而不是你的项目。 + + * **Default** 某些部署没有指明命名空间,这样部署可以快速创建一个网格,但如果做了很多错误信息的部署,就很能去清理。我不去修改它,因为它在为某一个目的服务时,会在不止一种情况下误导我。 + * **Kube-system** 系统相关的所有对象组成的命名空间。任何此命名空间的部署都可能是危险的操作,可能对系统本身造成不可挽回的破坏。没错,我试过;所以我不推荐。 + * **Kube-public** 所有人可读,但是这个命名空间是为系统保留的。 + +### 用命名空间来实现隔离 + +我用了多种方式通过命名空间来实现隔离。我经常用命名空间来把多个用户项目分割到不同的环境。这种方式可以有效防止跨项目的污染,因为命名空间提供了独立的环境。例如,使用者可以安装不同版本的 Jenkins,如果它们的环境变量是在不同的命名空间,就不会冲突。 + +这种隔离对于清理也很有帮助。如果部署组的多个项目被废弃,你可以用命令 `kubectl delete ns <$NAMESPACENAME>` 一键删除命名空间,清理命名空间内的所有东西。(请确认被删除的是正确的命名空间。我曾经在生产环境删除了错误的命名空间,这很不好。) + +如果你是基础设施所有者,请谨慎操作,因为这可能会引发其他团队的的故障或引发其他问题。例如,如果你创建了一个特定的命名空间,里面有 DNS 函数,其他人删除了它,那么命名空间内的所有 pod 和它们运行的应用都会被清空。所有的**删除**操作在真正实施之前都应该由同事(通过 [GitOps][3])评审一下。 + +虽然官方文档不建议 [10 人以下团队][2] 使用多个命名空间,但出于架构需要,在我自己的集群上还是用了多个命名空间。集群越干净越好。 + +### 关于命名空间管理员应该知道的 + +首先,命名空间不能嵌套。部署只能在一个命名空间中进行。对于版本化项目,你不一定要用命名空间,你可以使用标签来区分有相同名字的版本化应用。命名空间使用配额来为不同的用户划分资源;例如,*某个命名空间最多能有 x 个 node*。最后,所有的命名空间对于资源类型只能使用一个独一无二的名字。 + +### 命名空间命令操作 + +你需要安装 [Minikube][4]、 [Helm][5] 和 [kubectl][6] 命令行,才能使用下面的命名空间命令。我的文章 [_安全浏览你的 DevOps 流水线_][7] 中有它们的安装教程,你也可以去每个工程的官方主页去找安装教程。我使用的是最新的 Minikube。手动安装很快,第一次就能成功运行。 + +获取你的第一组命名空间: + +``` +jess@Athena:~$ kubectl get namespace +NAME            STATUS   AGE +default         Active   5m23s +kube-public     Active   5m24s +kube-system     Active   5m24s +``` + +创建一个命名空间: + +``` +jess@Athena:~$ kubectl create namespace athena +namespace/athena created +``` + +现在开发者可以部署到你创建的命名空间;例如,这里是一个简短的 Helm 结构信息: + +``` +jess@Athena:~$ helm install teset-deploy stable/redis --namespace athena +NAME: teset-deploy +LAST DEPLOYED: Sat Nov 23 13:47:43 2019 +NAMESPACE: athena +STATUS: deployed +REVISION: 1 +TEST SUITE: None +NOTES: +** Please be patient while the chart is being deployed ** +Redis can be accessed via port 6379 on the following DNS names from within your cluster: + +teset-deploy-redis-master.athena.svc.cluster.local for read/write operations +teset-deploy-redis-slave.athena.svc.cluster.local for read-only operations +``` + +获取你的密码: + +``` +export REDIS_PASSWORD=$(kubectl get secret --namespace athena teset-deploy-redis -o jsonpath="{.data.redis-password}" | base64 --decode) +``` + +连接你的 redis 服务: + +1. 运行一个你可以作为客户端用的 Redis pod: + + ```bash + kubectl run --namespace athena teset-deploy-redis-client --rm --tty -i --restart='Never' \ +   --env REDIS_PASSWORD=$REDIS_PASSWORD \ + --image docker.io/bitnami/redis:5.0.7-debian-9-r0 -- bash + ``` + +2. 使用 Redis CLI 连接: + ```bash + redis-cli -h teset-deploy-redis-master -a $REDIS_PASSWORD + redis-cli -h teset-deploy-redis-slave -a $REDIS_PASSWORD + ``` + +从集群外连接你的数据库: + +```bash +kubectl port-forward --namespace athena svc/teset-deploy-redis-master 6379:6379 & +redis-cli -h 127.0.0.1 -p 6379 -a $REDIS_PASSWORD +``` + +现在这一套部署已经完成了,你有一个在命名空间 **test-deploy** 中部署的图表。 + +查看你的命名空间中有哪些 pod: + + +``` +jess@Athena:~$ kubectl get pods --namespace athena +NAME                            READY   STATUS  RESTARTS   AGE +teset-deploy-redis-master-0   1/1       Running   0             2m38s +teset-deploy-redis-slave-0      1/1     Running   0             2m38s +teset-deploy-redis-slave-1      1/1     Running   0             90s +``` + +现在,你已经正式把你的应用隔离到了一个命名空间,创建了一个只在内部通信的虚拟集群。 + +一键删除所有东西: + + +```bash +jess@Athena:~$ kubectl delete namespace athena +namespace "athena" deleted +``` + +因为这会删除应用的所有内部配置,所以这个删除操作可能会持续一段时间,持续时间取决于你的部署到底有多大。 + +再次检查一下所有东西是否被删除了: + + +```bash +jess@Athena:~$ kubectl get pods --all-namespaces +NAMESPACE       NAME                            READY   STATUS  RESTARTS   AGE +kube-system   coredns-5644d7b6d9-4vxv6          1/1     Running   0             32m +kube-system   coredns-5644d7b6d9-t5wn7          1/1     Running   0             32m +kube-system   etcd-minikube                     1/1     Running   0             31m +kube-system   kube-addon-manager-minikube       1/1     Running   0             32m +kube-system   kube-apiserver-minikube           1/1     Running   0             31m +kube-system   kube-controller-manager-minikube  1/1     Running   0             31m +kube-system   kube-proxy-5tdmh                  1/1     Running   0             32m +kube-system   kube-scheduler-minikube           1/1     Running   0             31m +kube-system   storage-provisioner               1/1     Running   0             27m +``` + +这是一个所有 pod 及它们存在于的已知命名空间的列表。你可以看到,之前创建的应用和命名空间现在已经不在了。 + +### 命名空间实践 + +现在我是为了安全使用命名空间,如限制用户的权限。你可以限制所有的东西 — 从哪些角色可以访问命名空间,到命名空间可使用的集群资源(CPU 等)的配额等级。例如,我通过资源配额和基于角色的访问控制(role-based access control,RBAC)配置来确保只有允许的服务账号可以访问命名空间。 + +对于隔离方面的安全,我不希望我的私人 Jenkins 应用可以通过一个信任的本地网络被当做有公共 IP 地址的安全镜像来访问(我不得不假定,可能会做出妥协)。 + +如果你很难提前计算出到底要在你的云平台上部署多少 node(就我而言,在把我的私人服务器放到 [segfaulting][8] 之前可以部署多少个 node),那么命名空间在预算方面也很有用。虽然这超出了本文的讨论范围,而且很复杂,但值得你去调研和使用来防止你的集群过分扩展。 + +### 总结 + +命名空间是一个很好的隔离项目和应用的方法。本文仅是一个关于命名空间的简短介绍,所以我建议你更深入地研究下命名空间,在你的实践中更多地去使用它们。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/kubernetes-namespaces + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jrepka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ +[3]: https://www.weave.works/blog/gitops-operations-by-pull-request +[4]: https://kubernetes.io/docs/tasks/tools/install-minikube/ +[5]: https://helm.sh/ +[6]: https://kubernetes.io/docs/tasks/tools/install-kubectl/ +[7]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline +[8]: https://en.wikipedia.org/wiki/Segmentation_fault From f0ad173351dfd9b8bdbc675db3617dda4b7d4a23 Mon Sep 17 00:00:00 2001 From: chen ni Date: Sun, 29 Dec 2019 13:17:43 +0800 Subject: [PATCH 108/430] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow to make an old computer useful again.md | 148 ++++++++---------- 1 file changed, 68 insertions(+), 80 deletions(-) diff --git a/sources/tech/20190724 How to make an old computer useful again.md b/sources/tech/20190724 How to make an old computer useful again.md index 7048848930..8e05a25631 100644 --- a/sources/tech/20190724 How to make an old computer useful again.md +++ b/sources/tech/20190724 How to make an old computer useful again.md @@ -7,136 +7,124 @@ [#]: via: (https://opensource.com/article/19/7/how-make-old-computer-useful-again) [#]: author: (Howard Fosdick https://opensource.com/users/howtechhttps://opensource.com/users/don-watkinshttps://opensource.com/users/suehlehttps://opensource.com/users/aseem-sharmahttps://opensource.com/users/sethhttps://opensource.com/users/marcobravohttps://opensource.com/users/dragonbitehttps://opensource.com/users/don-watkinshttps://opensource.com/users/jamesfhttps://opensource.com/users/seth) -How to make an old computer useful again +如何把你的老爷机重新利用起来 ====== -Refurbish an old machine with these step-by-step instructions. +按照下面各个步骤,让你的老爷机焕然一新 ![Person typing on a 1980's computer][1] -Have an old computer gathering dust in your basement? Why not put it to use? A backup machine could come in handy if your primary computer fails and you want to be online with a larger screen than your smartphone. Or it could act as a cheap secondary computer shared by the family. You could even make it into a retro gaming box. +你的地下室里有一台用来落灰的旧电脑?为什么不把它利用起来呢?如果你常用的电脑坏了,又想用一个比手机更大的屏幕上网,这时候一台备用电脑可能就派上用场了。或者,它也可以充当一台全家人共用的廉价辅助电脑,甚至还可以改造为一台复古游戏机。 -You can take any computer up to a dozen years old and—with the right software—perform many of the same tasks you can with new machines. Open source software is the key. +哪怕是一台有十余年历史的老爷机,只要选对了软件,也可以胜任很多新电脑能够完成的任务。其中的关键在于,要使用开源软件。 -I've refurbished computers for two decades, and in this article, I'll share how I do it. We're talking about dual-core laptops and desktops between five and 12 years old. +我进行电脑翻新已经有二十年了。在这篇文章里,我会分享一下电脑翻新的技巧。此处讨论的范围包括双核笔记本,以及机龄在 5 到 12 年之间的台式机。 -### Verify the hardware +### 检查硬件 -Step one is to verify that your hardware all works. Overlooking a problem here could cause you big headaches later. +第一步是检查硬件是否运转正常。如果在这个环节忽略了一个问题,后面可能会让你非常头疼。 -Dust kills electronics, so open up the box and clean out the dirt. [Compressed air][2] comes in handy. Be careful that you're [grounded][3] whenever you touch the machine. And _don't_ rub anything with a cleaning cloth. Even a static shock so small you won't feel it can destroy circuitry. +灰尘是电子器件的天敌,所以第一件事应该是打开机箱,清除灰尘。[压缩空气设备][2]这时候可能会派上用场。请注意,进行任何接触电脑的操作时,都应该确保你是[触地][3]的。此外,_避免_ 清洁布与任何物体发生摩擦。即使是一次小到你无法察觉的静电放电,也可能会导致电路损毁。 -Then close the clean computer and verify that all the hardware works. Test: +清洁工作完成之后,关闭机箱,检查是否所有硬件都可以正常工作。需要测试的项目包括: - * Memory - * Disk - * Motherboard - * Peripherals (DVD drive, USB ports, sound, etc.) + * 内存 + * 硬盘 + * 主板 + * 外围设备(DVD 驱动器、USB 接口、声卡,等等) +首先,将计算机启动面板([UEFI][4] 或者是 [BIOS][5]面板)上的诊断测试依次运行一遍。如果不知道按哪个程序功能按键进入你电脑的启动面板,可以参考 [这份列表][6]。 +此外,也可以使用诸如 [Hirens BootCD][7] 和 [Ultimate Boot CD][8] 之类的免费资源工具包,进行启动面板覆盖不到的测试。这些资源工具包涵盖了数百个测试程序,它们都是免费的,尽管不都开源。运行这些工具包无需安装任何软件,因为它们都是从 U 盘或者 DVD 驱动器启动的。 -Run any diagnostic tests in the computer's boot panels (the [UEFI][4] or [BIOS][5] panels). [This list][6] tells you which program function (PF) key to press to access those panels for your computer. +测试一定要彻底!对于内存和硬盘来说,基础测试还不够,应该运行深度测试,哪怕是运行一整夜也无妨。只有这样,才能够查出那些不易发现的瞬时故障。 -Free resource kits like [Hirens BootCD][7] or [Ultimate Boot CD][8] enable you to test what your boot panels don't. They contain hundreds of testing programs; all are free, but not all are open source. You don't have to install anything to run these kits because they'll boot from a USB thumb drive or DVD drive. +如果发现了问题,可以参考我的[硬件故障排除快速指南][9],帮你解决最常见的硬件问题。 -Be thorough! Run the extended tests for memory and disk—not just the short tests. Let them run overnight. That's the only way to catch transient (sporadic) errors. +### 选择软件 -If you find problems, my [Quick guide to fixing hardware][9] will help you solve the most common hardware issues. +电脑翻新的关键在于,根据手头的硬件资源,恰如其分地安装软件。最核心的三种硬件资源分别是: -### Select the software + 1. 处理器(核数、速度) + 2. 内存 + 3. 显存 -The key to refurbishing is to install software appropriate for the hardware resources you have. The three essential hardware resources are: +可以在启动时的 UEFI/BIOS 面板上,弄清楚你电脑的硬件资源。记得抄下数据,以免遗忘。接下来,可以在 [CPU Benchmark][10] 网站上查看你的处理器,该网站除了提供 CPU 的背景资料,还提供 CPU 的一个性能分数。 - 1. Processor (number of cores and speed) - 2. Memory - 3. Video memory +了解了硬件性能之后,就可以选择能够在硬件上高效运行的软件了。软件的选择涉及四个重要的层面: + 1. 操作系统(OS) + 2. 桌面环境(DE) + 3. 浏览器 + 4. 应用 +一个优秀的 Linux 发行版可以满足全部四个层面。不要试图使用已经停止维护的 Windows 版本,例如 Windows 8、Vista 或者 XP,哪怕已经安装在电脑上了。恶意软件的 [风险][11] 你是承受不起的。明智的做法是,使用一个更抗病毒的最新版本操作系统。 -You can identify your computer's resources in its boot-time UEFI/BIOS panels. Write down your findings so that you don't forget them. Then, look up your processor at [CPU Benchmark][10]. That website gives you background on your CPU plus a CPU Mark that indicates its performance. +那 Windows 7 呢?[维护宽限期][12] 至 2020 年 1 月 14 日结束,也就是说,在此日期之前你还可以获得安全补丁,之后就想都别想了。现在正是迁出 Windows 7 的绝佳时机。 -Now that you know your hardware's power, you're ready to select software that it can efficiently run. Your software choices are divided into four critical areas: +Linux 的巨大优势在于,有许多专门为过时硬件设计的[发行版][13]。此外,[桌面环境][14]和操作系统在 Linux 的设计中是分开的,你可以自行选择搭配。这一点非常重要,因为桌面环境对低端系统的性能有很大影响。(对于 Windows 和 MacOS 来说,你选择的操作系统版本决定了桌面环境,没得可选。) - 1. Operating system (OS) - 2. Desktop environment (DE) - 3. Browser - 4. Applications +Linux 的另一个好处是,拥有数以千计免费且开源的应用,不需要担心激活或者许可的问题。此外,Linux 是可移植的,可以在不同的分区、硬盘、设备或计算机之间,对操作系统和应用进行复制、移动或克隆。(Windows 则不然,使用注册表将系统捆绑在了所安装的计算机上。) +### 翻新后的电脑能够做什么? +这里讨论的是大约在 2006 年和 2013 年之间生产的双核计算机,尤其是装载了 [Intel 酷睿 2][15] CPU 或者 [AMD 速龙 64 X2][16] 系列处理器的计算机。它们的 [CPU 分数][10] 大多在 1000 到 4000 分之间。这种电脑卖不了几个钱,但用在运行轻量级 Linux 软件上,性能还是足够的。 -A good Linux distribution covers all four. Don't be tempted to run an unsupported version of Windows like 8, Vista, or XP just because it's already on the computer! The [risk][11] of malware is too great. You're much better off with a more virus-resistant, up-to-date operating system. +有一点需要注意:你的电脑应该至少拥有 2GB 内存,如果不够就进行升级。就我翻新过的电脑来说,使用者用到的内存(不包括数据缓存)一般在 0.5 到 2 GB 之间,很少超过 2 GB。如果将内存升级到 2GB,系统就不至于进行 _swap_,即将硬盘当做内存使用。如果想要获得良好性能,这一点十分关键。 -How about Windows 7? [Extended support][12] ends January 14, 2020, meaning you get security fixes only until that date. After that, zilch. Now is the perfect time to migrate off Windows 7. +以我自己为例,我用来写作这篇文章的是一台有十年机龄的翻新电脑。取下 1 GB 内存条之后,它只剩下了 1 GB 内存,然后就慢得像一只乌龟。用它浏览网页,或者是做类似的事情,都让人感到灰心,甚至痛苦。一旦把内存条重新装回去,有了 2 GB 内存,它就立马回到了可以使用的状态。 -Linux's big benefit is that it offers [many distros][13] specifically designed for older hardware. Plus, its design decouples [DEs][14] from the OS, so you can mix and match the two. This is important because DEs heavily impact low-end system performance. (With Windows and MacOS, the OS version you run dictates the DE.) +一台 2 GB 的双核计算机可以满足大多数人的需求,只要安装的是轻量级发行版和浏览器。你可以用它浏览网页、发送电子邮件、编辑文档和电子表格、观看 YouTube 视频、参与 eBay 拍卖竞标、在社交网络上发帖、听播客、查看相簿、管理家庭收支和个人日程、玩游戏,等等。 -Other Linux advantages: Its thousands of apps are free and open source, so you don't have to worry about activation and licensing. And Linux is portable. You can copy, move, or clone the OS and applications across partitions, disks, devices, or computers. (Windows binds itself to the computer it's installed on via its Registry.) +### 翻新电脑的局限 -### What can your refurbished computer do? +那么,这些老爷机又有什么局限呢?由于它们的并发比不上最先进的计算机,所以应该使用轻量级浏览器,同时拦截广告(广告正是让网页加载变慢的罪魁祸首)。如果可以使用虚拟专用网络(VPN)拦截广告,为处理器免除广告加载的负荷,那就再好不过了。此外,还需要禁用视频自动播放、Flash 以及网页动效;将浏览器上的标签页控制在少数几个,不要同时打开 20 个;以及下载可以开启/禁用 JavaScript 的浏览器扩展。 -We're talking dual-core machines dating from about 2006 to 2013, especially [Intel Core 2][15] CPUs and [AMD Athlon 64 X2][16] family processors. Most have a [CPU Mark][10] of between 1,000 and 4,000. You can often pick up these machines for a song, yet they're still powerful enough to run lightweight Linux software. +让处理器专注于你目前正在做的事情吧,不要同时打开一堆应用,也不要在后台运行很多程序。此外,图像编辑和视频编辑的高级工具可能会很慢。至于运行虚拟机,还是别想了吧。 -One caution: be sure your computer has at least 2GB of memory. Upgrade the RAM if you have to. End users on my refurbished machines typically use between 0.5 and 2GB of RAM (exclusive of data buffering); rarely do they go over 2 gig. So if you can bump memory to 2GB, your system won't be forced to _swap_, or substitute disk for memory. That's critical for good performance. +那游戏呢?开源软件仓库提供了数以千计的游戏。这就是我为什么将显存列为三种核心硬件资源之一。如果你的电脑没有显卡,那很可能只有 32 或者 64 MB 的显存。可以增加一张显卡,将显存提升到 256 或者 512 MB,这样一来,处理器密集型的游戏就会顺畅很多了。如果不确定你的电脑有多少显存,可以参考[这里][17]。请注意,需要确保显卡与电脑的[显卡插槽][18](AGP、PCI-Express 或者 PCI)相匹配,同时使用正确的[连接线][19](VGA、DVI 或者 HDMI)。 -For example, I removed 1GB RAM from the decade-old rebuild I'm writing this article on, which dropped memory down to 1GB. The machine slowed to a crawl. Web surfing and other tasks became frustrating, even painful. I popped the memory stick back in and, with 2GB RAM, the desktop instantly reverted to its usable self. +#### 与 Windows 系统的兼容性如何? -With a 2 gig dual-core computer, most people can do whatever they want, so long as they run a lightweight distro and browser. You can web surf, email, edit documents, do spreadsheets, watch YouTube videos, bid on eBay auctions, post on social media, listen to podcasts, view photo collections, manage home finance and personal scheduling, play games, and more. +很多人都会问,Linux 与 Windows 系统的兼容性如何。首先,对于任何一个 Windows 程序,都有一个 [Linux 的替代版本][20]。 -### Limitations +退一步说,即使你真的必须要运行某个特定的 Windows 程序,通常也可以使用 [Wine][21] 在 Linux 上运行。可以在 [Wine 数据库][22] 里查找一下你的应用,看看是否可以在 Wine 上运行,顺便学一些特殊安装技巧。[Winetricks][23] 和 [PlayOnLinux][24] 这两个辅助工具可以帮助你进行安装和配置。 -What can't these older computers do? Their concurrency is less than state-of-the-art machines. So run a fast browser and block ads, because that's what slows down web surfing. If your virtual private network (VPN) can block ads for you and offload that work from your processor, that's ideal. Disable autoplay of videos, Flash, and animation. Surf with a couple of tabs open rather than 20. Install a browser extension so you can toggle JavaScript. +Wine 的另一个优势是可以运行 Windows 的老版本,例如 Vista、XP、ME/98/95 和 3.1。我认识一个家伙,搭建了一台特别赞的游戏电脑,然后用来玩 XP 上的老游戏。使用 [DOSBox][26],你甚至还可以运行数以千计的[免费 DOS 程序][25]。但是有一点需要注意,如果 Windows 程序可以运行,那么 Windows [病毒][27]也同样可以。你需要保护 Linux 上的 Wine 环境,正如保护任何其他 Windows 环境一样。 -Direct the processors to what you're working on; don't keep a ton of apps open or run lots of stuff in the background. High-end graphics and video editing may be slow. Virtual machine hosting is out. +对了,与 Microsoft Office 的兼容性怎么样?我使用的是 LibreOffice,经常编辑并交换 Word 和 Excel 文件,完全没有问题。不过,你应该避免使用隐晦的或者过于专业的功能。 -How about games? The open source software repositories offer literally thousands of games. That's why I listed video memory as one of the three essential hardware resources. If your box doesn't have a video card, it likely has only 32 or 64MB of VRAM. Bump that to 256 or 512MB by adding a video card, and you'll find that processor-intensive games run much better. [Here's how][17] to see how much VRAM your computer has. Be sure to get a card that fits your computer's [video slot][18] (AGP, PCI-Express, or PCI) and has the right [cable connector][19] (VGA, DVI, or HDMI). +### 如何选择发行版? -#### What about Windows compatibility? +假设选择了 Linux 作为操作系统,那么你还需要选择桌面环境、浏览器和各种应用。最简单的方法是,安装一个包含了你所需要的一切的发行版。 -People often ask about Windows compatibility. First, there's a [Linux equivalent][20] for every Windows program. +通过从 [live USB][28] U 盘或者 DVD 启动,你无需安装任何程序,就可以尝试不同的发行版。关于在 Linux 或 Windows 上创建可启动的 Linux 的方法,可以参考 [这里][29]。 -Second, if you really must run a specific Windows program, you can usually do that on Linux using [Wine][21]. Look up your application in the [Wine database][22] to verify it runs under Wine and learn any special install tricks. Then the auxiliary tools [Winetricks][23] or [PlayOnLinux][24] will help you with installation and setup. +我进行电脑翻新的目的是做慈善,所以无法指望电脑使用者具备任何相应知识。我需要的发行版应该具有以下特性: -Wine's other benefit is that it runs programs from old Windows versions like Vista, XP, ME/98/95, and 3.1. I know a guy who set up a fantastic game box running his old XP games. You can even run thousands of [free DOS programs][25] using [DOSBox.][26] One caution: if Windows programs can run, so can Windows [viruses][27]. You must protect your Wine environment inside Linux just as you would any other Windows environment. + * 用户友好 + * 具有轻量级界面 + * 自带各种轻量级应用 + * 拥有足够大的软件仓库 + * 历史表现良好 + * 拥有庞大的用户社区和活跃的论坛 + * 通过长期维护版本(而不是滚动发布版本)确保稳定性 + * 更重视可靠性,而不是尖端功能 + * 可以通过图形化用户界面进行设置,而不是只能通过文本文件进行设置 -How about compatibility with Microsoft Office? I use LibreOffice and routinely edit and exchange Word and Excel files without problems. You must, however, avoid using obscure or specialized features. +许多发行版都能够满足上面的要求。我曾经尝试成功的有 [Mint/Xfce][30]、[Xubuntu,][31] 和 [Lubuntu][32]。前两个发行版使用 Xfce 桌面环境,第三个使用 LXQt。相比 GNOME、Unity、KDE、MATE 和 Cinnamon 这些桌面环境,运行上面这两种桌面环境只需要[更少][33]的处理器和内存资源。 -### Which distro? +Xfce 和 LXQt 用起来非常简单,我的客户们之前从未见过 Linux,但是都可以自如使用这些简单的、菜单驱动的用户界面。 -Assuming Linux is the OS, you need to select a DE, browser, and applications. The easy way to do this is to install a distribution that bundles everything you need. +对于旧电脑来说,运行最快速、最高效的浏览器是一件非常重要的事情。[很多人觉得][34] Chromium 是最好的浏览器;此外,我还安装了 Firefox Quantum,因为大家都比较熟悉它,并且[它的性能][35]可以和 [Chromium 的性能][36]媲美。我还加上了 Opera,因为它速度快,而且有一些独特功能,比如内置的广告拦截,以及免费的 [虚拟专用网络][37]。Opera 是免费的,但并非开源。 -Remember that you can try out different distros without installing anything by booting from a [live USB][28] thumb drive or DVD. [Here's how to create a bootable Linux][29] from within Linux or Windows. +无论你使用什么浏览器,一定要拦截广告和追踪器,尽量降低浏览器的负荷。此外,除非得到你的明确批准,否则视频和 Flash 都不应该被允许运行。 -I rebuild computers for charity, so I can't assume any knowledge on the part of my users. I need a distro with these traits: +至于应用,我使用的是 Mint/Xfce、Xubuntu 和 Lubuntu 自带的轻量级应用,它们可以满足一切需求。 - * User-friendly - * Lightweight interface - * Bundles lightweight apps - * Big repository - * Solid track record - * Large user community with an active forum - * Stability through long-term support releases (not rolling releases) - * Prioritizes reliability over cutting-edge features - * Configurable by a GUI rather than by text files +### 行动起来吧 +你是否会对翻新后的电脑感到满意呢?就我来说,我所使用的两台电脑的机龄都已经超过十年了,其中一个装载的是 Intel 双核处理器([eMachines T5274a][38]),另一个装载的是 AMD 速龙 64 x2 处理器([HP dc5750][39]),两台电脑都有 2 GB 内存。它们和我的另一台具备四核 i5 处理器和 16 GB 内存 的电脑一样,完全能够胜任我的办公工作。如果说有什么功能是这两台电脑缺失的,那就是运行虚拟机了。 - -Many distros fulfill these criteria. The three I've successfully deployed are [Mint/Xfce][30], [Xubuntu,][31] and [Lubuntu][32]. The first two use the Xfce desktop environment, while the latter runs LXQt. These DEs [use less][33] processor and memory resources than alternatives like GNOME, Unity, KDE, MATE, and Cinnamon. - -Xfce and LXQt are very easy to use. My clients have never seen Linux before, yet they have no trouble using these simple, menu-driven interfaces. - -It's vital to run the fastest, most efficient browser on older equipment. [Many feel][34] Chromium wins the browser race. I also install Firefox Quantum because people are familiar with it and [its performance][35] rivals [that of Chromium][36]. I toss in Opera because it's speedy and has some unique features, like integrated ad-blocking and a free [virtual private network][37]. Opera is free but not open source. - -Whatever browser you use, block ads and trackers! Minimize browser overhead. And don't allow videos or Flash to run without your explicit say-so. - -For applications, I rely on the lightweight apps bundled with Mint/Xfce, Xubuntu, and Lubuntu. They address every possible need. - -### Go for it - -Will you be happy with your rebuild? The computers I've been using lately are both over a decade old. One has an Intel dual-core processor ([eMachines T5274a][38]) while the other features an AMD Athlon 64 x2 processor ([HP dc5750][39]). Both have 2 gig memory. They're as effective for my office workload as my quad-core i5 with 16GB RAM. The only function I miss when using them is the ability to host virtual machines. - -We live in an amazing era. You can take a five- to 12-year-old computer and, with a little effort, restore it to practical use. What could be more fun? - -Having recently co-authored a book about building things with the Raspberry Pi ( Raspberry Pi Hacks... - -I can see the brightness of curiosity in my six year old niece Shuchi's eyes when she explores a... +我们生活在一个非常神奇的年代。只需要付出一点努力,就可以将一台机龄在 5 到 12 年之间的旧电脑,翻新为一台具备实用价值的机器。还有什么比这更有趣吗? -------------------------------------------------------------------------------- @@ -144,7 +132,7 @@ via: https://opensource.com/article/19/7/how-make-old-computer-useful-again 作者:[Howard Fosdick][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/chen-ni) +译者:[chen-ni](https://github.com/chen-ni) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0c922daee912126332ab1be7b37af82ded0b7534 Mon Sep 17 00:00:00 2001 From: chen ni Date: Sun, 29 Dec 2019 13:40:24 +0800 Subject: [PATCH 109/430] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ow to make an old computer useful again.md | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/sources/tech/20190724 How to make an old computer useful again.md b/sources/tech/20190724 How to make an old computer useful again.md index 8e05a25631..6eb7209c0f 100644 --- a/sources/tech/20190724 How to make an old computer useful again.md +++ b/sources/tech/20190724 How to make an old computer useful again.md @@ -26,14 +26,14 @@ 清洁工作完成之后,关闭机箱,检查是否所有硬件都可以正常工作。需要测试的项目包括: - * 内存 - * 硬盘 - * 主板 - * 外围设备(DVD 驱动器、USB 接口、声卡,等等) +* 内存 +* 硬盘 +* 主板 +* 外围设备(DVD 驱动器、USB 接口、声卡,等等) 首先,将计算机启动面板([UEFI][4] 或者是 [BIOS][5]面板)上的诊断测试依次运行一遍。如果不知道按哪个程序功能按键进入你电脑的启动面板,可以参考 [这份列表][6]。 -此外,也可以使用诸如 [Hirens BootCD][7] 和 [Ultimate Boot CD][8] 之类的免费资源工具包,进行启动面板覆盖不到的测试。这些资源工具包涵盖了数百个测试程序,它们都是免费的,尽管不都开源。运行这些工具包无需安装任何软件,因为它们都是从 U 盘或者 DVD 驱动器启动的。 +此外,也可以使用诸如 [Hirens BootCD][7] 和 [Ultimate Boot CD][8] 之类的免费资源工具包,进行启动面板覆盖不到的测试。这些资源工具包涵盖了数百个测试程序,并且都是免费的,尽管不都开源。运行这些工具包无需安装任何软件,因为它们都是从 U 盘或者 DVD 驱动器启动的。 测试一定要彻底!对于内存和硬盘来说,基础测试还不够,应该运行深度测试,哪怕是运行一整夜也无妨。只有这样,才能够查出那些不易发现的瞬时故障。 @@ -43,18 +43,18 @@ 电脑翻新的关键在于,根据手头的硬件资源,恰如其分地安装软件。最核心的三种硬件资源分别是: - 1. 处理器(核数、速度) - 2. 内存 - 3. 显存 +1. 处理器(核数、速度) +2. 内存 +3. 显存 -可以在启动时的 UEFI/BIOS 面板上,弄清楚你电脑的硬件资源。记得抄下数据,以免遗忘。接下来,可以在 [CPU Benchmark][10] 网站上查看你的处理器,该网站除了提供 CPU 的背景资料,还提供 CPU 的一个性能分数。 +可以在启动时的 UEFI/BIOS 面板上,弄清楚你电脑的硬件资源。记得抄下数据,以免遗忘。接下来,可以在 [CPU Benchmark][10] 网站上查看你的处理器,该网站除了提供 CPU 的背景资料,还提供一个 CPU 的性能分数。 了解了硬件性能之后,就可以选择能够在硬件上高效运行的软件了。软件的选择涉及四个重要的层面: - 1. 操作系统(OS) - 2. 桌面环境(DE) - 3. 浏览器 - 4. 应用 +1. 操作系统(OS) +2. 桌面环境(DE) +3. 浏览器 +4. 应用 一个优秀的 Linux 发行版可以满足全部四个层面。不要试图使用已经停止维护的 Windows 版本,例如 Windows 8、Vista 或者 XP,哪怕已经安装在电脑上了。恶意软件的 [风险][11] 你是承受不起的。明智的做法是,使用一个更抗病毒的最新版本操作系统。 @@ -66,9 +66,9 @@ Linux 的另一个好处是,拥有数以千计免费且开源的应用,不 ### 翻新后的电脑能够做什么? -这里讨论的是大约在 2006 年和 2013 年之间生产的双核计算机,尤其是装载了 [Intel 酷睿 2][15] CPU 或者 [AMD 速龙 64 X2][16] 系列处理器的计算机。它们的 [CPU 分数][10] 大多在 1000 到 4000 分之间。这种电脑卖不了几个钱,但用在运行轻量级 Linux 软件上,性能还是足够的。 +这里讨论的是大约在 2006 年到 2013 年之间生产的双核计算机,尤其是装载了 [Intel 酷睿 2][15] CPU 或 [AMD 速龙 64 X2][16] 系列处理器的计算机。它们的 [CPU 分数][10] 大多在 1000 到 4000 分之间。这种电脑卖不了几个钱,但用在运行轻量级 Linux 软件上,性能还是足够的。 -有一点需要注意:你的电脑应该至少拥有 2GB 内存,如果不够就进行升级。就我翻新过的电脑来说,使用者用到的内存(不包括数据缓存)一般在 0.5 到 2 GB 之间,很少超过 2 GB。如果将内存升级到 2GB,系统就不至于进行 _swap_,即将硬盘当做内存使用。如果想要获得良好性能,这一点十分关键。 +有一点需要注意:你的电脑应该至少拥有 2 GB 内存,如果不够就进行升级。就我翻新过的电脑来说,使用者用到的内存(不包括数据缓存)一般在 0.5 到 2 GB 之间,很少超过 2 GB。如果将内存升级到 2GB,系统就不至于进行 _swap_,即将硬盘当做内存使用。如果想要获得良好性能,这一点十分关键。 以我自己为例,我用来写作这篇文章的是一台有十年机龄的翻新电脑。取下 1 GB 内存条之后,它只剩下了 1 GB 内存,然后就慢得像一只乌龟。用它浏览网页,或者是做类似的事情,都让人感到灰心,甚至痛苦。一旦把内存条重新装回去,有了 2 GB 内存,它就立马回到了可以使用的状态。 @@ -76,21 +76,21 @@ Linux 的另一个好处是,拥有数以千计免费且开源的应用,不 ### 翻新电脑的局限 -那么,这些老爷机又有什么局限呢?由于它们的并发比不上最先进的计算机,所以应该使用轻量级浏览器,同时拦截广告(广告正是让网页加载变慢的罪魁祸首)。如果可以使用虚拟专用网络(VPN)拦截广告,为处理器免除广告加载的负荷,那就再好不过了。此外,还需要禁用视频自动播放、Flash 以及网页动效;将浏览器上的标签页控制在少数几个,不要同时打开 20 个;以及下载可以开启/禁用 JavaScript 的浏览器扩展。 +那么,这些老爷机又有什么局限呢?由于它们的并发比不上最先进的计算机,所以应该使用轻量级浏览器,同时拦截广告(广告正是让网页加载变慢的罪魁祸首)。如果可以使用虚拟专用网络(VPN)拦截广告,为处理器免除广告加载的负荷,那就再好不过。此外,还需要禁用视频自动播放、Flash 以及网页动效;将浏览器上的标签页控制在少数几个,不要同时打开 20 个;以及下载可以开启/禁用 JavaScript 的浏览器扩展。 -让处理器专注于你目前正在做的事情吧,不要同时打开一堆应用,也不要在后台运行很多程序。此外,图像编辑和视频编辑的高级工具可能会很慢。至于运行虚拟机,还是别想了吧。 +让处理器专注于你目前正在做的事情吧,不要同时打开一堆应用,也不要在后台运行很多程序。图像编辑和视频编辑的高级工具可能会很慢;至于运行虚拟机,还是别想了吧。 那游戏呢?开源软件仓库提供了数以千计的游戏。这就是我为什么将显存列为三种核心硬件资源之一。如果你的电脑没有显卡,那很可能只有 32 或者 64 MB 的显存。可以增加一张显卡,将显存提升到 256 或者 512 MB,这样一来,处理器密集型的游戏就会顺畅很多了。如果不确定你的电脑有多少显存,可以参考[这里][17]。请注意,需要确保显卡与电脑的[显卡插槽][18](AGP、PCI-Express 或者 PCI)相匹配,同时使用正确的[连接线][19](VGA、DVI 或者 HDMI)。 #### 与 Windows 系统的兼容性如何? -很多人都会问,Linux 与 Windows 系统的兼容性如何。首先,对于任何一个 Windows 程序,都有一个 [Linux 的替代版本][20]。 +很多人都关心 Linux 与 Windows 系统的兼容性如何。首先,对于任何一个 Windows 程序,都有一个 [Linux 的替代版本][20]。 -退一步说,即使你真的必须要运行某个特定的 Windows 程序,通常也可以使用 [Wine][21] 在 Linux 上运行。可以在 [Wine 数据库][22] 里查找一下你的应用,看看是否可以在 Wine 上运行,顺便学一些特殊安装技巧。[Winetricks][23] 和 [PlayOnLinux][24] 这两个辅助工具可以帮助你进行安装和配置。 +退一步说,即使你真的必须要运行某个特定的 Windows 程序,通常也可以借助 [Wine][21] 在 Linux 上运行。可以在 [Wine 数据库][22] 里查找一下你的应用,看看是否可以在 Wine 上运行,顺便学一些特殊安装技巧。[Winetricks][23] 和 [PlayOnLinux][24] 这两个辅助工具可以帮助你进行安装和配置。 -Wine 的另一个优势是可以运行 Windows 的老版本,例如 Vista、XP、ME/98/95 和 3.1。我认识一个家伙,搭建了一台特别赞的游戏电脑,然后用来玩 XP 上的老游戏。使用 [DOSBox][26],你甚至还可以运行数以千计的[免费 DOS 程序][25]。但是有一点需要注意,如果 Windows 程序可以运行,那么 Windows [病毒][27]也同样可以。你需要保护 Linux 上的 Wine 环境,正如保护任何其他 Windows 环境一样。 +Wine 的另一个优势是可以运行 Windows 的老版本,例如 Vista、XP、ME/98/95 和 3.1。我认识一个家伙,搭建了一台特别赞的游戏电脑,然后用来玩 XP 上的老游戏。凭借 [DOSBox][26],你甚至还可以运行数以千计的[免费 DOS 程序][25]。但是有一点需要注意,如果 Windows 程序可以运行,那么 Windows [病毒][27]也同样可以。你需要保护 Linux 上的 Wine 环境,正如保护任何其他 Windows 环境一样。 -对了,与 Microsoft Office 的兼容性怎么样?我使用的是 LibreOffice,经常编辑并交换 Word 和 Excel 文件,完全没有问题。不过,你应该避免使用隐晦的或者过于专业的功能。 +对了,与 Microsoft Office 的兼容性又如何呢?我使用的是 LibreOffice,经常编辑并交换 Word 和 Excel 文件,完全没有问题。不过,你应该避免使用隐晦或者过于专业的功能。 ### 如何选择发行版? @@ -100,25 +100,25 @@ Wine 的另一个优势是可以运行 Windows 的老版本,例如 Vista、XP 我进行电脑翻新的目的是做慈善,所以无法指望电脑使用者具备任何相应知识。我需要的发行版应该具有以下特性: - * 用户友好 - * 具有轻量级界面 - * 自带各种轻量级应用 - * 拥有足够大的软件仓库 - * 历史表现良好 - * 拥有庞大的用户社区和活跃的论坛 - * 通过长期维护版本(而不是滚动发布版本)确保稳定性 - * 更重视可靠性,而不是尖端功能 - * 可以通过图形化用户界面进行设置,而不是只能通过文本文件进行设置 +* 用户友好 +* 具有轻量级界面 +* 自带各种轻量级应用 +* 拥有足够大的软件仓库 +* 历史表现良好 +* 拥有庞大的用户社区和活跃的论坛 +* 通过长期维护版本(而不是滚动发布版本)确保稳定性 +* 更重视可靠性,而不是尖端功能 +* 可以通过图形化用户界面进行设置,而不是只能通过文本文件进行设置 许多发行版都能够满足上面的要求。我曾经尝试成功的有 [Mint/Xfce][30]、[Xubuntu,][31] 和 [Lubuntu][32]。前两个发行版使用 Xfce 桌面环境,第三个使用 LXQt。相比 GNOME、Unity、KDE、MATE 和 Cinnamon 这些桌面环境,运行上面这两种桌面环境只需要[更少][33]的处理器和内存资源。 Xfce 和 LXQt 用起来非常简单,我的客户们之前从未见过 Linux,但是都可以自如使用这些简单的、菜单驱动的用户界面。 -对于旧电脑来说,运行最快速、最高效的浏览器是一件非常重要的事情。[很多人觉得][34] Chromium 是最好的浏览器;此外,我还安装了 Firefox Quantum,因为大家都比较熟悉它,并且[它的性能][35]可以和 [Chromium 的性能][36]媲美。我还加上了 Opera,因为它速度快,而且有一些独特功能,比如内置的广告拦截,以及免费的 [虚拟专用网络][37]。Opera 是免费的,但并非开源。 +对于旧电脑来说,运行最快速、最高效的浏览器是一件非常重要的事情。[很多人觉得][34] Chromium 是最好的浏览器;此外,我还安装了 Firefox Quantum,因为大家比较熟悉它,并且[它的性能][35]可以和 [Chromium 的性能][36]媲美。我还加上了 Opera,因为它速度快,而且有一些独特功能,比如内置的广告拦截,以及免费的 [虚拟专用网络][37]。Opera 是免费的,但并非开源。 无论你使用什么浏览器,一定要拦截广告和追踪器,尽量降低浏览器的负荷。此外,除非得到你的明确批准,否则视频和 Flash 都不应该被允许运行。 -至于应用,我使用的是 Mint/Xfce、Xubuntu 和 Lubuntu 自带的轻量级应用,它们可以满足一切需求。 +至于应用,我使用的是 Mint/Xfce、Xubuntu 和 Lubuntu 自带的轻量级应用。它们足以满足一切需求了。 ### 行动起来吧 From 1d4ca0cb171d69a8d04b936892906451fcc2b158 Mon Sep 17 00:00:00 2001 From: chen ni Date: Sun, 29 Dec 2019 13:47:55 +0800 Subject: [PATCH 110/430] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190724 How to make an old computer useful again.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190724 How to make an old computer useful again.md b/sources/tech/20190724 How to make an old computer useful again.md index 6eb7209c0f..216f4ee65e 100644 --- a/sources/tech/20190724 How to make an old computer useful again.md +++ b/sources/tech/20190724 How to make an old computer useful again.md @@ -84,7 +84,7 @@ Linux 的另一个好处是,拥有数以千计免费且开源的应用,不 #### 与 Windows 系统的兼容性如何? -很多人都关心 Linux 与 Windows 系统的兼容性如何。首先,对于任何一个 Windows 程序,都有一个 [Linux 的替代版本][20]。 +许多人关心 Linux 与 Windows 系统的兼容性如何。首先,对于任何一个 Windows 程序,都有一个 [Linux 的替代版本][20]。 退一步说,即使你真的必须要运行某个特定的 Windows 程序,通常也可以借助 [Wine][21] 在 Linux 上运行。可以在 [Wine 数据库][22] 里查找一下你的应用,看看是否可以在 Wine 上运行,顺便学一些特殊安装技巧。[Winetricks][23] 和 [PlayOnLinux][24] 这两个辅助工具可以帮助你进行安装和配置。 From 8535a58ea71b5acab51e73890b8ee28c794139e3 Mon Sep 17 00:00:00 2001 From: chen ni Date: Sun, 29 Dec 2019 13:49:40 +0800 Subject: [PATCH 111/430] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190724 How to make an old computer useful again.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190724 How to make an old computer useful again.md b/sources/tech/20190724 How to make an old computer useful again.md index 216f4ee65e..1df6d5fabd 100644 --- a/sources/tech/20190724 How to make an old computer useful again.md +++ b/sources/tech/20190724 How to make an old computer useful again.md @@ -88,7 +88,7 @@ Linux 的另一个好处是,拥有数以千计免费且开源的应用,不 退一步说,即使你真的必须要运行某个特定的 Windows 程序,通常也可以借助 [Wine][21] 在 Linux 上运行。可以在 [Wine 数据库][22] 里查找一下你的应用,看看是否可以在 Wine 上运行,顺便学一些特殊安装技巧。[Winetricks][23] 和 [PlayOnLinux][24] 这两个辅助工具可以帮助你进行安装和配置。 -Wine 的另一个优势是可以运行 Windows 的老版本,例如 Vista、XP、ME/98/95 和 3.1。我认识一个家伙,搭建了一台特别赞的游戏电脑,然后用来玩 XP 上的老游戏。凭借 [DOSBox][26],你甚至还可以运行数以千计的[免费 DOS 程序][25]。但是有一点需要注意,如果 Windows 程序可以运行,那么 Windows [病毒][27]也同样可以。你需要保护 Linux 上的 Wine 环境,正如保护任何其他 Windows 环境一样。 +Wine 的另一个优势是可以运行 Windows 的老版本,例如 Vista、XP、ME/98/95 和 3.1。我认识一个家伙,搭建了一台特别赞的游戏电脑,然后用来玩 XP 上的老游戏。借助 [DOSBox][26],你甚至还可以运行数以千计的[免费 DOS 程序][25]。但是有一点需要注意,如果 Windows 程序可以运行,那么 Windows [病毒][27]也同样可以。你需要保护 Linux 上的 Wine 环境,正如保护任何其他 Windows 环境一样。 对了,与 Microsoft Office 的兼容性又如何呢?我使用的是 LibreOffice,经常编辑并交换 Word 和 Excel 文件,完全没有问题。不过,你应该避免使用隐晦或者过于专业的功能。 From 715f04a07a2be33bf75a49204a2a322e210d1574 Mon Sep 17 00:00:00 2001 From: chen ni Date: Sun, 29 Dec 2019 13:50:14 +0800 Subject: [PATCH 112/430] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20190724 How to make an old computer useful again.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20190724 How to make an old computer useful again.md (100%) diff --git a/sources/tech/20190724 How to make an old computer useful again.md b/translated/tech/20190724 How to make an old computer useful again.md similarity index 100% rename from sources/tech/20190724 How to make an old computer useful again.md rename to translated/tech/20190724 How to make an old computer useful again.md From e39ecde04435a21c03ea2c03b54cda4b5d9bdd09 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Dec 2019 14:43:58 +0800 Subject: [PATCH 113/430] APL --- sources/tech/20191227 10 resources to boost your Git skills.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191227 10 resources to boost your Git skills.md b/sources/tech/20191227 10 resources to boost your Git skills.md index b05f363e14..6012455ab6 100644 --- a/sources/tech/20191227 10 resources to boost your Git skills.md +++ b/sources/tech/20191227 10 resources to boost your Git skills.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0812a625a24a943354520efa9dc4c873026ac54c Mon Sep 17 00:00:00 2001 From: chen ni Date: Sun, 29 Dec 2019 16:36:49 +0800 Subject: [PATCH 114/430] =?UTF-8?q?=E7=94=B3=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...our Distribution Still Using an ‘Outdated- Linux Kernel.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md b/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md index 224f848f2d..6152697eb3 100644 --- a/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md +++ b/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chen-ni) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -101,7 +101,7 @@ via: https://itsfoss.com/why-distros-use-old-kernel/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[chen-ni](https://github.com/chen-ni) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3c3880d31759ea371e491176f6bac2bc802ae8bf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Dec 2019 19:59:20 +0800 Subject: [PATCH 115/430] TSL --- ...7 10 resources to boost your Git skills.md | 68 ------------------- ...7 10 resources to boost your Git skills.md | 57 ++++++++++++++++ 2 files changed, 57 insertions(+), 68 deletions(-) delete mode 100644 sources/tech/20191227 10 resources to boost your Git skills.md create mode 100644 translated/tech/20191227 10 resources to boost your Git skills.md diff --git a/sources/tech/20191227 10 resources to boost your Git skills.md b/sources/tech/20191227 10 resources to boost your Git skills.md deleted file mode 100644 index 6012455ab6..0000000000 --- a/sources/tech/20191227 10 resources to boost your Git skills.md +++ /dev/null @@ -1,68 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (10 resources to boost your Git skills) -[#]: via: (https://opensource.com/article/19/12/git-resources) -[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) - -10 resources to boost your Git skills -====== -Wrap up the year with a review of the best in Git. Here are the top 10 -articles about surprising ways you can use Git in the new year. -![open source button on keyboard][1] - -As we near the end of 2019, it is time to look back at the top 10 articles we published about Git this year. - -These articles range from use cases and tutorials to some very interesting, if somewhat unconventional, ways to use Git. All of these articles can help you improve your Git skills, but if you really need a Git 101 introduction, be sure to check out our _[Getting started with Git: Terminology 101][2]_ article and download our [Git cheat sheet][3]. - - 1. _[How GNOME uses Git][4]_ by Molly de Blanc looks at the GNOME project’s adoption of a self-hosted GitLab instance as the GNOME project’s centralized location for contributing to GNOME. De Blanc works in a non-coding position, so her article also explores how the switch to GitLab benefits contributors whose primary role is not writing code. - - 2. Ahmad Awais’ _[Emoji-Log: A new way to write Git commit messages][5]_ explains how to use Emoji-Log, "a straightforward, open source Git commit log standard," to write better, more user-friendly, Git commit messages. The article contains an overview of the theory behind Emoji-Log and configuration examples that can be added to **.bashrc, .zshrc, or .gitconfig** to quickly start using Emoji-Log. - - 3. In _[Manage your daily schedule with Git][6]_, Seth Kenlon explains how to use Git to manage your calendar. By combining Org mode, Git, and a few other tools, Kenlon describes how to create a Git-based calendar workflow that can be synced across devices. - - 4. [_Use Git as the backend for chat_][7] by Seth Kenlon explores another unconventional way to use Git. In this article, he explores GIC, which is a chat client written in Node.js with Git functioning as the backend database. GIC is proof of concept, not something intended for production use, but it provides an interesting example of a really unique way to use Git. - - 5. Alan Formy-Duval’s _[A practical learning exercise for Git][8]_ is a chronicle of his effort to improve his Git skills. He shares his experience for others to benefit from what he learned, and Git novices will gain a lot from this excellent overview of Git’s core functionality. - - 6. _[How writers can get work done better with Git][9]_ by Seth Kenlon looks at how writers can benefit from a Git-based workflow. The article explains how to use Git and Atom to write using Markdown. By following the examples in this article, writers can easily add a complex revision control system to their writing workflow. - - 7. In _[How to use Magit to manage Git projects][10]_, Sachin Patil explains how to use Emacs’ Magit extension to manage Git repositories. The article provides clear examples of how to perform a selection of key Git tasks inside Emacs. The examples are supported by screenshots illustrating the various tasks. - - 8. _[Move your dotfiles to version control][11]_ by Matthew Broberg shows how to use Git to store the dotfiles in your home directory. Storing your dotfiles in a Git repository makes it easier to share your system configuration between computers and, if you so choose, share your configurations with others. The article does come with a warning about what not to share because sharing the wrong dotfiles can expose others. - - 9. Austin Dewey’s _[4 secrets management tools for Git encryption][12]_ compares Git-crypt, BlackBox, SOPS, and Transcrypt in this article examining tools for storing secrets in Git. The article covers four major areas: encryption types supported, the goals of each project, the projects’ workflows and differences, and other features. - - 10. _[Run a server with Git][13]_ by Seth Kenlon explains how Gitolite can be used to manage a Git server. Gitolite is "a backend application managing the fiddly bits" involved in using Git to manage a Git server. The article demonstrates how to install, configure, and use Gitolite, with clear examples detailing each step the process. - - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/git-resources - -作者:[Joshua Allen Holm][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/holmja -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx (open source button on keyboard) -[2]: https://opensource.com/article/19/2/git-terminology -[3]: https://opensource.com/downloads/cheat-sheet-git -[4]: https://opensource.com/article/19/10/how-gnome-uses-git -[5]: https://opensource.com/article/19/2/emoji-log-git-commit-messages -[6]: https://opensource.com/article/19/4/calendar-git -[7]: https://opensource.com/article/19/4/git-based-chat -[8]: https://opensource.com/article/19/5/practical-learning-exercise-git -[9]: https://opensource.com/article/19/4/write-git -[10]: https://opensource.com/article/19/1/how-use-magit -[11]: https://opensource.com/article/19/3/move-your-dotfiles-version-control -[12]: https://opensource.com/article/19/2/secrets-management-tools-git -[13]: https://opensource.com/article/19/4/server-administration-git diff --git a/translated/tech/20191227 10 resources to boost your Git skills.md b/translated/tech/20191227 10 resources to boost your Git skills.md new file mode 100644 index 0000000000..eee2be8848 --- /dev/null +++ b/translated/tech/20191227 10 resources to boost your Git skills.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 resources to boost your Git skills) +[#]: via: (https://opensource.com/article/19/12/git-resources) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) + +10 个提高 Git 技能的资源 +====== + +> 年末总结一下 Git 的最佳表现。以下是在新的一年中以新奇的方式使用 Git 的十篇文章。 + +![open source button on keyboard][1] + +快到 2019 年底了,是时候回顾一下我们今年发表的有关 Git 的前 10 篇文章了。 + +这些文章包括从用例和教程到一些非常有趣的(甚至有些非常规的)使用 Git 的方法。所有这些文章都可以帮助你提高 Git 技能,但是,如果你确实需要 Git 入门介绍,请务必查看我们的《[Git 入门:术语入门][2]》文章,并下载我们的 [Git 备忘单][3]。 + +1. Molly de Blanc 写的《[GNOME 如何使用 Git][4]》考察了 GNOME 项目采用的自托管 GitLab 实例的做法,该实例作为 GNOME 项目集中保存为 GNOME 做出的贡献的位置。De Blanc 从事于非编码职位,因此她的文章还探讨了切换到 GitLab 如何使主要角色不是编写代码的贡献者受益。 +2. Ahmad Awais 写的《[Emoji-Log:编写 Git 提交信息的新方法][5]》解释了如何使用 Emoji-Log(一种直白的、开源的 Git 提交日志标准)来编写更好、更用户友好的 Git 提交消息。本文概述了 Emoji-Log 背后的理论以及可添加到 `.bashrc`、`.zshrc` 或 `.gitconfig` 中的配置示例,以便你快速开始使用 Emoji-Log。 +3. 在《[用 Git 管理你的每日行程][6]》中,Seth Kenlon 解释了如何使用 Git 来管理日历。通过结合 Org 模式、Git 和其他一些工具,Kenlon 描述了如何创建可在设备之间同步的基于 Git 的日历工作流。 +4. 《[用 Git 作为聊天应用的后端][7]》,Seth Kenlon 探索了另一种使用 Git 的非常规方式。在本文中,他探讨了 GIC,这是一个用 Node.js 编写的聊天客户端,其中 Git 用作后端数据库。GIC 是一个概念验证模型,不是供产品环境使用的东西,但是它提供了一个有趣的示例,说明了使用 Git 的真正独特方法。 +5. Alan Formy-Duval 的《[Git 学习实用练习][8]》是一份他为提高 Git 技能而努力的编年史。他分享了自己的经验,以使其他人受益于他所学,而 Git 新手将从这篇对 Git 核心功能的出色概述中受益匪浅。 +6. 《[用 Git 帮助写作者更好地完成工作][9]》的作者 Seth Kenlon 着眼于写作者如何从基于 Git 的工作流中受益。本文介绍了如何使用 Git 和 Atom 利用 Markdown 进行书写。通过遵循本文中的示例,写作者可以轻松地将复杂的修订控制系统添加到其编写工作流中。 +7. Sachin Patil 在《[如何使用 Magit 管理 Git 项目][10]》中,解释了如何使用 Emacs 的 Magit 扩展来管理 Git 存储库。本文提供了有关如何在 Emacs 中执行一系列关键 Git 任务的清晰示例。这些示例由说明各种任务的屏幕截图支持。 +8. 《[把“点文件”放到版本控制中][11]》的作者 Matthew Broberg 演示了如何使用 Git 存储放在主目录中的点文件。将你的点文件存储在 Git 存储库中,可以更轻松地在计算机之间共享系统配置,并且,如果你愿意的话,也可以与其他人共享配置。这篇文章也有什么不要共享的警告,因为共享错误的点文件会暴露给其他人。 +9. Austin Dewey 的《[4 种用于 Git 加密的机密管理工具][12]》在本文中比较了 Git-crypt、BlackBox、SOPS 和 Transcrypt,研究了在 Git 中存储机密的工具。本文涵盖四个主要领域:支持的加密类型、每个项目的目标、项目的工作流和差异以及其他功能。 +10. Seth Kenlon 的《[使用 Git 管理 Git 服务器][13]》解释了如何使用 Gitolite 管理 Git 服务器。Gitolite 是使用 Git 来管理 Git 服务器的“管理杂项的后端应用程序”。本文演示了如何安装、配置和使用 Gitolite,并提供了清晰的示例详细说明了该过程的每个步骤。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/git-resources + +作者:[Joshua Allen Holm][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx (open source button on keyboard) +[2]: https://opensource.com/article/19/2/git-terminology +[3]: https://opensource.com/downloads/cheat-sheet-git +[4]: https://opensource.com/article/19/10/how-gnome-uses-git +[5]: https://linux.cn/article-10627-1.html +[6]: https://linux.cn/article-11320-1.html +[7]: https://linux.cn/article-11342-1.html +[8]: https://opensource.com/article/19/5/practical-learning-exercise-git +[9]: https://linux.cn/article-11499-1.html +[10]: https://opensource.com/article/19/1/how-use-magit +[11]: https://linux.cn/article-11419-1.html +[12]: https://opensource.com/article/19/2/secrets-management-tools-git +[13]: https://opensource.com/article/19/4/server-administration-git From 65d17132c3e768ba812c5933771776d6c3f8cc11 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Dec 2019 20:41:08 +0800 Subject: [PATCH 116/430] APL --- sources/tech/20191204 Fedora Desktops - Memory Footprints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191204 Fedora Desktops - Memory Footprints.md b/sources/tech/20191204 Fedora Desktops - Memory Footprints.md index f9a3ea0f3b..f69a975a37 100644 --- a/sources/tech/20191204 Fedora Desktops - Memory Footprints.md +++ b/sources/tech/20191204 Fedora Desktops - Memory Footprints.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ba98913fbc23359ede2cc125a751956f3b0fb6d5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Dec 2019 21:07:54 +0800 Subject: [PATCH 117/430] TSL --- ...204 Fedora Desktops - Memory Footprints.md | 82 ------------------- ...204 Fedora Desktops - Memory Footprints.md | 82 +++++++++++++++++++ 2 files changed, 82 insertions(+), 82 deletions(-) delete mode 100644 sources/tech/20191204 Fedora Desktops - Memory Footprints.md create mode 100644 translated/tech/20191204 Fedora Desktops - Memory Footprints.md diff --git a/sources/tech/20191204 Fedora Desktops - Memory Footprints.md b/sources/tech/20191204 Fedora Desktops - Memory Footprints.md deleted file mode 100644 index f69a975a37..0000000000 --- a/sources/tech/20191204 Fedora Desktops - Memory Footprints.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Fedora Desktops – Memory Footprints) -[#]: via: (https://fedoramagazine.org/fedora-desktops-memory-footprints/) -[#]: author: (Troy Dawson https://fedoramagazine.org/author/tdawson/) - -Fedora Desktops – Memory Footprints -====== - -![][1] - -There are over 40 desktops in Fedora. Each desktop has it’s own strengths and weaknesses. Usually picking a desktop is a very personal preference based on features, looks, and other qualities. Sometimes, what you pick for a desktop is limited by hardware constraints. - -This article is to help people compare Fedora desktops based on the desktop baseline memory. To narrow the scope, we are only looking at the desktops that have an official Fedora Live image. - -### Installation and Setup - -Each of the desktops was installed on it’s own KVM virtual machine. Each virtual machine had 1 CPU, 4GB of memory, 15 GB virtio solid state disk, and everything else that comes standard on RHEL 8.0 kvm. - -The images for installation were the standard Fedora 31 Live images. For GNOME, that image was the Fedora Workstation. For the other desktops, the corresponding Spin was used. Sugar On A Stick (SOAS) was not tested because it does not install easily onto a local drive. - -The virtual machine booted into the Live CD. “Install to Hard Disk” was selected. During the install, only the defaults were used. A root user, and a regular users were created. After installation and reboot, the Live image was verified to not be in the virtual CDROM. - -The settings for each desktop was not touched. They each ran whatever settings came default from the Live CD installation. Each desktop was logged into via the regular user. A terminal was opened. Using sudo each machine ran “dnf -y update”. After update, in that sudo terminal, each machine ran “/sbin/shutdown -h now” to shut down. - -### Testing - -Each machine was started up. The desktop was logged into via the regular user. Three of the desktop terminals were opened. xterm was never used, it was always the terminal for that desktop, such as konsole. - -In one terminal, top was started and M pressed, showing the processes sorted by memory. In another terminal, a simple while loop showed “free -m” every 30 seconds. The third terminal was idle. - -I then waited 5 minutes. This allowed any startup services to finish. I recorded the final free result, as well as the final top three memory consumers from top. - -### Results - - * Cinnamon - * 624 MB Memory used - * cinnamon 4.8% / Xorg 2.2% / dnfdragora 1.8% - * GNOME - * 612 MB Memory used - * gnome-shell 6.9% / gnome-software 1.8% / ibus-x11 1.5% - * KDE - * 733 MB Memory used - * plasmashell 6.2% / kwin_x11 3.6% / akonadi_mailfil 2.9% - * LXDE - * 318 MB Memory used - * Xorg 1.9% / nm-applet 1.8% / dnfdragora 1.8% - * LXQt - * 391 MB Memory used - * lxqt-panel 2.2% / pcmanfm-qt 2.1% / Xorg 2.1% - * MATE - * 465 MB Memory used - * Xorg 2.5% / dnfdragora 1.8% / caja 1.5% - * XFCE - * 448 MB Memory used - * Xorg 2.3% / xfwm4 2.0% / dnfdragora 1.8% - - - -### Conclusion - -I will let the numbers speak for themselves. - -Remember that these numbers are from a default Live install. If you remove, or add services and features, your memory usage will change. But this is a good baseline to look at if you are determining your desktop based on memory consumption. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/fedora-desktops-memory-footprints/ - -作者:[Troy Dawson][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/tdawson/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2019/11/desktop-memory-footprint-816x346.jpg diff --git a/translated/tech/20191204 Fedora Desktops - Memory Footprints.md b/translated/tech/20191204 Fedora Desktops - Memory Footprints.md new file mode 100644 index 0000000000..0fe78be674 --- /dev/null +++ b/translated/tech/20191204 Fedora Desktops - Memory Footprints.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora Desktops – Memory Footprints) +[#]: via: (https://fedoramagazine.org/fedora-desktops-memory-footprints/) +[#]: author: (Troy Dawson https://fedoramagazine.org/author/tdawson/) + +Fedora 上的桌面环境内存占用测试 +====== + +![][1] + +Fedora 中有 40 多中桌面环境。每种桌面环境都有自己的优点和缺点。通常,根据功能、外观和其他品质,选择桌面是非常个人的偏爱。但有时,你选择的桌面环境还会受到硬件限制。 + +本文旨在帮助人们根据桌面环境占用的基准内存来比较 Fedora 桌面环境。为了缩小范围,我们仅查看具有正式 Fedora Live 镜像的桌面环境。 + +### 安装与系统配置 + +每个桌面环境都安装在自己的 KVM 虚拟机上。每个虚拟机都有 1 个 CPU、4GB 内存、15GB virtio 固态磁盘,以及 RHEL 8.0 kvm 上所有其他标准配置。 + +用于安装的镜像是标准的 Fedora 31 Live 镜像。对于 GNOME,该镜像是 Fedora 工作站。对于其他桌面,使用了相应的 Spin 版本。未对“糖葫芦Sugar On A Stick”(SOAS)进行测试,因为它不容易安装到本地驱动器上。 + +用 Live CD 启动虚拟机,然后选择“安装到硬盘”。在安装过程中,仅使用默认值。创建一个 root 用户和一个普通用户。安装并重新启动后,live 镜像已确认不在虚拟 CDROM 中。 + +每个桌面环境的设置都没有改动。它们每个都以 Live CD 安装中默认的设置运行。每个桌面环境都是通过普通用户登录的。打开了一个终端,在每台虚拟机中都使用 `sudo` 运行了 `dnf -y update`。在更新后,在该 sudo 终端中,每台虚拟机都运行 `/sbin/shutdown -h now` 以关闭。 + +### 测试方式 + +每台机器都已启动。桌面环境已通过普通用户登录。打开了三个桌面终端。xterm 从未使用过,始终用的是该桌面环境的终端,例如 konsole。 + +在一个终端中,启动 `top` 并按下 `M`,以显示按内存排序的进程。在另一个终端中,一个简单的 `while` 循环每 30 秒显示一次 `free -m`。第三个终端闲置。 + +然后,我等待了 5 分钟。这样就可以让所有启动的服务都启动完成。我记录了最终的 `free` 结果,以及 `top` 中最终的前三名内存使用者。 + +### 结果 + + * Cinnamon + * 使用了624 MB + * cinnamon 4.8% / Xorg 2.2% / dnfdragora 1.8% + * GNOME + * 使用了 612 MB + * gnome-shell 6.9% / gnome-software 1.8% / ibus-x11 1.5% + * KDE + * 使用了 733 MB + * plasmashell 6.2% / kwin_x11 3.6% / akonadi_mailfil 2.9% + * LXDE + * 使用了 318 MB + * Xorg 1.9% / nm-applet 1.8% / dnfdragora 1.8% + * LXQt + * 使用了 391 MB + * lxqt-panel 2.2% / pcmanfm-qt 2.1% / Xorg 2.1% + * MATE + * 使用了 465 MB + * Xorg 2.5% / dnfdragora 1.8% / caja 1.5% + * XFCE + * 使用了 448 MB + * Xorg 2.3% / xfwm4 2.0% / dnfdragora 1.8% + + + +### 结论 + +我会让数字说明一切。 + +请记住,这些数字来自默认的 Live 安装环境。如果删除或添加服务和功能,则内存使用量将发生变化。但是,如果要根据内存消耗确定桌面环境,这是一个很好的基准。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-desktops-memory-footprints/ + +作者:[Troy Dawson][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/tdawson/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/11/desktop-memory-footprint-816x346.jpg From 2d1507f24ab878d7ab5eb4af873dad57da2c8b95 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 30 Dec 2019 00:53:06 +0800 Subject: [PATCH 118/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191230=20Fixing?= =?UTF-8?q?=20=E2=80=9CVLC=20is=20Unable=20to=20Open=20the=20MRL=E2=80=9D?= =?UTF-8?q?=20Error=20[Quick=20Tip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md --- ...nable to Open the MRL- Error -Quick Tip.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md diff --git a/sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md b/sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md new file mode 100644 index 0000000000..d8bbaf3185 --- /dev/null +++ b/sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md @@ -0,0 +1,102 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fixing “VLC is Unable to Open the MRL” Error [Quick Tip]) +[#]: via: (https://itsfoss.com/vlc-is-unable-to-open-the-mrl/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Fixing “VLC is Unable to Open the MRL” Error [Quick Tip] +====== + +One of the [VLC tips][1] is to play YouTube and other online videos with [VLC][2]. This could help you [watch online videos with subtitles][3]. + +But things may not always be simple because at times you’ll encounter this error when trying to open YouTube video with VLC: + +**Your input can’t be opened: +VLC is unable to open the MRL ‘. Check the log for details.** + +![VLC error while playing YouTube videos][4] + +The thing here is that Google doesn’t want you to use any third party application for watching YouTube because then they cannot collect data properly. + +So, they keep changing stuff from their side to make it harder for third party devs to work with YouTube. + +Take [youtube-dl][5] for example. You’ll notice that you cannot [download YouTube videos][6] with it all of a sudden and the simplest solution is to have the latest version of youtube-dl installed. + +Same goes for VLC. If you [install the latest VLC in Ubuntu][7] or whichever operating system you are using, you probably won’t see this error. + +### Fixing “VLC is unable to open the MRL” error + +Let me show you the steps to fix this problem for YouTube at least. + +Go to this page and use Ctrl+S to save the file from the official GitHub repository of VLC media player: + +[Download youtube.lua file][8] + +Now, what you need to do is to replace the youtube.luac (mind the ‘c’ in luac) in lib/vlc/lua/playlist directory with this downloaded file. + +#### Steps for Linux + +If you are using Linux, open the terminal and use the [locate command][9] to find the exact location of youtube.luac file: + +``` +locate youtube.luac +``` + +When you get the path of the file, you just replace that file with your downloaded file. I trust you to handle this simple task. + +For me, it showed the path of the file here: + +``` +[email protected]:~$ locate youtube.lua +/usr/lib/x86_64-linux-gnu/vlc/lua/playlist/youtube.luac +``` + +So all I did was to move the downloaded file to this location and replace the content of the file: + +``` +sudo cp ~/Downloads/youtube.lua /usr/lib/x86_64-linux-gnu/vlc/lua/playlist/youtube.luac +``` + +You should be able to play the YouTube videos in VLC now. + +#### Steps for Windows + +If you are using Windows, you should follow these steps: + + * Rename the downloaded youtube.lua file to youtube.luac + * Now copy this file and paste it to C:\Program Files (x86)\VideoLAN\VLC\lua\playlist\ + + + +That’s it. + +If you have trouble with Dailymotion or other video streaming websites, you can download their respective lua files from the VLC repository [here][10] and replace the existing one in your VLC install. + +I hope this quick tip fixed the problem with VLC unable to play YouTube videos for you. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/vlc-is-unable-to-open-the-mrl/ + +作者:[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/simple-vlc-tips/ +[2]: https://www.videolan.org/index.html +[3]: https://itsfoss.com/penguin-subtitle-player/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc_error_input_cant_be_played.png?ssl=1 +[5]: https://itsfoss.com/download-youtube-linux/ +[6]: https://itsfoss.com/download-youtube-videos-ubuntu/ +[7]: https://itsfoss.com/install-latest-vlc/ +[8]: https://raw.githubusercontent.com/videolan/vlc/master/share/lua/playlist/youtube.lua +[9]: https://linuxhandbook.com/locate-command/ +[10]: https://github.com/videolan/vlc/tree/master/share/lua/playlist From 65b8a6879bbc03c98d1d0327710589a894fd6c75 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 30 Dec 2019 00:53:57 +0800 Subject: [PATCH 119/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191229=20The=20?= =?UTF-8?q?best=20resources=20for=20agile=20software=20development?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191229 The best resources for agile software development.md --- ...esources for agile software development.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20191229 The best resources for agile software development.md diff --git a/sources/tech/20191229 The best resources for agile software development.md b/sources/tech/20191229 The best resources for agile software development.md new file mode 100644 index 0000000000..2e504f3d45 --- /dev/null +++ b/sources/tech/20191229 The best resources for agile software development.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The best resources for agile software development) +[#]: via: (https://opensource.com/article/19/12/agile-resources) +[#]: author: (Leigh Griffin https://opensource.com/users/lgriffin) + +The best resources for agile software development +====== +Read our top articles that highlight the discussion around agile's past, +present, and what it may look like in the future. +![Women programming][1] + +It has been a great year for agile topics on Opensource.com. As we approach the end of 2019, reviewed our top agile-related articles, as read by you, our readers! + +### Small Scale Scrum guide + +Opensource.com's six-part guide to [Small Scale Scrum][2] (which I helped co-author) advises smaller teams on how to bring agile into their work. The traditional scrum framework outlined in the official [Scrum Guide][3] recommends a minimum of three people for the framework to realize its full potential. However, it provides no guidance for how teams of one or two people can follow scrum successfully. Our six-part series aims to formalize Small Scale Scrum and examines our experience with it in the real world. The series was received very warmly by our readers—so much such that the six individual articles comprise 60% of our Top 10 list. So, if you haven't already, make sure to download them from our [_Introduction to Small Scale Scrum_ page][2]. + +### A comprehensive guide to agile project management + +Teams following traditional project management approaches, initially skeptical about agile, have warmed up to the agile way of working. Now agile has reached acceptance, and a more flexible, hybrid style has found a home. [_A comprehensive guide to agile project management_][4] by Matt Shealy covers 12 guiding principles of agile project management and is perfect for traditional project managers looking to bring some agility to their projects. + +### 4 steps to becoming an awesome agile developer + +A DevOps culture has emerged in many modern software teams that embrace agile software development principles that leverage cutting-edge tooling and automation. But this mechanically agile approach does not guarantee that developers are following agile practices in their day-to-day work. In [_4 steps to becoming an awesome agile developer_][5], Daniel Oh gives great tips for increasing your agility by focusing on design thinking, using predictable approaches, putting quality at the center, and continuously learning and exploring. Complementing these methods with your agile tooling will create very flexible and strong agile developers. + +### Scrum vs. kanban: Which agile framework is better? + +Scrum and kanban are two of the most popular approaches for teams running in an agile manner, and in [_Scrum vs. kanban: Which agile framework is better?_][6] Taz Brown explores the history and purpose of both. While reading this article, a great saying came to my mind: "If the only tool in your toolbox is a hammer, every problem looks like a nail." Knowing when to use kanban and when to use scrum is important, and this article helps show that both have a place, depending on your team, your challenge, and your goals. + +### 4 ways developers can have a say in what agile looks like + +Developers often have a fear of having a workstyle imposed upon them when the topic of adopting agile comes up. In [_4 ways developers can have a say in what agile looks like_][7], [Clément Verna][8] looks at ways that developers can flip that narrative by helping to determine what agile looks like on their team. Examining the origins and the basics of agile is a great starting point, but the real value is in having metrics to help guide your journey. Knowing what challenges you can expect to have will give you a firm ground to move forward. And making decisions empirically not only empowers teams but gives them a sense of ownership of the journey. Verna's article also examines the importance of putting people over processes and working as a team to achieve your goals. + +### Agile now and later + +This year, Opensource.com authors created a lot of discussion around agile's past, present, and what it may look like in the future. Thank you to all of them, and be sure to [share your own agile story][9] here in 2020. + +A look back at the tools Opensource.com covered in 2014 and 2015 , with updates on new releases,... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/agile-resources + +作者:[Leigh Griffin][a] +选题:[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/lgriffin +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/collab-team-pair-programming-code-keyboard2.png?itok=WnKfsl-G (Women programming) +[2]: https://opensource.com/downloads/small-scale-scrum +[3]: https://scrumguides.org/scrum-guide.html +[4]: https://opensource.com/article/19/8/guide-agile-project-management +[5]: https://opensource.com/article/19/2/steps-agile-developer +[6]: https://opensource.com/article/19/8/scrum-vs-kanban +[7]: https://opensource.com/article/19/10/ways-developers-what-agile +[8]: https://twitter.com/clemsverna +[9]: https://opensource.com/how-submit-article From c54ad8e3352a78b284f4ffcc41986ef216189ea3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 30 Dec 2019 09:01:26 +0800 Subject: [PATCH 120/430] translated --- ...Falkon Open Source Web Browser from KDE.md | 121 ------------------ ...Falkon Open Source Web Browser from KDE.md | 121 ++++++++++++++++++ 2 files changed, 121 insertions(+), 121 deletions(-) delete mode 100644 sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md create mode 100644 translated/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md diff --git a/sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md b/sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md deleted file mode 100644 index 7f3ec34562..0000000000 --- a/sources/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md +++ /dev/null @@ -1,121 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (App Highlight: Falkon Open Source Web Browser from KDE) -[#]: via: (https://itsfoss.com/falkon-browser/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -App Highlight: Falkon Open Source Web Browser from KDE -====== - -_**Formerly known as Qupzilla, Falkon is a web browser based on QtWebEngine. In this week’s App Highlight, we take a look at this open source software.**_ - -### Falkon: Open Source Web Browser for Linux (and Windows) - -![][1] - -First thing first, [Falkon][2] is not a new web browser. It has been in development since 2010 but it was known as Qupzilla. - -In 2017, QupZilla moved under KDE umbrella and changed its name to Falkon. Being under KDE umbrella means that project is actively maintained following KDE standards. - -It uses the [QtWebEngine][3] rendering engine – which is a striped down version of Chromium core. - -In this article, I shall take a closer look at what it offers and how it’s different than other dominant web browsers on Linux out there. - -### Features of Falkon Browser - -Thought it may not be a popular browser, I did find it capable enough to browse modern web services. - -Let me highlight the key features of Falkon and if you find it interesting enough, give it a try. - -#### Simple User Interface - -![][4] - -I know it’s not exactly a “feature” but the user experience (UX) matters a lot. Despite being a lightweight browser, you have a decent looking interface here. You won’t feel like you are using a browser from the early 2000’s. - -#### AdBlock Extension - -![][5] - -It comes packed in with the AdBlock extension that works pretty well if you want to get rid of the advertisements while browsing a website. You can also customize the behavior of the AdBlock extension. - -#### DuckDuckGo Default Search Engine - -It’s a good thing to have one of the [privacy-oriented search engines][6] as the default search engine if you do not like using Google. - -#### Session Manager - -![][7] - -Falkon includes a useful session manager from the available options in the browser menu. You can restore a specific recent session using this – which should come in handy. - -#### Extension Support - -![][8] - -It does support adding extensions but you cannot add extensions from Chrome/Firefox add-on marketplace. You have a limited set of extensions to choose from. - -#### Theme Support - -Falkon also lets you customize the appearance to some extent. You can try them out if you want to change the appearance of the browser. - -![][9] - -#### Other Essential Settings - -![][10] - -I also explored other settings/functionalities like adding a bookmark or being able to manage the passwords. - -Or, maybe manage the notification access of a webpage. - -Oh, I also tried using YouTube – with no problems whatsoever. - -Of course, this isn’t an extensive review – but yes, Falkon does have all the essential options that you will need in a browser (unless you have a specific requirements). - -### Installing Falkon Browser - -You can easily find Falkon browser available in your Software Center. - -In case you don’t, you can find Flatpak/Snap packages available from its [official download page][11]. You’ll also find Windows installer files on the download page. - -[Download Falkon Browser][11] - -**Wrapping Up** - -As a KDE product, Falkon is tailored for KDE desktop environment. Some KDE distributions like OpenMandriva use Falkon as the default web browser. - -Falkon browser is for the ones looking for a lightweight and feature-rich web browser. An alternative worth taking a look is [Midori][12]. - -In my opinion, it is a good alternative browser – unless you need tons of extensions, cross-platform synchronization and require to access some browser-specific websites. - -What do you think about the Falkon browser? Let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/falkon-browser/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-screenshot.jpg?ssl=1 -[2]: https://www.falkon.org/ -[3]: https://wiki.qt.io/QtWebEngine -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser.png?ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-adblock.jpg?ssl=1 -[6]: https://itsfoss.com/privacy-search-engines/ -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/session-manager-falkon.jpg?ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-extensions.png?ssl=1 -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-theme.png?ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-preference.png?ssl=1 -[11]: https://www.falkon.org/download/ -[12]: https://itsfoss.com/midori-browser/ diff --git a/translated/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md b/translated/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md new file mode 100644 index 0000000000..18d42af58a --- /dev/null +++ b/translated/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md @@ -0,0 +1,121 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (App Highlight: Falkon Open Source Web Browser from KDE) +[#]: via: (https://itsfoss.com/falkon-browser/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +应用推荐:来自 KDE 的 Falkon 开源 Web 浏览器 +====== + +_**它以前称为 Qupzilla,Falkon 是基于 QtWebEngine 的 Web 浏览器。在本周的“应用推荐”中,我们来看看这个开源软件。**_ + +### Falkon:适用于 Linux(和 Windows)的开源 Web 浏览器 + +![][1] + +首先,[Falkon][2] 不是新的 Web 浏览器。它自 2010 年以来一直在开发中,但被称为 Qupzilla。 + +2017 年,QupZilla 移到 KDE 旗下,并更名为 Falkon。处于 KDE 旗下意味着项目会按照 KDE 标准积极维护。 + +它使用 [QtWebEngine][3] 渲染引擎,这是 Chromium 核心的简化版本。 + +在本文中,我将仔细研究它提供的功能以及与 Linux 上其他主流 Web 浏览器的不同之处。 + +### Falkon 浏览器的功能 + +我认为它可能不是流行的浏览器,但我发现它足以浏览现代 Web 服务。 + +让我重点介绍 Falkon 的主要功能,如果你觉得它很有趣,请尝试一下。 + +#### 简单的用户界面 + +![][4] + +我知道这不完全是一项“功能”,但是用户体验 (UX) 至关重要。尽管是轻量级的浏览器,但你会拥有一个不错的界面。你不会觉得使用的是 2000 年早期的浏览器。 + +#### AdBlock 扩展 + +![][5] + +它附带了 AdBlock 扩展程序,如果你想在浏览网站时摆脱广告,它大的效果很好。你还可以自定义 AdBlock 扩展的行为。 + +#### DuckDuckGo 作为默认搜索引擎 + +如果你不喜欢使用 Google,那么最好将[主打隐私的搜索引擎][6]之一设为默认搜索引擎。 + +#### 会话管理器 + +![][7] + +Falkon 在浏览器菜单的可用选项中包含了一个有用的会话管理器。你可以用它还原特定的近期会话,这应该能派上用场。 + +#### 扩展支持 + +![][8] + +它确实支持添加扩展,但你不能从 Chrome/Firefox 插件市场添加扩展。你只能选择有限的一组扩展。 + +#### 主题支持 + +Falkon 还允许你在某种程度上自定义外观。如果要更改浏览器的外观,可以尝试一下。 + +![][9] + +#### 其他基本设置 + +![][10] + +我还尝试了其他设置/功能,例如添加书签或管理密码。 + +或者,管理网页的通知。 + +我还试了 YouTube,没有任何问题。 + +当然,这不是一个详尽的评测。但是,Falkon 确实拥有浏览器中需要的所有基本功能(除非你有特定要求)。 + +### 安装 Falkon 浏览器 + +你可以在软件中心轻松找到 Falkon 浏览器。 + +如果没有,你可以从它的[官方下载页面][11]中找到 Flatpak/Snap 包。你还可以在下载页面上找到 Windows 的安装程序。 + +[Download Falkon Browser][11] + +**总结** + +作为 KDE 产品,Falkon 是为 KDE 桌面环境量身定制的。一些 KDE 发行版(例如 OpenMandriva)使用 Falkon 作为默认的 Web 浏览器。 + +Falkon 浏览器适合那些正在寻求轻巧且功能丰富的 Web 浏览器的人。值得尝试的一个替代是 [Midori][12]。 + +我认为,除非你需要大量的扩展、跨平台同步并且需要访问某些特定于浏览器的网站,不然它是一个很好的替代浏览器,。 + +你如何看待 Falkon 浏览器?请在下面的评论中让我知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/falkon-browser/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-screenshot.jpg?ssl=1 +[2]: https://www.falkon.org/ +[3]: https://wiki.qt.io/QtWebEngine +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser.png?ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-adblock.jpg?ssl=1 +[6]: https://itsfoss.com/privacy-search-engines/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/session-manager-falkon.jpg?ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-extensions.png?ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-theme.png?ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-preference.png?ssl=1 +[11]: https://www.falkon.org/download/ +[12]: https://itsfoss.com/midori-browser/ From 4f52933f2e7e3246e017175ae0d2625920a1de0e Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 30 Dec 2019 09:08:34 +0800 Subject: [PATCH 121/430] translating --- ...226 Darktable 3 Released With GUI Rework and New Features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20191226 Darktable 3 Released With GUI Rework and New Features.md b/sources/news/20191226 Darktable 3 Released With GUI Rework and New Features.md index 9463a07712..665f5f585a 100644 --- a/sources/news/20191226 Darktable 3 Released With GUI Rework and New Features.md +++ b/sources/news/20191226 Darktable 3 Released With GUI Rework and New Features.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From beabd728b8c7fb0fe791ef2636a499b712ea17c6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Dec 2019 09:35:49 +0800 Subject: [PATCH 122/430] PRF @geekpi --- ...mize your Linux desktop with KDE Plasma.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/tech/20191221 Customize your Linux desktop with KDE Plasma.md b/translated/tech/20191221 Customize your Linux desktop with KDE Plasma.md index 402fcd0e3b..c4a3f64a24 100644 --- a/translated/tech/20191221 Customize your Linux desktop with KDE Plasma.md +++ b/translated/tech/20191221 Customize your Linux desktop with KDE Plasma.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Customize your Linux desktop with KDE Plasma) @@ -9,12 +9,14 @@ 使用 KDE Plasma 定制 Linux 桌面 ====== -本文是 24 天 Linux 桌面特别系列的一部分。如果你认为没有太多机会进行自定义桌面,KDE Plasma 可能适合你。 + +> 本文是 24 天 Linux 桌面特别系列的一部分。如果你认为没有太多自定义桌面的需要,KDE Plasma 可能适合你。 + ![5 pengiuns floating on iceburg][1] -KDE 社区的 Plasma 桌面是开源桌面中的巅峰之作。KDE 很早就进入了 Linux 桌面市场,但是由于它的 基础 Qt 工具包当时没有完全开放的许可证,因此才有 [GNOME][2] 桌面。在此之后,Qt 开源了,并且 KDE(及其衍生产品,例如 [Trinity桌面][3])开始蓬勃发展。 +KDE 社区的 Plasma 桌面是开源桌面环境中的巅峰之作。KDE 很早就进入了 Linux 桌面环境市场,但是由于它的基础 Qt 工具包当时没有完全开放的许可证,因此才有 [GNOME][2] 桌面。在此之后,Qt 开源了,并且 KDE(及其衍生产品,例如 [Trinity 桌面][3])开始蓬勃发展。 -你可能会在发行版的软件仓库中找到 KDE 桌面,或者可以下载并安装将 KDE 作为默认桌面的发行版。在安装之前,请注意,KDE 提供了完整、集成且强大的桌面体验,因此会同时安装几个 KDE 应用。如果你已经在运行其他桌面,那么将发现有几个冗余的应用(两个 PDF 阅读器、多个媒体播放器、两个或多个文件管理器,等等)。如果你只想尝试而不是一直使用 KDE 桌面,那么可以在虚拟机,如[GNOME Boxes][4]中安装基于 KDE 的发行版,也可以尝试使用可引导的操作系统,例如 [Porteus][5]。 +你可能会在发行版的软件仓库中找到 KDE 桌面,或者可以下载并安装将 KDE 作为默认桌面的发行版。在安装之前,请注意,KDE 提供了完整、集成且强大的桌面体验,因此会同时安装几个 KDE 应用。如果你已经在运行其他桌面,那么将发现有几个冗余的应用(两个 PDF 阅读器、多个媒体播放器、两个或多个文件管理器,等等)。如果你只想尝试而不是一直使用 KDE 桌面,那么可以在虚拟机,如 [GNOME Boxes][4] 中安装基于 KDE 的发行版,也可以尝试使用可引导的操作系统,例如 [Porteus][5]。 ### KDE 桌面之旅 @@ -22,15 +24,15 @@ KDE 社区的 Plasma 桌面是开源桌面中的巅峰之作。KDE 很早就进 ![KDE Plasma desktop][7] -但是,使 KDE 与众不同的是,你几乎可以更改任何想要的东西。Qt 工具包可以以令人惊讶的方式分割和重新排列,这意味着你实质上可以使用 KDE 的部件作为基础来设计自己的桌面。桌面行为的可用设置也很多。KDE 可以充当标准桌面,平铺窗口管理器以及两者之间的任意形式。你可以通过窗口类、角色、类型、标题或它们的任意组合来创建自己的窗口规则,因此,如果希望特定应用的行为不同于其他行为,那么可以创建全局设置的例外。 +但是,使 KDE 与众不同的是,你几乎可以更改任何想要的东西。Qt 工具包可以以令人惊讶的方式分割和重新排列,这意味着你实质上可以使用 KDE 的部件作为基础来设计自己的桌面。桌面行为的可用设置也很多。KDE 可以充当标准桌面、平铺窗口管理器以及两者之间的任意形式。你可以通过窗口类、角色、类型、标题或它们的任意组合来创建自己的窗口规则,因此,如果希望特定应用的行为不同于其他行为,那么可以创建全局设置的例外。 -此外,它还有丰富的小部件集合,使你可以自定义与桌面交互的方式。它有一个类似 GNOME 的全屏应用启动器,一个类似 Unity 的 dock 启动器和仅有图标的任务栏,一个传统的任务栏。你可以在屏幕的任何边缘上创建和放置面板。 +此外,它还有丰富的小部件集合,使你可以自定义与桌面交互的方式。它有一个类似 GNOME 的全屏应用启动器,一个类似 Unity 的 dock 启动器和仅有图标的任务栏,以及一个传统的任务栏。你可以在屏幕的任何边缘上创建和放置面板。 ![A slightly customized KDE desktop][8] -实际上,它有太多的自定义项了,因此 KDE 最常见的批评之一是它的_太过可定制化_,所以请记住,自定义项是可选的。你可以在默认配置下使用 Plasma 桌面,并仅在你认为必要时逐步进行更改。Plasma 桌面配置选项最重要的不是它们的数目,而是它们容易发现和直观,它们都在系统设置应用或者右键单击中。 +实际上,它有太多的自定义项了,因此 KDE 最常见的批评之一是它的*太过可定制化*,所以请记住,自定义项是可选的。你可以在默认配置下使用 Plasma 桌面,并仅在你认为必要时逐步进行更改。Plasma 桌面配置选项最重要的不是它们的数目,而是它们容易发现和直观,它们都在系统设置应用或者右键单击中。 -事实是,在 KDE 上,几乎绝不会只有一种方法可以完成任何给定的任务,并且它的用户将其视为其最大的优势。KDE 中没有隐含的工作流,只有默认的。并且可以更改所有默认设置,直到你需要桌面做的成为你的习惯。 +事实是,在 KDE 上,几乎绝不会只有一种方法可以完成任何给定的任务,并且它的用户将这个视为其最大的优势。KDE 中没有隐含的工作流,只有默认的。并且可以更改所有默认设置,直到你需要桌面做的成为你的习惯。 ### 一致性和集成 @@ -42,8 +44,6 @@ KDE 社区以一致性和集成为荣,出色的开发人员、社区管理以 KDE 适合所有人。使用其默认设置可获得流畅、原始的桌面体验,或对其进行自定义以使其成为自己专属。它是一个稳定、有吸引力且强大的桌面环境,可能有你想要在 Linux 完成要做的事的一切。 -KDE 最初代表 Kool Desktop Environment,但现在被许多人称为 K Desktop。 - -------------------------------------------------------------------------------- via: https://opensource.com/article/19/12/linux-kde-plasma @@ -51,7 +51,7 @@ via: https://opensource.com/article/19/12/linux-kde-plasma 作者:[Seth Kenlon][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/) 荣誉推出 @@ -67,4 +67,4 @@ via: https://opensource.com/article/19/12/linux-kde-plasma [8]: https://opensource.com/sites/default/files/uploads/advent-kde-dock.jpg (A slightly customized KDE desktop) [9]: https://kde.org/applications/ [10]: https://opensource.com/life/16/5/how-use-digikam-photo-management -[11]: https://opensource.com/sites/default/files/uploads/advent-kde.jpg (KDE on Porteus) \ No newline at end of file +[11]: https://opensource.com/sites/default/files/uploads/advent-kde.jpg (KDE on Porteus) From 27a8309da928f8c80bd1a779951709db944121ee Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Dec 2019 09:36:24 +0800 Subject: [PATCH 123/430] PUB @geekpi https://linux.cn/article-11728-1.html --- .../20191221 Customize your Linux desktop with KDE Plasma.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191221 Customize your Linux desktop with KDE Plasma.md (98%) diff --git a/translated/tech/20191221 Customize your Linux desktop with KDE Plasma.md b/published/20191221 Customize your Linux desktop with KDE Plasma.md similarity index 98% rename from translated/tech/20191221 Customize your Linux desktop with KDE Plasma.md rename to published/20191221 Customize your Linux desktop with KDE Plasma.md index c4a3f64a24..23f83f5d41 100644 --- a/translated/tech/20191221 Customize your Linux desktop with KDE Plasma.md +++ b/published/20191221 Customize your Linux desktop with KDE Plasma.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11728-1.html) [#]: subject: (Customize your Linux desktop with KDE Plasma) [#]: via: (https://opensource.com/article/19/12/linux-kde-plasma) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From e527b584873e3b2838a4bf93f82cc291d03d4e32 Mon Sep 17 00:00:00 2001 From: algzjh Date: Mon, 30 Dec 2019 14:08:24 +0800 Subject: [PATCH 124/430] translating by algzjh --- ...0191229 The best resources for agile software development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191229 The best resources for agile software development.md b/sources/tech/20191229 The best resources for agile software development.md index 2e504f3d45..84c8c09548 100644 --- a/sources/tech/20191229 The best resources for agile software development.md +++ b/sources/tech/20191229 The best resources for agile software development.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (algzjh) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 31b79577a8c9c3510734778f15e389f2236cfb4f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Dec 2019 21:08:04 +0800 Subject: [PATCH 125/430] APL --- .../20191113 How to cohost GitHub and GitLab with Ansible.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191113 How to cohost GitHub and GitLab with Ansible.md b/sources/tech/20191113 How to cohost GitHub and GitLab with Ansible.md index a635054dae..e71aed34ce 100644 --- a/sources/tech/20191113 How to cohost GitHub and GitLab with Ansible.md +++ b/sources/tech/20191113 How to cohost GitHub and GitLab with Ansible.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 02beba8457b17969a9c75c3f4332fe306511bc88 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Dec 2019 23:31:08 +0800 Subject: [PATCH 126/430] TSL --- ...o cohost GitHub and GitLab with Ansible.md | 175 ------------------ ...o cohost GitHub and GitLab with Ansible.md | 168 +++++++++++++++++ 2 files changed, 168 insertions(+), 175 deletions(-) delete mode 100644 sources/tech/20191113 How to cohost GitHub and GitLab with Ansible.md create mode 100644 translated/tech/20191113 How to cohost GitHub and GitLab with Ansible.md diff --git a/sources/tech/20191113 How to cohost GitHub and GitLab with Ansible.md b/sources/tech/20191113 How to cohost GitHub and GitLab with Ansible.md deleted file mode 100644 index e71aed34ce..0000000000 --- a/sources/tech/20191113 How to cohost GitHub and GitLab with Ansible.md +++ /dev/null @@ -1,175 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to cohost GitHub and GitLab with Ansible) -[#]: via: (https://opensource.com/article/19/11/how-host-github-gitlab-ansible) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -How to cohost GitHub and GitLab with Ansible -====== -Protect your access to important projects by mirroring Git repositories -with Ansible. -![Hands programming][1] - -Open source is everywhere. It's in your computer at home, it's in your computer at work, it's on the internet, and a lot of it is managed with [Git][2]. Because Git is decentralized, many people also think of it as a kind of crowdsourced backup solution. The theory is that each time someone clones a Git repository to their local computer, they are creating a backup of the project's source code. If 100 people do that, then there are 100 backup copies of a repository. - -This, in theory, mitigates "disasters" such as a project maintainer [suddenly deciding to remove a repository][3] or [inexplicably blocking all traffic][4] and leaving developers scrambling to figure out who has the latest version of the master branch. Similarly, entire code-hosting sites have disappeared in the past. Nobody anticipated the closure of Google Code, Microsoft CodePlex, or Gitorious when they were at their peak. - -In short, if the internet has taught us anything over the past few decades, it's that relying on the internet to magically create backups isn't the most reliable road to redundancy. - -Besides, it's a problem for a lot of people that many open source projects are hosted on GitHub, which is not an open platform. Many developers and users would prefer to support and interact with a stack such as GitLab, which has an open source community edition. - -### Using Ansible for Git - -Git's decentralization is useful in solving this problem. Using pure Git, you can easily push to two or more repositories with a single **push** command. However, for that to be useful against unexpected failure, you must be interacting (and pushing, specifically) with a Git repository frequently. Furthermore, there may be repositories out there that you want to back up, even though you may never push or pull the code yourself. - -But using Ansible, you can automate Git pulls of a project's master branch (or any other branch, for that matter) and then automate Git pushes of the repository to an "offsite" mirror. In other words, you can have your computer regularly pull from GitHub and push to GitLab or [Gitolite][5] or Gitea (or whatever Git host you prefer). - -### Ansible modules - -There wouldn't be much to Ansible if it weren't for its excellent collection of modules. Like third-party libraries for Python or applications for Linux, the technical _driver_ of the useful and surprisingly easy tricks Ansible is famous for are the parts that other people have already figured out for you. Because this article is tackling how to effectively and reliably backup a Git repository, the modules used here are the [Git module][6] and the [ini_file][7] module. - -To begin, create a file called **mirror.yaml** to serve as the playbook. You can start mostly as you usually do with Ansible, with **name** and **task** entries. This example adds **localhost** to the **hosts** list so that the play runs on the controller machine (the computer you're sitting at right now), but in real life, you would probably run this on a specific host or group of hosts on your network. - - -``` -\--- -\- name: "Mirror a Git repo with Ansible" -  hosts: localhost -  tasks: -``` - -### Git pull and clone - -If you're going to make a backup, then you need a copy of the latest code. The obvious way to make that happen with a Git repository is to perform a **git pull**. However, **pull** assumes that a clone already exists, and a well-written Ansible _play_ (an Ansible script) assumes as little as possible. It's better to tell Ansible to **clone** a repository first. - -Add your first task to your playbook: - - -``` -\--- -\- name: "Mirror a Git repo with Ansible" -  hosts: localhost -  vars: -    git_dir: /tmp/soso.git -  tasks: - -  - name: "Clone the git repo" -    git: -       repo: '' -       dest: '{{ git_dir }}' -       clone: yes -       update: yes -``` - -This example uses the open source, Unix-like operating system **soso** as the repository I want to mirror. This is a completely arbitrary choice and in no way implies a lack of confidence in this repository's future. It also uses a variable to refer to the destination folder, **/tmp/soso.git**, which is convenient now and also beneficial later should you want to scale this out to be a generic mirroring script. In real life, you would probably have a more permanent location than **/tmp**, such as **/home/gitmirrors/soso.git** or **/opt/gitmirrors/soso.git**, on your worker machine. - -Run your playbook: - - -``` -`$ ansible-playbook mirror.yaml` -``` - -The first time you run the playbook, Ansible correctly detects that the Git repository does not yet exist locally, so it clones it. - - -``` -PLAY [Ansible Git mirror] ******** - -TASK [Gathering Facts] *********** -ok: [localhost] - -TASK [Clone git repo] ************ -changed: [localhost] - -PLAY RECAP *********************** -localhost: ok=2 changed=1 failed=0 [...] -``` - -Should you run the playbook again, Ansible correctly detects that there have been no changes since the last time it was run and it reports that no actions were performed: - - -``` -`localhost: ok=2 changed=0 failed=0 [...]` -``` - -Next, Ansible must be instructed to push the repository to another Git server. - -### Git push - -The Git module in Ansible doesn't provide a **push** function, so that part of the process is manual. However, before you can push the repo to an alternate mirror, you have to have a mirror, and you have to configure the mirror as an alternate remote. - -First, you must add an alternate remote to your Git configuration. Because the Git config file is an INI-style configuration, you can use the **ini_file** Ansible module to append the required information easily. Add this to your playbook: - - -``` - - name: "Add alternate remote" -    ini_file: dest={{ git_dir }}/.git/config section='remote \"mirrored\"' option=url value='[git@gitlab.com][8]:example/soso-mirror.git' -    tags: configuration -``` - -For this to work, you must have an empty repository on your destination server (in this case, [GitLab.com][9]). If you need to create destination repositories in your playbook, you can do that by following Steve Ovens' excellent article "[How to use Ansible to set up a Git server over SSH][10]." - -Finally, use Git directly to push HEAD to your alternate remote: - - -``` - - name: "Push the repo to alternate remote" -    shell: 'git --verbose --git-dir={{ git_dir }}/.git push mirrored HEAD' -``` - -Run the playbook as usual, and then automate the process so that you never have to run it directly again. You can adjust the script with variables and specific Git commands to suit your needs, but with regular pulls and pushes, you can be sure that an important project that lives on one server is safely mirrored on another. - -Here is the full playbook for reference: - - -``` -\--- -\- name: "Mirror a Git repository with Ansible" -  hosts: localhost -  vars: -    git_dir: /tmp/soso.git - -  tasks: - -  - name: "Clone the Git repo" -    git: -       repo: '' -       dest: '{{ git_dir }}' -       clone: yes -       update: yes - -  - name: "Add alternate remote" -    ini_file: dest={{ git_dir }}/.git/config section='remote \"mirrored\"' option=url value='[git@gitlab.com][8]:example/soso-mirror.git' -    tags: configuration -  -  - name: "Push the repo to alternate remote" -    shell: 'git --verbose --git-dir={{ git_dir }}/.git push mirrored HEAD' -``` - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/11/how-host-github-gitlab-ansible - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop.png?itok=pGfEfu2S (Hands programming) -[2]: https://opensource.com/resources/what-is-git -[3]: https://github.com/AntiMicro/antimicro/issues/3 -[4]: https://opensource.com/article/19/10/how-community-saved-artwork-creative-commons -[5]: https://opensource.com/article/19/4/server-administration-git -[6]: https://docs.ansible.com/ansible/latest/modules/git_module.html -[7]: https://docs.ansible.com/ansible/latest/modules/ini_file_module.html -[8]: mailto:git@gitlab.com -[9]: http://GitLab.com -[10]: https://opensource.com/article/17/8/ansible-environment-management diff --git a/translated/tech/20191113 How to cohost GitHub and GitLab with Ansible.md b/translated/tech/20191113 How to cohost GitHub and GitLab with Ansible.md new file mode 100644 index 0000000000..4d9193d930 --- /dev/null +++ b/translated/tech/20191113 How to cohost GitHub and GitLab with Ansible.md @@ -0,0 +1,168 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to cohost GitHub and GitLab with Ansible) +[#]: via: (https://opensource.com/article/19/11/how-host-github-gitlab-ansible) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +如何使用 Ansible 同步 GitHub 和 GitLab +====== + +> 通过使用 Ansible 镜像 Git 存储库,保护对重要项目的访问。 + +![Hands programming][1] + +开源无处不在。它在家里的计算机上、在工作场所的计算机上、在互联网上,并且很多都由 [Git][2] 管理。由于 Git 是分布式的,因此许多人也将其视为一种众包的备份解决方案。从理论上讲,每当有人将 Git 存储库克隆到其本地计算机时,他们就是创建了项目源代码的备份。如果有 100 个人这样做,则存储库就有 100 个备份副本。 + +从理论上讲,这可以缓解“灾难”,例如项目维护者[突然决定删除存储库][3]或[莫名其妙地阻止所有流量][4],导致开发人员们无头苍蝇般地寻找谁拥有主分支的最新版本。类似的,整个代码托管站点也会消失。没有人会想到 Google Code、Microsoft CodePlex 或 Gitorious 会在鼎盛时期将被关闭。 + +简而言之,如果在过去的几十年中互联网教给了我们一些东西,那就是依靠互联网神奇地创建备份并不是冗余的最可靠途径。 + +此外,对于许多人来说,很多开源项目都托管在 GitHub 上是个问题,而 GitHub 不是开放平台。许多开发人员和用户都希望支持诸如 GitLab 之类的堆栈并与之交互,它具有开源社区版本。 + +### 使用 Ansible 管理 Git + +Git 的去中心方式对于解决这个问题很有用。使用纯 Git,你可以使用一个 `push` 命令轻松地将其推到两个或多个存储库。但是,为了使其在发生意外故障时有用,你必须经常与 Git 存储库进行交互(特别是推送)。此外,即使你可能永远不会自己推送或拉出代码,也可能有一些要备份的存储库。 + +但是,使用 Ansible,你可以自动执行项目主分支(或其他任何分支)的 Git 拉取,然后自动存储库到“异地”镜像的 Git 推送。换句话说,你可以让你的计算机定期从 GitHub 拉取并推送到 GitLab 或 [Gitolite][5] 或 Gitea(或你喜欢的任何 Git 主机)。 + +### Ansible 模块 + +如果 Ansible 并不是因为其出色的模块集合,那么它就没那么出色。像 Python 的第三方库或 Linux 的应用程序一样,这个技术驱动器有用而令人惊讶的简单技巧是,Ansible 以其他人贡献的组件而闻名。因为本文正在研究如何有效和可靠地备份 Git 存储库,所以这里使用的模块是 [Git 模块][6]和 [ini_file][7] 模块。 + +首先,创建一个名为 `mirror.yaml` 的文件作为剧本playbook。你可以像通常使用 Ansible 一样,从 `name` 和 `task` 条目开始。本示例将 `localhost` 添加到 `hosts` 列表中,以便在控制器计算机(你现在坐在前面的计算机)上运行动作play,但是在现实生活中,你可能会在特定的主机或一组网络上的主机上运行。 + +``` +--- +- name: "Mirror a Git repo with Ansible" + hosts: localhost + tasks: +``` + +### Git 拉取和克隆 + +如果要进行备份,则需要最新代码的副本。在 Git 仓库中实现这一目标的明显方法是执行 `git pull`。 但是,`pull` 会假定克隆已经存在,而写得很好的 Ansible 动作(Ansible 脚本)则尽可能少的假定。 最好先告诉 Ansible `clone` 存储库。 + +将你的第一个任务添加到剧本: + +``` +--- +- name: "Mirror a Git repo with Ansible" + hosts: localhost + vars: + git_dir: /tmp/soso.git + tasks: + + - name: "Clone the git repo" + git: + repo: 'https://github.com/ozkl/soso.git' + dest: '{{ git_dir }}' + clone: yes + update: yes +``` + +这个例子使用了开源的,类似于 Unix 的操作系统 soso 作为我要镜像的存储库。这是一个完全任意的选择,绝不意味着对该存储库的未来缺乏信心。它还使用变量来引用目标文件夹 `/tmp/soso.git`,这很方便,并且如果以后你希望将它扩展为一个通用的镜像脚本也会受益。在现实生活中,你的工作机上可能会比 `/tmp` 具有更永久的位置,例如 `/home/gitmirrors/soso.git` 或 `/opt/gitmirrors/soso.git`。 + +运行你的剧本: + +``` +$ ansible-playbook mirror.yaml +``` + +首次运行该剧本时,Ansible 会正确检测到 Git 存储库在本地尚不存在,因此将其克隆。 + +``` +PLAY [Ansible Git mirror] ******** + +TASK [Gathering Facts] *********** +ok: [localhost] + +TASK [Clone git repo] ************ +changed: [localhost] + +PLAY RECAP *********************** +localhost: ok=2 changed=1 failed=0 [...] +``` + +如果你再次运行该剧本,Ansible 会正确检测到自上次运行以来没有任何更改,并且会报告未执行任何操作: + +``` +localhost: ok=2 changed=0 failed=0 [...] +``` + +接下来,必须指示 Ansible 将存储库推送到另一个 Git 服务器。 + +### Git 推送 + +Ansible 中的 Git 模块不提供 `push` 功能,因此该过程的一部分是手动的。但是,在将存储库推送到备用镜像之前,你必须具有一个镜像,并且必须将镜像配置为备用远程服务器remote。 + +首先,必须将备用的远程服务器添加到 Git 配置。因为 Git 配置文件是 INI 样式的配置,所以你可以使用 `ini_file` Ansible 模块轻松地添加所需的信息。将此添加到你的剧本: + +``` + - name: "Add alternate remote" + ini_file: dest={{ git_dir }}/.git/config section='remote \"mirrored\"' option=url value='git@gitlab.com:example/soso-mirror.git' + tags: configuration +``` + +为此,你必须在目标服务器上有一个空的存储库(在本例中为 [GitLab.com][9])。如果需要在剧本中创建目标存储库,可以按照 Steve Ovens 的出色文章《[如何使用 Ansible 通过 SSH 设置 Git 服务器][10]》来完成。 + +最后,直接使用 Git 将 HEAD 推送到备用远程服务器: + +``` + - name: "Push the repo to alternate remote" + shell: 'git --verbose --git-dir={{ git_dir }}/.git push mirrored HEAD' +``` + +像往常一样运行该剧本,然后使该过程自动化,这样你就不必再次直接运行它了。你可以使用变量和特定的 Git 命令来调整脚本以适应你的需求,但是通过常规的拉取和推送操作,可以确保驻留在一台服务器上的重要项目可以安全地镜像到另一台服务器上。 + +这是完整的剧本,供参考: + +``` +--- +- name: "Mirror a Git repository with Ansible" + hosts: localhost + vars: + git_dir: /tmp/soso.git + + tasks: + + - name: "Clone the Git repo" + git: + repo: 'https://github.com/ozkl/soso.git' + dest: '{{ git_dir }}' + clone: yes + update: yes + + - name: "Add alternate remote" + ini_file: dest={{ git_dir }}/.git/config section='remote \"mirrored\"' option=url value='git@gitlab.com:example/soso-mirror.git' + tags: configuration + + - name: "Push the repo to alternate remote" + shell: 'git --verbose --git-dir={{ git_dir }}/.git push mirrored HEAD' +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/11/how-host-github-gitlab-ansible + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop.png?itok=pGfEfu2S (Hands programming) +[2]: https://opensource.com/resources/what-is-git +[3]: https://github.com/AntiMicro/antimicro/issues/3 +[4]: https://opensource.com/article/19/10/how-community-saved-artwork-creative-commons +[5]: https://opensource.com/article/19/4/server-administration-git +[6]: https://docs.ansible.com/ansible/latest/modules/git_module.html +[7]: https://docs.ansible.com/ansible/latest/modules/ini_file_module.html +[8]: mailto:git@gitlab.com +[9]: http://GitLab.com +[10]: https://opensource.com/article/17/8/ansible-environment-management From 5f1725dca61cce9890bdce61d3a0866fbe191b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 31 Dec 2019 08:08:05 +0800 Subject: [PATCH 127/430] Translated --- ... chapter template in LibreOffice Writer.md | 118 ----------------- ... chapter template in LibreOffice Writer.md | 124 ++++++++++++++++++ 2 files changed, 124 insertions(+), 118 deletions(-) delete mode 100644 sources/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md create mode 100644 translated/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md diff --git a/sources/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md b/sources/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md deleted file mode 100644 index 0d8bfed9ce..0000000000 --- a/sources/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md +++ /dev/null @@ -1,118 +0,0 @@ -Translating by robsean -How to create an e-book chapter template in LibreOffice Writer -====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_colorbooks.png?itok=vNhsYYyC) -For many people, using a word processor is the fastest, easiest, and most familiar way to write and publish an e-book. But firing up your word processor and typing away isn't enough--you need to follow a format. - -That's where a template comes in. A template ensures that your book has a consistent look and feel. Luckily, creating a template is quick and easy, and the time and effort you spend on it will give you a better-looking book. - -In this article, I'll walk you through how to create a simple template for writing individual chapters of an e-book using LibreOffice Writer. You can use this template for both PDF and EPUB books and modify it to suit your needs. - -### My approach - -Why am I focusing on creating a template for a chapter rather than one for an entire book? Because it's easier to write and manage individual chapters than it is to work on a single monolithic document. - -By focusing on individual chapters, you can focus on what you need to write. You can easily move those chapters around, and it's less cumbersome to send a reviewer a single chapter rather than your full manuscript. When you've finished writing a chapter, you can simply stitch your chapters together to publish the book (I'll discuss how to do that below). But don't feel that you're stuck with this approach--if you prefer to write in single file, simply adapt the steps described in this article to doing so. - -Let's get started. - -### Setting up the page - -This is important only if you plan to publish your e-book as a PDF. Setting up the page means your book won't comprise a mass of eye-straining text running across the screen. - -Select **Format > Page** to open the **Page Style** window. My PDF e-books are usually 5x8 inches tall (about 13x20cm, for those of us in the metric world). I also set the margins to half an inch (around 1.25 cm). These are my preferred dimensions; use whatever size suits you. - -![LibreOffice Page Style window][2] - - -The Page Style window in LibreOffice Writer lets you set margins and format the page. - -Next, add a footer to display a page number. Keep the Page Style window open and click the **Footer** tab. Select **Footer on** and click **OK**. - -On the page, click in the footer, then select **Insert > Field > Page Number**. Don't worry about the position and appearance of the page number; we'll take care of that next. - -### Setting up your styles - -Like the template itself, styles provide a consistent look and feel for your documents. If you want to change the font or the size of a heading, for example, you need do it in only one place rather than manually applying formatting to each heading. - -The standard LibreOffice template comes with a number of styles that you can fiddle with to suit your needs. To do that, press **F11** to open the **Styles and Formatting** window. - - -![LibreOffice styles and formatting][4] - - -Change fonts and other details using the Styles and Formatting window. - -Right-click on a style and select **Modify** to edit it. Here are the main styles that I use in every book I write: - -Style Font Spacing/Alignment Heading 1 Liberation Sans, 36 pt 36 pt above, 48 pt below, aligned left Heading 2 Liberation Sans, 18 pt 12 pt above, 12 pt below, aligned left Heading 3 Liberation Sans, 14 pt 12 pt above, 12 pt below, aligned left Text Body Liberation Sans, 12 pt 12 pt above, 12 pt below, aligned left Footer Liberation Sans, 10 pt Aligned center - - -![LibreOffice styles in action][6] - - -Here's what a selected style looks like when applied to ebook content. - -That's usually the bare minimum you need for most books. Feel free to change the fonts and spacing to suit your needs. - -Depending on the type of book you're writing, you might also want to create or modify styles for bullet and number lists, quotes, code samples, figures, etc. Just remember to use fonts and their sizes consistently. - -### Saving your template - -Select **File > Save As**. In the Save dialog box, select _ODF Text Document Template (.ott)_ from the formats list. This saves the document as a template, which you'll be able to quickly call up later. - -The best place to save it is in your LibreOffice templates folder. In Linux, for example, that's in your **/home** directory, under . **config/libreoffice/4/user/template**. - -### Writing your book - -Before you start writing, create a folder on your computer that will hold all the files--chapters, images, notes, etc.--for your book. - -When you're ready to write, fire up LibreOffice Writer and select **File > New > Templates**. Then select your template from the list and click **Open**. - - -![LibreOffice Writer template list][8] - - -Select your template from the list you set up in LibreOffice Writer and begin writing. - -Then save the document with a descriptive name. - -Avoid using conventions like _Chapter 1_ and _Chapter 2_ --at some point, you might decide to shuffle your chapters around, and it can get confusing when you're trying to manage those chapters. You could, however, put chapter numbers, like _Chapter 1_ or _Ch1,_ in the file name. It's easier to rename a file like that if you do wind up rearranging the chapters of your book. - -With that out of the way, start writing. Remember to use the styles in the template to format the text--that's why you created the template, right? - -### Publishing your e-book - -Once you've finished writing a bunch of chapters and are ready to publish them, create a master document. Think of a master document as a container for the chapters you've written. Using a master document, you can quickly assemble your book and rearrange your chapters at will. The LibreOffice help offers detailed instructions for working with [master documents][9]. - -Assuming you want to generate a PDF, don't just click the **Export Directly to PDF** button. That will create a decent PDF, but you might want to optimize it. To do that, select **File > Export as PDF** and tweak the settings in the PDF options window. You can learn more about that in the [LibreOffice Writer documentation][10]. - -If you want to create an EPUB instead of, or in addition to, a PDF, install the [Writer2EPUB][11] extension. Opensource.com's Bryan Behrenshausen [shares some useful instructions][12] for the extension. - -### Final thoughts - -The template we've created here is bare-bones, but you can use it for a simple book, or as the starting point for building a more complex template. Either way, this template will quickly get you started writing and publishing your e-book. - -### About The Author -Scott Nesbitt;I'M A Long-Time User Of Free Open Source Software;Write Various Things For Both Fun;Profit. I Don'T Take Myself Too Seriously;I Do All Of My Own Stunts. You Can Find Me At These Fine Establishments On The Web - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/17/10/creating-ebook-chapter-template-libreoffice-writer - -作者:[Scott Nesbitt][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/scottnesbitt -[2]:https://opensource.com/sites/default/files/images/life-uploads/lo-page-style.png (LibreOffice Page Style window) -[4]:https://opensource.com/sites/default/files/images/life-uploads/lo-paragraph-style.png (LibreOffice styles and formatting window) -[5]:/file/374466 -[6]:https://opensource.com/sites/default/files/images/life-uploads/lo-styles-in-action.png (Example of LibreOffice styles) -[8]:https://opensource.com/sites/default/files/images/life-uploads/lo-template-list.png (Template list - LibreOffice Writer) -[9]:https://help.libreoffice.org/Writer/Working_with_Master_Documents_and_Subdocuments -[10]:https://help.libreoffice.org/Common/Export_as_PDF -[11]:http://writer2epub.it/en/ -[12]:https://opensource.com/life/13/8/how-create-ebook-open-source-way diff --git a/translated/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md b/translated/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md new file mode 100644 index 0000000000..c73f774162 --- /dev/null +++ b/translated/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md @@ -0,0 +1,124 @@ +如何在 LibreOffice Writer 中创建一个电子书章节模板 +====== +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_colorbooks.png?itok=vNhsYYyC) + +对于很多人来说,使用 word 程序来写和发布一本电子书是一种最好的,最容易的,最熟悉的方法。但是,启动你的 word 程序和打字是不够的--你需要遵循一种格式。 + +这就是模板的来源。一个模板确保你的电子书有一个一致的外观和体验。幸运的是,创建一个模板是快速和容易的,并你在其上花费的时间和努力将给你一本更好感官的书。 + +在这片文章中,我将陪伴你走过如何使用 LibreOffice Writer 创建一个简单的用于写一本电子书的各个章节的模板。你可以将这个模板用于 PDF 和 EPUB 书籍,并假以修改来满足你的需要。 + +### 我的方法 + +为什么我聚焦于为一个章节创建一个模板,而不是为一整本书创建一个模板?因为编写和管理单独的章节比编写和管理单个庞大而僵化的文档更容易。 + +通过聚焦于单独的章节,你可以聚焦于你需要编写的东西。你可以容易地向各处移动这些章节,给审阅者发单独一章节比发你完整的原稿更简单而高效。当你写完一章后,你可以简单地把你的章节拼凑在一起来出版这本书(我将在下面讨论如何做到这一点)。但是不要觉得你被这种方法所束缚 --如果你更喜欢在单个文件中编写,简单地调整在这篇文章中描述的步骤来做做成这样。 + +让我们开始吧。 + +### 设置页面 + +仅当你计划发布你的电子书为一本 PDF 书时,这是很重要的。设置页面意味着你的书将不包含大量的穿越屏幕的让眼睛疲劳的文本。 + +选择 **格式 > 页面** 来打开 **页面样式** 窗口。我的 PDF 电子书通常是 5x8 英寸高(大约 13x20cm ,对于我们这些生活在米制世界的人来说)。我也设置页边距为半英寸(约 1.25 cm)。这些是我较喜欢的尺寸;使用任何适合你的尺寸。 + +![LibreOffice Page Style window][2] + + +在 LibreOffice Writer 中的页面样式窗口让你设置页边距和页格式。 + +接下来,添加页脚以显示页码。保持页面样式窗口打开着,并单击 **页脚** 选项卡。选择 **在页脚上** 并单击 **确定** 。 + +在该页面上,在页脚中单击,然后选择 **插入 > 字段 > 页码**。不要担心页码的位置和外观;我们接下来会处理。 + +### 设置你的样式 + +像模板本身一样,样式为你的文档提供一种一致的外观和体验。如果你想更改一个标题的字体或大小,例如,你只需要在一个地方完成它,而不是手动应用格式化到每个标题。 + +标准化的 LibreOffice 模板带有许多样式,你可以调整它们以适应你的需要。为此,按 **F11** 来打开 **样式和格式** 窗口。 + + +![LibreOffice styles and formatting][4] + + +使用样式和格式窗口更改字体和其它细节。 + +在一个样式上右键单击,并选择 **修改** 来编辑它。 这里是我在每本中使用的主要样式: + + 样式 | 字体 | 间距 / 对齐方式 + :-: | :-: | :-: + 标题 1 | Liberation Sans, 36 pt | 上面 36 pt ,下面 48 pt ,左对齐 + 标题 2 | Liberation Sans, 18 pt | 上面 12 pt ,下面 12 pt ,左对齐 + 标题 3 | Liberation Sans, 14 pt | 上面 12 pt ,下面 12 pt ,左对齐 + 正文 | Liberation Sans, 12 pt | 上面 12 pt ,下面 12 pt ,左对齐 + 页脚 | Liberation Sans, 10 pt | 居中对齐 + + +![LibreOffice styles in action][6] + + +这是当我们应用到电子书内容时的一个选择的样式外观。 + +对于大多数书来说,这通常是最小量要求。可以随便更改字体和空格来适应你的要求。 + +根据你正在编写书的类型,你可能也想创建或修改项目符合样式,以及数字列表,引号、代码示例,数字符号等等。只需要记住始终如一地使用字体以及其大小。 + +### 保存你的模板 + +选择 **文件 > 另存为** 。在保持对话框中,从格式列表中选择 _ODF 文本文档模板 (.ott)_ 。这将保存模板为一个模板,以后你可以快速调用该模板。 + +保存模板的最佳位置是 LibreOffice 模板文件夹。例如,在 Linux 中,那是在你的 **/home** 目录下,在 . **config/libreoffice/4/user/template** 下。 + +### 编写你的书 + +在你开始编写前,在你的计算机上创建一个文件夹,它将为你的书保存所有的文件--章节,图像,笔记等等。 + +当你准备编写时,启动 LibreOffice Writer 并选择 **文件 > 新建 > 模板** 。然后从列表中选择你的模板,并单击 **打开**。 + + +![LibreOffice Writer template list][8] + + +从你在 LibreOffice Writer 中设置的列表中选择你的模板,并开始编写。 + +然后用一个描述性名称保存文档。 + +建议使用像 _章节 1_ 和 _章节 2_ 这样的惯例--在某些时候,你可能决定重新编排你的章节,当你尝试管理这些章节时,它可能会变得混乱。然而,你可以在文件名称中放置章节数字,像 _章节 1_ 或 _Ch1 。很容易重命名一个文件,_ 。如果你完成重新排版书的章节,像这样重命名更容易。 + +别再碍事,开始编写。记住在模板中使用样式来格式化文本--这就是为什么你要创建模板,对吧? + +### 发布你的电子书 + +在完成编写一堆章节后,并准备发布它们时,创建一个主控文档。把一个主控文档作为你所编写章节的一个容器。使用一个主控文档,你可以快速地组装你的书,并任意重新排序你的章节。LibreOffice 帮助提供使用[主控文档][9]的详细信息。 + +假设你想生成一个 PDF ,不要只是单击**直接导出到 PDF** 按钮。这将创建一个相当不错的 PDF ,但是你可能想优化它。为此,选择 **文件 > 导出为 PDF** ,并在 PDF 窗口中轻微调整。你可以在 [LibreOffice Writer 文档][10] 中学到更多东西。 + +如果你想创建一个 EPUB 而不是 一个PDF ,或者除了一个 PDF 以外,另外创建一个 EPUB,安装 [Writer2EPUB][11] 扩展。Opensource.com 的 Bryan Behrenshausen 为这个扩展[分享一些有用的说明][12] 。 + +### 结束语 + +我们在这里创建的模板是极简单的,但是你将其用于一本简单的书,或者作为构建一个复杂模板的起点。不管怎样,这个模板都会让你快速地开始编写和发布你的电子书。 + +### 关于作者About The Author +Scott Nesbitt ;我是一个长期使用自由开放源码软件的人;写各种东西都是为了玩;盈利。我不太看重我自己;我做我自己的特效。你可以在网上的一些高质量的大型组装找到我的踪迹。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/17/10/creating-ebook-chapter-template-libreoffice-writer + +作者:[Scott Nesbitt][a] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/scottnesbitt +[2]:https://opensource.com/sites/default/files/images/life-uploads/lo-page-style.png (LibreOffice Page Style window) +[4]:https://opensource.com/sites/default/files/images/life-uploads/lo-paragraph-style.png (LibreOffice styles and formatting window) +[5]:/file/374466 +[6]:https://opensource.com/sites/default/files/images/life-uploads/lo-styles-in-action.png (Example of LibreOffice styles) +[8]:https://opensource.com/sites/default/files/images/life-uploads/lo-template-list.png (Template list - LibreOffice Writer) +[9]:https://help.libreoffice.org/Writer/Working_with_Master_Documents_and_Subdocuments +[10]:https://help.libreoffice.org/Common/Export_as_PDF +[11]:http://writer2epub.it/en/ +[12]:https://opensource.com/life/13/8/how-create-ebook-open-source-way From 78974b2caeaab7c4bd48012d11366adb70a08c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 31 Dec 2019 08:15:47 +0800 Subject: [PATCH 128/430] translating --- ...App Highlight- Open Source Disk Partitioning Tool GParted.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md b/sources/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md index 6c78a12ecb..fe72f5695a 100644 --- a/sources/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md +++ b/sources/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From cb8f1da5653ede53266c00f859a84020c8abc920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 31 Dec 2019 08:17:27 +0800 Subject: [PATCH 129/430] Translating --- sources/tech/20191215 How to Add Border Around Text in GIMP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191215 How to Add Border Around Text in GIMP.md b/sources/tech/20191215 How to Add Border Around Text in GIMP.md index d691bafb41..0b2e3858f2 100644 --- a/sources/tech/20191215 How to Add Border Around Text in GIMP.md +++ b/sources/tech/20191215 How to Add Border Around Text in GIMP.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 93d7c5fdc1cef4e8de5c17202aab97bdc0266b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 31 Dec 2019 08:24:49 +0800 Subject: [PATCH 130/430] Translated --- .../20191016 Open source interior design with Sweet Home 3D.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191016 Open source interior design with Sweet Home 3D.md b/sources/tech/20191016 Open source interior design with Sweet Home 3D.md index bc5a17c51c..309b816f81 100644 --- a/sources/tech/20191016 Open source interior design with Sweet Home 3D.md +++ b/sources/tech/20191016 Open source interior design with Sweet Home 3D.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f7de60aabef2eedd4f50271abd1ace60dc27e55a Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 31 Dec 2019 08:45:17 +0800 Subject: [PATCH 131/430] translated --- ...h the Linux Equinox Desktop Environment.md | 95 ------------------- ...h the Linux Equinox Desktop Environment.md | 92 ++++++++++++++++++ 2 files changed, 92 insertions(+), 95 deletions(-) delete mode 100644 sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md create mode 100644 translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md diff --git a/sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md b/sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md deleted file mode 100644 index 59abeb92b8..0000000000 --- a/sources/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md +++ /dev/null @@ -1,95 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Chill out with the Linux Equinox Desktop Environment) -[#]: via: (https://opensource.com/article/19/12/ede-linux-desktop) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Chill out with the Linux Equinox Desktop Environment -====== -This article is part of a special series of 24 days of Linux desktops. -EDE is not the most glamorous, minimal, nor efficient desktop. But its -soft, muted tones are calming, its familiarity soothing, and its icon -theme fun. -![Linux penguin at the north pole beside an igloo][1] - -I haven't used the Fast Light Toolkit ([FLTK][2]) for anything serious yet, but I'm a fan of the C++ GUI toolkit that's pretty simple to learn and (in my experience) reliable even across updates. When I found out that there was a desktop environment built with FLTK, I was eager to try it—and I was quickly glad I did. The [Equinox Desktop Environment (EDE)][3] is a fast and simple desktop written in C++ and FLTK for Unix desktops. It uses common desktop conventions, so it looks and feels familiar right away, and after only a few days of using it, I found its simplicity provides a minimal elegance that I enjoy. - -![EDE desktop][4] - -### Installing EDE - -You are likely to find EDE included in your distribution's software repository, but you can also find it in its [SourceForge repository][5]. If you're already running a different desktop, it's safe to install EDE on the same system because it brings along just a few extra applications, which are specific to EDE so they won't get in your way on other desktops. - -EDE is only the desktop, and it uses the [Pekwm][6] window manager to handle layout. - -After installing EDE, log out of your current desktop session so you can log into your new one. By default, your session manager (KDM, GDM, LightDM, or XDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging in. - -With GDM: - -![][7] - -With SDDM: - -![][8] - -When EDE first boots, you might be prompted to confirm some startup tasks. On my Slackware workstation, KDE had marked some services as startup tasks (such as the HPLIP print monitor and a Bluetooth daemon), and EDE imported them with just one confirmation box. - -![Importing desktop services in EDE][9] - -After setting it up once, you won't need to do it again. - -### EDE desktop tour - -EDE's layout is exactly what most people expect from a desktop: application menu on the left, taskbar in the middle, system tray on the right. It's the standard off-the-shelf layout that confuses nobody; this is a desktop that's safe to install on a Linux computer and hand over, with confidence, to someone who's never used Linux in their life. They'll fall right into this desktop with a soft and gentle landing. - -You can bring up a small desktop menu with a right-click. This allows you to make an application launcher on the desktop, create a folder, and set some theme options. - -The panel at the bottom of the screen is retractable, so you can work full-screen if you prefer. Click the clock in the bottom-right of the screen to bring up a calendar and time-zone settings. - -EDE has a small Configuration Place application that provides access to a few simple preferences: - - * Background and icon settings - * Screensaver settings - * Time and clock - * System bell - * Keyboard - * Preferred applications - - - -![EDE Configuration Place][10] - -There's not much more to EDE. There's no file manager, no text editor, or paint program, or game of solitaire. You must bring anything you want to run on your desktop. That means you get to pick and choose from the wide array of Linux applications and use whatever you love the most. - -### EDE as a statement - -I found the simplicity of EDE oddly comforting, at least as a kind of "holiday" desktop; it's a nice place to visit. It's not the most glamorous desktop available, nor the most minimal, nor the most efficient. But its soft, muted tones are calming, its familiarity soothing, and its icon theme fun and exuberant. EDE is a desktop that's proud of its slow and steady pace. - -If you're in the mood to put your feet up and enjoy a clean and pleasant interface, try EDE. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/ede-linux-desktop - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/penguin.igloo_.png?itok=K92O7H6b (Linux penguin at the north pole beside an igloo) -[2]: https://www.fltk.org/ -[3]: https://sourceforge.net/projects/ede/ -[4]: https://opensource.com/sites/default/files/uploads/advent-ede.jpg (EDE desktop) -[5]: http://ede.sf.net -[6]: https://opensource.com/article/19/12/pekwm-linux-desktop -[7]: https://opensource.com/sites/default/files/advent-gdm_2.jpg -[8]: https://opensource.com/sites/default/files/advent-kdm_1.jpg -[9]: https://opensource.com/sites/default/files/uploads/advent-ede-init.jpg (Importing desktop services in EDE) -[10]: https://opensource.com/sites/default/files/uploads/advent-ede-conf.jpg (EDE Configuration Place) diff --git a/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md b/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md new file mode 100644 index 0000000000..cfa8489c40 --- /dev/null +++ b/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Chill out with the Linux Equinox Desktop Environment) +[#]: via: (https://opensource.com/article/19/12/ede-linux-desktop) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +轻松使用 Linux Equinox 桌面环境 +====== +本文是 24 天 Linux 桌面特别系列的一部分。EDE 不是最迷人、最小或效率最高的桌面。但它的柔和、静音让人平静,它让人感到熟悉舒缓,它的图标主题有趣。 +![Linux penguin at the north pole beside an igloo][1] + +我还没有认真用过 Fast Light Toolkit([FLTK] [2]),但我是 C++ GUI 工具箱的粉丝,它非常易于学习,并且即使跨更新时也很可靠。当我发现有一个用 FLTK 构建的桌面环境时,我很想尝试一下,并且我很快为我的决定感到高兴。[Equinox 桌面环境(EDE)][3] 是用 C++ 和 FLTK 为 Unix 桌面编写的快速、简单的桌面。它使用通用的桌面约定,因此外观和感觉都非常熟悉,并且在使用几天后,我发现它的简单性提供了我所喜欢的最低限度的优雅。 + +![EDE desktop][4] + +### 安装 EDE + +你可能会发现 EDE 包含在发行版的软件仓库中,但你也可以在它的 [SourceForge 仓库][5]中找到它。如果你已经在运行其他桌面,你可以安全地在同一系统上安装 EDE,因为它仅带来了一些额外的应用,这些应用程序特定于 EDE,因此它们不会妨碍你的其他桌面。 + +EDE 只是桌面,它使用 [Pekwm][6] 窗口管理器来处理布局。 + +安装 EDE 之后,注销当前的桌面会话,以便你可以登录到新的会话。默认情况下,会话管理器(KDM、GDM、LightDM 或 XDM,取决于你的设置)将继续登录到以前的桌面,因此你必须在登录之前覆盖该桌面。 + +在 GDM 中: + +![][7] + +在 SDDM 中: + +![][8] + +首次启动 EDE 时,可能会提示你确认一些启动任务。在我的 Slackware 工作站上,KDE 将某些服务标记为启动任务(例如 HPLIP 打印监视器和蓝牙守护程序),并且 EDE 在一个确认框中显示了它们。 + +![Importing desktop services in EDE][9] + +设置一次后,你无需再次进行设置。 + +### EDE 桌面之旅 + +EDE 的布局恰恰是大多数人在桌面上所期望的布局:左侧的应用菜单、中间的任务栏、右侧的系统托盘。这是标准的现成布局,不会让任何人感到困惑。这是一个可以安全地装在 Linux 上并且可以自信地给任何没有使用过 Linux 的人使用的桌面。他们将以舒适的方式很快地适应这个桌面。 + +你可以单击鼠标右键打开一个小型桌面菜单。这可以让你在桌面上创建应用启动器、创建文件夹并设置一些主题选项。 + +屏幕底部的面板是可伸缩的,因此你可以根据需要在全屏模式下工作。单击屏幕右下角的时钟来调出日历和时区设置。 + +EDE 有一个小的配置应用,可用于设置一些简单的选项: + + * 背景和图标设置 +  * 屏幕保护程序设置 +  * 时间和时钟 +  * 系统铃声 +  * 键盘 +  * 偏好应用 + + + +![EDE Configuration Place][10] + +EDE 的功能不多。没有文件管理器、文本编辑器、绘画程序或纸牌游戏。你必须安装你想在桌面运行的程序。这意味着你可以从各种各样的 Linux 应用中进行选择,并使用你最喜欢的。 + +### EDE 总结 + +我发现 EDE 至少作为一种”假日“桌面而言,它的简单性令人舒适。它值得一看。它不是最迷人的桌面,也不是最小的、也不是最高效的。但它的柔和、静音让人平静,它让人感到熟悉舒缓,并且它的图标主题充满乐趣和生气。EDE 是一个以其缓慢而稳定的步调而自豪的桌面。 + +如果你想放松心情使用一个干净和令人愉悦的界面,请试试 EDE。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/ede-linux-desktop + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/penguin.igloo_.png?itok=K92O7H6b (Linux penguin at the north pole beside an igloo) +[2]: https://www.fltk.org/ +[3]: https://sourceforge.net/projects/ede/ +[4]: https://opensource.com/sites/default/files/uploads/advent-ede.jpg (EDE desktop) +[5]: http://ede.sf.net +[6]: https://opensource.com/article/19/12/pekwm-linux-desktop +[7]: https://opensource.com/sites/default/files/advent-gdm_2.jpg +[8]: https://opensource.com/sites/default/files/advent-kdm_1.jpg +[9]: https://opensource.com/sites/default/files/uploads/advent-ede-init.jpg (Importing desktop services in EDE) +[10]: https://opensource.com/sites/default/files/uploads/advent-ede-conf.jpg (EDE Configuration Place) From 6b402b9fa0e0233319bb3074be5a718a5ac95474 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 31 Dec 2019 08:53:59 +0800 Subject: [PATCH 132/430] translating --- ...0 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md b/sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md index d8bbaf3185..b8314533cf 100644 --- a/sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md +++ b/sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b5871344bd0d89a1d3788b179a966f8103307779 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Dec 2019 10:13:03 +0800 Subject: [PATCH 133/430] PRF --- ...ry Kubernetes job candidate should know.md | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/translated/tech/20191217 5 interview questions every Kubernetes job candidate should know.md b/translated/tech/20191217 5 interview questions every Kubernetes job candidate should know.md index b7a6fa9c1d..94ae41a3e9 100644 --- a/translated/tech/20191217 5 interview questions every Kubernetes job candidate should know.md +++ b/translated/tech/20191217 5 interview questions every Kubernetes job candidate should know.md @@ -1,64 +1,66 @@ [#]: collector: (lujun9972) [#]: translator: (Morisun029) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 interview questions every Kubernetes job candidate should know) [#]: via: (https://opensource.com/article/19/12/kubernetes-interview-questions) [#]: author: (Jessica Repka https://opensource.com/users/jrepka) -每个 Kubernetes 应聘者应该知道的5个面试题 +每个 Kubernetes 应聘者应该知道的 5 个面试题 ====== -如果你要面试Kubernetes相关的应聘者,这里给出了要提问的问题以及这些问题的重要性。 -![Pair programming][1] + +> 如果你是要面试 Kubernetes 相关职位的应聘者,这里给出了要提问的问题以及这些问题的重要性。 + +![](https://img.linux.net.cn/data/attachment/album/201912/31/101229mmjumsesrzhh6rhk.jpg) 面试对面试官及候选人来说都很不容易。最近,我发现面试 Kubernetes 相关工作的候选人似乎尤其困难。为什么呢?一方面,很难找到可以回答他们问题的人。而且,不管回答者回答的怎样,都很难确定他们是否有正确的经验。 -跳过这个问题,让我们来看看面试[Kubernetes][2]求职者时应该提问的一些问题。 +跳过这个问题,让我们来看看面试 [Kubernetes][2] 求职者时应该提问的一些问题。 ### Kubernetes 是什么? -我发现这个问题是面试中最好的问题之一。我经常听到有人说“我用Kubernetes工作”,但是当我问道“Kubernetes 是什么时,从来都没有得到过一个满意答案。 +我发现这个问题是面试中最好的问题之一。我经常听到有人说“我用 Kubernetes 工作”,但是当我问道“Kubernetes 是什么”时,从来都没有得到过一个满意答案。 -我最喜欢克里斯•肖特[Chris Short][3]给出的答案:“Kubernetes 就是带有一些 YAML 文件的 API 。” +我最喜欢 [Chris Short][3] 给出的答案:“Kubernetes 就是带有一些 YAML 文件的 API 。” -虽然他的回答没有错,但我会给你更详细的解释。 Kubernetes 是一个便携式容器编排工具,用于自动执行管理,监控,扩展和部署容器化应用程序。 +虽然他的回答没有错,但我会给你更详细的解释。 Kubernetes 是一个可移植容器的编排工具,用于自动执行管理、监控、扩展和部署容器化应用程序。 -我认为“用于部署容器化应用程序的编排工具”这个回答可能与你期望的答案差不多了。能回答出这个,我觉得已经很不错了。尽管许多人相信 Kubernetes 可以增加很多,但总的来说,它提供了许多API来增加其核心功能:容器编排。 +我认为“用于部署容器化应用程序的编排工具”这个回答可能与你期望的答案差不多了。能回答出这个,我觉得已经很不错了。尽管许多人认为 Kubernetes 做了更多更棒的工作,但总的来说,它为其核心功能——容器编排——添加了许多 API。 我认为,这是你在面试中可以提问的最好的问题之一,因为它至少证明了候选人是否知道 Kubernetes 是什么。 -### Kubernetes 的 node(节点)和 Pod 有什么区别? +### Kubernetes 的节点和 Pod 有什么区别? -该问题揭示了候选人对 Kubernetes 复杂性的初步了解。它将对话转换为体系结构概述,并可能导向许多有趣的后续细节问题。我已经听到了无数次关于该问题的错误解释了。 +该问题揭示了候选人对 Kubernetes 复杂性的初步了解。它将面试对话转换为对体系结构的概述,并可能导向许多有趣的后续细节问题。我已经听到了无数次关于该问题的错误解释了。 -[node][4] 是工作计算机。该计算机可以是虚拟机(VM)或物理计算机,具体取决于你是在虚拟机监控程序上运行还是在裸机上运行。该节点包含用于运行容器的服务,包括 kubelet,kube-proxy 和容器运行时。 +[节点][4] 是工作计算机。该计算机可以是虚拟机(VM)或物理计算机,具体取决于你是在虚拟机监控程序上运行还是在裸机上运行。该节点包含用于运行容器的服务,包括 kubelet、kube-proxy 和容器运行时。 -[pod][5] pod 包括(1)一个或多个具有共享网络(3)和存储(4)的容器(2)以及有关如何运行一起部署的容器的规范。这四个细节都很重要。更进一步,申请人应从技术层面解释,pod 是Kubernetes 可以创建和管理的最小可部署单元,而不是容器。 +[Pod][5] 包括:一个或多个**容器**、具有共享**网络**和**存储**,以及有关如何运行一起部署的容器的**规范**。这四个细节都很重要。更进一步,职位申请人应从技术层面解释,Pod 是 Kubernetes 可以创建和管理的最小可部署单元,而不是容器。 -对于这个问题,我听到的最好的简答是:“node 是计算机,而 pod 是容器中的东西。” 区别很重要。 Kubernetes 管理员的大部分工作是知道什么时间要部署什么,而节点可能非常非常昂贵,具体取决于它们的运行位置。我不希望有人一遍又一遍地部署节点,他们需要做的就是部署一堆Pod。 +对于这个问题,我听到的最好的简答是:“节点是计算机,而 Pod 是容器运行于其中的东西。”这个区别很重要。Kubernetes 管理员的大部分工作是知道什么时间要部署什么,而节点的部署成本可能非常非常高,具体取决于它们的运行位置。我不希望有人一遍又一遍地部署节点,他们需要做的就是部署一堆 Pod。 -### kubectl 是什么? (你怎么发音?) +### kubectl 是什么?(你怎么发音?) -这个问题是我的优先级中较高的问题之一,但可能与你和你的团队无关。在我的团队中,我们不会使用图形化界面来管理Kubernetes环境,我们使用命令行操作。 +这个问题是我优先级较高的问题之一,但可能与你和你的团队无关。在我的团队中,我们不会使用图形化界面来管理 Kubernetes 环境,我们使用命令行操作。 -那么什么是[kubectl][6]?它是 Kubernetes 的命令行界面。你可以从该界面获取并设置任何内容,从收集日志和事件到编辑部署环境和机密文件。随机提问候选人关于如何使用此工具对测试候选人对 kubectl 的熟悉度是很有帮助的。 +那么什么是 [kubectl][6]?它是 Kubernetes 的命令行界面。你可以从该界面获取并设置任何内容,从收集日志和事件到编辑部署环境和机密文件。随机提问候选人关于如何使用此工具对测试候选人对 kubectl 的熟悉度是很有帮助的。 -你是怎么读的?好吧,你随便吧(对此有很大的分歧),但是我很高兴向你介绍我朋友[Waldo][7]的精彩视频演示。 +你是怎么读的?好吧,你随便吧(对此有很大的分歧),但是我很高兴向你介绍我朋友 [Waldo][7] 的精彩视频演示。 -### 名称空间是什么? +### 命名空间是什么? -在多次面试中,我都没有得到关于这个问题的答案。我不确定在其他环境中使用的名称空间是否会在我所在的团队经常使用。我在这里给出一个简短的答案:名称空间是Pod中的虚拟集群。这种抽象可以使你将多个虚拟群集保留在各种环境中以此来进行隔离。 +在多次面试中,我都没有得到关于这个问题的答案。我不确定在其他环境中使用的命名空间是否会在我所在的团队经常使用。我在这里给出一个简短的答案:命名空间是 Pod 中的虚拟集群。这种抽象可以使你将多个虚拟集保留在多个环境中以此来进行隔离。 ### 容器是什么? -了解 Pod 中正在部署的内容总是有帮助的,因为如果都不知道其中部署的是什么,何谈部署?容器是打包代码及其所有依赖项的软件的标准单元。我收到了两个可以接收的答案,其中包括:a)精简的操作系统映像,以及b)在受限的 OS 环境中运行的应用程序。如果你可以命名使用[Docker][8]以外的其他容器的编排软件(例如你最喜欢的公共云的容器服务),则可以得到加分。 + +了解 Pod 中正在部署的内容总是有帮助的,因为如果都不知道其中部署的是什么,何谈部署?容器是打包代码及其所有依赖项的软件的标准单元。我收到了两个可以接受的答案,其中包括:a)精简的操作系统镜像,以及 b)在受限的操作系统环境中运行的应用程序。如果你可以叫得出使用 [Docker][8] 以外的其他容器的编排软件(例如你最喜欢的公共云的容器服务),则可以得到加分。 ### 其他问题 -如果你想知道为什么我没有在此问题列表中添加更多问题,那么我可以给出一个简单的答案:我所列出的这些问题是在面试候选人时应了解的最基本的问题。接下来的问题应该是基于具体的团队、环境及组织。如果你想知道为什么我没有在此问题列表中添加更多问题,那么我可以给出一个简单的答案:我所列出的这些问题是在面试候选人时应了解的最基本的问题。接下来的问题应该是基于具体的团队、环境及组织。 -**[阅读更多:如何准备 Kubernetes 相关的面试?]][9]** +如果你想知道为什么我没有在此问题列表中添加更多问题,那么我可以给出一个简单的答案:我所列出的这些问题是在面试候选人时应了解的最基本的问题。接下来的问题应该是基于具体的团队、环境及组织。当你仔细研究这些内容时,尝试寻找有关技术如何相互作用的有趣问题,以了解人们如何应对基础架构挑战。考虑一下你的团队最近遇到的挑战(中断),要求逐步进行部署,或者考虑改善团队积极想要改进的策略(例如减少部署时间)。问题越不抽象,对面试后真正重要的技能的询问就越多。 -没有两个环境是完全相同的。这也适用于面试中。我在每次面试中都会混合提问。 我也有一个测试面试者的小环境。我经常发现回答问题是最容易的部分,而你所做的工作才是对你的真正的考验。 +没有两个环境是完全相同的。这也适用于面试中。我在每次面试中都会混合提问。我也有一个测试面试者的小环境。我经常发现回答问题是最容易的部分,而你所做的工作才是对你的真正的考验。 我给面试官的最后一点建议是:如果你遇到一个很有潜力但没有经验的候选人时,请给他们一个证明自己的机会。如果当初没有人看到我的潜力,没有给我机会的话,我不会拥有今天的知识和经验。 @@ -70,8 +72,8 @@ via: https://opensource.com/article/19/12/kubernetes-interview-questions 作者:[Jessica Repka][a] 选题:[lujun9972][b] -译者:[Morisun029](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Morisun029](https://github.com/Morisun029) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1d21973e3b172b38ecaf12396c6d5f73cc043952 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Dec 2019 10:13:47 +0800 Subject: [PATCH 134/430] PUB @Morisun029 https://linux.cn/article-11730-1.html --- ...ew questions every Kubernetes job candidate should know.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191217 5 interview questions every Kubernetes job candidate should know.md (99%) diff --git a/translated/tech/20191217 5 interview questions every Kubernetes job candidate should know.md b/published/20191217 5 interview questions every Kubernetes job candidate should know.md similarity index 99% rename from translated/tech/20191217 5 interview questions every Kubernetes job candidate should know.md rename to published/20191217 5 interview questions every Kubernetes job candidate should know.md index 94ae41a3e9..f6d0f6685f 100644 --- a/translated/tech/20191217 5 interview questions every Kubernetes job candidate should know.md +++ b/published/20191217 5 interview questions every Kubernetes job candidate should know.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Morisun029) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11730-1.html) [#]: subject: (5 interview questions every Kubernetes job candidate should know) [#]: via: (https://opensource.com/article/19/12/kubernetes-interview-questions) [#]: author: (Jessica Repka https://opensource.com/users/jrepka) From 5aac22f376dcdac37e57533b79d7162eacb215d2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Dec 2019 10:48:00 +0800 Subject: [PATCH 135/430] PRF @geekpi --- ...Falkon Open Source Web Browser from KDE.md | 36 +++++++------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/translated/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md b/translated/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md index 18d42af58a..5e04937565 100644 --- a/translated/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md +++ b/translated/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (App Highlight: Falkon Open Source Web Browser from KDE) @@ -10,15 +10,13 @@ 应用推荐:来自 KDE 的 Falkon 开源 Web 浏览器 ====== -_**它以前称为 Qupzilla,Falkon 是基于 QtWebEngine 的 Web 浏览器。在本周的“应用推荐”中,我们来看看这个开源软件。**_ +> Falkon 是基于 QtWebEngine 的 Web 浏览器,它以前称为 Qupzilla。在本周的“应用推荐”中,我们来看看这个开源软件。 ### Falkon:适用于 Linux(和 Windows)的开源 Web 浏览器 ![][1] -首先,[Falkon][2] 不是新的 Web 浏览器。它自 2010 年以来一直在开发中,但被称为 Qupzilla。 - -2017 年,QupZilla 移到 KDE 旗下,并更名为 Falkon。处于 KDE 旗下意味着项目会按照 KDE 标准积极维护。 +首先,[Falkon][2] 并不是一款新的 Web 浏览器。它自 2010 年以来一直在开发中,但被称为 Qupzilla。2017 年,QupZilla 移到 KDE 旗下,并更名为 Falkon。处于 KDE 旗下意味着项目会按照 KDE 标准积极维护。 它使用 [QtWebEngine][3] 渲染引擎,这是 Chromium 核心的简化版本。 @@ -26,25 +24,23 @@ _**它以前称为 Qupzilla,Falkon 是基于 QtWebEngine 的 Web 浏览器。 ### Falkon 浏览器的功能 -我认为它可能不是流行的浏览器,但我发现它足以浏览现代 Web 服务。 - -让我重点介绍 Falkon 的主要功能,如果你觉得它很有趣,请尝试一下。 +我认为它可能不是流行的浏览器,但我发现它足以浏览现代 Web 服务。让我重点介绍 Falkon 的主要功能,如果你觉得它很有趣,请尝试一下。 #### 简单的用户界面 ![][4] -我知道这不完全是一项“功能”,但是用户体验 (UX) 至关重要。尽管是轻量级的浏览器,但你会拥有一个不错的界面。你不会觉得使用的是 2000 年早期的浏览器。 +我知道这不完全是一项“功能”,但是用户体验(UX)至关重要。尽管是轻量级的浏览器,但你会拥有一个不错的界面。你不会觉得使用的是一款源自 2000 年早期的浏览器。 #### AdBlock 扩展 ![][5] -它附带了 AdBlock 扩展程序,如果你想在浏览网站时摆脱广告,它大的效果很好。你还可以自定义 AdBlock 扩展的行为。 +它附带了 AdBlock 扩展程序,如果你想在浏览网站时摆脱广告,它的效果很好。你还可以自定义 AdBlock 扩展的行为。 #### DuckDuckGo 作为默认搜索引擎 -如果你不喜欢使用 Google,那么最好将[主打隐私的搜索引擎][6]之一设为默认搜索引擎。 +如果你不喜欢使用 Google,那么这是一件好事,它将这个[主打隐私的搜索引擎][6]设为默认搜索引擎。 #### 会话管理器 @@ -68,29 +64,23 @@ Falkon 还允许你在某种程度上自定义外观。如果要更改浏览器 ![][10] -我还尝试了其他设置/功能,例如添加书签或管理密码。 - -或者,管理网页的通知。 - -我还试了 YouTube,没有任何问题。 +我还尝试了其他设置/功能,例如添加书签或管理密码。或者,管理网页的通知。我还试了 YouTube,没有任何问题。 当然,这不是一个详尽的评测。但是,Falkon 确实拥有浏览器中需要的所有基本功能(除非你有特定要求)。 ### 安装 Falkon 浏览器 -你可以在软件中心轻松找到 Falkon 浏览器。 - -如果没有,你可以从它的[官方下载页面][11]中找到 Flatpak/Snap 包。你还可以在下载页面上找到 Windows 的安装程序。 +你可以在软件中心轻松找到 Falkon 浏览器。如果没有,你可以从它的[官方下载页面][11]中找到 Flatpak/Snap 包。你还可以在下载页面上找到 Windows 的安装程序。 [Download Falkon Browser][11] -**总结** +### 总结 作为 KDE 产品,Falkon 是为 KDE 桌面环境量身定制的。一些 KDE 发行版(例如 OpenMandriva)使用 Falkon 作为默认的 Web 浏览器。 -Falkon 浏览器适合那些正在寻求轻巧且功能丰富的 Web 浏览器的人。值得尝试的一个替代是 [Midori][12]。 +Falkon 浏览器适合那些正在寻求轻巧且功能丰富的 Web 浏览器的人。值得尝试的另一个替代是 [Midori][12]。 -我认为,除非你需要大量的扩展、跨平台同步并且需要访问某些特定于浏览器的网站,不然它是一个很好的替代浏览器,。 +我认为,除非你需要大量的扩展、跨平台同步并且需要访问某些特定于浏览器的网站,不然它是一个很好的替代浏览器。 你如何看待 Falkon 浏览器?请在下面的评论中让我知道你的想法。 @@ -101,7 +91,7 @@ via: https://itsfoss.com/falkon-browser/ 作者:[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 0e0b96babd5f3cead1afb0f06d1c60310dabb8cb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Dec 2019 10:48:50 +0800 Subject: [PATCH 136/430] PUB @geekpi https://linux.cn/article-11732-1.html --- ... App Highlight- Falkon Open Source Web Browser from KDE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md (98%) diff --git a/translated/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md b/published/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md similarity index 98% rename from translated/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md rename to published/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md index 5e04937565..7bd221d6f8 100644 --- a/translated/tech/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md +++ b/published/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11732-1.html) [#]: subject: (App Highlight: Falkon Open Source Web Browser from KDE) [#]: via: (https://itsfoss.com/falkon-browser/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 8139d5e08b1c92f197d807237851db92ad3c0a1e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Dec 2019 10:51:03 +0800 Subject: [PATCH 137/430] PRF --- ...24 App Highlight- Falkon Open Source Web Browser from KDE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/published/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md b/published/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md index 7bd221d6f8..bd4a26bc8e 100644 --- a/published/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md +++ b/published/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md @@ -12,6 +12,8 @@ > Falkon 是基于 QtWebEngine 的 Web 浏览器,它以前称为 Qupzilla。在本周的“应用推荐”中,我们来看看这个开源软件。 +![](https://img.linux.net.cn/data/attachment/album/201912/31/105027tblfjlzn9xx8keud.png) + ### Falkon:适用于 Linux(和 Windows)的开源 Web 浏览器 ![][1] From 5d8cacfd0a1b8e7f1f1d770e84e0ac7756249421 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Dec 2019 11:00:55 +0800 Subject: [PATCH 138/430] PRF --- .../20191204 Fedora Desktops - Memory Footprints.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translated/tech/20191204 Fedora Desktops - Memory Footprints.md b/translated/tech/20191204 Fedora Desktops - Memory Footprints.md index 0fe78be674..967b172a63 100644 --- a/translated/tech/20191204 Fedora Desktops - Memory Footprints.md +++ b/translated/tech/20191204 Fedora Desktops - Memory Footprints.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Fedora Desktops – Memory Footprints) @@ -12,7 +12,7 @@ Fedora 上的桌面环境内存占用测试 ![][1] -Fedora 中有 40 多中桌面环境。每种桌面环境都有自己的优点和缺点。通常,根据功能、外观和其他品质,选择桌面是非常个人的偏爱。但有时,你选择的桌面环境还会受到硬件限制。 +Fedora 中有 40 多种桌面环境(DE)。每种桌面环境都有自己的优点和缺点。通常,根据功能、外观和其它品质,选择桌面是一件非常个人的偏好。但有时,你选择的桌面环境还会受到硬件限制。 本文旨在帮助人们根据桌面环境占用的基准内存来比较 Fedora 桌面环境。为了缩小范围,我们仅查看具有正式 Fedora Live 镜像的桌面环境。 @@ -20,11 +20,11 @@ Fedora 中有 40 多中桌面环境。每种桌面环境都有自己的优点和 每个桌面环境都安装在自己的 KVM 虚拟机上。每个虚拟机都有 1 个 CPU、4GB 内存、15GB virtio 固态磁盘,以及 RHEL 8.0 kvm 上所有其他标准配置。 -用于安装的镜像是标准的 Fedora 31 Live 镜像。对于 GNOME,该镜像是 Fedora 工作站。对于其他桌面,使用了相应的 Spin 版本。未对“糖葫芦Sugar On A Stick”(SOAS)进行测试,因为它不容易安装到本地驱动器上。 +用于安装的镜像是标准的 Fedora 31 Live 镜像。对于 GNOME,该镜像是 “Fedora 工作站”。对于其它桌面,使用了相应的 Spin 版本。未对“糖葫芦Sugar On A Stick”(SOAS)进行测试,因为它不容易安装到本地驱动器上。 -用 Live CD 启动虚拟机,然后选择“安装到硬盘”。在安装过程中,仅使用默认值。创建一个 root 用户和一个普通用户。安装并重新启动后,live 镜像已确认不在虚拟 CDROM 中。 +用 Live CD 启动虚拟机,然后选择“安装到硬盘”。在安装过程中,仅使用默认值。创建了一个 root 用户和一个普通用户。安装并重新启动后,live 镜像已确认不在虚拟 CDROM 中。 -每个桌面环境的设置都没有改动。它们每个都以 Live CD 安装中默认的设置运行。每个桌面环境都是通过普通用户登录的。打开了一个终端,在每台虚拟机中都使用 `sudo` 运行了 `dnf -y update`。在更新后,在该 sudo 终端中,每台虚拟机都运行 `/sbin/shutdown -h now` 以关闭。 +每个桌面环境的设置都没有改动。它们每个都以 Live CD 环境中默认的设置运行。每个桌面环境都是通过普通用户登录的。打开了一个终端,在每台虚拟机中都使用 `sudo` 运行了 `dnf -y update`。在更新后,在该 sudo 终端中,每台虚拟机都运行 `/sbin/shutdown -h now` 以关闭。 ### 测试方式 @@ -73,7 +73,7 @@ via: https://fedoramagazine.org/fedora-desktops-memory-footprints/ 作者:[Troy Dawson][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a359e68dfa931102f16e5b60568cced1ecda85c4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Dec 2019 11:01:26 +0800 Subject: [PATCH 139/430] PUB @geekpi https://linux.cn/article-11733-1.html --- .../20191204 Fedora Desktops - Memory Footprints.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191204 Fedora Desktops - Memory Footprints.md (98%) diff --git a/translated/tech/20191204 Fedora Desktops - Memory Footprints.md b/published/20191204 Fedora Desktops - Memory Footprints.md similarity index 98% rename from translated/tech/20191204 Fedora Desktops - Memory Footprints.md rename to published/20191204 Fedora Desktops - Memory Footprints.md index 967b172a63..c11f1ea98f 100644 --- a/translated/tech/20191204 Fedora Desktops - Memory Footprints.md +++ b/published/20191204 Fedora Desktops - Memory Footprints.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11733-1.html) [#]: subject: (Fedora Desktops – Memory Footprints) [#]: via: (https://fedoramagazine.org/fedora-desktops-memory-footprints/) [#]: author: (Troy Dawson https://fedoramagazine.org/author/tdawson/) From c024e1d20427996ffa85a97315ee5cb71a258320 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Dec 2019 11:05:24 +0800 Subject: [PATCH 140/430] PRF --- published/20191204 Fedora Desktops - Memory Footprints.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20191204 Fedora Desktops - Memory Footprints.md b/published/20191204 Fedora Desktops - Memory Footprints.md index c11f1ea98f..21ae866e77 100644 --- a/published/20191204 Fedora Desktops - Memory Footprints.md +++ b/published/20191204 Fedora Desktops - Memory Footprints.md @@ -44,7 +44,7 @@ Fedora 中有 40 多种桌面环境(DE)。每种桌面环境都有自己的 * gnome-shell 6.9% / gnome-software 1.8% / ibus-x11 1.5% * KDE * 使用了 733 MB - * plasmashell 6.2% / kwin_x11 3.6% / akonadi_mailfil 2.9% + * plasmashell 6.2% / kwin\_x11 3.6% / akonadi\_mailfil 2.9% * LXDE * 使用了 318 MB * Xorg 1.9% / nm-applet 1.8% / dnfdragora 1.8% From a6d3519379bb8e69ecc88cb1753b3e721f9786b2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Dec 2019 20:44:47 +0800 Subject: [PATCH 141/430] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20201912?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2019 年过去了 --- ... And Upload Files To Compatible Hosting Sites Automatically.md | 0 .../20180207 23 open source audio-visual production tools.md | 0 ...k global- How to overcome cultural communication challenges.md | 0 ...ad Text Snippets To Pastebin-like Services From Commandline.md | 0 ...90217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md | 0 published/{ => 201912}/20190225 Netboot a Fedora Live CD.md | 0 published/{ => 201912}/20190322 Easy means easy to debug.md | 0 .../20190513 How To Set Password Complexity On Linux.md | 0 ...stall LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md | 0 published/{ => 201912}/20190711 DevOps for introverted people.md | 0 ...0190725 24 sysadmin job interview questions you should know.md | 0 published/{ => 201912}/20190827 curl exercises.md | 0 published/{ => 201912}/20190927 5 tips for GNU Debugger.md | 0 published/{ => 201912}/20191004 What-s in an open source name.md | 0 published/{ => 201912}/20191007 Using the Java Persistence API.md | 0 published/{ => 201912}/20191017 How to type emoji on Linux.md | 0 published/{ => 201912}/20191017 Using multitail on Linux.md | 0 ...14 SCP Command Examples to Securely Transfer Files in Linux.md | 0 ...o program with Bash- Logical operators and shell expansions.md | 0 .../{ => 201912}/20191023 How to program with Bash- Loops.md | 0 .../20191024 Get sorted with sort at the command line.md | 0 .../{ => 201912}/20191028 6 signs you might be a Linux user.md | 0 .../20191028 How to remove duplicate lines from files with awk.md | 0 ...1101 Awk one-liners and scripts to help you sort text files.md | 0 .../20191113 Edit images on Fedora easily with GIMP.md | 0 .../20191114 Debugging Software Deployments with strace.md | 0 .../{ => 201912}/20191115 How to port an awk script to Python.md | 0 ...ly Check if a Website is up or down from the Linux Terminal.md | 0 .../20191118 How internet security works- TLS, SSL, and CA.md | 0 ...19 Top 10 Vim plugins for programming in multiple languages.md | 0 ... Switching from Python 2 to Python 3- What you need to know.md | 0 ...w System Information on Linux Every Time You Log into Shell.md | 0 ...How to Install Ansible (Automation Tool) on CentOS 8-RHEL 8.md | 0 published/{ => 201912}/20191125 How to use loops in awk.md | 0 published/{ => 201912}/20191125 The many faces of awk.md | 0 ...ds to Find the IP Address of a Domain in the Linux Terminal.md | 0 .../20191127 Create virtual machines with Cockpit in Fedora.md | 0 .../20191127 How to write a Python web API with Flask.md | 0 ...a quietly unveils faster, lower power Tesla GPU accelerator.md | 0 .../20191129 A quick introduction to Toolbox on Fedora.md | 0 .../20191202 Use the Window Maker desktop on Linux.md | 0 ... Kubernetes, low-code developers, and other industry trends.md | 0 .../20191203 Using Ansible to organize your SSH keys in AWS.md | 0 ...191203 Why use the Pantheon desktop for Linux Elementary OS.md | 0 ...XPS 13 7390 Review- The Best Laptop For Desktop Linux Users.md | 0 .../{ => 201912}/20191204 Fedora Desktops - Memory Footprints.md | 0 .../20191204 Java vs. Python- Which should you choose.md | 0 .../{ => 201912}/20191206 5 cool terminal pagers in Fedora.md | 0 .../20191206 6 Ways to Send Email from the Linux Command Line.md | 0 .../{ => 201912}/20191206 Pekwm- A lightweight Linux desktop.md | 0 .../20191207 Getting started with the GNOME Linux desktop.md | 0 .../{ => 201912}/20191209 Counting down the days using bash.md | 0 .../20191210 3 easy steps to update your apps to Python 3.md | 0 ...210 Breaking Linux files into pieces with the split command.md | 0 .../20191210 Customize your Linux desktop with FVWM.md | 0 .../20191211 Annotate screenshots on Linux with Ksnip.md | 0 ...0191211 How to Find High CPU Consumption Processes in Linux.md | 0 .../20191212 How to configure Openbox for your Linux desktop.md | 0 ...0191213 What GNOME 2 fans love about the Mate Linux desktop.md | 0 .../20191214 Get started with Lumina for your Linux desktop.md | 0 ...erview questions every Kubernetes job candidate should know.md | 0 .../20191217 Build a retro Apple desktop with the Linux MLVWM.md | 0 published/{ => 201912}/20191218 How tracking pixels work.md | 0 ... - Restart Services in Ubuntu and Other Linux Distributions.md | 0 .../20191221 Customize your Linux desktop with KDE Plasma.md | 0 ... How to Update Grub on Ubuntu and Other Linux Distributions.md | 0 ...222 Why your Python code needs to be beautiful and explicit.md | 0 ...1224 App Highlight- Falkon Open Source Web Browser from KDE.md | 0 .../20191224 Unix is turning 50. What does that mean.md | 0 69 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 201912}/20171027 Share And Upload Files To Compatible Hosting Sites Automatically.md (100%) rename published/{ => 201912}/20180207 23 open source audio-visual production tools.md (100%) rename published/{ => 201912}/20181018 Think global- How to overcome cultural communication challenges.md (100%) rename published/{ => 201912}/20181231 Easily Upload Text Snippets To Pastebin-like Services From Commandline.md (100%) rename published/{ => 201912}/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md (100%) rename published/{ => 201912}/20190225 Netboot a Fedora Live CD.md (100%) rename published/{ => 201912}/20190322 Easy means easy to debug.md (100%) rename published/{ => 201912}/20190513 How To Set Password Complexity On Linux.md (100%) rename published/{ => 201912}/20190602 How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md (100%) rename published/{ => 201912}/20190711 DevOps for introverted people.md (100%) rename published/{ => 201912}/20190725 24 sysadmin job interview questions you should know.md (100%) rename published/{ => 201912}/20190827 curl exercises.md (100%) rename published/{ => 201912}/20190927 5 tips for GNU Debugger.md (100%) rename published/{ => 201912}/20191004 What-s in an open source name.md (100%) rename published/{ => 201912}/20191007 Using the Java Persistence API.md (100%) rename published/{ => 201912}/20191017 How to type emoji on Linux.md (100%) rename published/{ => 201912}/20191017 Using multitail on Linux.md (100%) rename published/{ => 201912}/20191020 14 SCP Command Examples to Securely Transfer Files in Linux.md (100%) rename published/{ => 201912}/20191022 How to program with Bash- Logical operators and shell expansions.md (100%) rename published/{ => 201912}/20191023 How to program with Bash- Loops.md (100%) rename published/{ => 201912}/20191024 Get sorted with sort at the command line.md (100%) rename published/{ => 201912}/20191028 6 signs you might be a Linux user.md (100%) rename published/{ => 201912}/20191028 How to remove duplicate lines from files with awk.md (100%) rename published/{ => 201912}/20191101 Awk one-liners and scripts to help you sort text files.md (100%) rename published/{ => 201912}/20191113 Edit images on Fedora easily with GIMP.md (100%) rename published/{ => 201912}/20191114 Debugging Software Deployments with strace.md (100%) rename published/{ => 201912}/20191115 How to port an awk script to Python.md (100%) rename published/{ => 201912}/20191116 6 Methods to Quickly Check if a Website is up or down from the Linux Terminal.md (100%) rename published/{ => 201912}/20191118 How internet security works- TLS, SSL, and CA.md (100%) rename published/{ => 201912}/20191119 Top 10 Vim plugins for programming in multiple languages.md (100%) rename published/{ => 201912}/20191120 Switching from Python 2 to Python 3- What you need to know.md (100%) rename published/{ => 201912}/20191121 Bash Script to View System Information on Linux Every Time You Log into Shell.md (100%) rename published/{ => 201912}/20191125 How to Install Ansible (Automation Tool) on CentOS 8-RHEL 8.md (100%) rename published/{ => 201912}/20191125 How to use loops in awk.md (100%) rename published/{ => 201912}/20191125 The many faces of awk.md (100%) rename published/{ => 201912}/20191126 5 Commands to Find the IP Address of a Domain in the Linux Terminal.md (100%) rename published/{ => 201912}/20191127 Create virtual machines with Cockpit in Fedora.md (100%) rename published/{ => 201912}/20191127 How to write a Python web API with Flask.md (100%) rename published/{ => 201912}/20191127 Nvidia quietly unveils faster, lower power Tesla GPU accelerator.md (100%) rename published/{ => 201912}/20191129 A quick introduction to Toolbox on Fedora.md (100%) rename published/{ => 201912}/20191202 Use the Window Maker desktop on Linux.md (100%) rename published/{ => 201912}/20191203 An idiot-s guide to Kubernetes, low-code developers, and other industry trends.md (100%) rename published/{ => 201912}/20191203 Using Ansible to organize your SSH keys in AWS.md (100%) rename published/{ => 201912}/20191203 Why use the Pantheon desktop for Linux Elementary OS.md (100%) rename published/{ => 201912}/20191204 Dell XPS 13 7390 Review- The Best Laptop For Desktop Linux Users.md (100%) rename published/{ => 201912}/20191204 Fedora Desktops - Memory Footprints.md (100%) rename published/{ => 201912}/20191204 Java vs. Python- Which should you choose.md (100%) rename published/{ => 201912}/20191206 5 cool terminal pagers in Fedora.md (100%) rename published/{ => 201912}/20191206 6 Ways to Send Email from the Linux Command Line.md (100%) rename published/{ => 201912}/20191206 Pekwm- A lightweight Linux desktop.md (100%) rename published/{ => 201912}/20191207 Getting started with the GNOME Linux desktop.md (100%) rename published/{ => 201912}/20191209 Counting down the days using bash.md (100%) rename published/{ => 201912}/20191210 3 easy steps to update your apps to Python 3.md (100%) rename published/{ => 201912}/20191210 Breaking Linux files into pieces with the split command.md (100%) rename published/{ => 201912}/20191210 Customize your Linux desktop with FVWM.md (100%) rename published/{ => 201912}/20191211 Annotate screenshots on Linux with Ksnip.md (100%) rename published/{ => 201912}/20191211 How to Find High CPU Consumption Processes in Linux.md (100%) rename published/{ => 201912}/20191212 How to configure Openbox for your Linux desktop.md (100%) rename published/{ => 201912}/20191213 What GNOME 2 fans love about the Mate Linux desktop.md (100%) rename published/{ => 201912}/20191214 Get started with Lumina for your Linux desktop.md (100%) rename published/{ => 201912}/20191217 5 interview questions every Kubernetes job candidate should know.md (100%) rename published/{ => 201912}/20191217 Build a retro Apple desktop with the Linux MLVWM.md (100%) rename published/{ => 201912}/20191218 How tracking pixels work.md (100%) rename published/{ => 201912}/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md (100%) rename published/{ => 201912}/20191221 Customize your Linux desktop with KDE Plasma.md (100%) rename published/{ => 201912}/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md (100%) rename published/{ => 201912}/20191222 Why your Python code needs to be beautiful and explicit.md (100%) rename published/{ => 201912}/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md (100%) rename published/{ => 201912}/20191224 Unix is turning 50. What does that mean.md (100%) diff --git a/published/20171027 Share And Upload Files To Compatible Hosting Sites Automatically.md b/published/201912/20171027 Share And Upload Files To Compatible Hosting Sites Automatically.md similarity index 100% rename from published/20171027 Share And Upload Files To Compatible Hosting Sites Automatically.md rename to published/201912/20171027 Share And Upload Files To Compatible Hosting Sites Automatically.md diff --git a/published/20180207 23 open source audio-visual production tools.md b/published/201912/20180207 23 open source audio-visual production tools.md similarity index 100% rename from published/20180207 23 open source audio-visual production tools.md rename to published/201912/20180207 23 open source audio-visual production tools.md diff --git a/published/20181018 Think global- How to overcome cultural communication challenges.md b/published/201912/20181018 Think global- How to overcome cultural communication challenges.md similarity index 100% rename from published/20181018 Think global- How to overcome cultural communication challenges.md rename to published/201912/20181018 Think global- How to overcome cultural communication challenges.md diff --git a/published/20181231 Easily Upload Text Snippets To Pastebin-like Services From Commandline.md b/published/201912/20181231 Easily Upload Text Snippets To Pastebin-like Services From Commandline.md similarity index 100% rename from published/20181231 Easily Upload Text Snippets To Pastebin-like Services From Commandline.md rename to published/201912/20181231 Easily Upload Text Snippets To Pastebin-like Services From Commandline.md diff --git a/published/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md b/published/201912/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md similarity index 100% rename from published/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md rename to published/201912/20190217 Install Android 8.1 Oreo on Linux To Run Apps - Games.md diff --git a/published/20190225 Netboot a Fedora Live CD.md b/published/201912/20190225 Netboot a Fedora Live CD.md similarity index 100% rename from published/20190225 Netboot a Fedora Live CD.md rename to published/201912/20190225 Netboot a Fedora Live CD.md diff --git a/published/20190322 Easy means easy to debug.md b/published/201912/20190322 Easy means easy to debug.md similarity index 100% rename from published/20190322 Easy means easy to debug.md rename to published/201912/20190322 Easy means easy to debug.md diff --git a/published/20190513 How To Set Password Complexity On Linux.md b/published/201912/20190513 How To Set Password Complexity On Linux.md similarity index 100% rename from published/20190513 How To Set Password Complexity On Linux.md rename to published/201912/20190513 How To Set Password Complexity On Linux.md diff --git a/published/20190602 How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md b/published/201912/20190602 How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md similarity index 100% rename from published/20190602 How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md rename to published/201912/20190602 How to Install LEMP (Linux, Nginx, MariaDB, PHP) on Fedora 30 Server.md diff --git a/published/20190711 DevOps for introverted people.md b/published/201912/20190711 DevOps for introverted people.md similarity index 100% rename from published/20190711 DevOps for introverted people.md rename to published/201912/20190711 DevOps for introverted people.md diff --git a/published/20190725 24 sysadmin job interview questions you should know.md b/published/201912/20190725 24 sysadmin job interview questions you should know.md similarity index 100% rename from published/20190725 24 sysadmin job interview questions you should know.md rename to published/201912/20190725 24 sysadmin job interview questions you should know.md diff --git a/published/20190827 curl exercises.md b/published/201912/20190827 curl exercises.md similarity index 100% rename from published/20190827 curl exercises.md rename to published/201912/20190827 curl exercises.md diff --git a/published/20190927 5 tips for GNU Debugger.md b/published/201912/20190927 5 tips for GNU Debugger.md similarity index 100% rename from published/20190927 5 tips for GNU Debugger.md rename to published/201912/20190927 5 tips for GNU Debugger.md diff --git a/published/20191004 What-s in an open source name.md b/published/201912/20191004 What-s in an open source name.md similarity index 100% rename from published/20191004 What-s in an open source name.md rename to published/201912/20191004 What-s in an open source name.md diff --git a/published/20191007 Using the Java Persistence API.md b/published/201912/20191007 Using the Java Persistence API.md similarity index 100% rename from published/20191007 Using the Java Persistence API.md rename to published/201912/20191007 Using the Java Persistence API.md diff --git a/published/20191017 How to type emoji on Linux.md b/published/201912/20191017 How to type emoji on Linux.md similarity index 100% rename from published/20191017 How to type emoji on Linux.md rename to published/201912/20191017 How to type emoji on Linux.md diff --git a/published/20191017 Using multitail on Linux.md b/published/201912/20191017 Using multitail on Linux.md similarity index 100% rename from published/20191017 Using multitail on Linux.md rename to published/201912/20191017 Using multitail on Linux.md diff --git a/published/20191020 14 SCP Command Examples to Securely Transfer Files in Linux.md b/published/201912/20191020 14 SCP Command Examples to Securely Transfer Files in Linux.md similarity index 100% rename from published/20191020 14 SCP Command Examples to Securely Transfer Files in Linux.md rename to published/201912/20191020 14 SCP Command Examples to Securely Transfer Files in Linux.md diff --git a/published/20191022 How to program with Bash- Logical operators and shell expansions.md b/published/201912/20191022 How to program with Bash- Logical operators and shell expansions.md similarity index 100% rename from published/20191022 How to program with Bash- Logical operators and shell expansions.md rename to published/201912/20191022 How to program with Bash- Logical operators and shell expansions.md diff --git a/published/20191023 How to program with Bash- Loops.md b/published/201912/20191023 How to program with Bash- Loops.md similarity index 100% rename from published/20191023 How to program with Bash- Loops.md rename to published/201912/20191023 How to program with Bash- Loops.md diff --git a/published/20191024 Get sorted with sort at the command line.md b/published/201912/20191024 Get sorted with sort at the command line.md similarity index 100% rename from published/20191024 Get sorted with sort at the command line.md rename to published/201912/20191024 Get sorted with sort at the command line.md diff --git a/published/20191028 6 signs you might be a Linux user.md b/published/201912/20191028 6 signs you might be a Linux user.md similarity index 100% rename from published/20191028 6 signs you might be a Linux user.md rename to published/201912/20191028 6 signs you might be a Linux user.md diff --git a/published/20191028 How to remove duplicate lines from files with awk.md b/published/201912/20191028 How to remove duplicate lines from files with awk.md similarity index 100% rename from published/20191028 How to remove duplicate lines from files with awk.md rename to published/201912/20191028 How to remove duplicate lines from files with awk.md diff --git a/published/20191101 Awk one-liners and scripts to help you sort text files.md b/published/201912/20191101 Awk one-liners and scripts to help you sort text files.md similarity index 100% rename from published/20191101 Awk one-liners and scripts to help you sort text files.md rename to published/201912/20191101 Awk one-liners and scripts to help you sort text files.md diff --git a/published/20191113 Edit images on Fedora easily with GIMP.md b/published/201912/20191113 Edit images on Fedora easily with GIMP.md similarity index 100% rename from published/20191113 Edit images on Fedora easily with GIMP.md rename to published/201912/20191113 Edit images on Fedora easily with GIMP.md diff --git a/published/20191114 Debugging Software Deployments with strace.md b/published/201912/20191114 Debugging Software Deployments with strace.md similarity index 100% rename from published/20191114 Debugging Software Deployments with strace.md rename to published/201912/20191114 Debugging Software Deployments with strace.md diff --git a/published/20191115 How to port an awk script to Python.md b/published/201912/20191115 How to port an awk script to Python.md similarity index 100% rename from published/20191115 How to port an awk script to Python.md rename to published/201912/20191115 How to port an awk script to Python.md diff --git a/published/20191116 6 Methods to Quickly Check if a Website is up or down from the Linux Terminal.md b/published/201912/20191116 6 Methods to Quickly Check if a Website is up or down from the Linux Terminal.md similarity index 100% rename from published/20191116 6 Methods to Quickly Check if a Website is up or down from the Linux Terminal.md rename to published/201912/20191116 6 Methods to Quickly Check if a Website is up or down from the Linux Terminal.md diff --git a/published/20191118 How internet security works- TLS, SSL, and CA.md b/published/201912/20191118 How internet security works- TLS, SSL, and CA.md similarity index 100% rename from published/20191118 How internet security works- TLS, SSL, and CA.md rename to published/201912/20191118 How internet security works- TLS, SSL, and CA.md diff --git a/published/20191119 Top 10 Vim plugins for programming in multiple languages.md b/published/201912/20191119 Top 10 Vim plugins for programming in multiple languages.md similarity index 100% rename from published/20191119 Top 10 Vim plugins for programming in multiple languages.md rename to published/201912/20191119 Top 10 Vim plugins for programming in multiple languages.md diff --git a/published/20191120 Switching from Python 2 to Python 3- What you need to know.md b/published/201912/20191120 Switching from Python 2 to Python 3- What you need to know.md similarity index 100% rename from published/20191120 Switching from Python 2 to Python 3- What you need to know.md rename to published/201912/20191120 Switching from Python 2 to Python 3- What you need to know.md diff --git a/published/20191121 Bash Script to View System Information on Linux Every Time You Log into Shell.md b/published/201912/20191121 Bash Script to View System Information on Linux Every Time You Log into Shell.md similarity index 100% rename from published/20191121 Bash Script to View System Information on Linux Every Time You Log into Shell.md rename to published/201912/20191121 Bash Script to View System Information on Linux Every Time You Log into Shell.md diff --git a/published/20191125 How to Install Ansible (Automation Tool) on CentOS 8-RHEL 8.md b/published/201912/20191125 How to Install Ansible (Automation Tool) on CentOS 8-RHEL 8.md similarity index 100% rename from published/20191125 How to Install Ansible (Automation Tool) on CentOS 8-RHEL 8.md rename to published/201912/20191125 How to Install Ansible (Automation Tool) on CentOS 8-RHEL 8.md diff --git a/published/20191125 How to use loops in awk.md b/published/201912/20191125 How to use loops in awk.md similarity index 100% rename from published/20191125 How to use loops in awk.md rename to published/201912/20191125 How to use loops in awk.md diff --git a/published/20191125 The many faces of awk.md b/published/201912/20191125 The many faces of awk.md similarity index 100% rename from published/20191125 The many faces of awk.md rename to published/201912/20191125 The many faces of awk.md diff --git a/published/20191126 5 Commands to Find the IP Address of a Domain in the Linux Terminal.md b/published/201912/20191126 5 Commands to Find the IP Address of a Domain in the Linux Terminal.md similarity index 100% rename from published/20191126 5 Commands to Find the IP Address of a Domain in the Linux Terminal.md rename to published/201912/20191126 5 Commands to Find the IP Address of a Domain in the Linux Terminal.md diff --git a/published/20191127 Create virtual machines with Cockpit in Fedora.md b/published/201912/20191127 Create virtual machines with Cockpit in Fedora.md similarity index 100% rename from published/20191127 Create virtual machines with Cockpit in Fedora.md rename to published/201912/20191127 Create virtual machines with Cockpit in Fedora.md diff --git a/published/20191127 How to write a Python web API with Flask.md b/published/201912/20191127 How to write a Python web API with Flask.md similarity index 100% rename from published/20191127 How to write a Python web API with Flask.md rename to published/201912/20191127 How to write a Python web API with Flask.md diff --git a/published/20191127 Nvidia quietly unveils faster, lower power Tesla GPU accelerator.md b/published/201912/20191127 Nvidia quietly unveils faster, lower power Tesla GPU accelerator.md similarity index 100% rename from published/20191127 Nvidia quietly unveils faster, lower power Tesla GPU accelerator.md rename to published/201912/20191127 Nvidia quietly unveils faster, lower power Tesla GPU accelerator.md diff --git a/published/20191129 A quick introduction to Toolbox on Fedora.md b/published/201912/20191129 A quick introduction to Toolbox on Fedora.md similarity index 100% rename from published/20191129 A quick introduction to Toolbox on Fedora.md rename to published/201912/20191129 A quick introduction to Toolbox on Fedora.md diff --git a/published/20191202 Use the Window Maker desktop on Linux.md b/published/201912/20191202 Use the Window Maker desktop on Linux.md similarity index 100% rename from published/20191202 Use the Window Maker desktop on Linux.md rename to published/201912/20191202 Use the Window Maker desktop on Linux.md diff --git a/published/20191203 An idiot-s guide to Kubernetes, low-code developers, and other industry trends.md b/published/201912/20191203 An idiot-s guide to Kubernetes, low-code developers, and other industry trends.md similarity index 100% rename from published/20191203 An idiot-s guide to Kubernetes, low-code developers, and other industry trends.md rename to published/201912/20191203 An idiot-s guide to Kubernetes, low-code developers, and other industry trends.md diff --git a/published/20191203 Using Ansible to organize your SSH keys in AWS.md b/published/201912/20191203 Using Ansible to organize your SSH keys in AWS.md similarity index 100% rename from published/20191203 Using Ansible to organize your SSH keys in AWS.md rename to published/201912/20191203 Using Ansible to organize your SSH keys in AWS.md diff --git a/published/20191203 Why use the Pantheon desktop for Linux Elementary OS.md b/published/201912/20191203 Why use the Pantheon desktop for Linux Elementary OS.md similarity index 100% rename from published/20191203 Why use the Pantheon desktop for Linux Elementary OS.md rename to published/201912/20191203 Why use the Pantheon desktop for Linux Elementary OS.md diff --git a/published/20191204 Dell XPS 13 7390 Review- The Best Laptop For Desktop Linux Users.md b/published/201912/20191204 Dell XPS 13 7390 Review- The Best Laptop For Desktop Linux Users.md similarity index 100% rename from published/20191204 Dell XPS 13 7390 Review- The Best Laptop For Desktop Linux Users.md rename to published/201912/20191204 Dell XPS 13 7390 Review- The Best Laptop For Desktop Linux Users.md diff --git a/published/20191204 Fedora Desktops - Memory Footprints.md b/published/201912/20191204 Fedora Desktops - Memory Footprints.md similarity index 100% rename from published/20191204 Fedora Desktops - Memory Footprints.md rename to published/201912/20191204 Fedora Desktops - Memory Footprints.md diff --git a/published/20191204 Java vs. Python- Which should you choose.md b/published/201912/20191204 Java vs. Python- Which should you choose.md similarity index 100% rename from published/20191204 Java vs. Python- Which should you choose.md rename to published/201912/20191204 Java vs. Python- Which should you choose.md diff --git a/published/20191206 5 cool terminal pagers in Fedora.md b/published/201912/20191206 5 cool terminal pagers in Fedora.md similarity index 100% rename from published/20191206 5 cool terminal pagers in Fedora.md rename to published/201912/20191206 5 cool terminal pagers in Fedora.md diff --git a/published/20191206 6 Ways to Send Email from the Linux Command Line.md b/published/201912/20191206 6 Ways to Send Email from the Linux Command Line.md similarity index 100% rename from published/20191206 6 Ways to Send Email from the Linux Command Line.md rename to published/201912/20191206 6 Ways to Send Email from the Linux Command Line.md diff --git a/published/20191206 Pekwm- A lightweight Linux desktop.md b/published/201912/20191206 Pekwm- A lightweight Linux desktop.md similarity index 100% rename from published/20191206 Pekwm- A lightweight Linux desktop.md rename to published/201912/20191206 Pekwm- A lightweight Linux desktop.md diff --git a/published/20191207 Getting started with the GNOME Linux desktop.md b/published/201912/20191207 Getting started with the GNOME Linux desktop.md similarity index 100% rename from published/20191207 Getting started with the GNOME Linux desktop.md rename to published/201912/20191207 Getting started with the GNOME Linux desktop.md diff --git a/published/20191209 Counting down the days using bash.md b/published/201912/20191209 Counting down the days using bash.md similarity index 100% rename from published/20191209 Counting down the days using bash.md rename to published/201912/20191209 Counting down the days using bash.md diff --git a/published/20191210 3 easy steps to update your apps to Python 3.md b/published/201912/20191210 3 easy steps to update your apps to Python 3.md similarity index 100% rename from published/20191210 3 easy steps to update your apps to Python 3.md rename to published/201912/20191210 3 easy steps to update your apps to Python 3.md diff --git a/published/20191210 Breaking Linux files into pieces with the split command.md b/published/201912/20191210 Breaking Linux files into pieces with the split command.md similarity index 100% rename from published/20191210 Breaking Linux files into pieces with the split command.md rename to published/201912/20191210 Breaking Linux files into pieces with the split command.md diff --git a/published/20191210 Customize your Linux desktop with FVWM.md b/published/201912/20191210 Customize your Linux desktop with FVWM.md similarity index 100% rename from published/20191210 Customize your Linux desktop with FVWM.md rename to published/201912/20191210 Customize your Linux desktop with FVWM.md diff --git a/published/20191211 Annotate screenshots on Linux with Ksnip.md b/published/201912/20191211 Annotate screenshots on Linux with Ksnip.md similarity index 100% rename from published/20191211 Annotate screenshots on Linux with Ksnip.md rename to published/201912/20191211 Annotate screenshots on Linux with Ksnip.md diff --git a/published/20191211 How to Find High CPU Consumption Processes in Linux.md b/published/201912/20191211 How to Find High CPU Consumption Processes in Linux.md similarity index 100% rename from published/20191211 How to Find High CPU Consumption Processes in Linux.md rename to published/201912/20191211 How to Find High CPU Consumption Processes in Linux.md diff --git a/published/20191212 How to configure Openbox for your Linux desktop.md b/published/201912/20191212 How to configure Openbox for your Linux desktop.md similarity index 100% rename from published/20191212 How to configure Openbox for your Linux desktop.md rename to published/201912/20191212 How to configure Openbox for your Linux desktop.md diff --git a/published/20191213 What GNOME 2 fans love about the Mate Linux desktop.md b/published/201912/20191213 What GNOME 2 fans love about the Mate Linux desktop.md similarity index 100% rename from published/20191213 What GNOME 2 fans love about the Mate Linux desktop.md rename to published/201912/20191213 What GNOME 2 fans love about the Mate Linux desktop.md diff --git a/published/20191214 Get started with Lumina for your Linux desktop.md b/published/201912/20191214 Get started with Lumina for your Linux desktop.md similarity index 100% rename from published/20191214 Get started with Lumina for your Linux desktop.md rename to published/201912/20191214 Get started with Lumina for your Linux desktop.md diff --git a/published/20191217 5 interview questions every Kubernetes job candidate should know.md b/published/201912/20191217 5 interview questions every Kubernetes job candidate should know.md similarity index 100% rename from published/20191217 5 interview questions every Kubernetes job candidate should know.md rename to published/201912/20191217 5 interview questions every Kubernetes job candidate should know.md diff --git a/published/20191217 Build a retro Apple desktop with the Linux MLVWM.md b/published/201912/20191217 Build a retro Apple desktop with the Linux MLVWM.md similarity index 100% rename from published/20191217 Build a retro Apple desktop with the Linux MLVWM.md rename to published/201912/20191217 Build a retro Apple desktop with the Linux MLVWM.md diff --git a/published/20191218 How tracking pixels work.md b/published/201912/20191218 How tracking pixels work.md similarity index 100% rename from published/20191218 How tracking pixels work.md rename to published/201912/20191218 How tracking pixels work.md diff --git a/published/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md b/published/201912/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md similarity index 100% rename from published/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md rename to published/201912/20191220 How to Start, Stop - Restart Services in Ubuntu and Other Linux Distributions.md diff --git a/published/20191221 Customize your Linux desktop with KDE Plasma.md b/published/201912/20191221 Customize your Linux desktop with KDE Plasma.md similarity index 100% rename from published/20191221 Customize your Linux desktop with KDE Plasma.md rename to published/201912/20191221 Customize your Linux desktop with KDE Plasma.md diff --git a/published/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md b/published/201912/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md similarity index 100% rename from published/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md rename to published/201912/20191222 How to Update Grub on Ubuntu and Other Linux Distributions.md diff --git a/published/20191222 Why your Python code needs to be beautiful and explicit.md b/published/201912/20191222 Why your Python code needs to be beautiful and explicit.md similarity index 100% rename from published/20191222 Why your Python code needs to be beautiful and explicit.md rename to published/201912/20191222 Why your Python code needs to be beautiful and explicit.md diff --git a/published/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md b/published/201912/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md similarity index 100% rename from published/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md rename to published/201912/20191224 App Highlight- Falkon Open Source Web Browser from KDE.md diff --git a/published/20191224 Unix is turning 50. What does that mean.md b/published/201912/20191224 Unix is turning 50. What does that mean.md similarity index 100% rename from published/20191224 Unix is turning 50. What does that mean.md rename to published/201912/20191224 Unix is turning 50. What does that mean.md From dcb5b04648c41f26caf577f53b03a12e5e8d512b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Dec 2019 22:04:33 +0800 Subject: [PATCH 142/430] PRF @geekpi --- ...e the Herbstluftwm Linux window manager.md | 53 +++++++++---------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/translated/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md b/translated/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md index cba33f5166..91bb816e93 100644 --- a/translated/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md +++ b/translated/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md @@ -1,22 +1,22 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11734-1.html) [#]: subject: (Why Vim fans love the Herbstluftwm Linux window manager) [#]: via: (https://opensource.com/article/19/12/herbstluftwm-linux-desktop) [#]: author: (Seth Kenlon https://opensource.com/users/seth) 为什么 Vim 爱好者喜欢 Herbstluftwm Linux 窗口管理器 ====== -本文是 24 天 Linux 桌面特别系列的一部分。如果你是Vim爱好者,请试试 Herbstluftwm,这是一个受到 ”Vim 方式“启发的基于平铺的 Linux 窗口管理器。 -![OpenStack source code \(Python\) in VIM][1] -每个人都喜欢 Vim(除了 Dvorak 和 Emacs 用户)。Vim 非常流行,以至于有整个 Web 浏览器都使用 Vim 键绑定来浏览网页,非常流行的 [Zsh][2] 终端仿真器中的 Vim 模式,甚至是文本编辑器。 还有一个名为 [herbstluftwm][3] 的窗口管理器,它部分模仿了 “Vim 方式”。Herbstluftwm 取消了窗口,在程序载入和使用时使用平铺或者象限代替。 你可以使用键盘(**Alt+h**、**Alt+j**、**Alt+k** 和 **Alt+l**)从一个平铺块移动到另一个平铺块。 +> 本文是 24 天 Linux 桌面特别系列的一部分。如果你是 Vim 爱好者,请试试 Herbstluftwm,这是一个受到 “Vim 方式”启发的平铺式 Linux 窗口管理器。 -![Herbstluftwm][4] +![](https://img.linux.net.cn/data/attachment/album/201912/31/215943pisvzwkm8mvsefhm.jpg) -从发行版软件仓库安装 Herbstluftwm。安装后,请退出当前桌面会话,以便可以登录到新会话。默认情况下,会话管理器(KDM、GDM、LightDM 或 XDM,具体取决于你的设置)将继续登录到以前的桌面,因此在登录之前必须覆盖它。 +每个人都喜欢 Vim(除了 Dvorak 和 Emacs 用户)。Vim 非常流行,它不仅仅是个编辑器,还有整个都使用 Vim 键绑定来浏览网页的 Web 浏览器,在非常流行的 [Zsh][2] 终端仿真器中也有 Vim 模式。此外,还有一个名为 [herbstluftwm][3] 的窗口管理器,它部分模仿了 “Vim 方式”。Herbstluftwm 取消了窗口,而是在程序载入和使用时使用平铺的贴片或者象限代替。你可以使用键盘(`Alt+h`、`Alt+j`、`Alt+k` 和 `Alt+l`)从一个平铺贴片移动到另一个平铺贴片。 + +可以从发行版软件仓库安装 Herbstluftwm。安装后,请退出当前桌面会话,以便可以登录到新会话。默认情况下,会话管理器(KDM、GDM、LightDM 或 XDM,具体取决于你的设置)将继续登录到以前的桌面,因此在登录之前必须覆盖它。 在 GDM 中: @@ -28,59 +28,56 @@ ### Herbstluftwm 桌面之旅 -第一次登录 Herbstluftwm 时,你只会看到绿屏,边缘有深绿色边框。你所看到的是初始平铺,其中没有加载任何应用程序。要启动默认应用,请按 **Alt+回车**。 - -文档中强调使用 **$HOME/.config/herbstluftwm/autostart** 作为登录时启动应用的配置文件。对于不必在每次登录时启动的应用,可以使用 xterm 作为启动守护进程。与往常一样,在命令将 shell 的控制权返回给你后加一个 **amp;** 符号。例如,要启动 Emacs: +第一次登录 Herbstluftwm 时,你只会看到一个绿屏,边缘有深绿色边框。你所看到的是初始的平铺贴片,其中没有加载任何应用程序。要启动默认应用,请按 `Alt+Enter`。 +![][4] +文档中强调使用 `$HOME/.config/herbstluftwm/autostart` 作为登录时启动重要应用的配置文件。对于不必在每次登录时启动的应用,可以使用 xterm 作为启动守护进程。与往常一样,在命令后加一个 `&` 符号会将 shell 的控制权返回给你。例如,要启动 Emacs: ``` -`% emacs &` +% emacs & ``` -这将在新平铺中启动 Emacs 窗口,然后返回命令行。 +这将在新的平铺贴片中启动 Emacs 窗口,然后返回命令行。 ![Emacs running in Herbstluftwm][7] -#### 切换平铺 +#### 切换平铺贴片 -要从一个平铺块移动到另一个平铺块,请使用经典的 **h**、**j**、**k** 或 **l** 与 **Alt** 的 Vim 导航组合键。例如,要从终端切换到其下方平铺中的应用(即屏幕底部),请按 **Alt+j**。要返回,请按 **Alt+k**。左移和右移分别为 **Alt+h** 和 **Alt+l**。 +要从一个平铺贴片移动到另一个平铺贴片,请使用经典的 `h`、`j`、`k` 或 `l` 与 `Alt` 的 Vim 导航组合键。例如,要从终端切换到其下方的平铺贴片中的应用(即屏幕底部),请按 `Alt+j`。要返回,请按 `Alt+k`。左移和右移分别为 `Alt+h` 和 `Alt+l`。 #### 分割屏幕 -你可以使用 **Alt+o** 垂直分割屏幕,使用 **Alt+u** 水平分割屏幕。 +你可以使用 `Alt+o` 垂直分割屏幕,使用 `Alt+u` 水平分割屏幕。 -要删除空白平铺块,请移动到该平铺块,然后按 **Alt+r**。 +要删除空白平铺贴片,请移动到该平铺贴片,然后按 `Alt+r`。 ### 配置 herbstluftwm -除了 **Alt** 键绑定外,你还可通过 **herbstclient** 命令与 Herbstluftwm 进行通信。此命令可以在 shell 中交互,或者你可在配置文件中保留你的首选项。 +除了 `Alt` 键绑定外,你还可通过 `herbstclient` 命令与 Herbstluftwm 进行通信。此命令可以在 shell 中交互,或者你可在配置文件中保留你的首选项。 你可以查看 Herbstluftwm 中的所有可用属性: - ``` -`$ herbstclient attr` +$ herbstclient attr ``` -Herbstluftwm 的默认行为在默认配置文件中定义,你可以将其复制到家目录并进行修改。启动后,Herbstluftwm 执行配置文件中包含的命令。例如,你觉得使用以 **Alt** 为中心的键绑定很笨拙(它传统上是应用内保留快捷键),那你可以在配置文件中更改触发 Herbstluftwm 操作的键: - +Herbstluftwm 的默认行为定义在其默认配置文件中,你可以将其复制到你的家目录并进行修改。启动后,Herbstluftwm 执行配置文件中包含的命令。例如,你觉得使用以 `Alt` 为中心的键绑定很笨拙(它传统上是应用内保留快捷键),那你可以在配置文件中更改触发 Herbstluftwm 操作的键: ``` % mkdir ~/.config/herbstluftwm -% cp /usr/xdg/herbstluftwm/autostart \ -~/.config/herbstluftwm +% cp /usr/xdg/herbstluftwm/autostart ~/.config/herbstluftwm % sed -i 's/Mod=Mod1/Mod=Mod4/' ~/.config/herbstluftwm % herbstclient reload ``` -这将使 Herbstluftwm 的修饰键更改为 Super 键(”Windows“或 ”Tux“ 键,具体取决于你的键盘)。 +这将使 Herbstluftwm 的修饰键更改为 `Super` 键(“Windows” 或 “Tux” 键,具体取决于你的键盘)。 -使用自动启动文件,你可以设置自定义键绑定,为特定类型的应用创建标签,以便以一致的方式平铺应用,并执行更多操作。 +使用 `autostart` 文件,你可以设置自定义键绑定,为特定类型的应用创建标签,以便以一致的方式平铺应用,并执行更多操作。 ### 为何你要尝试 herbstluftwm -Herbstluftwm 是一个平铺窗口管理器的很好例子。它默认平铺窗口,并允许用户定义全局规则例外。它使用类似 Vim 的导航,但可以快速简单地覆盖它。你可能是你一直在寻找的平铺管理器,所以请尽快尝试一下。 +Herbstluftwm 是一个平铺窗口管理器的很好例子。它默认平铺窗口,并允许用户定义全局规则的例外。它使用类似 Vim 的导航方式,但可以快速简单地覆盖它。它可能是你一直在寻找的平铺管理器,所以请马上尝试一下。 -------------------------------------------------------------------------------- @@ -89,7 +86,7 @@ via: https://opensource.com/article/19/12/herbstluftwm-linux-desktop 作者:[Seth Kenlon][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 00fd6dc8c46dd4496de0263851c4b12ca97b087c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Dec 2019 22:04:43 +0800 Subject: [PATCH 143/430] PUB @geekpi https://linux.cn/article-11734-1.html --- ...220 Why Vim fans love the Herbstluftwm Linux window manager.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md (100%) diff --git a/translated/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md b/published/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md similarity index 100% rename from translated/tech/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md rename to published/20191220 Why Vim fans love the Herbstluftwm Linux window manager.md From 67ecaf1a65908b22b9697e50ab0afd9c59d01259 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Tue, 31 Dec 2019 23:05:33 +0800 Subject: [PATCH 144/430] translating by lxbwolf --- sources/tech/20191017 Intro to the Linux useradd command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191017 Intro to the Linux useradd command.md b/sources/tech/20191017 Intro to the Linux useradd command.md index b2befd4650..ab23c72db5 100644 --- a/sources/tech/20191017 Intro to the Linux useradd command.md +++ b/sources/tech/20191017 Intro to the Linux useradd command.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2e5996fdc49832db9741b05177624359300e57b3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Jan 2020 01:06:36 +0800 Subject: [PATCH 145/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200101=20Signal?= =?UTF-8?q?:=20A=20Secure,=20Open=20Source=20Messaging=20App?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md --- ...al- A Secure, Open Source Messaging App.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md diff --git a/sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md b/sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md new file mode 100644 index 0000000000..4dd4037627 --- /dev/null +++ b/sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md @@ -0,0 +1,122 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Signal: A Secure, Open Source Messaging App) +[#]: via: (https://itsfoss.com/signal-messaging-app/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Signal: A Secure, Open Source Messaging App +====== + +**_Brief: Signal is a secure open-source messaging app for smartphones. It also offers a standalone desktop app for Linux, Windows, and macOS_. _Here, we take a look at its features and usability._** + +### Signal is an Excellent Alternative to WhatsApp (and Telegram) for Privacy Concerned People + +![Signal App On Linux][1] + +Signal is an open source application with a keen focus on privacy. It is recommended by privacy advocates like [Edward Snowden][2]. + +It may not have as many features as Telegram or WhatsApp – but if you want to enhance your privacy while having a conversation, this is a solid open-source solution. + +You can install it on your smartphone ([iOS][3]/[Android][4]) and it is also available for Linux, Windows, and macOS. + +### Features of Signal Messenger + +**Note:** _Some of the features are specific/exclusive to smartphones. You may not observe all the features mentioned in the desktop app._ + +As I already mentioned, this is tailored to enhance your privacy. So, the user experience may not be the “best” you’ve ever seen. But, privacy/security-wise, I think it is a good option to have. + +![Signal Features][5] + +#### Disappearing Messages + +You can set a timer for messages in a conversation – so that it will be automatically deleted as per the timer. + +Essentially, anyone in the conversation can activate this feature. So, you control if the messages should stay in a conversation or disappear. + +#### Use it As Default SMS App + +If you want to utilize an open-source app for all your SMSs, you can simply go to Signal’s app settings and set it as the default for SMS and MMS. + +#### Screen Security + +There’s a neat feature to block screenshots in-app, “Screen Security”. + +If you enable it, you won’t be able to take a screenshot of any conversation in the app. You can find the option to enable or disable it from the app settings. + +It may not be useful to everyone – but you can try it out. + +#### Safety Number + +If you want to verify the security of your encryption with a friend, you can simply tap on the profile and scroll down to find “View Safety Number”. + +You can either scan it to verify or simply take a look at it to mark it verified. + +#### Locked Messages + +If you protect the app with a lock (pin/fingerprint), even if your device has been unlocked, you won’t be able to see the messages on your notifications. + +So, when you get a notification while Signal is locked, you will notice the content of the notification as “**Locked Message**” – which is a plus for privacy-oriented users. + +#### Other Features + +![][6] + +As you would expect in a messaging app – you get a couple of stickers to utilize and you can also create a group if you want. + +However, you won’t have the ability to moderate your group – you can just add members and change the profile picture. + +In addition to this, Signal also supports biometric security for its app. + +### Installing Signal on Ubuntu/Linux + +Unfortunately, you don’t get a .**deb** or .**AppImage** to install it on your Linux distro. So, you will need to utilize the terminal as per the [official installation instructions][7]. + +Here’s what you have to type in the terminal: + +``` +curl -s https://updates.signal.org/desktop/apt/keys.asc | sudo apt-key add - +echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/signal-xenial.list +sudo apt update && sudo apt install signal-desktop +``` + +Simply copy-paste the commands one by one in the terminal and you should be good to go. + +[Download Signal for Other Devices][7] + +### My Thoughts On Signal + +I’ve been using Signal for a few years now and it has improved with what it offers. However, I still feel that the user experience can be improved. + +Privacy-wise, it is definitely a good alternative to what we already have (in my opinion). You can give it a try and see how well it works for your usage. + +You can also take a look at their [GitHub page][8] for the latest developments and beta releases if you want to try them out. + +Signal app may not be a popular messaging app when compared to WhatsApp or even [Telegram on Linux][9]. But, you can try it for yourself and encourage your friends to use an open-source messaging app. + +Have you tried it yet? Let me know what you think about the ‘Signal’ app in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/signal-messaging-app/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-shot.jpg?ssl=1 +[2]: https://en.wikipedia.org/wiki/Edward_Snowden +[3]: https://apps.apple.com/us/app/signal-private-messenger/id874139669 +[4]: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms&hl=en_IN +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-phone.jpg?ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-shot-1.jpg?ssl=1 +[7]: https://signal.org/download/ +[8]: https://github.com/signalapp +[9]: https://itsfoss.com/install-telegram-desktop-linux/ From bef234c00747c8c4eb7baecaa210db4c15f8bee5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Jan 2020 01:07:31 +0800 Subject: [PATCH 146/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191231=2012=20p?= =?UTF-8?q?rogramming=20resources=20for=20coders=20of=20all=20levels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191231 12 programming resources for coders of all levels.md --- ...ming resources for coders of all levels.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20191231 12 programming resources for coders of all levels.md diff --git a/sources/tech/20191231 12 programming resources for coders of all levels.md b/sources/tech/20191231 12 programming resources for coders of all levels.md new file mode 100644 index 0000000000..5da5148542 --- /dev/null +++ b/sources/tech/20191231 12 programming resources for coders of all levels.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (12 programming resources for coders of all levels) +[#]: via: (https://opensource.com/article/19/12/programming-resources) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) + +12 programming resources for coders of all levels +====== +No matter where you are in your programming journey, there are things +for you to learn in Opensource.com's top 12 programming articles from +2019. +![Woman sitting in front of her computer][1] + +> "The best time to learn computer programming was 20 years ago. The second best time is now." +> — A computer science proverb, maybe. + +Are you a new programmer, an experienced web dev, a backend wizard, a grizzled system programmer, or some other yet-to-be-discovered species of computer geek? Wherever you land in the vast ecosystem of software developers, the only constant in our field is the need to learn about new technologies and how to apply them. Here is an ensemble of the most-read Opensource.com articles from the past year that inform and entertain, and I'm excited to share them with you here. + +### For the noble newbie + +Whatever your skillset or interests, learning how to write computer programs turns that domain-specific knowledge into a superpower. Unfortunately, it isn't possible to learn how to program from the bite of a radioactive computer, at least not yet. Until that's a thing, I recommend these excellent articles to help bootstrap your programming skills. They address important questions like which languages to consider learning and different ways to get started. + + * [Which programming languages should you learn?][2] + * [A dozen ways to learn Python][3] + * [Three popular programming languages you can learn with Raspberry Pi][4] + * [Introducing kids to computational thinking with Python][5] + + + +### Keeping up with emerging technologies + +Experienced programmers know that the only thing harder than learning to program is keeping your skills and knowledge up to date. But we are an [autodidactic][6] breed, always looking to level up our expertise and understanding. Even if we don't anticipate using a new technology, we know that eventually, someone will ask about it. These articles on Rust, WebAssembly, and Podman are great places to start learning about just a few of the upcoming trends in software technology. + + * [Why should you use Rust in WebAssembly?][7] + * [Level up command-line playgrounds with WebAssembly][8] + * [How does rootless Podman work?][9] + * [Why to choose Rust as your next programming language][10] + + + +### Old programs never die + +Despite the never-ending cascade of new technologies, it never hurts to look back to help you look forward. Today's amazing technologies are built on top of yesterday's tools, and it will serve us well to understand the abilities and limitations of those tools, even if we never write a line of code in these languages of legend. This collection of articles focuses on the C language, a practical application written in AWK, and an interesting discussion of computer languages that are declining in popularity, but perhaps not dead yet. + + * [The monumental impact of C][11] + * [How to write a good C main function][12] + * [Drinking coffee with AWK][13] + * [What's your favorite "dead" language?][14] + + + +### Keep on learning + +No matter where you are in your programming journey, there will always be more to learn. I hope these top resources from 2019 will get you ready for 2020. Thanks to the authors and you, the reader. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/programming-resources + +作者:[Erik O'Shaughnessy][a] +选题:[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/jnyjny +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_3.png?itok=qw2A18BM (Woman sitting in front of her computer) +[2]: https://opensource.com/article/19/2/which-programming-languages-should-you-learn +[3]: https://opensource.com/article/19/8/dozen-ways-learn-python +[4]: https://opensource.com/article/19/3/programming-languages-raspberry-pi +[5]: https://opensource.com/article/19/2/break-down-stereotypes-python +[6]: https://en.wikipedia.org/wiki/Autodidacticism +[7]: https://opensource.com/article/19/2/why-use-rust-webassembly +[8]: https://opensource.com/article/19/4/command-line-playgrounds-webassembly +[9]: https://opensource.com/article/19/2/how-does-rootless-podman-work +[10]: https://opensource.com/article/19/10/choose-rust-programming-language +[11]: https://opensource.com/article/19/10/command-line-heroes-c +[12]: https://opensource.com/article/19/5/how-write-good-c-main-function +[13]: https://opensource.com/article/19/2/drinking-coffee-awk +[14]: https://opensource.com/article/19/6/favorite-dead-language From 45412c36e320ff7b81f913a3da4e4002a4c9eaa4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Jan 2020 01:08:01 +0800 Subject: [PATCH 147/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191231=207=20re?= =?UTF-8?q?sources=20to=20grow=20your=20Java=20skills?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191231 7 resources to grow your Java skills.md --- ...31 7 resources to grow your Java skills.md | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 sources/tech/20191231 7 resources to grow your Java skills.md diff --git a/sources/tech/20191231 7 resources to grow your Java skills.md b/sources/tech/20191231 7 resources to grow your Java skills.md new file mode 100644 index 0000000000..e3ce14f901 --- /dev/null +++ b/sources/tech/20191231 7 resources to grow your Java skills.md @@ -0,0 +1,109 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 resources to grow your Java skills) +[#]: via: (https://opensource.com/article/19/12/java-resources) +[#]: author: (Stephon Brown https://opensource.com/users/stephb) + +7 resources to grow your Java skills +====== +Java is still evolving and going strong decades after its launch. Catch +up with our hottest Java articles from 2019. +![Coffee beans and a cup of coffee][1] + +Java is still one of the most influential programming languages today. It only recently dropped from #2 to the third most used [programming language on GitHub][2]. You may say usage is not everything, but Java also remains popular. According to [Stack Overflow's Developer Survey Results for 2019][3], Java is the fifth most popular programming language. It was first released to the public in 1998, and it stays high on the usage and popularity scale after all this time. A big reason for that fact is that Java has grown and evolved significantly since its release. As a strongly-typed language, Java continues to push the envelope of the object-oriented programming (OOP) paradigm and is continually used to implement new concepts and technologies. + +Testifying to its ongoing popularity, Opensource.com publishes many excellent articles about the language. The following seven are Opensource.com's top read Java articles of 2019. + +### What is an object in Java? + +Chris Hermansen provides an in-depth look at the OOP paradigm and its importance to Java development in [_What is an object in Java?_][4] OOP is based on the idea that data and programs should all be viewed as "objects." Each object has properties and behaviors that describe how it is used in a program. + +There are a number of principals that define OOP and its use of objects for all aspects of programming. These include: + + * **Inheritance:** This is the hierarchical use of objects for mutating and reusing object properties and behaviors from parent objects to child objects. + * **Typing:** Static and strong typing express the idea that, at compile time, the type should be defined and constant unless explicitly converted or changed, which helps with both debugging and consistent functionality. + * **Classes and primitives:** Objects natively implemented into OOP languages are called "primitives," including int, long, etc.; however, objects designed and implemented using class declarations and by assigning properties and behaviors to primitives are called classes. + * **Object class:** In Java, the Object class is the parent class that all classes inherit from. It allows the use of basic functions and properties, including comparison and **hashCode** functionality. + + + +Overall, objects are the basis of Java development, and Chris expounds upon them in his in-depth article. + +### What is a Java constructor? + +As a great follow-up to Chris Hermansen's overview of the Java object, I recommend reading [_What is a Java constructor?_][5] The constructor is an important concept to understand when working within the realms of OOP and Java, and Seth Kenlon introduces it in this easy-to-understand guide. The constructor in Java (and most OOP languages) is where you instantiate or create an instance of an object you have defined. In many languages, an instance is created with the **new** keyword and the object you want to create. For example, **Dog fluffy = new Dog();** will create a new instance of **Dog**. Constructors can also set properties within the object you are instantiating; therefore, if you have an implementation for a constructor to set your object's size, height, and type, you can set those all from the constructor. By default, Java allows objects to be instantiated with the **new** keyword without having an explicit constructor defined and creates them at compilation time. + +### Initializing arrays in Java + +An array is a longstanding data structure that originates in early math concepts. In computer science, as Chris Hermansen says in [_Initializing arrays in Java_][6], it represents "…a contiguous block of memory where each location is a certain type," which can be any type—from primitives (int, long, etc.) to custom objects (Dog, Cat, Car). An array is initialized with a specific type of constructor that reserves the fixed length of the array; in other words, it is a defined amount of memory that the array is reserving. It looks like this: **int[] a = new int[15]**. Much like instantiating a new object, arrays are similar in form and functions. In addition, because arrays inherit from the Object class, they can utilize methods and properties associated with the Object class, including **GetClass()**. + +In addition to simple arrays, Java implements **ArrayLists** and **Map** objects by default. Both of these collection types allow elements to be added or removed dynamically; there is no need to set the size of each manually. The ArrayList allows the addition, retrieval, and removal of elements dynamically as your code runs. These lists must be of one type, which is defined when it is instantiated. The Map allows a dictionary object to be created, which means each index, or "key," is connected to another object. For example, **Map<string, Integer> scores = new Map<String, Integer>()** would allow you to insert a student's score, with the key being their name, with **scores.put("Stephon", 50)**. Arrays, ArrayLists, and Maps are excellent ways to store, retrieve, and manipulate data within your Java application. + +### Getting started with blockchain for Java developers + +Blockchain is an amalgamation of cryptography, computer science, cryptocurrency, and many other fields. It is the technology at the heart of Bitcoin and other cryptocurrencies, but it can stand alone and is powerful when implemented with other concepts. As Bilgin Ibrayam writes in [_Getting started with blockchain for Java developers_][7], "the technologies most people know, such as Java, .NET, and relational databases, are not common in the blockchain space; instead, blockchain is primarily dominated by C, Go, and Rust on the server side, and JavaScript on the client side." However, this should not deter you from using Java for developing blockchain projects, and Ibrayam provides seven Java-based open source technologies that leverage the Java language and the Java Virtual Machine (JVM) for blockchain development. + +The seven technologies he presents are: Corda, a business-focused, blockchain technology that focuses on building smart contracts to process and streamline business transactions on the chain; Hyperledger's Pantheon (or Besu), an Ethereum client that enables use of private and public networks and was created to introduce Java developers to blockchain development; Bitcoinj, a Java implementation of the Bitcoin protocol that allows the use of a wallet and transactions without Bitcoin Core; Web3j, a lightweight Ethereum client that has implementations for both Android and Java for smart contract development; Hyperledger Fabric SDK, a complete solution for building and providing security for a localized or distributed blockchain; FundRequest, a decentralized platform/marketplace that enables requesting open source work and is completely implemented in Java on top of the Ethereum network; and Eventeum, which allows monitoring of the Ethereum network and storage of events and their details on a messaging server like Kafka or RabbitMQ. + +### 7 Java tips for new developers + +When learning a new language, there are always obstacles, whether they be syntactical differences or entire development paradigm shifts. Seth Kenlon provides [_7 Java tips for new developers_][8], focusing on what to look for when diving into Java programming. Installing Java and the Java Development Kit (JDK) are the first steps to developing in Java. Most computers may already have Java and JVM installed, but you will need JDK to begin programming. + +In brief, Seth's tips are: + + * Most other languages allow importing and exporting libraries or other code that you may require when developing a project. Java packages are external or internal libraries that need to be managed. The packages are separated and organized by namespaces, which are like buckets for organizing code. + * Packages are imported with the simple syntax of **import** with the library's namespace. + * Declaring a class allows you to create an object in your program. These classes can use different access modifiers; within the classes are properties and methods or functions that also can have access modifiers that define whether they can be used only inside of the class, outside of the class with inherited classes, or by any other class. + * The class modifier **Static** allows the use of properties or functions without having to instantiate or create an instance of an object. + * Code will eventually have bugs; it is inevitable. "Try and catch" flow control allows you to catch errors and exceptions and implement recovery and logging mechanisms. + * To run a Java application outside an integrated development environment (IDE), such as Netbeans or Eclipse, navigate to your Java project folders from the command line and type **java <filename.java>** or, if the application is already compiled into a .jar file, **java -jar <filename.jar>**. + + + +### Using the Java Persistence API + +[_Using the Java Persistence API_][9] (JPA) is my introduction to connecting Java to various data persistence solutions, whether they be relational, NoSQL, or basic file representations in a system. Java provides a broad interface that allows connection to generally any type of persistence solution. This tutorial walks through creating an application with common libraries, including Spring Boot, a module/template for quickly configuring applications in Java; Maven, a package manager for Java; Lombok, a library that simplifies defining object accessors/mutators; and Netbeans, a popular IDE for developing in Java. + +The tutorial uses these libraries to create models for a fictitious bike shop's database. The models' accessors/mutators are defined with Lombok and provide data annotations that are used when persisting to the chosen database. Then the database is set up and configured through the **application.properties** file, which the JPA reads to connect and persist data. The persisting and fetching implementation is done mostly with the Spring framework for Mongo; however, you can also override functions for more control of what should be fetched when finding, updating, or persisting objects. In a matter of minutes, you will be able to define objects and call basic functions on local databases without much boilerplate. + +### How to compare strings in Java + +Flexibility is often considered a gift, and while there are tradeoffs between statically typed and dynamically typed languages, one of Java's strengths is its ability to compare types and equality of types. In fact, Girish Managoli explains in [_How to compare strings in Java_][10], there six different ways to compare the immutable string type in Java. + +The double-equal operator (**==**) compares memory location rather than string content. When the compiler sees two strings that are equal, it will allocate the same memory for both. If a new string is instantiated, it will not share the same memory location or object reference. + +The **equals** method compares the case-sensitive content of the string, not the object information. For example, if you use **equals** to compare **Dog** and **Dog**, the result would be true, even if they are two different objects; however, **dog** and **Dog** would be false because the function is case-sensitive. The **equalsIgnoreCase** function is the same as **equals**, except that it removes case-sensitivity; therefore, comparing **dog** and **Dog** would be true. The **compareTo** and **compareToIgnoreCase** functions compare strings based on the Unicode value of each character in the string; they compare the total value to the other string and return the total lexical value difference between the two (with case-sensitivity and case-insensitivity, respectively). Last but not least, the **Objects equals** function allows the comparison of two string object references and of null values. + +### Java: Still growing and evolving + +Java is still going strong, evolving, and staying relevant after all this time, and there is continued optimism in its growth. Since its release, the Java platform has continued to change with the times, from OpenJDK to release schedule changes, and push the envelope of what you can accomplish with it. + +As you can see from the top Java articles on Opensource.com in 2019, it never hurts to know the language, because you never know where you can use it for your next project. These (and other) Opensource.com articles have been really helpful to me as a [new developer transitioning from higher education][11]. I look forward to reading and sharing more in 2020, and I hope you'll join me. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/java-resources + +作者:[Stephon Brown][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/stephb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee) +[2]: https://octoverse.github.com/#top-languages +[3]: https://insights.stackoverflow.com/survey/2019 +[4]: https://opensource.com/article/19/8/what-object-java +[5]: https://opensource.com/article/19/6/what-java-constructor +[6]: https://opensource.com/article/19/10/initializing-arrays-java +[7]: https://opensource.com/article/19/4/blockchain-java-developers +[8]: https://opensource.com/article/19/10/java-basics +[9]: https://opensource.com/article/19/10/using-java-persistence-api +[10]: https://opensource.com/article/19/9/compare-strings-java +[11]: https://opensource.com/article/19/6/5-transferable-higher-education-skills From 6aa74361f167f7cda6eeba1cca25d953efda8ce8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Jan 2020 01:08:36 +0800 Subject: [PATCH 148/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191231=20How=20?= =?UTF-8?q?to=20be=20a=20better=20organization:=20Top=2010=20reads=20for?= =?UTF-8?q?=20leaders?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191231 How to be a better organization- Top 10 reads for leaders.md --- ... organization- Top 10 reads for leaders.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/tech/20191231 How to be a better organization- Top 10 reads for leaders.md diff --git a/sources/tech/20191231 How to be a better organization- Top 10 reads for leaders.md b/sources/tech/20191231 How to be a better organization- Top 10 reads for leaders.md new file mode 100644 index 0000000000..762f6b6c08 --- /dev/null +++ b/sources/tech/20191231 How to be a better organization- Top 10 reads for leaders.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to be a better organization: Top 10 reads for leaders) +[#]: via: (https://opensource.com/article/19/12/open-leadership) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) + +How to be a better organization: Top 10 reads for leaders +====== +Get tips and strategies to help you leverage open principles in your +organization. +![Shaking hands, networking][1] + +Modern organizations are adopting key elements from open source software. By leveraging the "open" in open source, leaders can help shape a more responsive and productive enterprise. Check out these top 10 articles from 2019 that can help you develop your own path in open leadership. + +### 19 resolutions of an open leader + +Open organizations succeed when leaders are open and transparent, demonstrating open skills, including transparency, inclusivity, adaptability, collaboration, and community. In [_19 resolutions of an open leader_][2], Angela Robertson shares her plan for continuing on the path of an open leader. + +### The psychology behind a blameless retrospective + +"One of the Agile Manifesto's principles suggests all teams regularly reflect on how to become more effective," writes Dominika Bula in [_The psychology behind a blameless retrospective_][3]. She says the main goals of a retrospective are to promote self-improvement, improve processes, and advance team members' skills. She also outlines the three foundational pillars that will "ensure your blameless retrospective truly is successful." + +### A guide to human communication for sysadmins + +The job of a systems administrator is no longer defined simply by running racks of servers and poking bits to optimize performance. In modern organizations, sysadmins can and should increase the value they deliver to the organization they work for. In [_A guide to human communication for sysadmins_][4], Maxim Burgerhout describes the best way to increase your value to an organization: getting to know the people around you. + +### The innovation delusion + +Red Hat CEO Jim Whitehurst observes that organizations (and especially leaders) like to think success is always planned—that they've become masters of chaos and can almost predict the future. But these assessments are often made with the benefit of hindsight. In [_The innovation delusion_][5], Jim advises that different kinds of challenges require different kinds of approaches, and we need to get better at building flexible organizations capable of responding to the unforeseen or unknowable. + +### The power of being vulnerable in the workplace + +In open organizations, high-performing teams must feel comfortable taking risks and appearing vulnerable in front of each other. These are necessary ingredients for creativity, curiosity, and diversity of ideas. In [_The power of being vulnerable in the workplace_][6], Kathleen Hayes explains psychological safety and explores some real-life examples where new mindsets and behaviors have helped teams thrive. + +### Let's be real: Diversity and inclusion is a business issue + +"If the problem is a struggle to innovate, then the solution is greater diversity and inclusion," DeLisa Alexander writes in [_Let's be real: Diversity and inclusion is a business issue_][7]. She says when diversity and inclusion are solutions to problems that affect us every day, we all do better work and generate value for customers. + +### How to plan your next IT career move + +Like many people in open source, being part of technology-oriented communities has been an essential part of Matthew Broberg's career development. In [_How to plan your next IT career move_][8], Matthew challenges us to ask essential career questions about the cloud, DevOps, coding, and where you're going next in IT. + +**[Read next: [The new rules of CIO leadership][9]]** + +### How to advance your career by contributing to open source projects + +After working as a recruiter for 10 years at Red Hat, Josh Wulf decided it was time for a change. He quit his job as a recruiter, contributed to open source software, and landed a job as a software engineer. Josh explains in [_How to advance your career by contributing to open source projects_][10] how he did it and how you can, too. + +### 7 tips to ace your tech job interview + +In [_7 tips to ace your tech job interview_][11], Jessica Repka shares an insightful list of interviewing tips that should help you stand out in a good way. Based on her own job interviews and what she's seen in person while interviewing others, Jessica's tips can give you the edge you need to find your next job. + +### Why DevOps is the most important tech strategy today + +"Many people first learn about DevOps when they see one of its outcomes and ask how it happened. It's not necessary to understand why something is part of DevOps to implement it," Kelly Albrecht writes in [_Why DevOps is the most important tech strategy today_][12]. Albrecht clears up some of the confusion about DevOps and explains how a DevOps strategy can mean the difference between being a leader or a follower in an industry. + +### Open leadership in 2020 + +What do you want to know about open leadership in the coming year? Please share your ideas for article topics in the comments—or even share your own experiences with open leadership by [writing an article for Opensource.com][13]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/open-leadership + +作者:[Jim Hall][a] +选题:[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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/network_team_career_hand.png?itok=_ztl2lk_ (Shaking hands, networking) +[2]: https://opensource.com/open-organization/19/1/leadership-goals +[3]: https://opensource.com/article/19/4/psychology-behind-blameless-retrospective +[4]: https://opensource.com/article/19/9/communication-sysadmins +[5]: https://opensource.com/open-organization/19/6/innovation-delusion +[6]: https://opensource.com/open-organization/19/3/introduction-psychological-safety +[7]: https://opensource.com/open-organization/19/5/inclusivity-solution-innovation +[8]: https://opensource.com/article/19/8/plan-next-IT-career-move +[9]: https://enterprisersproject.com/cio-new-rules-report +[10]: https://opensource.com/article/19/5/how-get-job-doing-open-source +[11]: https://opensource.com/article/19/1/job-interviewing-tips +[12]: https://opensource.com/article/19/3/devops-most-important-tech-strategy +[13]: https://opensource.com/how-submit-article From 29442beb945e4a3b0820cbb5a558f16bec9ad0cf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Jan 2020 01:08:54 +0800 Subject: [PATCH 149/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191231=2010=20A?= =?UTF-8?q?nsible=20resources=20to=20accelerate=20your=20automation=20skil?= =?UTF-8?q?ls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md --- ...es to accelerate your automation skills.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md diff --git a/sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md b/sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md new file mode 100644 index 0000000000..a522f0c869 --- /dev/null +++ b/sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 Ansible resources to accelerate your automation skills) +[#]: via: (https://opensource.com/article/19/12/ansible-resources) +[#]: author: (James Farrell https://opensource.com/users/jamesf) + +10 Ansible resources to accelerate your automation skills +====== +Gear up and get crackin' with awesome Ansible automation skills this +year. +![Gears above purple clouds][1] + +This year saw a wide range of really helpful Ansible articles. Whether you are just starting out with Ansible or a seasoned pro, there is something for everyone here to learn from. + +A good number of these articles are worthy of your bookmarking and perhaps a cron (or maybe a Tower/AWX job) reminder to reread them periodically. + +If you are new to Ansible, start with the following articles: + + * [_A quickstart guide to Ansible_][2] has some good starter information as well as deeper dives into more advanced topics + * [_10 Ansible modules you need to know_][3] and [_5 ops tasks to do with Ansible_][4] review some of the more fundamental functions that every Ansible admin should be familiar with + * [_How to use Ansible to document procedures_][5] also presents a survey of additional topics you might find it interesting to follow up on + + + +The remainder of these articles cover more advanced topics like Windows management, testing, hardware, cloud, and containers—and even a case study in managing the demands of tech-curious children. + +I hope you enjoyed this Ansible year as much as I did. Never stop learning! + + 1. _[How Ansible brought peace to my home][6]_ is a whimsical case study in applying Ansible skills to quickly provision new (or rather old) laptops for my children. + 2. _[Ansible for the Windows admin][7]_ by Taz Brown and Abner Malivert: Did you know Ansible can manage Windows nodes as well? This piece reviews basic Ansible server and Windows client setups with an example on how to deploy an IIS server. + 3. _[10 Ansible modules you need to know][3]_ by Shashank Hegde is a great place to start for some of the most common and basic Ansible modules all admins should know. Running commands, installing packages, and handling files are the basis for many useful automation plays. + 4. _[How to use Ansible to document procedures][5]_ by Marco Bravo: Ansible’s YAML files make for easy reading, so much so that they can be used to document the manual steps needed to accomplish a task. This makes your work easier to debug and extend later on. Also contained in this article are pointers on related topics like testing and analysis. + 5. _[Using Testinfra with Ansible to verify server state][8]_ by Clement Verna: Testing is an integral part of any CI/CD DevOps pipeline, so why not test Ansible’s results as well? This primer on Testinfra can be used to help check the configuration results you need. + 6. _[Hardware bootstrapping with Ansible][9]_ by Mark Phillips: Not all the world is containers and virtual machines. Many of us sysadmins still have significant hardware deployments to manage. With a little PXE dust and DHCP magic (among other tidbits), you can create a convenient framework using Ansible to get real hardware up and running easily. + 7. _[What you need to know about Ansible modules][10]_ by Jairo da Silva Junior: Modules bring real power to Ansible. Many modules are already available, but when there is none, you may need to roll your own. Read this article to look a bit deeper into how modules are made. + 8. _[5 ops tasks to do with Ansible][4]_ by Mark Phillips: This is another more basic review of Ansible use to manage common system operations tasks. The draw here is the list of examples given in Tower (or AWX) instead of the old familiar command line. + 9. _[A quickstart guide to Ansible][2]_ by Chris Short is a great PDF download that you should keep on hand and reread from time to time. It begins with a great primer to get started in Ansible. It also covers other areas of interest including Molecule testing, sysadmin tasks, and Kubernetes object management, to name a few. + 10. _[An Ansible reference guide, CI/CD with Ansible Tower and GitHub, and more news][11]_ by Mark Phillips: This is a monthly round-up article full of interesting links to follow. Topics span Ansible basics, managing Netapp E-Series storage, debugging, patching, and more. Videos are included here as well as some pointers to Ansible meetup groups. Check it out! + + + +Let us know if you had a favorite Ansible article this year and why in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/ansible-resources + +作者:[James Farrell][a] +选题:[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/jamesf +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chaos_engineer_monster_scary_devops_gear_kubernetes.png?itok=GPYLvfVh (Gears above purple clouds) +[2]: https://opensource.com/article/19/2/quickstart-guide-ansible +[3]: https://opensource.com/article/19/9/must-know-ansible-modules +[4]: https://opensource.com/article/19/8/ops-tasks-ansible +[5]: https://opensource.com/article/19/4/ansible-procedures +[6]: https://opensource.com/article/19/9/ansible-documentation-kids-laptops +[7]: https://opensource.com/article/19/2/ansible-windows-admin +[8]: https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state +[9]: https://opensource.com/article/19/5/hardware-bootstrapping-ansible +[10]: https://opensource.com/article/19/3/developing-ansible-modules +[11]: https://opensource.com/article/19/7/ansible-news-edition-one From adf802b41304ef5608a981381d7c68143cb01a32 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Jan 2020 01:09:12 +0800 Subject: [PATCH 150/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191230=2010=20a?= =?UTF-8?q?rticles=20to=20enhance=20your=20security=20aptitude?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191230 10 articles to enhance your security aptitude.md --- ...icles to enhance your security aptitude.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20191230 10 articles to enhance your security aptitude.md diff --git a/sources/tech/20191230 10 articles to enhance your security aptitude.md b/sources/tech/20191230 10 articles to enhance your security aptitude.md new file mode 100644 index 0000000000..7c4314b7ad --- /dev/null +++ b/sources/tech/20191230 10 articles to enhance your security aptitude.md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 articles to enhance your security aptitude) +[#]: via: (https://opensource.com/article/19/12/security-resources) +[#]: author: (Ben Cotton https://opensource.com/users/bcotton) + +10 articles to enhance your security aptitude +====== +Whether you're learning the first steps or looking to add to your +skills, there's something for you in Opensource.com's top 10 security +articles of 2019. +![A secure lock.][1] + +If security is a process (and it is), then it stands to reason that different projects (and contributors) are in different places. Some applications have years of security testing, with design done by people who have worked in information security for decades. Others are brand new projects by developers working on their first open source project. It comes as no surprise that Opensource.com's top security articles of 2019 represent this range of experience. We have articles that introduce basic security practices as well as deep dives into more advanced topics. + +Whether you're learning the first steps or looking to add to your skills acquired over a storied career, there's something for you in the top 10 security articles of 2019. + +### 7 steps to securing your Linux server + +Security is like a house: if the foundation is bad, the rest is at risk. Patrick H. Mullins' excellent _[7 steps to securing your Linux server][2]_ gets you started with basic security steps for Linux servers. Even if you have a lot of experience administering servers, this article provides a good checklist to make sure you have the basics covered. From there, you can begin adding additional layers of security. + +### Make Linux stronger with firewalls + +One of the seven steps to securing your server is enabling a firewall. But what _is_ a firewall, and how does it work? Seth Kenlon answers these questions and then describes in detail how to configure your firewall for better security in _[Make Linux stronger with firewalls][3]_. Using firewalld and Network Manager, you can set different firewall configurations for different networks. This allows you to have a trusting configuration on your home network, for example, and a more paranoid configuration on your favorite coffee shop's WiFi network. + +### Reducing security risks with centralized logging + +Once you've secured your system, you're not done: security is a process, not a state. Part of _keeping_ systems secure is keeping an eye on what goes on. One way to do that, especially with multiple systems, is to centralize your logging. In _[Reducing security risks with centralized logging][4]_, Hannah Suarez shares how to get started (she based this article on her lightning talk at FOSDEM '19). + +### Using GPG keys for SSH + +Most people who use key-based authentication for SSH use SSH keys. And why wouldn't you? It's right there in the name. These are perfectly fine from a security standpoint, but if you want to make some forms of key distribution and backup easier, there's another way. Brian Exelbierd's three-part series walks through _[How to enable SSH access with a GPG subkey][5]_, _[How to import existing SSH keys][6]_, and _[How to reduce your backup needs to a single key file][7]_. + +### Graphically manage SSH keys with Seahorse + +Using GPG for SSH keys isn't everyone's cup of tea, but that doesn't mean you're out of luck when it comes to key management. Seahorse is a graphical tool for managing SSH keys (and other authentication methods) that is included in the GNOME desktop. Alan Formy-Duval's [_Graphically manage SSH keys with Seahorse_][8], is particularly helpful to the novice user. + +### Security scanning your DevOps pipeline + +Containers are everywhere these days. But what's in them? Knowing that containers meet your security policies is an important part of staying secure. Fortunately, you can use open source tools to help automate compliance checking. Jessica Cherry's (formly Repka) [_Security scanning your DevOps pipeline_][9] is a step-by-step tutorial that shows you how to use the Jenkins build system and the Anchore inspection service to create a scanning pipeline for container images and registries. + +### 4 open source cloud security tools + +One of the great things about cloud services is that your data can be accessed from anywhere. One of the downsides to cloud services is that your data can be accessed from anywhere. If you're using "-as-a-Service" offerings, you want to make sure they're securely configured. Anderson Silva, Alison Naylor, Travis McPeak, and Rich Monk join forces to introduce [_4 open source cloud security tools_][10] to help improve security when using GitHub and AWS. If you're looking for accidentally committed secrets—or trying to prevent them from being committed in the first place—this article has tools you can use. + +### How to use OpenSSL: hashes, digital signatures, and more + +Much of information security is based on math: specifically, the cryptographic functions used to encrypt data and authenticate users or file contents. After providing an introduction in [_Getting started with OpenSSL: Cryptography basics_][11], Marty Kalin digs deeper into the details of _[How to use OpenSSL: Hashes, digital signatures, and more][12]_, explaining how to use the OpenSSL utility to explore these commonly used but uncommonly understood concepts. + +### Learn about computer security with the Raspberry Pi and Kali Linux + +Cheap hardware and open source software make a great combination, especially for people looking to learn by doing. In this article, Anderson Silva introduces the security-oriented Kali Linux distribution in _[Learn about computer security with the Raspberry Pi and Kali Linux][13]_. It's a short article, but it's full of useful links to documentation and security-related projects that you can use with your own Raspberry Pi. + +### Will quantum computing break security? + +Has the rest of this article been a waste? Will quantum computing render everything we know about security obsolete? The good news is that the answer is "no," but quantum computing can still have a profound impact on security and the computing world more broadly. In _[Will quantum computing break security?][14]_ Mike Bursell examines its potential impacts—both the good news and the bad. And of course, quantum computing may make it easier to break encryption, but that doesn't matter if the baddies can't get your data in the first place. + +### Looking to 2020 + +Security will always be important, and (as the quantum computing article suggests) the next few years will be an interesting time in the field. In 2020, Opensource.com articles will look at the leading edge of open source security and help explain the basics to the ever-growing open source community. If you have a topic you want us to cover, please share it in the comments, or—better yet— if you have an article in mind, [write for us][15]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/security-resources + +作者:[Ben Cotton][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bcotton +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_security_cc.png?itok=3V07Lpko (A secure lock.) +[2]: https://opensource.com/article/19/10/linux-server-security +[3]: https://opensource.com/article/19/7/make-linux-stronger-firewalls +[4]: https://opensource.com/article/19/2/reducing-security-risks-centralized-logging +[5]: https://opensource.com/article/19/4/gpg-subkeys-ssh +[6]: https://opensource.com/article/19/4/gpg-subkeys-ssh-multiples +[7]: https://opensource.com/article/19/4/gpg-subkeys-ssh-manage +[8]: https://opensource.com/article/19/4/ssh-keys-seahorse +[9]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline +[10]: https://opensource.com/article/19/9/open-source-cloud-security +[11]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1 +[12]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-2 +[13]: https://opensource.com/article/19/3/computer-security-raspberry-pi +[14]: https://opensource.com/article/19/1/will-quantum-computing-break-security +[15]: https://opensource.com/how-submit-article From 2da940ad6fcc5ae1d4f168a530fce7cc2f7624f8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Jan 2020 01:10:46 +0800 Subject: [PATCH 151/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191230=208=20mu?= =?UTF-8?q?st-read=20DevOps=20articles=20for=20success=20in=202020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191230 8 must-read DevOps articles for success in 2020.md --- ...ead DevOps articles for success in 2020.md | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 sources/tech/20191230 8 must-read DevOps articles for success in 2020.md diff --git a/sources/tech/20191230 8 must-read DevOps articles for success in 2020.md b/sources/tech/20191230 8 must-read DevOps articles for success in 2020.md new file mode 100644 index 0000000000..3ea0d05f72 --- /dev/null +++ b/sources/tech/20191230 8 must-read DevOps articles for success in 2020.md @@ -0,0 +1,153 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (8 must-read DevOps articles for success in 2020) +[#]: via: (https://opensource.com/article/19/12/devops-resources) +[#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) + +8 must-read DevOps articles for success in 2020 +====== +Get up to speed on DevOps with our eight most popular DevOps articles +this year. +![Brick wall between two people, a developer and an operations manager][1] + +I am an avid reader, but I go through periods where I'm so busy that it's hard to find the time to keep up with my reading list. Even during my busiest times, I try to stay up to date on DevOps news since it's one of my areas of focus. + +Here, I've summarized key takeaways from the top eight DevOps articles Opensource.com published this year so you can increase your knowledge even if you don't have time to read all of them. Since DevOps is about **people**, **processes**, and **tools**, I've categorized the top eight articles around those themes. + +### People + +#### 5 essential values for the DevOps mindset + +Conversations about IT problems and solutions often focus on the technology or the tools. But often, the people and processes are harder and more important to get right than the technology and tools. In [_5 essential values for the DevOps mindset_][2], Brent Aaron Reed and Willy-Peter Schaub outline the foundation for establishing the right processes and hiring the right people. + + * Create a continuous feedback loop with stakeholders (customers, business teams, partners, etc.). Ensure changes are being made for the right reasons and that they benefit all stakeholders. + * Processes should be continuously improved. Having a repeatable framework and process is good, but look for ways to make it better. + * Don't replace existing silos with new silos. Teamwork is essential; changing the name of a team or creating a new team does not help. You should be working to break down silos, not create new silos with new names. + * Your primary stakeholder is the customer. Every department in the organization needs to work together to make sure the customer's needs are met. + * Learning is infectious. When you learn something new, share it with others. + + + +#### The case for making the transition from sysadmin to DevOps engineer + +Making the leap from system administrator (sysadmin) to DevOps engineer requires shifting your mindset and learning new tools and technology. In [_The case for making the transition from sysadmin to DevOps engineer_][3], [Correspondent][4] Taz Brown covers this experience and the things you should do if you are considering taking on a DevOps engineer role. + + * Learn a scripting language like Python, Perl, Bash, or Powershell. You don't need to become an expert; learn the basics, and build up your skills over time. + * Think strategically and consider the business impact of your day-to-day tasks. + * Learn a programming language like Ruby, Go, or Python. + * Understand CI/CD pipelines and how and where to automate tasks within the pipeline. + * Become familiar with configuration and orchestration tools. + * Learn common Git commands as well as the fundamentals of version control. + + + +### Processes + +#### Don't test in production? Test in production! + +The notion of testing in production is a sticky subject, but Ann Marie Fred covers it well in [_Don't test in production? Test in production!_][5] Historically, development, test, and production systems were treated differently from the perspective of security, compliance, and risk management. The risks are much higher if data in production systems becomes corrupted than if it happens in a test environment. + +There are pros and cons to testing in production. The majority of the cons boil down to risk and compliance concerns like corrupted or leaked data, unintended side effects, and overloaded systems. Many of the pros can be lumped into two categories: improving the user experience (UX) and gaining new knowledge about your architecture. Improving UX includes things like usability testing, UX research, real-user monitoring, canary testing, and regression testing. Testing in production also enables you to learn more about your environment by running A/B tests, experimenting, chaos engineering, and failover testing. + +By testing in production, you gain feedback you would not otherwise get into quality, performance, availability, resiliency, user experience, and changes. Testing on real data can reveal things you would not see with mock or test data. You should test in production, but before you begin, put mechanisms in place to keep your systems safe and minimize risk. + + * Test all systems thoroughly with automated tests before you start testing in production. + * Review the risks associated with bug hunt days and put appropriate guardrails in place from the start. + * Follow the principles of chaos engineering: plan ahead; contain the blast radius; scale or squash. + + + +Yes, there are risks associated with testing in production, but you can minimize them with proper safeguards. + +#### 8 principles to achieve DevOps at scale + +Processes are a vital aspect of a successful DevOps initiative. The most important part is building processes suited to your organization rather than copying what worked somewhere else. The guidelines Matthieu Fronton lists in [_8 principles to achieve DevOps at scale_][6] ensure you will implement strategies focused on your business needs. + + * Teams create silos. Instead of building a DevOps team, create a DevOps task force of highly skilled and diverse members. Its objective is to help other projects and departments identify slow processes, automate processes, improve performance, and ensure effectiveness. + * Reduce overhead when collaborating and syncing on tasks. Make status updates and team availability publicly available, make work visible by putting everything in shared collaboration tools, and work on one task at a time to avoid context switching. + * Get outside help; hire an agile coach to be your advocate. + * Schedule regular team training on needed job skills, ranging from soft skills to how to use specific tools. + * Empower teams to make their own decisions and learn from their mistakes. + * Embrace uncertainty. Failures will happen, so run blameless post-mortems and determine how to improve and reduce uncertainty the next time around. + * DevOps is about people, processes, and tools. It is not just about the technical implementation of a product. + * Always be learning. Stay up to date on trends in the DevOps space. + + + +#### Small scale scrum vs. large scale scrum + +In [_Small scale scrum vs. large scale scrum_][7], Agnieszka Gancarczyk shares her analysis of 54 early responses to a survey on agile adoption. + + * 96% work in distributed teams, think scrum principles help them reduce development complexity, and believe agile contributes to the success of their projects. + * The most popular length of a sprint is three weeks (62%). + * Participants take on additional roles on their projects when needed, such as business analyst, project manager, and quality engineer. When changing roles, they lose an average of one to two hours. + * The majority of teams don't have a definition of "ready" to ensure that user stories are actionable, testable, and clear. + * Participants ask for help and mentoring when a task is complex. + + + +#### Scrum vs. kanban: Which agile framework is better? + +Agile is a process of iterative development and continuous feedback. While both scrum and kanban are classified as agile frameworks, they are not the same thing. In [_Scrum vs. kanban: Which agile framework is better?_][8] Taz Brown explores the differences. + +Kanban is an agile framework that utilizes a visual method for managing a project's creation through set steps, and the emphasis is on continuous flow through the steps. Tasks can be color-coded to identify different types of tasks. Work-in-progress limits can be used to restrict the maximum number of work items allowed in a single stage. The goal is to see progress and bottlenecks at a glance. Any team (not just software developers) can use the kanban methodology. + +The goal of scrum is to create a shippable product. Scrum involves daily standups, planning, reviews, retrospectives, and a two- to four-week cadence. Since its goal is to ship a product, scrum is primarily used by software development teams. + +Choosing which methodology is best for you depends on the state of your organization, the team, the people on the team, and the end product or service. + +### Tools + +#### Automate user acceptance testing with your DevOps pipeline + +User acceptance testing (UAT) determines whether a system satisfies user needs, business requirements, and authorized entity requirements. These tests need to be run whenever there is a new design in the application, which is why it's so valuable to automate them. In [_Automate user acceptance testing with your DevOps pipeline_][9], Daniel Oh shares how to skip manually validating test cases and automate them with Selenium. + +You can build WebDriver scripts with Selenium to execute test cases programmatically, then automate them by integrating the Selenium tool with your DevOps pipeline. + +#### A beginner's guide to building DevOps pipelines with open source tools + +Saving the best for last, Bryant Son's [_A beginner's guide to building DevOps pipelines with open source tools_][10] is a comprehensive overview of one critical category of DevOps tooling: continuous integration/continuous deployment (CI/CD) pipelines. The CI/CD pipeline is the process of taking code and configuration from a repository and moving it to production. + +Bryant describes some of the tools in a typical CI/CD pipeline. + + * A CI/CD tool like Jenkins talks to many different services and tools to configure and orchestrate them. + * Source control management (SCM) stores code in repositories, versions code, and facilitates collaboration with project members. (CI/CD can automate checking source code in and out among team members.) + * Build-automation tools compile and create a deployable package format from the source code. + * A web application server is the location where an executable will be deployed so the application can be used. + * Code testing coverage catches errors early on and ensures users are satisfied with the application. Code test frameworks help write the tests, and code-quality suggestion tools help improve the quality of the code. + + + +### More in 2020 + +Opensource.com's most widely read DevOps articles of 2019 covered a diverse range of topics under the umbrella of people, processes, and tools. We appreciate these writers for sharing their knowledge, and I look forward to reading more from them in 2020. + +What DevOps topics would you like us to cover in the coming months? Feel free to leave a comment or, better yet, [submit an article proposal][11]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/devops-resources + +作者:[Dawn Parzych][a] +选题:[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/dawnparzych +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/devops_confusion_wall_questions.png?itok=zLS7K2JG (Brick wall between two people, a developer and an operations manager) +[2]: https://opensource.com/article/19/5/values-devops-mindset +[3]: https://opensource.com/article/19/7/devops-vs-sysadmin +[4]: https://opensource.com/correspondent-program +[5]: https://opensource.com/article/19/5/dont-test-production +[6]: https://opensource.com/article/19/4/principles-achieve-devops-scale +[7]: https://opensource.com/article/19/3/small-scale-scrum-vs-large-scale-scrum +[8]: https://opensource.com/article/19/8/scrum-vs-kanban +[9]: https://opensource.com/article/19/4/devops-pipeline-acceptance-testing +[10]: https://opensource.com/article/19/4/devops-pipeline +[11]: https://opensource.com/how-submit-article From c9eb1a2820e678d78f6bcbd78db5047e36557bdb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Jan 2020 01:11:16 +0800 Subject: [PATCH 152/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020191227=202019:?= =?UTF-8?q?=20Year=20in=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20191227 2019- Year in review.md --- sources/tech/20191227 2019- Year in review.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20191227 2019- Year in review.md diff --git a/sources/tech/20191227 2019- Year in review.md b/sources/tech/20191227 2019- Year in review.md new file mode 100644 index 0000000000..12b423b903 --- /dev/null +++ b/sources/tech/20191227 2019- Year in review.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (2019: Year in review) +[#]: via: (https://jvns.ca/blog/2019-year-in-review/) +[#]: author: (Julia Evans https://jvns.ca/) + +2019: Year in review +====== + +It’s the end of the year again! Here are a few things that happened in 2019. + +### I have a business instead of a job! + +The biggest change this year is that I left my job in August after working there for 5.5 years and now I don’t have a job! Now I have a [business][1] (wizard zines). + +This has been exciting (I can do anything I want with my time! No rules! Wow!) and also disorienting (I can do anything I… want? Wait, what do I want to do exactly?). Obviously this is a good problem to have but it’s a big adjustment from the structure I had when I had a job. + +My plan for now is to give myself a year (until August 2020) to see how this new way of existing goes and then reevaluate. + +I wanted to write some reflections on my 5 years at Stripe here but it’s been such a huge part of my life for so long that I couldn’t figure out how to summarize it. I was in a much worse place in my career 6 years ago before I started working there and it really changed everything for me. + +### !!Con + +2019 was [!!Con][2]’s 6th year! It’s a conference about the joy, excitement, and surprise of programming. And !!Con also expanded to the [west coast][3]!! I wasn’t part of organizing the west coast conference at all but I got to attend and it was wonderful. + +Running a conference is a ton of work and I feel really lucky to get to do it with such great co-organizers – there have been at least 20 people involved in organizing over the years and I only do a small part (right now I organize sponsorships for the east coast conference). + +This year we also incorporated the [Exclamation Foundation][4] which is the official entity which runs both conferences which is going to make organizing money things a lot easier. + +### I understand how the business works a little better + +Earlier this year I signed up for a business course called [30x500][5] by Amy Hoy and Alex Hillman. They’ve influenced me a lot this year. Basically I signed up for it because I had a business that had made $100,000 in revenue already but I didn’t really understand how the business _worked_ and it felt like it could just evaporate at any point. So $2000 (the cost at the time of 30x500) was worth it to help me understand what was going on. + +Amy and Alex both just the other day wrote 100-tweet threads that have some of the ideas that I learned this year in them: [Alex on creating sustainable businesses][6] and [Amy on design][7]. + +I was hoping to build a system for selling printed zines in 2019 and I didn’t get to it – that’s probably my one concrete business goal for 2020. I tried out Lulu for printing in the hopes that I could experiment with print-on-demand but the quality was awful so it’s going to be a bit more work. + +### blog posts and things + +In 2019 I: + + * wrote 29 blog posts + * published 2 [zines][8] (Bite Size Networking, HTTP: Learn Your Browser’s Language) and wrote most of a third + * published 1 box set of my zines ([Your Linux Toolbox][9], it’s in Real Physical Bookstores!!) + * did some experiments in interactive SQL/server exercises, which I’m excited about but are sort of on the back burner right now. Maybe I’ll go back to them in 2020! + * made the same business [revenue][1] as in 2018 (which I was thrilled about) + * gave 0 talks (which was a goal of mine) + + + +The blog post I’m happiest to have published this year is definitely [Get your work recognized: write a brag document][10]. I’ve seen quite a few people saying that it helped them track their work and it makes me really happy. A bunch of people at my old job adopted it and it’s one of the non-engineering projects I’m most proud of having done there. + +Publishing this post about my [business revenue][1] was also important to me – in the past I loved blogging, but I didn’t think it was possible to make a living by explaining computer things online. And I was totally wrong! It is possible! So I think it’s important to tell other people that it’s a possibility. + +Having a Real Traditionally Published Book out is also really cool, I could not have imagined [4 years ago][11] that I could go to an actual bookstore and buy the little 16-page zine I wrote about how much I love strace. + +### what went well + +some things that were good this year: + + * spending time understanding why the business works the way it does instead of just guessing + * collaborating with many great people on !!Con to do a big thing together + * I’m happy to have given myself the time/space to do whatever it is I want, even though it’s a big adjustment + * writing things that help people a little bit with their careers (the brag documents post) is nice + + + +some things that are harder: + + * I used to have a lot of really amazing coworkers at my job, and right now I’m working much more by myself. I definitely miss having so many great people right there to talk to all the time. + + + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2019-year-in-review/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://jvns.ca/blog/2019/10/01/zine-revenue-2019/ +[2]: https://bangbangcon.com +[3]: https://bangbangcon.com/west +[4]: https://exclamation.foundation/ +[5]: https://30x500.com/academy/ +[6]: https://twitter.com/alexhillman/status/1209252239501647874 +[7]: https://twitter.com/amyhoy/status/1209693440872603651 +[8]: https://wizardzines.com +[9]: https://jvns.ca/blog/2019/10/21/print-collection-of-my-first-7-zines/ +[10]: https://jvns.ca/blog/brag-documents/ +[11]: https://jvns.ca/blog/2015/04/14/strace-zine/ From 91354d964012d1a3cfe31e31b06180393c9235ad Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Jan 2020 10:41:15 +0800 Subject: [PATCH 153/430] PRF @wxy --- ...o cohost GitHub and GitLab with Ansible.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/translated/tech/20191113 How to cohost GitHub and GitLab with Ansible.md b/translated/tech/20191113 How to cohost GitHub and GitLab with Ansible.md index 4d9193d930..41616cd282 100644 --- a/translated/tech/20191113 How to cohost GitHub and GitLab with Ansible.md +++ b/translated/tech/20191113 How to cohost GitHub and GitLab with Ansible.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to cohost GitHub and GitLab with Ansible) @@ -12,27 +12,27 @@ > 通过使用 Ansible 镜像 Git 存储库,保护对重要项目的访问。 -![Hands programming][1] +![](https://img.linux.net.cn/data/attachment/album/202001/01/104040fbdu68wosg8o99wg.jpg) -开源无处不在。它在家里的计算机上、在工作场所的计算机上、在互联网上,并且很多都由 [Git][2] 管理。由于 Git 是分布式的,因此许多人也将其视为一种众包的备份解决方案。从理论上讲,每当有人将 Git 存储库克隆到其本地计算机时,他们就是创建了项目源代码的备份。如果有 100 个人这样做,则存储库就有 100 个备份副本。 +开源无处不在。它在家里的计算机上、在工作场所的计算机上、在互联网上,并且很多都由 [Git][2] 管理。由于 Git 是分布式的,因此许多人也将其视为一种众包的备份解决方案。从理论上讲,每当有人将 Git 存储库克隆到其本地计算机时,他们就创建了该项目源代码的备份。如果有 100 个人这样做,则存储库就有 100 个备份副本。 -从理论上讲,这可以缓解“灾难”,例如项目维护者[突然决定删除存储库][3]或[莫名其妙地阻止所有流量][4],导致开发人员们无头苍蝇般地寻找谁拥有主分支的最新版本。类似的,整个代码托管站点也会消失。没有人会想到 Google Code、Microsoft CodePlex 或 Gitorious 会在鼎盛时期将被关闭。 +从理论上讲,这可以缓解“灾难”的影响,例如当项目维护者[突然决定删除存储库][3]或[莫名其妙地阻止所有流量][4],导致开发人员们无头苍蝇般地寻找谁拥有主分支的最新版本。类似的,整个代码托管站点也会消失。没有人会想到 Google Code、Microsoft CodePlex 或 Gitorious 会在鼎盛时期将被关闭。 简而言之,如果在过去的几十年中互联网教给了我们一些东西,那就是依靠互联网神奇地创建备份并不是冗余的最可靠途径。 -此外,对于许多人来说,很多开源项目都托管在 GitHub 上是个问题,而 GitHub 不是开放平台。许多开发人员和用户都希望支持诸如 GitLab 之类的堆栈并与之交互,它具有开源社区版本。 +此外,对于许多人来说,很多开源项目都托管在 GitHub 上是个问题 —— GitHub 并不是开放平台。许多开发人员和用户都希望支持诸如 GitLab 之类的堆栈并与之交互,它具有开源社区版本。 ### 使用 Ansible 管理 Git Git 的去中心方式对于解决这个问题很有用。使用纯 Git,你可以使用一个 `push` 命令轻松地将其推到两个或多个存储库。但是,为了使其在发生意外故障时有用,你必须经常与 Git 存储库进行交互(特别是推送)。此外,即使你可能永远不会自己推送或拉出代码,也可能有一些要备份的存储库。 -但是,使用 Ansible,你可以自动执行项目主分支(或其他任何分支)的 Git 拉取,然后自动存储库到“异地”镜像的 Git 推送。换句话说,你可以让你的计算机定期从 GitHub 拉取并推送到 GitLab 或 [Gitolite][5] 或 Gitea(或你喜欢的任何 Git 主机)。 +但是,使用 Ansible,你可以自动执行项目主分支(或其他任何分支)的 Git 拉取,然后自动进行存储库到“异地”镜像的 Git 推送。换句话说,你可以让你的计算机定期从 GitHub 拉取并推送到 GitLab 或 [Gitolite][5] 或 Gitea(或你喜欢的任何 Git 托管主机)。 ### Ansible 模块 -如果 Ansible 并不是因为其出色的模块集合,那么它就没那么出色。像 Python 的第三方库或 Linux 的应用程序一样,这个技术驱动器有用而令人惊讶的简单技巧是,Ansible 以其他人贡献的组件而闻名。因为本文正在研究如何有效和可靠地备份 Git 存储库,所以这里使用的模块是 [Git 模块][6]和 [ini_file][7] 模块。 +如果不是因其出色的模块集合,那么 Ansible 就没那么出色。像 Python 的第三方库或 Linux 的应用程序一样,这个技术引擎的一个有用而令人惊讶的简单技巧是,Ansible 以其他人贡献的组件而闻名。因为本文正在研究如何有效和可靠地备份 Git 存储库,所以这里使用的模块是 [Git 模块][6]和 [ini_file][7] 模块。 -首先,创建一个名为 `mirror.yaml` 的文件作为剧本playbook。你可以像通常使用 Ansible 一样,从 `name` 和 `task` 条目开始。本示例将 `localhost` 添加到 `hosts` 列表中,以便在控制器计算机(你现在坐在前面的计算机)上运行动作play,但是在现实生活中,你可能会在特定的主机或一组网络上的主机上运行。 +首先,创建一个名为 `mirror.yaml` 的文件作为剧本playbook。你可以像通常使用 Ansible 一样,从 `name` 和 `task` 条目开始。本示例将 `localhost` 添加到 `hosts` 列表中,以便在控制器计算机(你现在坐在前面的计算机)上运行动作play,但是在现实生活中,你可能会在特定的主机或一组网络上的主机上运行它。 ``` --- @@ -43,7 +43,7 @@ Git 的去中心方式对于解决这个问题很有用。使用纯 Git,你可 ### Git 拉取和克隆 -如果要进行备份,则需要最新代码的副本。在 Git 仓库中实现这一目标的明显方法是执行 `git pull`。 但是,`pull` 会假定克隆已经存在,而写得很好的 Ansible 动作(Ansible 脚本)则尽可能少的假定。 最好先告诉 Ansible `clone` 存储库。 +如果要进行备份,则需要最新代码的副本。明显,在 Git 仓库中实现这一目标的方法是执行 `git pull`。 但是,`pull` 会假定克隆已经存在,而写得很好的 Ansible 动作(Ansible 脚本)则尽可能少的假定。最好告诉 Ansible 先克隆存储库。 将你的第一个任务添加到剧本: @@ -63,7 +63,7 @@ Git 的去中心方式对于解决这个问题很有用。使用纯 Git,你可 update: yes ``` -这个例子使用了开源的,类似于 Unix 的操作系统 soso 作为我要镜像的存储库。这是一个完全任意的选择,绝不意味着对该存储库的未来缺乏信心。它还使用变量来引用目标文件夹 `/tmp/soso.git`,这很方便,并且如果以后你希望将它扩展为一个通用的镜像脚本也会受益。在现实生活中,你的工作机上可能会比 `/tmp` 具有更永久的位置,例如 `/home/gitmirrors/soso.git` 或 `/opt/gitmirrors/soso.git`。 +这个例子使用了开源的、类似于 Unix 的操作系统 soso 作为我要镜像的存储库。这是一个完全任意的选择,绝不意味着我对该存储库的未来缺乏信心。它还使用变量来引用目标文件夹 `/tmp/soso.git`,这很方便,并且如果以后你希望将它扩展为一个通用的镜像脚本也会受益。在现实生活中,你的工作机上可能会比 `/tmp` 具有更永久的位置,例如 `/home/gitmirrors/soso.git` 或 `/opt/gitmirrors/soso.git`。 运行你的剧本: @@ -150,7 +150,7 @@ via: https://opensource.com/article/19/11/how-host-github-gitlab-ansible 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6b20f939ee1b8ba5a1afc8601d38a786b7bd90e1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Jan 2020 10:41:49 +0800 Subject: [PATCH 154/430] PUB @wxy https://linux.cn/article-11735-1.html --- .../20191113 How to cohost GitHub and GitLab with Ansible.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191113 How to cohost GitHub and GitLab with Ansible.md (99%) diff --git a/translated/tech/20191113 How to cohost GitHub and GitLab with Ansible.md b/published/20191113 How to cohost GitHub and GitLab with Ansible.md similarity index 99% rename from translated/tech/20191113 How to cohost GitHub and GitLab with Ansible.md rename to published/20191113 How to cohost GitHub and GitLab with Ansible.md index 41616cd282..c9a05d6b40 100644 --- a/translated/tech/20191113 How to cohost GitHub and GitLab with Ansible.md +++ b/published/20191113 How to cohost GitHub and GitLab with Ansible.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11735-1.html) [#]: subject: (How to cohost GitHub and GitLab with Ansible) [#]: via: (https://opensource.com/article/19/11/how-host-github-gitlab-ansible) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 4f1536686af91606a711bcbf4b0e7fa1495735e9 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Wed, 1 Jan 2020 15:09:25 +0800 Subject: [PATCH 155/430] translated --- .../tech/20191017 Intro to the Linux useradd command.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20191017 Intro to the Linux useradd command.md (100%) diff --git a/sources/tech/20191017 Intro to the Linux useradd command.md b/translated/tech/20191017 Intro to the Linux useradd command.md similarity index 100% rename from sources/tech/20191017 Intro to the Linux useradd command.md rename to translated/tech/20191017 Intro to the Linux useradd command.md From d3a447dcf81bd16100590b5eef613b7960558e3a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 Jan 2020 20:51:51 +0800 Subject: [PATCH 156/430] Rename sources/tech/20191231 How to be a better organization- Top 10 reads for leaders.md to sources/talk/20191231 How to be a better organization- Top 10 reads for leaders.md --- ...1 How to be a better organization- Top 10 reads for leaders.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20191231 How to be a better organization- Top 10 reads for leaders.md (100%) diff --git a/sources/tech/20191231 How to be a better organization- Top 10 reads for leaders.md b/sources/talk/20191231 How to be a better organization- Top 10 reads for leaders.md similarity index 100% rename from sources/tech/20191231 How to be a better organization- Top 10 reads for leaders.md rename to sources/talk/20191231 How to be a better organization- Top 10 reads for leaders.md From 99ee33155dcf69405729aa26c01afe369d485440 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Jan 2020 22:14:17 +0800 Subject: [PATCH 157/430] APL --- ...0191231 12 programming resources for coders of all levels.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191231 12 programming resources for coders of all levels.md b/sources/tech/20191231 12 programming resources for coders of all levels.md index 5da5148542..669615585c 100644 --- a/sources/tech/20191231 12 programming resources for coders of all levels.md +++ b/sources/tech/20191231 12 programming resources for coders of all levels.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f782f892a97d4cf7da8bec47d50afc56806ca7a4 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 1 Jan 2020 23:00:27 +0800 Subject: [PATCH 158/430] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... Python interfaces using zope.interface.md | 132 ------------------ ... Python interfaces using zope.interface.md | 125 +++++++++++++++++ 2 files changed, 125 insertions(+), 132 deletions(-) delete mode 100644 sources/tech/20190924 An advanced look at Python interfaces using zope.interface.md create mode 100644 translated/tech/20190924 An advanced look at Python interfaces using zope.interface.md diff --git a/sources/tech/20190924 An advanced look at Python interfaces using zope.interface.md b/sources/tech/20190924 An advanced look at Python interfaces using zope.interface.md deleted file mode 100644 index aa984555d8..0000000000 --- a/sources/tech/20190924 An advanced look at Python interfaces using zope.interface.md +++ /dev/null @@ -1,132 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (An advanced look at Python interfaces using zope.interface) -[#]: via: (https://opensource.com/article/19/9/zopeinterface-python-package) -[#]: author: (Moshe Zadka https://opensource.com/users/moshezhttps://opensource.com/users/lauren-pritchetthttps://opensource.com/users/sethhttps://opensource.com/users/drmjg) - -An advanced look at Python interfaces using zope.interface -====== -Zope.interface helps declare what interfaces exist, which objects -provide them, and how to query for that information. -![Snake charmer cartoon with a yellow snake and a blue snake][1] - -The **zope.interface** library is a way to overcome ambiguity in Python interface design. Let's take a look at it. - -### Implicit interfaces are not zen - -The [Zen of Python][2] is loose enough and contradicts itself enough that you can prove anything from it. Let's meditate upon one of its most famous principles: "Explicit is better than implicit." - -One thing that traditionally has been implicit in Python is the expected interface. Functions have been documented to expect a "file-like object" or a "sequence." But what is a file-like object? Does it support **.writelines**? What about **.seek**? What is a "sequence"? Does it support step-slicing, such as **a[1:10:2]**? - -Originally, Python's answer was the so-called "duck-typing," taken from the phrase "if it walks like a duck and quacks like a duck, it's probably a duck." In other words, "try it and see," which is possibly the most implicit you could possibly get. - -In order to make those things explicit, you need a way to express expected interfaces. One of the first big systems written in Python was the [Zope][3] web framework, and it needed those things desperately to make it obvious what rendering code, for example, expected from a "user-like object." - -Enter **zope.interface**, which is developed by Zope but published as a separate Python package. **Zope.interface** helps declare what interfaces exist, which objects provide them, and how to query for that information. - -Imagine writing a simple 2D game that needs various things to support a "sprite" interface; e.g., indicate a bounding box, but also indicate when the object intersects with a box. Unlike some other languages, in Python, attribute access as part of the public interface is a common practice, instead of implementing getters and setters. The bounding box should be an attribute, not a method. - -A method that renders the list of sprites might look like: - - -``` -def render_sprites(render_surface, sprites): -    """ -    sprites should be a list of objects complying with the Sprite interface: -    * An attribute "bounding_box", containing the bounding box. -    * A method called "intersects", that accepts a box and returns -      True or False -    """ -    pass # some code that would actually render -``` - -The game will have many functions that deal with sprites. In each of them, you would have to specify the expected contract in a docstring. - -Additionally, some functions might expect a more sophisticated sprite object, maybe one that has a Z-order. We would have to keep track of which methods expect a Sprite object, and which expect a SpriteWithZ object. - -Wouldn't it be nice to be able to make what a sprite is explicit and obvious so that methods could declare "I need a sprite" and have that interface strictly defined? Enter **zope.interface**. - - -``` -from zope import interface - -class ISprite(interface.Interface): - -    bounding_box = interface.Attribute( -        "The bounding box" -    ) - -    def intersects(box): -        "Does this intersect with a box" -``` - -This code looks a bit strange at first glance. The methods do not include a **self**, which is a common practice, and it has an **Attribute** thing. This is the way to declare interfaces in **zope.interface**. It looks strange because most people are not used to strictly declaring interfaces. - -The reason for this practice is that the interface shows how the method will be called, not how it is defined. Because interfaces are not superclasses, they can be used to declare data attributes. - -One possible implementation of the interface can be with a circular sprite: - - -``` -@implementer(ISprite) -@attr.s(auto_attribs=True) -class CircleSprite: -    x: float -    y: float -    radius: float - -    @property -    def bounding_box(self): -        return ( -            self.x - self.radius, -            self.y - self.radius, -            self.x + self.radius, -            self.y + self.radius, -        ) - -    def intersects(self, box): -        # A box intersects a circle if and only if -        # at least one corner is inside the circle. -        top_left, bottom_right = box[:2], box[2:] -        for choose_x_from (top_left, bottom_right): -            for choose_y_from (top_left, bottom_right): -                x = choose_x_from[0] -                y = choose_y_from[1] -                if (((x - self.x) ** 2 + (y - self.y) ** 2) <= -                    self.radius ** 2): -                     return True -        return False -``` - -This _explicitly_ declares that the **CircleSprite** class implements the interface. It even enables us to verify that the class implements it properly: - - -``` -from zope.interface import verify - -def test_implementation(): -    sprite = CircleSprite(x=0, y=0, radius=1) -    verify.verifyObject(ISprite, sprite) -``` - -This is something that can be run by **pytest**, **nose**, or another test runner, and it will verify that the sprite created complies with the interface. The test is often partial: it will not test anything only mentioned in the documentation, and it will not even test that the methods can be called without exceptions! However, it does check that the right methods and attributes exist. This is a nice addition to the unit test suite and—at a minimum—prevents simple misspellings from passing the tests. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/9/zopeinterface-python-package - -作者:[Moshe Zadka][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshezhttps://opensource.com/users/lauren-pritchetthttps://opensource.com/users/sethhttps://opensource.com/users/drmjg -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Snake charmer cartoon with a yellow snake and a blue snake) -[2]: https://en.wikipedia.org/wiki/Zen_of_Python -[3]: http://zope.org diff --git a/translated/tech/20190924 An advanced look at Python interfaces using zope.interface.md b/translated/tech/20190924 An advanced look at Python interfaces using zope.interface.md new file mode 100644 index 0000000000..9827cb9b28 --- /dev/null +++ b/translated/tech/20190924 An advanced look at Python interfaces using zope.interface.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (An advanced look at Python interfaces using zope.interface) +[#]: via: (https://opensource.com/article/19/9/zopeinterface-python-package) +[#]: author: (Moshe Zadka https://opensource.com/users/moshezhttps://opensource.com/users/lauren-pritchetthttps://opensource.com/users/sethhttps://opensource.com/users/drmjg) + +借助 zope.interface 深入了解 Python 接口 +====== +Zope.interface 可以帮助指出存在哪些接口,是由哪些对象提供的,以及如何查询这些信息。 +![Snake charmer cartoon with a yellow snake and a blue snake][1] + +**zope.interface** 库可以克服 Python 接口设计中的歧义性。让我们来研究一下。 + +### 隐式接口不是 Python 之禅 + +[Python 之禅][2] 很宽松,但是有点自相矛盾,你可以从中证明一切。让我们来思考其中最著名的原则之一:“显示胜于隐式”。 + +在 Python 中会隐含的一件事是预期的接口。比如函数已经记录了它期望一个“类文件对象”或“序列”。但是什么是类文件对象呢?它支持 **.writelines** 和 **.seek** 吗?什么是一个“序列”?是否支持分步切片,例如 **a[1:10:2]**? + +最初,Python 的答案是所谓的“鸭子类型”,取自短语“如果它像鸭子一样行走,像鸭子一样嘎嘎叫,那么它可能就是鸭子”。换句话说,“试试看”,这可能是你能得到的最含蓄的表达。 + +为了使这些内容显式地表达出来,你需要一种方法来表达期望的接口。最早用 Python 编写的大型系统之一是 [Zope][3] Web 框架,它迫切需要这些东西来明确地呈现代码,例如,期望从“类似用户的对象”获得什么。 + +**zope.interface** 由 Zope 开发,但作为单独的 Python 包发布。**Zope.interface** 可以帮助指出存在哪些接口,是由哪些对象提供的,以及如何查询这些信息。 + +想象编写一个简单的 2D 游戏,它需要各种东西来支持 sprite 接口(to 校正:这里不知道如何翻译)。例如,表示一个边界框,但也表示对象何时与一个框相交。与一些其他语言不同,在 Python 中,将属性访问作为公共接口一部分是一种常见的做法,而不是实现 getter 和 setter。边界框应该是一个属性,而不是一个方法。 + +呈现外观列表的方法可能类似于: + +``` +def render_sprites(render_surface, sprites): +    """ +    sprites 应该是符合 Sprite 接口的对象列表: +    * 一个属性 "bounding_box",包含了边界框 +    * "intersects" 方法,它接受一个 box 并返回 True 或 False +    """ +    pass # 一些代码会渲染 +``` + +游戏将具有许多处理 sprite 的功能(函数)。在每个功能(函数)中,你都必须在文档中指定预期。 + +此外,某些功能可能期望使用更复杂的 Sprite 对象,例如具有 Z-order 的对象。我们必须跟踪哪些方法需要 Sprite 对象,哪些方法需要 SpriteWithZ 对象。 + +如果能够使 sprite 的内容显式出来,这样方法就可以声明“我需要一个 sprite”,并严格定义接口,这不是很好吗?来看看 **zope.interface**。 + +``` +from zope import interface + +class ISprite(interface.Interface): + +    bounding_box = interface.Attribute( +        "The bounding box" +    ) + +    def intersects(box): +        "它和一个框相交吗?" +``` + +乍看起来,这段代码有点奇怪。这些方法不包括 "self",而包含 "self" 是一种常见的做法,并且它有一个属性。这是在 zope.interface 中声明接口的方法。这看起来很奇怪,因为大多数人不习惯严格声明接口。 + +这样做的原因是接口显示了如何调用方法,而不是如何定义方法。因为接口不是超类,所以它们可以用来声明数据属性。 + +下面是一个可能的接口实现: + +``` +@implementer(ISprite) +@attr.s(auto_attribs=True) +class CircleSprite: +    x: float +    y: float +    radius: float + +    @property +    def bounding_box(self): +        return ( +            self.x - self.radius, +            self.y - self.radius, +            self.x + self.radius, +            self.y + self.radius, +        ) + +    def intersects(self, box): +        # 当且仅当至少一个角在圆内时,方框与圆相交 +        top_left, bottom_right = box[:2], box[2:] +        for choose_x_from (top_left, bottom_right): +            for choose_y_from (top_left, bottom_right): +                x = choose_x_from[0] +                y = choose_y_from[1] +                if (((x - self.x) ** 2 + (y - self.y) ** 2) <= +                    self.radius ** 2): +                     return True +        return False +``` + +这 _显式_ 声明了 **CircleSprite** 类实现接口。它甚至能让我们验证该类是否正确实现了接口: + +``` +from zope.interface import verify + +def test_implementation(): +    sprite = CircleSprite(x=0, y=0, radius=1) +    verify.verifyObject(ISprite, sprite) +``` + +这可以由 **pytest**、**nose** 或其他测试框架运行,它将验证创建的 sprite 是否符合接口。测试通常是局部的:它不会测试文档中没有提及的内容,甚至不会测试方法是否可以在没有异常的情况下被调用!但是,它会检查是否存在正确的方法和属性。这是对单元测试套件一个很好的补充,至少可以防止简单的拼写错误通过测试。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/9/zopeinterface-python-package + +作者:[Moshe Zadka][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/moshezhttps://opensource.com/users/lauren-pritchetthttps://opensource.com/users/sethhttps://opensource.com/users/drmjg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/getting_started_with_python.png?itok=MFEKm3gl (Snake charmer cartoon with a yellow snake and a blue snake) +[2]: https://en.wikipedia.org/wiki/Zen_of_Python +[3]: http://zope.org From 5e25ae70948471e49dac7ce10c2418302ff67002 Mon Sep 17 00:00:00 2001 From: nacyro Date: Wed, 1 Jan 2020 23:13:50 +0800 Subject: [PATCH 159/430] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87=20?= =?UTF-8?q?(#16873)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 文章: tech/10 articles to enhance your security aptitude 译者: nacyro --- .../20191230 10 articles to enhance your security aptitude.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191230 10 articles to enhance your security aptitude.md b/sources/tech/20191230 10 articles to enhance your security aptitude.md index 7c4314b7ad..ae6c1a9aaf 100644 --- a/sources/tech/20191230 10 articles to enhance your security aptitude.md +++ b/sources/tech/20191230 10 articles to enhance your security aptitude.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (nacyro) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d37d615ed10774676fb269d50674c251b870c996 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Jan 2020 23:42:11 +0800 Subject: [PATCH 160/430] TSL --- ...ming resources for coders of all levels.md | 85 ------------------- ...ming resources for coders of all levels.md | 79 +++++++++++++++++ 2 files changed, 79 insertions(+), 85 deletions(-) delete mode 100644 sources/tech/20191231 12 programming resources for coders of all levels.md create mode 100644 translated/tech/20191231 12 programming resources for coders of all levels.md diff --git a/sources/tech/20191231 12 programming resources for coders of all levels.md b/sources/tech/20191231 12 programming resources for coders of all levels.md deleted file mode 100644 index 669615585c..0000000000 --- a/sources/tech/20191231 12 programming resources for coders of all levels.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (12 programming resources for coders of all levels) -[#]: via: (https://opensource.com/article/19/12/programming-resources) -[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) - -12 programming resources for coders of all levels -====== -No matter where you are in your programming journey, there are things -for you to learn in Opensource.com's top 12 programming articles from -2019. -![Woman sitting in front of her computer][1] - -> "The best time to learn computer programming was 20 years ago. The second best time is now." -> — A computer science proverb, maybe. - -Are you a new programmer, an experienced web dev, a backend wizard, a grizzled system programmer, or some other yet-to-be-discovered species of computer geek? Wherever you land in the vast ecosystem of software developers, the only constant in our field is the need to learn about new technologies and how to apply them. Here is an ensemble of the most-read Opensource.com articles from the past year that inform and entertain, and I'm excited to share them with you here. - -### For the noble newbie - -Whatever your skillset or interests, learning how to write computer programs turns that domain-specific knowledge into a superpower. Unfortunately, it isn't possible to learn how to program from the bite of a radioactive computer, at least not yet. Until that's a thing, I recommend these excellent articles to help bootstrap your programming skills. They address important questions like which languages to consider learning and different ways to get started. - - * [Which programming languages should you learn?][2] - * [A dozen ways to learn Python][3] - * [Three popular programming languages you can learn with Raspberry Pi][4] - * [Introducing kids to computational thinking with Python][5] - - - -### Keeping up with emerging technologies - -Experienced programmers know that the only thing harder than learning to program is keeping your skills and knowledge up to date. But we are an [autodidactic][6] breed, always looking to level up our expertise and understanding. Even if we don't anticipate using a new technology, we know that eventually, someone will ask about it. These articles on Rust, WebAssembly, and Podman are great places to start learning about just a few of the upcoming trends in software technology. - - * [Why should you use Rust in WebAssembly?][7] - * [Level up command-line playgrounds with WebAssembly][8] - * [How does rootless Podman work?][9] - * [Why to choose Rust as your next programming language][10] - - - -### Old programs never die - -Despite the never-ending cascade of new technologies, it never hurts to look back to help you look forward. Today's amazing technologies are built on top of yesterday's tools, and it will serve us well to understand the abilities and limitations of those tools, even if we never write a line of code in these languages of legend. This collection of articles focuses on the C language, a practical application written in AWK, and an interesting discussion of computer languages that are declining in popularity, but perhaps not dead yet. - - * [The monumental impact of C][11] - * [How to write a good C main function][12] - * [Drinking coffee with AWK][13] - * [What's your favorite "dead" language?][14] - - - -### Keep on learning - -No matter where you are in your programming journey, there will always be more to learn. I hope these top resources from 2019 will get you ready for 2020. Thanks to the authors and you, the reader. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/programming-resources - -作者:[Erik O'Shaughnessy][a] -选题:[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/jnyjny -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_3.png?itok=qw2A18BM (Woman sitting in front of her computer) -[2]: https://opensource.com/article/19/2/which-programming-languages-should-you-learn -[3]: https://opensource.com/article/19/8/dozen-ways-learn-python -[4]: https://opensource.com/article/19/3/programming-languages-raspberry-pi -[5]: https://opensource.com/article/19/2/break-down-stereotypes-python -[6]: https://en.wikipedia.org/wiki/Autodidacticism -[7]: https://opensource.com/article/19/2/why-use-rust-webassembly -[8]: https://opensource.com/article/19/4/command-line-playgrounds-webassembly -[9]: https://opensource.com/article/19/2/how-does-rootless-podman-work -[10]: https://opensource.com/article/19/10/choose-rust-programming-language -[11]: https://opensource.com/article/19/10/command-line-heroes-c -[12]: https://opensource.com/article/19/5/how-write-good-c-main-function -[13]: https://opensource.com/article/19/2/drinking-coffee-awk -[14]: https://opensource.com/article/19/6/favorite-dead-language diff --git a/translated/tech/20191231 12 programming resources for coders of all levels.md b/translated/tech/20191231 12 programming resources for coders of all levels.md new file mode 100644 index 0000000000..c3687187b3 --- /dev/null +++ b/translated/tech/20191231 12 programming resources for coders of all levels.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (12 programming resources for coders of all levels) +[#]: via: (https://opensource.com/article/19/12/programming-resources) +[#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) + +12 个给码农们的编程资源 +====== + +> 无论你身处编程旅程中的何处,这 12 篇编程文章都有你需要学习一些东西。 + +![Woman sitting in front of her computer][1] + +> “学习计算机编程的最佳时间是 20 年前,其次是现在。” +> — (也许是)计算机科学的谚语 + +你是新程序员、经验丰富的 Web 开发人员、后端大师、头发花白的系统程序员,还是其他神秘物种的计算机极客?无论你身处广阔的软件开发人员生态系统中的何处,在我们领域中唯一不变的就是需要了解新技术及其应用方法。这是过去一年来阅读量最大的 Opensource.com 文章的集合,我很高兴在这里与你分享它们。 + +### 好好学习 + +无论你的技能或兴趣是什么,学习如何编写计算机程序都可以将特定领域的知识变成一种超能力。不幸的是,至少从现在开始,还不可能通过坐在计算机前面接受电磁辐射就能学会如何编程。在这之前,我推荐这些出色的文章来帮助激发你的编程技能。它们解决了一些重要的问题,例如考虑学习哪种语言以及不同的入门方式。 + +* [你应该学习哪种编程语言?][2] +* [学习 Python 的 12 个方式][3] +* [你可以使用树莓派学习的三种流行编程语言][4] +* [利用 Python 引导孩子的计算机思维][5] + +### 天天向上 + +经验丰富的程序员知道,与学习编程相比,唯一更难的就是使你的技能和知识保持最新。但是我们是[自学成才][6]的一族,总是希望提高我们的专业知识和理解力。即使我们不期望使用新技术,我们也知道总会有人问起它们。这些有关 Rust、WebAssembly 和 Podman 的文章是开始学习软件技术一些即将出现的趋势的好地方。 + +* [为什么要在 WebAssembly 中使用 Rust?][7] +* [使用 WebAssembly 提升命令行游乐场][8] +* [免 root 的 Podman 如何工作?][9] +* [为什么选择 Rust 作为你的下一种编程语言][10] + +### 老兵不死 + +尽管新技术层出不穷,但回顾过去可以帮助你前进。当今惊人的技术是建立在昨天的工具之上的,即使我们从未使用这些传奇语言编写过代码,它也将使我们很好地理解这些工具的功能和局限性。这一系列文章集中于 C 语言、用 AWK 编写的实际应用程序,以及对流行度下降但也许还没有消亡的计算机语言的有趣讨论。 + +* [C 的巨大影响] [11] +* [如何写好 C main 函数][12] +* [用 AWK 喝咖啡][13] +* [你最喜欢的“死”语言是什么?][14] + +### 学习不止 + +无论你在编程过程中处于何处,总有更多东西需要学习。我希望这些来自 2019 年的顶级资源能帮助你为 2020 年做好准备。感谢作者们和你——读者。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/programming-resources + +作者:[Erik O'Shaughnessy][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jnyjny +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_3.png?itok=qw2A18BM (Woman sitting in front of her computer) +[2]: https://linux.cn/article-10769-1.html +[3]: https://linux.cn/article-11280-1.html +[4]: https://linux.cn/article-10661-1.html +[5]: https://linux.cn/article-11116-1.html +[6]: https://en.wikipedia.org/wiki/Autodidacticism +[7]: https://opensource.com/article/19/2/why-use-rust-webassembly +[8]: https://opensource.com/article/19/4/command-line-playgrounds-webassembly +[9]: https://opensource.com/article/19/2/how-does-rootless-podman-work +[10]: https://opensource.com/article/19/10/choose-rust-programming-language +[11]: https://opensource.com/article/19/10/command-line-heroes-c +[12]: https://linux.cn/article-10949-1.html +[13]: https://linux.cn/article-10555-1.html +[14]: https://opensource.com/article/19/6/favorite-dead-language From 3d87a18a7839b10621d87ed1685b4138899f337d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Jan 2020 00:53:37 +0800 Subject: [PATCH 161/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200101=205=20pr?= =?UTF-8?q?edictions=20for=20Kubernetes=20in=202020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200101 5 predictions for Kubernetes in 2020.md --- ...01 5 predictions for Kubernetes in 2020.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20200101 5 predictions for Kubernetes in 2020.md diff --git a/sources/tech/20200101 5 predictions for Kubernetes in 2020.md b/sources/tech/20200101 5 predictions for Kubernetes in 2020.md new file mode 100644 index 0000000000..2032983b78 --- /dev/null +++ b/sources/tech/20200101 5 predictions for Kubernetes in 2020.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 predictions for Kubernetes in 2020) +[#]: via: (https://opensource.com/article/20/1/kubernetes-2020) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux) + +5 predictions for Kubernetes in 2020 +====== +Plus, a look back at the most popular Kubernetes articles on the site in +2019. +![Person drinking a hat drink at the computer][1] + +How do you track a wildly popular project like Kubernetes? How do you figure out where it’s going? If you are contributing to the project or participating in Special Interest Groups (SIGs), you might gain insight by osmosis, but for those of you with day jobs that don’t include contributing to Kubernetes, you might like a little help reading the tea leaves. With a fast-moving project like Kubernetes, the end of the year is an excellent time to take a look at the past year to gain insight into the next one. + +This year, Kubernetes made a lot of progress. Aside from inspecting code, documentation, and meeting notes, another good source is blog entries. To gain some insights, I took a look at the top ten Kubernetes articles on Opensource.com. These articles give us insight into what topics people are interested in reading, but just as importantly, what articles people are interested in writing. Let’s dig in! + +(Get the full list of top 10 Kubernetes articles from 2019 at the end.) + +First, I would point out that five of these articles tackle the expansion of workloads and where they can run. This expansion of workloads includes data science, PostgreSQL, InfluxDB, and Grafana (as a workload, not just to monitor the cluster itself) and Edge. Historically, Kubernetes and containers in general have mostly run on top of virtual machines, especially when run on infrastructure provided by cloud providers. With this interest in Kubernetes at the edge, it’s another sign that end users are genuinely interested in Kubernetes on bare metal (see also [Kubernetes on metal with OpenShift][2]). + +Next, there seems to be a lot of hunger for operational knowledge and best practices with Kubernetes. From [Kubernetes Operators][3], to [Kubernetes Controllers][4], from [Secrets][5] to [ConfigMaps][6], developers and operators alike are looking for best practices and ways to simplify workload deployment and management. Often we get caught up in the actual configuration example, or how people do it, and don’t take a step back to realize that all of these fall into the bucket of how to operationalize the deployment of applications (not how to install or run Kubernetes itself). + +Finally, people seem to be really interested in getting started. In fact, there is so much information on how to build Kubernetes that it intimidates people and gets them down the wrong path. A couple of the top articles focus on why you should learn to run applications on Kubernetes instead of concentrating on installing it. Like best practices, people often don’t take a step back to analyze where they should invest their time when getting started. I have always advocated for, where possible, spending limited time and money on using technology instead of building it. + +### 5 predictions for Kubernetes in 2020 + +So, looking back at those themes from 2019, what does this tell us about where 2020 is going? Well, combining insight from these articles with my own broad purview, I want to share my thoughts for 2020 and beyond: + + 1. Expansion of workloads. I would keep my eye on high-performance computing, AI/ML, and stateful workloads using Operators. + + 2. More concrete best practices, especially around mature standards like PCI, HIPAA, NIST, etc. + + 3. Increased security around rootless and higher security [runtimes classes][7] (like [gVisor][8], [Kata Containers][9], etc.) + + 4. Better standardization on Kubernetes manifests as the core artifact for deployment in development and sharing applications between developers. Things like [podman generate kube][10], [podman play kube][11], and all in one Kubernetes environments like [CodeReady Containers (CRC)][12] + + 5. An ever-wider ecosystem of network, storage and specialized hardware (GPUs, etc.) vendors creating best of breed solutions for Kubernetes (in free software, we believe that open ecosystems are better than vertically integrated solutions) + + + + +I'm looking forward to another great year in Kubernetes! + +**Top 10 Kubernetes articles for 2019** + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/kubernetes-2020 + +作者:[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://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://blog.openshift.com/kubernetes-on-metal-with-openshift/ +[3]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/ +[4]: https://kubernetes.io/docs/concepts/architecture/controller/ +[5]: https://kubernetes.io/docs/concepts/configuration/secret/ +[6]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/ +[7]: https://kubernetes.io/docs/concepts/containers/runtime-class/ +[8]: https://gvisor.dev/ +[9]: https://katacontainers.io/ +[10]: https://developers.redhat.com/blog/2019/01/29/podman-kubernetes-yaml/ +[11]: https://www.redhat.com/en/blog/rhel-81-minor-release-major-new-container-capabilities +[12]: https://developers.redhat.com/products/codeready-containers/overview From 7c36acbcaa8d6a52a508740e7d17d62796bf81dd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Jan 2020 00:54:08 +0800 Subject: [PATCH 162/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200101=20How=20?= =?UTF-8?q?to=20get=20started=20with=20open=20source=20in=202020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200101 How to get started with open source in 2020.md --- ...to get started with open source in 2020.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20200101 How to get started with open source in 2020.md diff --git a/sources/tech/20200101 How to get started with open source in 2020.md b/sources/tech/20200101 How to get started with open source in 2020.md new file mode 100644 index 0000000000..35f67c3d28 --- /dev/null +++ b/sources/tech/20200101 How to get started with open source in 2020.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to get started with open source in 2020) +[#]: via: (https://opensource.com/article/20/1/getting-started-open-source) +[#]: author: (Bryant Son https://opensource.com/users/brson) + +How to get started with open source in 2020 +====== +New to open source? Opensource.com's top 10 articles for newcomers will +get you on the right pathway quickly in the new year. +![pipe in a building][1] + +When Opensource.com launched in 2010, Red Hat CEO Jim Whitehurst said the site "is one of the ways in which Red Hat gives something back to the open source community." And that community has always included the growing number of people who are new to open source. + +In 2019, we published many articles about the open source way of thinking, choosing hardware, the contribution process, and other topics geared toward newbies. If you're new to open source, this list of Opensource.com's top 10 articles from 2019 about getting started with open source should put you on the right path. + +### Why I made the switch from Mac to Linux + +Have you ever considered trying out Linux but were not sure how to start? You are not alone! Trying something new is usually a little scary and involves a learning curve. In [_Why I made the switch from Mac to Linux_][2], Matthew Broberg shares his story about adopting Linux and how his initial nervousness was transformed into an awesome feeling of accomplishment. + +### Getting started with Git: Terminology 101 + +Although there are many ways to contribute to open source (including writing about it, like I'm doing here), the most notable contributions come from the developers who provide source code to projects. They usually make their source code contributions to GitHub and GitLab repositories using the Git tool. Matthew Broberg's guide to [_Getting started with Git: Terminology 101_][3] explains how to get started with Git so you can make your first commit to your favorite open source project. + +### Buying a Linux-ready laptop + +Most people who want to try Linux are already familiar with Microsoft Windows or Apple MacOS, and they may know they can install Linux on their existing computer, for example, by using a virtual machine, partitioning their drive to install Linux alongside Windows or Mac, reformatting their drive to erase their old operating system and install Linux, or putting Linux on a second drive. But many may not know they can buy a Linux-by-default laptop from companies like System76, Slimbook, and Tuxedo. In [_Buying a Linux-ready laptop_][4], Richardo Berlasso shares his experience of ordering, receiving, and using a Linux-ready Tuxedo laptop. + +### Getting started with Vim: The basics + +Vim is an improved version of the vi text editor. It's is available by default on most Linux operating systems and competes with Emacs, another popular Linux text editor. Knowing how to use Vim can give you an edge in creating, modifying, and managing text-based files, whether they are programming files or simple words on a screen. In [_Getting started with Vim: The basics_][5], I walk through how to start learning Vim to simplify your open source journey. + +### How to create a pull request in GitHub + +Pull request, often shortened to PR, is a Git term that means something is available to be merged into another branch. Pull requests are an essential part of the open source contribution process: to contribute to an open source project, people fork or clone a branch to work on it, and the PR process is how they later merge their work back to the parent branch. [_How to create a pull request in GitHub_][6] by Kedar Vijay Kulkarni will give you a good foundation of knowledge to make your first pull request. + +### Bash vs. Python: Which language should you use? + +Of the many programming languages out there, Python is definitely one of the hottest, driven mostly by the growth of data science. But for automation engineers, Bash always has been the primary script language to get the job done. So, what can Python do that Bash cannot? What are some Bash tasks that Python can't replace? Learn the differences by reading [_Bash vs. Python: Which language should you use?_][7] by Archit Modi. + +### How to use Ansible to document procedures + +Ansible is a very popular and powerful infrastructure-as-code tool. Many enterprises rely on it to automate tasks in their cloud platforms. Among the countless things Ansible can do, one of the least obvious is the one Marco Bravo explains: [_How to use Ansible to document procedures_][8]. + +### A dozen ways to learn Python + +Learning a programming language is always a daunting task. But Python has a number of features that make the learning process easy. Contributor Don Watkins offers [_A dozen ways to learn Python_][9] to take some of the stress out of the journey from getting started to becoming a Python expert. + +### What's the best Linux distribution for beginners? + +Everyone has probably heard of Android, the most widely used Linux-based mobile operating system. And many have heard of Red Hat Enterprise Linux (RHEL) and Ubuntu. Picking a Linux operating system can be difficult, but Lauren Pritchett's poll [_What's the best Linux distribution for beginners?_][10] might help you pick the right one based on the community's input. By the way, while you're there, make sure to vote for your favorite Linux distro. + +### My first contribution to open source: Impostor Syndrome + +Contributing to open source can change your life in positive ways, but you can't ignore the technical challenges around it. Have you ever heard someone say, "Hey, starting with open source is a piece of cake? Everyone can do it!" Probably not, since it's not exactly true. Galen Corey shares some of the challenges he confronted in [_My first contribution to open source: Impostor Syndrome_][11]. + +### What else do you need to get started? + +There are a lot of topics related to getting started with open source, which also means there are a lot of opportunities for Opensource.com to give back to new users by publishing articles to help them. Do you have ideas for other articles we should cover in 2020? Please share your suggestions in the comments, or even consider [writing an article][12] about your own open source journey. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/getting-started-open-source + +作者:[Bryant Son][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/brson +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/open_pipe_red_hat_tower_building.png?itok=8ho3yi7L (pipe in a building) +[2]: https://opensource.com/article/19/10/why-switch-mac-linux +[3]: https://opensource.com/article/19/2/git-terminology +[4]: https://opensource.com/article/19/7/linux-laptop +[5]: https://opensource.com/article/19/3/getting-started-vim +[6]: https://opensource.com/article/19/7/create-pull-request-github +[7]: https://opensource.com/article/19/4/bash-vs-python +[8]: https://opensource.com/article/19/4/ansible-procedures +[9]: https://opensource.com/article/19/8/dozen-ways-learn-python +[10]: https://opensource.com/article/19/10/linux-distribution-beginners +[11]: https://opensource.com/article/19/11/my-first-open-source-contribution-impostor-syndrome +[12]: https://opensource.com/how-submit-article From 2a6dfeb2fa9796231196f4725847e447fe4652b1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Jan 2020 00:54:44 +0800 Subject: [PATCH 163/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200101=209=20ch?= =?UTF-8?q?eat=20sheets=20and=20guides=20to=20enhance=20your=20tech=20skil?= =?UTF-8?q?ls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md --- ... and guides to enhance your tech skills.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md diff --git a/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md b/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md new file mode 100644 index 0000000000..fb9d954ab5 --- /dev/null +++ b/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 cheat sheets and guides to enhance your tech skills) +[#]: via: (https://opensource.com/article/20/1/cheat-sheets-guides) +[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) + +9 cheat sheets and guides to enhance your tech skills +====== +Kick off the new year with our latest programming cheat sheets and +guides for people of all skill levels. Take our poll to let us know what +you'd like to see next! +![a checklist for a team][1] + +Cheat sheets are perfect for the new coder just starting out on the command line. However, even the most experienced programmers need to lean on references every once in a while. If that pesky keyboard shortcut is just at the tip of your finger, a cheat sheet is perfect to have nearby. Here’s a roundup of our downloadable guides that will set you up for success in 2020. + +### Cheat sheets + +#### [Markdown][2] + +Markdown is not just for coders. Anyone can use it to help bring syntax and structure to a plain text document. This cheat sheet provides Markdown foundations using the CommonMark specification. It also includes syntax for GitHub and GitLab.  + +#### [Linux permissions and users][3] + +Keep commands for managing users close at hand with this Linux cheat sheet. Quickly learn how to add users, delete users, show history, and set permissions. + +#### [Bash][4] + +Once you know Bash, the possibilities at the command line are endless. Our Bash cheat sheet helps you become more efficient with keyboard shortcuts. Before you know it, you'll be running scripts in your sleep (literally).   + +#### [Linux common commands][5] + +It's no wonder that our cheat sheet for common Linux commands is so popular. This cheat sheet is packed with the essentials to get started with installing software and navigating file systems. Print this one out for yourself and your colleagues. + +#### [Microservices][6] + +It seems like everyone is talking about microservices and for good reason. Microservices make applications modular so that they are easier to build and maintain. It's no longer just a buzzword with this cheat sheet. Get to know important terms and learn more about the fundamentals of microservices in [A guide to open source for microservices][7]. + +#### [Java][8] + +This cheat sheet is ideal for beginner and intermediate Java programmers. It includes important context along with code for handling imports, variables, classes, and more. + +#### [pip][9] + +Programmers love using pip commands to help install, manage, and use Python software packages. However, pip can do much more than that. This cheat sheet will teach you how to build wheels and record packages. + +### Guides + +#### [7 essential PyPI libraries][10] + +This collection of Python tutorials will help you learn how to write extensions faster, format your code, automate tests, ensure code consistency, and more using PyPI libraries.  + +#### [Getting started with Kubernetes][11] + +In this approachable guide, author [Scott McCarty][12] uses an unexpected analogy to explain the value of Kubernetes and the steps to get started.  + +* * * + +We'd like to hear from you: Do you have an idea for a new cheat sheet or guide? Take our poll and choose from one of the options, or let us know in the comments. Check out all of our downloads [here][13]. Get alerts about new cheat sheets by [signing up][14] for our email newsletter. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/cheat-sheets-guides + +作者:[Lauren Pritchett][a] +选题:[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/lauren-pritchett +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team) +[2]: https://opensource.com/downloads/cheat-sheet-markdown +[3]: https://opensource.com/downloads/linux-permissions-cheat-sheet +[4]: https://opensource.com/downloads/bash-cheat-sheet +[5]: https://opensource.com/downloads/linux-common-commands-cheat-sheet +[6]: https://opensource.com/downloads/microservices-cheat-sheet +[7]: https://opensource.com/article/19/11/microservices-cheat-sheet +[8]: https://opensource.com/downloads/java-cheat-sheet +[9]: https://opensource.com/downloads/pip-cheat-sheet +[10]: https://opensource.com/downloads/7-essential-pypi-libraries +[11]: https://opensource.com/downloads/getting-started-kubernetes-ebook +[12]: https://opensource.com/users/fatherlinux +[13]: https://opensource.com/downloads/cheat-sheets +[14]: https://opensource.com/email-newsletter From 255f8986cce56ee11ddf7619fc2d4fc2c8b40b88 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 2 Jan 2020 08:43:13 +0800 Subject: [PATCH 164/430] translated --- ...leased With GUI Rework and New Features.md | 112 ------------------ ...leased With GUI Rework and New Features.md | 111 +++++++++++++++++ 2 files changed, 111 insertions(+), 112 deletions(-) delete mode 100644 sources/news/20191226 Darktable 3 Released With GUI Rework and New Features.md create mode 100644 translated/news/20191226 Darktable 3 Released With GUI Rework and New Features.md diff --git a/sources/news/20191226 Darktable 3 Released With GUI Rework and New Features.md b/sources/news/20191226 Darktable 3 Released With GUI Rework and New Features.md deleted file mode 100644 index 665f5f585a..0000000000 --- a/sources/news/20191226 Darktable 3 Released With GUI Rework and New Features.md +++ /dev/null @@ -1,112 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Darktable 3 Released With GUI Rework and New Features) -[#]: via: (https://itsfoss.com/darktable-3-release/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Darktable 3 Released With GUI Rework and New Features -====== - -Here’s the Christmas gift for the photography enthusiasts. Darktable 3.0 has just released. - -[Darktable][1] is one of the [best applications for editing RAW images on Linux][2]. You can consider it as a [free and open source alternative to Adobe Lightroom][3]. - -Darktable 3 is a major new release with tons of feature improvements and a complete rework of the user interface. The GUI is now completely controlled by GTK+ CSS rules, which makes the whole GUI themable. There are eight themes available by default. - -With the help of over 3000 commits and 553 pull requests, the new release has fixed 66 bugs and added many new features. - -Let’s see what features this new release brings. - -### New features in Darktable 3.0 - -![Darktable 3.0 Screenshot][4] - -Here are the highlighted new features: - - * Reworked UI - * A new module for handling 3D RGB Lut transformations - * Many improvements to the ‘denoise (profiled)’ module - * A new ‘culling’ mode and timeline view added - * Many improvements to the ‘denoise (profiled)’ module - * New tone equalizer’ basic and filmic RGB modules - * Better 4K/5K display support - * Undo/redo support for more operations - * Many code optimizations for CPU and SSE paths - * Support for exporting to Google Photos - * More camera support, white balance presets, and noise profiles - * Plenty of bug fixes and feature improvements - - - -You can read about all the changes in the [release notes on GitHub][5]. - -### Installing Darktable 3.0 on Linux - -Let’s see how to get the latest Darktable release. - -#### Installing Darktable 3.0 on Ubuntu-based distributions - -Darktable is available in Ubuntu but you won’t get the latest release immediately. For the LTS version, it may take months before you have this version update. - -Worry not! Darktable provides its [own PPA][6] to install the latest release on Ubuntu-based distributions. - -Unfortuntaley, That Darktable PPA has not been updated with the new release. - -Worry not (again)! Thanks to our friend [Ji M of Ubuntu Handbook][7], we have an unofficial PPA for easily installing Darktable 3.0 on Ubuntu and other Ubuntu based distributions. - -Open a terminal and use these commands one by one: - -``` -sudo add-apt-repository ppa:ubuntuhandbook1/darktable -sudo apt update -sudo apt install darktable -``` - -#### Uninstall Darktable 3 - -To remove Darktable installed via this PPA, you can first uninstall the application: - -``` -sudo apt remove darktable -``` - -And then [remove the PPA][8] as well: - -``` -sudo add-apt-repository -r ppa:ubuntuhandbook1/darktable -``` - -#### Installing Darktable on other Linux distributions - -You may wait for your distribution to provide this new release through the software manager. - -You may also download the tarball or the entire source code from the GitHub release page (it’s at the bottom of the page). - -[Download Darktable 3.0][5] - -With Darktable 3, you can edit your holiday pictures better :) - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/darktable-3-release/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://www.darktable.org/ -[2]: https://itsfoss.com/raw-image-tools-linux/ -[3]: https://itsfoss.com/open-source-photoshop-alternatives/ -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/darktable_3_screenshot.jpg?ssl=1 -[5]: https://github.com/darktable-org/darktable/releases/tag/release-3.0.0 -[6]: https://launchpad.net/~pmjdebruijn/+archive/ubuntu/darktable-release -[7]: http://ubuntuhandbook.org/index.php/2019/12/install-darktable-3-0-0-ubuntu-18-04-19-10/ -[8]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ diff --git a/translated/news/20191226 Darktable 3 Released With GUI Rework and New Features.md b/translated/news/20191226 Darktable 3 Released With GUI Rework and New Features.md new file mode 100644 index 0000000000..d49467438d --- /dev/null +++ b/translated/news/20191226 Darktable 3 Released With GUI Rework and New Features.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Darktable 3 Released With GUI Rework and New Features) +[#]: via: (https://itsfoss.com/darktable-3-release/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Darktable 3 发布,带来重做的 GUI 及新的功能 +====== + +这是给摄影爱好者的圣诞节礼物。Darktable 3.0 刚刚发布了。 + +[Darktable][1] 是[在 Linux 上编辑 RAW 图像的最佳应用之一] [2]。你可以将其视为 [Adobe Lightroom 的免费开源替代品][3]。 + +Darktable 3 是一个主版本更新,它有许多功能改进和对用户界面的重做。现在,GUI 完全由 GTK+ CSS 规则控制,这使得整个 GUI 都可定制主题。默认它有八个主题。 + +借助 3000 多个提交和 553 个拉取请求,新版本修复了 66 个 bug 并添加了许多新功能。 + +让我们看看这个新版本带来了什么功能。 + +### Darktable 3.0 的新功能 + +![Darktable 3.0 Screenshot][4] + +以下是重要的新功能: + + *重做的 UI +  * 用于处理 3D RGB Lut 变换的新模块 +  * 对“降噪(轮廓化)”模块进行了许多改进 +  * 添加了新的“剔除”模式和时间轴视图 +  * 对“降噪(轮廓化)”模块进行了许多改进 +  * 新色调均衡器的基本和电影 RGB 模块 +  * 更好的 4K/5K 显示支持 +  * 撤消/重做支持更多操作 +  * 针对 CPU 和 SSE 路径的许多代码优化 +  * 支持导出到 Google 相册 +  * 更多的相机支持,白平衡预设和噪点配置 +  * 大量的 bug 修复和功能改进 + + +你可以在 [GitHub 发行说明][5]中了解所有更改。 + +### 在 Linux 上安装 Darktable 3.0 + +让我们看看如何获​​取最新的 Darktable 版本。 + +#### 在基于 Ubuntu 的发行版上安装 Darktable 3.0 + +Ubuntu 仓库中有 Darktable,但你不能得到最新的版本。对于 LTS 版本,它的更新可能需要几个月的时间。 + +不用担心!Darktable 提供了[自己的 PPA][6],来在基于 Ubuntu 的发行版上安装最新版本。 + +不幸的是,此 Darktable PPA 尚未随新版本更新。 + +不用担心了!多亏了我们的朋友 [Ubuntu Handbook 的 Ji M][7],我们有一个非正式的 PPA,可以轻松地在 Ubuntu 和其他基于 Ubuntu 的发行版上安装 Darktable 3.0。 + +打开终端,并使用这些命令: + +``` +sudo add-apt-repository ppa:ubuntuhandbook1/darktable +sudo apt update +sudo apt install darktable +``` + +#### 卸载 Darktable 3 + +要删除通过此 PPA 安装的 Darktable,你可以先卸载该应用: + +``` +sudo apt remove darktable +``` + +接着[删除 PPA][8]: + +``` +sudo add-apt-repository -r ppa:ubuntuhandbook1/darktable +``` + +#### 在其他 Linux 发行版上安装 Darktable + +你可以等待到你的发行版的软件管理器提供新版本。 + +你也可以从 GitHub 发布页面(位于页面底部)下载 tarball 或所有源代码。 + +[Download Darktable 3.0][5] + +使用 Darktable 3,你可以更好地编辑自己的假期照片:) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/darktable-3-release/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.darktable.org/ +[2]: https://itsfoss.com/raw-image-tools-linux/ +[3]: https://itsfoss.com/open-source-photoshop-alternatives/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/darktable_3_screenshot.jpg?ssl=1 +[5]: https://github.com/darktable-org/darktable/releases/tag/release-3.0.0 +[6]: https://launchpad.net/~pmjdebruijn/+archive/ubuntu/darktable-release +[7]: http://ubuntuhandbook.org/index.php/2019/12/install-darktable-3-0-0-ubuntu-18-04-19-10/ +[8]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/ From abcc2e9b79882bca422e20936f7a0caa3681cd07 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 2 Jan 2020 08:52:12 +0800 Subject: [PATCH 165/430] translating --- .../20200101 Signal- A Secure, Open Source Messaging App.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md b/sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md index 4dd4037627..fbb741b9f5 100644 --- a/sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md +++ b/sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 00ba46b1be03c83e253938630ab30d9b0260a8fa Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 2 Jan 2020 09:24:31 +0800 Subject: [PATCH 166/430] Rename sources/tech/20200101 How to get started with open source in 2020.md to sources/talk/20200101 How to get started with open source in 2020.md --- .../20200101 How to get started with open source in 2020.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200101 How to get started with open source in 2020.md (100%) diff --git a/sources/tech/20200101 How to get started with open source in 2020.md b/sources/talk/20200101 How to get started with open source in 2020.md similarity index 100% rename from sources/tech/20200101 How to get started with open source in 2020.md rename to sources/talk/20200101 How to get started with open source in 2020.md From 92a023f51b15e6d41814794fc7360de6694c6289 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Jan 2020 09:40:06 +0800 Subject: [PATCH 167/430] PRF @wxy --- ...27 10 resources to boost your Git skills.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20191227 10 resources to boost your Git skills.md b/translated/tech/20191227 10 resources to boost your Git skills.md index eee2be8848..66f23f3e4e 100644 --- a/translated/tech/20191227 10 resources to boost your Git skills.md +++ b/translated/tech/20191227 10 resources to boost your Git skills.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (10 resources to boost your Git skills) @@ -10,22 +10,22 @@ 10 个提高 Git 技能的资源 ====== -> 年末总结一下 Git 的最佳表现。以下是在新的一年中以新奇的方式使用 Git 的十篇文章。 +> 年末总结一下 Git 的最佳表现。以下是告诉你可以在新的一年中以新奇的方式使用 Git 的十篇文章。 -![open source button on keyboard][1] +![](https://img.linux.net.cn/data/attachment/album/202001/02/093934q5ifu46u4nuq4lgi.jpg) -快到 2019 年底了,是时候回顾一下我们今年发表的有关 Git 的前 10 篇文章了。 +2019 年过去了,是时候回顾一下我们(opensource.com)今年发表的有关 Git 的前 10 篇文章了。 这些文章包括从用例和教程到一些非常有趣的(甚至有些非常规的)使用 Git 的方法。所有这些文章都可以帮助你提高 Git 技能,但是,如果你确实需要 Git 入门介绍,请务必查看我们的《[Git 入门:术语入门][2]》文章,并下载我们的 [Git 备忘单][3]。 -1. Molly de Blanc 写的《[GNOME 如何使用 Git][4]》考察了 GNOME 项目采用的自托管 GitLab 实例的做法,该实例作为 GNOME 项目集中保存为 GNOME 做出的贡献的位置。De Blanc 从事于非编码职位,因此她的文章还探讨了切换到 GitLab 如何使主要角色不是编写代码的贡献者受益。 +1. Molly de Blanc 写的《[GNOME 项目如何使用 Git][4]》考察了 GNOME 项目采用的自托管 GitLab 实例的做法,该实例作为 GNOME 项目集中保存对 GNOME 做出的贡献的位置。De Blanc 从事于非编码职位,因此她的文章还探讨了切换到 GitLab 如何使主要角色不是编写代码的贡献者受益。 2. Ahmad Awais 写的《[Emoji-Log:编写 Git 提交信息的新方法][5]》解释了如何使用 Emoji-Log(一种直白的、开源的 Git 提交日志标准)来编写更好、更用户友好的 Git 提交消息。本文概述了 Emoji-Log 背后的理论以及可添加到 `.bashrc`、`.zshrc` 或 `.gitconfig` 中的配置示例,以便你快速开始使用 Emoji-Log。 3. 在《[用 Git 管理你的每日行程][6]》中,Seth Kenlon 解释了如何使用 Git 来管理日历。通过结合 Org 模式、Git 和其他一些工具,Kenlon 描述了如何创建可在设备之间同步的基于 Git 的日历工作流。 4. 《[用 Git 作为聊天应用的后端][7]》,Seth Kenlon 探索了另一种使用 Git 的非常规方式。在本文中,他探讨了 GIC,这是一个用 Node.js 编写的聊天客户端,其中 Git 用作后端数据库。GIC 是一个概念验证模型,不是供产品环境使用的东西,但是它提供了一个有趣的示例,说明了使用 Git 的真正独特方法。 5. Alan Formy-Duval 的《[Git 学习实用练习][8]》是一份他为提高 Git 技能而努力的编年史。他分享了自己的经验,以使其他人受益于他所学,而 Git 新手将从这篇对 Git 核心功能的出色概述中受益匪浅。 -6. 《[用 Git 帮助写作者更好地完成工作][9]》的作者 Seth Kenlon 着眼于写作者如何从基于 Git 的工作流中受益。本文介绍了如何使用 Git 和 Atom 利用 Markdown 进行书写。通过遵循本文中的示例,写作者可以轻松地将复杂的修订控制系统添加到其编写工作流中。 -7. Sachin Patil 在《[如何使用 Magit 管理 Git 项目][10]》中,解释了如何使用 Emacs 的 Magit 扩展来管理 Git 存储库。本文提供了有关如何在 Emacs 中执行一系列关键 Git 任务的清晰示例。这些示例由说明各种任务的屏幕截图支持。 -8. 《[把“点文件”放到版本控制中][11]》的作者 Matthew Broberg 演示了如何使用 Git 存储放在主目录中的点文件。将你的点文件存储在 Git 存储库中,可以更轻松地在计算机之间共享系统配置,并且,如果你愿意的话,也可以与其他人共享配置。这篇文章也有什么不要共享的警告,因为共享错误的点文件会暴露给其他人。 +6. 《[用 Git 帮助写作者更好地完成工作][9]》的作者 Seth Kenlon 着眼于写作者如何从基于 Git 的工作流中受益。本文介绍了如何使用 Git 和 Atom 利用 Markdown 进行书写。通过遵循本文中的示例,写作者可以轻松地将复杂的版本控制系统添加到其编写工作流中。 +7. Sachin Patil 在《[如何使用 Magit 管理 Git 项目][10]》中,解释了如何使用 Emacs 的 Magit 扩展来管理 Git 存储库。本文提供了有关如何在 Emacs 中执行一系列关键 Git 任务的清晰示例。这些示例带有说明各种任务的屏幕截图。 +8. 《[把“点文件”放到版本控制中][11]》的作者 Matthew Broberg 演示了如何使用 Git 存储放在主目录中的点文件。将你的点文件存储在 Git 存储库中,可以更轻松地在计算机之间共享系统配置,并且,如果你愿意的话,也可以与其他人共享配置。这篇文章也有不要共享哪些文件的警告,因为共享错误的点文件会将其暴露给其他人。 9. Austin Dewey 的《[4 种用于 Git 加密的机密管理工具][12]》在本文中比较了 Git-crypt、BlackBox、SOPS 和 Transcrypt,研究了在 Git 中存储机密的工具。本文涵盖四个主要领域:支持的加密类型、每个项目的目标、项目的工作流和差异以及其他功能。 10. Seth Kenlon 的《[使用 Git 管理 Git 服务器][13]》解释了如何使用 Gitolite 管理 Git 服务器。Gitolite 是使用 Git 来管理 Git 服务器的“管理杂项的后端应用程序”。本文演示了如何安装、配置和使用 Gitolite,并提供了清晰的示例详细说明了该过程的每个步骤。 @@ -36,7 +36,7 @@ via: https://opensource.com/article/19/12/git-resources 作者:[Joshua Allen Holm][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c4bb1456b9281b4b79bf269c88c276c1f3e9bdc4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Jan 2020 09:40:56 +0800 Subject: [PATCH 168/430] PUB @wxy https://linux.cn/article-11737-1.html --- .../tech/20191227 10 resources to boost your Git skills.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20191227 10 resources to boost your Git skills.md b/translated/tech/20191227 10 resources to boost your Git skills.md index 66f23f3e4e..8dc63c18bf 100644 --- a/translated/tech/20191227 10 resources to boost your Git skills.md +++ b/translated/tech/20191227 10 resources to boost your Git skills.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11737-1.html) [#]: subject: (10 resources to boost your Git skills) [#]: via: (https://opensource.com/article/19/12/git-resources) [#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) From 2cb00c83640323ac3f982963c3e3f39b4b30c657 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Jan 2020 10:30:40 +0800 Subject: [PATCH 169/430] PRF @robsean --- ... chapter template in LibreOffice Writer.md | 64 +++++++++---------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/translated/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md b/translated/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md index c73f774162..be6ce008f5 100644 --- a/translated/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md +++ b/translated/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md @@ -1,31 +1,33 @@ 如何在 LibreOffice Writer 中创建一个电子书章节模板 ====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_colorbooks.png?itok=vNhsYYyC) -对于很多人来说,使用 word 程序来写和发布一本电子书是一种最好的,最容易的,最熟悉的方法。但是,启动你的 word 程序和打字是不够的--你需要遵循一种格式。 +> 将电子书分成几章,创建电子书会更容易。这是设置模板的分步指南。 -这就是模板的来源。一个模板确保你的电子书有一个一致的外观和体验。幸运的是,创建一个模板是快速和容易的,并你在其上花费的时间和努力将给你一本更好感官的书。 +![](https://img.linux.net.cn/data/attachment/album/202001/02/102817vmflleeemehetblt.jpg) -在这片文章中,我将陪伴你走过如何使用 LibreOffice Writer 创建一个简单的用于写一本电子书的各个章节的模板。你可以将这个模板用于 PDF 和 EPUB 书籍,并假以修改来满足你的需要。 +对于很多人来说,使用 word 程序来撰写和发布一本电子书是一种最好的、最容易的、最熟悉的方法。但是,启动你的 word 程序和打字是不够的 —— 你需要遵循一种格式。 + +这就是模板的来源。一个模板确保你的电子书有一个一致的外观和体验。幸运的是,创建模板是快速和容易的,并你在其上花费的时间和努力将带给你一本更好感观的书。 + +在这篇文章中,我将陪伴你走过如何使用 LibreOffice Writer 创建一个简单的模板,可以用于一本电子书的各个章节。你可以将这个模板用于 PDF 和 EPUB 书籍,并加以修改来满足你的需要。 ### 我的方法 -为什么我聚焦于为一个章节创建一个模板,而不是为一整本书创建一个模板?因为编写和管理单独的章节比编写和管理单个庞大而僵化的文档更容易。 +为什么我着重于为一个章节创建一个模板,而不是为一整本书创建一个模板?因为编写和管理单独的章节比编写和管理单个庞大而僵化的文档更容易。 -通过聚焦于单独的章节,你可以聚焦于你需要编写的东西。你可以容易地向各处移动这些章节,给审阅者发单独一章节比发你完整的原稿更简单而高效。当你写完一章后,你可以简单地把你的章节拼凑在一起来出版这本书(我将在下面讨论如何做到这一点)。但是不要觉得你被这种方法所束缚 --如果你更喜欢在单个文件中编写,简单地调整在这篇文章中描述的步骤来做做成这样。 +通过关注于单独的章节,你可以专心于你需要编写的东西。你可以很容易地四处移动这些章节,给审阅者发单独一章节比发送你的完整原稿更简单而高效。当你写完一章后,你可以简单地把你的章节拼凑在一起来出版这本书(我将在下面讨论如何做到这一点)。但是不要觉得你被这种方法所束缚 —— 如果你更喜欢在单个文件中编写,简单地调整在这篇文章中描述的步骤就行。 让我们开始吧。 ### 设置页面 -仅当你计划发布你的电子书为一本 PDF 书时,这是很重要的。设置页面意味着你的书将不包含大量的穿越屏幕的让眼睛疲劳的文本。 +仅当你计划发布你的电子书为一本 PDF 书时,这是很重要的。设置页面意味着你的书将不包含大量的跨越屏幕的让眼睛疲劳的文本。 -选择 **格式 > 页面** 来打开 **页面样式** 窗口。我的 PDF 电子书通常是 5x8 英寸高(大约 13x20cm ,对于我们这些生活在米制世界的人来说)。我也设置页边距为半英寸(约 1.25 cm)。这些是我较喜欢的尺寸;使用任何适合你的尺寸。 +选择 **格式 > 页面** 来打开 **页面样式** 窗口。我的 PDF 电子书通常是 5x8 英寸高(大约 13x20cm ,对于我们这些生活在米制世界的人来说)。我也设置页边距为半英寸(约 1.25 cm)。这些是我较喜欢的尺寸;你可以使用任何适合你的尺寸。 ![LibreOffice Page Style window][2] - -在 LibreOffice Writer 中的页面样式窗口让你设置页边距和页格式。 +*在 LibreOffice Writer 中的页面样式窗口让你设置页边距和页格式。* 接下来,添加页脚以显示页码。保持页面样式窗口打开着,并单击 **页脚** 选项卡。选择 **在页脚上** 并单击 **确定** 。 @@ -33,15 +35,13 @@ ### 设置你的样式 -像模板本身一样,样式为你的文档提供一种一致的外观和体验。如果你想更改一个标题的字体或大小,例如,你只需要在一个地方完成它,而不是手动应用格式化到每个标题。 - -标准化的 LibreOffice 模板带有许多样式,你可以调整它们以适应你的需要。为此,按 **F11** 来打开 **样式和格式** 窗口。 +像模板本身一样,样式为你的文档提供一种一致的外观和体验。如果你想更改一个标题的字体或大小,例如,你只需要在一个地方完成它,而不是手动应用格式化到每个标题。 +标准化的 LibreOffice 模板带有许多样式,你可以调整它们以适应你的需要。为此,按 `F11` 来打开 **样式和格式** 窗口。 ![LibreOffice styles and formatting][4] - -使用样式和格式窗口更改字体和其它细节。 +*使用样式和格式窗口更改字体和其它细节。* 在一个样式上右键单击,并选择 **修改** 来编辑它。 这里是我在每本中使用的主要样式: @@ -56,51 +56,45 @@ ![LibreOffice styles in action][6] +*这是当我们应用到电子书内容时的一个选择的样式外观。* -这是当我们应用到电子书内容时的一个选择的样式外观。 +对于大多数书来说,这通常是最小要求。可以随便更改字体和空格来适应你的要求。 -对于大多数书来说,这通常是最小量要求。可以随便更改字体和空格来适应你的要求。 - -根据你正在编写书的类型,你可能也想创建或修改项目符合样式,以及数字列表,引号、代码示例,数字符号等等。只需要记住始终如一地使用字体以及其大小。 +根据你正在编写书的类型,你可能也想创建或修改项目符合样式,以及数字列表、引号、代码示例、数字符号等等。只需要记住始终如一地使用字体以及其大小。 ### 保存你的模板 -选择 **文件 > 另存为** 。在保持对话框中,从格式列表中选择 _ODF 文本文档模板 (.ott)_ 。这将保存模板为一个模板,以后你可以快速调用该模板。 +选择 **文件 > 另存为** 。在保持对话框中,从格式列表中选择 “ODF 文本文档模板 (.ott)” 。这将保存模板为一个模板,以后你可以快速调用该模板。 -保存模板的最佳位置是 LibreOffice 模板文件夹。例如,在 Linux 中,那是在你的 **/home** 目录下,在 . **config/libreoffice/4/user/template** 下。 +保存模板的最佳位置是 LibreOffice 模板文件夹。例如,在 Linux 中,那是在你的家目录下,在 `.config/libreoffice/4/user/template` 下。 ### 编写你的书 -在你开始编写前,在你的计算机上创建一个文件夹,它将为你的书保存所有的文件--章节,图像,笔记等等。 +在你开始编写前,在你的计算机上创建一个文件夹,它将为你的书保存所有的文件 —— 章节、图像、笔记等等。 当你准备编写时,启动 LibreOffice Writer 并选择 **文件 > 新建 > 模板** 。然后从列表中选择你的模板,并单击 **打开**。 - ![LibreOffice Writer template list][8] - -从你在 LibreOffice Writer 中设置的列表中选择你的模板,并开始编写。 +*从你在 LibreOffice Writer 中设置的列表中选择你的模板,并开始编写。* 然后用一个描述性名称保存文档。 -建议使用像 _章节 1_ 和 _章节 2_ 这样的惯例--在某些时候,你可能决定重新编排你的章节,当你尝试管理这些章节时,它可能会变得混乱。然而,你可以在文件名称中放置章节数字,像 _章节 1_ 或 _Ch1 。很容易重命名一个文件,_ 。如果你完成重新排版书的章节,像这样重命名更容易。 +建议使用像 “第 1 章” 和 “第 2 章” 这样的惯例 —— 在某些时候,你可能决定重新编排你的章节,当你尝试管理这些章节时,它可能会变得混乱。然而,你可以在文件名称中放置章节数字,像 “第 1 章” 或 “一” 。如果你最后要重新排列全书的章节,像这样重命名更容易。 -别再碍事,开始编写。记住在模板中使用样式来格式化文本--这就是为什么你要创建模板,对吧? +无需赘言,开始编写吧。记住在模板中使用样式来格式化文本 —— 这就是为什么你要创建模板,对吧? ### 发布你的电子书 -在完成编写一堆章节后,并准备发布它们时,创建一个主控文档。把一个主控文档作为你所编写章节的一个容器。使用一个主控文档,你可以快速地组装你的书,并任意重新排序你的章节。LibreOffice 帮助提供使用[主控文档][9]的详细信息。 +在完成编写一堆章节后,并准备发布它们时,创建一个主控文档。把一个主控文档作为你所编写章节的一个容器。使用一个主控文档,你可以快速地组装你的书,并任意重新排序你的章节。LibreOffice 的帮助提供了使用[主控文档][9]的详细信息。 -假设你想生成一个 PDF ,不要只是单击**直接导出到 PDF** 按钮。这将创建一个相当不错的 PDF ,但是你可能想优化它。为此,选择 **文件 > 导出为 PDF** ,并在 PDF 窗口中轻微调整。你可以在 [LibreOffice Writer 文档][10] 中学到更多东西。 +假设你想生成一个 PDF ,不要只是单击**直接导出到 PDF** 按钮。这将创建一个相当不错的 PDF ,但是你可能想优化它。为此,选择 **文件 > 导出为 PDF** ,并在 PDF 选项窗口中轻微调整。你可以在这篇 [LibreOffice Writer 文档][10] 中学到更多东西。 -如果你想创建一个 EPUB 而不是 一个PDF ,或者除了一个 PDF 以外,另外创建一个 EPUB,安装 [Writer2EPUB][11] 扩展。Opensource.com 的 Bryan Behrenshausen 为这个扩展[分享一些有用的说明][12] 。 +如果你想创建一个 EPUB 而不是一个 PDF,或者除了一个 PDF 以外,另外创建一个 EPUB,请安装 [Writer2EPUB][11] 扩展。Opensource.com 的 Bryan Behrenshausen 为这个扩展[分享了一些有用的说明][12] 。 ### 结束语 -我们在这里创建的模板是极简单的,但是你将其用于一本简单的书,或者作为构建一个复杂模板的起点。不管怎样,这个模板都会让你快速地开始编写和发布你的电子书。 - -### 关于作者About The Author -Scott Nesbitt ;我是一个长期使用自由开放源码软件的人;写各种东西都是为了玩;盈利。我不太看重我自己;我做我自己的特效。你可以在网上的一些高质量的大型组装找到我的踪迹。 +我们在这里创建的模板是极简单的,但是你可以将其用于一本简单的书,或者作为构建一个复杂模板的起点。不管怎样,这个模板都会让你快速地开始编写和发布你的电子书。 -------------------------------------------------------------------------------- @@ -108,7 +102,7 @@ via: https://opensource.com/article/17/10/creating-ebook-chapter-template-libreo 作者:[Scott Nesbitt][a] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 26114119df3e2a5ed4823c1060b9263ee2b4da91 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Jan 2020 10:33:56 +0800 Subject: [PATCH 170/430] PUB @robsean https://linux.cn/article-11738-1.html --- ... to create an e-book chapter template in LibreOffice Writer.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20171018 How to create an e-book chapter template in LibreOffice Writer.md (100%) diff --git a/translated/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md b/published/20171018 How to create an e-book chapter template in LibreOffice Writer.md similarity index 100% rename from translated/tech/20171018 How to create an e-book chapter template in LibreOffice Writer.md rename to published/20171018 How to create an e-book chapter template in LibreOffice Writer.md From 52ca2c8a035834c86f048ef314f6bc937173d100 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Jan 2020 22:24:00 +0800 Subject: [PATCH 171/430] PRF @geekpi --- ...leased With GUI Rework and New Features.md | 43 +++++++++---------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/translated/news/20191226 Darktable 3 Released With GUI Rework and New Features.md b/translated/news/20191226 Darktable 3 Released With GUI Rework and New Features.md index d49467438d..3ae5c19e01 100644 --- a/translated/news/20191226 Darktable 3 Released With GUI Rework and New Features.md +++ b/translated/news/20191226 Darktable 3 Released With GUI Rework and New Features.md @@ -1,20 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Darktable 3 Released With GUI Rework and New Features) [#]: via: (https://itsfoss.com/darktable-3-release/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -Darktable 3 发布,带来重做的 GUI 及新的功能 +Darktable 3 发布,带来重新打造的 UI 及新的功能 ====== -这是给摄影爱好者的圣诞节礼物。Darktable 3.0 刚刚发布了。 +> 这是给摄影爱好者的圣诞节礼物。Darktable 3.0 刚刚发布了。 -[Darktable][1] 是[在 Linux 上编辑 RAW 图像的最佳应用之一] [2]。你可以将其视为 [Adobe Lightroom 的免费开源替代品][3]。 +[Darktable][1] 是[在 Linux 上编辑 RAW 图像的最佳应用之一][2]。你可以将其视为 [Adobe Lightroom 的自由开源替代品][3]。 -Darktable 3 是一个主版本更新,它有许多功能改进和对用户界面的重做。现在,GUI 完全由 GTK+ CSS 规则控制,这使得整个 GUI 都可定制主题。默认它有八个主题。 +Darktable 3 是一个主版本更新,它带来了大量的功能改进和重新打造的用户界面。现在,GUI 完全由 GTK+ CSS 规则所控制,这使得整个 GUI 都可定制主题。它默认有八个主题。 借助 3000 多个提交和 553 个拉取请求,新版本修复了 66 个 bug 并添加了许多新功能。 @@ -26,19 +26,18 @@ Darktable 3 是一个主版本更新,它有许多功能改进和对用户界 以下是重要的新功能: - *重做的 UI -  * 用于处理 3D RGB Lut 变换的新模块 -  * 对“降噪(轮廓化)”模块进行了许多改进 -  * 添加了新的“剔除”模式和时间轴视图 -  * 对“降噪(轮廓化)”模块进行了许多改进 -  * 新色调均衡器的基本和电影 RGB 模块 -  * 更好的 4K/5K 显示支持 -  * 撤消/重做支持更多操作 -  * 针对 CPU 和 SSE 路径的许多代码优化 -  * 支持导出到 Google 相册 -  * 更多的相机支持,白平衡预设和噪点配置 -  * 大量的 bug 修复和功能改进 - +* 重新打造的 UI +* 用于处理 3D RGB Lut 变换的新模块 +* 对“降噪(轮廓化)”模块进行了许多改进 +* 添加了新的“剔除”模式和时间轴视图 +* 对“降噪(轮廓化)”模块进行了许多改进 +* 新色调均衡器的基本和电影 RGB 模块 +* 更好的 4K/5K 显示支持 +* 撤消/重做支持更多操作 +* 针对 CPU 和 SSE 路径的许多代码优化 +* 支持导出到 Google 相册 +* 支持更多的相机,白平衡预设和噪点配置 +* 大量的 bug 修复和功能改进 你可以在 [GitHub 发行说明][5]中了解所有更改。 @@ -48,9 +47,9 @@ Darktable 3 是一个主版本更新,它有许多功能改进和对用户界 #### 在基于 Ubuntu 的发行版上安装 Darktable 3.0 -Ubuntu 仓库中有 Darktable,但你不能得到最新的版本。对于 LTS 版本,它的更新可能需要几个月的时间。 +Ubuntu 仓库中有 Darktable,但你不能得到马上最新的版本。对于 LTS 版本,它的更新可能需要几个月的时间。 -不用担心!Darktable 提供了[自己的 PPA][6],来在基于 Ubuntu 的发行版上安装最新版本。 +不用担心!Darktable 提供了[自己的 PPA][6] 来在基于 Ubuntu 的发行版上安装最新版本。 不幸的是,此 Darktable PPA 尚未随新版本更新。 @@ -84,7 +83,7 @@ sudo add-apt-repository -r ppa:ubuntuhandbook1/darktable 你也可以从 GitHub 发布页面(位于页面底部)下载 tarball 或所有源代码。 -[Download Darktable 3.0][5] +- [下载 Darktable 3.0][5] 使用 Darktable 3,你可以更好地编辑自己的假期照片:) @@ -95,7 +94,7 @@ via: https://itsfoss.com/darktable-3-release/ 作者:[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 5fdaaa1d3fa3a703208db55ac2d262a91ac55f6f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Jan 2020 22:27:42 +0800 Subject: [PATCH 172/430] PUB @geekpi https://linux.cn/article-11741-1.html --- ...6 Darktable 3 Released With GUI Rework and New Features.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20191226 Darktable 3 Released With GUI Rework and New Features.md (98%) diff --git a/translated/news/20191226 Darktable 3 Released With GUI Rework and New Features.md b/published/20191226 Darktable 3 Released With GUI Rework and New Features.md similarity index 98% rename from translated/news/20191226 Darktable 3 Released With GUI Rework and New Features.md rename to published/20191226 Darktable 3 Released With GUI Rework and New Features.md index 3ae5c19e01..b7c6b53cbb 100644 --- a/translated/news/20191226 Darktable 3 Released With GUI Rework and New Features.md +++ b/published/20191226 Darktable 3 Released With GUI Rework and New Features.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11741-1.html) [#]: subject: (Darktable 3 Released With GUI Rework and New Features) [#]: via: (https://itsfoss.com/darktable-3-release/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From b4c1425446b4f16db2531876f3a2168bcad759c4 Mon Sep 17 00:00:00 2001 From: nacyro Date: Thu, 2 Jan 2020 22:33:17 +0800 Subject: [PATCH 173/430] =?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 --- ...icles to enhance your security aptitude.md | 92 ------------------- ...icles to enhance your security aptitude.md | 91 ++++++++++++++++++ 2 files changed, 91 insertions(+), 92 deletions(-) delete mode 100644 sources/tech/20191230 10 articles to enhance your security aptitude.md create mode 100644 translated/tech/20191230 10 articles to enhance your security aptitude.md diff --git a/sources/tech/20191230 10 articles to enhance your security aptitude.md b/sources/tech/20191230 10 articles to enhance your security aptitude.md deleted file mode 100644 index ae6c1a9aaf..0000000000 --- a/sources/tech/20191230 10 articles to enhance your security aptitude.md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (nacyro) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (10 articles to enhance your security aptitude) -[#]: via: (https://opensource.com/article/19/12/security-resources) -[#]: author: (Ben Cotton https://opensource.com/users/bcotton) - -10 articles to enhance your security aptitude -====== -Whether you're learning the first steps or looking to add to your -skills, there's something for you in Opensource.com's top 10 security -articles of 2019. -![A secure lock.][1] - -If security is a process (and it is), then it stands to reason that different projects (and contributors) are in different places. Some applications have years of security testing, with design done by people who have worked in information security for decades. Others are brand new projects by developers working on their first open source project. It comes as no surprise that Opensource.com's top security articles of 2019 represent this range of experience. We have articles that introduce basic security practices as well as deep dives into more advanced topics. - -Whether you're learning the first steps or looking to add to your skills acquired over a storied career, there's something for you in the top 10 security articles of 2019. - -### 7 steps to securing your Linux server - -Security is like a house: if the foundation is bad, the rest is at risk. Patrick H. Mullins' excellent _[7 steps to securing your Linux server][2]_ gets you started with basic security steps for Linux servers. Even if you have a lot of experience administering servers, this article provides a good checklist to make sure you have the basics covered. From there, you can begin adding additional layers of security. - -### Make Linux stronger with firewalls - -One of the seven steps to securing your server is enabling a firewall. But what _is_ a firewall, and how does it work? Seth Kenlon answers these questions and then describes in detail how to configure your firewall for better security in _[Make Linux stronger with firewalls][3]_. Using firewalld and Network Manager, you can set different firewall configurations for different networks. This allows you to have a trusting configuration on your home network, for example, and a more paranoid configuration on your favorite coffee shop's WiFi network. - -### Reducing security risks with centralized logging - -Once you've secured your system, you're not done: security is a process, not a state. Part of _keeping_ systems secure is keeping an eye on what goes on. One way to do that, especially with multiple systems, is to centralize your logging. In _[Reducing security risks with centralized logging][4]_, Hannah Suarez shares how to get started (she based this article on her lightning talk at FOSDEM '19). - -### Using GPG keys for SSH - -Most people who use key-based authentication for SSH use SSH keys. And why wouldn't you? It's right there in the name. These are perfectly fine from a security standpoint, but if you want to make some forms of key distribution and backup easier, there's another way. Brian Exelbierd's three-part series walks through _[How to enable SSH access with a GPG subkey][5]_, _[How to import existing SSH keys][6]_, and _[How to reduce your backup needs to a single key file][7]_. - -### Graphically manage SSH keys with Seahorse - -Using GPG for SSH keys isn't everyone's cup of tea, but that doesn't mean you're out of luck when it comes to key management. Seahorse is a graphical tool for managing SSH keys (and other authentication methods) that is included in the GNOME desktop. Alan Formy-Duval's [_Graphically manage SSH keys with Seahorse_][8], is particularly helpful to the novice user. - -### Security scanning your DevOps pipeline - -Containers are everywhere these days. But what's in them? Knowing that containers meet your security policies is an important part of staying secure. Fortunately, you can use open source tools to help automate compliance checking. Jessica Cherry's (formly Repka) [_Security scanning your DevOps pipeline_][9] is a step-by-step tutorial that shows you how to use the Jenkins build system and the Anchore inspection service to create a scanning pipeline for container images and registries. - -### 4 open source cloud security tools - -One of the great things about cloud services is that your data can be accessed from anywhere. One of the downsides to cloud services is that your data can be accessed from anywhere. If you're using "-as-a-Service" offerings, you want to make sure they're securely configured. Anderson Silva, Alison Naylor, Travis McPeak, and Rich Monk join forces to introduce [_4 open source cloud security tools_][10] to help improve security when using GitHub and AWS. If you're looking for accidentally committed secrets—or trying to prevent them from being committed in the first place—this article has tools you can use. - -### How to use OpenSSL: hashes, digital signatures, and more - -Much of information security is based on math: specifically, the cryptographic functions used to encrypt data and authenticate users or file contents. After providing an introduction in [_Getting started with OpenSSL: Cryptography basics_][11], Marty Kalin digs deeper into the details of _[How to use OpenSSL: Hashes, digital signatures, and more][12]_, explaining how to use the OpenSSL utility to explore these commonly used but uncommonly understood concepts. - -### Learn about computer security with the Raspberry Pi and Kali Linux - -Cheap hardware and open source software make a great combination, especially for people looking to learn by doing. In this article, Anderson Silva introduces the security-oriented Kali Linux distribution in _[Learn about computer security with the Raspberry Pi and Kali Linux][13]_. It's a short article, but it's full of useful links to documentation and security-related projects that you can use with your own Raspberry Pi. - -### Will quantum computing break security? - -Has the rest of this article been a waste? Will quantum computing render everything we know about security obsolete? The good news is that the answer is "no," but quantum computing can still have a profound impact on security and the computing world more broadly. In _[Will quantum computing break security?][14]_ Mike Bursell examines its potential impacts—both the good news and the bad. And of course, quantum computing may make it easier to break encryption, but that doesn't matter if the baddies can't get your data in the first place. - -### Looking to 2020 - -Security will always be important, and (as the quantum computing article suggests) the next few years will be an interesting time in the field. In 2020, Opensource.com articles will look at the leading edge of open source security and help explain the basics to the ever-growing open source community. If you have a topic you want us to cover, please share it in the comments, or—better yet— if you have an article in mind, [write for us][15]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/security-resources - -作者:[Ben Cotton][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/bcotton -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_security_cc.png?itok=3V07Lpko (A secure lock.) -[2]: https://opensource.com/article/19/10/linux-server-security -[3]: https://opensource.com/article/19/7/make-linux-stronger-firewalls -[4]: https://opensource.com/article/19/2/reducing-security-risks-centralized-logging -[5]: https://opensource.com/article/19/4/gpg-subkeys-ssh -[6]: https://opensource.com/article/19/4/gpg-subkeys-ssh-multiples -[7]: https://opensource.com/article/19/4/gpg-subkeys-ssh-manage -[8]: https://opensource.com/article/19/4/ssh-keys-seahorse -[9]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline -[10]: https://opensource.com/article/19/9/open-source-cloud-security -[11]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1 -[12]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-2 -[13]: https://opensource.com/article/19/3/computer-security-raspberry-pi -[14]: https://opensource.com/article/19/1/will-quantum-computing-break-security -[15]: https://opensource.com/how-submit-article diff --git a/translated/tech/20191230 10 articles to enhance your security aptitude.md b/translated/tech/20191230 10 articles to enhance your security aptitude.md new file mode 100644 index 0000000000..3a86ffc6a0 --- /dev/null +++ b/translated/tech/20191230 10 articles to enhance your security aptitude.md @@ -0,0 +1,91 @@ +[#]: collector: "lujun9972" +[#]: translator: "nacyro" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "10 articles to enhance your security aptitude" +[#]: via: "https://opensource.com/article/19/12/security-resources" +[#]: author: "Ben Cotton https://opensource.com/users/bcotton" + +10 篇文章强化你的安全能力 +====== +无论你是新手还是想要增加技能,Opensource.com 2019 年十大安全文章中都有适合你的内容。 + +![A secure lock.][1] + +如果安全是一个过程(确实如此),那么理所当然的,不同的项目(及其贡献者)情况各有不同。有些应用程序经历了多年的安全测试,由在信息安全领域工作了几十年的人员所设计。其他的则是由开发人员在他们的第一个开源项目中开发的全新项目。毫不奇怪,Opensource.com 2019 年十大安全文章囊括了代表这一范围的经验。我们有介绍基本安全实践的文章,也有深入探讨更高级主题的文章。 + +无论你是新手还是想要增加你在传奇职业生涯中获得的技能,2019 年十大安全文章中都有适合你的内容。 + +### 《七步捍卫你的 Linux 服务器(7 steps to securing your Linux server)》 + +安全如舍,地基不牢,房屋不稳。Patrick H. Mullins 的杰作《[七步捍卫你的 Linux 服务器(7 steps to securing your Linux server)][2]》让您从Linux服务器的基本安全步骤开始。即使您有很多管理服务器的经验,本文也提供了一个很好的清单以确保您掌握了基础知识。在此基础上,您可以开始添加额外的安全层。 + +### 《用防火墙使 Linux 更健壮(Make Linux stronger with firewalls)》 + +七步捍卫你的 Linux 服务器中的一步即是启用防火墙。但什么**是**防火墙,它是如何工作的呢? Seth Kenlon 在《[用防火墙使 Linux 更健壮(Make Linux stronger with firewalls)][3]》一文中回答了这些问题,然后详细描述了为了更好的安全性应如何配置你的防火墙。使用 `firewalld` 与 `Network Manager`,您可以为不同的网络设置不同的防火墙配置。例如,这允许您在您的家庭网络上进行信任配置,并在您最喜欢的咖啡店的 WiFi 网络上进行更多疑的配置。 + +### 《减少集中日志的安全风险(Reducing security risks with centralized logging)》 + +保护系统安全,只有开始,没有结束:安全是一个过程而不是状态。**保持**系统安全工作的一部分即是密切关注所发生的事情。集中化日志是实现这一点的一种方法,尤其是在管理多系统时。在《[减少集中日志的安全风险(Reducing security risks with centralized logging)][4]》中 Hannah Suarez 分享了要如何开始(她这篇文章基于她在 FOSDEM'19 (自由及开源软件开发者欧洲会议) 中的闪电演讲) + +### 《为 SSH 使用 GPG 密钥(Using GPG keys for SSH)》 + +大多数人都会为 `SSH` 的密钥认证使用 `SSH 密钥`。为什么不呢?毕竟就在名字里。从安全的角度来看,这些方法非常好。但若想简化某些形式的密钥分发与备份还有另一种方法,Brian Exelbierd 的三部曲系列介绍了《[如何启用使用 GPG 子钥的 SSH 访问(How to enable SSH access with a GPG subkey)][5]》、《[如何导入现有 SSH 密钥(How to import existing SSH keys)][6]》、《[如何将备份量减少到单个密钥文件(How to reduce your backup needs to a single key file)][7]》 + +### 《使用 `Seahorse` 图形化管理 SSH 密钥(Graphically manage SSH keys with Seahorse)》 + +并不是所有人都喜欢用 `GPG` 作为 `SSH 密钥`,但这并不意味着您在密钥管理上会不顺。`Seahorse` 是一个在 `GNOME` 桌面中用于管理 `SSH 密钥` 及其他身份验证方法的图形化工具。Alan Formy-Duval 的《[使用 `Seahorse` 图形化管理 SSH 密钥(Graphically manage SSH keys with Seahorse)][8]》对新手用户特别有帮助。 + +### 《安全扫描你的 DevOps 管线(Security scanning your DevOps pipeline)》 + +如今到处都是容器。但它们容纳着什么?了解容器满足您的安全策略是保持安全性的重要部分。幸运的是,您可以使用开源工具来帮助自动化符合性检查。Jessica Cherry (原名: Repka) 的《[安全扫描你的 DevOps 管线(Security scanning your DevOps pipeline)][9]》是一个循序渐进的教程,向您展示了如何使用 `Jenkins` 构建系统和 `Anchore` 检查服务为容器镜像和 `registries` 创建扫描管线。 + +### 《四个开源云安全工具(4 open source cloud security tools)》 + +云服务的一大优点是你的数据可以从任何地方访问。云服务的一个缺点是你的数据可以从任何地方访问。如果您使用的是 `"-as-a-Service" (译注: IaaS, PaaS, SaaS)` 产品,那么您需要确保它们是经过安全配置的。Anderson Silva、Alison Naylor、Travis McPeak 和 Rich Monk 联合推出《[四个开源云安全工具(4 open source cloud security tools)][10]》以帮助在使用 `GitHub` 和 `AWS` 时提高安全性。如果你正在寻找被不小心提交的秘密,或尝试从一开始就阻止这些秘密被提交,这篇文章提供了工具。 + +### 《如何使用OpenSSL:哈希,数字签名,等等(How to use OpenSSL: hashes, digital signatures, and more)》 + +许多信息安全是基于数学的:特别是用于加密数据和验证用户或文件内容的加密函数。在《[开始使用 OpenSSL:密码学基础(Getting started with OpenSSL: Cryptography basics)][11]》中进行介绍后,Marty Kalin 深入讨论了《[如何使用 OpenSSL:哈希,数字签名,等等(How to use OpenSSL: hashes, digital signatures, and more)][12]》的细节,解释了如何使用 `OpenSSL` 实用程序来探索这些常用但不常被理解的概念。 + +### 《使用树莓派和 Kali Linux 学习计算机安全(Learn about computer security with the Raspberry Pi and Kali Linux)》 + +廉价硬件与开源软件构成了一个很好的组合,特别是对于那些希望边做边学的人来说。在《[使用树莓派和 Kali Linux 学习计算机安全(Learn about computer security with the Raspberry Pi and Kali Linux)][13]》这篇文章中,Anderson Silva 介绍了面向安全的 `Kali Linux` 发行版。这是一篇短文,但它满是关于文档和安全相关项目的有用的链接,您可以在自己的树莓派上使用它们。 + +### 《量子计算会破坏安全吗?(Will quantum computing break security?)》 + +这篇文章的余下部分是浪费吗?量子计算会让我们对安全的所知变得过时吗?好消息是:回答是否定的,但是量子计算仍然可以在更广泛的范围内对安全和计算世界产生深远的影响。在《[量子计算会破坏安全吗?(Will quantum computing break security?)][14]》一文中,Mike Bursell 剖析了它好坏两方面的影响,当然,量子计算可能会让加密的破解变得更容易,但如果坏人一开始就无法获得你的数据,那也没有关系。 + +### 《展望 2020(Looking to 2020)》 + +安全永远是重要的,(正如那篇量子计算文章所建议的) 未来几年将是该领域的一个有趣时期。在 2020 年,Opensource.com 的文章将着眼于开源安全的前沿,并帮助向不断增长的开源社区解释基础知识。如果你有一个你想要我们报导的主题,请在评论中分享它,或者更进一步 —— 如果你想写一篇文章,就写给我们吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/security-resources + +作者:[Ben Cotton][a] +选题:[lujun9972][b] +译者:[nacyro](https://github.com/nacyro) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bcotton +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_security_cc.png?itok=3V07Lpko "A secure lock." +[2]: https://opensource.com/article/19/10/linux-server-security +[3]: https://opensource.com/article/19/7/make-linux-stronger-firewalls +[4]: https://opensource.com/article/19/2/reducing-security-risks-centralized-logging +[5]: https://opensource.com/article/19/4/gpg-subkeys-ssh +[6]: https://opensource.com/article/19/4/gpg-subkeys-ssh-multiples +[7]: https://opensource.com/article/19/4/gpg-subkeys-ssh-manage +[8]: https://opensource.com/article/19/4/ssh-keys-seahorse +[9]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline +[10]: https://opensource.com/article/19/9/open-source-cloud-security +[11]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1 +[12]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-2 +[13]: https://opensource.com/article/19/3/computer-security-raspberry-pi +[14]: https://opensource.com/article/19/1/will-quantum-computing-break-security +[15]: https://opensource.com/how-submit-article From 604cb2366eecb2b1a284bf16ce9cdae63fef29b7 Mon Sep 17 00:00:00 2001 From: nacyro Date: Thu, 2 Jan 2020 22:59:14 +0800 Subject: [PATCH 174/430] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...101 9 cheat sheets and guides to enhance your tech skills.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md b/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md index fb9d954ab5..7e9e984b63 100644 --- a/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md +++ b/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (nacyro) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 243e8f0246e21f8fa22a0f64b4bad49743ab5a2c Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Thu, 2 Jan 2020 23:31:04 +0800 Subject: [PATCH 175/430] translated --- ...1017 Intro to the Linux useradd command.md | 131 ++++++++---------- 1 file changed, 58 insertions(+), 73 deletions(-) diff --git a/translated/tech/20191017 Intro to the Linux useradd command.md b/translated/tech/20191017 Intro to the Linux useradd command.md index ab23c72db5..ffebd61d47 100644 --- a/translated/tech/20191017 Intro to the Linux useradd command.md +++ b/translated/tech/20191017 Intro to the Linux useradd command.md @@ -7,59 +7,55 @@ [#]: via: (https://opensource.com/article/19/10/linux-useradd-command) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) -Intro to the Linux useradd command +Linux useradd 命令介绍 ====== -Add users (and customize their accounts as needed) with the useradd -command. +使用 useradd 命令来添加用户(并且根据需要修改账号)。 ![people in different locations who are part of the same team][1] -Adding a user is one of the most fundamental exercises on any computer system; this article focuses on how to do it on a Linux system. +任何计算机系统中,添加用户都是最重要的事之一;本文着重介绍如何在 Linux 系统中添加用户。 -Before getting started, I want to mention three fundamentals to keep in mind. First, like with most operating systems, Linux users need an account to be able to log in. This article specifically covers local accounts, not network accounts such as LDAP. Second, accounts have both a name (called a username) and a number (called a user ID). Third, users are typically placed into a group. Groups also have a name and group ID. - -As you'd expect, Linux includes a command-line utility for adding users; it's called **useradd**. You may also find the command **adduser**. Many distributions have added this symbolic link to the **useradd** command as a matter of convenience. +正式开始之前,我先提三个概念。首先,跟大多数操作系统一样,Linux 用户也需要一个账号才能登录。本文只介绍本地账号,不涉及网络账号,如 LDAP。其次,每个账号都有一个名字(username)和一个对应的数字(用户 ID)。最后,每个用户通常都在一个组内,每个组都有一个名字和一个组 ID。 +你可能已经想到了,Linux 提供了添加用户的命令行工具,就是 `useradd` 命令。有些版本也叫 `adduser`。为了方便使用,很多发行版上这个命令是一个指向 `useradd` 命令的符号链接。 ``` $ file `which adduser` /usr/sbin/adduser: symbolic link to useradd ``` -Let's take a look at **useradd**. +来看一下 `useradd`。 -> Note: The defaults described in this article reflect those in Red Hat Enterprise Linux 8.0. You may find subtle differences in these files and certain defaults on other Linux distributions or other Unix operating systems such as FreeBSD or Solaris. +> 注意:本文描述的默认环境是 Red Hat Enterprise Linux 8.0。你可能会发现本文描述的这些文件和某些默认值与某些 Linux 发行版或其他 Unix 操作系统(FreeBSD 或 Solaris)偶尔会有差异。 -### Default behavior +### 默认处理 -The basic usage of **useradd** is quite simple: A user can be added just by providing their username. +`useradd` 的基本用法相当简单:通过一个用户名就可以添加一个用户 - -``` -`$ sudo useradd sonny` +```bash +$ sudo useradd sonny ``` -In this example, the **useradd** command creates an account called _sonny_. A group with the same name is also created, and _sonny_ is placed in it to be used as the primary group. There are other parameters, such as language and shell, that are applied according to defaults and values set in the configuration files **/etc/default/useradd** and **/etc/login.defs**. This is generally sufficient for a single, personal system or a small, one-server business environment. +在本例中,`useradd` 命令创建了一个名为 *sonny* 的账号。此命令同时创建了一个同名的组,*sonny* 被放进了这个组,这个组也是 *sonny* 账号的主组。命令执行时,根据配置文件 `/etc/default/useradd` 和 `/etc/login.defs` 中的不同设置,也会有其他的参数处理,如语言和 shell。对于一个私人系统或微小的单服务商业环境,这些参数已经足够了。 -While the two files above govern the behavior of **useradd**, user information is stored in other files found in the **/etc** directory, which I will refer to throughout this article. +上面两个文件控制 `useradd` 的处理,用户的信息保存在 `/etc` 目录下的一些其他文件中,关于这些信息的讲解会贯穿全文。 -File | Description | Fields (bold—set by useradd) ----|---|--- -passwd | Stores user account details | **username**:unused:**uid**:**gid**:**comment**:**homedir**:**shell** -shadow | Stores user account security details | **username**:password:lastchange:minimum:maximum:warn:**inactive**:**expire**:unused -group | Stores group details | **groupname**:unused:**gid**:**members** +| 文件 | 描述 | 域 (加粗的表示由 useradd 命令设置) | +| ------ | ------------------------------------ | ------------------------------------------------------------ | +| passwd | Stores user account details | **username**:unused:**uid**:**gid**:**comment**:**homedir**:**shell** | +| shadow | Stores user account security details | **username**:password:lastchange:minimum:maximum:warn:**inactive**:**expire**:unused | +| group | Stores group details | **groupname**:unused:**gid**:**members** | -### Customizable behavior +### 自定义处理 -The command line allows customization for times when an administrator needs finer control, such as to specify a user's ID number. +当管理员需要更好地控制账号时,可以使用命令行来自定义,如指定一个用户的 ID。 -#### User and group ID numbers +#### 用户和组 ID -By default, **useradd** tries to use the same number for the user ID (UID) and primary group ID (GID), but there are no guarantees. Although it's not necessary for the UID and GID to match, it's easier for administrators to manage them when they do. +`useradd` 默认主组 ID(GID)与用户 ID(UID)相同,但也不完全是。虽然 UID 与 GID 相同不是必须的,但如果相同,会更方便管理员管理。 -I have just the scenario to explain. Suppose I add another account, this time for Timmy. Comparing the two users, _sonny_ and _timmy_, shows that both users and their respective primary groups were created by using the **getent** command. +下面的场景就是一个 GID 与 UID 不同的 例子。现在我添加另一账号,名为 Timmy。通过使用 `getent` 命令来比较 *sonny* 和 *timmy* 两个账号,显示两个用户和对应的主组。 - -``` +```bash $ getent passwd sonny timmy sonny❌1001:1002:Sonny:/home/sonny:/bin/bash timmy❌1002:1003::/home/timmy:/bin/bash @@ -69,18 +65,16 @@ sonny❌1002: timmy❌1003: ``` -Unfortunately, neither users' UID nor primary GID match. This is because the default behavior is to assign the next available UID to the user and then attempt to assign the same number to the primary group. However, if that number is already used, the next available GID is assigned to the group. To explain what happened, I hypothesize that a group with GID 1001 already exists and enter a command to confirm. +不幸的是,两者的 UID 和 GID 都不相同。因为默认的处理是,创建用户时,把下一个可用的 UID 赋给用户,然后把同一个数字作为主组 ID 赋给它。然而,当要使用的 ID 已经被使用时,就再把下一个可用的 GID 赋给它。为了弄清细节,我猜想 1001 这个 GID 已经被使用了,用一个命令确认了一下。 - -``` +```bash $ getent group 1001 book❌1001:alan ``` -The group _book_ with the ID _1001_ has caused the GIDs to be off by one. This is an example where a system administrator would need to take more control of the user-creation process. To resolve this issue, I must first determine the next available user and group ID that will match. The commands **getent group** and **getent passwd** will be helpful in determining the next available number. This number can be passed with the **-u** argument. +*book* 的 ID 是 *1001*,因此新创建的用户的 GID 都有偏移量 1。这就是为什么系统管理员在用户创建过程中需要多设置一些值的一个实例。为了解决这个问题,我必须先确定下一个可用的 UID 和 GID 是否相同。确定下一个可用值时,可以使用 `getent group` 和 `getent passwd` 命令,通过 `-u` 参数传递要确认的值。 - -``` +```bash $ sudo useradd -u 1004 bobby $ getent passwd bobby; getent group bobby @@ -88,64 +82,59 @@ bobby❌1004:1004::/home/bobby:/bin/bash bobby❌1004: ``` -Another good reason to specify the ID is for users that will be accessing files on a remote system using the Network File System (NFS). NFS is easier to administer when all client and server systems have the same ID configured for a given user. I cover this in a bit more detail in my article on [using autofs to mount NFS shares][2]. +另一个需要指定 ID 的场景是,通过 NFS 访问远程系统上的文件时。对于一个给定的用户,当 NFS 所有客户端和服务系统的 ID 都一样时,管理员更容易控制。在我的文章 [使用 autofs 挂载 NFS][2] 中有详细介绍。 -### More customization +### 更多自定义 -Very often though, other account parameters need to be specified for a user. Here are brief examples of the most common customizations you may need to use. +一些其他的指定用户信息的参数也用得比较频繁。这里是一些你会经常用到的参数的概括例子。 -#### Comment +#### 注释 -The comment option is a plain-text field for providing a short description or other information using the **-c** argument. +注释选项是通过 `-c` 参数指定的一个解释文本字段,可以提供一段简短的描述或其他信息。 - -``` +```bash $ sudo useradd -c "Bailey is cool" bailey $ getent passwd bailey bailey❌1011:1011:Bailey is cool:/home/bailey:/bin/bash ``` -#### Groups +#### 组 -A user can be assigned one primary group and multiple secondary groups. The **-g** argument specifies the name or GID of the primary group. If it's not specified, **useradd** creates a primary group with the user's same name (as demonstrated above). The **-G** (uppercase) argument is used to pass a comma-separated list of groups that the user will be placed into; these are known as secondary groups. +一个用户可以被指定一个主组和多个次组。 `-g` 参数指定主组名称或 GID。如果不指定,`useradd` 会以用户名创建一个主组(前面演示过)。`-G`(大写)参数用一个逗号分隔的组列表来指定此用户所属的组,这些组就是次组。 - -``` +```bash $ sudo useradd -G tgroup,fgroup,libvirt milly $ id milly uid=1012(milly) gid=1012(milly) groups=1012(milly),981(libvirt),4000(fgroup),3000(tgroup) ``` -#### Home directory +#### 家目录 -The default behavior of **useradd** is to create the user's home directory in **/home**. However, different aspects of the home directory can be overridden with the following arguments. The **-b** sets another directory where user homes can be placed. For example, **/home2** instead of the default **/home**. +`useradd` 的默认处理是,在 `/home` 目录下创建用户的家目录。然而,下面的参数可以改写家目录的 base 目录。`-b` 设置另一个可以创建家目录的 base 目录。例如 指定 `/home2` 而不是 `/home`。 - -``` +```bash $ sudo useradd -b /home2 vicky $ getent passwd vicky vicky❌1013:1013::/home2/vicky:/bin/bash ``` -The **-d** lets you specify a home directory with a different name from the user. +`-d` 参数可以指定一个与用户名不同的家目录。 - -``` +```bash $ sudo useradd -d /home/ben jerry $ getent passwd jerry jerry❌1014:1014::/home/ben:/bin/bash ``` -#### The skeleton directory +#### skeleton 目录 -The **-k** instructs the new user's new home directory to be populated with any files in the **/etc/skel** directory. These are usually shell configuration files, but they can be anything that a system administrator would like to make available to all new users. +`-k` 参数指定创建新用户时,会复制 `/etc/skel` 目录下的所有文件到家目录中。这些文件通常是 shell 配置文件,当然也可以是系统管理员想在新建用户时使用的任何文件。 #### Shell -The **-s** argument can be used to specify the shell. The default is used if nothing else is specified. For example, in the following, shell **bash** is defined in the default configuration file, but Wally has requested **zsh**. +`-s` 参数可以指定 shell。如果不指定,则使用默认的 shell。例如,下面的例子中 ,配置文件中定义的 shell 是 `bash`,但 `Wally` 这个用户指定的是 `zsh`。 - -``` +```bash $ grep SHELL /etc/default/useradd SHELL=/bin/bash @@ -154,42 +143,38 @@ $ getent passwd wally wally❌1004:1004::/home/wally:/usr/bin/zsh ``` -#### Security +#### 安全 -Security is an essential part of user management, so there are several options available with the **useradd** command. A user account can be given an expiration date, in the form YYYY-MM-DD, using the **-e** argument. +安全是用户管理的重中之重,因此 `useradd` 命令也提供了很多关于安全的选项。可以使用 `-e` 参数,以 YYYY-MM-DD 的格式指定一个用户的过期时间。 - -``` +```bash $ sudo useradd -e 20191231 sammy $ sudo getent shadow sammy sammy:!!:18171:0:99999:7::20191231: ``` -An account can also be disabled automatically if the password expires. The **-f** argument will set the number of days after the password expires before the account is disabled. Zero is immediate. +当密码过期时,一个账号也可以自动失效。`-f` 参数指定密码过期后经过几天账号失效。如果设为 0,则立即失效。 - -``` +```bash $ sudo useradd -f 30 willy $ sudo getent shadow willy willy:!!:18171:0:99999:7:30:: ``` -### A real-world example +### 实例 -In practice, several of these arguments may be used when creating a new user account. For example, if I need to create an account for Perry, I might use the following command: +生产中,创建一个用户账号时会用到多个参数。例如,我要创建一个 Perry 账号,可能会用下面的命令: - -``` +```bash $ sudo useradd -u 1020 -c "Perry Example" \ -G tgroup -b /home2 \ -s /usr/bin/zsh \ -e 20201201 -f 5 perry ``` -Refer to the sections above to understand each option. Verify the results with: +查看前面的内容来理解每个选项。用下面的命令确认结果: - -``` +```bash $ getent passwd perry; getent group perry; getent shadow perry; id perry perry❌1020:1020:Perry Example:/home2/perry:/usr/bin/zsh perry❌1020: @@ -197,9 +182,9 @@ perry:!!:18171:0:99999:7:5:20201201: uid=1020(perry) gid=1020(perry) groups=1020(perry),3000(tgroup) ``` -### Some final advice +### 一点小建议 -The **useradd** command is a "must-know" for any Unix (not just Linux) administrator. It is important to understand all of its options since user creation is something that you want to get right the first time. This means having a well-thought-out naming convention that includes a dedicated UID/GID range reserved for your users across your enterprise, not just on a single system—particularly when you're working in a growing organization. +`useradd` 命令是所有 Unix(不仅仅是 Linux)系统管理员都必知必会的命令。由于用户创建不能出错,需要第一次就正确,所以理解它的每一个选项很重要。这意味着你需要有一套深思熟虑的命名约定,包括为整个企业环境而不仅仅是一个单系统预留一个专用的 UID/GID 范围,尤其是你为一个成长中的组织工作时。 -------------------------------------------------------------------------------- From a067016b3d77e9bfdace19660e58e95989f8bdf1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Jan 2020 00:45:18 +0800 Subject: [PATCH 176/430] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @nacyro 恭喜你完成了第一篇翻译! --- ...icles to enhance your security aptitude.md | 65 ++++++++++--------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/translated/tech/20191230 10 articles to enhance your security aptitude.md b/translated/tech/20191230 10 articles to enhance your security aptitude.md index 3a86ffc6a0..bd488182d4 100644 --- a/translated/tech/20191230 10 articles to enhance your security aptitude.md +++ b/translated/tech/20191230 10 articles to enhance your security aptitude.md @@ -1,65 +1,66 @@ [#]: collector: "lujun9972" [#]: translator: "nacyro" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "10 articles to enhance your security aptitude" [#]: via: "https://opensource.com/article/19/12/security-resources" [#]: author: "Ben Cotton https://opensource.com/users/bcotton" -10 篇文章强化你的安全能力 +10 篇强化你的安全能力的文章 ====== -无论你是新手还是想要增加技能,Opensource.com 2019 年十大安全文章中都有适合你的内容。 -![A secure lock.][1] +> 无论你是新手还是想要增加技能,这十篇安全文章中都有适合你的内容。 -如果安全是一个过程(确实如此),那么理所当然的,不同的项目(及其贡献者)情况各有不同。有些应用程序经历了多年的安全测试,由在信息安全领域工作了几十年的人员所设计。其他的则是由开发人员在他们的第一个开源项目中开发的全新项目。毫不奇怪,Opensource.com 2019 年十大安全文章囊括了代表这一范围的经验。我们有介绍基本安全实践的文章,也有深入探讨更高级主题的文章。 +![](https://img.linux.net.cn/data/attachment/album/202001/03/004344rco51cnc153ns1zz.jpg) + +如果安全是一个过程(确实如此),那么理所当然的,不同的项目(及其贡献者)的情况各有不同。有些应用程序经历了多年的安全测试,由在信息安全领域工作了几十年的人员所设计。而另外一些则是由开发人员在他们的第一个开源项目中开发的全新项目。毫不奇怪,这十大安全文章囊括了代表这一范围的经验。我们有介绍基本安全实践的文章,也有深入探讨更高级主题的文章。 无论你是新手还是想要增加你在传奇职业生涯中获得的技能,2019 年十大安全文章中都有适合你的内容。 -### 《七步捍卫你的 Linux 服务器(7 steps to securing your Linux server)》 +### 《安全强化你的 Linux 服务器的七个步骤》 -安全如舍,地基不牢,房屋不稳。Patrick H. Mullins 的杰作《[七步捍卫你的 Linux 服务器(7 steps to securing your Linux server)][2]》让您从Linux服务器的基本安全步骤开始。即使您有很多管理服务器的经验,本文也提供了一个很好的清单以确保您掌握了基础知识。在此基础上,您可以开始添加额外的安全层。 +安全如舍,地基不牢,房屋不稳。Patrick H. Mullins 的杰作《[安全强化你的 Linux 服务器的七个步骤][2]》让你从 Linux 服务器的基本安全步骤开始。即使你有很多管理服务器的经验,本文也提供了一个很好的清单以确保你掌握了基础知识。在此基础上,你可以开始添加额外的安全层。 -### 《用防火墙使 Linux 更健壮(Make Linux stronger with firewalls)》 +### 《使用防火墙让你的 Linux 更加强大》 -七步捍卫你的 Linux 服务器中的一步即是启用防火墙。但什么**是**防火墙,它是如何工作的呢? Seth Kenlon 在《[用防火墙使 Linux 更健壮(Make Linux stronger with firewalls)][3]》一文中回答了这些问题,然后详细描述了为了更好的安全性应如何配置你的防火墙。使用 `firewalld` 与 `Network Manager`,您可以为不同的网络设置不同的防火墙配置。例如,这允许您在您的家庭网络上进行信任配置,并在您最喜欢的咖啡店的 WiFi 网络上进行更多疑的配置。 +七步捍卫你的 Linux 服务器中的一步即是启用防火墙。但什么**是**防火墙,它是如何工作的呢? Seth Kenlon 在《[使用防火墙让你的 Linux 更加强大][3]》一文中回答了这些问题,然后详细描述了为了更好的安全性应如何配置你的防火墙。使用 firewalld 与 Network Manager,你可以为不同的网络设置不同的防火墙配置。例如,这允许你在家庭网络上进行信任配置,并在你最喜欢的咖啡店的 WiFi 网络上进行更多疑的配置。 -### 《减少集中日志的安全风险(Reducing security risks with centralized logging)》 +### 《用集中日志减少安全风险》 -保护系统安全,只有开始,没有结束:安全是一个过程而不是状态。**保持**系统安全工作的一部分即是密切关注所发生的事情。集中化日志是实现这一点的一种方法,尤其是在管理多系统时。在《[减少集中日志的安全风险(Reducing security risks with centralized logging)][4]》中 Hannah Suarez 分享了要如何开始(她这篇文章基于她在 FOSDEM'19 (自由及开源软件开发者欧洲会议) 中的闪电演讲) +保护系统安全,只有开始,没有结束:安全是一个过程而不是状态。**保持**系统安全工作的一部分即是密切关注所发生的事情。集中化日志是实现这一点的一种方法,尤其是在管理多系统时。在《[减少集中日志的安全风险][4]》中 Hannah Suarez 分享了要如何开始(她这篇文章基于她在 FOSDEM'19 [自由及开源软件开发者欧洲会议] 中的闪电演讲)。 -### 《为 SSH 使用 GPG 密钥(Using GPG keys for SSH)》 +### 《在 SSH 中使用 GPG 密钥》 -大多数人都会为 `SSH` 的密钥认证使用 `SSH 密钥`。为什么不呢?毕竟就在名字里。从安全的角度来看,这些方法非常好。但若想简化某些形式的密钥分发与备份还有另一种方法,Brian Exelbierd 的三部曲系列介绍了《[如何启用使用 GPG 子钥的 SSH 访问(How to enable SSH access with a GPG subkey)][5]》、《[如何导入现有 SSH 密钥(How to import existing SSH keys)][6]》、《[如何将备份量减少到单个密钥文件(How to reduce your backup needs to a single key file)][7]》 +大多数人都会为 SSH 的密钥认证使用 SSH 密钥。为什么不呢?毕竟 SSH 就在名字里。从安全的角度来看,这些方法非常好。但若想简化某些形式的密钥分发与备份还有另一种方法,Brian Exelbierd 的三部曲系列介绍了《[如何启用使用 GPG 子钥的 SSH 访问][5]》、《[如何导入现有 SSH 密钥][6]》、《[如何将备份量减少到单个密钥文件][7]》 -### 《使用 `Seahorse` 图形化管理 SSH 密钥(Graphically manage SSH keys with Seahorse)》 +### 《使用 Seahorse 图形化管理 SSH 密钥》 -并不是所有人都喜欢用 `GPG` 作为 `SSH 密钥`,但这并不意味着您在密钥管理上会不顺。`Seahorse` 是一个在 `GNOME` 桌面中用于管理 `SSH 密钥` 及其他身份验证方法的图形化工具。Alan Formy-Duval 的《[使用 `Seahorse` 图形化管理 SSH 密钥(Graphically manage SSH keys with Seahorse)][8]》对新手用户特别有帮助。 +并不是所有人都喜欢用 GPG 作为 SSH 密钥,但这并不意味着你在密钥管理上会不顺利。Seahorse 是一个在 GNOME 桌面中用于管理 SSH 密钥及其他身份验证方法的图形化工具。Alan Formy-Duval 的《[使用 Seahorse 图形化管理 SSH 密钥》对新手用户特别有帮助。 -### 《安全扫描你的 DevOps 管线(Security scanning your DevOps pipeline)》 +### 《安全扫描你的 DevOps 流程》 -如今到处都是容器。但它们容纳着什么?了解容器满足您的安全策略是保持安全性的重要部分。幸运的是,您可以使用开源工具来帮助自动化符合性检查。Jessica Cherry (原名: Repka) 的《[安全扫描你的 DevOps 管线(Security scanning your DevOps pipeline)][9]》是一个循序渐进的教程,向您展示了如何使用 `Jenkins` 构建系统和 `Anchore` 检查服务为容器镜像和 `registries` 创建扫描管线。 +如今到处都是容器。但它们容纳着什么?了解容器满足你的安全策略是保持安全性的重要部分。幸运的是,你可以使用开源工具来帮助自动化合规检查。Jessica Cherry(原名: Repka)的《[安全扫描你的 DevOps 流程][9]》是一个循序渐进的教程,向你展示了如何使用 Jenkins 构建系统和 Anchore 检查服务为容器镜像和注册库创建扫描流程。 -### 《四个开源云安全工具(4 open source cloud security tools)》 +### 《4 种开源云安全工具》 -云服务的一大优点是你的数据可以从任何地方访问。云服务的一个缺点是你的数据可以从任何地方访问。如果您使用的是 `"-as-a-Service" (译注: IaaS, PaaS, SaaS)` 产品,那么您需要确保它们是经过安全配置的。Anderson Silva、Alison Naylor、Travis McPeak 和 Rich Monk 联合推出《[四个开源云安全工具(4 open source cloud security tools)][10]》以帮助在使用 `GitHub` 和 `AWS` 时提高安全性。如果你正在寻找被不小心提交的秘密,或尝试从一开始就阻止这些秘密被提交,这篇文章提供了工具。 +云服务的一大优点是你的数据可以从任何地方访问。云服务的一个缺点是你的数据可以从任何地方访问。如果你使用的是 “-as-a-Service”(LCTT 译注: 某某即服务,如 IaaS、PaaS、Saa)产品,那么你需要确保它们是经过安全配置的。Anderson Silva、Alison Naylor、Travis McPeak 和 Rich Monk 联合推出《[4 种开源云安全工具][10]》以帮助在使用 GitHub 和 AWS 时提高安全性。如果你正在寻找被不小心提交的机密信息,或尝试从一开始就阻止这些机密信息被提交,这篇文章提供了工具。 -### 《如何使用OpenSSL:哈希,数字签名,等等(How to use OpenSSL: hashes, digital signatures, and more)》 +### 《如何使用 OpenSSL:哈希、数字签名等》 -许多信息安全是基于数学的:特别是用于加密数据和验证用户或文件内容的加密函数。在《[开始使用 OpenSSL:密码学基础(Getting started with OpenSSL: Cryptography basics)][11]》中进行介绍后,Marty Kalin 深入讨论了《[如何使用 OpenSSL:哈希,数字签名,等等(How to use OpenSSL: hashes, digital signatures, and more)][12]》的细节,解释了如何使用 `OpenSSL` 实用程序来探索这些常用但不常被理解的概念。 +许多信息安全是基于数学的:特别是用于加密数据和验证用户或文件内容的加密函数。在《[开始使用 OpenSSL:密码学基础][11]》中进行介绍后,Marty Kalin 深入讨论了《[如何使用 OpenSSL:哈希、数字签名等][12]》的细节,解释了如何使用 OpenSSL 实用程序来探索这些常用但不常被理解的概念。 -### 《使用树莓派和 Kali Linux 学习计算机安全(Learn about computer security with the Raspberry Pi and Kali Linux)》 +### 《使用树莓派和 Kali Linux 学习计算机安全》 -廉价硬件与开源软件构成了一个很好的组合,特别是对于那些希望边做边学的人来说。在《[使用树莓派和 Kali Linux 学习计算机安全(Learn about computer security with the Raspberry Pi and Kali Linux)][13]》这篇文章中,Anderson Silva 介绍了面向安全的 `Kali Linux` 发行版。这是一篇短文,但它满是关于文档和安全相关项目的有用的链接,您可以在自己的树莓派上使用它们。 +廉价硬件与开源软件构成了一个很好的组合,特别是对于那些希望边做边学的人来说。在《[使用树莓派和 Kali Linux 学习计算机安全][13]》这篇文章中,Anderson Silva 介绍了面向安全的 Kali Linux 发行版。这是一篇短文,但它满是关于文档和安全相关项目的有用的链接,你可以在自己的树莓派上使用它们。 -### 《量子计算会破坏安全吗?(Will quantum computing break security?)》 +### 《量子计算会打破现有的安全体系吗?》 -这篇文章的余下部分是浪费吗?量子计算会让我们对安全的所知变得过时吗?好消息是:回答是否定的,但是量子计算仍然可以在更广泛的范围内对安全和计算世界产生深远的影响。在《[量子计算会破坏安全吗?(Will quantum computing break security?)][14]》一文中,Mike Bursell 剖析了它好坏两方面的影响,当然,量子计算可能会让加密的破解变得更容易,但如果坏人一开始就无法获得你的数据,那也没有关系。 +这篇文章的余下部分是浪费吗?量子计算会让我们对安全的所知变得过时吗?好消息是:回答是否定的,但是量子计算仍然可以在更广泛的范围内对安全和计算世界产生深远的影响。在《[量子计算会打破现有的安全体系吗?][14]》一文中,Mike Bursell 剖析了它好坏两方面的影响,当然,量子计算可能会让加密的破解变得更容易,但如果坏人一开始就无法获得你的数据,那也没有关系。 -### 《展望 2020(Looking to 2020)》 +### 展望 2020 -安全永远是重要的,(正如那篇量子计算文章所建议的) 未来几年将是该领域的一个有趣时期。在 2020 年,Opensource.com 的文章将着眼于开源安全的前沿,并帮助向不断增长的开源社区解释基础知识。如果你有一个你想要我们报导的主题,请在评论中分享它,或者更进一步 —— 如果你想写一篇文章,就写给我们吧。 +安全永远是重要的,(正如那篇量子计算文章所建议的)未来几年将是该领域的一个有趣时期。在 2020 年,我们的文章将着眼于开源安全的前沿,并帮助向不断增长的开源社区解释基础知识。如果你有一个你想要我们报导的主题,请在评论中分享它,或者更进一步 —— 如果你想写一篇文章,就写给我们吧。 -------------------------------------------------------------------------------- @@ -68,24 +69,24 @@ via: https://opensource.com/article/19/12/security-resources 作者:[Ben Cotton][a] 选题:[lujun9972][b] 译者:[nacyro](https://github.com/nacyro) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/bcotton [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_security_cc.png?itok=3V07Lpko "A secure lock." -[2]: https://opensource.com/article/19/10/linux-server-security -[3]: https://opensource.com/article/19/7/make-linux-stronger-firewalls +[2]: https://linux.cn/article-11444-1.html +[3]: https://linux.cn/article-11093-1.html [4]: https://opensource.com/article/19/2/reducing-security-risks-centralized-logging [5]: https://opensource.com/article/19/4/gpg-subkeys-ssh [6]: https://opensource.com/article/19/4/gpg-subkeys-ssh-multiples [7]: https://opensource.com/article/19/4/gpg-subkeys-ssh-manage [8]: https://opensource.com/article/19/4/ssh-keys-seahorse [9]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline -[10]: https://opensource.com/article/19/9/open-source-cloud-security +[10]: https://linux.cn/article-11432-1.html [11]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-1 [12]: https://opensource.com/article/19/6/cryptography-basics-openssl-part-2 [13]: https://opensource.com/article/19/3/computer-security-raspberry-pi -[14]: https://opensource.com/article/19/1/will-quantum-computing-break-security +[14]: https://linux.cn/article-10566-1.html [15]: https://opensource.com/how-submit-article From a45011051057696c1ade6b077fbd42371b1c11ab Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Jan 2020 00:46:25 +0800 Subject: [PATCH 177/430] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @nacyro 本文首发地址: https://linux.cn/article-11742-1.html 你的 LCTT 专页地址: https://linux.cn/lctt/nacyro 请注册以领取 LCCN: https://lctt.linux.cn/ --- .../20191230 10 articles to enhance your security aptitude.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191230 10 articles to enhance your security aptitude.md (99%) diff --git a/translated/tech/20191230 10 articles to enhance your security aptitude.md b/published/20191230 10 articles to enhance your security aptitude.md similarity index 99% rename from translated/tech/20191230 10 articles to enhance your security aptitude.md rename to published/20191230 10 articles to enhance your security aptitude.md index bd488182d4..4f55e44590 100644 --- a/translated/tech/20191230 10 articles to enhance your security aptitude.md +++ b/published/20191230 10 articles to enhance your security aptitude.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "nacyro" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-11742-1.html" [#]: subject: "10 articles to enhance your security aptitude" [#]: via: "https://opensource.com/article/19/12/security-resources" [#]: author: "Ben Cotton https://opensource.com/users/bcotton" From 791826ef8316669fd7eb28a9ced6a6307cb2483f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 3 Jan 2020 00:52:53 +0800 Subject: [PATCH 178/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200103=20GNOME?= =?UTF-8?q?=20has=20a=20=E2=80=98Secret=E2=80=99=20Screen=20Recorder.=20He?= =?UTF-8?q?re=E2=80=99s=20How=20to=20Use=20it!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md --- ...et- Screen Recorder. Here-s How to Use it.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md diff --git a/sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md b/sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md new file mode 100644 index 0000000000..96de8997fa --- /dev/null +++ b/sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md @@ -0,0 +1,103 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (GNOME has a ‘Secret’ Screen Recorder. Here’s How to Use it!) +[#]: via: (https://itsfoss.com/gnome-screen-recorder/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +GNOME has a ‘Secret’ Screen Recorder. Here’s How to Use it! +====== + +[GNOME][1] is one of the [most popular desktop environments][2] and for good reasons. It has a modern UI and it comes with a number of GNOME-specific applications that blend well with the overall desktop appearance. + +You can [tweak GNOME][3] to your liking as much as you want but I am not here to discuss that. GNOME desktop has some hidden features that you probably are not aware of. + +One of such not-so-obvious feature is a built in screen recorder. + +Yes, you read that right. If you are using GNOME desktop, you don’t necessarily need to install other [screen recorders in Linux][4]. You just need to know the correct keyboard shortcut. + +### Instantly record your screen with GNOME Screen Recorder + +To quickly access the GNOME screen recorder, you have to press this [keyboard shortcut in Ubuntu][5] or other distributions using GNOME desktop: + +``` +Ctrl + Alt + Shift + R +``` + +This will immediately start recording your desktop. You can tell that the screen recording is in progress by looking at the red dot in the system tray area of the top panel: + +![The red dot in the system tray area indicates that screen recording is in progress][6] + +#### Increase the screencast duration + +The default maximum record time is just 30 seconds. It can be increased though. + +Open a terminal and use the following command: + +``` +gsettings set org.gnome.settings-daemon.plugins.media-keys max-screencast-length 300 +``` + +In the above command, I have increased the maximum length of the recording to 300 seconds (i.e. 5 minutes). You can change it to any other value but it should be in seconds. + +If you **don’t want any limit on the maximum recording time, set it to 0** and then the recording won’t stop until you manually stop it or your disk runs out of space. + +#### Stop the screen recording + +As I mentioned, your desktop recording will stop automatically after it reaches the maximum time limit. + +To stop the recording before that, you can press the same key combination: + +``` +Ctrl + Alt + Shift + R +``` + +Your recordings are saved in [webm][7] format in the Videos folder of your Home directory. + +#### Limitations + +While it might be handy to record your desktop quickly with this handy little tool, it has its several limitations when compared to a full-fledged screen recording tool like [Simple Screen Recorder][8]. + + * There is no time delay option before the recording starts + * There is no pause and play option + * It records the entire screen. No option to record only an application window or a ceratin area or a certain monitor (if you have a multi-monitor setup). + * Videos are saved in webm format in the user’s Videos directory. You cannot change it. You’ll have to use a tool like [HandBrake to convert the videos to other format][9]. + + + +As you can see, the secret GNOME screen recorder is no where near to the features provided by the likes of [Kazam][10] or other such tools. + +But it doesn’t try to be a full-fledged screen recorder. It just provides you a quick way of recording a small screencast. That’s it. + +GNOME is a versatile modern desktop environments. You can [tweak GNOME][3] extensively. The [GNOME Extensions][11] provide another dimension to the desktop customization. + +This screen recorder is one of the hidden features of GNOME like the suspend option that you won’t easily find on your own. + +_How do you like it? Do you know some other hidden GNOME features that you would like to share with us? The comment section is all yours._ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gnome-screen-recorder/ + +作者:[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://gnome.org/ +[2]: https://itsfoss.com/best-linux-desktop-environments/ +[3]: https://itsfoss.com/gnome-tweak-tool/ +[4]: https://itsfoss.com/best-linux-screen-recorders/ +[5]: https://itsfoss.com/ubuntu-shortcuts/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/gnome_screen_recording.jpg?ssl=1 +[7]: https://www.webmproject.org/about/ +[8]: https://itsfoss.com/record-screen-ubuntu-simplescreenrecorder/ +[9]: https://itsfoss.com/handbrake/ +[10]: https://itsfoss.com/kazam-screen-recorder/ +[11]: https://itsfoss.com/best-gnome-extensions/ From 1b5cb52623e7d72de8e53710f9f6c8be135530e0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 3 Jan 2020 00:54:04 +0800 Subject: [PATCH 179/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200102=20Data?= =?UTF-8?q?=20streaming=20and=20functional=20programming=20in=20Java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200102 Data streaming and functional programming in Java.md --- ...ming and functional programming in Java.md | 496 ++++++++++++++++++ 1 file changed, 496 insertions(+) create mode 100644 sources/tech/20200102 Data streaming and functional programming in Java.md diff --git a/sources/tech/20200102 Data streaming and functional programming in Java.md b/sources/tech/20200102 Data streaming and functional programming in Java.md new file mode 100644 index 0000000000..0349de9072 --- /dev/null +++ b/sources/tech/20200102 Data streaming and functional programming in Java.md @@ -0,0 +1,496 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Data streaming and functional programming in Java) +[#]: via: (https://opensource.com/article/20/1/javastream) +[#]: author: (Marty Kalin https://opensource.com/users/mkalindepauledu) + +Data streaming and functional programming in Java +====== +Learn how to use the stream API and functional programming constructs in +Java 8. +![computer screen ][1] + +When Java SE 8 (aka core Java 8) was introduced in 2014, it introduced changes that fundamentally impact programming in it. The changes have two closely linked parts: the stream API and the functional programming constructs. This article uses code examples, from the basics through advanced features, to introduce each part and illustrate the interplay between them. + +### The basics + +The stream API is a concise and high-level way to iterate over the elements in a data sequence. The packages **java.util.stream** and **java.util.function** house the new libraries for the stream API and related functional programming constructs. Of course, a code example is worth a thousand words. + +The code segment below populates a **List** with about 2,000 random integer values: + + +``` +[Random][2] rand = new [Random][2](); +List<Integer> list = new ArrayList<Integer>();           // empty list +for (int i = 0; i < 2048; i++) list.add(rand.nextInt()); // populate it +``` + +Another **for** loop could be used to iterate over the populated list to collect the even values into another list. The stream API is a cleaner way to do the same: + + +``` +[List][3] <Integer> evens = list +   .stream()                      // streamify the list +   .filter(n -> (n & 0x1) == 0)   // filter out odd values +   .collect(Collectors.toList()); // collect even values +``` + +The example has three functions from the stream API: + + * The **stream** function can turn a **Collection** into a stream, which is a conveyor belt of values accessible one at a time. The streamification is lazy (and therefore efficient) in that the values are produced as needed rather than all at once. + + * The **filter** function determines which streamed values, if any, get through to the next stage in the processing pipeline, the **collect** stage. The **filter** function is _higher-order_ in that its argument is a function—in this example, a lambda, which is an unnamed function and at the center of Java's new functional programming constructs. + +The lambda syntax departs radically from traditional Java: + + +``` +`n -> (n & 0x1) == 0` +``` + +The arrow (a minus sign followed immediately by a greater-than sign) separates the argument list on the left from the function's body on the right. The argument **n** is not explicitly typed, although it could be; in any case, the compiler figures out that **n** is an **Integer**. If there were multiple arguments, these would be enclosed in parentheses and separated by commas. + +The body, in this example, checks whether an integer's lowest-order (rightmost) bit is a zero, which indicates an even value. A filter should return a boolean value. There is no explicit **return** in the function's body, although there could be. If the body has no explicit **return**, then the body's last expression is the returned value. In this example, written in the spirit of lambda programming, the body consists of the single, simple boolean expression **(n & 0x1) == 0**. + + * The **collect** function gathers the even values into a list whose reference is **evens**. As an example below illustrates, the **collect** function is thread-safe and, therefore, would work correctly even if the filtering operation was shared among multiple threads. + + + + +### Convenience functions and easy multi-threading + +In a production environment, a data stream might have a file or a network connection as its source. For learning the stream API, Java provides types such as **IntStream**, which can generate streams with elements of various types. Here is an **IntStream** example: + + +``` +IntStream                         // integer stream +   .range(1, 2048)                // generate a stream of ints in this range +   .parallel()                    // partition the data for multiple threads +   .filter(i -> ((i & 0x1) > 0))  // odd parity? pass through only odds +   .forEach([System][4].out::println); // print each +``` + +The **IntStream** type includes a **range** function that generates a stream of integer values within a specified range, in this case, from 1 through 2,048, with increments of 1. The **parallel** function automatically partitions the work to be done among multiple threads, each of which does the filtering and printing. (The number of threads typically matches the number of CPUs on the host system.) The argument to the **forEach** function is a _method reference_, in this case, a reference to the **println** method encapsulated in **System.out**, which is of type **PrintStream**. The syntax for method and constructor references will be discussed shortly. + +Because of the multi-threading, the integer values are printed in an arbitrary order overall but in sequence within a given thread. For example, if thread T1 prints 409 and 411, then T1 does so in the order 409–411, but some other thread might print 2,045 beforehand. The threads behind the **parallel** call execute concurrently, and the order of their output is therefore indeterminate. + +### The map/reduce pattern + +The _map/reduce_ pattern has become popular in processing large datasets. A map/reduce macro operation is built from two micro-operations. The data first are scattered (_mapped_) among various workers, and the separate results then are gathered together—perhaps as a single value, which would be the _reduction_. Reduction can take different forms, as the following examples illustrate. + +Instances of the **Number** class below represent integer values with either **EVEN** or **ODD** parity: + + +``` +public class [Number][5] { +    enum Parity { EVEN, ODD } +    private int value; +    public [Number][5](int n) { setValue(n); } +    public void setValue(int value) { this.value = value; } +    public int getValue() { return this.value; } +    public Parity getParity() { +        return ((value & 0x1) == 0) ? Parity.EVEN : Parity.ODD; +    } +    public void dump() { +        [System][4].out.format("Value: %2d (parity: %s)\n", getValue(), +                          (getParity() == Parity.ODD ? "odd" : "even")); +    } +} +``` + +The following code illustrates map/reduce with a **Number** stream, thereby showing that the stream API can handle not only primitive types such as **int** and **float** but programmer-defined class types as well. + +In the code segment below, a list of random integer values is streamified using the **parallelStream** rather than the **stream** function. The **parallelStream** variant, like the **parallel** function introduced earlier, does automatic multithreading. + + +``` +final int howMany = 200; +[Random][2] r = new [Random][2](); +[Number][5][ ] nums = new [Number][5][howMany]; +for (int i = 0; i < howMany; i++) nums[i] = new [Number][5](r.nextInt(100)); +List<Number> listOfNums = [Arrays][6].asList(nums);  // listify the array + +[Integer][7] sum4All = listOfNums +   .parallelStream()           // automatic multi-threading +   .mapToInt([Number][5]::getValue) // method reference rather than lambda +   .sum();                     // reduce streamed values to a single value +[System][4].out.println("The sum of the randomly generated values is: " + sum4All); +``` + +The higher-order **mapToInt** function could take a lambda as an argument, but in this case, it takes a method reference instead, which is **Number::getValue**. The **getValue** method expects no arguments and returns its **int** value for a given **Number** instance. The syntax is uncomplicated: the class name **Number** followed by a double colon and the method's name. Recall the earlier **System.out::println** example, which has the double colon after the **static** field **out** in the **System** class. + +The method reference **Number::getValue** could be replaced by the lambda below. The argument **n** is one of the **Number** instances in the stream: + + +``` +`mapToInt(n -> n.getValue())` +``` + +In general, lambdas and method references are interchangeable: if a higher-order function such as **mapToInt** can take one form as an argument, then this function could take the other as well. The two functional programming constructs have the same purpose—to perform some customized operation on data passed in as arguments. Choosing between the two is often a matter of convenience. For example, a lambda can be written without an encapsulating class, whereas a method cannot. My habit is to use a lambda unless the appropriate encapsulated method is already at hand. + +The **sum** function at the end of the current example does the reduction in a thread-safe manner by combining the partial sums from the **parallelStream** threads. However, the programmer is responsible for ensuring that, in the course of the multi-threading induced by the **parallelStream** call, the programmer's own function calls (in this case, to **getValue**) are thread-safe. + +The last point deserves emphasis. Lambda syntax encourages the writing of _pure functions_, which are functions whose return values depend only on the arguments, if any, passed in; a pure function has no side effects such as updating a **static** field in a class. Pure functions are thereby thread-safe, and the stream API works best if the functional arguments passed to higher-order functions, such as **filter** and **map**, are pure functions. + +For finer-grained control, there is another stream API function, named **reduce**, that could be used for summing the values in the **Number** stream: + + +``` +[Integer][7] sum4AllHarder = listOfNums +   .parallelStream()                           // multi-threading +   .map([Number][5]::getValue)                      // value per Number +   .reduce(0, (sofar, next) -> sofar + next);  // reduction to a sum +``` + +This version of the **reduce** function takes two arguments, the second of which is a function: + + * The first argument (in this case, zero) is the _identity_ value, which serves as the initial value for the reduction operation and as the default value should the stream run dry during the reduction. + * The second argument is the _accumulator_, in this case, a lambda with two arguments: the first argument (**sofar**) is the running sum, and the second argument (**next**) is the next value from the stream. The running sum and next value then are added to update the accumulator. Keep in mind that both the **map** and the **reduce** functions now execute in a multi-threaded context because of the **parallelStream** call at the start. + + + +In the examples so far, stream values are collected and then reduced, but, in general, the **Collectors** in the stream API can accumulate values without reducing them to a single value. The collection activity can produce arbitrarily rich data structures, as the next code segment illustrates. The example uses the same **listOfNums** as the preceding examples: + + +``` +Map<[Number][5].Parity, List<Number>> numMap = listOfNums +   .parallelStream() +   .collect(Collectors.groupingBy([Number][5]::getParity)); + +List<Number> evens = numMap.get([Number][5].Parity.EVEN); +List<Number> odds = numMap.get([Number][5].Parity.ODD); +``` + +The **numMap** in the first line refers to a **Map** whose key is a **Number** parity (**ODD** or **EVEN**) and whose value is a **List** of **Number** instances with values having the designated parity. Once again, the processing is multi-threaded through the **parallelStream** call, and the **collect** call then assembles (in a thread-safe manner) the partial results into the single **Map** to which **numMap** refers. The **get** method then is called twice on the **numMap**, once to get the **evens** and a second time to get the **odds**. + +The utility function **dumpList** again uses the higher-order **forEach** function from the stream API: + + +``` +private void dumpList([String][8] msg, List<Number> list) { +   [System][4].out.println("\n" + msg); +   list.stream().forEach(n -> n.dump()); // or: forEach(Number::dump) +} +``` + +Here is a slice of the program's output from a sample run: + + +``` +The sum of the randomly generated values is: 3322 +The sum again, using a different method:     3322 + +Evens: + +Value: 72 (parity: even) +Value: 54 (parity: even) +... +Value: 92 (parity: even) + +Odds: + +Value: 35 (parity: odd) +Value: 37 (parity: odd) +... +Value: 41 (parity: odd) +``` + +### Functional constructs for code simplification + +Functional constructs, such as method references and lambdas, fit nicely into the stream API. These constructs represent a major simplification of higher-order functions in Java. Even in the bad old days, Java technically supported higher-order functions through the **Method** and **Constructor** types, instances of which could be passed as arguments to other functions. These types were used—but rarely in production-grade Java precisely because of their complexity. Invoking a **Method**, for example, requires either an object reference (if the method is non-**static**) or at least a class identifier (if the method is **static**). The arguments for the invoked **Method** then are passed to it as **Object** instances, which may require explicit downcasting if polymorphism (another complexity!) is not in play. By contrast, lambdas and method references are easy to pass as arguments to other functions. + +The new functional constructs have uses beyond the stream API, however. Consider a Java GUI program with a button for the user to push, for example, to get the current time. The event handler for the button push might be written as follows: + + +``` +[JButton][9] updateCurrentTime = new [JButton][9]("Update current time"); +updateCurrentTime.addActionListener(new [ActionListener][10]() { +   @Override +   public void actionPerformed([ActionEvent][11] e) { +      currentTime.setText(new [Date][12]().toString()); +   } +}); +``` + +This short code segment is a challenge to explain. Consider the second line in which the argument to the method **addActionListener** begins as follows: + + +``` +`new ActionListener() {` +``` + +This seems wrong in that **ActionListener** is an **abstract** interface, and **abstract** types cannot be instantiated with a call to **new**. However, it turns out that something else entirely is being instantiated: an unnamed inner class that implements this interface. If the code above were encapsulated in a class named **OldJava**, then this unnamed inner class would be compiled as **OldJava$1.class**. The **actionPerformed** method is overridden in the unnamed inner class. + +Now consider this refreshing change with the new functional constructs: + + +``` +`updateCurrentTime.addActionListener(e -> currentTime.setText(new Date().toString()));` +``` + +The argument **e** in the lambda is an **ActionEvent** instance, and the lambda's body is a simple call to **setText** on the button. + +### Functional interfaces and composition + +The lambdas used so far have been written in place. For convenience, however, there can be references to lambdas just as there are to encapsulated methods. The following series of short examples illustrate this. + +Consider this interface definition: + + +``` +@FunctionalInterface // optional, usually omitted +interface BinaryIntOp { +    abstract int compute(int arg1, int arg2); // abstract could be dropped +} +``` + +The annotation **@FunctionalInterface** applies to any interface that declares a _single_ abstract method; in this case, **compute**. Several standard interfaces (e.g., the **Runnable** interface with its single declared method, **run**) fit the bill. In this example, **compute** is the declared method. The interface can be used as the target type in a reference declaration: + + +``` +BinaryIntOp div = (arg1, arg2) -> arg1 / arg2; +div.compute(12, 3); // 4 +``` + +The package **java.util.function** provides various functional interfaces. Some examples follow. + +The code segment below introduces the parameterized **Predicate** functional interface. In this example, the type **Predicate<String>** with parameter **String** can refer to either a lambda with a **String** argument or a **String** method such as **isEmpty**. In general, a _predicate_ is a function that returns a boolean value. + + +``` +Predicate<String> pred = [String][8]::isEmpty; // predicate for a String method +[String][8][ ] strings = {"one", "two", "", "three", "four"}; +[Arrays][6].asList(strings) +   .stream() +   .filter(pred)                  // filter out non-empty strings +   .forEach([System][4].out::println); // only the empty string is printed +``` + +The **isEmpty** predicate evaluates to **true** just in case a string's length is zero; hence, only the empty string makes it through to the **forEach** stage in the pipeline. + +The next code segments illustrate how simple lambdas or method references can be composed into richer ones. Consider this series of assignments to references of the **IntUnaryOperator** type, which takes an integer argument and returns an integer value: + + +``` +IntUnaryOperator doubled = n -> n * 2; +IntUnaryOperator tripled = n -> n * 3; +IntUnaryOperator squared = n -> n * n; +``` + +**IntUnaryOperator** is a **FunctionalInterface** whose single declared method is **applyAsInt**. The three references **doubled**, **tripled**, and **squared** now can be used standalone or in various compositions: + + +``` +int arg = 5; +doubled.applyAsInt(arg); // 10 +tripled.applyAsInt(arg); // 15 +squared.applyAsInt(arg); // 25 +``` + +Here are some sample compositions: + + +``` +int arg = 5; +doubled.compose(squared).applyAsInt(arg); // doubled-the-squared: 50 +tripled.compose(doubled).applyAsInt(arg); // tripled-the-doubled: 30 +doubled.andThen(squared).applyAsInt(arg); // doubled-andThen-squared: 100 +squared.andThen(tripled).applyAsInt(arg); // squared-andThen-tripled: 75 +``` + +Compositions could be done with in-place lambdas, but the references make the code cleaner. + +### Constructor references + +Constructor references are yet another of the functional programming constructs, but these references are useful in more subtle contexts than lambdas and method references. Once again, a code example seems the best way to clarify. + +Consider this [POJO][13] class: + + +``` +public class BedRocker { // resident of Bedrock +    private [String][8] name; +    public BedRocker([String][8] name) { this.name = name; } +    public [String][8] getName() { return this.name; } +    public void dump() { [System][4].out.println(getName()); } +} +``` + +The class has a single constructor, which requires a **String** argument. Given an array of names, the goal is to generate an array of **BedRocker** elements, one per name. Here is the code segment that uses functional constructs to do so: + + +``` +[String][8][ ] names = {"Fred", "Wilma", "Peebles", "Dino", "Baby Puss"}; + +Stream<BedRocker> bedrockers = [Arrays][6].asList(names).stream().map(BedRocker::new); +BedRocker[ ] arrayBR = bedrockers.toArray(BedRocker[]::new); + +[Arrays][6].asList(arrayBR).stream().forEach(BedRocker::dump); +``` + +At a high level, this code segment transforms names into **BedRocker** array elements. In detail, the code works as follows. The **Stream** interface (in the package **java.util.stream**) can be parameterized, in this case, to generate a stream of **BedRocker** items named **bedrockers**. + +The **Arrays.asList** utility again is used to streamify an array, **names**, with each stream item then passed to the **map** function whose argument now is the constructor reference **BedRocker::new**. This constructor reference acts as an object factory by generating and initializing, on each call, a **BedRocker** instance. After the second line executes, the stream named **bedrockers** consists of five **BedRocker** items. + +The example can be clarified further by focusing on the higher-order **map** function. In a typical case, a mapping transforms a value of one type (e.g., an **int**) into a different value of the _same_ type (e.g., an integer's successor): + + +``` +`map(n -> n + 1) // map n to its successor` +``` + +In the **BedRocker** example, however, the transformation is more dramatic because a value of one type (a **String** representing a name) is mapped to a value of a _different_ type, in this case, a **BedRocker** instance with the string as its name. The transformation is done through a constructor call, which is enabled by the constructor reference: + + +``` +`map(BedRocker::new) // map a String to a BedRocker` +``` + +The value passed to the constructor is one of the names in the **names** array. + +The second line of this code example also illustrates the by-now-familiar transformation of an array first into a **List** and then into a **Stream**: + + +``` +`Stream bedrockers = Arrays.asList(names).stream().map(BedRocker::new);` +``` + +The third line goes the other way—the stream **bedrockers** is transformed into an array by invoking the **toArray** method with the _array_ constructor reference **BedRocker[]::new**: + + +``` +`BedRocker[ ] arrayBR = bedrockers.toArray(BedRocker[]::new);` +``` + +This constructor reference does not create a single **BedRocker** instance, but rather an entire array of these: the constructor reference is now **BedRocker[]::new** rather than **BedRocker::new**. For confirmation, the **arrayBR** is transformed into a **List**, which again is streamified so that **forEach** can be used to print the **BedRocker** names: + + +``` +Fred +Wilma +Peebles +Dino +Baby Puss +``` + +The example's subtle transformations of data structures are done with but few lines of code, underscoring the power of various higher-order functions that can take a lambda, a method reference, or a constructor reference as an argument + +### Currying + +To _curry_ a function is to reduce (typically by one) the number of explicit arguments required for whatever work the function does. (The term honors the logician Haskell Curry.) In general, functions are easier to call and are more robust if they have fewer arguments. (Recall some nightmarish function that expects a half-dozen or so arguments!) Accordingly, currying should be seen as an effort to simplify a function call. The interface types in the **java.util.function** package are suited for currying, as the next example shows. + +References of the **IntBinaryOperator** interface type are for functions that take two integer arguments and return an integer value: + + +``` +IntBinaryOperator mult2 = (n1, n2) -> n1 * n2; +mult2.applyAsInt(10, 20); // 200 +mult2.applyAsInt(10, 30); // 300 +``` + +The reference name **mult2** underscores that two explicit arguments are required, in this example, 10 and 20. + +The previously introduced **IntUnaryOperator** is simpler than an **IntBinaryOperator** because the former requires just one argument, whereas the latter requires two arguments. Both return an integer value. The goal, therefore, is to curry the two-argument **IntBinraryOperator** named **mult2** into a one-argument **IntUnaryOperator** version **curriedMult2**. + +Consider the type **IntFunction<R>**. A function of this type takes an integer argument and returns a result of type **R**, which could be another function—indeed, an **IntBinaryOperator**. Having a lambda return another lambda is straightforward: + + +``` +`arg1 -> (arg2 -> arg1 * arg2) // parentheses could be omitted` +``` + +The full lambda starts with **arg1,** and this lambda's body—and returned value—is another lambda, which starts with **arg2**. The returned lambda takes just one argument (**arg2**) but returns the product of two numbers (**arg1** and **arg2**). The following overview, followed by the code, should clarify. + +Here is an overview of how **mult2** can be curried: + + * A lambda of type **IntFunction<IntUnaryOperator>** is written and called with an integer value such as 10. The returned **IntUnaryOperator** caches the value 10 and thereby becomes the curried version of **mult2**, in this example, **curriedMult2**. + * The **curriedMult2** function then is called with a single explicit argument (e.g., 20), which is multiplied with the cached argument (in this case, 10) to produce the product returned. + + + +Here are the details in code: + + +``` +// Create a function that takes one argument n1 and returns a one-argument +// function n2 -> n1 * n2 that returns an int (the product n1 * n2). +IntFunction<IntUnaryOperator> curriedMult2Maker = n1 -> (n2 -> n1 * n2); +``` + +Calling the **curriedMult2Maker** generates the desired **IntUnaryOperator** function: + + +``` +// Use the curriedMult2Maker to get a curried version of mult2. +// The argument 10 is n1 from the lambda above. +IntUnaryOperator curriedMult2 = curriedMult2Maker2.apply(10); +``` + +The value 10 is now cached in the **curriedMult2** function so that the explicit integer argument in a **curriedMult2** call will be multiplied by 10: + + +``` +curriedMult2.applyAsInt(20); // 200 = 10 * 20 +curriedMult2.applyAsInt(80); // 800 = 10 * 80 +``` + +The cached value can be changed at will: + + +``` +curriedMult2 = curriedMult2Maker.apply(50); // cache 50 +curriedMult2.applyAsInt(101);               // 5050 = 101 * 50 +``` + +Of course, multiple curried versions of **mult2**, each an **IntUnaryOperator**, can be created in this way. + +Currying takes advantage of a powerful feature about lambdas: a lambda is easily written to return whatever type of value is needed, including another lambda. + +### Wrapping up + +Java remains a class-based object-oriented programming language. But with the stream API and its supporting functional constructs, Java takes a decisive (and welcomed) step toward functional languages such as Lisp. The result is a Java better suited to process the massive data streams so common in modern programming. This step in the functional direction also makes it easier to write clear, concise Java in the pipeline style highlighted in previous code examples: + + +``` +dataStream +   .parallelStream() // multi-threaded for efficiency +   .filter(...)      // stage 1 +   .map(...)         // stage 2 +   .filter(...)      // stage 3 +   ... +   .collect(...);    // or, perhaps, reduce: stage N +``` + +The automatic multi-threading, illustrated with the **parallel** and **parallelStream** calls, is built upon Java's fork/join framework, which supports _task stealing_ for efficiency. Suppose that the thread pool behind a **parallelStream** call consists of eight threads and that the **dataStream** is partitioned eight ways. Some thread (e.g., T1) might work faster than another (e.g., T7), which means that some of T7's tasks ought to be moved into T1's work queue. This happens automatically at runtime. + +The programmer's chief responsibility in this easy multi-threading world is to write thread-safe functions passed as arguments to the higher-order functions that dominate in the stream API. Lambdas, in particular, encourage the writing of pure—and, therefore, thread-safe—functions. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/javastream + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/features_solutions_command_data.png?itok=4_VQN3RK (computer screen ) +[2]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+random +[3]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+list +[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+number +[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+arrays +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+integer +[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+jbutton +[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+actionlistener +[11]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+actionevent +[12]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+date +[13]: https://en.wikipedia.org/wiki/Plain_old_Java_object From b5334c946f9a92e9c46f0eda85f9f8ee4678fb1c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 3 Jan 2020 00:54:51 +0800 Subject: [PATCH 180/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200102=2010=20o?= =?UTF-8?q?pen=20source=20software=20alternatives=20for=20the=20new=20year?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200102 10 open source software alternatives for the new year.md --- ... software alternatives for the new year.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20200102 10 open source software alternatives for the new year.md diff --git a/sources/tech/20200102 10 open source software alternatives for the new year.md b/sources/tech/20200102 10 open source software alternatives for the new year.md new file mode 100644 index 0000000000..59d7f4067e --- /dev/null +++ b/sources/tech/20200102 10 open source software alternatives for the new year.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 open source software alternatives for the new year) +[#]: via: (https://opensource.com/article/20/1/open-source-alternatives) +[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) + +10 open source software alternatives for the new year +====== +Open source software can help you become better organized, more +productive, more secure, and even healthier. +![Multi-colored and directional network computer cables][1] + +Open source isn't just for techies. On your desktop (regardless of your operating system), on your phone, and in your business, open source software can help you become better organized, more productive, more secure, and healthier. Best of all, you don't need to worry about the shackles of proprietary licenses. + +Throughout 2019, Opensource.com's team of [Correspondents][2] and community of writers have highlighted top-notch open source alternatives to proprietary software. Take a quick look at the best 10 of those articles. + +In _[Intro to Corteza, an open source alternative to Salesforce][3]_, Dennis Arh introduces us to Corteza, a powerful and flexible customer relationship management (CRM) system. Dennis outlines what Corteza has to offer, then walks us through how to install and configure the system. While Corteza might not pack all the features of the bigger closed source CRM systems, it's more than enough for the majority of users. + +Opensource.com Correspondent Chris Hermansen whips up an overview of a half-dozen instant messaging apps for mobile devices in _[Choosing an open messenger client: Alternatives to WhatsApp][4]_. While each of the six apps has its strengths, Chris recommends Signal for "its open-by-design approach, its serious and ongoing privacy and security stance, and having a Signal app on our GNOME (and Windows) desktops." + +In _[5 social media alternatives to protect your privacy][5]_, privacy advocate Dan Arel walks through several open source replacements for Twitter, Facebook, Instagram, WhatsApp, and Facebook Messenger. Dan also shares how he cut his ties with those privacy-crushing services without losing touch with the people who matter. His approach might work for you, too. + +You don't need an expensive application like Adobe Acrobat to work with PDF files on the Linux desktop, as I show in _[Two graphical tools for manipulating PDFs on the Linux desktop][6]_. These tools are simple, but they pack a lot of punch and take care of most of your PDF manipulation needs. + +In _[How to create an automated calendar with Google Apps Script with open source on top][7]_, Correspondent Dan Barker explores how to manage conference submissions by stitching together a Google Sheet with Google Calendar using a script he wrote. OK, the services Dan's script interacts with aren't open source, but you can grab that script from [Dan's GitLab repository][8] and modify it to your heart's content. + +In _[4 open source apps for plant-based diets][9]_, Correspondent Joshua Allen Holm uncovers some mobile apps that can help you plan meatless meals, shop more effectively for the ingredients for those meals, and find vegan and vegetarian restaurants nearby. As someone who's shifting to a more plant-based diet, I can see myself using a couple of these apps in the near future. And that they're available on [F-Droid][10] is a bonus. + +I dive into a very useful spreadsheet editor that's built for collaboration in _[Get going with EtherCalc, a web-based alternative to Google Sheets][11]_. If you're of a technical bent, you can run your own instance; otherwise, you can use one of several hosted editions. EtherCalc does take a bit of getting used to, but if your needs are simple, you'll find (as I did) that it's a flexible tool. + +Opensource.com's Seth Kenlon examines _[CBZ and DjVu: Open source alternatives to PDFs][12]_. This pair of digital archive formats can do everything PDF can do but are easier to manipulate. Seth also shows how to use command-line tools to create archives in the CBZ and DjVu formats and, with DjVu files, offers some advanced tips and tricks. + +I explain how a good open source application can exist quite nicely in a proprietary environment in _[Organize your information on the Mac desktop with nvALT][13]_. In this article, I discuss how to how to manage notes and more with this _very_ useful tool. What makes nvALT all the more attractive to me is that [plain text][14] is at its core, so it's a solid fit for my workflow whenever I'm working in MacOS. + +In _[Getting started with Pimcore: An open source alternative for product information management][15]_, Dietmar Rietsch introduces a tool for businesses of all sizes to manage, mold, and share data about their products. In the past, I worked for a company or two that specialized in this type of software. It's great to see an open source alternative that's as flexible, polished, and easy to use as its closed source cousins. + +These articles give you a taste of the open source alternatives to proprietary software that are out there. Are there any substitutes for proprietary software that you think we should cover in the coming months? Feel free to leave a comment or, better yet, [submit an article proposal][16]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-alternatives + +作者:[Scott Nesbitt][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/scottnesbitt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/connections_wires_sysadmin_cable.png?itok=d5WqHmnJ (Multi-colored and directional network computer cables) +[2]: https://opensource.com/correspondent-program +[3]: https://opensource.com/article/19/8/corteza-open-source-alternative-salesforce +[4]: https://opensource.com/article/19/3/open-messenger-client +[5]: https://opensource.com/article/19/1/open-source-social-media-alternatives +[6]: https://opensource.com/article/19/2/manipulating-pdfs-linux +[7]: https://opensource.com/article/19/1/automate-calendar +[8]: https://gitlab.com/barkerd427/conference-scripts +[9]: https://opensource.com/article/19/4/apps-plant-based-diets +[10]: https://f-droid.org/ +[11]: https://opensource.com/article/19/7/get-going-ethercalc +[12]: https://opensource.com/article/19/3/comic-book-archive-djvu +[13]: https://opensource.com/article/19/1/nvalt +[14]: https://plaintextproject.online/ +[15]: https://opensource.com/article/19/11/pimcore-alternative-product-information-management +[16]: https://opensource.com/how-submit-article From a81ef337e2355038184c6b6f016acceb4b3c5118 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 3 Jan 2020 00:55:22 +0800 Subject: [PATCH 181/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200102=20Put=20?= =?UTF-8?q?some=20loot=20in=20your=20Python=20platformer=20game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200102 Put some loot in your Python platformer game.md --- ...ome loot in your Python platformer game.md | 535 ++++++++++++++++++ 1 file changed, 535 insertions(+) create mode 100644 sources/tech/20200102 Put some loot in your Python platformer game.md diff --git a/sources/tech/20200102 Put some loot in your Python platformer game.md b/sources/tech/20200102 Put some loot in your Python platformer game.md new file mode 100644 index 0000000000..678fb69516 --- /dev/null +++ b/sources/tech/20200102 Put some loot in your Python platformer game.md @@ -0,0 +1,535 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Put some loot in your Python platformer game) +[#]: via: (https://opensource.com/article/20/1/loot-python-platformer-game) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Put some loot in your Python platformer game +====== +Give your players some treasures to collect and boost their score in +this installment on programming video games with Python's Pygame module. +![Hearts, stars, and dollar signs][1] + +This is part 9 in an ongoing series about creating video games in [Python 3][2] using the [Pygame][3] module. Previous articles are: + + * [Learn how to program in Python by building a simple dice game][4] + * [Build a game framework with Python using the Pygame module][5] + * [How to add a player to your Python game][6] + * [Using Pygame to move your game character around][7] + * [What's a hero without a villain? How to add one to your Python game][8] + * [Simulate gravity in your Python game][9] + * [Add jumping to your Python platformer game][10] + * [Enable your Python game player to run forward and backward][11] + + + +If you've followed along with the previous articles in this series, then you know all the basics of programming video game mechanics. You can build upon these basics to create a fully functional video game all your own. Following a "recipe" like the code samples in this series is helpful when you're first learning, but eventually, the recipe becomes a constraint. It's time to use the principles you've learned and apply them in new ways. + +If that sounds easier said than done, this article demonstrates an example of how to leverage what you already know for new purposes. Specifically, it covers how to implement a looting system + +using what you have already learned about platforms from previous lessons. + +In most video games, you have the opportunity to "loot," or collect treasures and other items within the game world. Loot usually increases your score or your health or provides information leading to your next quest. + +Including loot in your game is similar to programming platforms. Like platforms, loot has no user controls, scrolls with the game world, and must check for collisions with the player sprite. + +### Creating the loot function + +Loot is so similar to platforms that you don't even need a Loot class. You can just reuse the **Platform** class and call the results loot. + +Since loot type and placement probably differ from level to level, create a new function called **loot** in your **Level** class, if you don't already have one. Since loot items are not platforms, you must also create a new **loot_list** group and then add loot objects to it. As with platforms, ground, and enemies, this group is used when checking for collisions: + + +``` +    def loot(lvl,lloc): +        if lvl == 1: +            loot_list = pygame.sprite.Group() +            loot = Platform(300,ty*7,tx,ty, 'loot_1.png') +            loot_list.add(loot) + +        if lvl == 2: +            print(lvl) + +        return loot_list +``` + +You can add as many loot objects as you like; just remember to add each one to your loot list. The arguments for the **Platform** class are the X position, the Y position, the width and height of the loot sprite (it's usually easiest to keep your loot sprite the same size as all other tiles), and the image you want to use as loot. Placement of loot can be just as complex as mapping platforms, so use the level design document you created when creating the level. + +Call your new loot function in the **Setup** section of your script. In the following code, the first three lines are for context, so just add the fourth: + + +``` +enemy_list = Level.bad( 1, eloc ) +ground_list = Level.ground( 1,gloc,tx,ty ) +plat_list = Level.platform( 1,tx,ty ) +loot_list = Level.loot(1,tx,ty) +``` + +As you know by now, the loot won't get drawn to the screen unless you include it in your main loop. Add the final line from the following code sample to your loop: + + +``` +    enemy_list.draw(world) +    ground_list.draw(world) +    plat_list.draw(world) +    loot_list.draw(world) +``` + +Launch your game to see what happens. + +![Loot in Python platformer][12] + +Your loot objects are spawned, but they don't do anything when your player runs into them, nor do they scroll when your player runs past them. Fix these issues next. + +### Scrolling loot + +Like platforms, loot has to scroll when the player moves through the game world. The logic is identical to platform scrolling. To scroll the loot forward, add the last two lines: + + +``` +        for e in enemy_list: +            e.rect.x -= scroll +        for l in loot_list: +            l.rect.x -= scroll +``` + +To scroll it backward, add the last two lines: + + +``` +        for e in enemy_list: +            e.rect.x += scroll +        for l in loot_list: +            l.rect.x += scroll +``` + +Launch your game again to see that your loot objects now act like they're _in_ the game world instead of just painted on top of it. + +### Detecting collisions + +As with platforms and enemies, you can check for collisions between loot and your player. The logic is the same as other collisions, except that a hit doesn't (necessarily) affect gravity or health. Instead, a hit causes the loot to disappear and increment the player's score. + +When your player touches a loot object, you can remove that object from the **loot_list**. This means that when your main loop redraws all loot items in **loot_list**, it won't redraw that particular object, so it will look like the player has grabbed the loot. + +Add the following code above the platform collision detection in the **update** function of your **Player** class (the last line is just for context): + + +``` +                loot_hit_list = pygame.sprite.spritecollide(self, loot_list, False) +                for loot in loot_hit_list: +                        loot_list.remove(loot) +                        self.score += 1 +                print(self.score) +  +        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) +``` + +Not only do you remove the loot object from its group when a collision happens, but you also award your player a bump in score. You haven't created a score variable yet, so add that to your player's properties, created in the **__init__** function of the **Player** class. In the following code, the first two lines are for context, so just add the score variable: + + +``` +        self.frame = 0 +        self.health = 10 +        self.score = 0 +``` + +When calling the **update** function in your main loop, include the **loot_list**: + + +``` +        player.gravity() +        player.update() +``` + +As you can see, you've got all the basics. All you have to do now is use what you know in new ways. + +There are a few more tips in the next article, but in the meantime, use what you've learned to make a few simple, single-level games. Limiting the scope of what you are trying to create is important so that you don't overwhelm yourself. It also makes it easier to end up with a finished product that looks and feels finished. + +Here's all the code you've written for this Python platformer so far: + + +``` +#!/usr/bin/env python3 +# draw a world +# add a player and player control +# add player movement +# add enemy and basic collision +# add platform +# add gravity +# add jumping +# add scrolling + +# GNU All-Permissive License +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved.  This file is offered as-is, +# without any warranty. + +import pygame +import sys +import os + +''' +Objects +''' + +class Platform(pygame.sprite.Sprite): +    # x location, y location, img width, img height, img file     +    def __init__(self,xloc,yloc,imgw,imgh,img): +        pygame.sprite.Sprite.__init__(self) +        self.image = pygame.image.load(os.path.join('images',img)).convert() +        self.image.convert_alpha() +        self.rect = self.image.get_rect() +        self.rect.y = yloc +        self.rect.x = xloc + +class Player(pygame.sprite.Sprite): +    ''' +    Spawn a player +    ''' +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.movex = 0 +        self.movey = 0 +        self.frame = 0 +        self.health = 10 +        self.collide_delta = 0 +        self.jump_delta = 6 +        self.score = 1 +        self.images = [] +        for i in range(1,9): +            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() +            img.convert_alpha() +            img.set_colorkey(ALPHA) +            self.images.append(img) +            self.image = self.images[0] +            self.rect  = self.image.get_rect() + +    def jump(self,platform_list): +        self.jump_delta = 0 + +    def gravity(self): +        self.movey += 3.2 # how fast player falls +        +        if self.rect.y > worldy and self.movey >= 0: +            self.movey = 0 +            self.rect.y = worldy-ty +        +    def control(self,x,y): +        ''' +        control player movement +        ''' +        self.movex += x +        self.movey += y +        +    def update(self): +        ''' +        Update sprite position +        ''' +        +        self.rect.x = self.rect.x + self.movex +        self.rect.y = self.rect.y + self.movey + +        # moving left +        if self.movex < 0: +            self.frame += 1 +            if self.frame > ani*3: +                self.frame = 0 +            self.image = self.images[self.frame//ani] + +        # moving right +        if self.movex > 0: +            self.frame += 1 +            if self.frame > ani*3: +                self.frame = 0 +            self.image = self.images[(self.frame//ani)+4] + +        # collisions +        enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) +        for enemy in enemy_hit_list: +            self.health -= 1 +            #print(self.health) + +        loot_hit_list = pygame.sprite.spritecollide(self, loot_list, False) +        for loot in loot_hit_list: +            loot_list.remove(loot) +            self.score += 1 +            print(self.score) + +        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) +        for p in plat_hit_list: +            self.collide_delta = 0 # stop jumping +            self.movey = 0 +            if self.rect.y > p.rect.y: +                self.rect.y = p.rect.y+ty +            else: +                self.rect.y = p.rect.y-ty +            +        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) +        for g in ground_hit_list: +            self.movey = 0 +            self.rect.y = worldy-ty-ty +            self.collide_delta = 0 # stop jumping +            if self.rect.y > g.rect.y: +                self.health -=1 +                print(self.health) +                +        if self.collide_delta < 6 and self.jump_delta < 6: +            self.jump_delta = 6*2 +            self.movey -= 33  # how high to jump +            self.collide_delta += 6 +            self.jump_delta    += 6 +            +class Enemy(pygame.sprite.Sprite): +    ''' +    Spawn an enemy +    ''' +    def __init__(self,x,y,img): +        pygame.sprite.Sprite.__init__(self) +        self.image = pygame.image.load(os.path.join('images',img)) +        self.movey = 0 +        #self.image.convert_alpha() +        #self.image.set_colorkey(ALPHA) +        self.rect = self.image.get_rect() +        self.rect.x = x +        self.rect.y = y +        self.counter = 0 + +                +    def move(self): +        ''' +        enemy movement +        ''' +        distance = 80 +        speed = 8 + +        self.movey += 3.2 +        +        if self.counter >= 0 and self.counter <= distance: +            self.rect.x += speed +        elif self.counter >= distance and self.counter <= distance*2: +            self.rect.x -= speed +        else: +            self.counter = 0 +        +        self.counter += 1 + +        if not self.rect.y >= worldy-ty-ty: +            self.rect.y += self.movey + +        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) +        for p in plat_hit_list: +            self.movey = 0 +            if self.rect.y > p.rect.y: +                self.rect.y = p.rect.y+ty +            else: +                self.rect.y = p.rect.y-ty + +        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) +        for g in ground_hit_list: +            self.rect.y = worldy-ty-ty + +        +class Level(): +    def bad(lvl,eloc): +        if lvl == 1: +            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy +            enemy_list = pygame.sprite.Group() # create enemy group +            enemy_list.add(enemy)              # add enemy to group +            +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return enemy_list + +    def loot(lvl,tx,ty): +        if lvl == 1: +            loot_list = pygame.sprite.Group() +            loot = Platform(200,ty*7,tx,ty, 'loot_1.png') +            loot_list.add(loot) + +        if lvl == 2: +            print(lvl) + +        return loot_list + +    def ground(lvl,gloc,tx,ty): +        ground_list = pygame.sprite.Group() +        i=0 +        if lvl == 1: +            while i < len(gloc): +                ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') +                ground_list.add(ground) +                i=i+1 + +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return ground_list + +    def platform(lvl,tx,ty): +        plat_list = pygame.sprite.Group() +        ploc = [] +        i=0 +        if lvl == 1: +            ploc.append((20,worldy-ty-128,3)) +            ploc.append((300,worldy-ty-256,3)) +            ploc.append((500,worldy-ty-128,4)) + +            while i < len(ploc): +                j=0 +                while j <= ploc[i][2]: +                    plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png') +                    plat_list.add(plat) +                    j=j+1 +                print('run' + str(i) + str(ploc[i])) +                i=i+1 + +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return plat_list + +''' +Setup +''' +worldx = 960 +worldy = 720 + +fps = 40 # frame rate +ani = 4  # animation cycles +clock = pygame.time.Clock() +pygame.init() +main = True + +BLUE  = (25,25,200) +BLACK = (23,23,23 ) +WHITE = (254,254,254) +ALPHA = (0,255,0) + +world = pygame.display.set_mode([worldx,worldy]) +backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() +backdropbox = world.get_rect() +player = Player() # spawn player +player.rect.x = 0 +player.rect.y = 0 +player_list = pygame.sprite.Group() +player_list.add(player) +steps = 10 +forwardx = 600 +backwardx = 230 + +eloc = [] +eloc = [200,20] +gloc = [] +#gloc = [0,630,64,630,128,630,192,630,256,630,320,630,384,630] +tx = 64 #tile size +ty = 64 #tile size + +i=0 +while i <= (worldx/tx)+tx: +    gloc.append(i*tx) +    i=i+1 + +enemy_list = Level.bad( 1, eloc ) +ground_list = Level.ground( 1,gloc,tx,ty ) +plat_list = Level.platform( 1,tx,ty ) +loot_list = Level.loot(1,tx,ty) + +''' +Main loop +''' +while main == True: +    for event in pygame.event.get(): +        if event.type == pygame.QUIT: +            pygame.quit(); sys.exit() +            main = False + +        if event.type == pygame.KEYDOWN: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                print("LEFT") +                player.control(-steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                print("RIGHT") +                player.control(steps,0) +            if event.key == pygame.K_UP or event.key == ord('w'): +                print('jump') + +        if event.type == pygame.KEYUP: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                player.control(steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                player.control(-steps,0) +            if event.key == pygame.K_UP or event.key == ord('w'): +                player.jump(plat_list) + +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False + +    # scroll the world forward +    if player.rect.x >= forwardx: +        scroll = player.rect.x - forwardx +        player.rect.x = forwardx +        for p in plat_list: +            p.rect.x -= scroll +        for e in enemy_list: +            e.rect.x -= scroll +        for l in loot_list: +            l.rect.x -= scroll +                +    # scroll the world backward +    if player.rect.x <= backwardx: +        scroll = backwardx - player.rect.x +        player.rect.x = backwardx +        for p in plat_list: +            p.rect.x += scroll +        for e in enemy_list: +            e.rect.x += scroll +        for l in loot_list: +            l.rect.x += scroll + +    world.blit(backdrop, backdropbox)     +    player.gravity() # check gravity +    player.update() +    player_list.draw(world) #refresh player position +    enemy_list.draw(world)  # refresh enemies +    ground_list.draw(world)  # refresh enemies +    plat_list.draw(world)   # refresh platforms +    loot_list.draw(world)   # refresh loot + +    for e in enemy_list: +        e.move() +    pygame.display.flip() +    clock.tick(fps) +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/loot-python-platformer-game + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUS_lovemoneyglory2.png?itok=AvneLxFp (Hearts, stars, and dollar signs) +[2]: https://www.python.org/ +[3]: https://www.pygame.org/news +[4]: https://opensource.com/article/17/10/python-101 +[5]: https://opensource.com/article/17/12/game-framework-python +[6]: https://opensource.com/article/17/12/game-python-add-a-player +[7]: https://opensource.com/article/17/12/game-python-moving-player +[8]: https://opensource.com/article/18/5/pygame-enemy +[9]: https://opensource.com/article/19/11/simulate-gravity-python +[10]: https://opensource.com/article/19/12/jumping-python-platformer-game +[11]: https://opensource.com/article/19/12/python-platformer-game-run +[12]: https://opensource.com/sites/default/files/uploads/pygame-loot.jpg (Loot in Python platformer) From 710ae3242d3bc3c45b19f90796510493bac3029c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Jan 2020 08:38:04 +0800 Subject: [PATCH 182/430] PRF @wxy --- ... Pop-_OS vs Ubuntu- Which One is Better.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md b/translated/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md index 3693d00e22..292ce90348 100644 --- a/translated/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md +++ b/translated/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Pop!_OS vs Ubuntu: Which One is Better?) @@ -12,7 +12,7 @@ Pop!_OS 与 Ubuntu:哪个更棒? 好吧,你可能会发现从[最佳 Linux 发行版][1]列表中选择一个发行版很容易,但是,将两个类似的 Linux 发行版进行比较通常会令人困惑,就像 Pop!_OS 与 Ubuntu 一样。 -有趣的是,Pop!\_OS 基于 [Ubuntu][2]。那么,Pop!\_OS 和 Ubuntu 之间有什么区别呢?为什么要从中选择一个呢? +有趣的是,Pop!\_OS 是基于 [Ubuntu][2] 的。那么,Pop!\_OS 和 Ubuntu 之间有什么区别呢?为什么要从中选择一个呢? 在本文中,我将比较 Pop!_OS 和 Ubuntu(两者都是我的最爱)。 @@ -24,7 +24,7 @@ Pop!_OS 与 Ubuntu:哪个更棒? 发现相似之处可帮助你区分其他差异之处。因此,让我们从一些明显的相似之处开始。 -就像我提到的,Pop!\_OS 是基于 Ubuntu 之上的 Linux 发行版。因此,当你使用 Pop!_OS 时,你将获得使用 Ubuntu 的所有好处(从技术上说,其核心是一样的)。 +就像我提到的,Pop!\_OS 是基于 Ubuntu 之上的 Linux 发行版。因此,当你使用 Pop!\_OS 时,你将获得使用 Ubuntu 的所有好处(从技术上说,其核心是一样的)。 它们都默认带有 [GNOME 桌面环境][4],因此它们具有相似的用户界面(UI)。 @@ -42,7 +42,7 @@ Pop!_OS 与 Ubuntu:哪个更棒? 除了外观之外,[Ubuntu 还通过添加程序坞和其他一些小花巧来定制了 GNOME 的体验][6]。如果你喜欢定制的 GNOME 体验,可能会发现它更好。 -但是,如果你更喜欢纯粹的 GNOME 体验,默认情况下 Pop!_OS 会为你提供。 +但是,如果你更喜欢纯粹的 GNOME 体验,Pop!_OS 默认情况下为你提供的就是这样。 在你亲自尝试之前,我无法说服你。但是,Pop!_OS 中的总体配色方案、图标和主题可以说是令人愉悦的高级用户体验。 @@ -60,7 +60,7 @@ Ubuntu 非常重视 Snap 软件包。这增加了它提供的应用程序的数 我为什么要说这个呢? -因为 Pop!_OS 具有其[自己的官方 PPA][8],并在默认情况下已启用。你会在此处找到一些有用的应用程序,例如 Android Studio、TensorFlow。无需下载 Android Studio 的 1GB 大的 Snap 程序包。只需使用 [apt-get install][9]就可以了。 +因为 Pop!_OS 具有其[自己的官方 PPA][8],并已默认启用。你会在此处找到一些有用的应用程序,例如 Android Studio、TensorFlow。无需下载 Android Studio 的 1GB 大的 Snap 程序包。只需使用 [apt-get install][9]就可以了。 #### 预装应用 @@ -76,13 +76,13 @@ Ubuntu 非常重视 Snap 软件包。这增加了它提供的应用程序的数 ![][11] -对于熟悉 Snap 程序包的用户来说,Ubuntu 的软件中心是比 Pop!_OS 商店更好的解决方案,因为你可以在软件中心中列出快照程序包。 +对于熟悉 Snap 程序包的用户来说,Ubuntu 的软件中心是比 Pop!_OS 商店更好的解决方案,因为你可以在软件中心中列出 Snap 程序包。 -你无法在软件中心中过滤快照包,但是当你在软件中心中发现一个 Snap 包(查看应用程序来源的详细信息为“ Snap store ”/“Snapcraft”)时安装它就更容易了。 +你无法在软件中心中过滤 Snap 软件包,但是当你在软件中心中发现一个 Snap 软件包(查看应用程序来源的详细信息为 “Snap store”/“Snapcraft”)时安装它就更容易了。 -如果你感到困惑,Pop!\_OS 也确实支持快照包。但是,你不会在 Pop!_OS 商店中找到它们,这是唯一的区别。 +可能你会感到困惑,Pop!\_OS 也确实支持 Snap 软件包。但是,你不会在 Pop!\_OS 商店中找到它们,这是唯一的区别。 -如果不确定什么是 Snap 软件包及其功能,可以查看我们的文章[在 Linux 上安装 Snap 应用][12]。 +如果不确定什么是 Snap 软件包及其功能,可以查看我们的文章《[在 Linux 上安装 Snap 应用][12]》。 #### 单独的 NVIDIA/AMD ISO 文件 @@ -96,9 +96,9 @@ Ubuntu 非常重视 Snap 软件包。这增加了它提供的应用程序的数 #### 可靠性与问题 -毫无疑问,这两个[发行版都适合初学者][14],并且相当可靠。如果你想要更好的可靠性和更少的问题,则可能希望一直用长期支持(LTS)版本。 +毫无疑问,这两个[发行版都适合初学者][14],并且相当可靠。如果你想要更好的可靠性和更少的问题,则可能希望一直使用长期支持(LTS)版本。 -当出现新版本的 Ubuntu 时,Pop!_OS 将在其上开发,并有可能解决用户在 Ubuntu 原始发行版上遇到的问题,然后再进行新的升级。这给他们带来了一点优势,但这没什么实质性的不同,因为这些修复最终都可以运用于 Ubuntu。 +当出现新版本的 Ubuntu 时,Pop!_OS 将在其上开发,并有可能解决用户在 Ubuntu 原始发行版上遇到的问题,然后再进行新的升级。这给它们带来了一点优势,但这没什么实质性的不同,因为这些修复最终都可以运用于 Ubuntu。 #### 性能 @@ -110,7 +110,7 @@ Ubuntu 非常重视 Snap 软件包。这增加了它提供的应用程序的数 当然,你可以手动进行一些优化调整以满足要求——无论它们中的哪个不满足你的硬件配置。 -但是,如果你想使用 System76 笔记本电脑,那么 Pop!\_OS 将可以证明自己是 [Linux 领域的苹果][15],因为 Pop!_OS 是针对其硬件量身定制的,与 Ubuntu 有所不同。 +但是,如果你想使用 System76 笔记本电脑,那么 Pop!\_OS 将可以证明自己是 [Linux 领域的苹果][15],因为 Pop!\_OS 是针对其硬件量身定制的,与 Ubuntu 有所不同。 #### 硬件兼容性 @@ -131,7 +131,7 @@ via: https://itsfoss.com/pop-os-vs-ubuntu/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 20ec23ed537d76f5fa3f0ca936b662d398c1a21e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Jan 2020 08:53:40 +0800 Subject: [PATCH 183/430] PUB @wxy https://linux.cn/article-11744-1.html --- .../20191221 Pop-_OS vs Ubuntu- Which One is Better.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191221 Pop-_OS vs Ubuntu- Which One is Better.md (99%) diff --git a/translated/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md b/published/20191221 Pop-_OS vs Ubuntu- Which One is Better.md similarity index 99% rename from translated/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md rename to published/20191221 Pop-_OS vs Ubuntu- Which One is Better.md index 292ce90348..dd86eb3196 100644 --- a/translated/tech/20191221 Pop-_OS vs Ubuntu- Which One is Better.md +++ b/published/20191221 Pop-_OS vs Ubuntu- Which One is Better.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11744-1.html) [#]: subject: (Pop!_OS vs Ubuntu: Which One is Better?) [#]: via: (https://itsfoss.com/pop-os-vs-ubuntu/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From bcba764d318f9d0cce44b30c8c449028246540d0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 3 Jan 2020 08:59:00 +0800 Subject: [PATCH 184/430] translated --- ...nable to Open the MRL- Error -Quick Tip.md | 102 ------------------ ...nable to Open the MRL- Error -Quick Tip.md | 101 +++++++++++++++++ 2 files changed, 101 insertions(+), 102 deletions(-) delete mode 100644 sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md create mode 100644 translated/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md diff --git a/sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md b/sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md deleted file mode 100644 index b8314533cf..0000000000 --- a/sources/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md +++ /dev/null @@ -1,102 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Fixing “VLC is Unable to Open the MRL” Error [Quick Tip]) -[#]: via: (https://itsfoss.com/vlc-is-unable-to-open-the-mrl/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Fixing “VLC is Unable to Open the MRL” Error [Quick Tip] -====== - -One of the [VLC tips][1] is to play YouTube and other online videos with [VLC][2]. This could help you [watch online videos with subtitles][3]. - -But things may not always be simple because at times you’ll encounter this error when trying to open YouTube video with VLC: - -**Your input can’t be opened: -VLC is unable to open the MRL ‘. Check the log for details.** - -![VLC error while playing YouTube videos][4] - -The thing here is that Google doesn’t want you to use any third party application for watching YouTube because then they cannot collect data properly. - -So, they keep changing stuff from their side to make it harder for third party devs to work with YouTube. - -Take [youtube-dl][5] for example. You’ll notice that you cannot [download YouTube videos][6] with it all of a sudden and the simplest solution is to have the latest version of youtube-dl installed. - -Same goes for VLC. If you [install the latest VLC in Ubuntu][7] or whichever operating system you are using, you probably won’t see this error. - -### Fixing “VLC is unable to open the MRL” error - -Let me show you the steps to fix this problem for YouTube at least. - -Go to this page and use Ctrl+S to save the file from the official GitHub repository of VLC media player: - -[Download youtube.lua file][8] - -Now, what you need to do is to replace the youtube.luac (mind the ‘c’ in luac) in lib/vlc/lua/playlist directory with this downloaded file. - -#### Steps for Linux - -If you are using Linux, open the terminal and use the [locate command][9] to find the exact location of youtube.luac file: - -``` -locate youtube.luac -``` - -When you get the path of the file, you just replace that file with your downloaded file. I trust you to handle this simple task. - -For me, it showed the path of the file here: - -``` -[email protected]:~$ locate youtube.lua -/usr/lib/x86_64-linux-gnu/vlc/lua/playlist/youtube.luac -``` - -So all I did was to move the downloaded file to this location and replace the content of the file: - -``` -sudo cp ~/Downloads/youtube.lua /usr/lib/x86_64-linux-gnu/vlc/lua/playlist/youtube.luac -``` - -You should be able to play the YouTube videos in VLC now. - -#### Steps for Windows - -If you are using Windows, you should follow these steps: - - * Rename the downloaded youtube.lua file to youtube.luac - * Now copy this file and paste it to C:\Program Files (x86)\VideoLAN\VLC\lua\playlist\ - - - -That’s it. - -If you have trouble with Dailymotion or other video streaming websites, you can download their respective lua files from the VLC repository [here][10] and replace the existing one in your VLC install. - -I hope this quick tip fixed the problem with VLC unable to play YouTube videos for you. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/vlc-is-unable-to-open-the-mrl/ - -作者:[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/simple-vlc-tips/ -[2]: https://www.videolan.org/index.html -[3]: https://itsfoss.com/penguin-subtitle-player/ -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc_error_input_cant_be_played.png?ssl=1 -[5]: https://itsfoss.com/download-youtube-linux/ -[6]: https://itsfoss.com/download-youtube-videos-ubuntu/ -[7]: https://itsfoss.com/install-latest-vlc/ -[8]: https://raw.githubusercontent.com/videolan/vlc/master/share/lua/playlist/youtube.lua -[9]: https://linuxhandbook.com/locate-command/ -[10]: https://github.com/videolan/vlc/tree/master/share/lua/playlist diff --git a/translated/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md b/translated/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md new file mode 100644 index 0000000000..004f300c56 --- /dev/null +++ b/translated/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fixing “VLC is Unable to Open the MRL” Error [Quick Tip]) +[#]: via: (https://itsfoss.com/vlc-is-unable-to-open-the-mrl/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +修复 “VLC is Unable to Open the MRL” 错误 +====== + +一个使用 [VLC 的技巧][1]是使用 [VLC] [2] 播放 YouTube 和其他在线视频。这可以帮助你[观看带有字幕的在线视频][3]。 + +但是事情并不总是这么简单,因为有时使用 VLC 打开 YouTube 视频时会遇到此错误: + +**Your input can’t be opened: VLC is unable to open the MRL ‘. Check the log for details.** + +![VLC error while playing YouTube videos][4] + +这是因为 Google 不想让你使用任何第三方应用观看 YouTube,因为这样他们就无法正常收集数据。 + +因此,他们不断修改服务端,以使第三发开发更难与 Youtube 集成。 + +以 [youtube-dl][5] 为例。你会发现自己无法突然[下载 YouTube 视频] [6],最简单的方案是安装最新版本的 youtube-dl。 + +对于 VLC 也是如此。如果你[在 Ubuntu 或任何你用的系统中安装了最新的 VLC][7],那么可能不会看到此错误。 + +### 修复 ”VLC is unable to open the MRL“ 错误 + +让我向你展示对于 YouTube 的修复步骤。 + +进入 VLC 媒体播放器的官方 Github 仓库页面,并使用 Ctrl+S 保存文件: + +[Download youtube.lua file][8] + +现在,你需要做的是用此下载文件替换 lib/vlc/lua/playlist 目录中的 youtube.luac(注意 luac 中的 “c”)。 + +#### Linux 中的步骤 + +如果你使用的是 Linux,请打开终端并使用 [locate 命令][9]查找 youtube.luac 文件的确切位置: + +``` +locate youtube.luac +``` + +当你得到文件的路径时,只需将该文件替换为下载的文件即可。我相信你可以完成这项简单的任务。 + +对我而言,以下是文件路径: + +``` +[email protected]:~$ locate youtube.lua +/usr/lib/x86_64-linux-gnu/vlc/lua/playlist/youtube.luac +``` + +因此,我要做的就是将下载的文件移到该位置并替换它的内容: + +``` +sudo cp ~/Downloads/youtube.lua /usr/lib/x86_64-linux-gnu/vlc/lua/playlist/youtube.luac +``` + +你现在应该可以在 VLC 中播放 YouTube 视频了。 + +#### Windows 中的步骤 + +如果你使用的是 Windows,那么应遵循以下步骤: + + * 将下载的 youtube.lua 文件重命名为 youtube.luac + * 复制此文件并将其粘贴到 C:\Program Files (x86)\VideoLAN\VLC\lua\playlist\ + + + +就是这些了。 + +如果你在 Dailymotion 或其他视频流网站上遇到问题,那么可以从 VLC 仓库的[此处][10]下载它们各自的 lua 文件,并替换 VLC 安装中的现有 lua 文件。 + +我希望这个快速提示可以解决 VLC 无法为你播放 YouTube 视频的问题。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/vlc-is-unable-to-open-the-mrl/ + +作者:[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/simple-vlc-tips/ +[2]: https://www.videolan.org/index.html +[3]: https://itsfoss.com/penguin-subtitle-player/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc_error_input_cant_be_played.png?ssl=1 +[5]: https://itsfoss.com/download-youtube-linux/ +[6]: https://itsfoss.com/download-youtube-videos-ubuntu/ +[7]: https://itsfoss.com/install-latest-vlc/ +[8]: https://raw.githubusercontent.com/videolan/vlc/master/share/lua/playlist/youtube.lua +[9]: https://linuxhandbook.com/locate-command/ +[10]: https://github.com/videolan/vlc/tree/master/share/lua/playlist From 00d722679c20875a9ce34b4ab40ee0e24331468d Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 3 Jan 2020 09:05:16 +0800 Subject: [PATCH 185/430] translating --- ...NOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md b/sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md index 96de8997fa..f761c28dd1 100644 --- a/sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md +++ b/sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 44468cd7fbf184224c9354c16e1c588596230d9a Mon Sep 17 00:00:00 2001 From: BrunoJu Date: Fri, 3 Jan 2020 10:56:16 +0800 Subject: [PATCH 186/430] Update 20191231 10 Ansible resources to accelerate your automation skills.md --- ...10 Ansible resources to accelerate your automation skills.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md b/sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md index a522f0c869..5a1dc5dccf 100644 --- a/sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md +++ b/sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (BrunoJu) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 5e91314ff78ea596911f56572f0dba9a49f55790 Mon Sep 17 00:00:00 2001 From: nacyro Date: Fri, 3 Jan 2020 15:59:02 +0800 Subject: [PATCH 187/430] =?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 --- ... and guides to enhance your tech skills.md | 89 ------------------- ... and guides to enhance your tech skills.md | 88 ++++++++++++++++++ 2 files changed, 88 insertions(+), 89 deletions(-) delete mode 100644 sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md create mode 100644 translated/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md diff --git a/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md b/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md deleted file mode 100644 index 7e9e984b63..0000000000 --- a/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (nacyro) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (9 cheat sheets and guides to enhance your tech skills) -[#]: via: (https://opensource.com/article/20/1/cheat-sheets-guides) -[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) - -9 cheat sheets and guides to enhance your tech skills -====== -Kick off the new year with our latest programming cheat sheets and -guides for people of all skill levels. Take our poll to let us know what -you'd like to see next! -![a checklist for a team][1] - -Cheat sheets are perfect for the new coder just starting out on the command line. However, even the most experienced programmers need to lean on references every once in a while. If that pesky keyboard shortcut is just at the tip of your finger, a cheat sheet is perfect to have nearby. Here’s a roundup of our downloadable guides that will set you up for success in 2020. - -### Cheat sheets - -#### [Markdown][2] - -Markdown is not just for coders. Anyone can use it to help bring syntax and structure to a plain text document. This cheat sheet provides Markdown foundations using the CommonMark specification. It also includes syntax for GitHub and GitLab.  - -#### [Linux permissions and users][3] - -Keep commands for managing users close at hand with this Linux cheat sheet. Quickly learn how to add users, delete users, show history, and set permissions. - -#### [Bash][4] - -Once you know Bash, the possibilities at the command line are endless. Our Bash cheat sheet helps you become more efficient with keyboard shortcuts. Before you know it, you'll be running scripts in your sleep (literally).   - -#### [Linux common commands][5] - -It's no wonder that our cheat sheet for common Linux commands is so popular. This cheat sheet is packed with the essentials to get started with installing software and navigating file systems. Print this one out for yourself and your colleagues. - -#### [Microservices][6] - -It seems like everyone is talking about microservices and for good reason. Microservices make applications modular so that they are easier to build and maintain. It's no longer just a buzzword with this cheat sheet. Get to know important terms and learn more about the fundamentals of microservices in [A guide to open source for microservices][7]. - -#### [Java][8] - -This cheat sheet is ideal for beginner and intermediate Java programmers. It includes important context along with code for handling imports, variables, classes, and more. - -#### [pip][9] - -Programmers love using pip commands to help install, manage, and use Python software packages. However, pip can do much more than that. This cheat sheet will teach you how to build wheels and record packages. - -### Guides - -#### [7 essential PyPI libraries][10] - -This collection of Python tutorials will help you learn how to write extensions faster, format your code, automate tests, ensure code consistency, and more using PyPI libraries.  - -#### [Getting started with Kubernetes][11] - -In this approachable guide, author [Scott McCarty][12] uses an unexpected analogy to explain the value of Kubernetes and the steps to get started.  - -* * * - -We'd like to hear from you: Do you have an idea for a new cheat sheet or guide? Take our poll and choose from one of the options, or let us know in the comments. Check out all of our downloads [here][13]. Get alerts about new cheat sheets by [signing up][14] for our email newsletter. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/cheat-sheets-guides - -作者:[Lauren Pritchett][a] -选题:[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/lauren-pritchett -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team) -[2]: https://opensource.com/downloads/cheat-sheet-markdown -[3]: https://opensource.com/downloads/linux-permissions-cheat-sheet -[4]: https://opensource.com/downloads/bash-cheat-sheet -[5]: https://opensource.com/downloads/linux-common-commands-cheat-sheet -[6]: https://opensource.com/downloads/microservices-cheat-sheet -[7]: https://opensource.com/article/19/11/microservices-cheat-sheet -[8]: https://opensource.com/downloads/java-cheat-sheet -[9]: https://opensource.com/downloads/pip-cheat-sheet -[10]: https://opensource.com/downloads/7-essential-pypi-libraries -[11]: https://opensource.com/downloads/getting-started-kubernetes-ebook -[12]: https://opensource.com/users/fatherlinux -[13]: https://opensource.com/downloads/cheat-sheets -[14]: https://opensource.com/email-newsletter diff --git a/translated/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md b/translated/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md new file mode 100644 index 0000000000..15c10736ed --- /dev/null +++ b/translated/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: (nacyro) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 cheat sheets and guides to enhance your tech skills) +[#]: via: (https://opensource.com/article/20/1/cheat-sheets-guides) +[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) + +九个提升你技术技能的备忘单和指南 +====== +用我们最新的编程备忘单和指南来为新年开局,它适合所有技能水平的人。来参加我们的投票,让我们知道你接下来想看什么! + +![a checklist for a team][1] + +对刚接触命令行的新程序员来说备忘单是完美的。然而,即便是最有经验的程序员也需要时不时地依靠参考资料。假如你刚好敲不出那个讨厌的快捷键,那么手边有个备忘单就很赞了。这是一份我们可供下载指南的综述,它将助你在 2020 年取得成功。 + +### 备忘单 + +#### [Markdown][2] + +Markdown 不仅针对程序员,任何人都可以借助它为纯文本文档增添语法和结构。此备忘单提供了使用 CommonMark 规范的 Markdown 要点。它还包括 GitHub 和 GitLab 的语法。 + +#### [Linux 权限和用户][3] + +用这个 Linux 备忘单把用户管理命令放在手边。快速学习如何增删用户、查看历史以及设置权限。 + +#### [Bash][4] + +一旦您了解了 Bash,在命令行中就蕴含了无限可能。我们的 Bash 备忘单可以帮助您更有效地使用键盘快捷键。不知不觉间,您就能易如反掌地运行脚本。 + +#### [Linux 常用命令][5] + +毫不奇怪,我们的 Linux 常用命令备忘单是如此受欢迎。这个备忘单包含了开始安装软件和导览文件系统的要点。为自己和你的同事打印出来吧。 + +#### [微服务][6] + +似乎每个人都在谈论微服务,而且理由很充分。微服务使应用程序模块化,因此更容易构建和维护。它不再只是这个备忘单上的流行语。在 [微服务开源指南][7] 中了解重要的术语并学习更多关于微服务的基础知识。 + +#### [Java][8] + +此备忘单非常适合初级和中级 Java 程序员。它包括重要的上下文以及处理导入、变量、类等的代码。 + +#### [pip][9] + +程序员爱用 pip 命令来帮助安装、管理和使用 Python 软件包。然而,pip 可以做的远不止这些。这个备忘单将教你如何构建 wheels 和 record 包。 + +### 指南 + +#### [七个不可或缺的 PyPI 库][10] + +这组 Python 教程将帮助您学习如何更快地编写扩展、格式化代码、自动化测试、确保代码一致性,以及更多使用 PyPI 库的方法。 + +#### [开始学习 Kubernetes][11] + +在这份平易近人的指南中,作者 [Scott McCarty][12] 用了一个出人意料的类比来解释 Kubernetes 的价值和上手步骤。 + +* * * + +我们想听听你的意见:你对新的备忘单或指南有什么高见?参加我们的投票,从选项中选择一个,或者在评论中告诉我们。点击 [这里][13] 查看我们所有的下载。通过 [注册][14] 我们的电子邮件通讯获得关于新备忘单的提醒。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/cheat-sheets-guides + +作者:[Lauren Pritchett][a] +选题:[lujun9972][b] +译者:[nacyro](https://github.com/nacyro) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lauren-pritchett +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team) +[2]: https://opensource.com/downloads/cheat-sheet-markdown +[3]: https://opensource.com/downloads/linux-permissions-cheat-sheet +[4]: https://opensource.com/downloads/bash-cheat-sheet +[5]: https://opensource.com/downloads/linux-common-commands-cheat-sheet +[6]: https://opensource.com/downloads/microservices-cheat-sheet +[7]: https://opensource.com/article/19/11/microservices-cheat-sheet +[8]: https://opensource.com/downloads/java-cheat-sheet +[9]: https://opensource.com/downloads/pip-cheat-sheet +[10]: https://opensource.com/downloads/7-essential-pypi-libraries +[11]: https://opensource.com/downloads/getting-started-kubernetes-ebook +[12]: https://opensource.com/users/fatherlinux +[13]: https://opensource.com/downloads/cheat-sheets +[14]: https://opensource.com/email-newsletter From 8eeac9210007c607f9b6f694d7195421fd93d1b1 Mon Sep 17 00:00:00 2001 From: nacyro Date: Fri, 3 Jan 2020 16:50:55 +0800 Subject: [PATCH 188/430] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20191031 Advance your awk skills with two easy tutorials.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191031 Advance your awk skills with two easy tutorials.md b/sources/tech/20191031 Advance your awk skills with two easy tutorials.md index f84e4ebe3a..76f7a54e5f 100644 --- a/sources/tech/20191031 Advance your awk skills with two easy tutorials.md +++ b/sources/tech/20191031 Advance your awk skills with two easy tutorials.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (nacyro) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ecf018d5142d2ccf3daf2dee7d58360c6059fef6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Jan 2020 17:44:07 +0800 Subject: [PATCH 189/430] PRF @geekpi --- ...h the Linux Equinox Desktop Environment.md | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md b/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md index cfa8489c40..84c9ed2b1e 100644 --- a/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md +++ b/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Chill out with the Linux Equinox Desktop Environment) @@ -9,20 +9,20 @@ 轻松使用 Linux Equinox 桌面环境 ====== -本文是 24 天 Linux 桌面特别系列的一部分。EDE 不是最迷人、最小或效率最高的桌面。但它的柔和、静音让人平静,它让人感到熟悉舒缓,它的图标主题有趣。 -![Linux penguin at the north pole beside an igloo][1] -我还没有认真用过 Fast Light Toolkit([FLTK] [2]),但我是 C++ GUI 工具箱的粉丝,它非常易于学习,并且即使跨更新时也很可靠。当我发现有一个用 FLTK 构建的桌面环境时,我很想尝试一下,并且我很快为我的决定感到高兴。[Equinox 桌面环境(EDE)][3] 是用 C++ 和 FLTK 为 Unix 桌面编写的快速、简单的桌面。它使用通用的桌面约定,因此外观和感觉都非常熟悉,并且在使用几天后,我发现它的简单性提供了我所喜欢的最低限度的优雅。 +> 本文是 24 天 Linux 桌面特别系列的一部分。EDE 不是最迷人、最小或效率最高的桌面。但它的柔和、安宁让人平静,它让人感到熟悉舒缓,它的图标主题也很有趣。 + +我还没有认真用过 Fast Light Toolkit([FLTK] [2]),但我是 C++ GUI 工具箱的粉丝,它非常易于学习,并且即使进行更新也很可靠。当我发现有一个用 FLTK 构建的桌面环境时,我很想尝试一下,并且我很快为我的决定感到高兴。[Equinox 桌面环境(EDE)][3] 是用 C++ 和 FLTK 为 Unix 桌面编写的快速、简单的桌面环境。它使用通用的桌面约定,因此外观和感觉都非常熟悉,并且在使用几天后,我发现它的简单性提供了我所喜欢的最低限度的优雅。 ![EDE desktop][4] ### 安装 EDE -你可能会发现 EDE 包含在发行版的软件仓库中,但你也可以在它的 [SourceForge 仓库][5]中找到它。如果你已经在运行其他桌面,你可以安全地在同一系统上安装 EDE,因为它仅带来了一些额外的应用,这些应用程序特定于 EDE,因此它们不会妨碍你的其他桌面。 +你可能会发现 EDE 包含在发行版的软件仓库中,但你也可以在它的 [SourceForge 仓库][5]中找到它。如果你已经在运行其他桌面环境,你可以安全地在同一系统上安装 EDE,因为它仅带来了一些额外的应用,这些应用程序特定于 EDE,因此它们不会妨碍你的其他桌面。 -EDE 只是桌面,它使用 [Pekwm][6] 窗口管理器来处理布局。 +EDE 只是桌面环境,它使用 [Pekwm][6] 窗口管理器来处理布局。 -安装 EDE 之后,注销当前的桌面会话,以便你可以登录到新的会话。默认情况下,会话管理器(KDM、GDM、LightDM 或 XDM,取决于你的设置)将继续登录到以前的桌面,因此你必须在登录之前覆盖该桌面。 +安装 EDE 之后,注销当前的桌面会话,以便你可以登录到新的会话。默认情况下,会话管理器(KDM、GDM、LightDM 或 XDM,取决于你的设置)将继续登录到以前的桌面环境,因此你必须在登录之前覆盖该桌面环境。 在 GDM 中: @@ -48,14 +48,12 @@ EDE 的布局恰恰是大多数人在桌面上所期望的布局:左侧的应 EDE 有一个小的配置应用,可用于设置一些简单的选项: - * 背景和图标设置 -  * 屏幕保护程序设置 -  * 时间和时钟 -  * 系统铃声 -  * 键盘 -  * 偏好应用 - - +* 背景和图标设置 +* 屏幕保护程序设置 +* 时间和时钟 +* 系统铃声 +* 键盘 +* 偏好应用 ![EDE Configuration Place][10] @@ -63,7 +61,7 @@ EDE 的功能不多。没有文件管理器、文本编辑器、绘画程序或 ### EDE 总结 -我发现 EDE 至少作为一种”假日“桌面而言,它的简单性令人舒适。它值得一看。它不是最迷人的桌面,也不是最小的、也不是最高效的。但它的柔和、静音让人平静,它让人感到熟悉舒缓,并且它的图标主题充满乐趣和生气。EDE 是一个以其缓慢而稳定的步调而自豪的桌面。 +我发现 EDE 至少作为一种“假日”桌面而言,它的简单性令人舒适。它值得一看。它不是最迷人的桌面,也不是最精简的、也不是最高效的。但它的柔和、安宁让人平静,它让人感到熟悉舒缓,并且它的图标主题充满乐趣和生气。EDE 是一个以其缓慢而稳定的步调而自豪的桌面。 如果你想放松心情使用一个干净和令人愉悦的界面,请试试 EDE。 @@ -74,7 +72,7 @@ via: https://opensource.com/article/19/12/ede-linux-desktop 作者:[Seth Kenlon][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 ebdcc4000c43d02a6b15df7922461277b0433027 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Jan 2020 17:44:37 +0800 Subject: [PATCH 190/430] PUB @geekpi https://linux.cn/article-11745-1.html --- ...24 Chill out with the Linux Equinox Desktop Environment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191224 Chill out with the Linux Equinox Desktop Environment.md (98%) diff --git a/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md b/published/20191224 Chill out with the Linux Equinox Desktop Environment.md similarity index 98% rename from translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md rename to published/20191224 Chill out with the Linux Equinox Desktop Environment.md index 84c9ed2b1e..c6a96672d7 100644 --- a/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md +++ b/published/20191224 Chill out with the Linux Equinox Desktop Environment.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11745-1.html) [#]: subject: (Chill out with the Linux Equinox Desktop Environment) [#]: via: (https://opensource.com/article/19/12/ede-linux-desktop) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 965419e2bece4108bb02ca647ec930b4da6bc229 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Fri, 3 Jan 2020 22:08:52 +0800 Subject: [PATCH 191/430] translating by lxbwolf --- sources/tech/20200101 5 predictions for Kubernetes in 2020.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200101 5 predictions for Kubernetes in 2020.md b/sources/tech/20200101 5 predictions for Kubernetes in 2020.md index 2032983b78..99723632b8 100644 --- a/sources/tech/20200101 5 predictions for Kubernetes in 2020.md +++ b/sources/tech/20200101 5 predictions for Kubernetes in 2020.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 09736cf9fdd2ade647f8c89c1399dfa439912f4c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Jan 2020 23:30:13 +0800 Subject: [PATCH 192/430] PUB --- .../20191227 10 resources to boost your Git skills.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20191227 10 resources to boost your Git skills.md (100%) diff --git a/translated/tech/20191227 10 resources to boost your Git skills.md b/published/20191227 10 resources to boost your Git skills.md similarity index 100% rename from translated/tech/20191227 10 resources to boost your Git skills.md rename to published/20191227 10 resources to boost your Git skills.md From d99886fd6152b9885d359aaa2322db2e15faf2f8 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Fri, 3 Jan 2020 23:31:14 +0800 Subject: [PATCH 193/430] Translating by MjSeven --- .../tech/20191129 How to write a Python web API with Django.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191129 How to write a Python web API with Django.md b/sources/tech/20191129 How to write a Python web API with Django.md index ed16fc40f8..38acb243cd 100644 --- a/sources/tech/20191129 How to write a Python web API with Django.md +++ b/sources/tech/20191129 How to write a Python web API with Django.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 461886a295a1e4ba1f9d14777053ca22e48d0a0e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Jan 2020 00:55:34 +0800 Subject: [PATCH 194/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200103=20Tracki?= =?UTF-8?q?ng=20Translations=20with=20Transtats?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200103 Tracking Translations with Transtats.md --- ...03 Tracking Translations with Transtats.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20200103 Tracking Translations with Transtats.md diff --git a/sources/tech/20200103 Tracking Translations with Transtats.md b/sources/tech/20200103 Tracking Translations with Transtats.md new file mode 100644 index 0000000000..b11a56be66 --- /dev/null +++ b/sources/tech/20200103 Tracking Translations with Transtats.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tracking Translations with Transtats) +[#]: via: (https://fedoramagazine.org/tracking-translations-with-transtats/) +[#]: author: (Sundeep Anand https://fedoramagazine.org/author/suanand/) + +Tracking Translations with Transtats +====== + +![][1] + +Translation is an important step in software localization which helps make software more popular globally, and impacts international user experience. In recent years, localization processes have been evolving worldwide to become more continuous, faster, efficient with automation. In Fedora, the development of the [Zanata][2] platform and its plugins, then [Transtats][3], and now the migration to the [Weblate][4] platform are part of this common ongoing goal. The localization of a desktop OS like Fedora is highly complex because it depends on many factors of the individual upstream projects which are packaged in Fedora. For example, different translation timelines, resources, and tooling. + +### What is Transtats? + +Transtats is a web application which tries to tie up upstream repositories, translation platforms, build system, and product release schedule together to solve problems of mismatch, out-of-sync conditions and to assist the timely packaging of quality translations. Actually, it collects translation data, analyzes them, and creates meaningful representations. + +Fedora Transtats is hosted at + +![][5] + +### How to see the translation status of my package? + +Just select **Packages** tab from left hand side navigation bar. This takes us to the packages list view. Then, search for the package and click on its name. + +![][6] + +For example _anaconda_. On package details page, locate following: + +![][7] + +Here, we have translation statistics from translation platform: [Zanata][8] and [Koji][9] build system. Syncs with the platform and build system are scheduled, which update differences periodically. Languages in red color indicate that there are translated strings remaining in the Translation Platform to be pulled and packaged, whereas, blue denote translated messages could not make 100% in the built package. + +### String breakage (or changes?) + +In translation of software packages, one of the challenges is to prevent string breakage. Package maintainers should strive to abide by the scheduled Fedora release String Freeze. However, in some circumstances it could be necessary to break the string freeze and to inform the translation team on the mailing list. As well as, to update latest translation template (POT) file in the translation platform. Just in case these actions seem missing – translators may get new strings to translate very late or the application may have some strings untranslated. In the worst case, an outdated translation string mismatch may result in a crash. Sync and automation pipelines are there to prevent this, nevertheless it depends on the push or pull methods followed by package developers or maintainers. + +To deal with the same context, we can use a job template in Transtats to detect this string change – particularly useful after string freeze in Fedora release schedule. This would be really helpful for the folks who look for packaging translations without string breakage, keeping translation template (POT) file in sync with translation platform, and testing localized form of the application for translation completeness to back trace. + +### How to detect string changes? + +One of the options in **Jobs** tab is ‘YML based Jobs’. Where we can see available job templates. + +![][10] + +The jobs framework executes all the tasks mentioned in the YAML, create appropriate logs and store results. Track String Change job basically: + + 1. Clones the source repository of respective package. + 2. Tries to generate translation template (POT) file. + 3. Downloads POT file from respective translation platform. + 4. And, finds differences between both the POT files. + + + +_Actually, Transtats maintains mapping of upstream repository, Translation Platform project and respective build tag for every package._ + +![][11] + +Let’s take a closer look into this YAML. We can provide value for %PACKAGE_NAME% and %RELEASE_SLUG% in the next step – **Set Values**! For example: _anaconda_ and _fedora-32_. Furthermore, a couple of things seek attention are: + + * In case the upstream software repository maintains separate git branch for fedora release, please edit ‘branch: master’ to ‘branch: <fedora-release-branch>’ + * In ‘generate’ block, mention the command to generate POT file. Default one should work for ‘intltool-update’ only, however, many packages do have their own. + * A few packages may have gettext domain name different than that of package name. If this is the case, mention the gettext domain too. + + + +As soon as the job is triggered, logs should be populated. If this is not a _scratch_ run, a unique URL shall also be created at the end. + +![][12] + +Left hand side is the input YAML and right hand side is respective log for each task. Here we can find the differences and figure out string mismatch. + +![][13] + +In [Transtats][14], we can create solutions to different problems in the form of job templates. And, scheduling of these jobs could be a step towards automation. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/tracking-translations-with-transtats/ + +作者:[Sundeep Anand][a] +选题:[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/suanand/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/12/transtats-816x345.png +[2]: http://zanata.org/ +[3]: http://transtats.org/ +[4]: https://weblate.org/en/ +[5]: https://fedoramagazine.org/wp-content/uploads/2019/12/transtats-landing-1-1024x450.png +[6]: https://fedoramagazine.org/wp-content/uploads/2019/12/anaconda-pkg.png +[7]: https://fedoramagazine.org/wp-content/uploads/2019/12/anaconda-details.png +[8]: https://fedora.zanata.org/project/view/anaconda +[9]: https://koji.fedoraproject.org/koji +[10]: https://fedoramagazine.org/wp-content/uploads/2019/12/job-templates-1024x361.png +[11]: https://fedoramagazine.org/wp-content/uploads/2019/12/strchgjob.png +[12]: https://fedoramagazine.org/wp-content/uploads/2019/12/string-change-job-log-1024x478.png +[13]: https://fedoramagazine.org/wp-content/uploads/2019/12/string-change-1024x614.png +[14]: https://github.com/transtats/transtats From 647cd510fe8700b5219e8bfb6e3382026cf6f6b8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Jan 2020 00:57:40 +0800 Subject: [PATCH 195/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200104=20Shocki?= =?UTF-8?q?ng!=20EA=20is=20Permanently=20Banning=20Linux=20Gamers=20on=20B?= =?UTF-8?q?attlefield=20V?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md --- ...y Banning Linux Gamers on Battlefield V.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md diff --git a/sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md b/sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md new file mode 100644 index 0000000000..b0d8bb3874 --- /dev/null +++ b/sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Shocking! EA is Permanently Banning Linux Gamers on Battlefield V) +[#]: via: (https://itsfoss.com/ea-banning-linux-gamers/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Shocking! EA is Permanently Banning Linux Gamers on Battlefield V +====== + +Only when I thought that [EA][1] as a game company might be getting better after [its decision to make its games available on Steam][2] – but it looks like that isn’t the case. + +In a [Reddit thread][3], a lot of Linux players seem to complain about getting banned by FairFight (which is the server-side anti-cheat engine used for BF V) just because they chose to play Battlefield V (BF V) on [Linux using Wine][4]. + +![][5] + +### Is this a widespread issue? + +Unfortunately, it seems to be the case with a number of Linux players using Wine to play Battlefield V on Linux. + +You can also find users on [Lutris Gaming forums][6] and [Battlefield forums][7] talking about it. + +Of course, the userbase on Linux playing Battlefield V isn’t huge – but it still matters, right? + +### What’s exactly the issue here? + +It looks like EA’s anti-cheat tech considers [DXVK][8] (Vulkan-based implementation of DirectX which tries to solve compatibility issues) as cheating. + +So, basically, the compatibility layer that is being utilized to make it possible to run Battlefield V is being detected as a modified file through which you’re “**potentially**” cheating. + +![Battlefield V on Lutris][9] + +Even though this could be an innocent problem for the anti-cheat engine but EA does not seem to acknowledge that at all. + +Here’s what they respond with when one of the players wrote an email to EA in order to lift the ban: + +> After thoroughly investigating your account and concern, we found that your account was actioned correctly and will not remove this sanction from your account. + +Also, with all this going on, [Lutris Gaming][10] seems to be quite furious on EA’s behavior with the permanent bans: + +> It has come to our attention that several Battlefield 5 players have recently been banned for playing on Linux, and that EA has chosen not to revert these wrongful punishments. Due to this, we advise to refrain from playing any multiplayer games published by [@EA][11] in the future. +> +> — Lutris Gaming (@LutrisGaming) [January 2, 2020][12] + +### Not just Battlefield V, it’s the same with Destiny 2 + +As pointed by a Redditor in the same thread, Bungie also happens to consider Wine as an emulator (which is against their policy) and has banned players on Linux a while back. + +### EA needs to address the issue + +_We have reached out to EA for a comment on the issue_. _And, we’re still waiting for a response._ + +I shall update the article if we have an official response from EA. However, considering Blizzard as an example, they should actually work on fixing the issue and [reverse the bans on players using Linux][13]. + +I know that BF V does not offer native Linux support – but supporting the compatibility layer and not considering it as cheating would allow Linux users to experience the game which they rightfully own (or considering to purchase). + +What are your thoughts on this? Let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ea-banning-linux-gamers/ + +作者:[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.ea.com/ +[2]: https://thenextweb.com/gaming/2019/10/29/ea-games-are-coming-back-to-steam-but-you-still-need-origin/ +[3]: https://www.reddit.com/r/linux/comments/ej3q2p/ea_is_permanently_banning_linux_players_on/ +[4]: https://itsfoss.com/install-latest-wine/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/reddit-thread-ea.jpg?ssl=1 +[6]: https://forums.lutris.net/t/ea-banning-dxvk-on-battlefield-v/7810 +[7]: https://forums.battlefield.com/en-us/discussion/197938/ea-banning-dxvk-on-battlefield-v-play-linux +[8]: https://github.com/doitsujin/dxvk +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/battlefield-v-lutris-gaming.png?ssl=1 +[10]: https://lutris.net/ +[11]: https://twitter.com/EA?ref_src=twsrc%5Etfw +[12]: https://twitter.com/LutrisGaming/status/1212827248430059520?ref_src=twsrc%5Etfw +[13]: https://www.altchar.com/game-news/blizzard-unbans-overwatch-players-who-used-linux-os-agF9y0G2gWjn From fd094955beb7b002093e38de46058c3b6730236e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Jan 2020 00:58:13 +0800 Subject: [PATCH 196/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200103=20What?= =?UTF-8?q?=20you=20need=20to=20know=20about=20Rust=20in=202020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200103 What you need to know about Rust in 2020.md --- ...hat you need to know about Rust in 2020.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20200103 What you need to know about Rust in 2020.md diff --git a/sources/tech/20200103 What you need to know about Rust in 2020.md b/sources/tech/20200103 What you need to know about Rust in 2020.md new file mode 100644 index 0000000000..ddb91f42ea --- /dev/null +++ b/sources/tech/20200103 What you need to know about Rust in 2020.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What you need to know about Rust in 2020) +[#]: via: (https://opensource.com/article/20/1/rust-resources) +[#]: author: (Ryan Levick https://opensource.com/users/ryanlevick) + +What you need to know about Rust in 2020 +====== +While many programmers have long used Rust for hobby projects, in 2019, +the language attracted support from major technology companies, as the +top Rust articles on Opensource.com explain. +![Person using a laptop][1] + +[Rust][2] has drawn plenty of attention from programmers on sites like Hacker News for a while. While many have long [loved using the language][3] for hobby projects, it didn't start catching on in industry until 2019, when this really started to change. + +Over the last year, many large companies, including [Microsoft][4], [Facebook][5], and [Intel][6], came out in support of Rust, and many [smaller ones][7] took notice. As the first emcee at [RustFest][8], the largest Rust conference in Europe, in 2016, I didn't meet a single person professionally using Rust who didn't work at Mozilla. Three years later, it seemed like every other person I talked to at RustFest 2019 was using Rust in their day job for another company, whether as a game developer, a backend engineer at a bank, a creator of developer tools, or something else. + +In 2019, Opensource.com also played a role by reporting on the growing interest in Rust. In case you missed them, here are the top articles about Rust on Opensource.com over the last year. + +### Building the virtualization stack of the future with rust-vmm + +Amazon's [Firecracker][9] is the virtualization technology that powers AWS Lambda and Fargate, and it is written completely in Rust. One of the technology's authors, Andreea Florescu, offers insight into Firecracker and its related technologies in [_**Building the virtualization stack of the future with rust-vmm**_][10]. + +Firecracker started life as a fork of Google's [CrosVM][11] but quickly diverged due to the differing needs of the two projects. Despite this, there are many common pieces that are best shared across the project and in any other virtual machine manager (VMM) written in Rust. With that in mind, the [rust-vmm][12] project started as a way for Amazon and Google, as well as Intel and Red Hat, to share common Rust "crates" (i.e., packages) with each other and the rest of the open source community. These include interfaces to KVM (Linux virtualization APIs), Virtio device support, and a kernel loader. + +It's truly amazing to see some of the titans of the software industry working together around a common technology stack written in Rust. Given this and other partnerships around [technology stacks written in Rust][13], I wouldn't be surprised to see more of this in 2020. + +### Why to choose Rust as your next programming language + +Adopting a new language, especially at a large company with a long-established technology stack, is no easy task. I had the pleasure of writing [_**Why to choose Rust as your next programming language**_][14] about how Microsoft is looking into adopting Rust when so many other interesting programming languages have not been considered. + +Choosing a programming language involves many different criteria—from technical to organizational to even emotional. Some of these criteria are easier to measure than others. For instance, it's easier to understand the costs of technical changes, like adapting build systems and building new tooling, than it is to understand organizational or emotional issues like how productive or happy developers will be using this new language. What's more, the easy-to-measure criteria are often cost-related, while the hard-to-measure criteria are often benefits-oriented. This often leads to costs getting more weight in the decision-making process, even though it's not necessarily true that the costs outweigh the benefits—it's just that they're easier to measure. This makes it unlikely for a company to adopt a new language. + +However, one of Rust's largest benefits is how easy it is to measure its ability to write secure yet performant systems software. Given that 70% of severe vulnerabilities at Microsoft are due to memory-safety issues that Rust is designed to prevent, and that these issues cost the company billions of dollars per year, it's easy to measure and understand the benefits of adopting the language. + +Whether full-scale adoption of Rust at Microsoft will happen remains to be seen, but Rust's future is bright if only for the fact that is has a clear and measurable benefit over existing technologies. + +### Rust in 2020 + +Rust is really starting to gain traction in industry. Although it still has a long way to go to reach the popularity of languages like C++. I expect more companies to start adopting Rust in 2020. The Rust community must now set its sights on welcoming people and companies into the community while ensuring that the things that have driven the language to this point remain in place. + +Rust is more than just a compiler and a set of libraries. It's a group of people who care about making systems programming easy, safe, and fun. The coming year will be critical in Rust's journey from a hobbyist language to one of the main languages used in the software industry. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/rust-resources + +作者:[Ryan Levick][a] +选题:[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/ryanlevick +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: http://rust-lang.org/ +[3]: https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languages +[4]: https://youtu.be/o01QmYVluSw +[5]: https://youtu.be/kylqq8pEgRs +[6]: https://youtu.be/l9hM0h6IQDo +[7]: https://oxide.computer/blog/introducing-the-oxide-computer-company/ +[8]: https://rustfest.eu +[9]: https://firecracker-microvm.github.io/ +[10]: https://opensource.com/article/19/3/rust-virtual-machine +[11]: https://chromium.googlesource.com/chromiumos/platform/crosvm/ +[12]: https://github.com/rust-vmm +[13]: https://bytecodealliance.org/ +[14]: https://opensource.com/article/19/10/choose-rust-programming-language From 92e78b5fd087fa09872902c82ca0c0e62dd6defa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Jan 2020 00:58:39 +0800 Subject: [PATCH 197/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200103=20My=20R?= =?UTF-8?q?aspberry=20Pi=20retrospective:=206=20projects=20and=20more?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md --- ...y Pi retrospective- 6 projects and more.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md diff --git a/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md b/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md new file mode 100644 index 0000000000..b68e15a924 --- /dev/null +++ b/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (My Raspberry Pi retrospective: 6 projects and more) +[#]: via: (https://opensource.com/article/20/1/raspberry-pi-best) +[#]: author: (Anderson Silva https://opensource.com/users/ansilva) + +My Raspberry Pi retrospective: 6 projects and more +====== +See what I've done with the fun, educational, and useful Raspberry Pi. +![Raspberry Pi 4 board, posterized filter][1] + +Historically and theoretically speaking, a decade, a century, or a millennium starts when the clock turns midnight on January 1 of the year one of its decimal order. For example, the 20th century started on January 1, 1901, not on January 1, 1900. The reason for this is simple: there is no year 0 in our modern calendar, so these periods of time start on year 1 (using the Gregorian calendar). But that's not how we refer to time periods colloquially and culturally; for example, when we mention '80s music or movies, we're talking about the period from 1980 to 1989. + +The recently passed 2010s, I could argue, was the decade of the cloud, social media, mobile technology, and the Internet of Things (IoT), which includes the [Raspberry Pi][2]. Recently, _Time_ magazine called the Raspberry Pi one of the [10 best gadgets of the past decade][3]. And I very much agree. + +The original Raspberry Pi launched in 2012, and it took me a couple of years to jump on the bandwagon and ride on the Pi-train. But since then, I have built many fun educational projects at home and even documented a few of them for Opensource.com. + +### The Christmas light trilogy + +I wrote three articles over three years that explored controlling Christmas lights with the Raspberry Pi and the open source project LightShowPi. The first article, [_Create your own musical light show with Raspberry Pi_][4], was a mix between a very basic introduction to electronics development and building a Christmas light show. The second article, [_SSH into your Christmas tree with Raspberry Pi_][5], went a little deeper into controlling the lights with things such as remote management and electronic buttons. The last chapter of the trilogy, [_Set the holiday mood with your Raspberry Pi_][6], reviewed changes introduced in the LightShowPi project in the prior year. + +### DIY projects + +Over the years, I've turned my Raspberry Pi into several useful devices. One time, I turned the Pi into a [music-playing device with the Pi MusicBox][7], which allows you to plug your favorite music streaming services into a common web interface and play your favorite tunes around the house. + +Making the Raspberry Pi into a [mobile video recording device][8] was another DIY project I put together. It required a few extra pieces of hardware, like a touchscreen, a Pi Camera, and a battery pack, but it worked. One of the biggest drawbacks of this setup was the small amount of memory available on the Pi at the time. I think the capabilities of this little portable camera could be a lot better if I re-did it on a Raspberry Pi 4 with 4GB of RAM. This may be a project to revisit in 2020. + +Another small project I built, a [digital clock for my living room][9], used the small Adafruit PiTFT screen. As simple as this project was, it probably was the one that I used the longest. That clock stood by my TV set for over a year, running 24 hours a day… until the day the screen burned out. + +### The Pi Day series + +Last but not least, in 2019, I contributed [14 articles in 14 days][10] leading up to Pi Day (March 14). This was by far the most challenging writing project I've ever done, but it allowed me to cover many different topics and hopefully expose readers to even more ideas about the versatility of the Raspberry Pi. + +### To infinity and beyond + +I don't know anyone in the Raspberry Pi Foundation, so I don't have any special access to its roadmaps and future plans. I could (but I won't) speculate on what the future holds for the brand and its devices that have allowed so many people of different social statuses around the world to expand their knowledge about computer science, electronics, and open source development. All I hope is for the foundation's management to stay true to its vision and mission and continue making affordable technology for people everywhere. + +The 2010s are over, and what a sweet decade it was. To me, it smelled like pie, raspberry pie. + +Having recently co-authored a book about building things with the Raspberry Pi ( Raspberry Pi Hacks... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/raspberry-pi-best + +作者:[Anderson Silva][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ansilva +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberrypi4_board_hardware.jpg?itok=KnFU7NvR (Raspberry Pi 4 board, posterized filter) +[2]: https://www.raspberrypi.org/ +[3]: https://time.com/5745302/best-gadgets-of-the-2010s-decade/?utm_source=reddit.com +[4]: https://opensource.com/life/15/2/music-light-show-with-raspberry-pi +[5]: https://opensource.com/life/15/12/ssh-your-christmas-tree-raspberry-pi +[6]: https://opensource.com/article/18/12/lightshowpi-raspberry-pi +[7]: https://opensource.com/life/15/3/pi-musicbox-guide +[8]: https://opensource.com/life/15/9/turning-raspberry-pi-portable-streaming-camera +[9]: https://opensource.com/article/17/7/raspberry-pi-clock +[10]: https://opensource.com/article/19/3/happy-pi-day From 1a8473c1a5c9b7fb65bf661589f5845ca0d8bce6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Jan 2020 00:59:05 +0800 Subject: [PATCH 198/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200103=20Introd?= =?UTF-8?q?ucing=20the=20guide=20to=20inter-process=20communication=20in?= =?UTF-8?q?=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md --- ...to inter-process communication in Linux.md | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md diff --git a/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md b/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md new file mode 100644 index 0000000000..c0b7eee940 --- /dev/null +++ b/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md @@ -0,0 +1,176 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Introducing the guide to inter-process communication in Linux) +[#]: via: (https://opensource.com/article/20/1/inter-process-communication-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Introducing the guide to inter-process communication in Linux +====== +This free eBook gives seasoned and occasional coders insight into the +core concepts and mechanisms of inter-process communication (IPC) in +Linux. +![Inter-process Communication in Linux][1] + +Getting one software process to talk to another software process is a delicate balancing act. It can be a vital function for an application, though, so it's a problem any programmer embarking on a complex project has to solve. Whether your application needs to kick off a job being handled by someone else's software; to monitor an action being performed by a peripheral or over a network; or to detect a signal from some other source, when your software relies on something outside of its own code to know what to do next or when to do it, you need to think about inter-process communication (IPC). + +The Unix operating system accounted for this long ago, possibly because of an early expectation that software would originate from diverse sources. In the same tradition, Linux provides many of the same interfaces for IPC and some new ones. The Linux kernel features several IPC methods, and the [util-linux package][2] contains the **ipcmk**, **ipcrm**, **ipcs**, and **lsipc** commands for monitoring and managing IPC messages. + +### Show IPC information + +Before experimenting with IPC, you should know what IPC facilities are already on your system. The **lsipc** command provides that information. + + +``` +RESOURCE DESCRIPTION               LIMIT  USED  USE% +MSGMNI   Number of message queues  32000     0 0.00% +MSGMAX   Max size of message (byt.. 8192     -     - +MSGMNB   Default max size of queue 16384     -     - +SHMMNI   Shared memory segments     4096    79 1.93% +SHMALL   Shared memory pages       184[...] 25452 0.00% +SHMMAX   Max size of shared memory 18446744073692774399 +SHMMIN   Min size of shared memory     1     -     - +SEMMNI   Number of semaphore ident 32000     0 0.00% +SEMMNS   Total number of semaphore 1024000.. 0 0.00% +SEMMSL   Max semaphores per semap  32000     -     - +SEMOPM   Max number of operations p  500     -     - +SEMVMX   Semaphore max value       32767     -     - +``` + +You may notice that this sample listing includes three different types of IPC mechanisms, each available in the Linux kernel: messages (MSG), shared memory (SHM), and semaphores (SEM). You can view current activity in each of those subsystems with the **ipcs** command: + + +``` +$ ipcs + +\------ Message Queues Creators/Owners --- +msqid     perms     cuid      cgid  [...] + +\------ Shared Memory Segment Creators/Owners +shmid     perms    cuid    cgid  [...] +557056    700      seth    users [...] +3571713   700      seth    users [...] +2654210   600      seth    users [...] +2457603   700      seth    users [...] + +\------ Semaphore Arrays Creators/Owners --- +semid     perms     cuid      cgid  [...] +``` + +This shows that there currently are no messages or semaphore arrays, but a number of shared memory segments are in use. + +There's a simple example you can perform on your system so you can see one of these systems at work. It involves some C code, so you must have build tools on your system. The names of the packages you must install to be able to build from source code vary depending on your distro, so refer to your documentation for specifics. For example, on Debian-based distributions, you can learn about build requirements on the [BuildingTutorial][3] section of the wiki, and on Fedora-based distributions, refer to the [Installing software from source][4] section of the docs. + +### Create a message queue + +Your system has a default message queue already, but you can create your own using the **ipcmk** command: + + +``` +$ ipcmk --queue +Message queue id: 32764 +``` + +Write a simple IPC message sender, hard-coding in the queue ID for simplicity: + + +``` +#include <sys/ipc.h> +#include <sys/msg.h> +#include <stdio.h> +#include <string.h> + +struct msgbuffer { +  char text[24]; +} message; + +int main() { +    int msqid = 32764; +    strcpy(message.text,"opensource.com"); +    msgsnd(msqid, &message, sizeof(message), 0); +    printf("Message: %s\n",message.text); +    printf("Queue: %d\n",msqid); +    return 0; +        } +``` + +Compile the application and run it: + + +``` +$ gcc msgsend.c -o msg.bin +$ ./msg.bin +Message: opensource.com +Queue: 32769 +``` + +You just sent a message to your message queue. You can verify that with the **ipcs** command, using the **\--queue** option to limit output to the message queue: + + +``` +$ ipcs -q + +\------ Message Queues -------- +key        msqid   owner  perms  used-bytes  messages +0x7b341ab9 0       seth   666    0          0 +0x72bd8410 32764   seth   644    24         1 +``` + +You can also retrieve those messages with: + + +``` +#include <sys/ipc.h> +#include <sys/msg.h> +#include <stdio.h> + +struct msgbuffer { +    char text[24]; +} message; + +int main() { +    int msqid = 32764; +    msgrcv(msqid, &message, sizeof(message),0,0); +    printf("\nQueue: %d\n",msqid); +    printf("Got this message: %s\n", message.text); +    msgctl(msqid,IPC_RMID,NULL); +    return 0; +``` + +Compile and run with: + + +``` +$ gcc get.c -o get.bin +$ ./get.bin + +Queue: 32764 +Got this message: opensource.com +``` + +### Download [the eBook][5] + +This is just one example of the lessons available in Marty Kalin's [A guide to inter-process communication in Linux][5], the latest free (and Creative Commons) downloadable eBook from Opensource.com. In just a few short lessons, you will learn about POSIX methods of IPC from message queues, shared memory and semaphores, sockets, signals, and much more. Sit down with Marty's book, and you'll emerge a better-informed programmer. But it isn't just for seasoned coders—if all you ever write are shell scripts, there's plenty of practical knowledge about pipes (named and unnamed) and shared files, as well as important concepts you need to know when you use a shared file or an external message queue. + +If you're interested in making great software that's written to be dynamic and system-aware, you need to know about IPC. Let [this book][5] be your guide. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/inter-process-communication-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_inter-process_communication_linux_520x292.png?itok=hPoen7oI (Inter-process Communication in Linux) +[2]: https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/ +[3]: https://wiki.debian.org/BuildingTutorial +[4]: https://docs.pagure.org/docs-fedora/installing-software-from-source.html +[5]: https://opensource.com/downloads/guide-inter-process-communication-linux From 24abcbc7833e4a91ce122e8f552d5dd7d19314ec Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Jan 2020 00:59:46 +0800 Subject: [PATCH 199/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200103=20Add=20?= =?UTF-8?q?scorekeeping=20to=20your=20Python=20game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200103 Add scorekeeping to your Python game.md --- ...03 Add scorekeeping to your Python game.md | 640 ++++++++++++++++++ 1 file changed, 640 insertions(+) create mode 100644 sources/tech/20200103 Add scorekeeping to your Python game.md diff --git a/sources/tech/20200103 Add scorekeeping to your Python game.md b/sources/tech/20200103 Add scorekeeping to your Python game.md new file mode 100644 index 0000000000..d2055cc067 --- /dev/null +++ b/sources/tech/20200103 Add scorekeeping to your Python game.md @@ -0,0 +1,640 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Add scorekeeping to your Python game) +[#]: via: (https://opensource.com/article/20/1/add-scorekeeping-your-python-game) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Add scorekeeping to your Python game +====== +In the tenth article in this series on programming with Python's Pygame +module, display your game player's score when they collect loot or take +damage. +![connecting yellow dots in a maze][1] + +This is part 10 in an ongoing series about creating video games in [Python 3][2] using the [Pygame][3] module. Previous articles are: + + * [Learn how to program in Python by building a simple dice game][4] + * [Build a game framework with Python using the Pygame module][5] + * [How to add a player to your Python game][6] + * [Using Pygame to move your game character around][7] + * [What's a hero without a villain? How to add one to your Python game][8] + * [Simulate gravity in your Python game][9] + * [Add jumping to your Python platformer game][10] + * [Enable your Python game player to run forward and backward][11] + * [Using Python to set up loot in Pygame][12] + + + +If you've followed along with this series, you've learned all the essential syntax and patterns you need to create a video game with Python. However, it still lacks one vital component. This component isn't important just for programming games in Python; it's something you must master no matter what branch of computing you explore: Learning new tricks as a programmer by reading a language's or library's documentation. + +Luckily, the fact that you're reading this article is a sign that you're comfortable with documentation. For the practical purpose of making your platform game more polished, in this article, you will add a score and health display to your game screen. But the not-so-secret agenda of this lesson is to teach you how to find out what a library offers and how you can use new features. + +### Displaying the score in Pygame + +Now that you have loot that your player can collect, there's every reason to keep score so that your player sees just how much loot they've collected. You can also track the player's health so that when they hit one of the enemies, it has a consequence. + +You already have variables that track score and health, but it all happens in the background. This article teaches you to display these statistics in a font of your choice on the game screen during gameplay. + +### Read the docs + +Most Python modules have documentation, and even those that do not can be minimally documented by Python's Help function. [Pygame's main page][13] links to its documentation. However, Pygame is a big module with a lot of documentation, and its docs aren't exactly written in the same approachable (and friendly and elucidating and helpful) narrative style as articles on Opensource.com. They're technical documents, and they list each class and function available in the module, what kind of inputs each expects, and so on. If you're not comfortable referring to descriptions of code components, this can be overwhelming. + +The first thing to do, before bothering with a library's documentation, is to think about what you are trying to achieve. In this case, you want to display the player's score and health on the screen. + +Once you've determined your desired outcome, think about what components are required for it. You can think of this in terms of variables and functions or, if that doesn't come naturally to you yet, you can think generically. You probably recognize that displaying a score requires some text, which you want Pygame to draw on the screen. If you think it through, you might realize that it's not very different from rendering a player or loot or a platform on screen. + +Technically, you _could_ use graphics of numbers and have Pygame display those. It's not the easiest way to achieve your goal, but if it's the only way you know, then it's a valid way. However, if you refer to Pygame's docs, you see that one of the modules listed is **font**, which is Pygame's method for making printing text on the screen as easy as typing. + +### Deciphering technical documentation + +The **font** documentation page starts with **pygame.font.init()**, which it lists as the function that is used to initialize the font module. It's called automatically by **pygame.init()**, which you already call in your code. Once again, you've reached a point that that's technically _good enough_. While you don't know _how_ yet, you know that you _can_ use the **pygame.font** functions to print text on the screen. + +If you read further, however, you find that there's yet an even better way to print fonts. The **pygame.freetype** module is described in the docs this way: + +> The pygame.freetype module is a replacement for pygame.fontpygame module for loading and rendering fonts. It has all of the functionality of the original, plus many new features. + +Further down the **pygame.freetype** documentation page, there's some sample code: + + +``` +import pygame +import pygame.freetype +``` + +Your code already imports Pygame, but modify your **import** statements to include the Freetype module: + + +``` +import pygame +import sys +import os +import pygame.freetype +``` + +### Using a font in Pygame + +From the description of the font modules, it's clear that Pygame uses a font, whether it's one you provide or a default font built into Pygame, to render text on the screen. Scroll through the **pygame.freetype** documentation to find the **pygame.freetype.Font** function: + + +``` +pygame.freetype.Font +Create a new Font instance from a supported font file. + +Font(file, size=0, font_index=0, resolution=0, ucs4=False) -> Font + +pygame.freetype.Font.name +  Proper font name. + +pygame.freetype.Font.path +  Font file path + +pygame.freetype.Font.size +  The default point size used in rendering +``` + +This describes how to construct a font "object" in Pygame. It may not feel natural to you to think of a simple object onscreen as the combination of several code attributes, but it's very similar to how you built your hero and enemy sprites. Instead of an image file, you need a font file. Once you have a font file, you can create a font object in your code with the **pygame.freetype.Font** function and then use that object to render text on the screen. + +Because not everyone in the world has the exact same fonts on their computers, it's important to bundle your chosen font with your game. To bundle a font, first create a new directory in your game folder, right along with the directory you created for your images. Call it **fonts**. + +Even though several fonts come with your computer, it's not legal to give those fonts away. It seems strange, but that's how the law works. If you want to ship a font with your game, you must find an open source or Creative Commons font that permits you to give the font away along with your game. + +Sites that specialize in free and legal fonts include: + + * [Font Library][14] + * [Font Squirrel][15] + * [League of Moveable Type][16] + + + +When you find a font that you like, download it. Extract the ZIP or [TAR][17] file and move the **.ttf** or **.otf** file into the **fonts** folder in your game project directory. + +You aren't installing the font on your computer. You're just placing it in your game's **fonts** folder so that Pygame can use it. You _can_ install the font on your computer if you want, but it's not necessary. The important thing is to have it in your game directory, so Pygame can "trace" it onto the screen. + +If the font file has a complicated name with spaces or special characters, just rename it. The filename is completely arbitrary, and the simpler it is, the easier it is for you to type into your code. + +Now tell Pygame about your font. From the documentation, you know that you'll get a font object in return when you provide at least the path to a font file to **pygame.freetype.Font** (the docs state explicitly that all remaining attributes are optional): + + +``` +`Font(file, size=0, font_index=0, resolution=0, ucs4=False) -> Font` +``` + +Create a new variable called **myfont** to serve as your font in the game, and place the results of the **Font** function into that variable. This example uses the **amazdoom.ttf** font, but you can use whatever font you want. Place this code in your Setup section: + + +``` +font_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"fonts","amazdoom.ttf") +font_size = tx +myfont = pygame.freetype.Font(font_path, font_size) +``` + +### Displaying text in Pygame + +Now that you've created a font object, you need a function to draw the text you want onto the screen. This is the same principle you used to draw the background and platforms in your game. + +First, create a function, and use the **myfont** object to create some text, setting the color to some RGB value. This must be a global function; it does not belong to any specific class: + + +``` +def stats(score,health): +    myfont.render_to(world, (4, 4), "Score:"+str(score), WHITE, None, size=64) +    myfont.render_to(world, (4, 72), "Health:"+str(health), WHITE, None, size=64) +``` + +Of course, you know by now that nothing happens in your game if it's not in the Main loop, so add a call to your **stats** function near the bottom of the file: + + +``` +    for e in enemy_list: +        e.move() +    stats(player.score,player.health) # draw text +    pygame.display.flip() +``` + +Try your game. + +When the player collects loot, the score goes up. When the player gets hit by an enemy, health goes down. Success! + +![Keeping score in Pygame][18] + +There is one problem, though. When a player gets hit by an enemy, health goes _way_ down, and that's not fair. You have just discovered a non-fatal bug. Non-fatal bugs are those little problems in applications that don't keep the application from starting up or even from working (mostly), but they either don't make sense, or they annoy the user. Here's how to fix this one. + +### Fixing the health counter + +The problem with the current health point system is that health is subtracted for every tick of the Pygame clock that the enemy is touching the player. That means that a slow-moving enemy can take a player down to –200 health in just one encounter, and that's not fair. You could, of course, just give your player a starting health score of 10,000 and not worry about it; that would work, and possibly no one would mind. But there is a better way. + +Currently, your code detects when a player and an enemy collide. The fix for the health-point problem is to detect _two_ separate events: when the player and enemy collide and, once they have collided, when they _stop_ colliding. + +First, in your Player class, create a variable to represent when a player and enemy have collided: + + +``` +        self.frame = 0 +        self.health = 10 +        self.damage = 0 +``` + +In the update function of your Player class, _remove_ this block of code: + + +``` +        for enemy in enemy_hit_list: +            self.health -= 1 +            #print(self.health) +``` + +And in its place, check for collision as long as the player is not currently being hit: + + +``` +        if self.damage == 0: +            for enemy in enemy_hit_list: +                if not self.rect.contains(enemy): +                    self.damage = self.rect.colliderect(enemy) +``` + +You might see similarities between the block you deleted and the one you just added. They're both doing the same job, but the new code is more complex. Most importantly, the new code runs only if the player is not _currently_ being hit. That means that this code runs once when a player and enemy collide and not constantly for as long as the collision happens, the way it used to. + +The new code uses two new Pygame functions. The **self.rect.contains** function checks to see if an enemy is currently within the player's bounding box, and **self.rect.colliderect** sets your new **self.damage** variable to one when it is true, no matter how many times it is true. + +Now even three seconds of getting hit by an enemy still looks like one hit to Pygame. + +I discovered these functions by reading through Pygame's documentation. You don't have to read all the docs at once, and you don't have to read every word of each function. However, it's important to spend time with the documentation of a new library or module that you're using; otherwise, you run a high risk of reinventing the wheel. Don't spend an afternoon trying to hack together a solution to something that's already been solved by the framework you're using. Read the docs, find the functions, and benefit from the work of others! + +Finally, add another block of code to detect when the player and the enemy are no longer touching. Then and only then, subtract one point of health from the player. + + +``` +        if self.damage == 1: +            idx = self.rect.collidelist(enemy_hit_list) +            if idx == -1: +                self.damage = 0   # set damage back to 0 +                self.health -= 1  # subtract 1 hp +``` + +Notice that this new code gets triggered _only_ if the player has been hit. That means this code doesn't run while your player is running around your game world exploring or collecting loot. It only runs when the **self.damage** variable gets activated. + +When the code runs, it uses **self.rect.collidelist** to see whether or not the player is _still_ touching an enemy in your enemy list (**collidelist** returns negative one when it detects no collision). Once it is not touching an enemy, it's time to pay the **self.damage** debt: deactivate the **self.damage** variable by setting it back to zero and subtract one point of health. + +Try your game now. + +### Score reaction + +Now that you have a way for your player to know their score and health, you can make certain events occur when your player reaches certain milestones. For instance, maybe there's a special loot item that restores some health points. And maybe a player who reaches zero health points has to start back at the beginning of a level. + +You can check for these events in your code and manipulate your game world accordingly. You already know how, so go skim the documentation for new tricks and try them out on your own. + +Here's all the code so far: + + +``` +#!/usr/bin/env python3 +# draw a world +# add a player and player control +# add player movement +# add enemy and basic collision +# add platform +# add gravity +# add jumping +# add scrolling +# add loot +# add score + +# GNU All-Permissive License +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved.  This file is offered as-is, +# without any warranty. + +import pygame +import sys +import os +import pygame.freetype + +''' +Objects +''' +        +class Platform(pygame.sprite.Sprite): +    # x location, y location, img width, img height, img file     +    def __init__(self,xloc,yloc,imgw,imgh,img): +        pygame.sprite.Sprite.__init__(self) +        self.image = pygame.image.load(os.path.join('images',img)).convert() +        self.image.convert_alpha() +        self.rect = self.image.get_rect() +        self.rect.y = yloc +        self.rect.x = xloc + +class Player(pygame.sprite.Sprite): +    ''' +    Spawn a player +    ''' +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.movex = 0 +        self.movey = 0 +        self.frame = 0 +        self.health = 10 +        self.damage = 0 +        self.collide_delta = 0 +        self.jump_delta = 6 +        self.score = 1 +        self.images = [] +        for i in range(1,9): +            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() +            img.convert_alpha() +            img.set_colorkey(ALPHA) +            self.images.append(img) +            self.image = self.images[0] +            self.rect  = self.image.get_rect() + +    def jump(self,platform_list): +        self.jump_delta = 0 + +    def gravity(self): +        self.movey += 3.2 # how fast player falls +        +        if self.rect.y > worldy and self.movey >= 0: +            self.movey = 0 +            self.rect.y = worldy-ty +        +    def control(self,x,y): +        ''' +        control player movement +        ''' +        self.movex += x +        self.movey += y +        +    def update(self): +        ''' +        Update sprite position +        ''' +        +        self.rect.x = self.rect.x + self.movex +        self.rect.y = self.rect.y + self.movey + +        # moving left +        if self.movex < 0: +            self.frame += 1 +            if self.frame > ani*3: +                self.frame = 0 +            self.image = self.images[self.frame//ani] + +        # moving right +        if self.movex > 0: +            self.frame += 1 +            if self.frame > ani*3: +                self.frame = 0 +            self.image = self.images[(self.frame//ani)+4] + +        # collisions +        enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) +        if self.damage == 0: +            for enemy in enemy_hit_list: +                if not self.rect.contains(enemy): +                    self.damage = self.rect.colliderect(enemy) + +        if self.damage == 1: +            idx = self.rect.collidelist(enemy_hit_list) +            if idx == -1: +                self.damage = 0   # set damage back to 0 +                self.health -= 1  # subtract 1 hp + +        loot_hit_list = pygame.sprite.spritecollide(self, loot_list, False) +        for loot in loot_hit_list: +            loot_list.remove(loot) +            self.score += 1 +            print(self.score) + +        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) +        for p in plat_hit_list: +            self.collide_delta = 0 # stop jumping +            self.movey = 0 +            if self.rect.y > p.rect.y: +                self.rect.y = p.rect.y+ty +            else: +                self.rect.y = p.rect.y-ty +            +        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) +        for g in ground_hit_list: +            self.movey = 0 +            self.rect.y = worldy-ty-ty +            self.collide_delta = 0 # stop jumping +            if self.rect.y > g.rect.y: +                self.health -=1 +                print(self.health) +                +        if self.collide_delta < 6 and self.jump_delta < 6: +            self.jump_delta = 6*2 +            self.movey -= 33  # how high to jump +            self.collide_delta += 6 +            self.jump_delta    += 6 +            +class Enemy(pygame.sprite.Sprite): +    ''' +    Spawn an enemy +    ''' +    def __init__(self,x,y,img): +        pygame.sprite.Sprite.__init__(self) +        self.image = pygame.image.load(os.path.join('images',img)) +        self.movey = 0 +        #self.image.convert_alpha() +        #self.image.set_colorkey(ALPHA) +        self.rect = self.image.get_rect() +        self.rect.x = x +        self.rect.y = y +        self.counter = 0 + +                +    def move(self): +        ''' +        enemy movement +        ''' +        distance = 80 +        speed = 8 + +        self.movey += 3.2 +        +        if self.counter >= 0 and self.counter <= distance: +            self.rect.x += speed +        elif self.counter >= distance and self.counter <= distance*2: +            self.rect.x -= speed +        else: +            self.counter = 0 +        +        self.counter += 1 + +        if not self.rect.y >= worldy-ty-ty: +            self.rect.y += self.movey + +        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) +        for p in plat_hit_list: +            self.movey = 0 +            if self.rect.y > p.rect.y: +                self.rect.y = p.rect.y+ty +            else: +                self.rect.y = p.rect.y-ty + +        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) +        for g in ground_hit_list: +            self.rect.y = worldy-ty-ty + +        +class Level(): +    def bad(lvl,eloc): +        if lvl == 1: +            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy +            enemy_list = pygame.sprite.Group() # create enemy group +            enemy_list.add(enemy)              # add enemy to group +            +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return enemy_list + +    def loot(lvl,tx,ty): +        if lvl == 1: +            loot_list = pygame.sprite.Group() +            loot = Platform(200,ty*7,tx,ty, 'loot_1.png') +            loot_list.add(loot) + +        if lvl == 2: +            print(lvl) + +        return loot_list + +    def ground(lvl,gloc,tx,ty): +        ground_list = pygame.sprite.Group() +        i=0 +        if lvl == 1: +            while i < len(gloc): +                ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') +                ground_list.add(ground) +                i=i+1 + +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return ground_list + +    def platform(lvl,tx,ty): +        plat_list = pygame.sprite.Group() +        ploc = [] +        i=0 +        if lvl == 1: +            ploc.append((20,worldy-ty-128,3)) +            ploc.append((300,worldy-ty-256,3)) +            ploc.append((500,worldy-ty-128,4)) + +            while i < len(ploc): +                j=0 +                while j <= ploc[i][2]: +                    plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png') +                    plat_list.add(plat) +                    j=j+1 +                print('run' + str(i) + str(ploc[i])) +                i=i+1 + +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return plat_list + +def stats(score,health): +    myfont.render_to(world, (4, 4), "Score:"+str(score), SNOWGRAY, None, size=64) +    myfont.render_to(world, (4, 72), "Health:"+str(health), SNOWGRAY, None, size=64) + +''' +Setup +''' +worldx = 960 +worldy = 720 + +fps = 40 # frame rate +ani = 4  # animation cycles +clock = pygame.time.Clock() +pygame.init() +main = True + +BLUE  = (25,25,200) +BLACK = (23,23,23 ) +WHITE = (254,254,254) +SNOWGRAY = (137,164,166) +ALPHA = (0,255,0) +    +world = pygame.display.set_mode([worldx,worldy]) +backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() +backdropbox = world.get_rect() +player = Player() # spawn player +player.rect.x = 0 +player.rect.y = 0 +player_list = pygame.sprite.Group() +player_list.add(player) +steps = 10 +forwardx = 600 +backwardx = 230 + +eloc = [] +eloc = [200,20] +gloc = [] +tx = 64 #tile size +ty = 64 #tile size + +font_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"fonts","amazdoom.ttf") +font_size = tx +myfont = pygame.freetype.Font(font_path, font_size) +    +i=0 +while i <= (worldx/tx)+tx: +    gloc.append(i*tx) +    i=i+1 + +enemy_list = Level.bad( 1, eloc ) +ground_list = Level.ground( 1,gloc,tx,ty ) +plat_list = Level.platform( 1,tx,ty ) +loot_list = Level.loot(1,tx,ty) + +''' +Main loop +''' +while main == True: +    for event in pygame.event.get(): +        if event.type == pygame.QUIT: +            pygame.quit(); sys.exit() +            main = False + +        if event.type == pygame.KEYDOWN: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                print("LEFT") +                player.control(-steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                print("RIGHT") +                player.control(steps,0) +            if event.key == pygame.K_UP or event.key == ord('w'): +                print('jump') + +        if event.type == pygame.KEYUP: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                player.control(steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                player.control(-steps,0) +            if event.key == pygame.K_UP or event.key == ord('w'): +                player.jump(plat_list) + +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False + +    # scroll the world forward +    if player.rect.x >= forwardx: +        scroll = player.rect.x - forwardx +        player.rect.x = forwardx +        for p in plat_list: +            p.rect.x -= scroll +        for e in enemy_list: +            e.rect.x -= scroll +        for l in loot_list: + +            l.rect.x -= scroll +                +    # scroll the world backward +    if player.rect.x <= backwardx: +        scroll = backwardx - player.rect.x +        player.rect.x = backwardx +        for p in plat_list: +            p.rect.x += scroll +        for e in enemy_list: +            e.rect.x += scroll +        for l in loot_list: +            l.rect.x += scroll + +    world.blit(backdrop, backdropbox) +    player.gravity() # check gravity +    player.update() +    player_list.draw(world) #refresh player position +    enemy_list.draw(world)  # refresh enemies +    ground_list.draw(world)  # refresh enemies +    plat_list.draw(world)   # refresh platforms +    loot_list.draw(world)   # refresh loot +    for e in enemy_list: +        e.move() +    stats(player.score,player.health) # draw text +    pygame.display.flip() +    clock.tick(fps) +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/add-scorekeeping-your-python-game + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW_maze.png?itok=mZ5LP4-X (connecting yellow dots in a maze) +[2]: https://www.python.org/ +[3]: https://www.pygame.org/news +[4]: https://opensource.com/article/17/10/python-101 +[5]: https://opensource.com/article/17/12/game-framework-python +[6]: https://opensource.com/article/17/12/game-python-add-a-player +[7]: https://opensource.com/article/17/12/game-python-moving-player +[8]: https://opensource.com/article/18/5/pygame-enemy +[9]: https://opensource.com/article/19/11/simulate-gravity-python +[10]: https://opensource.com/article/19/12/jumping-python-platformer-game +[11]: https://opensource.com/article/19/12/python-platformer-game-run +[12]: https://opensource.com/article/19/12/loot-python-platformer-game +[13]: http://pygame.org/news +[14]: https://fontlibrary.org/ +[15]: https://www.fontsquirrel.com/ +[16]: https://www.theleagueofmoveabletype.com/ +[17]: https://opensource.com/article/17/7/how-unzip-targz-file +[18]: https://opensource.com/sites/default/files/uploads/pygame-score.jpg (Keeping score in Pygame) From b3182a7127a88ff8399d719ea871aa3a8eec5c7c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Jan 2020 06:40:45 +0800 Subject: [PATCH 200/430] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chen-ni 翻译的很棒! --- ...ow to make an old computer useful again.md | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/translated/tech/20190724 How to make an old computer useful again.md b/translated/tech/20190724 How to make an old computer useful again.md index 1df6d5fabd..60497a12b2 100644 --- a/translated/tech/20190724 How to make an old computer useful again.md +++ b/translated/tech/20190724 How to make an old computer useful again.md @@ -1,18 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to make an old computer useful again) [#]: via: (https://opensource.com/article/19/7/how-make-old-computer-useful-again) -[#]: author: (Howard Fosdick https://opensource.com/users/howtechhttps://opensource.com/users/don-watkinshttps://opensource.com/users/suehlehttps://opensource.com/users/aseem-sharmahttps://opensource.com/users/sethhttps://opensource.com/users/marcobravohttps://opensource.com/users/dragonbitehttps://opensource.com/users/don-watkinshttps://opensource.com/users/jamesfhttps://opensource.com/users/seth) +[#]: author: (Howard Fosdick https://opensource.com/users/howtech) 如何把你的老爷机重新利用起来 ====== -按照下面各个步骤,让你的老爷机焕然一新 -![Person typing on a 1980's computer][1] -你的地下室里有一台用来落灰的旧电脑?为什么不把它利用起来呢?如果你常用的电脑坏了,又想用一个比手机更大的屏幕上网,这时候一台备用电脑可能就派上用场了。或者,它也可以充当一台全家人共用的廉价辅助电脑,甚至还可以改造为一台复古游戏机。 +> 按照下面各个步骤,让你的老爷机焕然一新。 + +![](https://img.linux.net.cn/data/attachment/album/202001/04/064017ztl28cn6jjhnjnaj.jpg) + +你的地下室里是不是有一台用来落灰的旧电脑?为什么不把它利用起来呢?如果你常用的电脑坏了,又想用一个比手机更大的屏幕上网,这时候一台备用电脑可能就派上用场了。或者,它也可以充当一台全家人共用的廉价备用电脑,甚至还可以改造为一台复古游戏机。 哪怕是一台有十余年历史的老爷机,只要选对了软件,也可以胜任很多新电脑能够完成的任务。其中的关键在于,要使用开源软件。 @@ -22,7 +24,7 @@ 第一步是检查硬件是否运转正常。如果在这个环节忽略了一个问题,后面可能会让你非常头疼。 -灰尘是电子器件的天敌,所以第一件事应该是打开机箱,清除灰尘。[压缩空气设备][2]这时候可能会派上用场。请注意,进行任何接触电脑的操作时,都应该确保你是[触地][3]的。此外,_避免_ 清洁布与任何物体发生摩擦。即使是一次小到你无法察觉的静电放电,也可能会导致电路损毁。 +灰尘是电子器件的天敌,所以第一件事应该是打开机箱,清除灰尘。[压缩空气设备][2]这时候可能会派上用场。请注意,进行任何接触电脑的操作时,都应该确保[接地][3]。此外,**不要**用清洁布擦拭任何东西。即使是一次小到你无法察觉的静电放电,也可能会导致电路损毁。 清洁工作完成之后,关闭机箱,检查是否所有硬件都可以正常工作。需要测试的项目包括: @@ -31,23 +33,23 @@ * 主板 * 外围设备(DVD 驱动器、USB 接口、声卡,等等) -首先,将计算机启动面板([UEFI][4] 或者是 [BIOS][5]面板)上的诊断测试依次运行一遍。如果不知道按哪个程序功能按键进入你电脑的启动面板,可以参考 [这份列表][6]。 +首先,将计算机启动界面([UEFI][4] 或者是 [BIOS][5] 界面)上的诊断测试依次运行一遍。如果不知道按哪个功能键进入你电脑的启动界面,可以参考 [这份列表][6]。 -此外,也可以使用诸如 [Hirens BootCD][7] 和 [Ultimate Boot CD][8] 之类的免费资源工具包,进行启动面板覆盖不到的测试。这些资源工具包涵盖了数百个测试程序,并且都是免费的,尽管不都开源。运行这些工具包无需安装任何软件,因为它们都是从 U 盘或者 DVD 驱动器启动的。 +此外,也可以使用诸如 [Hirens BootCD][7] 和 [Ultimate Boot CD][8] 之类的免费资源工具包,进行启动界面覆盖不到的测试。这些资源工具包涵盖了数百个测试程序,并且都是免费的,尽管不都开源。运行这些工具包无需安装任何软件,因为它们都是从 U 盘或者 DVD 驱动器启动的。 测试一定要彻底!对于内存和硬盘来说,基础测试还不够,应该运行深度测试,哪怕是运行一整夜也无妨。只有这样,才能够查出那些不易发现的瞬时故障。 -如果发现了问题,可以参考我的[硬件故障排除快速指南][9],帮你解决最常见的硬件问题。 +如果发现了问题,可以参考我的[硬件故障排除快速指南][9],可以帮你解决最常见的硬件问题。 ### 选择软件 电脑翻新的关键在于,根据手头的硬件资源,恰如其分地安装软件。最核心的三种硬件资源分别是: -1. 处理器(核数、速度) +1. 处理器(内核数、速度) 2. 内存 3. 显存 -可以在启动时的 UEFI/BIOS 面板上,弄清楚你电脑的硬件资源。记得抄下数据,以免遗忘。接下来,可以在 [CPU Benchmark][10] 网站上查看你的处理器,该网站除了提供 CPU 的背景资料,还提供一个 CPU 的性能分数。 +可以在启动时的 UEFI/BIOS 界面上,弄清楚你电脑的硬件资源。记得抄下数据,以免遗忘。接下来,可以在 [CPU Benchmark][10] 网站上查看你的处理器,该网站除了提供 CPU 的背景资料,还提供一个 CPU 的性能分数。 了解了硬件性能之后,就可以选择能够在硬件上高效运行的软件了。软件的选择涉及四个重要的层面: @@ -56,19 +58,19 @@ 3. 浏览器 4. 应用 -一个优秀的 Linux 发行版可以满足全部四个层面。不要试图使用已经停止维护的 Windows 版本,例如 Windows 8、Vista 或者 XP,哪怕已经安装在电脑上了。恶意软件的 [风险][11] 你是承受不起的。明智的做法是,使用一个更抗病毒的最新版本操作系统。 +一个优秀的 Linux 发行版可以满足上述全部四个层面。不要试图使用已经停止维护的 Windows 版本,例如 Windows 8、Vista 或者 XP,哪怕已经安装在电脑上了。恶意软件的[风险][11]你是承受不起的。明智的做法是,使用一个更抗病毒的最新版本操作系统。 -那 Windows 7 呢?[维护宽限期][12] 至 2020 年 1 月 14 日结束,也就是说,在此日期之前你还可以获得安全补丁,之后就想都别想了。现在正是迁出 Windows 7 的绝佳时机。 +那 Windows 7 呢?[维护宽限期][12]至 2020 年 1 月 14 日结束,也就是说,在此日期之前你还可以获得安全补丁,之后就想都别想了。现在正是迁出 Windows 7 的绝佳时机。 Linux 的巨大优势在于,有许多专门为过时硬件设计的[发行版][13]。此外,[桌面环境][14]和操作系统在 Linux 的设计中是分开的,你可以自行选择搭配。这一点非常重要,因为桌面环境对低端系统的性能有很大影响。(对于 Windows 和 MacOS 来说,你选择的操作系统版本决定了桌面环境,没得可选。) -Linux 的另一个好处是,拥有数以千计免费且开源的应用,不需要担心激活或者许可的问题。此外,Linux 是可移植的,可以在不同的分区、硬盘、设备或计算机之间,对操作系统和应用进行复制、移动或克隆。(Windows 则不然,使用注册表将系统捆绑在了所安装的计算机上。) +Linux 的另一个好处是,拥有数以千计自由且开源的应用,不需要担心激活或者许可的问题。此外,Linux 是可移植的,可以在不同的分区、硬盘、设备或计算机之间,对操作系统和应用进行复制、移动或克隆。(Windows 则不然,使用注册表将系统捆绑在了所安装的计算机上。) ### 翻新后的电脑能够做什么? 这里讨论的是大约在 2006 年到 2013 年之间生产的双核计算机,尤其是装载了 [Intel 酷睿 2][15] CPU 或 [AMD 速龙 64 X2][16] 系列处理器的计算机。它们的 [CPU 分数][10] 大多在 1000 到 4000 分之间。这种电脑卖不了几个钱,但用在运行轻量级 Linux 软件上,性能还是足够的。 -有一点需要注意:你的电脑应该至少拥有 2 GB 内存,如果不够就进行升级。就我翻新过的电脑来说,使用者用到的内存(不包括数据缓存)一般在 0.5 到 2 GB 之间,很少超过 2 GB。如果将内存升级到 2GB,系统就不至于进行 _swap_,即将硬盘当做内存使用。如果想要获得良好性能,这一点十分关键。 +有一点需要注意:你的电脑应该至少拥有 2 GB 内存,如果不够就进行升级。就我翻新过的电脑来说,使用者用到的内存(不包括数据缓存)一般在 0.5 到 2 GB 之间,很少超过 2 GB。如果将内存升级到 2GB,系统就不至于进行**内存交换**,即将硬盘当做内存使用。如果想要获得良好性能,这一点十分关键。 以我自己为例,我用来写作这篇文章的是一台有十年机龄的翻新电脑。取下 1 GB 内存条之后,它只剩下了 1 GB 内存,然后就慢得像一只乌龟。用它浏览网页,或者是做类似的事情,都让人感到灰心,甚至痛苦。一旦把内存条重新装回去,有了 2 GB 内存,它就立马回到了可以使用的状态。 @@ -76,19 +78,19 @@ Linux 的另一个好处是,拥有数以千计免费且开源的应用,不 ### 翻新电脑的局限 -那么,这些老爷机又有什么局限呢?由于它们的并发比不上最先进的计算机,所以应该使用轻量级浏览器,同时拦截广告(广告正是让网页加载变慢的罪魁祸首)。如果可以使用虚拟专用网络(VPN)拦截广告,为处理器免除广告加载的负荷,那就再好不过。此外,还需要禁用视频自动播放、Flash 以及网页动效;将浏览器上的标签页控制在少数几个,不要同时打开 20 个;以及下载可以开启/禁用 JavaScript 的浏览器扩展。 +那么,这些老爷机又有什么局限呢?由于它们的并发性能比不上最先进的计算机,所以应该使用轻量级浏览器,同时拦截广告(广告正是让网页加载变慢的罪魁祸首)。如果可以使用虚拟专用网络(VPN)拦截广告,为处理器免除加载广告的负荷,那就再好不过。此外,还需要禁用视频自动播放、Flash 以及网页动画效果;将浏览器上的标签页控制在少数几个,不要同时打开 20 个;以及下载可以开启/禁用 JavaScript 的浏览器扩展。 让处理器专注于你目前正在做的事情吧,不要同时打开一堆应用,也不要在后台运行很多程序。图像编辑和视频编辑的高级工具可能会很慢;至于运行虚拟机,还是别想了吧。 -那游戏呢?开源软件仓库提供了数以千计的游戏。这就是我为什么将显存列为三种核心硬件资源之一。如果你的电脑没有显卡,那很可能只有 32 或者 64 MB 的显存。可以增加一张显卡,将显存提升到 256 或者 512 MB,这样一来,处理器密集型的游戏就会顺畅很多了。如果不确定你的电脑有多少显存,可以参考[这里][17]。请注意,需要确保显卡与电脑的[显卡插槽][18](AGP、PCI-Express 或者 PCI)相匹配,同时使用正确的[连接线][19](VGA、DVI 或者 HDMI)。 +那游戏呢?开源软件仓库提供了数以千计的游戏。这就是我为什么将显存列为三种核心硬件资源之一。如果你的电脑没有独立显卡,那很可能只有 32 或者 64 MB 的显存。可以增加一张显卡,将显存提升到 256 或者 512 MB,这样一来,处理器密集型的游戏就会顺畅很多了。如果不确定你的电脑有多少显存,可以参考[这里][17]。请注意,需要确保显卡与电脑的[显卡插槽][18](AGP、PCI-Express 或者 PCI)相匹配,同时使用正确的[连接线][19](VGA、DVI 或者 HDMI)。 #### 与 Windows 系统的兼容性如何? -许多人关心 Linux 与 Windows 系统的兼容性如何。首先,对于任何一个 Windows 程序,都有一个 [Linux 的替代版本][20]。 +许多人关心 Linux 与 Windows 系统的兼容性如何。首先,对于任何一个 Windows 程序,都有一个 [Linux 版本的替代品][20]。 退一步说,即使你真的必须要运行某个特定的 Windows 程序,通常也可以借助 [Wine][21] 在 Linux 上运行。可以在 [Wine 数据库][22] 里查找一下你的应用,看看是否可以在 Wine 上运行,顺便学一些特殊安装技巧。[Winetricks][23] 和 [PlayOnLinux][24] 这两个辅助工具可以帮助你进行安装和配置。 -Wine 的另一个优势是可以运行 Windows 的老版本,例如 Vista、XP、ME/98/95 和 3.1。我认识一个家伙,搭建了一台特别赞的游戏电脑,然后用来玩 XP 上的老游戏。借助 [DOSBox][26],你甚至还可以运行数以千计的[免费 DOS 程序][25]。但是有一点需要注意,如果 Windows 程序可以运行,那么 Windows [病毒][27]也同样可以。你需要保护 Linux 上的 Wine 环境,正如保护任何其他 Windows 环境一样。 +Wine 的另一个优势是可以运行旧版本 Windows(例如 Vista、XP、ME/98/95 和 3.1)上的程序。我认识一个家伙,搭建了一台特别赞的游戏电脑,然后用来玩 XP 上的老游戏。借助 [DOSBox][26],你甚至还可以运行数以千计的[免费 DOS 程序][25]。但是有一点需要注意,如果 Windows 程序可以运行,那么 Windows [病毒][27]也同样可以。你需要保护 Linux 上的 Wine 环境,正如保护任何其他 Windows 环境一样。 对了,与 Microsoft Office 的兼容性又如何呢?我使用的是 LibreOffice,经常编辑并交换 Word 和 Excel 文件,完全没有问题。不过,你应该避免使用隐晦或者过于专业的功能。 @@ -96,7 +98,7 @@ Wine 的另一个优势是可以运行 Windows 的老版本,例如 Vista、XP 假设选择了 Linux 作为操作系统,那么你还需要选择桌面环境、浏览器和各种应用。最简单的方法是,安装一个包含了你所需要的一切的发行版。 -通过从 [live USB][28] U 盘或者 DVD 启动,你无需安装任何程序,就可以尝试不同的发行版。关于在 Linux 或 Windows 上创建可启动的 Linux 的方法,可以参考 [这里][29]。 +通过从 [live USB][28] U 盘或者 DVD 启动,你无需安装任何程序,就可以尝试不同的发行版。关于在 Linux 或 Windows 上创建可启动的 Linux 的方法,可以参考[这里][29]。 我进行电脑翻新的目的是做慈善,所以无法指望电脑使用者具备任何相应知识。我需要的发行版应该具有以下特性: @@ -110,11 +112,11 @@ Wine 的另一个优势是可以运行 Windows 的老版本,例如 Vista、XP * 更重视可靠性,而不是尖端功能 * 可以通过图形化用户界面进行设置,而不是只能通过文本文件进行设置 -许多发行版都能够满足上面的要求。我曾经尝试成功的有 [Mint/Xfce][30]、[Xubuntu,][31] 和 [Lubuntu][32]。前两个发行版使用 Xfce 桌面环境,第三个使用 LXQt。相比 GNOME、Unity、KDE、MATE 和 Cinnamon 这些桌面环境,运行上面这两种桌面环境只需要[更少][33]的处理器和内存资源。 +许多发行版都能够满足上面的要求。我曾经尝试成功的有 [Mint/Xfce][30]、[Xubuntu][31] 和 [Lubuntu][32]。前两个发行版使用 Xfce 桌面环境,第三个使用 LXQt。相比 GNOME、Unity、KDE、MATE 和 Cinnamon 这些桌面环境,运行上面这两种桌面环境只需要[更少][33]的处理器和内存资源。 Xfce 和 LXQt 用起来非常简单,我的客户们之前从未见过 Linux,但是都可以自如使用这些简单的、菜单驱动的用户界面。 -对于旧电脑来说,运行最快速、最高效的浏览器是一件非常重要的事情。[很多人觉得][34] Chromium 是最好的浏览器;此外,我还安装了 Firefox Quantum,因为大家比较熟悉它,并且[它的性能][35]可以和 [Chromium 的性能][36]媲美。我还加上了 Opera,因为它速度快,而且有一些独特功能,比如内置的广告拦截,以及免费的 [虚拟专用网络][37]。Opera 是免费的,但并非开源。 +对于旧电脑来说,运行最快速、最高效的浏览器是一件非常重要的事情。[很多人觉得][34] Chromium 是最好的浏览器;此外,我还安装了 Firefox Quantum,因为大家比较熟悉它,并且[它的性能][35]可以和 [Chromium 的性能][36]媲美。我还加上了 Opera,因为它速度快,而且有一些独特功能,比如内置的广告拦截,以及免费的[虚拟专用网络][37]。Opera 是免费的,但并非开源。 无论你使用什么浏览器,一定要拦截广告和追踪器,尽量降低浏览器的负荷。此外,除非得到你的明确批准,否则视频和 Flash 都不应该被允许运行。 @@ -122,7 +124,7 @@ Xfce 和 LXQt 用起来非常简单,我的客户们之前从未见过 Linux, ### 行动起来吧 -你是否会对翻新后的电脑感到满意呢?就我来说,我所使用的两台电脑的机龄都已经超过十年了,其中一个装载的是 Intel 双核处理器([eMachines T5274a][38]),另一个装载的是 AMD 速龙 64 x2 处理器([HP dc5750][39]),两台电脑都有 2 GB 内存。它们和我的另一台具备四核 i5 处理器和 16 GB 内存 的电脑一样,完全能够胜任我的办公工作。如果说有什么功能是这两台电脑缺失的,那就是运行虚拟机了。 +你是否会对翻新后的电脑感到满意呢?就我来说,我所使用的两台电脑的机龄都已经超过十年了,其中一个装载的是 Intel 双核处理器([eMachines T5274a][38]),另一个装载的是 AMD 速龙 64 x2 处理器([HP dc5750][39]),两台电脑都有 2 GB 内存。它们和我的另一台具备四核 i5 处理器和 16 GB 内存的电脑一样,完全能够胜任我的办公工作。如果说有什么功能是这两台电脑缺失的,那就是运行虚拟机了。 我们生活在一个非常神奇的年代。只需要付出一点努力,就可以将一台机龄在 5 到 12 年之间的旧电脑,翻新为一台具备实用价值的机器。还有什么比这更有趣吗? @@ -133,11 +135,11 @@ via: https://opensource.com/article/19/7/how-make-old-computer-useful-again 作者:[Howard Fosdick][a] 选题:[lujun9972][b] 译者:[chen-ni](https://github.com/chen-ni) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]: https://opensource.com/users/howtechhttps://opensource.com/users/don-watkinshttps://opensource.com/users/suehlehttps://opensource.com/users/aseem-sharmahttps://opensource.com/users/sethhttps://opensource.com/users/marcobravohttps://opensource.com/users/dragonbitehttps://opensource.com/users/don-watkinshttps://opensource.com/users/jamesfhttps://opensource.com/users/seth +[a]: https://opensource.com/users/howtech [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) [2]: https://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=compressed+air+for+computers&rh=i%3Aaps%2Ck%3Acompressed+air+for+computers From 5d8cd4cc24adb26cc85a9d42d60913d2e70529ae Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Jan 2020 06:41:56 +0800 Subject: [PATCH 201/430] PUB @chen-ni https://linux.cn/article-11746-1.html --- .../20190724 How to make an old computer useful again.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190724 How to make an old computer useful again.md (99%) diff --git a/translated/tech/20190724 How to make an old computer useful again.md b/published/20190724 How to make an old computer useful again.md similarity index 99% rename from translated/tech/20190724 How to make an old computer useful again.md rename to published/20190724 How to make an old computer useful again.md index 60497a12b2..726436a18a 100644 --- a/translated/tech/20190724 How to make an old computer useful again.md +++ b/published/20190724 How to make an old computer useful again.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11746-1.html) [#]: subject: (How to make an old computer useful again) [#]: via: (https://opensource.com/article/19/7/how-make-old-computer-useful-again) [#]: author: (Howard Fosdick https://opensource.com/users/howtech) From 3b9e205119021823c081167b846c92e8c91f12fd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 Jan 2020 07:24:32 +0800 Subject: [PATCH 202/430] Rename sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md to sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md --- ...ng- EA is Permanently Banning Linux Gamers on Battlefield V.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md (100%) diff --git a/sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md b/sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md similarity index 100% rename from sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md rename to sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md From a631c447635fe5f90954201d1cd1761d26ed0b81 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 Jan 2020 07:26:42 +0800 Subject: [PATCH 203/430] Rename sources/tech/20200103 What you need to know about Rust in 2020.md to sources/talk/20200103 What you need to know about Rust in 2020.md --- .../20200103 What you need to know about Rust in 2020.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200103 What you need to know about Rust in 2020.md (100%) diff --git a/sources/tech/20200103 What you need to know about Rust in 2020.md b/sources/talk/20200103 What you need to know about Rust in 2020.md similarity index 100% rename from sources/tech/20200103 What you need to know about Rust in 2020.md rename to sources/talk/20200103 What you need to know about Rust in 2020.md From eac7d5f5049f0ff08489f2bb365972e881a2e02f Mon Sep 17 00:00:00 2001 From: BrunoJu Date: Sat, 4 Jan 2020 09:24:29 +0800 Subject: [PATCH 204/430] Update article Update article: 10 Ansible resources to accelerate your automation skills --- ...es to accelerate your automation skills.md | 70 ------------------- ...es to accelerate your automation skills.md | 65 +++++++++++++++++ 2 files changed, 65 insertions(+), 70 deletions(-) delete mode 100644 sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md create mode 100644 translated/tech/20191231 10 Ansible resources to accelerate your automation skills.md diff --git a/sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md b/sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md deleted file mode 100644 index 5a1dc5dccf..0000000000 --- a/sources/tech/20191231 10 Ansible resources to accelerate your automation skills.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (BrunoJu) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (10 Ansible resources to accelerate your automation skills) -[#]: via: (https://opensource.com/article/19/12/ansible-resources) -[#]: author: (James Farrell https://opensource.com/users/jamesf) - -10 Ansible resources to accelerate your automation skills -====== -Gear up and get crackin' with awesome Ansible automation skills this -year. -![Gears above purple clouds][1] - -This year saw a wide range of really helpful Ansible articles. Whether you are just starting out with Ansible or a seasoned pro, there is something for everyone here to learn from. - -A good number of these articles are worthy of your bookmarking and perhaps a cron (or maybe a Tower/AWX job) reminder to reread them periodically. - -If you are new to Ansible, start with the following articles: - - * [_A quickstart guide to Ansible_][2] has some good starter information as well as deeper dives into more advanced topics - * [_10 Ansible modules you need to know_][3] and [_5 ops tasks to do with Ansible_][4] review some of the more fundamental functions that every Ansible admin should be familiar with - * [_How to use Ansible to document procedures_][5] also presents a survey of additional topics you might find it interesting to follow up on - - - -The remainder of these articles cover more advanced topics like Windows management, testing, hardware, cloud, and containers—and even a case study in managing the demands of tech-curious children. - -I hope you enjoyed this Ansible year as much as I did. Never stop learning! - - 1. _[How Ansible brought peace to my home][6]_ is a whimsical case study in applying Ansible skills to quickly provision new (or rather old) laptops for my children. - 2. _[Ansible for the Windows admin][7]_ by Taz Brown and Abner Malivert: Did you know Ansible can manage Windows nodes as well? This piece reviews basic Ansible server and Windows client setups with an example on how to deploy an IIS server. - 3. _[10 Ansible modules you need to know][3]_ by Shashank Hegde is a great place to start for some of the most common and basic Ansible modules all admins should know. Running commands, installing packages, and handling files are the basis for many useful automation plays. - 4. _[How to use Ansible to document procedures][5]_ by Marco Bravo: Ansible’s YAML files make for easy reading, so much so that they can be used to document the manual steps needed to accomplish a task. This makes your work easier to debug and extend later on. Also contained in this article are pointers on related topics like testing and analysis. - 5. _[Using Testinfra with Ansible to verify server state][8]_ by Clement Verna: Testing is an integral part of any CI/CD DevOps pipeline, so why not test Ansible’s results as well? This primer on Testinfra can be used to help check the configuration results you need. - 6. _[Hardware bootstrapping with Ansible][9]_ by Mark Phillips: Not all the world is containers and virtual machines. Many of us sysadmins still have significant hardware deployments to manage. With a little PXE dust and DHCP magic (among other tidbits), you can create a convenient framework using Ansible to get real hardware up and running easily. - 7. _[What you need to know about Ansible modules][10]_ by Jairo da Silva Junior: Modules bring real power to Ansible. Many modules are already available, but when there is none, you may need to roll your own. Read this article to look a bit deeper into how modules are made. - 8. _[5 ops tasks to do with Ansible][4]_ by Mark Phillips: This is another more basic review of Ansible use to manage common system operations tasks. The draw here is the list of examples given in Tower (or AWX) instead of the old familiar command line. - 9. _[A quickstart guide to Ansible][2]_ by Chris Short is a great PDF download that you should keep on hand and reread from time to time. It begins with a great primer to get started in Ansible. It also covers other areas of interest including Molecule testing, sysadmin tasks, and Kubernetes object management, to name a few. - 10. _[An Ansible reference guide, CI/CD with Ansible Tower and GitHub, and more news][11]_ by Mark Phillips: This is a monthly round-up article full of interesting links to follow. Topics span Ansible basics, managing Netapp E-Series storage, debugging, patching, and more. Videos are included here as well as some pointers to Ansible meetup groups. Check it out! - - - -Let us know if you had a favorite Ansible article this year and why in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/ansible-resources - -作者:[James Farrell][a] -选题:[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/jamesf -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chaos_engineer_monster_scary_devops_gear_kubernetes.png?itok=GPYLvfVh (Gears above purple clouds) -[2]: https://opensource.com/article/19/2/quickstart-guide-ansible -[3]: https://opensource.com/article/19/9/must-know-ansible-modules -[4]: https://opensource.com/article/19/8/ops-tasks-ansible -[5]: https://opensource.com/article/19/4/ansible-procedures -[6]: https://opensource.com/article/19/9/ansible-documentation-kids-laptops -[7]: https://opensource.com/article/19/2/ansible-windows-admin -[8]: https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state -[9]: https://opensource.com/article/19/5/hardware-bootstrapping-ansible -[10]: https://opensource.com/article/19/3/developing-ansible-modules -[11]: https://opensource.com/article/19/7/ansible-news-edition-one diff --git a/translated/tech/20191231 10 Ansible resources to accelerate your automation skills.md b/translated/tech/20191231 10 Ansible resources to accelerate your automation skills.md new file mode 100644 index 0000000000..f50180a6d7 --- /dev/null +++ b/translated/tech/20191231 10 Ansible resources to accelerate your automation skills.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: (BrunoJu) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (10 Ansible resources to accelerate your automation skills) +[#]: via: (https://opensource.com/article/19/12/ansible-resources) +[#]: author: (James Farrell https://opensource.com/users/jamesf) + +提升自动化技巧的10大Ansible资源 +====== +今年,准备好,用出色的Ansible自动化技能装备自己的技能包吧。 + +![Gears above purple clouds][1] + +今年我关注了大量关于Ansible的文章,以下这些内容都值得每个人学习,无论是否是Ansible的新手。 + +这些文章值得大家标记为书签,或者设置个计划任务(亦或者是设置一个Tower/AWX job),用来提醒自己常读常新。 +如果你是Ansible的新手,那么就从这些文章开始着手吧: + * [_A quickstart guide to Ansible_][2] 拥有一些对新手非常有用的信息,同时还有一些更高级的话题。 + * [_10 Ansible modules you need to know_][3] 和 [_5 ops tasks to do with Ansible_][4] 这篇文章有每一位Ansible的管理者都应该熟悉并认真研习的一些最基础的Ansible功能 + * [_How to use Ansible to document procedures_][5] 这篇文章是对一些额外话题的纵览,我猜你一定会感到很有趣。 + + +剩余的这些文章包含了更多高级的话题,比如Windows管理,测试、硬件、云和容器,甚至包括了一个案例研究,如何管理那些对技术有兴趣的孩子的需求。 + +我希望你能像我一样好好享受Ansible带来的乐趣。不要停止学习哦! + 1. _[How Ansible brought peace to my home][6]_ 这个异想天开的案例,你能看到如何利用Ansible为孩子们快速部署一个新的笔记本(或者重装旧笔记本) + 2. _[Ansible for the Windows admin][7]_ 你知道Ansible也可以管理Windows的节点吗?这篇文章以部署一个IIS为案例,阐述了基础的Ansible服务器和Windows客户端的安装。 + 3. _[10 Ansible modules you need to know][3]_ 这是个学习你最应该知道的那些最常见最基础Ansible模块的好文章。执行命令、安装系统包和操作文件是许多有用的自动化工作的基础。 + 4. _[How to use Ansible to document procedures][5]_  Ansible的YAML文件易于阅读,因此它们可以被用于记录完成任务所需的手动步骤。这一特性可以帮助你调试与扩展,这令工作变得异常轻松。同时,这篇文章还包含关于测试和分析等Ansible相关主题的指导。 + 5. _[Using Testinfra with Ansible to verify server state][8]_ 测试环节是任何一个 CI/CD 开发型运维场景不可或缺的一部分。所以为什么不把测试Ansible的运行结果也纳入其中呢?这个有关于Ansible测试架构的入门级文章可以被用来帮助你配置。 + 6. _[Hardware bootstrapping with Ansible][9]_ 这个世界并不是完全已经被容器和虚拟机所占据。许多系统管理员仍然需要管理众多硬件资源。通过Ansible与PXE、DHCP以及其他一些技术的结合,你可以创建一个简单的管理框架,对硬件实施控制。 + 7. _[What you need to know about Ansible modules][10]_ 模块给Ansible带来了巨大的潜力,许多模块我们已经可以拿来利用。但如果没有你所需的模块,那你可以尝试给自己造一个。看看这篇文章吧,它能让你了解如何从零开始打造自己所需的模块。 + 8. _[5 ops tasks to do with Ansible][4]_ 这是另一个有关于如何使用Ansible来管理常见的系统操作任务的文章。这里描述了一系列可以取代命令行操作的Tower(AWX)的案例。 + 9. _[A quickstart guide to Ansible][2]_ 这篇文章是个可以下载的PDF文档。它可以作为一本随时拿来翻阅的手册。这篇文章的开头有助于初学者入门。同时,还包括了一些其他的研究领域,比如模块测试、系统管理任务和针对K8S对象的管理。 + 10. _[An Ansible reference guide, CI/CD with Ansible Tower and GitHub, and more news][11]_ 这是一篇每月进行总结更新的文章,充满了有趣的链接。话题包括了Ansible的基础内容、管理Netapp的E系列存储产品、调试、打补丁包和其他一些相关内容。文章中还包括了一些视频以及指导性文章的链接。击这里查看详情! + + +如果你也有一些你喜爱的Ansible文章,那请留言告诉我们吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/ansible-resources + +作者:[James Farrell][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/BrunoJu) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jamesf +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chaos_engineer_monster_scary_devops_gear_kubernetes.png?itok=GPYLvfVh (Gears above purple clouds) +[2]: https://opensource.com/article/19/2/quickstart-guide-ansible +[3]: https://opensource.com/article/19/9/must-know-ansible-modules +[4]: https://opensource.com/article/19/8/ops-tasks-ansible +[5]: https://opensource.com/article/19/4/ansible-procedures +[6]: https://opensource.com/article/19/9/ansible-documentation-kids-laptops +[7]: https://opensource.com/article/19/2/ansible-windows-admin +[8]: https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state +[9]: https://opensource.com/article/19/5/hardware-bootstrapping-ansible +[10]: https://opensource.com/article/19/3/developing-ansible-modules +[11]: https://opensource.com/article/19/7/ansible-news-edition-one From 0e26c268164396e4dbbc564da69aa03285207db4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Jan 2020 21:20:02 +0800 Subject: [PATCH 205/430] APL --- sources/tech/20190405 File sharing with Git.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190405 File sharing with Git.md b/sources/tech/20190405 File sharing with Git.md index 13f95b8287..7f135cc3ca 100644 --- a/sources/tech/20190405 File sharing with Git.md +++ b/sources/tech/20190405 File sharing with Git.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6cab90062f2eb3d2f5d8d4f48325a71ea5cd6961 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Jan 2020 23:03:01 +0800 Subject: [PATCH 206/430] TSL --- .../tech/20190405 File sharing with Git.md | 234 ------------------ .../tech/20190405 File sharing with Git.md | 231 +++++++++++++++++ 2 files changed, 231 insertions(+), 234 deletions(-) delete mode 100644 sources/tech/20190405 File sharing with Git.md create mode 100644 translated/tech/20190405 File sharing with Git.md diff --git a/sources/tech/20190405 File sharing with Git.md b/sources/tech/20190405 File sharing with Git.md deleted file mode 100644 index 7f135cc3ca..0000000000 --- a/sources/tech/20190405 File sharing with Git.md +++ /dev/null @@ -1,234 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (File sharing with Git) -[#]: via: (https://opensource.com/article/19/4/file-sharing-git) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -File sharing with Git -====== -SparkleShare is an open source, Git-based, Dropbox-style file sharing -application. Learn more in our series about little-known uses of Git. -![][1] - -[Git][2] is one of those rare applications that has managed to encapsulate so much of modern computing into one program that it ends up serving as the computational engine for many other applications. While it's best-known for tracking source code changes in software development, it has many other uses that can make your life easier and more organized. In this series leading up to Git's 14th anniversary on April 7, we'll share seven little-known ways to use Git. Today, we'll look at SparkleShare, which uses Git as the backbone for file sharing. - -### Git for file sharing - -One of the nice things about Git is that it's inherently distributed. It's built to share. Even if you're sharing a repository just with other computers on your own network, Git brings transparency to the act of getting files from a shared location. - -As interfaces go, Git is pretty simple. It varies from user to user, but the common incantation when sitting down to get some work done is just **git pull** or maybe the slightly more complex **git pull && git checkout -b my-branch**. Still, for some people, the idea of _entering a command_ into their computer at all is confusing or bothersome. Computers are meant to make life easy, and computers are good at repetitious tasks, and so there are easier ways to share files with Git. - -### SparkleShare - -The [SparkleShare][3] project is a cross-platform, open source, Dropbox-style file sharing application based on Git. It automates all Git commands, triggering the add, commit, push, and pull processes with the simple act of dragging-and-dropping a file into a specially designated SparkleShare directory. Because it is based on Git, you get fast, diff-based pushes and pulls, and you inherit all the benefits of Git version control and backend infrastructure (like Git hooks). It can be entirely self-hosted, or you can use it with Git hosting services like [GitLab][4], GitHub, Bitbucket, and others. Furthermore, because it's basically just a frontend to Git, you can access your SparkleShare files on devices that may not have a SparkleShare client but do have Git clients. - -Just as you get all the benefits of Git, you also get all the usual Git restrictions: It's impractical to use SparkleShare to store hundreds of photos and music and videos because Git is designed and optimized for text. Git certainly has the capability to store large files of binary data but it is designed to track history, so once a file is added to it, it's nearly impossible to completely remove it. This somewhat limits the usefulness of SparkleShare for some people, but it makes it ideal for many workflows, including [calendaring][5]. - -#### Installing SparkleShare - -SparkleShare is cross-platform, with installers for Windows and Mac available from its [website][6]. For Linux, there's a [Flatpak][7] in your software installer, or you can run these commands in a terminal: - - -``` -$ sudo flatpak remote-add flathub -$ sudo flatpak install flathub org.sparkleshare.SparkleShare -``` - -### Creating a Git repository - -SparkleShare isn't software-as-a-service (SaaS). You run SparkleShare on your computer to communicate with a Git repository—SparkleShare doesn't store your data. If you don't have a Git repository to sync a folder with yet, you must create one before launching SparkleShare. You have three options: hosted Git, self-hosted Git, or self-hosted SparkleShare. - -#### Git hosting - -SparkleShare can use any Git repository you can access for storage, so if you have or create an account with GitLab or any other hosting service, it can become the backend for your SparkleShare. For example, the open source [Notabug.org][8] service is a Git hosting service like GitHub and GitLab, but unique enough to prove SparkleShare's flexibility. Creating a new repository differs from host to host depending on the user interface, but all of the major ones follow the same general model. - -First, locate the button in your hosting service to create a new project or repository and click on it to begin. Then step through the repository creation process, providing a name for your repository, privacy level (repositories often default to being public), and whether or not to initialize the repository with a README file. Whether you need a README or not, enable an initial README file. Starting a repository with a file isn't strictly necessary, but it forces the Git host to instantiate a **master** branch in the repository, which helps ensure that frontend applications like SparkleShare have a branch to commit and push to. It's also useful for you to see a file, even if it's an almost empty README file, to confirm that you have connected. - -![Creating a Git repository][9] - -Once you've created a repository, obtain the URL it uses for SSH clones. You can get this URL the same way anyone gets any URL for a Git project: navigate to the page of the repository and look for the **Clone** button or field. - -![Cloning a URL on GitHub][10] - -Cloning a GitHub URL. - -![Cloning a URL on GitLab][11] - -Cloning a GitLab URL. - -This is the address SparkleShare uses to reach your data, so make note of it. Your Git repository is now configured. - -#### Self-hosted Git - -You can use SparkleShare to access a Git repository on any computer you have access to. No special setup is required, aside from a bare Git repository. However, if you want to give access to your Git repository to anyone else, then you should run a Git manager like [Gitolite][12] or SparkleShare's own Dazzle server to help you manage SSH keys and accounts. At the very least, create a user specific to Git so that users with access to your Git repository don't also automatically gain access to the rest of your server. - -Log into your server as the Git user (or yourself, if you're very good at managing user and group permissions) and create a repository: - - -``` -$ mkdir ~/sparkly.git -$ cd ~/sparkly.git -$ git init --bare . -``` - -Your Git repository is now configured. - -#### Dazzle - -SparkleShare's developers provide a Git management system called [Dazzle][13] to help you self-host Git repositories. - -On your server, download the Dazzle application to some location in your path: - - -``` -$ curl \ -\--output ~/bin/dazzle -$ chmod +x ~/bin/dazzle -``` - -Dazzle sets up a user specific to Git and SparkleShare and also implements access rights based on keys generated by the SparkleShare application. For now, just set up a project: - - -``` -`$ dazzle create sparkly` -``` - -Your server is now configured as a SparkleShare host. - -### Configuring SparkleShare - -When you launch SparkleShare for the first time, you are prompted to configure what server you want SparkleShare to use for storage. This process may feel like a first-run setup wizard, but it's actually the usual process for setting up a new shared location within SparkleShare. Unlike many shared drive applications, with SparkleShare you can have several locations configured at once. The first shared location you configure isn't any more significant than any shared location you may set up later, and you're not signing up with SparkleShare or any other service. You're just pointing SparkleShare at a Git repository so that it knows what to keep your first SparkleShare folder in sync with. - -On the first screen, identify yourself by whatever means you want on record in the Git commits that SparkleShare makes on your behalf. You can use anything, even fake information that resolves to nothing. It's purely for the commit messages, which you may never even see if you have no interest in reviewing the Git backend processes. - -The next screen prompts you to choose your hosting type. If you are using GitLab, GitHub, Planio, or Bitbucket, then select the appropriate one. For anything else, select **Own server**. - -![Choosing a Sparkleshare host][14] - -At the bottom of this screen, you must enter the SSH clone URL. If you're self-hosting, the address is something like **** and the remote path is the absolute path to the Git repository you created for this purpose. - -Based on my self-hosted examples above, the address to my imaginary server is **** (the **:22122** indicates a nonstandard SSH port) and the remote path is **/home/git/sparkly.git**. - -If I use my Notabug.org account instead, the address from the example above is **[git@notabug.org][15]** and the path is **seth/sparkly.git**. - -SparkleShare will fail the first time it attempts to connect to the host because you have not yet copied the SparkleShare client ID (an SSH key specific to the SparkleShare application) to the Git host. This is expected, so don't cancel the process. Leave the SparkleShare setup window open and obtain the client ID from the SparkleShare icon in your system tray. Then copy the client ID to your clipboard so you can add it to your Git host. - -![Getting the client ID from Sparkleshare][16] - -#### Adding your client ID to a hosted Git account - -Minor UI differences aside, adding an SSH key (which is all the client ID is) is basically the same process on any hosting service. In your Git host's web dashboard, navigate to your user settings and find the **SSH Keys** category. Click the **Add New Key** button (or similar) and paste the contents of your SparkleShare client ID. - -![Adding an SSH key][17] - -Save the key. If you want someone else, such as collaborators or family members, to be able to access this same repository, they must provide you with their SparkleShare client ID so you can add it to your account. - -#### Adding your client ID to a self-hosted Git account - -A SparkleShare client ID is just an SSH key, so copy and paste it into your Git user's **~/.ssh/authorized_keys** file. - -#### Adding your client ID with Dazzle - -If you are using Dazzle to manage your SparkleShare projects, add a client ID with this command: - - -``` -`$ dazzle link` -``` - -When Dazzle prompts you for the ID, paste in the client ID found in the SparkleShare menu. - -### Using SparkleShare - -Once you've added your client ID to your Git host, click the **Retry** button in the SparkleShare window to finish setup. When it's finished cloning your repository, you can close the SparkleShare setup window, and you'll find a new **SparkleShare** folder in your home directory. If you set up a Git repository with a hosting service and chose to include a README or license file, you can see them in your SparkleShare directory. - -![Sparkleshare file manager][18] - -Otherwise, there are some hidden directories, which you can see by revealing hidden directories in your file manager. - -![Showing hidden files in GNOME][19] - -You use SparkleShare the same way you use any directory on your computer: you put files into it. Anytime a file or directory is placed into a SparkleShare folder, it's copied in the background to your Git repository. - -#### Excluding certain files - -Since Git is designed to remember _everything_ , you may want to exclude specific file types from ever being recorded. There are a few reasons to manage excluded files. By defining files that are off limits for SparkleShare, you can avoid accidental copying of large files. You can also design a scheme for yourself that enables you to store files that logically belong together (MIDI files with their **.flac** exports, for instance) in one directory, but manually back up the large files yourself while letting SparkleShare back up the text-based files. - -If you can't see hidden files in your system's file manager, then reveal them. Navigate to your SparkleShare folder, then to the directory representing your repository, locate a file called **.gitignore** , and open it in a text editor. You can enter file extensions or file names, one per line, into **.gitignore** , and any file matching what you list will be (as the file name suggests) ignored. - - -``` -Thumbs.db -$RECYCLE.BIN/ -.DS_Store -._* -.fseventsd -.Spotlight-V100 -.Trashes -.directory -.Trash-* -*.wav -*.ogg -*.flac -*.mp3 -*.m4a -*.opus -*.jpg -*.png -*.mp4 -*.mov -*.mkv -*.avi -*.pdf -*.djvu -*.epub -*.od{s,t} -*.cbz -``` - -You know the types of files you encounter most often, so concentrate on the ones most likely to sneak their way into your SparkleShare directory. If you want to exercise a little overkill, you can find good collections of **.gitignore** files on Notabug.org and also on the internet at large. - -With those entries in your **.gitignore** file, you can place large files that you don't want sent to your Git host in your SparkleShare directory, and SparkleShare will ignore them entirely. Of course, that means it's up to you to make sure they get onto a backup or distributed to your SparkleShare collaborators through some other means. - -### Automation - -[Automation][20] is part of the silent agreement we have with computers: they do the repetitious, boring stuff that we humans either aren't very good at doing or aren't very good at remembering. SparkleShare is a nice, simple way to automate the routine distribution of data. It isn't right for every Git repository, by any means. It doesn't have an interface for advanced Git functions; it doesn't have a pause button or a manual override. And that's OK because its scope is intentionally limited. SparkleShare does what SparkleShare sets out to do, it does it well, and it's one Git repository you won't have to think about. - -If you have a use for that kind of steady, invisible automation, give SparkleShare a try. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/file-sharing-git - -作者:[Seth Kenlon (Red Hat, Community Moderator)][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_cloud21x_cc.png?itok=5UwC92dO -[2]: https://git-scm.com/ -[3]: http://www.sparkleshare.org/ -[4]: http://gitlab.com -[5]: https://opensource.com/article/19/4/calendar-git -[6]: http://sparkleshare.org -[7]: /business/16/8/flatpak -[8]: http://notabug.org -[9]: https://opensource.com/sites/default/files/uploads/git-new-repo.jpg (Creating a Git repository) -[10]: https://opensource.com/sites/default/files/uploads/github-clone-url.jpg (Cloning a URL on GitHub) -[11]: https://opensource.com/sites/default/files/uploads/gitlab-clone-url.jpg (Cloning a URL on GitLab) -[12]: http://gitolite.org -[13]: https://github.com/hbons/Dazzle -[14]: https://opensource.com/sites/default/files/uploads/sparkleshare-host.jpg (Choosing a Sparkleshare host) -[15]: mailto:git@notabug.org -[16]: https://opensource.com/sites/default/files/uploads/sparkleshare-clientid.jpg (Getting the client ID from Sparkleshare) -[17]: https://opensource.com/sites/default/files/uploads/git-ssh-key.jpg (Adding an SSH key) -[18]: https://opensource.com/sites/default/files/uploads/sparkleshare-file-manager.jpg (Sparkleshare file manager) -[19]: https://opensource.com/sites/default/files/uploads/gnome-show-hidden-files.jpg (Showing hidden files in GNOME) -[20]: /downloads/ansible-quickstart diff --git a/translated/tech/20190405 File sharing with Git.md b/translated/tech/20190405 File sharing with Git.md new file mode 100644 index 0000000000..a1ad1bc228 --- /dev/null +++ b/translated/tech/20190405 File sharing with Git.md @@ -0,0 +1,231 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (File sharing with Git) +[#]: via: (https://opensource.com/article/19/4/file-sharing-git) +[#]: author: (Seth Kenlon) + +用 Git 共享文件 +====== + +> SparkleShare 是一个开源的基于 Git、Dropbox 风格的文件共享应用程序。在我们的系列文章中了解有关 Git 鲜为人知的用法。 + +![][1] + +[Git][2] 是一个少有的能将如此多的现代计算封装到一个程序之中的应用程序,它可以用作许多其他应用程序的计算引擎。虽然它以跟踪软件开发中的源代码更改而闻名,但它还有许多其他用途,可以让你的生活更轻松、更有条理。在这个 Git 系列中,我们将分享七种鲜为人知的使用 Git 的方法。 + +今天,我们将看看 SparkleShare,它使用 Git 作为文件共享的基础。 + +### 用于文件共享的 Git + +Git 的优点之一是它具有固有的分发能力。它可用来建立共享。即使你只是与自己网络上的其他计算机共享资源库,Git 也会为从共享位置获取文件的行为带来透明性。 + +随着其界面的发展,Git 变得非常简单。虽然因用户而异,他们坐下来完成一些工作时的共同点仅仅是 `git pull` 或稍微复杂一点的 `git pull && git checkout -b my-branch`。但是,对于某些人来说,将*命令输入*到他们的计算机中的做法完全是令人困惑或烦恼的。计算机旨在使生活变得轻松,计算机擅长重复性工作,因此有更简便的方法可以与 Git 共享文件。 + +### SparkleShare + +[SparkleShare][3] 项目是一个基于 Git 的跨平台的开源的 Dropbox 式的文件共享应用程序。它通过将文件拖放到专门指定的 SparkleShare 目录中的简单操作,自动执行所有 Git 命令,触发添加、提交、推送和拉取过程。因为它基于 Git,所以你可以获得基于差异(diff)的快速推送和拉取,并且继承了 Git 版本控制和后端基础设施(如 Git 挂钩)的所有优点。它可以完全自托管,也可以将其与 [GitLab][4]、GitHub、Bitbucket 等 Git 托管服务一起使用。此外,由于它基本上只是一个 Git 的前端,因此你可以在可能没有 SparkleShare 客户端但有 Git 客户端的设备上访问 SparkleShare 中的文件。 + +正如你获得 Git 的所有好处一样,你也会受到所有常见的 Git 限制:使用 SparkleShare 存储数百张照片、音乐和视频是不切实际的,因为 Git 是为文本而设计和优化的。Git 当然可以存储二进制文件的大文件,但是因为它可以跟踪历史记录,因此一旦将文件添加到其中,几乎就不可能完全删除它。这在某种程度上限制了 SparkleShare 对某些人的实用性,但使其非常适合许多工作流程,包括 [日程安排][5]。 + +#### 安装 SparkleShare + +SparkleShare 是跨平台的,可从[网站][6]获得适用于 Windows 和 Mac 的安装程序。对于 Linux,有一个 [Flatpak][7] 安装包,或者你可以在终端中运行以下命令: + +``` +$ sudo flatpak remote-add flathub https://flathub.org/repo/flathub.flatpakrepo +$ sudo flatpak install flathub org.sparkleshare.SparkleShare +``` + +### 创建一个 Git 存储库 + +SparkleShare 并不是软件即服务(SaaS)。你在计算机上运行 SparkleShare 以与 Git 存储库进行通信,而 SparkleShare 并不存储你的数据。如果你还没有与文件夹同步的 Git 存储库,则必须在启动 SparkleShare 之前创建一个文件夹。你有三个选择:托管的 Git、自托管 Git 或自托管 SparkleShare。 + +#### 托管的 Git + +SparkleShare 可以使用你可以访问的任何 Git 存储库进行存储,因此,如果你拥有(或可在其中创建的)GitLab 或任何其他托管服务的帐户,则它可以成为 SparkleShare 的后端。例如,开源 [Notabug.org][8] 服务是一个类似于 GitHub 和 GitLab 的 Git 托管服务,但其独特性足以证明 SparkleShare 的灵活性。根据用户界面的不同,不同的托管服务创建新存储库的方法也有所不同,但是所有主要存储库都遵循相同的通用模型。 + +首先,在托管服务中找到创建一个新项目或存储库的按钮,单击它以开始。然后逐步完成存储库的创建过程,为存储库提供名称、隐私级别(存储库通常默认为公共),以及是否使用 `README` 文件初始化存储库。无论你是否需要个 `README` 文件,请初始化建立一个。使用一个文件创立存储库不是绝对必要的,但是它会强制 Git 主机实例化存储库中的 `master` 分支,这有助于确保前端应用程序(例如 SparkleShare)具有要提交并推送的分支。即使文件几乎是空的 `README` 文件,也可以用来查看该文件以确认你已连接成功。 + +![Creating a Git repository][9] + +创建存储库后,获取其用于 SSH 克隆的 URL。你可以像获取任何人从 Git 项目获得其 URL 一样获得此 URL:导航至存储库页面并查找 “Clone” 按钮或字段。 + +![Cloning a URL on GitHub][10] + +*GitHub 的克隆 URL。* + +![Cloning a URL on GitLab][11] + +*GitLab 的克隆 URL。* + +这是 SparkleShare 用于获取数据的地址,因此请记下它。你的 Git 存储库现已配置好。 + + +#### 自托管的 Git + +你可以使用 SparkleShare 访问你有权访问的任何计算机上的 Git 存储库。除了一个 Git 裸存储库外,无需任何特殊设置。但是,如果你想将对 Git 存储库的访问权授予其他任何人,则应运行 [Gitolite][12] 之类的 Git 管理器或 SparkleShare 自己的 Dazzle 服务器来帮助你管理 SSH 密钥和帐户。至少,创建一个特定于 Git 的用户,以便有权访问你的 Git 存储库的用户不会自动获得对服务器其余部分的访问权限。 + +以 Git 用户身份登录服务器(如果你非常擅长管理用户和组权限,则可以以自己的用户登录)并创建存储库: + +``` +$ mkdir ~/sparkly.git +$ cd ~/sparkly.git +$ git init --bare . +``` + +你的 Git 存储库现已配置好。 + +#### Dazzle + +SparkleShare 的开发人员提供了一个名为 [Dazzle][13] 的 Git 管理系统,以帮助你自托管 Git 存储库。 + +在你的服务器上,将 Dazzle 应用程序下载到你的路径中的某个位置: + +``` +$ curl https://raw.githubusercontent.com/hbons/Dazzle/master/dazzle.sh --output ~/bin/dazzle +$ chmod +x ~/bin/dazzle +``` + +Dazzle 设置了一个特定于 Git 和 SparkleShare 的用户,并且还基于 SparkleShare 应用程序生成的密钥实现了访问权限。现在,只需设置一个项目: + +``` +$ dazzle create sparkly +``` + +你的服务器现在已经配置好,可以用作 SparkleShare 托管了。 + +### 配置 SparkleShare + +首次启动 SparkleShare 时,系统会提示你配置要让 SparkleShare 用于存储的服务器。这个过程可能看起来像一个首次运行的安装向导,但实际上是在 SparkleShare 中设置新共享位置的通常过程。与许多共享驱动器应用程序不同,使用 SparkleShare 可以一次配置多个位置。你配置的第一个共享位置并不比你以后可以设置的任何共享位置重要,并且你也没有注册 SparkleShare 或任何其他服务。你只是将 SparkleShare 指向 Git 存储库,以便它知道如何使第一个 SparkleShare 文件夹保持同步。 + +在第一个屏幕上,给出一个身份,SparkleShare 将在代表你进行的 Git 提交记录中使用这些信息。你可以使用任何内容,甚至可以不代表任何意义的伪造信息。它仅用于提交消息,如果你对审查 Git 后端进程没有兴趣,你可能甚至看不到它们。 + +下一个屏幕提示你选择主机类型。如果你使用的是 GitLab、GitHub、Planio 或 Bitbucket,则可以选择一个适当的。否则,请选择“自己的服务器”。 + +![Choosing a Sparkleshare host][14] + +在此屏幕底部,您必须输入 SSH 的克隆 URL。如果你是自托管的 Git,则地址类似于 ``,而远程路径是为此目的而创建的 Git 存储库的绝对路径。 + +根据上面的自托管示例,我虚构的服务器的地址为 `ssh://git@example.com:22122`(`:22122` 表示非标准的 SSH 端口),远程路径为 `/home/git/sparkly.git`。 + +如果我改用 Notabug.org 帐户,则上例中的地址为 `ssh://git@notabug.org`,路径为 `seth/sparkly.git`。 + +SparkleShare 首次尝试连接到主机时将失败,因为你尚未将 SparkleShare 客户端 ID(特定于 SparkleShare 应用程序的 SSH 密钥)复制到 Git 主机。这是预料之中的,所以不要取消该过程。将 SparkleShare 设置窗口保持打开状态,并从系统任务栏中的 SparkleShare 图标处获取客户端 ID。然后将客户端 ID 复制到剪贴板,以便可以将其添加到 Git 主机。 + +![Getting the client ID from Sparkleshare][16] + +#### 将你的客户端 ID 添加到托管的 Git 帐户 + +除了较小的 UI 差异外,在任何托管服务上添加 SSH 密钥(所有客户端 ID 都是这样)的过程基本上是相同的。在你的 Git 主机的 Web 仪表板中,导航到你的用户设置,然后找到 “SSH 密钥”类别。单击“添加新密钥”按钮(或类似按钮),然后粘贴你的 SparkleShare 客户端 ID 的内容。 + +![Adding an SSH key][17] + +保存密钥。如果你希望其他人(例如协作者或家庭成员)能够访问同一存储库,则他们必须向你提供其 SparkleShare 客户端 ID,以便你可以将其添加到帐户中。 + +#### 将你的客户端 ID 添加到自托管的 Git 帐户 + +SparkleShare 客户端 ID 只是一个 SSH 密钥,因此将其复制并粘贴到 Git 用户的 `~/.ssh/authorized_keys`文件中。 + +#### 使用 Dazzle 添加你的客户 ID + +如果你使用 Dazzle 管理 SparkleShare 项目,请使用以下命令添加客户端 ID: + +``` +$ dazzle link +``` + +当 Dazzle 提示你输入该 ID 时,请粘贴在 SparkleShare 菜单中找到的客户端 ID。 + +### 使用 SparkleShare + +将客户端 ID 添加到 Git 主机后,在 SparkleShare 窗口中单击“重试”按钮以完成设置。克隆存储库完成后,你可以关闭 SparkleShare 设置窗口,并在你的家目录中找到一个新的 `SparkleShare` 文件夹。如果你设置了带有托管服务的 Git 存储库,并选择包括 `README` 文件或许可证文件,则可以在 SparkleShare 目录中看到它们。 + +![Sparkleshare file manager][18] + +此外,有一些隐藏目录,你可以通过在文件管理器中显示隐藏目录来查看。 + +![Showing hidden files in GNOME][19] + +使用 SparkleShare 的方式与使用计算机上任何目录的方式相同:将文件放入其中。每当将文件或目录放入 SparkleShare 文件夹时,它都会在后台复制到你的 Git 存储库。 + +#### 排除某些文件 + +由于 Git 从设计上就是要记住*一切*,因此你可能希望从记录中排除特定的文件类型。排除一些文件是有原因的。通过定义摆脱 SparkleShare 限制的文件,可以避免意外复制大文件。你还可以为自己设计一种方案,使你可以将存储在一个目录中的逻辑上属于同一文件(例如,MIDI 文件及其 .flac 导出文件),但是可以自己手动备份大文件,而同时让 SparkleShare 备份基于文本的文件。 + +如果在系统的文件管理器中看不到隐藏的文件,请显示它们。导航到你的 SparkleShare 文件夹,然后到代表你的存储库的目录,找到一个名为 `.gitignore` 的文件,然后在文本编辑器中将其打开。你可以在 `.gitignore` 中输入文件扩展名或文件名(每行一个),任何与你列出的文件匹配的文件都会被忽略(如文件名所示)。 + +``` +Thumbs.db +$RECYCLE.BIN/ +.DS_Store +._* +.fseventsd +.Spotlight-V100 +.Trashes +.directory +.Trash-* +*.wav +*.ogg +*.flac +*.mp3 +*.m4a +*.opus +*.jpg +*.png +*.mp4 +*.mov +*.mkv +*.avi +*.pdf +*.djvu +*.epub +*.od{s,t} +*.cbz +``` + +你知道最经常遇到哪些文件类型,因此请集中精力处理最有可能潜入你的 SparkleShare 目录的文件。如果您想稍微矫枉过正一些,可以在 Notabug.org 以及整个网上找到 `.gitignore` 文件的好集合。 + +通过将这些条目保存在 `.gitignore` 文件中,你可以将不需要发送到 Git 主机的大文件放在 SparkleShare 目录中,SparkleShare 将完全忽略它们。当然,这意味着您需要确保它们可以备份或通过其他方式分发给你的 SparkleShare 合作者。 + +### 自动化 + +[自动化][20] 是我们与计算机达成的默契之一:计算机执行重复的、无聊的工作,而我们人类要么不擅长做这些,要么不擅长记忆这些。SparkleShare 是一种很好的、简单的自动执行例行数据分发的方法。无论如何,这并不适合每个 Git 存储库。它没有用于高级 Git 功能的接口,它没有暂停按钮或手动管理的操作。没关系,因为它的范围是有意限制的。SparkleShare 可以完成 SparkleShare 计划要做的事情,它做得很好,而且它是你无需关心的一个 Git 存储库。 + +如果你想使用这种稳定的、看不见的自动化,请尝试一下 SparkleShare。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/file-sharing-git + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_cloud21x_cc.png?itok=5UwC92dO +[2]: https://git-scm.com/ +[3]: http://www.sparkleshare.org/ +[4]: http://gitlab.com +[5]: https://opensource.com/article/19/4/calendar-git +[6]: http://sparkleshare.org +[7]: /business/16/8/flatpak +[8]: http://notabug.org +[9]: https://opensource.com/sites/default/files/uploads/git-new-repo.jpg (Creating a Git repository) +[10]: https://opensource.com/sites/default/files/uploads/github-clone-url.jpg (Cloning a URL on GitHub) +[11]: https://opensource.com/sites/default/files/uploads/gitlab-clone-url.jpg (Cloning a URL on GitLab) +[12]: http://gitolite.org +[13]: https://github.com/hbons/Dazzle +[14]: https://opensource.com/sites/default/files/uploads/sparkleshare-host.jpg (Choosing a Sparkleshare host) +[15]: mailto:git@notabug.org +[16]: https://opensource.com/sites/default/files/uploads/sparkleshare-clientid.jpg (Getting the client ID from Sparkleshare) +[17]: https://opensource.com/sites/default/files/uploads/git-ssh-key.jpg (Adding an SSH key) +[18]: https://opensource.com/sites/default/files/uploads/sparkleshare-file-manager.jpg (Sparkleshare file manager) +[19]: https://opensource.com/sites/default/files/uploads/gnome-show-hidden-files.jpg (Showing hidden files in GNOME) +[20]: /downloads/ansible-quickstart From 40b7e0a32be7ea0cee4b184d3080d6ebae11f25d Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Sun, 5 Jan 2020 00:37:29 +0800 Subject: [PATCH 207/430] translated 20200101 5 predictions for Kubernetes in 2020.md --- ...01 5 predictions for Kubernetes in 2020.md | 73 ------------------- ...01 5 predictions for Kubernetes in 2020.md | 67 +++++++++++++++++ 2 files changed, 67 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20200101 5 predictions for Kubernetes in 2020.md create mode 100644 translated/tech/20200101 5 predictions for Kubernetes in 2020.md diff --git a/sources/tech/20200101 5 predictions for Kubernetes in 2020.md b/sources/tech/20200101 5 predictions for Kubernetes in 2020.md deleted file mode 100644 index 99723632b8..0000000000 --- a/sources/tech/20200101 5 predictions for Kubernetes in 2020.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 predictions for Kubernetes in 2020) -[#]: via: (https://opensource.com/article/20/1/kubernetes-2020) -[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux) - -5 predictions for Kubernetes in 2020 -====== -Plus, a look back at the most popular Kubernetes articles on the site in -2019. -![Person drinking a hat drink at the computer][1] - -How do you track a wildly popular project like Kubernetes? How do you figure out where it’s going? If you are contributing to the project or participating in Special Interest Groups (SIGs), you might gain insight by osmosis, but for those of you with day jobs that don’t include contributing to Kubernetes, you might like a little help reading the tea leaves. With a fast-moving project like Kubernetes, the end of the year is an excellent time to take a look at the past year to gain insight into the next one. - -This year, Kubernetes made a lot of progress. Aside from inspecting code, documentation, and meeting notes, another good source is blog entries. To gain some insights, I took a look at the top ten Kubernetes articles on Opensource.com. These articles give us insight into what topics people are interested in reading, but just as importantly, what articles people are interested in writing. Let’s dig in! - -(Get the full list of top 10 Kubernetes articles from 2019 at the end.) - -First, I would point out that five of these articles tackle the expansion of workloads and where they can run. This expansion of workloads includes data science, PostgreSQL, InfluxDB, and Grafana (as a workload, not just to monitor the cluster itself) and Edge. Historically, Kubernetes and containers in general have mostly run on top of virtual machines, especially when run on infrastructure provided by cloud providers. With this interest in Kubernetes at the edge, it’s another sign that end users are genuinely interested in Kubernetes on bare metal (see also [Kubernetes on metal with OpenShift][2]). - -Next, there seems to be a lot of hunger for operational knowledge and best practices with Kubernetes. From [Kubernetes Operators][3], to [Kubernetes Controllers][4], from [Secrets][5] to [ConfigMaps][6], developers and operators alike are looking for best practices and ways to simplify workload deployment and management. Often we get caught up in the actual configuration example, or how people do it, and don’t take a step back to realize that all of these fall into the bucket of how to operationalize the deployment of applications (not how to install or run Kubernetes itself). - -Finally, people seem to be really interested in getting started. In fact, there is so much information on how to build Kubernetes that it intimidates people and gets them down the wrong path. A couple of the top articles focus on why you should learn to run applications on Kubernetes instead of concentrating on installing it. Like best practices, people often don’t take a step back to analyze where they should invest their time when getting started. I have always advocated for, where possible, spending limited time and money on using technology instead of building it. - -### 5 predictions for Kubernetes in 2020 - -So, looking back at those themes from 2019, what does this tell us about where 2020 is going? Well, combining insight from these articles with my own broad purview, I want to share my thoughts for 2020 and beyond: - - 1. Expansion of workloads. I would keep my eye on high-performance computing, AI/ML, and stateful workloads using Operators. - - 2. More concrete best practices, especially around mature standards like PCI, HIPAA, NIST, etc. - - 3. Increased security around rootless and higher security [runtimes classes][7] (like [gVisor][8], [Kata Containers][9], etc.) - - 4. Better standardization on Kubernetes manifests as the core artifact for deployment in development and sharing applications between developers. Things like [podman generate kube][10], [podman play kube][11], and all in one Kubernetes environments like [CodeReady Containers (CRC)][12] - - 5. An ever-wider ecosystem of network, storage and specialized hardware (GPUs, etc.) vendors creating best of breed solutions for Kubernetes (in free software, we believe that open ecosystems are better than vertically integrated solutions) - - - - -I'm looking forward to another great year in Kubernetes! - -**Top 10 Kubernetes articles for 2019** - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/kubernetes-2020 - -作者:[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://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) -[2]: https://blog.openshift.com/kubernetes-on-metal-with-openshift/ -[3]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/ -[4]: https://kubernetes.io/docs/concepts/architecture/controller/ -[5]: https://kubernetes.io/docs/concepts/configuration/secret/ -[6]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/ -[7]: https://kubernetes.io/docs/concepts/containers/runtime-class/ -[8]: https://gvisor.dev/ -[9]: https://katacontainers.io/ -[10]: https://developers.redhat.com/blog/2019/01/29/podman-kubernetes-yaml/ -[11]: https://www.redhat.com/en/blog/rhel-81-minor-release-major-new-container-capabilities -[12]: https://developers.redhat.com/products/codeready-containers/overview diff --git a/translated/tech/20200101 5 predictions for Kubernetes in 2020.md b/translated/tech/20200101 5 predictions for Kubernetes in 2020.md new file mode 100644 index 0000000000..32868982f8 --- /dev/null +++ b/translated/tech/20200101 5 predictions for Kubernetes in 2020.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: "lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 predictions for Kubernetes in 2020) +[#]: via: (https://opensource.com/article/20/1/kubernetes-2020) +[#]: author: (Scott McCarty https://opensource.com/users/fatherlinux) + +2020 年对 Kubernetes 的 5 项预测 +====== +请先回顾下 2019 年网站上最受欢迎的 Kubernetes 的文章。 +![Person drinking a hat drink at the computer][1] + +你怎么追踪一个广受欢迎的项目(如 Kubernetes)的发展轨迹?你怎么能了解它发展到什么程度了?如果你在为这个项目作贡献或加入了 SIG(Special Interest Group),可能你会在潜移默化中了解到它的发展轨迹,但如果你的全日工作不涉及到为 Kubernetes 作贡献,那么你可能需要一点关于未来的预测来帮助你了解。对于一个诸如 Kubernetes 的快速发展的项目,年末是回顾过去的一年和展望新的一年的最好时机。 + +今年,Kubernetes 取得了很大的进展。除了去查看源码、文档、会议笔记,你也可以去浏览博客。为了深入了解,我在 Opensource.com 上看了 Kubernetes 的 top 10 文章。通过这些文章,我们能了解开发者们更喜欢读和写哪些话题的文章。我们开始吧! + +(2019 年末获取 Kubernetes 文章的 top 10。) + +首先,我要指明这些文章中有 5 篇是关于 Kubernetes 工作负载的扩展以及它们可以运行在什么场景。这些工作负载涵盖数据科学、PostgreSQL、InfluxDB、Grafana(不仅仅监控集群本身)和 Edge。从历史角度看,Kubernetes 和容器都是在虚拟机上运行的,尤其是运行在由云提供的基础设施上时。抛开对于 Kubernetes 的兴趣因素,这也表明了终端用户们极度希望在裸机上安装 Kubernetes(参照[OpenShift 环境安装 Kubernetes][2])。 + +其次,也有很多开发者希望了解操作相关的知识以及 Kubernetes 的最佳实践。从 [Kubernetes 操作][3] 到 [Kubernetes 控制器][4],从 [Secrets][5] 到 [ConfigMaps][6],开发者和运维人员都希望能找到简化部署和管理工作的最佳实践。我们经常纠结在怎么去修改配置文件或别人会怎么配置,而不去回头想想这些配置是怎么让应用部署运转的(不是怎么安装,也不是怎么运行 Kubernetes)。 + +最后,人们似乎对入门教程真的感兴趣。事实上,构建 Kubernetes 所需了解的信息太多了,以至于让人们望而却步,也使他们走了错误的路。流行度高的文章中有几篇讲述了为什么你需要了解用 Kubernetes 运行应用程序,而不仅仅是安装它。就是最佳实践类的文章一样,人们也通常不会回头分析在入门时他们应该在什么地方花费时间。我一直秉持的理念是,把有限的时间和金钱投入到如何使用某项技术上,而不是如何构建它。 + +### 2020 年对 Kubernetes 的 5 项预测 + +回顾下 2019 年的相关主题,这些主题告诉我们 2020 年将如何发展?结合这些文章中的观点,加上我自己的看法,我来分享下我对于 2020 年以及未来发展趋势的想法: + + 1. 工作负载扩展。我会关注高性能计算,AI/ML 以及使用 Operator 的有状态工作负载。 + + 2. 更多的生产中的最佳实践,尤其是跟一些成熟的标准相关的,像 PCI,HIPAA,NIST 等等. + + 3. rootless 相关的更好的安全性和 [runtimes classes][7](如 [gVisor][8],[Kata Containers][9] 等等)更高的安全性。 + + 4. 在部署和开发者们共享应用时,把 Kubernetes 清单的更好的规范标准作为部署的核心要素。如 [podman generate kube][10], [podman play kube][11], 还有多合一 Kubernetes 环境,如 [CodeReady Containers (CRC)][12] + + 5. 一个前所未有的网络、存储和专业硬件(如 GPU 等等)供应商的生态系统,为 Kubernetes 提供 BoB(译注:best of breed,单项最佳品牌)解决方案(在免费软件中,我们相信开放的生态系统好过垂直整合的解决方案)。 + +期待 Kubernetes 在新的一年里再创辉煌! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/kubernetes-2020 + +作者:[Scott McCarty][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者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://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: https://blog.openshift.com/kubernetes-on-metal-with-openshift/ +[3]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator/ +[4]: https://kubernetes.io/docs/concepts/architecture/controller/ +[5]: https://kubernetes.io/docs/concepts/configuration/secret/ +[6]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/ +[7]: https://kubernetes.io/docs/concepts/containers/runtime-class/ +[8]: https://gvisor.dev/ +[9]: https://katacontainers.io/ +[10]: https://developers.redhat.com/blog/2019/01/29/podman-kubernetes-yaml/ +[11]: https://www.redhat.com/en/blog/rhel-81-minor-release-major-new-container-capabilities +[12]: https://developers.redhat.com/products/codeready-containers/overview From 2651b99b8bbe0469d249ea617acd7f06125babcf Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Sun, 5 Jan 2020 00:46:37 +0800 Subject: [PATCH 208/430] modify md --- .../tech/20200101 5 predictions for Kubernetes in 2020.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20200101 5 predictions for Kubernetes in 2020.md b/translated/tech/20200101 5 predictions for Kubernetes in 2020.md index 32868982f8..f760fcfe4a 100644 --- a/translated/tech/20200101 5 predictions for Kubernetes in 2020.md +++ b/translated/tech/20200101 5 predictions for Kubernetes in 2020.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: "lxbwolf) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2277c19e205a701b72b7620276efb9c6750e83f0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 5 Jan 2020 00:59:21 +0800 Subject: [PATCH 209/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200104=20DevOps?= =?UTF-8?q?=20is=20a=20solution=20to=20burnout=20worth=20investing=20in?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200104 DevOps is a solution to burnout worth investing in.md --- ... solution to burnout worth investing in.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20200104 DevOps is a solution to burnout worth investing in.md diff --git a/sources/tech/20200104 DevOps is a solution to burnout worth investing in.md b/sources/tech/20200104 DevOps is a solution to burnout worth investing in.md new file mode 100644 index 0000000000..59d27c605e --- /dev/null +++ b/sources/tech/20200104 DevOps is a solution to burnout worth investing in.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (DevOps is a solution to burnout worth investing in) +[#]: via: (https://opensource.com/article/20/1/devops-burnout-solution) +[#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) + +DevOps is a solution to burnout worth investing in +====== +Instead of treating burnout once it kicks in, we need to do more to +prevent it in the first place. Here is a reminder of the cause and a +look at solutions. +![A person choosing between several different incentives][1] + +Not a day goes by that I don't see a tweet or hear somebody talking about burnout. Burnout is becoming a pervasive part of our lives, especially in tech and open source communities. In [_What you need to know about burnout in open source communities_,][2] I defined burnout and explored its causes, symptoms, and potential treatments. But a better question is about prevention: How do we change the underlying processes, cultures, and tools to prevent burnout from occurring in the first place? + +### Burnout's catalyst is unplanned work + +Let's start by reviewing what's known about the cause of burnout. In 2019, PagerDuty published [_Unplanned work: The human impact of an always-on world_][3]. More than 35% of the study's respondents are considering leaving their jobs due to stress and work/life balance issues, also known as burnout. Companies that utilize automation and have documented response plans have fewer unplanned incidents and less stressed employees. + +Modern software organizations use automation and documented response plans to move faster. Moving faster is necessary to stay competitive. We are in this endless cycle where customers expect more, which puts more pressure on companies to deliver more and deliver it faster, which in turn creates pressure on employees. + +However, it is possible to move fast while having protections to prevent unplanned work and burnout. The Accelerate State of DevOps Report has been tracking trends in DevOps for six years. It allows teams to benchmark against others in the industry as low, medium, high, or elite performers. One of the findings from the [2019 State of DevOps report][4] was: "Productivity can drive improvements in work/life balance and reductions in burnout, and organizations can make smart investments to support it." + +Productivity means more work gets done. Therefore, more value is delivered. The catch to productivity is balance: Don't do more work in the short term at the expense of burning out your people. Processes and tooling need to be in place to prevent people from feeling overworked and overwhelmed. + +To support productivity that does not lead to burnout, organizations need to make smart investments in tooling and reduce technical debt. Investing in tooling means purchasing useful and easy-to-use solutions. The preference for building rather than buying may lead productivity to decrease and burnout to emerge. How? Instead of focusing on building features that are competitive differentiators and help the company achieve key business objectives, the developers spend countless hours trying to build something that a vendor could have quickly provided. + +As developers spend time building non-core solutions, technical debt accrues, and features are pushed out. Instead of building all the things, buy the tooling that supports the business but is not strategic, and build the things that are core to your business strategy. You wouldn't use development resources to build your own email program, so treat other tooling the same way. Twenty percent of tools used by low-performing teams are developed primarily in-house and proprietary to the organization, compared to 5% to 6% in medium, high, and elite teams. + +### Worthwhile solutions to burnout + +If you want to prevent burnout, here are some areas to invest in. It's no coincidence they overlap with frequent discussions [in DevOps articles][5]. + +#### Communication and collaboration + +Communication is at the heart of everything we do. [Laurie Barth][6] sums it up nicely: "Over time, I've learned that the biggest source of failure is often due to people and teams. A lack of communication and coordination can cause serious problems." Use tools like videoconferencing, Confluence, and Slack to ensure communication and collaboration happen. + +But create rules around the use of these tools. Make sure to turn off Slack notifications during off-hours. I disable my notifications from 6pm to 8am. + +Define what type of communication is best for which situations. Slack is useful for real-time, ephemeral communication, but it can lead to people feeling the need to always be on. If they're not online, they may miss an important conversation. If major or minor decisions are made in a Slack thread, document those in a longer-living system of record, giving all team members access to the necessary information. + +Trying to debug an incident? Communicate via Slack. Need to write up a post-incident review? Post that to Confluence or a wiki. + +Videoconferencing tools like Zoom or BlueJeans help enable remote work. Having the ability to work remotely, part-time or full-time, can reduce the stress of commuting or relocating. Videoconferences make it easy to stay connected with distributed teams because sometimes it is easier to hash things out in a face-to-face conversation than over email or Slack. + +These tools should not be used to encourage people to work while on vacation. Time off means time away from work to rest, recover, and recharge. + +#### Releases and deploys + +According to the 2019 State of DevOps report, elite teams deploy code 208 times more frequently than low performers, and their lead time from committing code to deployment is 106 times faster. It may seem that the more deploys you do, the greater the likelihood of burnout, but that isn't necessarily the case. Teams that utilize continuous delivery have processes in place to deploy safely. + +First, separate releases from deploys—just because you deployed code doesn't mean that all users should have access to it. Ring deploys make features available to a small group of people, like internal employees or beta customers. These users can help you identify bugs or provide feedback to fine-tune a feature before releasing it widely. + +Next, create feedback loops regarding the quality of a deployment. Things don't always go as planned when deploying your code. You need the ability to rapidly stop when things go wrong. Feedback loops include implementing monitoring and observability tools. By using telemetry data along with kill switches, you can quickly turn off a poorly behaving feature rather than rolling back an entire deployment. + +Finally, run A/B tests and experiments to learn what customers respond to. A metrics-based approach provides insight into what works and what doesn't and can help you validate a hypothesis. Instead of creating technical debt with a partial feature, collect data to see if the feature provides the expected conversions early on. If it doesn't, don't release it. + +#### Incident resolution + +Part of resolving incidents means knowing what to do when something breaks. And constantly putting out fires can lead to burnout. We can't prevent all incidents from happening, but we can be better prepared. Running chaos experiments or game days with tools like Gremlin can help companies prepare for the unexpected. + +With chaos experiments, you can learn how your systems, services, and applications respond under specific scenarios. Knowing how things behave when they're broken can shorten incident-resolution times. They can also help you identify and fix vulnerabilities before an incident occurs. + +What can you automate to reduce toil during incident resolution? For example, when you're actively working on an incident, can a Slack channel dedicated to the incident be automatically generated? Or can you create [feature flags][7] with a solution like LaunchDarkly (full disclosure: I work there) to perform common tasks during incident resolution? These could include: + + * Dynamic configuration changes, like automatically adjusting logging levels to collect more information when an alert is triggered + * Load-shedding to disable non-critical elements when systems are under heavy load to ensure essential tasks complete + * Kill switches or circuit breakers to turn off features when they are impacting your service reliability + + + +### It's not magic + +There is no magic bullet to resolve burnout; it requires having the right people, processes, and tools. The people help create an environment of psychological safety where people are free to ask questions, experiment, make mistakes, and be creative. Think about what is most important to your organization, and invest in the right tools to support those goals and the people working towards them. + +This month we look at ways to balance your workload, gracefully say "no," and avoid burnout. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/devops-burnout-solution + +作者:[Dawn Parzych][a] +选题:[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/dawnparzych +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_incentives.png?itok=IhIL1xyT (A person choosing between several different incentives) +[2]: https://opensource.com/article/19/11/burnout-open-source-communities +[3]: https://www.pagerduty.com/resources/reports/unplanned-work/ +[4]: https://services.google.com/fh/files/misc/state-of-devops-2019.pdf +[5]: https://opensource.com/tags/devops +[6]: https://laurieontech.com/ +[7]: https://martinfowler.com/articles/feature-toggles.html From fe36b54e08223dff6886b4540c2379977e4a952c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 5 Jan 2020 01:00:19 +0800 Subject: [PATCH 210/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200104=20Indust?= =?UTF-8?q?rial=20Internet=20Consortium=20teams=20up=20with=20blockchain-f?= =?UTF-8?q?ocused=20security=20group?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200104 Industrial Internet Consortium teams up with blockchain-focused security group.md --- ... with blockchain-focused security group.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sources/talk/20200104 Industrial Internet Consortium teams up with blockchain-focused security group.md diff --git a/sources/talk/20200104 Industrial Internet Consortium teams up with blockchain-focused security group.md b/sources/talk/20200104 Industrial Internet Consortium teams up with blockchain-focused security group.md new file mode 100644 index 0000000000..cd5f8f23c2 --- /dev/null +++ b/sources/talk/20200104 Industrial Internet Consortium teams up with blockchain-focused security group.md @@ -0,0 +1,52 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Industrial Internet Consortium teams up with blockchain-focused security group) +[#]: via: (https://www.networkworld.com/article/3512062/industrial-internet-consortium-teams-up-with-blockchain-focused-security-group.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Industrial Internet Consortium teams up with blockchain-focused security group +====== +A merger between a prominent industrial-IoT umbrella group and a blockchain-centered corporate memebership program highlights a new focus on bringing finished IoT solutions to market. +Leo Wolfert / Getty Images + +The Industrial Internet Consortium and the Trusted IoT Alliance announced today that they would merge memberships, in an effort to drive more collaborative approaches to [industrial IoT][1] and help create more market-ready products. + +The Trusted IoT Alliance will now operate under the aegis of the IIC, a long-standing umbrella group for vendors operating in the IIoT market. The idea is to help create more standardized approaches to common use cases in IIoT, enabling companies to get solutions to market more quickly. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][2] + +“This consolidation will strengthen the ability of the IIC to provide guidance and advance best practices on the uses of distributed-ledger technology across industries, and boost the commercialization of these products and services,” said 451 Research senior [blockchain][3] and DLT analyst Csilla Zsigri in a statement. + +Gartner vice president and analyst Al Velosa said that it’s possible the move to team up with TIoTA was driven in part by a new urgency to reach potential customers. Where other players in the IoT marketplace, like the major cloud vendors, have raked in billions of dollars in revenue, the IIoT vendors themselves haven’t been as quick to hit their sales targets. “This approach is them trying to explore new vectors for revenue that they haven’t before,” Velosa said in an interview. + +The IIC, whose founding members include Cisco, IBM, Intel, AT&T and GE, features 19 different working groups, covering everything from IIoT technology itself to security to marketing to strategy. Adding TIoTA’s blockchain focus to the mix could help answer questions about security, which are centrally important to the continued success of enterprise and industrial IoT products. + +Indeed, research from Gartner released late last year shows that IoT users are already gravitating toward blockchain and other distributed-ledger technologies. Fully three-quarters of IoT technology adopters in the U.S. have either brought that type of technology into their stack already or are planning to do so by the end of 2020. While almost two-thirds of respondents to the survey cited security and trust as the biggest drivers of their embrace of blockchain, almost as many noted that the technology had allowed them to increase business efficiency and lower costs. + +**[ Also see [What is edge computing?][4] and [How edge networking and IoT will reshape data centers][5].]** + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3512062/industrial-internet-consortium-teams-up-with-blockchain-focused-security-group.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3243928/what-is-the-industrial-internet-of-things-essentials-of-iiot.html +[2]: https://www.networkworld.com/newsletters/signup.html +[3]: https://www.networkworld.com/article/3386881/why-blockchain-might-be-coming-to-an-iot-implementation-near-you.html +[4]: https://www.networkworld.com/article/3224893/internet-of-things/what-is-edge-computing-and-how-it-s-changing-the-network.html +[5]: https://www.networkworld.com/article/3291790/data-center/how-edge-networking-and-iot-will-reshape-data-centers.html +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From dba8b36c0b6facb3de8fc99e07ebcc18011331ed Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 5 Jan 2020 08:34:56 +0800 Subject: [PATCH 211/430] Rename sources/tech/20200104 DevOps is a solution to burnout worth investing in.md to sources/talk/20200104 DevOps is a solution to burnout worth investing in.md --- ...20200104 DevOps is a solution to burnout worth investing in.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200104 DevOps is a solution to burnout worth investing in.md (100%) diff --git a/sources/tech/20200104 DevOps is a solution to burnout worth investing in.md b/sources/talk/20200104 DevOps is a solution to burnout worth investing in.md similarity index 100% rename from sources/tech/20200104 DevOps is a solution to burnout worth investing in.md rename to sources/talk/20200104 DevOps is a solution to burnout worth investing in.md From 4182d564cf9b7fcc1e6a2a241a24b4e41b2e8c54 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Jan 2020 08:41:54 +0800 Subject: [PATCH 212/430] PRF @geekpi --- ...nable to Open the MRL- Error -Quick Tip.md | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/translated/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md b/translated/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md index 004f300c56..c94e4cdf2f 100644 --- a/translated/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md +++ b/translated/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Fixing “VLC is Unable to Open the MRL” Error [Quick Tip]) @@ -10,11 +10,13 @@ 修复 “VLC is Unable to Open the MRL” 错误 ====== +![](https://img.linux.net.cn/data/attachment/album/202001/05/084139mzlt1lfivilnnbkl.jpg) + 一个使用 [VLC 的技巧][1]是使用 [VLC] [2] 播放 YouTube 和其他在线视频。这可以帮助你[观看带有字幕的在线视频][3]。 但是事情并不总是这么简单,因为有时使用 VLC 打开 YouTube 视频时会遇到此错误: -**Your input can’t be opened: VLC is unable to open the MRL ‘. Check the log for details.** +> Your input can’t be opened: VLC is unable to open the MRL ‘. Check the log for details. ![VLC error while playing YouTube videos][4] @@ -26,19 +28,17 @@ 对于 VLC 也是如此。如果你[在 Ubuntu 或任何你用的系统中安装了最新的 VLC][7],那么可能不会看到此错误。 -### 修复 ”VLC is unable to open the MRL“ 错误 +### 修复 “VLC is unable to open the MRL” 错误 让我向你展示对于 YouTube 的修复步骤。 -进入 VLC 媒体播放器的官方 Github 仓库页面,并使用 Ctrl+S 保存文件: +进入 VLC 媒体播放器的官方 Github 仓库页面的[这个页面][8],并使用 `Ctrl+S` 保存文件: -[Download youtube.lua file][8] - -现在,你需要做的是用此下载文件替换 lib/vlc/lua/playlist 目录中的 youtube.luac(注意 luac 中的 “c”)。 +现在,你需要做的是用此下载文件替换 `lib/vlc/lua/playlist` 目录中的 `youtube.luac`(注意 luac 中的 “c”)。 #### Linux 中的步骤 -如果你使用的是 Linux,请打开终端并使用 [locate 命令][9]查找 youtube.luac 文件的确切位置: +如果你使用的是 Linux,请打开终端并使用 [locate 命令][9]查找 `youtube.luac` 文件的确切位置: ``` locate youtube.luac @@ -49,7 +49,7 @@ locate youtube.luac 对我而言,以下是文件路径: ``` -[email protected]:~$ locate youtube.lua +abhishek@itsfoss:~$ locate youtube.lua /usr/lib/x86_64-linux-gnu/vlc/lua/playlist/youtube.luac ``` @@ -65,10 +65,8 @@ sudo cp ~/Downloads/youtube.lua /usr/lib/x86_64-linux-gnu/vlc/lua/playlist/youtu 如果你使用的是 Windows,那么应遵循以下步骤: - * 将下载的 youtube.lua 文件重命名为 youtube.luac - * 复制此文件并将其粘贴到 C:\Program Files (x86)\VideoLAN\VLC\lua\playlist\ - - + * 将下载的 `youtube.lua` 文件重命名为 `youtube.luac` + * 复制此文件并将其粘贴到 `C:\Program Files (x86)\VideoLAN\VLC\lua\playlist\` 就是这些了。 @@ -83,7 +81,7 @@ via: https://itsfoss.com/vlc-is-unable-to-open-the-mrl/ 作者:[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 b99de9587e8b5cea0a576dbfe5e166a479ebe3d7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Jan 2020 08:42:46 +0800 Subject: [PATCH 213/430] PUB @geekpi https://linux.cn/article-11748-1.html --- ...xing -VLC is Unable to Open the MRL- Error -Quick Tip.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md (95%) diff --git a/translated/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md b/published/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md similarity index 95% rename from translated/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md rename to published/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md index c94e4cdf2f..51b076d906 100644 --- a/translated/tech/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md +++ b/published/20191230 Fixing -VLC is Unable to Open the MRL- Error -Quick Tip.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11748-1.html) [#]: subject: (Fixing “VLC is Unable to Open the MRL” Error [Quick Tip]) [#]: via: (https://itsfoss.com/vlc-is-unable-to-open-the-mrl/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) @@ -16,7 +16,7 @@ 但是事情并不总是这么简单,因为有时使用 VLC 打开 YouTube 视频时会遇到此错误: -> Your input can’t be opened: VLC is unable to open the MRL ‘. Check the log for details. +> Your input can’t be opened: VLC is unable to open the MRL ''. Check the log for details. ![VLC error while playing YouTube videos][4] From 21ab432f7d8164af90f6f712f40783c3f70a05ff Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Jan 2020 09:46:12 +0800 Subject: [PATCH 214/430] PRF @lxbwolf --- ...219 Kubernetes namespaces for beginners.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/translated/tech/20191219 Kubernetes namespaces for beginners.md b/translated/tech/20191219 Kubernetes namespaces for beginners.md index 5c1f6267b0..06a5c4bf50 100644 --- a/translated/tech/20191219 Kubernetes namespaces for beginners.md +++ b/translated/tech/20191219 Kubernetes namespaces for beginners.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Kubernetes namespaces for beginners) @@ -9,42 +9,44 @@ Kubernetes 命名空间入门 ====== -命名空间是什么?你为什么需要它? -![Ship captain sailing the Kubernetes seas][1] -kubernetes 命名空间是什么?Shakespeare 以前写过,我们声称的命名空间,或者任何其他名字,仍是一个虚拟集群。命名空间,意味着 kubernetes 可以在单个集群上提供多个 kubernetes 的集群,类似一个对其主机进行抽象的虚拟机。[kubernetes 文档][2] 中的解释: +> 命名空间是什么?你为什么需要它? + +![](https://img.linux.net.cn/data/attachment/album/202001/05/094542qnq3qc3nrkkrjanh.jpg) + +kubernetes 命名空间namespace是什么?正如 Shakespeare 以前写过的,我们所谓的命名空间,或者任何其他名字,就是虚拟集群。通过虚拟集群,意味着 kubernetes 可以在单个集群上提供多个 kubernetes 的集群,类似一个在其主机抽象出来的虚拟机。[kubernetes 文档][2] 中的解释: > kubernetes 在一个物理集群上提供了多个虚拟集群。这些虚拟集群被称为命名空间。 -你为什么需要命名空间?一句话概括:隔离。 +你为什么需要命名空间?一言以蔽之:隔离。 -隔离有很多优点,如它提供了安全和干净的环境。如果你是基础设施的所属者,并且为开发者提供环境,隔离就相当重要。你最不需要的就是,一个不熟悉你集群是如何搭建的人去修改系统配置 — 这可能导致所有人都无法登录。 +隔离有很多优点,如它提供了安全和干净的环境。如果你是基础设施的所属者,并且要为开发者提供环境,隔离就相当重要。你最不需要的就是,一个不熟悉你集群是如何搭建的人去修改系统配置 —— 这可能导致所有人都无法登录。 ### 初始命名空间 - 一个集群的三个初始命名空间:**default**、**kube-system** 和 **kube-public**。虽然你可以用这三个命名空间作技术部署,但我还是推荐你把这三个命名空间留作系统配置用,而不是你的项目。 +一个集群的三个初始命名空间:`default`、`kube-system` 和 `kube-public`。虽然技术上你可以用这三个命名空间作部署,但我还是推荐你把这三个命名空间留作系统配置用,而不是你的项目。 - * **Default** 某些部署没有指明命名空间,这样部署可以快速创建一个网格,但如果做了很多错误信息的部署,就很能去清理。我不去修改它,因为它在为某一个目的服务时,会在不止一种情况下误导我。 - * **Kube-system** 系统相关的所有对象组成的命名空间。任何此命名空间的部署都可能是危险的操作,可能对系统本身造成不可挽回的破坏。没错,我试过;所以我不推荐。 - * **Kube-public** 所有人可读,但是这个命名空间是为系统保留的。 +* `Default` 用于某些没有指明命名空间的部署,这是一种快速创建混乱的做法,如果你在没有正确信息的情况下做了很多部署,将很难清理。我不会去动它,因为它只有这一个用途,而且在不止一种情况下误导过我。 +* `Kube-system` 是 Kubernetes 系统相关的所有对象组成的命名空间。任何对此命名空间的部署都可能是危险的操作,可能对系统本身造成不可挽回的破坏。没错,我试过;所以我不推荐。 +* `Kube-public` 所有人可读,但是这个命名空间是为系统保留的。 ### 用命名空间来实现隔离 -我用了多种方式通过命名空间来实现隔离。我经常用命名空间来把多个用户项目分割到不同的环境。这种方式可以有效防止跨项目的污染,因为命名空间提供了独立的环境。例如,使用者可以安装不同版本的 Jenkins,如果它们的环境变量是在不同的命名空间,就不会冲突。 +我用了多种方式通过命名空间来实现隔离。我经常用命名空间来把多个用户项目分割到不同的环境。这种方式可以有效防止跨项目的污染,因为命名空间提供了独立的环境。例如,用户可以安装不同版本的 Jenkins,如果它们的环境变量是在不同的命名空间,就不会冲突。 -这种隔离对于清理也很有帮助。如果部署组的多个项目被废弃,你可以用命令 `kubectl delete ns <$NAMESPACENAME>` 一键删除命名空间,清理命名空间内的所有东西。(请确认被删除的是正确的命名空间。我曾经在生产环境删除了错误的命名空间,这很不好。) +这种隔离对于清理也很有帮助。如果开发小组的多个项目突然被废弃,你可以用命令 `kubectl delete ns <$NAMESPACENAME>` 一键删除命名空间,清理命名空间内的所有东西。(请确认被删除的是正确的命名空间。我曾经在生产环境删除了错误的命名空间,这很不好。) -如果你是基础设施所有者,请谨慎操作,因为这可能会引发其他团队的的故障或引发其他问题。例如,如果你创建了一个特定的命名空间,里面有 DNS 函数,其他人删除了它,那么命名空间内的所有 pod 和它们运行的应用都会被清空。所有的**删除**操作在真正实施之前都应该由同事(通过 [GitOps][3])评审一下。 +如果你是基础设施所有者,请谨慎操作,因为这可能会引发其他团队的的故障或引发其他问题。例如,如果你创建了一个特定的命名空间,里面有特殊的额外安全的 DNS 功能,但是其他人删除了它,那么命名空间内的所有 pod 和它们运行的应用都会被清空。所有的**删除**操作在真正实施之前都应该由同事(通过 [GitOps][3])评审一下。 虽然官方文档不建议 [10 人以下团队][2] 使用多个命名空间,但出于架构需要,在我自己的集群上还是用了多个命名空间。集群越干净越好。 ### 关于命名空间管理员应该知道的 -首先,命名空间不能嵌套。部署只能在一个命名空间中进行。对于版本化项目,你不一定要用命名空间,你可以使用标签来区分有相同名字的版本化应用。命名空间使用配额来为不同的用户划分资源;例如,*某个命名空间最多能有 x 个 node*。最后,所有的命名空间对于资源类型只能使用一个独一无二的名字。 +首先,命名空间不能嵌套。部署只能在一个命名空间中进行。对于版本化项目,你不一定要用命名空间,你可以使用标签来区分有相同名字的版本化应用。命名空间使用配额来为不同的用户划分资源;例如,*某个命名空间最多能有 x 个节点*。最后,所有的命名空间对于该资源类型只能使用一个独一无二的名字。 ### 命名空间命令操作 -你需要安装 [Minikube][4]、 [Helm][5] 和 [kubectl][6] 命令行,才能使用下面的命名空间命令。我的文章 [_安全浏览你的 DevOps 流水线_][7] 中有它们的安装教程,你也可以去每个工程的官方主页去找安装教程。我使用的是最新的 Minikube。手动安装很快,第一次就能成功运行。 +你需要安装 [Minikube][4]、[Helm][5] 和 [kubectl][6] 命令行,才能使用下面的命名空间命令。我的文章《[安全扫描你的 DevOps 流水线][7]》中有它们的安装教程,你也可以去每个项目的官方主页去找安装教程。我使用的是最新的 Minikube。手动安装很快,第一次就能成功运行。 获取你的第一组命名空间: @@ -63,7 +65,7 @@ jess@Athena:~$ kubectl create namespace athena namespace/athena created ``` -现在开发者可以部署到你创建的命名空间;例如,这里是一个简短的 Helm 结构信息: +现在开发者可以部署到你创建的命名空间了;例如,这里是一个简短的 Helm chart: ``` jess@Athena:~$ helm install teset-deploy stable/redis --namespace athena @@ -74,7 +76,7 @@ STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: -** Please be patient while the chart is being deployed ** +` Please be patient while the chart is being deployed ` Redis can be accessed via port 6379 on the following DNS names from within your cluster: teset-deploy-redis-master.athena.svc.cluster.local for read/write operations @@ -98,6 +100,7 @@ export REDIS_PASSWORD=$(kubectl get secret --namespace athena teset-deploy-redis ``` 2. 使用 Redis CLI 连接: + ```bash redis-cli -h teset-deploy-redis-master -a $REDIS_PASSWORD redis-cli -h teset-deploy-redis-slave -a $REDIS_PASSWORD @@ -110,11 +113,10 @@ kubectl port-forward --namespace athena svc/teset-deploy-redis-master 6379:6379 redis-cli -h 127.0.0.1 -p 6379 -a $REDIS_PASSWORD ``` -现在这一套部署已经完成了,你有一个在命名空间 **test-deploy** 中部署的图表。 +现在这一套部署已经完成了,你有一个在命名空间 `test-deploy` 中部署的 chart。 查看你的命名空间中有哪些 pod: - ``` jess@Athena:~$ kubectl get pods --namespace athena NAME                            READY   STATUS  RESTARTS   AGE @@ -127,7 +129,6 @@ teset-deploy-redis-slave-1      1/1     Running   0             90s 一键删除所有东西: - ```bash jess@Athena:~$ kubectl delete namespace athena namespace "athena" deleted @@ -137,7 +138,6 @@ namespace "athena" deleted 再次检查一下所有东西是否被删除了: - ```bash jess@Athena:~$ kubectl get pods --all-namespaces NAMESPACE       NAME                            READY   STATUS  RESTARTS   AGE @@ -156,11 +156,11 @@ kube-system   storage-provisioner               1/1     Running   0 ### 命名空间实践 -现在我是为了安全使用命名空间,如限制用户的权限。你可以限制所有的东西 — 从哪些角色可以访问命名空间,到命名空间可使用的集群资源(CPU 等)的配额等级。例如,我通过资源配额和基于角色的访问控制(role-based access control,RBAC)配置来确保只有允许的服务账号可以访问命名空间。 +当前我是出于安全考虑才使用命名空间,如限制用户的权限。你可以限制所有的东西 —— 从哪些角色可以访问命名空间,到命名空间可使用的集群资源(CPU 等)的配额等级。例如,我通过资源配额和基于角色的访问控制role-based access control(RBAC)配置来确保只有允许的服务账号可以访问命名空间。 -对于隔离方面的安全,我不希望我的私人 Jenkins 应用可以通过一个信任的本地网络被当做有公共 IP 地址的安全镜像来访问(我不得不假定,可能会做出妥协)。 +对于隔离方面的安全,我不希望我的私人 Jenkins 应用可以通过一个信任的本地网络被当做一个有公共 IP 地址的安全镜像来访问(我不得不假定,可能会被侵袭)。 -如果你很难提前计算出到底要在你的云平台上部署多少 node(就我而言,在把我的私人服务器放到 [segfaulting][8] 之前可以部署多少个 node),那么命名空间在预算方面也很有用。虽然这超出了本文的讨论范围,而且很复杂,但值得你去调研和使用来防止你的集群过分扩展。 +如果你很难提前计算出到底要在你的云平台上部署多少节点(或者,就我而言,是在[搞崩][8]我的家庭服务器之前我能部署多少个),那么命名空间在预算方面也很有用。虽然这超出了本文的讨论范围,而且很复杂,但值得你去调研和使用来防止你的集群过分扩展。 ### 总结 @@ -173,7 +173,7 @@ via: https://opensource.com/article/19/12/kubernetes-namespaces 作者:[Jessica Cherry][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 37c8828eee2b213dcdadf927e2e163923fbc94c0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Jan 2020 09:46:40 +0800 Subject: [PATCH 215/430] PUB @lxbwolf https://linux.cn/article-11749-1.html --- .../20191219 Kubernetes namespaces for beginners.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191219 Kubernetes namespaces for beginners.md (99%) diff --git a/translated/tech/20191219 Kubernetes namespaces for beginners.md b/published/20191219 Kubernetes namespaces for beginners.md similarity index 99% rename from translated/tech/20191219 Kubernetes namespaces for beginners.md rename to published/20191219 Kubernetes namespaces for beginners.md index 06a5c4bf50..c45aa74d42 100644 --- a/translated/tech/20191219 Kubernetes namespaces for beginners.md +++ b/published/20191219 Kubernetes namespaces for beginners.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11749-1.html) [#]: subject: (Kubernetes namespaces for beginners) [#]: via: (https://opensource.com/article/19/12/kubernetes-namespaces) [#]: author: (Jessica Cherry https://opensource.com/users/jrepka) From cbcfbc8dd7330da93819934bd6131128f0230766 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Jan 2020 10:20:23 +0800 Subject: [PATCH 216/430] PRF @wxy --- ...ming resources for coders of all levels.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20191231 12 programming resources for coders of all levels.md b/translated/tech/20191231 12 programming resources for coders of all levels.md index c3687187b3..c61d0aa4c3 100644 --- a/translated/tech/20191231 12 programming resources for coders of all levels.md +++ b/translated/tech/20191231 12 programming resources for coders of all levels.md @@ -1,39 +1,39 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (12 programming resources for coders of all levels) [#]: via: (https://opensource.com/article/19/12/programming-resources) [#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) -12 个给码农们的编程资源 +12 个给全等级码农们的编程资源 ====== > 无论你身处编程旅程中的何处,这 12 篇编程文章都有你需要学习一些东西。 -![Woman sitting in front of her computer][1] +![](https://img.linux.net.cn/data/attachment/album/202001/05/102002cdjy66jucbcfs6dg.jpg) > “学习计算机编程的最佳时间是 20 年前,其次是现在。” -> — (也许是)计算机科学的谚语 +> — 计算机科学的谚语(也许是) -你是新程序员、经验丰富的 Web 开发人员、后端大师、头发花白的系统程序员,还是其他神秘物种的计算机极客?无论你身处广阔的软件开发人员生态系统中的何处,在我们领域中唯一不变的就是需要了解新技术及其应用方法。这是过去一年来阅读量最大的 Opensource.com 文章的集合,我很高兴在这里与你分享它们。 +无论你是新程序员、经验丰富的 Web 开发人员、后端大师、头发花白的系统程序员,还是其他神秘物种的计算机极客?无论你身处广阔的软件开发人员生态系统中的何处,在我们领域中唯一不变的就是需要了解新技术及其应用方法。这是过去一年来阅读量最大的 Opensource.com 文章的集合,我很高兴在这里与你分享它们。 ### 好好学习 无论你的技能或兴趣是什么,学习如何编写计算机程序都可以将特定领域的知识变成一种超能力。不幸的是,至少从现在开始,还不可能通过坐在计算机前面接受电磁辐射就能学会如何编程。在这之前,我推荐这些出色的文章来帮助激发你的编程技能。它们解决了一些重要的问题,例如考虑学习哪种语言以及不同的入门方式。 -* [你应该学习哪种编程语言?][2] -* [学习 Python 的 12 个方式][3] -* [你可以使用树莓派学习的三种流行编程语言][4] -* [利用 Python 引导孩子的计算机思维][5] +* [你应该学习哪种编程语言?][2](译文) +* [学习 Python 的 12 个方式][3](译文) +* [你可以使用树莓派学习的三种流行编程语言][4](译文) +* [利用 Python 引导孩子的计算机思维][5](译文) ### 天天向上 经验丰富的程序员知道,与学习编程相比,唯一更难的就是使你的技能和知识保持最新。但是我们是[自学成才][6]的一族,总是希望提高我们的专业知识和理解力。即使我们不期望使用新技术,我们也知道总会有人问起它们。这些有关 Rust、WebAssembly 和 Podman 的文章是开始学习软件技术一些即将出现的趋势的好地方。 * [为什么要在 WebAssembly 中使用 Rust?][7] -* [使用 WebAssembly 提升命令行游乐场][8] +* [使用 WebAssembly 扩展命令行领域][8] * [免 root 的 Podman 如何工作?][9] * [为什么选择 Rust 作为你的下一种编程语言][10] @@ -42,8 +42,8 @@ 尽管新技术层出不穷,但回顾过去可以帮助你前进。当今惊人的技术是建立在昨天的工具之上的,即使我们从未使用这些传奇语言编写过代码,它也将使我们很好地理解这些工具的功能和局限性。这一系列文章集中于 C 语言、用 AWK 编写的实际应用程序,以及对流行度下降但也许还没有消亡的计算机语言的有趣讨论。 * [C 的巨大影响] [11] -* [如何写好 C main 函数][12] -* [用 AWK 喝咖啡][13] +* [如何写好 C main 函数][12](译文) +* [用 AWK 喝咖啡][13](译文) * [你最喜欢的“死”语言是什么?][14] ### 学习不止 @@ -57,7 +57,7 @@ via: https://opensource.com/article/19/12/programming-resources 作者:[Erik O'Shaughnessy][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 833d4892d808f3b0db96e43d32ee02d990861be3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Jan 2020 10:20:59 +0800 Subject: [PATCH 217/430] PUB @wxy https://linux.cn/article-11751-1.html --- ...91231 12 programming resources for coders of all levels.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191231 12 programming resources for coders of all levels.md (98%) diff --git a/translated/tech/20191231 12 programming resources for coders of all levels.md b/published/20191231 12 programming resources for coders of all levels.md similarity index 98% rename from translated/tech/20191231 12 programming resources for coders of all levels.md rename to published/20191231 12 programming resources for coders of all levels.md index c61d0aa4c3..2e32ec2515 100644 --- a/translated/tech/20191231 12 programming resources for coders of all levels.md +++ b/published/20191231 12 programming resources for coders of all levels.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11751-1.html) [#]: subject: (12 programming resources for coders of all levels) [#]: via: (https://opensource.com/article/19/12/programming-resources) [#]: author: (Erik O'Shaughnessy https://opensource.com/users/jnyjny) From 24c143416f9463a5c00a2e5351d6be60a1d95d46 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 5 Jan 2020 14:29:55 +0800 Subject: [PATCH 218/430] =?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 --- ...w to write a Python web API with Django.md | 247 ------------------ ...w to write a Python web API with Django.md | 230 ++++++++++++++++ 2 files changed, 230 insertions(+), 247 deletions(-) delete mode 100644 sources/tech/20191129 How to write a Python web API with Django.md create mode 100644 translated/tech/20191129 How to write a Python web API with Django.md diff --git a/sources/tech/20191129 How to write a Python web API with Django.md b/sources/tech/20191129 How to write a Python web API with Django.md deleted file mode 100644 index 38acb243cd..0000000000 --- a/sources/tech/20191129 How to write a Python web API with Django.md +++ /dev/null @@ -1,247 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to write a Python web API with Django) -[#]: via: (https://opensource.com/article/19/11/python-web-api-django) -[#]: author: (Rachel Waston https://opensource.com/users/rachelwaston) - -How to write a Python web API with Django -====== -Django is one of the most popular frameworks for Python API development. -Learn how to use it in this quick tutorial. -![Hands on a keyboard with a Python book ][1] - -[Django][2] is the comprehensive web framework by which all other frameworks are measured. One of the most popular names in Python API development, Django has surged in popularity since its start in 2005. - -Django is maintained by the Django Software Foundation and has experienced great community support, with over 11,600 members worldwide. On Stack Overflow, Django has around 191,000 tagged questions. Websites like Spotify, YouTube, and Instagram rely on Django for application and data management. - -This article demonstrates a simple API to fetch data from a server using the GET method of the HTTP protocol. - -### Set up a project - -First, create a structure for your Django application; you can do this at any location on your system: - - -``` -$ mkdir myproject -$ cd myproject -``` - -Then, create a virtual environment to isolate package dependencies locally within the project directory: - - -``` -$ python3 -m venv env -$ source env/bin/activate -``` - -On Windows, use the command **env\Scripts\activate** to activate your Python virtual environment. - -### Install Django and the Django REST framework - -Next, install the Python modules for Django and Django REST: - - -``` -$ pip3 install django -$ pip3 install djangorestframework -``` - -### Instantiate a new Django project - -Now that you have a work environment for your app, you must instantiate a new Django project. Unlike a minimal framework like [Flask][3], Django includes dedicated commands for this process (note the trailing **.** character in the first command): - - -``` -$ django-admin startproject tutorial . -$ cd tutorial -$ django-admin startapp quickstart -``` - -Django uses a database as its backend, so you should sync your database before beginning development. The database can be managed with the **manage.py** script that was created when you ran the **django-admin** command. Because you're currently in the **tutorial** directory, use the **../** notation to run the script, located one directory up: - - -``` -$ python3 ../manage.py makemigrations -No changes detected -$ python4 ../manage.py migrate -Operations to perform: -  Apply all migrations: admin, auth, contenttypes, sessions -Running migrations: -  Applying contenttypes.0001_initial... OK -  Applying auth.0001_initial... OK -  Applying admin.0001_initial... OK -  Applying admin.0002_logentry_remove_auto_add... OK -  Applying admin.0003_logentry_add_action_flag_choices... OK -  Applying contenttypes.0002_remove_content_type_name... OK -  Applying auth.0002_alter_permission_name_max_length... OK -  Applying auth.0003_alter_user_email_max_length... OK -  Applying auth.0004_alter_user_username_opts... OK -  Applying auth.0005_alter_user_last_login_null... OK -  Applying auth.0006_require_contenttypes_0002... OK -  Applying auth.0007_alter_validators_add_error_messages... OK -  Applying auth.0008_alter_user_username_max_length... OK -  Applying auth.0009_alter_user_last_name_max_length... OK -  Applying auth.0010_alter_group_name_max_length... OK -  Applying auth.0011_update_proxy_permissions... OK -  Applying sessions.0001_initial... OK -``` - -### Create users in Django - -Create an initial user named **admin** with the example password of **password123**: - - -``` -$ python3 ../manage.py createsuperuser \ -  --email [admin@example.com][4] \ -  --username admin -``` - -Create a password when you're prompted. - -### Implement serializers and views in Django - -For Django to be able to pass information over to an HTTP GET request, the information object must be translated into valid response data. Django implements **serializers** for this. - -In your project, define some serializers by creating a new module named **quickstart/serializers.py**, which you'll use for data representations: - - -``` -from django.contrib.auth.models import User, Group -from rest_framework import serializers - -class UserSerializer(serializers.HyperlinkedModelSerializer): -    class Meta: -        model = User -        fields = ['url', 'username', 'email', 'groups'] - -class GroupSerializer(serializers.HyperlinkedModelSerializer): -    class Meta: -        model = Group -        fields = ['url', 'name'] -``` - -A [view][5] in Django is a function that takes a web request and returns a web response. The response can be HTML, or an HTTP redirect, or an HTTP error, a JSON or XML document, an image or TAR file, or anything else you can get over the internet. To create a view, open **quickstart/views.py** and enter the following code. This file already exists and has some boilerplate text in it, so keep that and append this text to the file: - - -``` -from django.contrib.auth.models import User, Group -from rest_framework import viewsets -from tutorial.quickstart.serializers import UserSerializer, GroupSerializer - -class UserViewSet(viewsets.ModelViewSet): -    """ -    API endpoint  allows users to be viewed or edited. -    """ -    queryset = User.objects.all().order_by('-date_joined') -    serializer_class = UserSerializer - -class GroupViewSet(viewsets.ModelViewSet): -    """ -    API endpoint  allows groups to be viewed or edited. -    """ -    queryset = Group.objects.all() -    serializer_class = GroupSerializer -``` - -### Generate URLs with Django - -Now you can generate URLs so people can access your fledgling API. Open **urls.py** in a text editor and replace the default sample code with this code: - - -``` -from django.urls import include, path -from rest_framework import routers -from tutorial.quickstart import views - -router = routers.DefaultRouter() -router.register(r'users', views.UserViewSet) -router.register(r'groups', views.GroupViewSet) - -# Use automatic URL routing -# Can also include login URLs for the browsable API -urlpatterns = [ -    path('', include(router.urls)), -    path('api-auth/', include('rest_framework.urls', namespace='rest_framework')) -] -``` - -### Adjust your Django project settings - -The settings module for this example project is stored in **tutorial/settings.py**, so open that in a text editor and add **rest_framework** to the end of the **INSTALLED_APPS** list: - - -``` -INSTALLED_APPS = [ -    ... -    'rest_framework', -] -``` - -### Test your Django API - -You're now ready to test the API you've built. First, start up the built-in server from the command line: - - -``` -`$ python3 manage.py runserver` -``` - -You can access your API by navigating to the URL **** using **curl**: - - -``` -$ curl --get -[{"url":" -``` - -Or use Firefox or the [open source web browser][6] of your choice: - -![A simple Django API][7] - -For more in-depth knowledge about RESTful APIs using Django and Python, see the excellent [Django documentation][8]. - -### Why should I use Django? - -The major benefits of Django: - - 1. The size of the Django community is ever-growing, so you have lots of resources for guidance, even on a complicated project. - 2. Features like templating, routing, forms, authentication, and management tools are included by default. You don't have to hunt for external tools or worry about third-party tools introducing compatibility issues. - 3. Simple constructs for users, loops, and conditions allow you to focus on writing code. - 4. It's a mature and optimized framework that is extremely fast and reliable. - - - -The major drawbacks of Django are: - - 1. Django is complex! From a developer's point of view, Django can be trickier to learn than a simpler framework. - 2. There's a big ecosystem around Django. This is great once you're comfortable with Django, but it can be overwhelming when you're still learning. - - - -Django is a great option for your application or API. Download it, get familiar with it, and start developing an amazing project! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/11/python-web-api-django - -作者:[Rachel Waston][a] -选题:[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/rachelwaston -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) -[2]: https://www.djangoproject.com/ -[3]: https://opensource.com/article/19/11/python-web-api-flask -[4]: mailto:admin@example.com -[5]: https://docs.djangoproject.com/en/2.2/topics/http/views/ -[6]: https://opensource.com/article/19/7/open-source-browsers -[7]: https://opensource.com/sites/default/files/uploads/django-api.png (A simple Django API) -[8]: https://docs.djangoproject.com/en/2.2 diff --git a/translated/tech/20191129 How to write a Python web API with Django.md b/translated/tech/20191129 How to write a Python web API with Django.md new file mode 100644 index 0000000000..aaf4acefb8 --- /dev/null +++ b/translated/tech/20191129 How to write a Python web API with Django.md @@ -0,0 +1,230 @@ +[#]: collector: (lujun9972) +[#]: translator: (MjSeven) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to write a Python web API with Django) +[#]: via: (https://opensource.com/article/19/11/python-web-api-django) +[#]: author: (Rachel Waston https://opensource.com/users/rachelwaston) + +如何借助 Django 来编写一个 Python Web API +====== +Django 是 Python API 开发中最流行的框架之一,在这个教程中,我们来学习如何使用它。 +![拿起 Python 书来学习吧][1] + +[Django][2] 所有 Web 框架中最全面的,也是最受欢迎的一个。自 2005 年以来,其流行度大幅上升。 + +Django 是由 Django 软件基金会维护,并且获得了社区的大力支持,在全球拥有超过 11,600 名会员。在 Stack Overflow 上,Django 约有 191,000 个带标签的问题。Spotify、YouTube 和 Instagram 等都使用 Django 来构建应用程序和数据管理。 + +本文演示了一个简单的 API,通过它可以使用 HTTP 协议的 GET 方法来从服务器获取数据。 + +### 构建一个项目 + +首先,为你的 Django 应用程序创建一个目录结构,你可以在系统的任何位置创建: + +``` +$ mkdir myproject +$ cd myproject +``` + +然后,在项目目录中创建一个虚拟环境来隔离本地包依赖关系: + +``` +$ python3 -m venv env +$ source env/bin/activate +``` + +在 Windows 上,使用命令 **env\Scripts\activate** 来激活虚拟环境: + +### 安装 Django 和 Django REST framework + +然后,安装 Django 和 Django REST: + +``` +$ pip3 install django +$ pip3 install djangorestframework +``` + +### 实例化一个新的 Django 项目 + +现在你的应用程序已经有了一个工作环境,你必须实例化一个新的 Django 项目。与 [Flask][3] 这样微框架不同的是,Django 有专门的命令来创建(注意第一条命令后的 **.** 字符)。 + +``` +$ django-admin startproject tutorial . +$ cd tutorial +$ django-admin startapp quickstart +``` + +Django 使用数据库来管理后端,所以你应该在开始开发之前同步数据库,数据库可以通过 **manage.py** 脚本管理,它是在你运行 **django-admin** 命令时创建的。因为你现在在 **tutorial** 目录,所以使用 **../** 符号来运行脚本,它位于上一层目录: + +``` +$ python3 ../manage.py makemigrations +No changes detected +$ python4 ../manage.py migrate +Operations to perform: +  Apply all migrations: admin, auth, contenttypes, sessions +Running migrations: +  Applying contenttypes.0001_initial... OK +  Applying auth.0001_initial... OK +  Applying admin.0001_initial... OK +  Applying admin.0002_logentry_remove_auto_add... OK +  Applying admin.0003_logentry_add_action_flag_choices... OK +  Applying contenttypes.0002_remove_content_type_name... OK +  Applying auth.0002_alter_permission_name_max_length... OK +  Applying auth.0003_alter_user_email_max_length... OK +  Applying auth.0004_alter_user_username_opts... OK +  Applying auth.0005_alter_user_last_login_null... OK +  Applying auth.0006_require_contenttypes_0002... OK +  Applying auth.0007_alter_validators_add_error_messages... OK +  Applying auth.0008_alter_user_username_max_length... OK +  Applying auth.0009_alter_user_last_name_max_length... OK +  Applying auth.0010_alter_group_name_max_length... OK +  Applying auth.0011_update_proxy_permissions... OK +  Applying sessions.0001_initial... OK +``` + +### 在 Django 中创建用户 + +创建一个名为 **admin**,密码为 **password123** 的初始用户: + +``` +$ python3 ../manage.py createsuperuser \ +  --email [admin@example.com][4] \ +  --username admin +``` + +在提示时创建密码。 + +### 在 Django 中实现序列化和视图 + +为了使 Django 能够将信息传递给 HTTP GET 请求,必须将信息对象转化为有效的响应数据。Django 为此实现了“序列化类”。 + +在你的项目中,创建一个名为 **quickstart/serializers.py** 的新模块,使用它来定义一些序列化器,模块将用于数据展示: + +``` +from django.contrib.auth.models import User, Group +from rest_framework import serializers + +class UserSerializer(serializers.HyperlinkedModelSerializer): +    class Meta: +        model = User +        fields = ['url', 'username', 'email', 'groups'] + +class GroupSerializer(serializers.HyperlinkedModelSerializer): +    class Meta: +        model = Group +        fields = ['url', 'name'] +``` + +Django 中的 [view][5] 是一个接受 Web 请求并返回 Web 响应的函数。响应可以是 HTML、HTTP 重定向、HTTP 错误、JSON 或 XML 文档、图像或 TAR 文件,或者可以是从 Internet 获得的任何其他内容。要创建视图,打开 **quickstart/views.py** 并输入以下代码。该文件已经存在,并且其中包含一些示例文本,保留这些文本并将以下代码添加到文件中: + +``` +from django.contrib.auth.models import User, Group +from rest_framework import viewsets +from tutorial.quickstart.serializers import UserSerializer, GroupSerializer + +class UserViewSet(viewsets.ModelViewSet): +    """ +    API 允许查看或编辑用户 +    """ +    queryset = User.objects.all().order_by('-date_joined') +    serializer_class = UserSerializer + +class GroupViewSet(viewsets.ModelViewSet): +    """ +    API 允许查看或编辑组 +    """ +    queryset = Group.objects.all() +    serializer_class = GroupSerializer +``` + +### 使用 Django 生成 URL + +现在,你可以生成 URL 以便人们可以访问你刚起步的 API。在文本编辑器中打开 urls.py 并将默认示例代码替换为以下代码: + +``` +from django.urls import include, path +from rest_framework import routers +from tutorial.quickstart import views + +router = routers.DefaultRouter() +router.register(r'users', views.UserViewSet) +router.register(r'groups', views.GroupViewSet) + +# 使用自动路由 URL +# 还有登录 URL +urlpatterns = [ +    path('', include(router.urls)), +    path('api-auth/', include('rest_framework.urls', namespace='rest_framework')) +] +``` + +### 调整你的 Django 项目设置 + +这个示例项目的设置模块存储在 **tutorial/settings.py** 中,因此在文本编辑器中将其打开,然后在 **INSTALLED_APPS** 列表的末尾添加 **rest_framework**: + +``` +INSTALLED_APPS = [ +    ... +    'rest_framework', +] +``` + +### 测试 Django API + +现在,你可以测试构建的 API。首先,从命令行启动内置服务器: + +``` +`$ python3 manage.py runserver` +``` + +你可以通过使用 **curl** 导航至 URL **** 来访问 API: + +``` +$ curl --get +[{"url":" +``` + +使用 Firefox 或[开源浏览器][6]: + +![一个简单的 Django API][7] + +有关使用 Django 和 Python 的 RESTful API 的更多深入知识,参考出色的 [Django 文档][8]。 + +### 为什么要使用 Djago? + +Django 的主要优点: + + 1. Django 社区的规模正在不断扩大,因此即使你做一个复杂项目,也会有大量的指导资源。 + 2. 默认包含模板、路由、表单、身份验证和管理工具等功能,你不必寻找外部工具,也不必担心第三方工具会引入兼容性问题。 + 3. 用户,循环和条件的简单结构使你可以专注于编写代码。 + 4. 这是一个成熟且经过优化的框架,它非常快速且可靠。 + +Django 的主要缺点是: + + 1. Django 很复杂!从开发人员视角的角度来看,它可能比简单的框架更难学。 + 2. Django 有一个很大的生态系统。一旦你熟悉它,这会很棒,但是当你深入学习时,它可能会令人感到无所适从。 + +对你的应用程序或 API 来说,Django 是绝佳选择。下载并熟悉它,开始开发一个迷人的项目! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/11/python-web-api-django + +作者:[Rachel Waston][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/rachelwaston +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) +[2]: https://www.djangoproject.com/ +[3]: https://opensource.com/article/19/11/python-web-api-flask +[4]: mailto:admin@example.com +[5]: https://docs.djangoproject.com/en/2.2/topics/http/views/ +[6]: https://opensource.com/article/19/7/open-source-browsers +[7]: https://opensource.com/sites/default/files/uploads/django-api.png (A simple Django API) +[8]: https://docs.djangoproject.com/en/2.2 From 73017730a98b1f330565628ab3c4b013d8a0d178 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Sun, 5 Jan 2020 19:09:25 +0800 Subject: [PATCH 219/430] translating by lxbwolf --- sources/tech/20191210 Lessons learned from programming in Go.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191210 Lessons learned from programming in Go.md b/sources/tech/20191210 Lessons learned from programming in Go.md index 1702d36c47..0c9aeea2e2 100644 --- a/sources/tech/20191210 Lessons learned from programming in Go.md +++ b/sources/tech/20191210 Lessons learned from programming in Go.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1a18060ceafa26e3ec53d7943f74a06cda233400 Mon Sep 17 00:00:00 2001 From: summer2233 Date: Sun, 5 Jan 2020 21:29:00 +0800 Subject: [PATCH 220/430] Update 20171130 Excellent Business Software Alternatives For Linux.md --- ...171130 Excellent Business Software Alternatives For Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20171130 Excellent Business Software Alternatives For Linux.md b/sources/tech/20171130 Excellent Business Software Alternatives For Linux.md index 3469c62569..4a40b993f3 100644 --- a/sources/tech/20171130 Excellent Business Software Alternatives For Linux.md +++ b/sources/tech/20171130 Excellent Business Software Alternatives For Linux.md @@ -1,3 +1,5 @@ +summer2233 is translating + Excellent Business Software Alternatives For Linux ------- From 6ba21f4ddb9a1ce58ecf32a1e7d7f6ed54bf7c4a Mon Sep 17 00:00:00 2001 From: summer2233 Date: Sun, 5 Jan 2020 21:31:19 +0800 Subject: [PATCH 221/430] Update 20191226 10 Linux command tutorials for beginners and experts.md --- ...1226 10 Linux command tutorials for beginners and experts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md b/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md index 3172f26ea1..03fc77a8e1 100644 --- a/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md +++ b/sources/tech/20191226 10 Linux command tutorials for beginners and experts.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (summer2233) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 42dedf47444a6b0fd340182c185f042fdcef75b0 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 5 Jan 2020 22:31:00 +0800 Subject: [PATCH 222/430] Translating --- ...180522 Advanced use of the less text file viewer in Linux.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/tech/20180522 Advanced use of the less text file viewer in Linux.md b/sources/tech/20180522 Advanced use of the less text file viewer in Linux.md index e080c39b57..9d8ea93869 100644 --- a/sources/tech/20180522 Advanced use of the less text file viewer in Linux.md +++ b/sources/tech/20180522 Advanced use of the less text file viewer in Linux.md @@ -1,3 +1,5 @@ +Translating by MjSeven + Advanced use of the less text file viewer in Linux ====== From 5a1c090897bafe146ffdf3ca2d54d49c2304f422 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Jan 2020 22:46:48 +0800 Subject: [PATCH 223/430] PRF @MjSeven --- ... Python interfaces using zope.interface.md | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/translated/tech/20190924 An advanced look at Python interfaces using zope.interface.md b/translated/tech/20190924 An advanced look at Python interfaces using zope.interface.md index 9827cb9b28..e2797b9e40 100644 --- a/translated/tech/20190924 An advanced look at Python interfaces using zope.interface.md +++ b/translated/tech/20190924 An advanced look at Python interfaces using zope.interface.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (An advanced look at Python interfaces using zope.interface) @@ -9,42 +9,44 @@ 借助 zope.interface 深入了解 Python 接口 ====== -Zope.interface 可以帮助指出存在哪些接口,是由哪些对象提供的,以及如何查询这些信息。 + +> Zope.interface 可以帮助声明存在哪些接口,是由哪些对象提供的,以及如何查询这些信息。 + ![Snake charmer cartoon with a yellow snake and a blue snake][1] -**zope.interface** 库可以克服 Python 接口设计中的歧义性。让我们来研究一下。 +`zope.interface` 库可以克服 Python 接口设计中的歧义性。让我们来研究一下。 ### 隐式接口不是 Python 之禅 -[Python 之禅][2] 很宽松,但是有点自相矛盾,你可以从中证明一切。让我们来思考其中最著名的原则之一:“显示胜于隐式”。 +[Python 之禅][2] 很宽松,但是有点自相矛盾,以至于你可以用它来例证任何东西。让我们来思考其中最著名的原则之一:“显示胜于隐式”。 -在 Python 中会隐含的一件事是预期的接口。比如函数已经记录了它期望一个“类文件对象”或“序列”。但是什么是类文件对象呢?它支持 **.writelines** 和 **.seek** 吗?什么是一个“序列”?是否支持分步切片,例如 **a[1:10:2]**? +传统上,在 Python 中会隐含的一件事是预期的接口。比如函数已经记录了它期望一个“类文件对象”或“序列”。但是什么是类文件对象呢?它支持 `.writelines`吗?`.seek` 呢?什么是一个“序列”?是否支持步进切片,例如 `a[1:10:2]`? -最初,Python 的答案是所谓的“鸭子类型”,取自短语“如果它像鸭子一样行走,像鸭子一样嘎嘎叫,那么它可能就是鸭子”。换句话说,“试试看”,这可能是你能得到的最含蓄的表达。 +最初,Python 的答案是所谓的“鸭子类型”,取自短语“如果它像鸭子一样行走,像鸭子一样嘎嘎叫,那么它可能就是鸭子”。换句话说,“试试看”,这可能是你能得到的最具隐式的表达。 -为了使这些内容显式地表达出来,你需要一种方法来表达期望的接口。最早用 Python 编写的大型系统之一是 [Zope][3] Web 框架,它迫切需要这些东西来明确地呈现代码,例如,期望从“类似用户的对象”获得什么。 +为了使这些内容显式地表达出来,你需要一种方法来表达期望的接口。[Zope][3] Web 框架是最早用 Python 编写的大型系统之一,它迫切需要这些东西来使代码明确呈现出来,例如,期望从“类似用户的对象”获得什么。 -**zope.interface** 由 Zope 开发,但作为单独的 Python 包发布。**Zope.interface** 可以帮助指出存在哪些接口,是由哪些对象提供的,以及如何查询这些信息。 +`zope.interface` 由 Zope 开发,但作为单独的 Python 包发布。`Zope.interface` 可以帮助声明存在哪些接口,是由哪些对象提供的,以及如何查询这些信息。 -想象编写一个简单的 2D 游戏,它需要各种东西来支持 sprite 接口(to 校正:这里不知道如何翻译)。例如,表示一个边界框,但也表示对象何时与一个框相交。与一些其他语言不同,在 Python 中,将属性访问作为公共接口一部分是一种常见的做法,而不是实现 getter 和 setter。边界框应该是一个属性,而不是一个方法。 +想象编写一个简单的 2D 游戏,它需要各种东西来支持精灵界面(LCTT 译注:“精灵 Sprite”是指游戏面板中各个组件)。例如,表示一个边界框,但也要表示对象何时与一个框相交。与一些其他语言不同,在 Python 中,将属性访问作为公共接口一部分是一种常见的做法,而不是实现 getter 和 setter。边界框应该是一个属性,而不是一个方法。 -呈现外观列表的方法可能类似于: +呈现精灵列表的方法可能类似于: ``` def render_sprites(render_surface, sprites):     """     sprites 应该是符合 Sprite 接口的对象列表: -    * 一个属性 "bounding_box",包含了边界框 -    * "intersects" 方法,它接受一个 box 并返回 True 或 False +    * 一个名为 "bounding_box" 的属性,包含了边界框 +    * 一个名为 "intersects" 的方法,它接受一个边界框并返回 True 或 False     """ -    pass # 一些代码会渲染 +    pass # 一些做实际渲染的代码 ``` -游戏将具有许多处理 sprite 的功能(函数)。在每个功能(函数)中,你都必须在文档中指定预期。 +该游戏将具有许多处理精灵的函数。在每个函数中,你都必须在随附文档中指定预期。 -此外,某些功能可能期望使用更复杂的 Sprite 对象,例如具有 Z-order 的对象。我们必须跟踪哪些方法需要 Sprite 对象,哪些方法需要 SpriteWithZ 对象。 +此外,某些函数可能期望使用更复杂的精灵对象,例如具有 Z 序的对象。我们必须跟踪哪些方法需要 Sprite 对象,哪些方法需要 SpriteWithZ 对象。 -如果能够使 sprite 的内容显式出来,这样方法就可以声明“我需要一个 sprite”,并严格定义接口,这不是很好吗?来看看 **zope.interface**。 +如果能够使精灵是显式而直观的,这样方法就可以声明“我需要一个精灵”,并有个严格定义的接口,这不是很好吗?来看看 `zope.interface`。 ``` from zope import interface @@ -52,18 +54,18 @@ from zope import interface class ISprite(interface.Interface):     bounding_box = interface.Attribute( -        "The bounding box" +        "边界框"     )     def intersects(box):         "它和一个框相交吗?" ``` -乍看起来,这段代码有点奇怪。这些方法不包括 "self",而包含 "self" 是一种常见的做法,并且它有一个属性。这是在 zope.interface 中声明接口的方法。这看起来很奇怪,因为大多数人不习惯严格声明接口。 +乍看起来,这段代码有点奇怪。这些方法不包括 `self`,而包含 `self` 是一种常见的做法,并且它有一个**属性**。这是在 `zope.interface` 中声明接口的方法。这看起来很奇怪,因为大多数人不习惯严格声明接口。 这样做的原因是接口显示了如何调用方法,而不是如何定义方法。因为接口不是超类,所以它们可以用来声明数据属性。 -下面是一个可能的接口实现: +下面是一个能带有圆形精灵的接口的一个实现: ``` @implementer(ISprite) @@ -89,13 +91,13 @@ class CircleSprite:             for choose_y_from (top_left, bottom_right):                 x = choose_x_from[0]                 y = choose_y_from[1] -                if (((x - self.x) ** 2 + (y - self.y) ** 2) <= -                    self.radius ** 2): +                if (((x - self.x) ` 2 + (y - self.y) ` 2) <= +                    self.radius ` 2):                      return True         return False ``` -这 _显式_ 声明了 **CircleSprite** 类实现接口。它甚至能让我们验证该类是否正确实现了接口: +这**显式**声明了实现了该接口的 `CircleSprite` 类。它甚至能让我们验证该类是否正确实现了接口: ``` from zope.interface import verify @@ -105,7 +107,7 @@ def test_implementation():     verify.verifyObject(ISprite, sprite) ``` -这可以由 **pytest**、**nose** 或其他测试框架运行,它将验证创建的 sprite 是否符合接口。测试通常是局部的:它不会测试文档中没有提及的内容,甚至不会测试方法是否可以在没有异常的情况下被调用!但是,它会检查是否存在正确的方法和属性。这是对单元测试套件一个很好的补充,至少可以防止简单的拼写错误通过测试。 +这可以由 pytest、nose 或其他测试框架运行,它将验证创建的精灵是否符合接口。测试通常是局部的:它不会测试仅在文档中提及的内容,甚至不会测试方法是否可以在没有异常的情况下被调用!但是,它会检查是否存在正确的方法和属性。这是对单元测试套件一个很好的补充,至少可以防止简单的拼写错误通过测试。 -------------------------------------------------------------------------------- @@ -114,7 +116,7 @@ via: https://opensource.com/article/19/9/zopeinterface-python-package 作者:[Moshe Zadka][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 d499842bd3be1bf62a1bc3de70efe0202606f187 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Jan 2020 22:47:31 +0800 Subject: [PATCH 224/430] PUB @MjSeven https://linux.cn/article-11752-1.html --- ...advanced look at Python interfaces using zope.interface.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190924 An advanced look at Python interfaces using zope.interface.md (98%) diff --git a/translated/tech/20190924 An advanced look at Python interfaces using zope.interface.md b/published/20190924 An advanced look at Python interfaces using zope.interface.md similarity index 98% rename from translated/tech/20190924 An advanced look at Python interfaces using zope.interface.md rename to published/20190924 An advanced look at Python interfaces using zope.interface.md index e2797b9e40..f2918057fc 100644 --- a/translated/tech/20190924 An advanced look at Python interfaces using zope.interface.md +++ b/published/20190924 An advanced look at Python interfaces using zope.interface.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11752-1.html) [#]: subject: (An advanced look at Python interfaces using zope.interface) [#]: via: (https://opensource.com/article/19/9/zopeinterface-python-package) [#]: author: (Moshe Zadka https://opensource.com/users/moshezhttps://opensource.com/users/lauren-pritchetthttps://opensource.com/users/sethhttps://opensource.com/users/drmjg) From cdee6de4b6aaac4953a4055873acaf3490b905ee Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Jan 2020 23:49:32 +0800 Subject: [PATCH 225/430] PRF&PUB @nacyro https://linux.cn/article-11753-1.html --- ... and guides to enhance your tech skills.md | 85 ++++++++++++++++++ ... and guides to enhance your tech skills.md | 88 ------------------- 2 files changed, 85 insertions(+), 88 deletions(-) create mode 100644 published/20200101 9 cheat sheets and guides to enhance your tech skills.md delete mode 100644 translated/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md diff --git a/published/20200101 9 cheat sheets and guides to enhance your tech skills.md b/published/20200101 9 cheat sheets and guides to enhance your tech skills.md new file mode 100644 index 0000000000..966b7aee3a --- /dev/null +++ b/published/20200101 9 cheat sheets and guides to enhance your tech skills.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: (nacyro) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11753-1.html) +[#]: subject: (9 cheat sheets and guides to enhance your tech skills) +[#]: via: (https://opensource.com/article/20/1/cheat-sheets-guides) +[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) + +九个提升程序员技术技能的备忘单和指南 +====== + +> 用我们最新的编程备忘单和指南来为新年开局,它适合所有技能水平的人。 + +![](https://img.linux.net.cn/data/attachment/album/202001/05/233115etzm6hv4a3z5yvhg.jpg) + +对刚接触命令行的新程序员来说备忘单是完美的。然而,即便是最有经验的程序员也需要时不时地依靠参考资料。假如你刚好敲不出那个讨厌的快捷键,那么手边有个备忘单就很赞了。这是一份我们可供下载指南的综述,它将助你在 2020 年取得成功。 + +### 备忘单 + +#### Markdown + +[Markdown][2] 不仅针对程序员,任何人都可以借助它为纯文本文档增添语法和结构。此备忘单提供了使用 CommonMark 规范的 Markdown 基础要点。它还包括 GitHub 和 GitLab 的语法。 + +#### Linux 权限和用户 + +用这个 Linux 备忘单把[用户管理][3]命令放在手边。快速学习如何增删用户、查看历史以及设置权限。 + +#### Bash + +一旦你了解了 [Bash][4],在命令行中就蕴含了无限可能。我们的 Bash 备忘单可以帮助你更有效地使用键盘快捷键。不知不觉间,你就能在睡眠中(字面意义上)运行脚本。 + +#### Linux 常用命令 + +毫不奇怪,我们的 [Linux 常用命令备忘单][5]是如此受欢迎。这个备忘单包含了开始安装软件和导览文件系统的要点。为自己和你的同事打印出来吧。 + +#### 微服务 + +似乎每个人都在谈论[微服务][6],而且理由很充分。微服务使应用程序模块化,因此更容易构建和维护。它不再只是这个备忘单上的流行语。在[微服务开源指南][7]中了解重要的术语并学习更多关于微服务的基础知识。 + +#### Java + +此备忘单非常适合初级和中级 [Java][8] 程序员。它包括重要的上下文以及处理导入、变量、类等的代码。 + +#### pip + +程序员爱用 [pip][9] 命令来帮助安装、管理和使用 Python 软件包。然而,pip 可以做的远不止这些。这个备忘单将教你如何构建 wheels 和 record 包。 + +### 指南 + +#### 七个不可或缺的 PyPI 库 + +[这组 Python 教程][10]将帮助你学习如何更快地编写扩展、格式化代码、自动化测试、确保代码一致性,以及更多使用 PyPI 库的方法。 + +#### 开始学习 Kubernetes + +在这份平易近人的[指南][11]中,作者 Scott McCarty 用了一个出人意料的类比来解释 Kubernetes 的价值和上手步骤。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/cheat-sheets-guides + +作者:[Lauren Pritchett][a] +选题:[lujun9972][b] +译者:[nacyro](https://github.com/nacyro) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lauren-pritchett +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team) +[2]: https://opensource.com/downloads/cheat-sheet-markdown +[3]: https://opensource.com/downloads/linux-permissions-cheat-sheet +[4]: https://opensource.com/downloads/bash-cheat-sheet +[5]: https://opensource.com/downloads/linux-common-commands-cheat-sheet +[6]: https://opensource.com/downloads/microservices-cheat-sheet +[7]: https://opensource.com/article/19/11/microservices-cheat-sheet +[8]: https://opensource.com/downloads/java-cheat-sheet +[9]: https://opensource.com/downloads/pip-cheat-sheet +[10]: https://opensource.com/downloads/7-essential-pypi-libraries +[11]: https://opensource.com/downloads/getting-started-kubernetes-ebook +[12]: https://opensource.com/users/fatherlinux +[13]: https://opensource.com/downloads/cheat-sheets +[14]: https://opensource.com/email-newsletter diff --git a/translated/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md b/translated/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md deleted file mode 100644 index 15c10736ed..0000000000 --- a/translated/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md +++ /dev/null @@ -1,88 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (nacyro) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (9 cheat sheets and guides to enhance your tech skills) -[#]: via: (https://opensource.com/article/20/1/cheat-sheets-guides) -[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) - -九个提升你技术技能的备忘单和指南 -====== -用我们最新的编程备忘单和指南来为新年开局,它适合所有技能水平的人。来参加我们的投票,让我们知道你接下来想看什么! - -![a checklist for a team][1] - -对刚接触命令行的新程序员来说备忘单是完美的。然而,即便是最有经验的程序员也需要时不时地依靠参考资料。假如你刚好敲不出那个讨厌的快捷键,那么手边有个备忘单就很赞了。这是一份我们可供下载指南的综述,它将助你在 2020 年取得成功。 - -### 备忘单 - -#### [Markdown][2] - -Markdown 不仅针对程序员,任何人都可以借助它为纯文本文档增添语法和结构。此备忘单提供了使用 CommonMark 规范的 Markdown 要点。它还包括 GitHub 和 GitLab 的语法。 - -#### [Linux 权限和用户][3] - -用这个 Linux 备忘单把用户管理命令放在手边。快速学习如何增删用户、查看历史以及设置权限。 - -#### [Bash][4] - -一旦您了解了 Bash,在命令行中就蕴含了无限可能。我们的 Bash 备忘单可以帮助您更有效地使用键盘快捷键。不知不觉间,您就能易如反掌地运行脚本。 - -#### [Linux 常用命令][5] - -毫不奇怪,我们的 Linux 常用命令备忘单是如此受欢迎。这个备忘单包含了开始安装软件和导览文件系统的要点。为自己和你的同事打印出来吧。 - -#### [微服务][6] - -似乎每个人都在谈论微服务,而且理由很充分。微服务使应用程序模块化,因此更容易构建和维护。它不再只是这个备忘单上的流行语。在 [微服务开源指南][7] 中了解重要的术语并学习更多关于微服务的基础知识。 - -#### [Java][8] - -此备忘单非常适合初级和中级 Java 程序员。它包括重要的上下文以及处理导入、变量、类等的代码。 - -#### [pip][9] - -程序员爱用 pip 命令来帮助安装、管理和使用 Python 软件包。然而,pip 可以做的远不止这些。这个备忘单将教你如何构建 wheels 和 record 包。 - -### 指南 - -#### [七个不可或缺的 PyPI 库][10] - -这组 Python 教程将帮助您学习如何更快地编写扩展、格式化代码、自动化测试、确保代码一致性,以及更多使用 PyPI 库的方法。 - -#### [开始学习 Kubernetes][11] - -在这份平易近人的指南中,作者 [Scott McCarty][12] 用了一个出人意料的类比来解释 Kubernetes 的价值和上手步骤。 - -* * * - -我们想听听你的意见:你对新的备忘单或指南有什么高见?参加我们的投票,从选项中选择一个,或者在评论中告诉我们。点击 [这里][13] 查看我们所有的下载。通过 [注册][14] 我们的电子邮件通讯获得关于新备忘单的提醒。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/cheat-sheets-guides - -作者:[Lauren Pritchett][a] -选题:[lujun9972][b] -译者:[nacyro](https://github.com/nacyro) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/lauren-pritchett -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team) -[2]: https://opensource.com/downloads/cheat-sheet-markdown -[3]: https://opensource.com/downloads/linux-permissions-cheat-sheet -[4]: https://opensource.com/downloads/bash-cheat-sheet -[5]: https://opensource.com/downloads/linux-common-commands-cheat-sheet -[6]: https://opensource.com/downloads/microservices-cheat-sheet -[7]: https://opensource.com/article/19/11/microservices-cheat-sheet -[8]: https://opensource.com/downloads/java-cheat-sheet -[9]: https://opensource.com/downloads/pip-cheat-sheet -[10]: https://opensource.com/downloads/7-essential-pypi-libraries -[11]: https://opensource.com/downloads/getting-started-kubernetes-ebook -[12]: https://opensource.com/users/fatherlinux -[13]: https://opensource.com/downloads/cheat-sheets -[14]: https://opensource.com/email-newsletter From 52b33c1280863165623cc6a188441a9f69a16889 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 6 Jan 2020 00:56:19 +0800 Subject: [PATCH 226/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200105=207=20Wa?= =?UTF-8?q?ys=20NOT=20to=20manage=20your=20remote=20team?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200105 7 Ways NOT to manage your remote team.md --- ...5 7 Ways NOT to manage your remote team.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20200105 7 Ways NOT to manage your remote team.md diff --git a/sources/tech/20200105 7 Ways NOT to manage your remote team.md b/sources/tech/20200105 7 Ways NOT to manage your remote team.md new file mode 100644 index 0000000000..b4e223a03e --- /dev/null +++ b/sources/tech/20200105 7 Ways NOT to manage your remote team.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 Ways NOT to manage your remote team) +[#]: via: (https://opensource.com/article/20/1/ways-not-manage-remote-team) +[#]: author: (Matt Shealy https://opensource.com/users/mshealy) + +7 Ways NOT to manage your remote team +====== +Learn to let go and let your team shine with these simple steps. +![World locations with red dots with a sun burst background][1] + +Building a remote development team presents unique challenges. Trying to build a cross-functional team, full of various personalities, virtually can lead to communication disasters. Fortunately, through planning, smart hiring, training, and communication, project leaders can build and lead virtual development teams successfully. + +The demand for remote teams continues to grow. The increased demand for software developers and [new communication technology][2] has removed the barriers of geography. Even with these advancements, disparate team members from different backgrounds may find it challenging to learn how to interact with one another. + +It's easy for misunderstandings and miscommunications to occur. It's becoming more and more critical to [rethink collaboration][3] in a work environment growing increasingly more remote. As a result, project leaders must rethink the needs of teams spread out across the globe. + +By avoiding a few key pitfalls, your team can overcome these challenges consistently. If you follow a few time-tested, in-house practices, and some that apply specifically to remote teams, you can manage a range of personalities and complete your build successfully. + +The following are seven practices to avoid when managing a remote team. + +### Don't slack on training + +A variety of different perspectives is the top benefit of working with diverse remote team members. However, it’s essential to understand and acknowledge those differences during training. + +Addressing language differences is only one part of acknowledging team diversity. When recruiting programmers, it would be best if you focus on candidates with an aptitude for working in a multicultural environment and even in a multi-coding language environment. + +Also, don’t make the mistake of thinking that personal characteristics are unimportant because team members aren’t working face-to-face. Team members still have to collaborate, so their personalities must mesh. + +Training isn’t all technical skills. Emotional training can also help a team work well together remotely. Emotional intelligence [training can help coworkers develop skills like empathy and awareness][4] that can make teams work better together. Emotional distance can make it challenging to establish bonds between new trainees and team leaders from the get-go, which can immediately loosen bonds in what could be a strong remote team. Consider what remote team-building training you can do via video or on Slack. Remember that is it important to constantly be proactive in strengthening relationships throughout the life of your team. + +### Don't use an ad hoc communication system + +When working with diverse remote team members, it’s essential that you use straightforward, effective code management and communication software. Ideally, you want the most uncomplicated resources available. + +The process may need to be further simplified for newer team members and freelancers who do not have the time to learn everything about the ins and outs of the organization’s policies. + +Create standard ways to communicate with team members. Maybe all work discussion happens in Slack or one of its [open source alternatives][5], while teams use [project management software][6] to keep work on schedule. + +Having a clear space for each type of conversation will help those who need to focus on work, while also offering an outlet for fun. Team members must use these resources daily, if not hourly. If your solutions are too complicated, learning to navigate the tools will pull focus from design and implementation work. + +### Don't lose sight of the big picture + +Avoid the pitfalls of focusing too closely on daily goals. It is essential you stay focused on the overall project. You should work with team members to establish your goals and milestones, and make sure team members stay on schedule. As the project leader, it’s your job to make sure these key events contribute to deliverable milestones. + +### Don't micromanage your team + +Some project managers, especially those with a coding background, find it difficult to delegate responsibility. It’s natural to gravitate toward solving familiar problems. However, it’s your job to guide the ship, not develop solutions. + +In [a micromanaged environment][7], the project manager tells the programmers what the code is, and exactly how to craft it. However, this management style ultimately leads to employee dissatisfaction. + +Your team should feel free to explore solutions, initiate positive change, and use innovation for exciting new ideas. + +If you don’t give your coders space to innovate and use their creativity, they feel undervalued. If this sentiment persists, your remote staff members are unlikely to produce the best work possible. + +### Use this opportunity to promote diversity + +If you are going to build a remote team, you must understand and acknowledge that [team members will have different backgrounds][8]. This circumstance is especially beneficial. The diverse viewpoints of staff members will enable your team to offer insights that expand beyond that of a centrally located talent pool. + +Also, your diverse remote team will give you access to experience with global trends. Furthermore, your team will be less likely to suffer from the effect of crowd mentality thinking. + +With the freedom to innovate, team members will feel more comfortable offering their input. Together, these benefits will enable your team as a whole to build a product better suited for multiple regions and verticals. + +### Don't forget to keep an eye on costs + +Ballooning costs are a top challenge for development teams. Despite project planning best practices, scope creep is a real problem for even the most experienced teams. There are two underlying factors that need to be addressed if this problem is to be solved. + +The first is the fact that the more analysis that is done throughout the development process, the more complexity arises and is ultimately added to the system. The second factor is the fact that people who have been through system development before know that there won’t ever be a "second phase" of the project. They know that there will only be one shot at the project, so they try and fit everything possible into the initial project phase. + +These two self-reinforcing factors lead to a death spiral of problems. Too much analysis leads to system complexity and loads of features being crammed into the first phase. A lack of trust between IT and business teams inevitably forms because of this. The design requirements become too big and complicated for there to be any chance of staying on schedule or on budget. Inevitably, blame lands with the IT team. + +The answer to this problem is to restrict analysis to only what the business team needs right now. IT should refrain from speculating on what may be needed in the future or asking business team members what they may need down the line. + +These requirements allow IT to build a reliable project plan and overall budget. If your team is looking to outsource the project at least in part, [calculating the app development costs][9] for each individual team or project component can help to keep things on track. + +### Don't think of time zone differences as a barrier + +Do not view time zone differences as a challenge. You can leverage time zones to your advantage and build your team in a way that will keep the project running around the clock. + +What is more important is choosing candidates who work independently. Good remote coders are responsible, organize their time effectively, and communicate well with team members. With an effective communication system, time differences will have no effect on the successful outcome of your team. + +Remote team members benefit significantly from predictable and straightforward engagement. The relatively new remote work environment demands that staff members establish a new standard for clear, concise communication. To promote a collaborative environment, teams must establish norms, such as universal jargon and consensus on communication tools. + +In an environment that thrives on innovation, predictability is an asset when it comes to teamwork. Everyone is different, and innovation is a sought-after commodity in software development. However, in the remote environment, consistent behavior helps team members communicate effectively. + +### Conclusion + +Remote work is quickly becoming the new default for software development. Be sure to avoid these pitfalls to set your teams up for success. + +Do you have any tips to recommend? Please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/ways-not-manage-remote-team + +作者:[Matt Shealy][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mshealy +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_remote_teams.png?itok=Wk1yBFv6 (World locations with red dots with a sun burst background) +[2]: https://www.chamberofcommerce.com/business-advice/strategies-and-tools-for-remote-team-collaboration +[3]: https://hbr.org/2018/02/how-to-collaborate-effectively-if-your-team-is-remote +[4]: https://www.skillsoft.com/content-solutions/business-skills-training/emotional-intelligence-training/ +[5]: https://opensource.com/alternatives/slack +[6]: https://opensource.com/business/16/2/top-issue-support-and-bug-tracking-tools +[7]: https://blog.trello.com/how-to-stop-micromanaging-your-remote-team +[8]: https://opensource.com/article/18/10/think-global-communication-challenges +[9]: https://www.appdevelopmentcost.com/#the-definitive-guide-to-understanding-app-development-costs From 0dd01ded175d6f05ede6d9b7b2124d5ea077aa51 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 6 Jan 2020 08:53:02 +0800 Subject: [PATCH 227/430] translated --- ...al- A Secure, Open Source Messaging App.md | 122 ------------------ ...al- A Secure, Open Source Messaging App.md | 122 ++++++++++++++++++ 2 files changed, 122 insertions(+), 122 deletions(-) delete mode 100644 sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md create mode 100644 translated/tech/20200101 Signal- A Secure, Open Source Messaging App.md diff --git a/sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md b/sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md deleted file mode 100644 index fbb741b9f5..0000000000 --- a/sources/tech/20200101 Signal- A Secure, Open Source Messaging App.md +++ /dev/null @@ -1,122 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Signal: A Secure, Open Source Messaging App) -[#]: via: (https://itsfoss.com/signal-messaging-app/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Signal: A Secure, Open Source Messaging App -====== - -**_Brief: Signal is a secure open-source messaging app for smartphones. It also offers a standalone desktop app for Linux, Windows, and macOS_. _Here, we take a look at its features and usability._** - -### Signal is an Excellent Alternative to WhatsApp (and Telegram) for Privacy Concerned People - -![Signal App On Linux][1] - -Signal is an open source application with a keen focus on privacy. It is recommended by privacy advocates like [Edward Snowden][2]. - -It may not have as many features as Telegram or WhatsApp – but if you want to enhance your privacy while having a conversation, this is a solid open-source solution. - -You can install it on your smartphone ([iOS][3]/[Android][4]) and it is also available for Linux, Windows, and macOS. - -### Features of Signal Messenger - -**Note:** _Some of the features are specific/exclusive to smartphones. You may not observe all the features mentioned in the desktop app._ - -As I already mentioned, this is tailored to enhance your privacy. So, the user experience may not be the “best” you’ve ever seen. But, privacy/security-wise, I think it is a good option to have. - -![Signal Features][5] - -#### Disappearing Messages - -You can set a timer for messages in a conversation – so that it will be automatically deleted as per the timer. - -Essentially, anyone in the conversation can activate this feature. So, you control if the messages should stay in a conversation or disappear. - -#### Use it As Default SMS App - -If you want to utilize an open-source app for all your SMSs, you can simply go to Signal’s app settings and set it as the default for SMS and MMS. - -#### Screen Security - -There’s a neat feature to block screenshots in-app, “Screen Security”. - -If you enable it, you won’t be able to take a screenshot of any conversation in the app. You can find the option to enable or disable it from the app settings. - -It may not be useful to everyone – but you can try it out. - -#### Safety Number - -If you want to verify the security of your encryption with a friend, you can simply tap on the profile and scroll down to find “View Safety Number”. - -You can either scan it to verify or simply take a look at it to mark it verified. - -#### Locked Messages - -If you protect the app with a lock (pin/fingerprint), even if your device has been unlocked, you won’t be able to see the messages on your notifications. - -So, when you get a notification while Signal is locked, you will notice the content of the notification as “**Locked Message**” – which is a plus for privacy-oriented users. - -#### Other Features - -![][6] - -As you would expect in a messaging app – you get a couple of stickers to utilize and you can also create a group if you want. - -However, you won’t have the ability to moderate your group – you can just add members and change the profile picture. - -In addition to this, Signal also supports biometric security for its app. - -### Installing Signal on Ubuntu/Linux - -Unfortunately, you don’t get a .**deb** or .**AppImage** to install it on your Linux distro. So, you will need to utilize the terminal as per the [official installation instructions][7]. - -Here’s what you have to type in the terminal: - -``` -curl -s https://updates.signal.org/desktop/apt/keys.asc | sudo apt-key add - -echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/signal-xenial.list -sudo apt update && sudo apt install signal-desktop -``` - -Simply copy-paste the commands one by one in the terminal and you should be good to go. - -[Download Signal for Other Devices][7] - -### My Thoughts On Signal - -I’ve been using Signal for a few years now and it has improved with what it offers. However, I still feel that the user experience can be improved. - -Privacy-wise, it is definitely a good alternative to what we already have (in my opinion). You can give it a try and see how well it works for your usage. - -You can also take a look at their [GitHub page][8] for the latest developments and beta releases if you want to try them out. - -Signal app may not be a popular messaging app when compared to WhatsApp or even [Telegram on Linux][9]. But, you can try it for yourself and encourage your friends to use an open-source messaging app. - -Have you tried it yet? Let me know what you think about the ‘Signal’ app in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/signal-messaging-app/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-shot.jpg?ssl=1 -[2]: https://en.wikipedia.org/wiki/Edward_Snowden -[3]: https://apps.apple.com/us/app/signal-private-messenger/id874139669 -[4]: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms&hl=en_IN -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-phone.jpg?ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-shot-1.jpg?ssl=1 -[7]: https://signal.org/download/ -[8]: https://github.com/signalapp -[9]: https://itsfoss.com/install-telegram-desktop-linux/ diff --git a/translated/tech/20200101 Signal- A Secure, Open Source Messaging App.md b/translated/tech/20200101 Signal- A Secure, Open Source Messaging App.md new file mode 100644 index 0000000000..812a97f32f --- /dev/null +++ b/translated/tech/20200101 Signal- A Secure, Open Source Messaging App.md @@ -0,0 +1,122 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Signal: A Secure, Open Source Messaging App) +[#]: via: (https://itsfoss.com/signal-messaging-app/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Signal:安全、开源的聊天应用 +====== + +** _简介:Signal 是一款智能手机上的安全开源聊天应用。它还提供了适用于 Linux、Windows 和 macOS 的独立桌面应用。在本文中,我们来看看它的功能和可用性。_** + +### 对于关注隐私的人来说,Signal 是 WhatsApp(和 Telegram)的绝佳替代品 + +![Signal App On Linux][1] + +Signal 是一款关注隐私的开源应用。像[爱德华·斯诺登][2]这样的隐私权倡导者建议使用它。 + +它可能没有 Telegram 或 WhatsApp 这么多的功能。但是,如果你想在交流时增强隐私,这是一个可靠的开源方案。 + +你可以在智能手机(iOS][3]/[Android][4])上安装,也可以在 Linux、Windows 和 macOS 上安装。 + +### Signal 的功能 + +**注意:** _某些功能是智能手机特有的。你可能无法在桌面应用上看到所有功能。_ + +正如我已经提到的,这是为增强你的隐私而量身定制的。因此,用户体验可能不是你见过“最佳”的。但是,从隐私/安全角度考虑,我认为这是一个不错的选择。 + +![Signal Features][5] + +#### 消失的消息 + +你可以为对话中的消息设置一个计时器,以便根据它自动删除消息。 + +本质上,对话中的任何人都可以激活此功能。因此,你可以控制对话中的消息时保留还是消失。 + +#### 用作默认短信应用 + +如果你想在短信中使用开源应用,那么只需口进入 Signal 的设置,并将其设置为短信和彩信的默认设置。 + +#### 屏幕安全 + +有一个巧妙的功能可以阻止应用内截图,它就是“屏幕安全”。 + +如果你开启它,那么你将无法为应用中的任何对话截图。你可以从应用设置中找到启用或禁用它的选项。 + +它可能并不是对所有人有用,但你可以尝试一下。 + +#### 安全数字 + +如果你想与朋友一起验证加密的安全性,只需点击个人资料并向下滚动找到“查看安全数字”。 + +你可以扫描验证或者看一眼并标记为已验证。 + +#### 锁定消息 + +如果你使用了锁(密码/指纹)来保护应用,那么即使你的设备已解锁,你也无法在通知中看到消息。 + +因此,当 Signal 处于锁定状态收到通知时,你会注意到通知的内容为 “**Locked Message**”,这对于注重隐私的用户来说是一个加分项。 + +#### 其它功能 + +![][6] + +如你所期待的聊天应用,你可以使用几个标签,并且可以根据需要创建一个组。 + +但是,你无法管理你的组,你只能添加成员和更改群头像。 + +此外,Signal 还为其应用支持生物识别。 + +### 在 Ubuntu/Linux 上安装 Signal + +不幸的是,你无法在你的 Linux 发行版上找到 .**deb** 或者 .**AppImage**。因此,你需要根据[官方安装说明][7]在终端上安装。 + +在终端中输入以下内容: + +``` +curl -s https://updates.signal.org/desktop/apt/keys.asc | sudo apt-key add - +echo "deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main" | sudo tee -a /etc/apt/sources.list.d/signal-xenial.list +sudo apt update && sudo apt install signal-desktop +``` + +只需在终端中一个接一个地复制并粘贴命令。 + +[Download Signal for Other Devices][7] + +### 我对 Signal 的想法 + +我已经使用 Signal 有几年了,它的功能已经得到了改善。但是,我仍然认为可以改善用户体验。 + +在隐私方面,(在我看来)这绝对是我们已有软件的一个很好的替代方案。你可以尝试一下,看看它的使用效果如何。 + +如果你想尝试一下它,也可以看看它的 [GitHub 页面][8]以获取最新的开发和 beta 版本。 + +与 WhatsApp 甚至 [Linux 上的 Telegram][9] 相比,Signal 可能不是流行的聊天应用。但是,你可以自己尝试一下,并鼓励你的朋友使用它。 + +你尝试过了吗?在下面的评论中,让我知道你对 “Signal” 的看法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/signal-messaging-app/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-shot.jpg?ssl=1 +[2]: https://en.wikipedia.org/wiki/Edward_Snowden +[3]: https://apps.apple.com/us/app/signal-private-messenger/id874139669 +[4]: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms&hl=en_IN +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-phone.jpg?ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/signal-shot-1.jpg?ssl=1 +[7]: https://signal.org/download/ +[8]: https://github.com/signalapp +[9]: https://itsfoss.com/install-telegram-desktop-linux/ From b5ff457b11f128e839a5ed7e717e0a96f53e1165 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 6 Jan 2020 08:59:47 +0800 Subject: [PATCH 228/430] translating --- .../20191214 Make VLC More Awesome With These Simple Tips.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191214 Make VLC More Awesome With These Simple Tips.md b/sources/tech/20191214 Make VLC More Awesome With These Simple Tips.md index de91a1105b..a4dd3b7bd5 100644 --- a/sources/tech/20191214 Make VLC More Awesome With These Simple Tips.md +++ b/sources/tech/20191214 Make VLC More Awesome With These Simple Tips.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From df0fe6f778abded40c96df3c823fd629a6882678 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 6 Jan 2020 11:21:54 +0800 Subject: [PATCH 229/430] Rename sources/tech/20200105 7 Ways NOT to manage your remote team.md to sources/talk/20200105 7 Ways NOT to manage your remote team.md --- .../20200105 7 Ways NOT to manage your remote team.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200105 7 Ways NOT to manage your remote team.md (100%) diff --git a/sources/tech/20200105 7 Ways NOT to manage your remote team.md b/sources/talk/20200105 7 Ways NOT to manage your remote team.md similarity index 100% rename from sources/tech/20200105 7 Ways NOT to manage your remote team.md rename to sources/talk/20200105 7 Ways NOT to manage your remote team.md From b72910f7ce18adc4cee91a7ac5d07adfb1bbbb72 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 6 Jan 2020 22:58:24 +0800 Subject: [PATCH 230/430] PRF @lxbwolf --- ...1017 Intro to the Linux useradd command.md | 71 ++++++++++--------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/translated/tech/20191017 Intro to the Linux useradd command.md b/translated/tech/20191017 Intro to the Linux useradd command.md index ffebd61d47..d38143f55e 100644 --- a/translated/tech/20191017 Intro to the Linux useradd command.md +++ b/translated/tech/20191017 Intro to the Linux useradd command.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Intro to the Linux useradd command) @@ -9,8 +9,10 @@ Linux useradd 命令介绍 ====== -使用 useradd 命令来添加用户(并且根据需要修改账号)。 -![people in different locations who are part of the same team][1] + +> 使用 useradd 命令来添加用户(并且根据需要修改账号)。 + +![](https://img.linux.net.cn/data/attachment/album/202001/06/225733hv1u7f4z4vbt8u5x.jpg) 任何计算机系统中,添加用户都是最重要的事之一;本文着重介绍如何在 Linux 系统中添加用户。 @@ -29,21 +31,21 @@ $ file `which adduser` ### 默认处理 -`useradd` 的基本用法相当简单:通过一个用户名就可以添加一个用户 +`useradd` 的基本用法相当简单:提供一个用户名就可以添加一个用户。 ```bash $ sudo useradd sonny ``` -在本例中,`useradd` 命令创建了一个名为 *sonny* 的账号。此命令同时创建了一个同名的组,*sonny* 被放进了这个组,这个组也是 *sonny* 账号的主组。命令执行时,根据配置文件 `/etc/default/useradd` 和 `/etc/login.defs` 中的不同设置,也会有其他的参数处理,如语言和 shell。对于一个私人系统或微小的单服务商业环境,这些参数已经足够了。 +在本例中,`useradd` 命令创建了一个名为 `sonny` 的账号。此命令同时创建了一个同名的组,`sonny` 被放进了这个组,这个组也是 `sonny` 账号的主组。命令执行时,根据配置文件 `/etc/default/useradd` 和 `/etc/login.defs` 中的不同设置,也会有其他的参数,如语言和 shell。对于一个私人系统或微小的单服务商业环境,这些参数已经足够了。 上面两个文件控制 `useradd` 的处理,用户的信息保存在 `/etc` 目录下的一些其他文件中,关于这些信息的讲解会贯穿全文。 | 文件 | 描述 | 域 (加粗的表示由 useradd 命令设置) | | ------ | ------------------------------------ | ------------------------------------------------------------ | -| passwd | Stores user account details | **username**:unused:**uid**:**gid**:**comment**:**homedir**:**shell** | -| shadow | Stores user account security details | **username**:password:lastchange:minimum:maximum:warn:**inactive**:**expire**:unused | -| group | Stores group details | **groupname**:unused:**gid**:**members** | +| `passwd` | 存储用户账号信息 | 用户名:未使用:UID:GID:备注:家目录:shell | +| `shadow` | 存储用户账号的安全信息 | 用户名:加密密码:上次修改时间:最短使用天数:最长使用天数间:修改前警示天数:过期后宽限时间:未使用 | +| `group` | 存储组信息 | 组名:未使用:GID:成员列表 | ### 自定义处理 @@ -51,35 +53,35 @@ $ sudo useradd sonny #### 用户和组 ID -`useradd` 默认主组 ID(GID)与用户 ID(UID)相同,但也不完全是。虽然 UID 与 GID 相同不是必须的,但如果相同,会更方便管理员管理。 +默认情况下,`useradd` 试图使用相同的用户 ID(UID)和主组 ID(GID),但也不完全是。虽然 UID 与 GID 相同不是必须的,但如果相同,会更方便管理员管理。 -下面的场景就是一个 GID 与 UID 不同的 例子。现在我添加另一账号,名为 Timmy。通过使用 `getent` 命令来比较 *sonny* 和 *timmy* 两个账号,显示两个用户和对应的主组。 +下面的场景就是一个 GID 与 UID 不同的例子。现在我添加另一账号,名为 Timmy。通过使用 `getent` 命令来比较 `sonny` 和 `timmy` 两个账号,显示两个用户和对应的主组。 ```bash $ getent passwd sonny timmy -sonny❌1001:1002:Sonny:/home/sonny:/bin/bash -timmy❌1002:1003::/home/timmy:/bin/bash +sonny:x:1001:1002:Sonny:/home/sonny:/bin/bash +timmy:x:1002:1003::/home/timmy:/bin/bash $ getent group sonny timmy -sonny❌1002: -timmy❌1003: +sonny:x:1002: +timmy:x:1003: ``` -不幸的是,两者的 UID 和 GID 都不相同。因为默认的处理是,创建用户时,把下一个可用的 UID 赋给用户,然后把同一个数字作为主组 ID 赋给它。然而,当要使用的 ID 已经被使用时,就再把下一个可用的 GID 赋给它。为了弄清细节,我猜想 1001 这个 GID 已经被使用了,用一个命令确认了一下。 +不幸的是,两者的 UID 和 GID 都不相同。因为默认的处理是,创建用户时,把下一个可用的 UID 赋给用户,然后把同一个数字作为主组 ID 赋给它。然而,当要使用的组 ID 已经被使用时,就再把下一个可用的 GID 赋给它。为了弄清细节,我猜想 1001 这个 GID 已经被使用了,用一个命令确认了一下。 ```bash $ getent group 1001 -book❌1001:alan +book:x:1001:alan ``` -*book* 的 ID 是 *1001*,因此新创建的用户的 GID 都有偏移量 1。这就是为什么系统管理员在用户创建过程中需要多设置一些值的一个实例。为了解决这个问题,我必须先确定下一个可用的 UID 和 GID 是否相同。确定下一个可用值时,可以使用 `getent group` 和 `getent passwd` 命令,通过 `-u` 参数传递要确认的值。 +`book` 的 ID 是 `1001`,因此新创建的用户的 GID 都有偏移量 1。这就是为什么系统管理员在用户创建过程中需要多设置一些值的一个实例。为了解决这个问题,我必须先确定下一个可用的 UID 和 GID 是否相同。确定下一个可用值时,可以使用 `getent group` 和 `getent passwd` 命令,通过 `-u` 参数传递要确认的值。 ```bash $ sudo useradd -u 1004 bobby $ getent passwd bobby; getent group bobby -bobby❌1004:1004::/home/bobby:/bin/bash -bobby❌1004: +bobby:x:1004:1004::/home/bobby:/bin/bash +bobby:x:1004: ``` 另一个需要指定 ID 的场景是,通过 NFS 访问远程系统上的文件时。对于一个给定的用户,当 NFS 所有客户端和服务系统的 ID 都一样时,管理员更容易控制。在我的文章 [使用 autofs 挂载 NFS][2] 中有详细介绍。 @@ -95,12 +97,12 @@ bobby❌1004: ```bash $ sudo useradd -c "Bailey is cool" bailey $ getent passwd bailey -bailey❌1011:1011:Bailey is cool:/home/bailey:/bin/bash +bailey:x:1011:1011:Bailey is cool:/home/bailey:/bin/bash ``` #### 组 -一个用户可以被指定一个主组和多个次组。 `-g` 参数指定主组名称或 GID。如果不指定,`useradd` 会以用户名创建一个主组(前面演示过)。`-G`(大写)参数用一个逗号分隔的组列表来指定此用户所属的组,这些组就是次组。 +一个用户可以被指定一个主组和多个次组。`-g` 参数指定主组名称或 GID。如果不指定,`useradd` 会以用户名创建一个主组(前面演示过)。`-G`(大写)参数用一个逗号分隔的组列表来指定此用户所属的组,这些组就是次组。 ```bash $ sudo useradd -G tgroup,fgroup,libvirt milly @@ -110,12 +112,12 @@ uid=1012(milly) gid=1012(milly) groups=1012(milly),981(libvirt),4000(fgroup),300 #### 家目录 -`useradd` 的默认处理是,在 `/home` 目录下创建用户的家目录。然而,下面的参数可以改写家目录的 base 目录。`-b` 设置另一个可以创建家目录的 base 目录。例如 指定 `/home2` 而不是 `/home`。 +`useradd` 的默认处理是,在 `/home` 目录下创建用户的家目录。然而,下面的参数可以改写家目录的基础目录。`-b` 设置另一个可以创建家目录的基础目录。例如指定 `/home2` 而不是 `/home`。 ```bash $ sudo useradd -b /home2 vicky $ getent passwd vicky -vicky❌1013:1013::/home2/vicky:/bin/bash +vicky:x:1013:1013::/home2/vicky:/bin/bash ``` `-d` 参数可以指定一个与用户名不同的家目录。 @@ -123,24 +125,23 @@ vicky❌1013:1013::/home2/vicky:/bin/bash ```bash $ sudo useradd -d /home/ben jerry $ getent passwd jerry -jerry❌1014:1014::/home/ben:/bin/bash +jerry:x:1014:1014::/home/ben:/bin/bash ``` -#### skeleton 目录 +#### 目录模板 -`-k` 参数指定创建新用户时,会复制 `/etc/skel` 目录下的所有文件到家目录中。这些文件通常是 shell 配置文件,当然也可以是系统管理员想在新建用户时使用的任何文件。 +指定 `-k` 参数会在创建新用户时,复制 `/etc/skel` 目录下的所有文件到用户的家目录中。这些文件通常是 shell 配置文件,当然也可以是系统管理员想在新建用户时使用的任何文件。 #### Shell -`-s` 参数可以指定 shell。如果不指定,则使用默认的 shell。例如,下面的例子中 ,配置文件中定义的 shell 是 `bash`,但 `Wally` 这个用户指定的是 `zsh`。 +`-s` 参数可以指定 shell。如果不指定,则使用默认的 shell。例如,下面的例子中 ,配置文件中定义的 shell 是 `bash`,但 `wally` 这个用户指定的是 `zsh`。 ```bash -$ grep SHELL /etc/default/useradd SHELL=/bin/bash $ sudo useradd -s /usr/bin/zsh wally $ getent passwd wally -wally❌1004:1004::/home/wally:/usr/bin/zsh +wally:x:1004:1004::/home/wally:/usr/bin/zsh ``` #### 安全 @@ -153,7 +154,7 @@ $ sudo getent shadow sammy sammy:!!:18171:0:99999:7::20191231: ``` -当密码过期时,一个账号也可以自动失效。`-f` 参数指定密码过期后经过几天账号失效。如果设为 0,则立即失效。 +当密码过期时,账号也会自动失效。`-f` 参数指定密码过期后经过几天账号失效。如果设为 0,则立即失效。 ```bash $ sudo useradd -f 30 willy @@ -163,7 +164,7 @@ willy:!!:18171:0:99999:7:30:: ### 实例 -生产中,创建一个用户账号时会用到多个参数。例如,我要创建一个 Perry 账号,可能会用下面的命令: +生产环境中,创建一个用户账号时会用到多个参数。例如,我要创建一个 Perry 账号,可能会用下面的命令: ```bash $ sudo useradd -u 1020 -c "Perry Example" \ @@ -176,8 +177,8 @@ $ sudo useradd -u 1020 -c "Perry Example" \ ```bash $ getent passwd perry; getent group perry; getent shadow perry; id perry -perry❌1020:1020:Perry Example:/home2/perry:/usr/bin/zsh -perry❌1020: +perry:x:1020:1020:Perry Example:/home2/perry:/usr/bin/zsh +perry:x:1020: perry:!!:18171:0:99999:7:5:20201201: uid=1020(perry) gid=1020(perry) groups=1020(perry),3000(tgroup) ``` @@ -192,8 +193,8 @@ via: https://opensource.com/article/19/10/linux-useradd-command 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ebdef401aca71102214cb466dc0899ea7e12793d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 6 Jan 2020 22:59:10 +0800 Subject: [PATCH 231/430] PUB @lxbwolf https://linux.cn/article-11756-1.html --- .../20191017 Intro to the Linux useradd command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191017 Intro to the Linux useradd command.md (99%) diff --git a/translated/tech/20191017 Intro to the Linux useradd command.md b/published/20191017 Intro to the Linux useradd command.md similarity index 99% rename from translated/tech/20191017 Intro to the Linux useradd command.md rename to published/20191017 Intro to the Linux useradd command.md index d38143f55e..ae1c1c2d4a 100644 --- a/translated/tech/20191017 Intro to the Linux useradd command.md +++ b/published/20191017 Intro to the Linux useradd command.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11756-1.html) [#]: subject: (Intro to the Linux useradd command) [#]: via: (https://opensource.com/article/19/10/linux-useradd-command) [#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) From a9580330d10e03ce5b62f895b69fbfb54b7aded0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 6 Jan 2020 23:21:01 +0800 Subject: [PATCH 232/430] PRF --- published/20191017 Intro to the Linux useradd command.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/published/20191017 Intro to the Linux useradd command.md b/published/20191017 Intro to the Linux useradd command.md index ae1c1c2d4a..d088a1d16d 100644 --- a/published/20191017 Intro to the Linux useradd command.md +++ b/published/20191017 Intro to the Linux useradd command.md @@ -43,9 +43,9 @@ $ sudo useradd sonny | 文件 | 描述 | 域 (加粗的表示由 useradd 命令设置) | | ------ | ------------------------------------ | ------------------------------------------------------------ | -| `passwd` | 存储用户账号信息 | 用户名:未使用:UID:GID:备注:家目录:shell | -| `shadow` | 存储用户账号的安全信息 | 用户名:加密密码:上次修改时间:最短使用天数:最长使用天数间:修改前警示天数:过期后宽限时间:未使用 | -| `group` | 存储组信息 | 组名:未使用:GID:成员列表 | +| `passwd` | 存储用户账号信息 | **用户名**:未使用:**UID**:**GID**:**备注**:**家目录**:**shell** | +| `shadow` | 存储用户账号的安全信息 | **用户名**:加密密码:上次修改时间:最短使用天数:最长使用天数间:**修改前警示天数**:**过期后宽限时间**:未使用 | +| `group` | 存储组信息 | **组名**:未使用:**GID**:**成员列表** | ### 自定义处理 From 884c9c8839641c166611347485f8c417b83ab7ed Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 6 Jan 2020 23:45:06 +0800 Subject: [PATCH 233/430] APL --- sources/tech/20191130 7 maker gifts for kids and teens.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191130 7 maker gifts for kids and teens.md b/sources/tech/20191130 7 maker gifts for kids and teens.md index a821b221e3..72a9debb38 100644 --- a/sources/tech/20191130 7 maker gifts for kids and teens.md +++ b/sources/tech/20191130 7 maker gifts for kids and teens.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From eef47403bf13f34fba003404cbf9694462c9fb4f Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Tue, 7 Jan 2020 00:46:38 +0800 Subject: [PATCH 234/430] tmp --- ... Lessons learned from programming in Go.md | 191 +++++++++--------- 1 file changed, 96 insertions(+), 95 deletions(-) diff --git a/sources/tech/20191210 Lessons learned from programming in Go.md b/sources/tech/20191210 Lessons learned from programming in Go.md index 0c9aeea2e2..93e9af3398 100644 --- a/sources/tech/20191210 Lessons learned from programming in Go.md +++ b/sources/tech/20191210 Lessons learned from programming in Go.md @@ -1,71 +1,70 @@ -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Lessons learned from programming in Go) -[#]: via: (https://opensource.com/article/19/12/go-common-pitfalls) -[#]: author: (Eduardo Ferreira https://opensource.com/users/edufgf) +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Lessons learned from programming in Go" +[#]: via: "https://opensource.com/article/19/12/go-common-pitfalls" +[#]: author: "Eduardo Ferreira https://opensource.com/users/edufgf" -Lessons learned from programming in Go +用 Go 编程受到的启发 ====== -Prevent future concurrent processing headaches by learning how to -address these common pitfalls. +通过学习如何定位并发处理的陷阱来避免未来处理这些问题时的困境。 ![Goland gopher illustration][1] -When you are working with complex distributed systems, you will likely come across the need for concurrent processing. At [Mode.net][2], we deal daily with real-time, fast and resilient software. Building a global private network that dynamically routes packets at the millisecond scale wouldn’t be possible without a highly concurrent system. This dynamic routing is based on the state of the network and, while there are many parameters to consider here, our focus is on link [metrics][3]. In our context, link metrics can be anything related to the status or current properties of a network link (e.g.: link latency). +在复杂的分布式系统进行任务处理时,你通常会需要进行并发的操作。[Mode.net][2] 公司系统每天要处理实时、快速和灵活的以毫秒为单位动态路由数据包的全球专用网络和数据,需要高度并发的系统。他们的动态路由是基于网络状态的,而这个过程需要考虑众多因素,我们只考虑关系链的监控。在我们的环境中,调用关系链监控可以是任何跟网络调用关系链有关的状态和当前属性(如连接延迟)。 -### Concurrent probing for link metrics +### 并发探测链接指标 -[H.A.L.O.][4] (Hop-by-Hop Adaptive Link-State Optimal Routing), our dynamic routing algorithm relies partially on link metrics to compute its routing table. Those metrics are collected by an independent component that sits on each [PoP][5] (Point of Presence). PoPs are machines that represent a single routing entity in our networks, connected by links and spread around multiple locations shaping our network. This component probes neighboring machines using network packets, and those neighbors will bounce back the initial probe. Link latency values can be derived from the received probes. Because each PoP has more than one neighbor, the nature of such a task is intrinsically concurrent: we need to measure latency for each neighboring link in real-time. We can’t afford sequential processing; each probe must be processed as soon as possible in order to compute this metric. +[H.A.L.O.][4] (Hop-by-Hop Adaptive Link-State Optimal Routing,译注:逐跳自适应链路状态最佳路由), 我们的动态路由算法部分依赖于链路度量来计算路由表。 这些指标由位于每个PoP(译注:存活节点)上的独立组件收集。PoP是表示我们的网络中单个路由实体的机器,通过链路连接并分布在我们的网络拓扑中的各个位置。某个组件使用网络数据包探测周围的机器,周围的机器回复数据包给前者。从接收到的探测包中可以获得链路延迟。由于每个 PoP 都有多个临近节点,所以这种探测任务实质上是并发的:我们需要实时测量每个临近连接点的延迟。我们不能串行地处理;为了计算这个指标,必须尽快处理每个探针。 ![latency computation graph][6] -### Sequence numbers and resets: A reordering situation +### 序列号和重置:一个记录场景 -Our probing component exchanges packets and relies on sequence numbers for packet processing. This aims to avoid processing of packet duplication or out-of-order packets. Our first implementation relied on a special sequence number 0 to reset sequence numbers. Such a number was only used during initialization of a component. The main problem was that we were considering an increasing sequence number value that always started at 0. After the component restarts, packet reordering could happen, and a packet could easily replace the sequence number with the value that was being used before the reset. This meant that the following packets would be ignored until it reaches the sequence number that was in use just before the reset. +我们的探测组件互相发送和接收数据包并依靠序列号进行数据包处理。旨在避免处理重复的包或顺序被打乱的包。我们的第一个实现依靠特殊的序列号0来重置序列号。这个数字仅在组件初始化时使用。主要的问题是我们只考虑了始终从 0 开始递增的序列号。组件重启后,包的顺序可能会重新排列,某个包的序列号可能会轻易地被替换成重置之前使用过的值。这意味着,直到排到重置之前用到的值之前,它后面的包都会被忽略掉。 -### UDP handshake and finite state machine +### UDP 握手和有限状态机 -The problem here was proper agreement of a sequence number after a component restarts. There are a few ways to handle this and, after discussing our options, we chose to implement a 3-way handshake protocol with a clear definition of states. This handshake establishes sessions over links during initialization. This guarantees that nodes are communicating over the same session and using the appropriate sequence number for it. +这里的问题是重启前后的序列号是否一致。有几种方法可以解决这个问题,经过讨论,我们选择了实现一个带有清晰状态定义的三向交握协议。这个握手过程在初始化时通过链接建立 session。这样可以确保节点通过同一个 session 进行通信且使用了适当的序列号。 -To properly implement this, we have to define a finite state machine with clear states and transitions. This allows us to properly manage all corner cases for the handshake formation. +为了正确实现这个过程,我们必须顶一个一个有清晰状态和过渡的有限状态机。这样我们就可以正确管理握手过程中的所有极端情况。 ![finite state machine diagram][7] -Session IDs are generated by the handshake initiator. A full exchange sequence is as follows: +session ID 由握手的初始化程序生成。一个完整的交换顺序如下: - 1. The sender sends out a **SYN (ID)*** *packet. - 2. The receiver stores the received **ID** and sends a **SYN-ACK (ID)**. - 3. The sender receives the **SYN-ACK (ID) *_and sends out an **ACK (ID)**._ *It also starts sending packets starting with sequence number 0. - 4. The receiver checks the last received **ID*** _and accepts the **ACK (ID)**_ *if the ID matches. It also starts accepting packets with sequence number 0. + 1. sender 发送一个 **SYN (ID)** 数据包。 + 2. receiver 存储接收到的 **ID** 并发送一个 **SYN-ACK (ID)**. + 3. sender 接收到 **SYN-ACK (ID)** _并发送一个 **ACK (ID)**_。它还发送一个从序列号 0 开始的数据包。 + 4. receiver 检查最后接收到的 **ID**,如果 ID 匹配,_则接受 **ACK (ID)**_。它还开始接受序列号为 0 的数据包。 -### Handling state timeouts +### 处理状态超时 -Basically, at each state, you need to handle, at most, three types of events: link events, packet events, and timeout events. And those events show up concurrently, so here you have to handle concurrency properly. +Basically, at each state, you need to handle, at most, three types of events: link events, packet events, and timeout events. And those events show up concurrently, so here you have to handle concurrency properly.基本上,每种状态下你都需要处理最多三种类型的事件:链接事件、数据包事件和超时事件。这些事件会并发地出现,因此你必须正确处理并发。 - * Link events are either link up or link down updates. This can either initiate a link session or break an existing session. - * Packet events are control packets **(SYN/SYN-ACK/ACK)** or just probe responses. - * Timeout events are the ones triggered after a scheduled timeout expires for the current session state. + * 链接事件包括连接和断开,连接时会初始化一个链接 session,断开时会断开一个已建立的 seesion。 + * 数据包事件是控制数据包 **(SYN/SYN-ACK/ACK)** 或只是探测响应。 + * 超时事件在当前 session 状态的预定超时时间到期后触发。 -The main challenge here is how to handle concurrent timeout expiration and other events. And this is where one can easily fall into the traps of deadlocks and race conditions. +这里面临的最主要的问题是如何处理并发超时到期和其他事件。这里很容易陷入死锁和资源竞争的陷阱。 -### A first approach +### 第一种方法 -The language used for this project is [Golang][8]. It does provide native synchronization mechanisms such as native channels and locks and is able to spin lightweight threads for concurrent processing. +本项目使用的语言是 [Golang][8]. 它确实提供了原生的同步机制,如自带的 channel 和锁,并且能够使用轻量级线程来进行并发处理。 ![gophers hacking together][9] gophers hacking together -You can start first by designing a structure that represents our **Session** and **Timeout Handlers**. +首先,你可以设计两个分别表示我们的 **Session** 和 **Timeout Handlers** 的结构体。 -``` +```go type Session struct {     State SessionState     Id SessionId   @@ -80,21 +79,21 @@ type TimeoutHandler struct {   } ``` -**Session** identifies the connection session, with the session ID, neighboring link IP, and the current session state. +**Session** 标识连接 session,内有表示 session ID、临近的连接点的 IP 和当前 session 状态的字段。 -**TimeoutHandler** holds the callback function, the session for which it should run, the duration, and a pointer to the scheduled timer. +**TimeoutHandler** 包含回调函数、对应的 session、持续时间和指向调度计时器的 timer 指针。 -There is a global map that will store, per neighboring link session, the scheduled timeout handler. +每一个临近连接点的 session 都包含一个保存调度 `TimeoutHandler` 的全局 map。 ``` `SessionTimeout map[Session]*TimeoutHandler` ``` -Registering and canceling a timeout is achieved by the following methods: +下面方法注册和取消超时: -``` +```go // schedules the timeout callback function.   func (timeout* TimeoutHandler) Register() {     timeout.timer = time.AfterFunc(time.Duration(timeout.duration) * time.Second, func() {   @@ -110,10 +109,10 @@ func (timeout* TimeoutHandler) Cancel() {   } ``` -For the timeouts creation and storage, you can use a method like the following: +你可以使用类似下面的方法来创建和存储超时: -``` +```go func CreateTimeoutHandler(callback func(Session), session Session, duration int) *TimeoutHandler {     if sessionTimeout[session] == nil {       sessionTimeout[session] := new(TimeoutHandler)   @@ -127,12 +126,12 @@ func CreateTimeoutHandler(callback func(Session), session Session, duration int) } ``` -Once the timeout handler is created and registered, it runs the callback after _duration_ seconds have elapsed. However, some events will require you to reschedule a timeout handler (as it happens at **SYN** state — every 3 seconds). +超时 handler 创建后,会在经过了设置的 _duration_ 时间(秒)后执行回调函数。然而,有些事件会使你重新调度一个超时 handler(与 **SYN** 状态时的处理一样 — 每 3 秒一次)。 -For that, you can have the callback rescheduling a new timeout: +为此,你可以让回调函数重新调度一次超时: -``` +```go func synCallback(session Session) {     sendSynPacket(session) @@ -144,34 +143,34 @@ func synCallback(session Session) {   } ``` -This callback reschedules itself in a new timeout handler and updates the global **sessionTimeout** map. +这次回调在新的超时 handler 中重新调度自己,并更新全局 map **sessionTimeout**。 -### **Data race and references** +### 数据竞争和引用 -Your solution is ready. One simple test is to check that a timeout callback is executed after the timer has expired. To do this, register a timeout, sleep for its duration, and then check whether the callback actions were done. After the test is executed, it is a good idea to cancel the scheduled timeout (as it reschedules), so it won’t have side effects between tests. +你的解决方案已经有了。可以通过检查计时器到期后超时回调是否执行来进行一个简单的测试。为此,注册一个超时,在 *duration* 时间内 sleep,然后检查是否执行的回调的处理。执行这个测试后,最好取消预定的超时时间(因为它会重新调度),这样才不会在下次测试时产生副作用。 -Surprisingly, this simple test found a bug in the solution. Canceling timeouts using the cancel method was just not doing its job. The following order of events would cause a data race condition: +令人惊讶的是,这个简单的测试发现了这个解决方案中的一个 bug。使用 cancel 方法来取消超时并没有正确处理。以下顺序的事件会导致数据资源竞争: - 1. You have one scheduled timeout handler. - 2. Thread 1: -a) You receive a control packet, and you now want to cancel the registered timeout and move on to the next session state. (e.g. received a **SYN-ACK** **after you sent a **SYN**). -b) You call **timeout.Cancel()**, which calls a **timer.Stop()**. (Note that a Golang timer stop doesn’t prevent an already expired timer from running.) - 3. Thread 2: -a) Right before that cancel call, the timer has expired, and the callback was about to execute. -b) The callback is executed, it schedules a new timeout and updates the global map. - 4. Thread 1: -a) Transitions to a new session state and registers a new timeout, updating the global map. + 1. 你有一个已调度的超时 handler。 + 2. 线程 1: +a) 你接收到一个控制数据包,现在你要取消已注册的超时并切换到下一个 session 状态(如 发送 **SYN** 后接收到一个 **SYN-ACK**) +b) 你调用了 **timeout.Cancel()**,这个函数调用了 **timer.Stop()**。(请注意,Golang 计时器的 stop 不会终止一个已过期的计时器。) + 3. 线程 2: +a) 在调用 cancel 之前,计时器已过期,回调即将执行。 +b) 执行回调,它调度一次新的超时并更新全局 map。 + 4. 线程 1: +a) 切换到新的 session 状态并注册新的超时,更新全局 map。 -Both threads were updating the timeout map concurrently. The end result is that you failed to cancel the registered timeout, and then you also lost the reference to the rescheduled timeout done by thread 2. This results in a handler that keeps executing and rescheduling for a while, doing unwanted behavior. +两个线程同时更新超时 map。最终结果是你无法取消注册的超时,然后你也会丢失对线程 2 重新调度的超时的引用。这导致 handler 在一段时间内持续执行和重新调度,出现非预期行为。 -### When locking is not enough +### 锁也解决不了问题 -Using locks also doesn’t fix the issue completely. If you add locks before processing any event and before executing a callback, it still doesn’t prevent an expired callback to run: +使用锁也不能完全解决问题。如果你在处理所有事件和执行回调之前加锁,它仍然不能阻止一个过期的回调运行: -``` +```go func (timeout* TimeoutHandler) Register() {     timeout.timer = time.AfterFunc(time.Duration(timeout.duration) * time._Second_, func() {       stateLock.Lock()   @@ -182,26 +181,26 @@ func (timeout* TimeoutHandler) Register() {   } ``` -The difference now is that the updates in the global map are synchronized, but this doesn’t prevent the callback from running after you call the **timeout.Cancel() **— This is the case if the scheduled timer expired but didn’t grab the lock yet. You should again lose reference to one of the registered timeouts. +现在的区别就是全局 map 的更新是同步的,但是这还是不能阻止在你调用 **timeout.Cancel() ** 后回调的执行 — 这种情况出现在调度计时器过期了但是还没有拿到锁的时候。你还是会丢失一个已注册的超时的引用。 -### Using cancellation channels +### 使用取消 channel -Instead of relying on golang’s **timer.Stop()**, which doesn’t prevent an expired timer to execute, you can use cancellation channels. +你可以使用取消 channel,而不必依赖不能阻止到期的计时器执行的 golang 函数 **timer.Stop()**。 -It is a slightly different approach. Now you won’t do a recursive re-scheduling through callbacks; instead, you register an infinite loop that waits for cancellation signals or timeout events. +这是一个略有不同的方法。现在你可以不用再通过回调进行递归地重新调度;而是注册一个死循环,这个循环接收到取消信号或超时事件是终止。 -The new **Register()** spawns a new go thread that runs your callback after a timeout and schedules a new timeout after the previous one has been executed. A cancellation channel is returned to the caller to control when the loop should stop. +新的 **Register()** 产生一个新的 go 协程,这个协程在在超时后执行你的回调,并在前一个超时执行后调度新的超时。返回给调用发一个取消 channel,用来控制循环的终止。 -``` +```go func (timeout *TimeoutHandler) Register() chan struct{} {     cancelChan := make(chan struct{})         go func () {       select {   -    case _ = <\- cancelChan:   +    case _ = <- cancelChan:         return   -    case _ = <\- time.AfterFunc(time.Duration(timeout.duration) * time.Second):   +    case _ = <- time.AfterFunc(time.Duration(timeout.duration) * time.Second):         func () {           stateLock.Lock()           defer stateLock.Unlock() @@ -218,23 +217,23 @@ func (timeout* TimeoutHandler) Cancel() {     if timeout.cancelChan == nil {       return     }   -  timeout.cancelChan <\- struct{}{}   +  timeout.cancelChan <- struct{}{}   } ``` -This approach gives you a cancellation channel for each timeout you register. A cancel call sends an empty struct to the channel and triggers the cancellation. However, this doesn’t resolve the previous issue; the timeout can expire right before you call cancel over the channel, and before the lock is grabbed by the timeout thread. +这个方法提供了你注册的所有超时的取消 channel。对 cancel 的一次调用向 channel 发送一个空结构体并触发取消操作。然而,这并不能解决前面的问题;可能在你通过 channel 调用 cancel 超时线程还没有拿到锁之前,超时时间就已经到了。 -The solution here is to check the cancellation channel inside the timeout scope after you grab the lock. +这里的解决方案是,在拿到锁之后,检查一下超时范围内的取消 channel。 -``` -  case _ = <\- time.AfterFunc(time.Duration(timeout.duration) * time.Second):   +```go +  case _ = <- time.AfterFunc(time.Duration(timeout.duration) * time.Second):       func () {         stateLock.Lock()         defer stateLock.Unlock()               select {   -      case _ = <\- handler.cancelChan:   +      case _ = <- handler.cancelChan:           return         default:           timeout.callback(timeout.session)   @@ -243,47 +242,49 @@ The solution here is to check the cancellation channel inside the timeout scope   } ``` -Finally, this guarantees that the callback is only executed after you grab the lock and no cancellation was triggered. +最终,这可以确保在拿到锁之后执行回调,不会触发取消操作。 -### Beware of deadlocks +### 小心死锁 -This solution seems to work; however, there is one hidden pitfall here: [deadlocks][10]. +这个解决方案看起来有效;但是还是有个隐患:[死锁][10]。 -Please read the code above again and try to find it yourself. Think of concurrent calls to any of the methods described. +请阅读上面的代码,试着自己找到它。考虑下描述的所有函数的并发调用。 -The last problem here is with the cancellation channel itself. We made it an unbuffered channel, which means that sending is a blocking call. Once you call cancel in a timeout handler, you only proceed once that handler is canceled. The problem here is when you have multiple calls to the same cancelation channel, where a cancel request is only consumed once. And this can easily happen if concurrent events were to cancel the same timeout handler, like a link down or control packet event. This results in a deadlock situation, possibly bringing the application to a halt. +这里的问题在取消 channel 本身。我们创建的是无缓冲 channel,即发送是阻塞调用。当你在一个超时 handler 中调用取消函数时,只有在该 handler 被取消后才能继续处理。问题出现在,当你有多个调用请求到同一个取消 channel 时,这时一个取消请求只被处理一次。当多个事件同时取消同一个超时 handler 时,如链接断开或控制包事件,很容易出现这种情况。这会导致死锁,可能会使应用程序 halt。 ![gophers on a wire, talking][11] -Is anyone listening? +还有人吗? -By Trevor Forrey. Used with permission. +已获得 Trevor Forrey 授权。 -The solution here is to at least make the channel buffered by one, so sends are not always blocking, and also explicitly make the send non-blocking in case of concurrent calls. This guarantees the cancellation is sent once and won’t block the subsequent cancel calls. +这里的解决方案是创建 channel 时指定大小至少为 1,这样向 channel 发送数据就不会阻塞,也显式地使发送变成非阻塞的,避免了并发调用。这样可以确保取消操作只发送一次,并且不会则色后续的取消调用。 -``` +```go func (timeout* TimeoutHandler) Cancel() {     if timeout.cancelChan == nil {       return     }         select {   -  case timeout.cancelChan <\- struct{}{}:   +  case timeout.cancelChan <- struct{}{}:     default:       // can’t send on the channel, someone has already requested the cancellation.     }   } ``` -### Conclusion +### 总结 -You learned in practice how common mistakes can show up while working with concurrent code. Due to their non-deterministic nature, those issues can go easily undetected, even with extensive testing. Here are the three main problems we encountered in the initial implementation. +在实践中你学到了并发操作时出现的常见错误。由于其不确定性,即使进行大量的测试,也不容易发现这些问题。下面是我们在最初的实现中遇到的三个主要问题: -#### Updating shared data without synchronization +#### 在非同步的情况下更新共享数据 This seems like an obvious one, but it’s actually hard to spot if your concurrent updates happen in different locations. The result is data race, where multiple updates to the same data can cause update loss, due to one update overriding another. In our case, we were updating the scheduled timeout reference on the same shared map. (Interestingly, if Go detects a concurrent read/write on the same Map object, it throws a fatal error —you can try to run Go’s [data race detector][12]). This eventually results in losing a timeout reference and making it impossible to cancel that given timeout. Always remember to use locks when they are needed. + + ![gopher assembly line][13] don’t forget to synchronize gophers’ work @@ -317,18 +318,18 @@ via: https://opensource.com/article/19/12/go-common-pitfalls [a]: https://opensource.com/users/edufgf [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/go-golang.png?itok=OAW9BXny (Goland gopher illustration) +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/go-golang.png?itok=OAW9BXny "Goland gopher illustration" [2]: http://mode.net [3]: https://en.wikipedia.org/wiki/Metrics_%28networking%29 [4]: https://people.ece.cornell.edu/atang/pub/15/HALO_ToN.pdf [5]: https://en.wikipedia.org/wiki/Point_of_presence -[6]: https://opensource.com/sites/default/files/uploads/image2_0_3.png (latency computation graph) -[7]: https://opensource.com/sites/default/files/uploads/image3_0.png (finite state machine diagram) +[6]: https://opensource.com/sites/default/files/uploads/image2_0_3.png "latency computation graph" +[7]: https://opensource.com/sites/default/files/uploads/image3_0.png "finite state machine diagram" [8]: https://golang.org/ -[9]: https://opensource.com/sites/default/files/uploads/image4.png (gophers hacking together) +[9]: https://opensource.com/sites/default/files/uploads/image4.png "gophers hacking together" [10]: https://en.wikipedia.org/wiki/Deadlock -[11]: https://opensource.com/sites/default/files/uploads/image5_0_0.jpg (gophers on a wire, talking) +[11]: https://opensource.com/sites/default/files/uploads/image5_0_0.jpg "gophers on a wire, talking" [12]: https://golang.org/doc/articles/race_detector.html -[13]: https://opensource.com/sites/default/files/uploads/image6.jpeg (gopher assembly line) +[13]: https://opensource.com/sites/default/files/uploads/image6.jpeg "gopher assembly line" [14]: https://en.wikipedia.org/wiki/Monitor_%28synchronization%29#Condition_variables -[15]: https://opensource.com/sites/default/files/uploads/image7.png (gopher boot camp) +[15]: https://opensource.com/sites/default/files/uploads/image7.png "gopher boot camp" From 6dacee06787746bfe551626c3c1f4fa2fd2ce2e1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Jan 2020 00:55:40 +0800 Subject: [PATCH 235/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200107=20Bash?= =?UTF-8?q?=20Script=20to=20Check=20How=20Long=20the=20High=20CPU/Memory?= =?UTF-8?q?=20Consumption=20Processes=20Runs=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200107 Bash Script to Check How Long the High CPU-Memory Consumption Processes Runs on Linux.md --- ...ory Consumption Processes Runs on Linux.md | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 sources/tech/20200107 Bash Script to Check How Long the High CPU-Memory Consumption Processes Runs on Linux.md diff --git a/sources/tech/20200107 Bash Script to Check How Long the High CPU-Memory Consumption Processes Runs on Linux.md b/sources/tech/20200107 Bash Script to Check How Long the High CPU-Memory Consumption Processes Runs on Linux.md new file mode 100644 index 0000000000..fc3818c344 --- /dev/null +++ b/sources/tech/20200107 Bash Script to Check How Long the High CPU-Memory Consumption Processes Runs on Linux.md @@ -0,0 +1,149 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Bash Script to Check How Long the High CPU/Memory Consumption Processes Runs on Linux) +[#]: via: (https://www.2daygeek.com/bash-script-to-check-how-long-the-high-cpu-memory-consumption-processes-runs-on-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Bash Script to Check How Long the High CPU/Memory Consumption Processes Runs on Linux +====== + +In the past, we have written three different articles to identify this using Linux commands. + +You can access them immediately by going to the relevant URLs below. + + * **[How to Find High CPU Consumption Processes in Linux][1]** + * **[How to Find Out Top Memory Consuming Processes in Linux][2]** + * **[Five Ways to Check How Long a Process Has Been Running in Linux][3]** + + + +Two scripts are included in this tutorial, which helps you to identify how long the high CPU/memory consumption processes are running on Linux. + +The script will show you the process ID, the owner of the process, the name of the process and how long the processes are running. + +This will help you identify which jobs are running overtime (which must be completed beforehand). + +This can be achieved using the ps command. + +### What’s ps Command + +ps stands for processes status, it display the information about the active/running processes on the system. + +It provides a snapshot of the current processes along with detailed information like username, user id, cpu usage, memory usage, process start date and time command name etc. + +### 1) Bash Script to Check How Long the High CPU Consumption Processes Runs on Linux + +This script will help you to identify how long the high CPU consumption processes has been running on Linux. + +``` +# vi /opt/scripts/long-running-cpu-proc.sh + +#!/bin/bash +ps -eo pid,user,ppid,%mem,%cpu,cmd --sort=-%cpu | head | tail -n +2 | awk '{print $1}' > /tmp/long-running-processes.txt +echo "--------------------------------------------------" +echo "UName PID CMD Process_Running_Time" +echo "--------------------------------------------------" +for userid in `cat /tmp/long-running-processes.txt` +do +username=$(ps -u -p $userid | tail -1 | awk '{print $1}') +pruntime=$(ps -p $userid -o etime | tail -1) +ocmd=$(ps -p $userid | tail -1 | awk '{print $4}') +echo "$username $userid $ocmd $pruntime" +done | column -t +echo "--------------------------------------------------" +``` + +Set an executable **[Linux file permission][4]** to **“long-running-cpu-proc.sh”** file. + +``` +# chmod +x /opt/scripts/long-running-cpu-proc.sh +``` + +When you run this script, you will get an output like the one below. + +``` +# sh /opt/scripts/long-running-cpu-proc.sh + +---------------------------------------------------- +UName PID CMD Process_Running_Time +---------------------------------------------------- +daygeek 5214 Web 01:18:48 +daygeek 5748 Web 01:08:20 +daygeek 8043 inkscape 22:11 +daygeek 5269 Web 01:18:31 +daygeek 1712 Web 10:44:50 +daygeek 5335 RDD 01:17:54 +daygeek 1639 firefox 10:44:51 +daygeek 7793 nautilus 24:14 +daygeek 6301 Web 57:40 +---------------------------------------------------- +``` + +### 2) Bash Script to Check How Long the High Memory Consumption Processes Runs on Linux + +This script will help you to identify how long the top memory consumption processes has been running on Linux. + +``` +# sh /opt/scripts/long-running-memory-proc.sh + +#!/bin/bash +ps -eo pid,user,ppid,%mem,%cpu,cmd --sort=-%mem | head | tail -n +2 | awk '{print $1}' > /tmp/long-running-processes-1.txt +echo "--------------------------------------------------" +echo "UName PID CMD Process_Running_Time" +echo "--------------------------------------------------" +for userid in `cat /tmp/long-running-processes-1.txt` +do +username=$(ps -u -p $userid | tail -1 | awk '{print $1}') +pruntime=$(ps -p $userid -o etime | tail -1) +ocmd=$(ps -p $userid | tail -1 | awk '{print $4}') +echo "$username $userid $ocmd $pruntime" +done | column -t +echo "--------------------------------------------------" +``` + +Set an executable Linux file permission to **“long-running-memory-proc.sh”** file. + +``` +# chmod +x /opt/scripts/long-running-memory-proc.sh +``` + +When you run this script, you will get an output like the one below. + +``` +# sh /opt/scripts/long-running-memory-proc.sh + +---------------------------------------------------- +UName PID CMD Process_Running_Time +---------------------------------------------------- +daygeek 1639 firefox 10:44:56 +daygeek 2997 Web 10:39:54 +daygeek 5269 Web 01:18:37 +daygeek 1712 Web 10:44:55 +daygeek 8043 inkscape 22:17 +daygeek 5214 Web 01:18:54 +daygeek 1898 Web 10:44:48 +daygeek 1129 Xorg 10:45:07 +daygeek 6301 Web 57:45 +---------------------------------------------------- +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/bash-script-to-check-how-long-the-high-cpu-memory-consumption-processes-runs-on-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/how-to-find-high-cpu-consumption-processes-in-linux/ +[2]: https://www.2daygeek.com/linux-find-top-memory-consuming-processes/ +[3]: https://www.2daygeek.com/how-to-check-how-long-a-process-has-been-running-in-linux/ +[4]: https://www.2daygeek.com/understanding-linux-file-permissions/ From 8ae7e83dcbaa294e82bbc08a2e20cfe37354a9d3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Jan 2020 00:56:32 +0800 Subject: [PATCH 236/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200106=20Open?= =?UTF-8?q?=20Source=20Supply=20Chain:=20A=20Matter=20of=20Trust?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200106 Open Source Supply Chain- A Matter of Trust.md --- ... Source Supply Chain- A Matter of Trust.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sources/tech/20200106 Open Source Supply Chain- A Matter of Trust.md diff --git a/sources/tech/20200106 Open Source Supply Chain- A Matter of Trust.md b/sources/tech/20200106 Open Source Supply Chain- A Matter of Trust.md new file mode 100644 index 0000000000..3484c3ca55 --- /dev/null +++ b/sources/tech/20200106 Open Source Supply Chain- A Matter of Trust.md @@ -0,0 +1,69 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open Source Supply Chain: A Matter of Trust) +[#]: via: (https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +Open Source Supply Chain: A Matter of Trust +====== + +[![][1]][2] + +_**Co-authored by Curtis Franklin, Jr**_ + +Open source software is often considered safer and more secure than proprietary software because users can, if they want, compile the software from the source code. They know the source of the code running in their environment.  Every component that they are running in their environment can be audited and the developer held accountable.   + +However, users and vendors are moving away from complexity that comes with total control and embracing convenience and ease of use. + +“I am often taken aback when I see a talk around security and privacy and then the presenter runs the ‘docker run’ command to install and run some random binary downloaded from the internet,” said [Dirk Hohndel, Vice-President and Chief Open Source Officer at VMware.][3] “Those two things seem to be a little bit at odds with each other.” + +The software supply chain — the process that takes an application from coding through packaging and distribution to its ultimate user — is complicated. If done wrong, it could be potentially risky, especially for open source software.  A malevolent player can get access to the backend and start inserting any random binary code onto a user’s system without that user’s knowledge or control. + +It’s not a problem specific to the cloud-native world. It can be seen in modern app development environments, including JavaScript, npm, PyPI, RubyGems, and so on.  Even Homebrew on Mac used to be provided through source code that a user would compile themselves.  + +“Today, you just download the binary and install it, hoping that it’s built from the same source code that you have access to,” said Hohndel. “As an industry, we need to pay more attention to our supply chain.  It’s something that is extremely important to me and that I’m trying to get more people interested in it.”  + +It’s not simply a binary versus source code equation, though. There are huge advantages to just running a binary instead of having to build everything from sources.   It allows developers to be more flexible and more responsive in their turnaround. They can cycle very quickly through new development and product releases by reusing some binaries. + +“It would be nice if there was a way to sign these binaries and have an ‘on-the-fly’ verification mechanism so users know they can trust these,” said Hohndel. + +Linux distributions have solved this problem as the distributions act as gatekeepers who check the integrity of packages that go into supported repositories.  + +“Packages offered through distributions like Debian are signed with a key. It takes a lot of work to ensure that this is really the software that should be in the distribution. They have solved the supply chain problem,” said Hohndel. + +But even on Linux distribution, people want to simplify things and trade correctness and security for speed. There are now projects like AppImage, Snap and Flatpack that have adopted the binary route, bringing the trust issue to Linux distributions. It’s the same problem of docker containers all over again. + +“The ideal solution would be to find a way for us as a community to devise a system of trust which ensures that if a binary was signed with a key that is in the network of trust, it can be trusted and provides us with the ability to reliably go back to the sources and do an audit,” suggested Hohndel. + +However, all this additional steps incur costs that most projects are either unwilling or unable to afford. Some projects are trying to find ways around the problem. NPM, for example, has begun to encourage those submitting packages to properly authenticate and secure their accounts to improve trustworthiness on the platform.  + +**Open Source Community Is Good At Solving Problems** + +Hohndel is involved with many efforts to solve the open source supply chain problem and is spreading awareness about it. Last year, [VMware acquired Bitnami,][4] which is a great place for curating open source applications that are signed by VMware.  + +“We are talking with upstream open source communities in various ecosystems to raise awareness about it. We are also discussing technical solutions that will make it easier for these communities to solve the underlying problems,” said Hohndel. + +The open source community has historically been diligent at ensuring software quality, including the mechanisms for security and privacy. Still, Hohndel says, “The biggest concern that I have is that, in the excitement about the next new thing, we often ignore the underlying engineering discipline that we really need.” + +Ultimately, Hohndel feels that answer will come from the open source community itself. “Open source is an engineering methodology and it’s a social experiment. Open source is all about people trusting each other, working with each other, collaborating across borders, between companies, amongst competitors in ways that we didn’t do before,” he explains. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/ + +作者:[Swapnil Bhartiya][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/swapnil/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2020/01/hand-1137978_1920-1068x801.jpg (hand-1137978_1920) +[2]: https://www.linux.com/wp-content/uploads/2020/01/hand-1137978_1920.jpg +[3]: https://www.swapnilbhartiya.com/open-source-leaders-dirk-hohndel-brings-open-source-to-vmware/ +[4]: https://techcrunch.com/2019/05/15/vmware-acquires-bitnami-to-deliver-packaged-applications-anywhere/ From f9c2412d4a61667987ac979d9bc42c88650c4b7e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Jan 2020 00:57:01 +0800 Subject: [PATCH 237/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200107=20Kali?= =?UTF-8?q?=20Linux=20Will=20No=20Longer=20Have=20The=20Default=20Root=20U?= =?UTF-8?q?ser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md --- ...ll No Longer Have The Default Root User.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md diff --git a/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md b/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md new file mode 100644 index 0000000000..2ffcd8f715 --- /dev/null +++ b/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Kali Linux Will No Longer Have The Default Root User) +[#]: via: (https://itsfoss.com/kali-linux-root-user/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Kali Linux Will No Longer Have The Default Root User +====== + +Kali Linux is a specialized Linux distribution for cyber security testing and hacking related tasks. + +If you’ve used [Kali Linux][1], you probably know that it followed a default root user policy. In other words, you are always root in Kali Linux. Whatever you do – you will be accessing tools/applications as root by default. + +It looks like everything back then was kind of “root for all” for everything. So, the default root user policy existed. + +They also explained the history for this in their [announcement post][2]: + +> A lot of those tools back then either required root access to run or ran better when ran as root. With this operating system that would be ran from a CD, never be updated, and had a lot of tools that needed root access to run it was a simple decision to have a “everything as root” security model. It made complete sense for the time. + +### Kali Linux will now have a default non-root user (like most other distributions) + +![][3] + +A default non-root model was necessary because a lot of users now use Kali Linux as their daily driver. + +Of course, they [do not recommend using Kali Linux][4] as a replacement for stable distributions like Ubuntu/Fedora/Manjaro – however, with its active development, some users do consider using it on a day-to-day basis instead of just using it for its tools. + +So, with a wide mainstream usage of the distro, the Kali Linux team thought of switching to a default non-root model because nowadays a lot of applications/tools do not require root access. + +> While we don’t encourage people to run Kali as their day to day operating system, over the last few years more and more users have started to do so _(even if they are not using it to do penetration testing full time)_, including some members of the Kali development team. When people do so, they obviously don’t run as default root user. With this usage over time, there is the obvious conclusion that default root user is no longer necessary and Kali will be better off moving to a more traditional security model. + +So I am reiterating that you should not consider Kali Linux to be fit for your daily tasks if you do not utilize security-related [Kali Linux tools][5]. Feel free to experiment – but I wouldn’t be so sure to rely on it. + +So from the next release, when you install Kali Linux, you’ll be asked to create non-root user that will have admin privileges. Tools and commands that require root access will be run with sudo. + +![][6] + +#### [Pretend to be Using Windows with Kali Linux Undercover Mode][7] + +The new undercover mode in Kali Linux switches the desktop layout to make it look like Windows 10. Find out how to activate the undercover mode. + +### New default user and password for Kali Linux live mode + +![Kali Linux has new user-password in the live system][8] + +Technically, you won’t find a groundbreaking difference. Just note that the default user ID and password in live mode is “**kali**“. + +You can find the new non-root model implemented in the new daily/weekly builds if you want to test it early. + +In either case, you can wait for the 2020.1 release scheduled for late January to take a look at the new default non-root user model. + +### Getting back the old root model in Kali Linux + +If you are a long time Kali Linux user, you may not find it convenient to add sudo before commands and then manually enter the password. + +The good news here is that you can still get the old password-less root rights with this command: + +``` +sudo dpkg-reconfigure kali-grant-root +``` + +What do you think about the default non-root user model? Is it a good decision? Let me know your thoughts in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/kali-linux-root-user/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.kali.org/ +[2]: https://www.kali.org/news/kali-default-non-root-user/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/kali_linux_default_root_user.png?ssl=1 +[4]: https://itsfoss.com/kali-linux-review/ +[5]: https://itsfoss.com/best-kali-linux-tools/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/11/kali_linux_undercover_mode.jpg?fit=800%2C450&ssl=1 +[7]: https://itsfoss.com/kali-linux-undercover-mode/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/kali-linux-live-password.png?ssl=1 From 23bed4dc448b9e84f2a9cec6796ad0ebe3b0fe6c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Jan 2020 00:57:21 +0800 Subject: [PATCH 238/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200107=20App=20?= =?UTF-8?q?Highlight:=20Catfish=20Desktop=20File=20Searching=20Tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200107 App Highlight- Catfish Desktop File Searching Tool.md --- ...ht- Catfish Desktop File Searching Tool.md | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 sources/tech/20200107 App Highlight- Catfish Desktop File Searching Tool.md diff --git a/sources/tech/20200107 App Highlight- Catfish Desktop File Searching Tool.md b/sources/tech/20200107 App Highlight- Catfish Desktop File Searching Tool.md new file mode 100644 index 0000000000..d485682215 --- /dev/null +++ b/sources/tech/20200107 App Highlight- Catfish Desktop File Searching Tool.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (App Highlight: Catfish Desktop File Searching Tool) +[#]: via: (https://itsfoss.com/catfish/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +App Highlight: Catfish Desktop File Searching Tool +====== + +_****Brief: Catfish is a nifty file searching GUI tool for Linux desktop. The interface is lightweight and simple and the tool allows to refine your search with** criteria like time, file type etc.**_ + +The Linux purists use commands like locate, find and grep to search for files in the terminal. + +But as a desktop Linux user, you don’t need to leave the comfort of the graphical user interface (GUI) and deep dive into the command line interface (CLI) just for searching files on your desktop. + +Most Linux distributions provide a basic desktop search feature either via the file manager or through the desktop environment itself. + +On GNOME desktop, you can search for files in the Activities area (use the Windows key to bring it up). Files (previously known as Nautilus) also has a built-in search button. + +![Nautilus file manager already has advanced search feature][1] + +You can extend this search and add options like time and type of the file. One thing it doesn’t do is to search inside the files. For example, you cannot use it to get all the files that contains “university”. + +This is where a desktop file search tool like Catfish could help you. + +### Catfish: A nifty GUI tool for searching files on Linux + +[Catfish][2] is a GUI tool that enables you to search your desktop for any kind of files. It uses locate and find commands underneath. The autocompletion feature uses [Zeitgeist][3] daemon and [locate command][4]. It’s a lightweight tool and uses GTK+. + +Catfish is developed by [Christian Dywan][5], the same person who develops the [lightweight Midori web browser][6]. + +![Catfish interface on MX Linux][7] + +Some of the main features of Catfish are: + + * Search for files anywhere on your system, **including the mounted partitions** + * **Search inside the files** for its contents (can be enabled from preferences) + * Search hidden files as well + * Refine your search based on modification time + * Refine your search based on file type (images, videos, documents etc) + * Refine your search based on location (Documents, Downloads, Pictures or other folders) + * Exclude certain directories and paths from your search + * Lightweight and simple interface + * **Support for Wayland** display server (from version 1.4.12) + + + +Catfish is now a Xfce project and it is providing the search feature to Xfce’s Thunar file manager. + +### Installing Catfish on Ubuntu and other Linux distributions + +Let’s see how to install Catfish on your Linux distributions. + +**Ubuntu-based distributions** + +Catfish is available in the universe repository for Ubuntu based distributions such as Xubuntu, Linux Mint, Linux Lite etc. + +You can install it from the software center by searching for Catfish + +![Catfish in Ubuntu Software Center][8] + +or, use the terminal to install it: + +``` +sudo apt install catfish +``` + +The version provided by Ubuntu may not be the latest. The [official PPA][9] has been abandoned so this means that to get the latest Catfish version, you’ll have to [install it from the source code][10]. + +**On other distributions** + +Catfish is also available in most major Linux distributions. It is certainly available on Fedora and if you check your distribution’s package manager or software center, you should find it there and install it like any other program. + +**Conclusion** + +In this week’s Linux application highlight, you learned about this handy little utility. However, Catfish is not the only tool of its kind. You may check some other search tools like [ANGRYSearch][11] or [SearchMonkey][12]. + +Have you ever used a GUI tool for searching files or do you rely on the good old command line? And what do you think of Catfish? Do you look forward to use it? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/catfish/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/search-files-gnome.jpg?ssl=1 +[2]: https://launchpad.net/catfish-search/ +[3]: https://wiki.archlinux.org/index.php/Zeitgeist +[4]: https://linuxhandbook.com/locate-command/ +[5]: http://www.twotoasts.de/index.php/about/ +[6]: https://itsfoss.com/midori-browser/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/catfish_screenshot.png?ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/catfish_ubuntu_software_center.jpg?ssl=1 +[9]: https://itsfoss.com/ppa-guide/ +[10]: https://itsfoss.com/install-software-from-source-code/ +[11]: https://itsfoss.com/angrysearch/ +[12]: https://itsfoss.com/searchmonkey-search-text-files-linux/ From 8638c00497c6dfed4f6918147985517e351fe2df Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Jan 2020 00:58:19 +0800 Subject: [PATCH 239/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200106=20How=20?= =?UTF-8?q?to=20write=20a=20Python=20web=20API=20with=20Pyramid=20and=20Co?= =?UTF-8?q?rnice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200106 How to write a Python web API with Pyramid and Cornice.md --- ...Python web API with Pyramid and Cornice.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/tech/20200106 How to write a Python web API with Pyramid and Cornice.md diff --git a/sources/tech/20200106 How to write a Python web API with Pyramid and Cornice.md b/sources/tech/20200106 How to write a Python web API with Pyramid and Cornice.md new file mode 100644 index 0000000000..2b10ef953a --- /dev/null +++ b/sources/tech/20200106 How to write a Python web API with Pyramid and Cornice.md @@ -0,0 +1,157 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to write a Python web API with Pyramid and Cornice) +[#]: via: (https://opensource.com/article/20/1/python-web-api-pyramid-cornice) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +How to write a Python web API with Pyramid and Cornice +====== +Use Pyramid and Cornice to build and document scalable RESTful web +services. +![Searching for code][1] + +[Python][2] is a high-level, object-oriented programming language known for its simple syntax. It is consistently among the top-rated programming languages for building RESTful APIs. + +[Pyramid][3] is a Python web framework designed to scale up with an application: it's simple for simple applications but can grow for big, complex applications. Among other things, Pyramid powers PyPI, the Python package index. [Cornice][4] provides helpers to build and document REST-ish web services with Pyramid. + +This article will use the example of a web service to get famous quotes to show how to use these tools. + +### Set up a Pyramid application + +Start by creating a virtual environment for your application and a file to hold the code: + + +``` +$ mkdir tutorial +$ cd tutorial +$ touch main.py +$ python3 -m venv env +$ source env/bin/activate +(env) $ pip3 install cornice twisted +``` + +### Import the Cornice and Pyramid modules + +Import these modules with: + + +``` +from pyramid.config import Configurator +from cornice import Service +``` + +### Define the service + +Define the quotes service as a **Service** object: + + +``` +QUOTES = Service(name='quotes', +                 path='/', +                 description='Get quotes') +``` + +### Write the quotes logic + +So far, this only supports **GET**ing quotes. Decorate the function with **QUOTES.get**; this is how you can tie in the logic to the REST service: + + +``` +@QUOTES.get() +def get_quote(request): +    return { +        'William Shakespeare': { +            'quote': ['Love all, trust a few, do wrong to none', +            'Some are born great, some achieve greatness, and some have greatness thrust upon them.'] +    }, +    'Linus': { +        'quote': ['Talk is cheap. Show me the code.'] +        } +    } +``` + +Note that unlike in other frameworks, the **get_quote** function is _not_ changed by the decorator. If you import this module, you can still call the function regularly and inspect the result. + +This is useful when writing unit tests for Pyramid RESTful services. + +### Define the application object + +Finally, use **scan** to find all decorated functions and add them to the configuration:  + + +``` +with Configurator() as config: +    config.include("cornice") +    config.scan() +    application = config.make_wsgi_app() +``` + +The default for scan is to scan the current module. You can also give the name of a package if you want to scan all modules in a package. + +### Run the service + +I use Twisted's WSGI server to run the application, but you can use any other [WSGI][5] server, like Gunicorn or uWSGI, if you want: + + +``` +`(env)$ python -m twisted web --wsgi=main.application` +``` + +By default, Twisted's WSGI server runs on port 8080. You can test the service with [HTTPie][6]: + + +``` +(env) $ pip install httpie +... +(env) $ http GET +HTTP/1.1 200 OK +Content-Length: 220 +Content-Type: application/json +Date: Mon, 02 Dec 2019 16:49:27 GMT +Server: TwistedWeb/19.10.0 +X-Content-Type-Options: nosniff + +{ +    "Linus": { +        "quote": [ +            "Talk is cheap. Show me the code." +        ] +    }, +    "William Shakespeare": { +        "quote": [ +            "Love all,trust a few,do wrong to none", +            "Some are born great, some achieve greatness, and some greatness thrust upon them." +        ] +    } +} +``` + +### Why use Pyramid? + +Pyramid is not the most popular framework, but it is used in some high-profile projects like [PyPI][7]. I like Pyramid because it is one of the frameworks that took unit testing seriously: because the decorators do not modify the function and there are no thread-local variables, functions are callable directly from unit tests. For example, functions that need access to the database will get it from the **request** object passed in via **request.config**. This allows a unit tester to put a mock (or real) database object in the request, instead of carefully setting globals, thread-local variables, or other framework-specific things. + +If you're looking for a well-tested library to build your next API, give Pyramid a try. You won't be disappointed. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/python-web-api-pyramid-cornice + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_python_programming.png?itok=ynSL8XRV (Searching for code) +[2]: https://opensource.com/resources/python +[3]: https://opensource.com/article/18/5/pyramid-framework +[4]: https://cornice.readthedocs.io/en/latest/ +[5]: https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface +[6]: https://opensource.com/article/19/8/getting-started-httpie +[7]: https://pypi.org/ From dd1cfb171b21de63db5570da5b9ea1d24ed1bec1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Jan 2020 00:58:47 +0800 Subject: [PATCH 240/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200106=20Create?= =?UTF-8?q?=20fancy=20text=20for=20your=20social=20media=20posts=20with=20?= =?UTF-8?q?this=20Gawk=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200106 Create fancy text for your social media posts with this Gawk script.md --- ...ocial media posts with this Gawk script.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20200106 Create fancy text for your social media posts with this Gawk script.md diff --git a/sources/tech/20200106 Create fancy text for your social media posts with this Gawk script.md b/sources/tech/20200106 Create fancy text for your social media posts with this Gawk script.md new file mode 100644 index 0000000000..361bac0726 --- /dev/null +++ b/sources/tech/20200106 Create fancy text for your social media posts with this Gawk script.md @@ -0,0 +1,126 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create fancy text for your social media posts with this Gawk script) +[#]: via: (https://opensource.com/article/20/1/gawk-scripting-social-media) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) + +Create fancy text for your social media posts with this Gawk script +====== +Add a little style to your status updates by posting text in script, +fraktur, or double-strike characters. +![Chat via email][1] + +Like almost everyone on the planet, I have a few social media accounts. I mostly stick to Facebook to stay up to date with friends and family and Twitter to follow a few other people. + +Have you ever wanted to make a post that includes italics or some other fancy formatting? You can easily change the text to italics or bold when you're writing an email, but most social media platforms don't provide many formatting options. + +And sometimes, I just want to put a little _emphasis_ into what I'm writing. If I've had a really good day and I want to share that with my friends, I might want to put that text in italics. For other posts, I might want to use different formatting that will help my text stand out. Sure, you can use emoji, but sometimes a little text formatting can add that extra pizzazz to your posts. + +I found a way to do just that. With a short [Gawk][2] script I wrote, I can create fancy formatting that I can copy and paste into my social media posts. + +### Special HTML + +HTML includes a bunch of special characters for mathematics, symbols, and other languages that most people are not aware of. Within the Mathematical Markup Language ([MathML][3]) math character support, HTML includes alternate versions of the alphabet for script, fraktur, and double-strike (shown respectively in this image) characters. + +![script, fraktur, and double-strike text][4] + +You can use these alternate versions of the alphabet to create fancy text. + +The script alphabet variation is written as the letter followed by **scr**. Characters can be uppercase or lowercase. For example, to print the script letter **a** in an HTML page, type **&ascr;**, and to print the script letter **Z** in HTML, type **&Zscr;**. + +The fraktur and double-strike variations are referenced in similar ways. The fraktur mathematical lower-case **a** is **&afr;**, and the capital **Y** is **&Yfr;**. The mathematical double-strike **a** is referenced as **&aopf;**, and the double-strike **X** is **&Xopf;**. + +### Gawk functions + +Once you know how to reference the alternate versions of each letter, it's easy to define a few Gawk functions to print those HTML entities. Since these alternate characters exist only for letters and not punctuation or numbers, start with a simple wrapper function to determine if a character is an uppercase or lowercase letter. + + +``` +#!/usr/bin/gawk -f +# Echo the input as different "fonts." Redirect this into an html +# page and copy/paste fancy text into twitter or facebook. + +BEGIN { alpha="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; } + +function is_alpha(c) { +  return(index(alpha, c)); +} +``` + +The **BEGIN** statement defines an alphabet string called **alpha** that contains all letters a–z and A–Z. The **is_alpha(c)** function uses the built-in **index()** function to return the location of the character **c** in the string **alpha**. If the character **c** is not a letter, **index()** returns zero, which the script uses as a False value. + +Because the **is_alpha(c)** function just "wraps" a call to the **index()** function without doing anything else; this is called a _wrapper_ function. Think of it as shorthand that makes the Gawk script easier to read. + +With that, it's easy to define a few functions that convert single letters into each of the alternate versions of the alphabet. In general, each function calls **is_alpha(c)** to determine if a character is a letter a–z or A–Z. If it is (i.e., if the returned value is non-zero), then the function prints the HTML entity for that letter as script, fraktur, and double-strike. Otherwise, the function prints the letter. + + +``` +function print_script(c) { +  if ( is_alpha(c) ) { printf("&%cscr;", c); } else { printf("%c", c); } +} +function print_fraktur(c) { +  if ( is_alpha(c) ) { printf("&%cfr;", c); }  else { printf("%c", c); } +} +function print_double(c) { +  if ( is_alpha(c) ) { printf("&%copf;", c); } else { printf("%c", c); } +} +``` + +The **print_script(c)** function prints a single letter in script. Similarly, the **print_fraktur(c)** function prints a letter in fraktur, and the **print_double(c)** function prints a single letter in double-strike. + +All that's left is a Gawk loop to convert plain text into each of the alternate alphabet characters. This script loops over each line three times and prints the text in script, fraktur, or double-strike. Each line is wrapped in **<p>** and **</p>** HTML tags. + + +``` +{ text=$0; +  len=length(text); + +  print "<p>"; +  for (i=1; i<=len; i++) { +    print_script( substr(text, i, 1) ); +  } +  print "</p><p>"; +  for (i=1; i<=len; i++) { +    print_fraktur( substr(text, i, 1) ); +  } +  print "</p><p>"; +  for (i=1; i<=len; i++) { +    print_double( substr(text, i, 1) ); +  } +  print "</p>"; +} +``` + +### Putting it all together + +I saved the above lines in a script file called **htmlecho** and put it in my **~/bin** directory. + + +``` +$ htmlecho > /tmp/hello.html +Hello world +^Z +``` + +Whenever I want to add fancy text to my Facebook and Twitter posts, I just run the script and save the output to a temporary HTML page. I open the temporary page in a web browser and copy and paste the fancy text I like best into my social media posts. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/gawk-scripting-social-media + +作者:[Jim Hall][a] +选题:[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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/email_chat_communication_message.png?itok=LKjiLnQu (Chat via email) +[2]: https://www.gnu.org/software/gawk/ +[3]: https://en.wikipedia.org/wiki/MathML +[4]: https://opensource.com/sites/default/files/uploads/hello_world.png (script, fraktur, and double-strike text) From 299bf6e3e090c4a0446ef4d689becabc21607800 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Jan 2020 00:59:07 +0800 Subject: [PATCH 241/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200105=20PaperW?= =?UTF-8?q?M:=20tiled=20window=20management=20for=20GNOME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200105 PaperWM- tiled window management for GNOME.md --- ...erWM- tiled window management for GNOME.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20200105 PaperWM- tiled window management for GNOME.md diff --git a/sources/tech/20200105 PaperWM- tiled window management for GNOME.md b/sources/tech/20200105 PaperWM- tiled window management for GNOME.md new file mode 100644 index 0000000000..0948014fba --- /dev/null +++ b/sources/tech/20200105 PaperWM- tiled window management for GNOME.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PaperWM: tiled window management for GNOME) +[#]: via: (https://jvns.ca/blog/2020/01/05/paperwm/) +[#]: author: (Julia Evans https://jvns.ca/) + +PaperWM: tiled window management for GNOME +====== + +When I started using Linux on my personal computer, one of the first things I got excited about was tiny lightweight window managers, largely because my laptop at the time had 32MB of RAM and anything else was unusable. + +Then I got into tiling window managers like [xmonad][1]! I could manage my windows with my keyboard! They were so fast! I could configure xmonad by writing a Haskell program! I could customize everything in all kinds of fun ways (like using [dmenu][2] as a launcher)! I used 3 or 4 different tiling window managers over the years and it was fun. + +About 6 years ago I decided configuring my tiling window manager wasn’t fun for me anymore and switched to using the Ubuntu stock desktop environment: Gnome. (which is much faster now that I have 500x more RAM in my laptop :) ) + +So I’ve been using Gnome for a long time, but I still kind of missed tiling window managers. Then 6 months ago a friend told me about [PaperWM][3], which lets you tile your windows in Gnome! I installed it immediately and I’ve been using it ever since. + +### PaperWM: tiling window management for Gnome + +The basic idea of [PaperWM][3] is: you want to keep using Gnome (because all kinds of things Just Work in Gnome) but you also kinda wish you were using a tiling window manager. + +It’s a Gnome extension (instead of being a standalone window manager) and it’s in Javascript. + +### “Paper” means all of your windows are in a line + +The main idea in PaperWM is it puts all your windows in a line, which is actually quite different from traditional tiling window managers where you can tile your windows any way you want. Here’s a gif of me moving between / resizing some windows while writing this blog post (there’s a browser and two terminal windows): + +![][4] + +PaperWM’s Github README links to this video: , which describes a similar system as a “linear window manager”. + +I’d never heard of this way of organizing windows before but I like the simplicity of it – if I’m looking for a specific window I just move left/right until I find it. + +### everything I do in PaperWM + +there are lots of other features but these are the only ones I use: + + * move left and right between windows (`Super + ,`, `Super + .`) + * move the window left/right in the ordering (`Super+Shift+,`, `Super+Shift+.`) + * full screen a window (`Super + f`) + * make a window smaller (`Super + r`) + + + +### I like tools that I don’t have to configure + +I’ve been using PaperWM for 6 months on a laptop and I really like it! I also really appreciate that even though it’s configurable (by writing a Javascript configuration file), it does the things I want out of the box without me having to research how to configure it. + +The [fish shell][5] is another delightful tool like that – I basically don’t configure fish at all (except to set environment variables etc) and I really like the default feature set. + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2020/01/05/paperwm/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://xmonad.org/ +[2]: https://wiki.archlinux.org/index.php/Dmenu +[3]: https://github.com/paperwm/PaperWM +[4]: https://jvns.ca/images/paperwm.gif +[5]: https://jvns.ca/blog/2017/04/23/the-fish-shell-is-awesome/ From 645361a2416b45bba0b7b078755a89f55b49147f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Jan 2020 01:01:14 +0800 Subject: [PATCH 242/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200105=20Friend?= =?UTF-8?q?=20of=20a=20Friend:=20The=20Facebook=20That=20Could=20Have=20Be?= =?UTF-8?q?en?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200105 Friend of a Friend- The Facebook That Could Have Been.md --- ...iend- The Facebook That Could Have Been.md | 236 ++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 sources/talk/20200105 Friend of a Friend- The Facebook That Could Have Been.md diff --git a/sources/talk/20200105 Friend of a Friend- The Facebook That Could Have Been.md b/sources/talk/20200105 Friend of a Friend- The Facebook That Could Have Been.md new file mode 100644 index 0000000000..bbdb88f4f3 --- /dev/null +++ b/sources/talk/20200105 Friend of a Friend- The Facebook That Could Have Been.md @@ -0,0 +1,236 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Friend of a Friend: The Facebook That Could Have Been) +[#]: via: (https://twobithistory.org/2020/01/05/foaf.html) +[#]: author: (Two-Bit History https://twobithistory.org) + +Friend of a Friend: The Facebook That Could Have Been +====== + +> _I express my network in a FOAF file, and that is the start of the revolution._ —Tim Berners-Lee (2007) + +The FOAF standard, or Friend of a Friend standard, is a now largely defunct/ignored/superseded[1][1] web standard dating from the early 2000s that hints at what social networking might have looked like had Facebook not conquered the world. Before we talk about FOAF though, I want to talk about the New York City Subway. + +The New York City Subway is controlled by a single entity, the Metropolitan Transportation Agency, better known as the MTA. The MTA has a monopoly on subway travel in New York City. There is no legal way to travel in New York City by subway without purchasing a ticket from the MTA. The MTA has no competitors, at least not in the “subway space.” + +This wasn’t always true. Surprisingly, the subway system was once run by two corporations that competed with each other. The Inter-borough Rapid Transit Company (IRT) operated lines that ran mostly through Manhattan, while the Brooklyn-Manhattan Transit Corporation (BMT) operated lines in Brooklyn, some of which extended into Manhattan also. In 1932, the City opened its own service called the Independent Subway System to compete with the IRT and BMT, and so for a while there were _three_ different organizations running subway lines in New York City. + +One imagines that this was not an effective way to run a subway. It was not. Constructing interchanges between the various systems was challenging because the IRT and BMT used trains of different widths. Interchange stations also had to have at least two different fare-collection areas since passengers switching trains would have to pay multiple operators. The City eventually took over the IRT and BMT in 1940, bringing the whole system together under one operator, but some of the inefficiencies that the original division entailed are still problems today: Trains designed to run along lines inherited from the BMT (e.g. the A, C, or E) cannot run along lines inherited from the IRT (e.g. the 1, 2, or 3) because the IRT tunnels are too narrow. As a result, the MTA has to maintain two different fleets of mutually incompatible subway cars, presumably at significant additional expense relative to other subway systems in the world that only have to deal with a single tunnel width. + +This legacy of the competition between the IRT and BMT suggests that subway systems naturally tend toward monopoly. It just makes more sense for there to be a single operator than for there to be competing operators. Average passengers are amply compensated for the loss of choice by never having to worry about whether they brought their IRT MetroCard today but forgot their BMT MetroCard at home. + +Okay, so what does the Subway have to do with social networking? Well, I have wondered for a while now whether Facebook has, like the MTA, a natural monopoly. Facebook does seem to have _a_ monopoly, whether natural or unnatural—not over social media per se (I spend much more time on Twitter), but over my internet social connections with real people I know. It has a monopoly over, as they call it, my digitized “social graph”; I would quit Facebook tomorrow if I didn’t worry that by doing so I might lose many of those connections. I get angry about this power that Facebook has over me. I get angry in a way that I do not get angry about the MTA, even though the Subway is, metaphorically and literally, a sprawling trash fire. And I suppose I get angry because at root I believe that Facebook’s monopoly, unlike the MTA’s, is not a natural one. + +What this must mean is that I think Facebook owns all of our social data now because they happened to get there first and then dig a big moat around themselves, not because a world with competing Facebook-like platforms is inefficient or impossible. Is that true, though? There are some good reasons to think it isn’t: Did Facebook simply get there first, or did they instead just do social networking better than everyone else? Isn’t the fact that there is only one Facebook actually convenient if you are trying to figure out how to contact an old friend? In a world of competing Facebooks, what would it mean if you and your boyfriend are now Facebook official, but he still hasn’t gotten around to updating his relationship status on VisageBook, which still says he is in a relationship with his college ex? Which site will people trust? Also, if there were multiple sites, wouldn’t everyone spend a lot more time filling out web forms? + +In the last few years, as the disadvantages of centralized social networks have dramatically made themselves apparent, many people have attempted to create decentralized alternatives. These alternatives are based on open standards that could potentially support an ecosystem of inter-operating social networks (see e.g. [the Fediverse][2]). But none of these alternatives has yet supplanted a dominant social network. One obvious explanation for why this hasn’t happened is the power of network effects: With everyone already on Facebook, any one person thinking of leaving faces a high cost for doing so. Some might say this proves that social networks are natural monopolies and stop there; I would say that Facebook, Twitter, et al. chose to be walled gardens, and given that people have envisioned and even built social networks that inter-operate, the network effects that closed platforms enjoy tell us little about the inherent nature of social networks. + +So the real question, in my mind, is: Do platforms like Facebook continue to dominate merely because of their network effects, or is having a single dominant social network more efficient in the same way that having a single operator for a subway system is more efficient? + +Which finally brings me back to FOAF. Much of the world seems to have forgotten about the FOAF standard, but FOAF was an attempt to build a decentralized and open social network before anyone had even heard of Facebook. If any decentralized social network ever had a chance of occupying the redoubt that Facebook now occupies before Facebook got there, it was FOAF. Given that a large fraction of humanity now has a Facebook account, and given that relatively few people know about FOAF, should we conclude that social networking, like subway travel, really does lend itself to centralization and natural monopoly? Or does the FOAF project demonstrate that decentralized social networking was a feasible alternative that never became popular for other reasons? + +### The Future from the Early Aughts + +The FOAF project, begun in 2000, set out to create a universal standard for describing people and the relationships between them. That might strike you as a wildly ambitious goal today, but aspirations like that were par for the course in the late 1990s and early 2000s. The web (as people still called it then) had just trounced closed systems like America Online and [Prodigy][3]. It could only have been natural to assume that further innovation in computing would involve the open, standards-based approach embodied by the web. + +Many people believed that the next big thing was for the web to evolve into something called the Semantic Web. [I have written about][4] what exactly the Semantic Web was supposed to be and how it was supposed to work before, so I won’t go into detail here. But I will sketch the basic vision motivating the people who worked on Semantic Web technologies, because the FOAF standard was an application of that vision to social networking. + +There is an essay called [“How Google beat Amazon and Ebay to the Semantic Web”][5] that captures the lofty dream of the Semantic Web well. It was written by Paul Ford in 2002. The essay imagines a future (as imminent as 2009) in which Google, by embracing the Semantic Web, has replaced Amazon and eBay as the dominant e-commerce platform. In this future, you can search for something you want to purchase—perhaps a second-hand Martin guitar—by entering `buy:martin guitar` into Google. Google then shows you all the people near your zipcode selling Martin guitars. Google knows about these people and their guitars because Google can read RDF, a markup language and core Semantic Web technology focused on expressing relationships. Regular people can embed RDF on their web pages to advertise (among many other things) the items they have to sell. Ford predicts that as the number of people searching for and advertising products this way grows, Amazon and eBay will lose their near-monopolies over, respectively, first-hand and second-hand e-commerce. Nobody will want to search a single centralized database for something to buy when they could instead search the whole web. Even Google, Ford writes, will eventually lose its advantage, because in theory anyone could crawl the web reading RDF and offer a search feature similar to Google’s. At the very least, if Google wanted to make money from its Semantic Web marketplace by charging a percentage of each transaction, that percentage would probably by forced down over time by competitors offering a more attractive deal. + +Ford’s imagined future was an application of RDF, or the Resource Description Framework, to e-commerce, but the exciting thing about RDF was that hypothetically it could be used for anything. The RDF standard, along with a constellation of related standards, once widely adopted, was supposed to blow open database-backed software services on the internet the same way HTML had blown open document publishing on the internet. + +One arena that RDF and other Semantic Web technologies seemed poised to takeover immediately was social networking. The FOAF project, known originally as “RDF Web Ring” before being renamed, was the Semantic Web effort offshoot that sought to accomplish this. FOAF was so promising in its infancy that some people thought it would inevitably make all other social networking sites obsolete. A 2004 Guardian article about the project introduced FOAF this way: + +> In the beginning, way back in 1996, it was SixDegrees. Last year, it was Friendster. Last week, it was Orkut. Next week, it could be Flickr. All these websites, and dozens more, are designed to build networks of friends, and they are currently at the forefront of the trendiest internet development: social networking. But unless they can start to offer more substantial benefits, it is hard to see them all surviving, once the Friend Of A Friend (FOAF) standard becomes a normal part of life on the net.[2][6] + +The article goes on to complain that the biggest problem with social networking is that there are too many social networking sites. Something is needed that can connect all of the different networks together. FOAF is the solution, and it will revolutionize social networking as a result. + +FOAF, according to the article, would tie the different networks together by doing three key things: + + * It would establish a machine-readable format for social data that could be read by any social networking site, saving users from having to enter this information over and over again + * It would allow “personal information management programs,” i.e. your “Contacts” application, to generate a file in this machine-readable format that you could feed to social networking sites + * It would further allow this machine-readable format to be hosted on personal homepages and read remotely by social networking sites, meaning that you would be able to keep your various profiles up-to-date by just pushing changes to your own homepage + + + +It is hard to believe today, but the problem in 2004, at least for savvy webizens and technology columnists aware of all the latest sites, was not the lack of alternative social networks but instead the proliferation of them. Given _that_ problem—so alien to us now—one can see why it made sense to pursue a single standard that promised to make the proliferation of networks less of a burden. + +### The FOAF Spec + +According to the description currently given on the FOAF project’s website, FOAF is “a computer language defining a dictionary of people-related terms that can be used in structured data.” Back in 2000, in a document they wrote to explain the project’s goals, Dan Brickley and Libby Miller, FOAF’s creators, offered a different description that suggests more about the technology’s ultimate purpose—they introduced FOAF as a tool that would allow computers to read the personal information you put on your homepage the same way that other humans do.[3][7] FOAF would “help the web do the sorts of things that are currently the proprietary offering of centralised services.”[4][8] By defining a standard vocabulary for people and the relationships between them, FOAF would allow you to ask the web questions such as, “Find me today’s web recommendations made by people who work for Medical organizations,” or “Find me recent publications by people I’ve co-authored documents with.” + +Since FOAF is a standardized vocabulary, the most important output of the FOAF project was the FOAF specification. The FOAF specification defines a small collection of RDF _classes_ and RDF _properties_. (I’m not going to explain RDF here, but again see [my post about the Semantic Web][4] if you want to know more.) The RDF _classes_ defined by the FOAF specification represent subjects you might want to describe, such as people (the `Person` class) and organizations (the `Organization` class). The RDF _properties_ defined by the FOAF specification represent logical statements you might make about the different subjects. A person could have, for example, a first name (the `givenName` property), a last name (the `familyName` property), perhaps even a personality type (the `myersBriggs` property), and be near another person or location (the `based_near` property). The idea was that these classes and properties would be sufficient to represent the kind of the things people say about themselves and their friends on their personal homepage. + +The FOAF specification gives the following as an example of a well-formed FOAF document. This example uses XML, though an equivalent document could be written using JSON or a number of other formats: + +``` + + Dan Brickley + + + + +``` + +This FOAF document describes a person named “Dan Brickley” (one of the specification’s authors) that has a homepage at `http://danbri.org`, something called an “open ID,” and a picture available at `/images/me.jpg`, presumably relative to the base address of Brickley’s homepage. The FOAF-specific terms are prefixed by `foaf:`, indicating that they are part of the FOAF namespace, while the more general RDF terms are prefixed by `rdf:`. + +Just to persuade you that FOAF isn’t tied to XML, here is a similar FOAF example from Wikipedia, expressed using a format called JSON-LD[5][9]: + +``` +{ + "@context": { + "name": "http://xmlns.com/foaf/0.1/name", + "homepage": { + "@id": "http://xmlns.com/foaf/0.1/workplaceHomepage", + "@type": "@id" + }, + "Person": "http://xmlns.com/foaf/0.1/Person" + }, + "@id": "https://me.example.com", + "@type": "Person", + "name": "John Smith", + "homepage": "https://www.example.com/" +} +``` + +This FOAF document describes a person named John Smith with a homepage at `www.example.com`. + +Perhaps the best way to get a feel for how FOAF works is to play around with [FOAF-a-matic][10], a web tool for generating FOAF documents. It allows you to enter information about yourself using a web form, then uses that information to create the FOAF document (in XML) that represents you. FOAF-a-matic demonstrates how FOAF could have been used to save everyone from having to enter their social information into a web form ever again—if every social networking site could read FOAF, all you’d need to do to sign up for a new site is point the site to the FOAF document that FOAF-a-matic generated for you. + +Here is a slightly more complicated FOAF example, representing me, that I created using FOAF-a-matic: + +``` + + + + + + + + + Sinclair Target + Sinclair + Target + + + + + John Smith + + + + + + +``` + +This example has quite a lot of preamble setting up the various XML namespaces used by the document. There is also a section containing data about the tool that was used to generate the document, largely so that, it seems, people know whom to email with complaints. The `foaf:Person` element describing me tells you my name, email address, and homepage. There is also a nested `foaf:knows` element telling you that I am friends with John Smith. + +This example illustrates another important feature of FOAF documents: They can link to each other. If you remember from the previous example, my friend John Smith has a homepage at `www.example.com`. In this example, where I list John Smith as a `foaf:person` with whom I have a `foaf:knows` relationship, I also provide a `rdfs:seeAlso` element that points to John Smith’s FOAF document hosted on his homepage. Because I have provided this link, any program reading my FOAF document could find out more about John Smith by following the link and reading his FOAF document. In the FOAF document we have for John Smith above, John did not provide any information about his friends (including me, meaning, tragically, that our friendship is unidirectional). But if he had, then the program reading my document could find out not only about me but also about John, his friends, their friends, and so on, until the program has crawled the whole social graph that John and I inhabit. + +This functionality will seem familiar to anyone that has used Facebook, which is to say that this functionality will seem familiar to you. There is no `foaf:wall` property or `foaf:poke` property to replicate Facebook’s feature set exactly. Obviously, there is also no slick blue user interface that everyone can use to visualize their FOAF social network; FOAF is just a vocabulary. But Facebook’s core feature—the feature that I have argued is key to Facebook’s monopoly power over, at the very least, myself—is here provided in a distributed way. FOAF allows a group of friends to represent their real-life social graph digitally by hosting FOAF documents on their own homepages. It allows them to do this without surrendering control of their data to a centralized database in the sky run by a billionaire android-man who spends much of his time apologizing before congressional committees. + +### FOAF on Ice + +If you visit the current FOAF project homepage, you will notice that, in the top right corner, there is an image of the character Fry from the TV series Futurama, stuck inside some sort of stasis chamber. This is a still from the pilot episode of Futurama, in which Fry gets frozen in a cryogenic tank in 1999 only to awake a millennium later in 2999. Brickley, whom I messaged briefly on Twitter, told me that he put that image there as a way communicating that the FOAF project is currently “in stasis,” though he hopes that there will be a future opportunity to resuscitate the project along with its early 2000s optimism about how the web should work. + +FOAF never revolutionized social networking the way that the 2004 Guardian article about it expected it would. Some social networking sites decided to support the standard: LiveJournal and MyOpera are examples.[6][11] FOAF even played a role in Howard Dean’s presidential campaign in 2004—a group of bloggers and programmers got together to create a network of websites they called “DeanSpace” to promote the campaign, and these sites used FOAF to keep track of supporters and volunteers.[7][12] But today FOAF is known primarily for being one of the more widely used vocabularies of RDF, itself a niche standard on the modern web. If FOAF is part of your experience of the web today at all, then it is as an ancestor to the technology that powers Google’s “knowledge panels” (the little sidebars that tell you the basics about a person or a thing if you searched for something simple). Google uses vocabularies published by the schema.org project—the modern heir to the Semantic Web effort—to populate its knowledge panels.[8][13] The schema.org vocabulary for describing people seems to be somewhat inspired by FOAF and serves many of the same purposes. + +So why didn’t FOAF succeed? Why do we all use Facebook now instead? Let’s ignore that FOAF is a simple standard with nowhere near as many features as Facebook—that’s true today, clearly, but if FOAF had enjoyed more momentum it’s possible that applications could have been built on top of it to deliver a Facebook-like experience. The interesting question is: Why didn’t this nascent form of distributed social networking catch fire when Facebook was not yet around to compete with it? + +There probably is no single answer to that question, but if I had to pick one, I think the biggest issue is that FOAF only makes sense on a web where everyone has a personal website. In the late 1990s and early 2000s, it might have been easy to assume the web would eventually look like this, especially since so many of the web’s early adopters were, as far as I can tell, prolific bloggers or politically engaged technologists excited to have a platform. But the reality is that regular people don’t want to have to learn how to host a website. FOAF allows you to control your own social information and broadcast it to social networks instead of filling out endless web forms, which sounds pretty great if you already have somewhere to host that information. But most people in practice found it easier to just fill out the web form and sign up for Facebook than to figure out how to buy a domain and host some XML. + +What does this mean for my original question about whether or not Facebook’s monopoly is a natural one? I think I have to concede that the FOAF example is evidence that social networking _does_ naturally lend itself to monopoly. + +That people did not want to host their own data isn’t especially meaningful itself—modern distributed social networks like [Mastodon][14] have solved that problem by letting regular users host their profiles on nodes set up by more savvy users. It is a sign, however, of just how much people hate complexity. This is bad news for decentralized social networks, because they are inherently more complex under the hood than centralized networks in a way that is often impossible to hide from users. + +Consider FOAF: If I were to write an application that read FOAF data from personal websites, what would I do if Sally’s FOAF document mentions a John Smith with a homepage at `example.com`, and Sue’s FOAF document mentions a John Smith with a homepage at `example.net`? Are we talking about a single John Smith with two websites or two entirely different John Smiths? What if the both FOAF documents list John Smith’s email as `johnsmith@gmail.com`? This issue of identity was an acute one for FOAF. In a 2003 email, Brickley wrote that because there does not exist and probably should not exist a “planet-wide system for identifying people,” the approach taken by FOAF is “pluralistic.”[9][15] Some properties of FOAF people, such as email addresses and homepage addresses, are special in that their values are globally unique. So these different properties can be used to merge (or, as Libby Miller called it, “smoosh”) FOAF documents about people together. But none of these special properties are privileged above the others, so it’s not obvious how to handle our John Smith case. Do we trust the homepages and conclude we have two different people? Or do we trust the email addresses and conclude we have a single person? Could I really write an application capable of resolving this conflict without involving (and inconveniencing) the user? + +Facebook, with its single database and lack of political qualms, could create a “planet-wide system for identifying people” and so just gave every person a unique Facebook ID. Problem solved. + +Complexity alone might not doom distributed social networks if people cared about being able to own and control their data. But FOAF’s failure to take off demonstrates that people have never valued control very highly. As one blogger has put it, “‘Users want to own their own data’ is an ideology, not a use case.”[10][16] If users do not value control enough to stomach additional complexity, and if centralized systems are more simple than distributed ones—and if, further, centralized systems tend to be closed and thus the successful ones enjoy powerful network effects—then social networks are indeed natural monopolies. + +That said, I think there is still a distinction to be drawn between the subway system case and the social networking case. I am comfortable with the MTA’s monopoly on subway travel because I expect subway systems to be natural monopolies for a long time to come. If there is going to be only one operator of the New York City Subway, then it ought to be the government, which is at least nominally more accountable than a private company with no competitors. But I do not expect social networks to stay natural monopolies. The Subway is carved in granite; the digital world is writ in water. Distributed social networks may now be more complicated than centralized networks in the same way that carrying two MetroCards is more complicated than carrying one. In the future, though, the web, or even the internet, could change in fundamental ways that make distributed technology much easier to use. + +If that happens, perhaps FOAF will be remembered as the first attempt to build the kind of social network that humanity, after a brief experiment with corporate mega-databases, does and always will prefer. + +_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][17] on Twitter or subscribe to the [RSS feed][18] to make sure you know when a new post is out._ + +_Previously on TwoBitHistory…_ + +> I know it's been too long since my last post, but my new one is here! I wrote almost 5000 words on John Carmack, Doom, and the history of the binary space partitioning tree. +> +> — TwoBitHistory (@TwoBitHistory) [November 6, 2019][19] + + 1. Please note that I did not dare say “dead.” [↩︎][20] + + 2. Jack Schofield, “Let’s be Friendsters,” The Guardian, February 19, 2004, accessed January 5, 2020, . [↩︎][21] + + 3. Dan Brickley and Libby Miller, “Introducing FOAF,” FOAF Project, 2008, accessed January 5, 2020, . [↩︎][22] + + 4. ibid. [↩︎][23] + + 5. Wikipedia contributors, “JSON-LD,” Wikipedia: The Free Encyclopedia, December 13, 2019, accessed January 5, 2020, . [↩︎][24] + + 6. “Data Sources,” FOAF Project Wiki, December 11 2009, accessed January 5, 2020, . [↩︎][25] + + 7. Aldon Hynes, “What is Dean Space?”, Extreme Democracy, accessed January 5, 2020, . [↩︎][26] + + 8. “Understand how structured data works,” Google Developer Portal, accessed January 5, 2020, . [↩︎][27] + + 9. tef, “Why your distributed network will not work,” Progamming is Terrible, January 2, 2013, . [↩︎][28] + + 10. Dan Brickley, “Identifying things in FOAF,” rdfweb-dev Mailing List, July 10, 2003, accessed on January 5, 2020, . [↩︎][29] + + + + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2020/01/05/foaf.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: tmp.k5HszJyQ4D#fn:1 +[2]: https://en.wikipedia.org/wiki/Fediverse +[3]: https://en.wikipedia.org/wiki/Prodigy_(online_service) +[4]: https://twobithistory.org/2018/05/27/semantic-web.html +[5]: https://www.ftrain.com/google_takes_all +[6]: tmp.k5HszJyQ4D#fn:2 +[7]: tmp.k5HszJyQ4D#fn:3 +[8]: tmp.k5HszJyQ4D#fn:4 +[9]: tmp.k5HszJyQ4D#fn:5 +[10]: http://www.ldodds.com/foaf/foaf-a-matic +[11]: tmp.k5HszJyQ4D#fn:6 +[12]: tmp.k5HszJyQ4D#fn:7 +[13]: tmp.k5HszJyQ4D#fn:8 +[14]: https://en.wikipedia.org/wiki/Mastodon_(software) +[15]: tmp.k5HszJyQ4D#fn:9 +[16]: tmp.k5HszJyQ4D#fn:10 +[17]: https://twitter.com/TwoBitHistory +[18]: https://twobithistory.org/feed.xml +[19]: https://twitter.com/TwoBitHistory/status/1192196764239093760?ref_src=twsrc%5Etfw +[20]: tmp.k5HszJyQ4D#fnref:1 +[21]: tmp.k5HszJyQ4D#fnref:2 +[22]: tmp.k5HszJyQ4D#fnref:3 +[23]: tmp.k5HszJyQ4D#fnref:4 +[24]: tmp.k5HszJyQ4D#fnref:5 +[25]: tmp.k5HszJyQ4D#fnref:6 +[26]: tmp.k5HszJyQ4D#fnref:7 +[27]: tmp.k5HszJyQ4D#fnref:8 +[28]: tmp.k5HszJyQ4D#fnref:9 +[29]: tmp.k5HszJyQ4D#fnref:10 From ff78995b346ce77f6db2b91bf4e1e41626b6ce28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 7 Jan 2020 08:14:14 +0800 Subject: [PATCH 243/430] Translated --- ...n Source Disk Partitioning Tool GParted.md | 116 ------------------ ...n Source Disk Partitioning Tool GParted.md | 116 ++++++++++++++++++ 2 files changed, 116 insertions(+), 116 deletions(-) delete mode 100644 sources/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md create mode 100644 translated/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md diff --git a/sources/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md b/sources/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md deleted file mode 100644 index fe72f5695a..0000000000 --- a/sources/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md +++ /dev/null @@ -1,116 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (App Highlight: Open Source Disk Partitioning Tool GParted) -[#]: via: (https://itsfoss.com/gparted/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -App Highlight: Open Source Disk Partitioning Tool GParted -====== - -_**Brief: GParted is an incredibly popular and free partition editor available for Linux distros. Here, we take a look at what it offers in brief.**_ - -### GParted: A Free & Open-Source GUI-based Partition Manager - -![][1] - -GParted is undoubtedly one of the [best partition managers for Linux][2] out there. The user interface is very simple and gets the job done. - -In some cases, you end up using [GParted][3] to fix or format your USB drive as well. I had a [USB disk which I couldn’t format in Ubuntu][4] using the “Disks” app – this is where GParted came to the rescue. - -So, it is a quite useful tool with a lot of good features. Let me highlight them for you. - -Warning! - -Playing with disk partitioning is a risky task. Don’t do it unless it’s absolutely necessary. Or else, you might just end up wiping the entire disk. - -### Features of GParted - -You can do a lot of things with GParted, ranging from a simple format task to important partitioning tasks. I’ll highlight the key features with some screenshots to help you know more about it before installing it. - -#### Create partition tables - -You can create a new partition table for your new disks or erase the content of your existing disk to modify the partition table. - -![][5] - -You will be able to select msdos, gpt, atari, and a lot more types of partition tables. - -#### Create, move, label, delete & modify partitions - -You can easily create, label, delete or modify the partitions with a bunch of options available within GParted. - -![][6] - -Of course, you will have to be careful about what you want to do. - -The good thing is that GParted makes sure that you do not directly apply any changes – it queues up your selected operations/tasks and asks for another final confirmation before you hit it. - -The tick mark symbol ✓on the top allows you to confirm the changes and then only your changes take into effect. - -Here’s another screenshot for the options you have available for the partitions: - -![][7] - -#### Attempt data rescue - -Apart from editing partitions, you can also try to [recover your lost data in Linux][8] using the “**Attempt Data Rescue**” feature as shown in the screenshot below. - -![][9] - -It is worth noting that you do not have this feature installed by default – you only see the option visible. So, for the data recovery feature to work, you have to install gpart separately using the following command (on Ubuntu/Debian-based distributions): - -``` -sudo apt install gpart -``` - -In addition to all the key features, it supports a wide range of storage devices and filesystems. You can learn more about it from the [list of features][10] on their official website. - -### Installing GParted on Ubuntu and other Linux distributions - -You might have GParted pre-installed. So, make sure to verify that. If you do not have it installed, you can head into the software center to get it installed. - -In case you want to use the terminal, simply type in the following command: - -``` -sudo apt install gparted -``` - -As I mentioned above, if you want the data recovery option, you should install gpart package in addition to gparted package. - -If you’re using any other Linux distribution, you can either find it in the respective software manager or simply check out the [official download instructions][11]. - -[Download GParted][11] - -**Wrapping Up** - -GParted is a very useful and important tool when it comes to dealing with disk management and partitions. However, you will have to be careful while using it for the obvious reasons. - -Have you tried GParted? Which other partitioning tool you use on Linux? Feel free to share your experiences in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/gparted/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/gparted-screenshot.png?ssl=1 -[2]: https://itsfoss.com/partition-managers-linux/ -[3]: https://gparted.org/ -[4]: https://itsfoss.com/format-usb-drive-sd-card-ubuntu/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/gparted-create-partition-table.png?ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/gparted-modify-partitions.png?ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/gparted-partition-options.png?ssl=1 -[8]: https://itsfoss.com/recover-deleted-files-linux/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/gparted-attempt-data-rescue-feature.png?ssl=1 -[10]: https://gparted.org/features.php -[11]: https://gparted.org/download.php diff --git a/translated/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md b/translated/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md new file mode 100644 index 0000000000..6fa07d80a3 --- /dev/null +++ b/translated/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md @@ -0,0 +1,116 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (App Highlight: Open Source Disk Partitioning Tool GParted) +[#]: via: (https://itsfoss.com/gparted/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +应用程序推荐:开源磁盘分区工具 GParted +====== + +_**摘要:GParted 是一个非常流行的自由的可用于 Linux 发行版的分区编辑器。在这里,我们简单地看看它提供了什么。**_ + +### GParted:一个基于自由和开放源码的图形化分区管理器 + +![][1] + +GParted 无疑是[在 Linux 下的最好的分区管理器][2]之一。用户界面非常简单,可用完成任务。 + +在一些情况下,你最终也需要使用 [GParted][3] 来修复或格式化你的 USB 驱动器。我有一个[我不能在 Ubuntu 中格式化的 USB 磁盘][4],使用该“磁盘”应用程序 – 这里是 GParted 用来救援的地方。 + +所以,它是非常有用的工具,有很多好的特色。让我为你们推荐一下。 + +警告! + +玩弄磁盘分区是一件危险的工作。除非绝对必要,否则不要做。否则,你可能最终会擦除整个磁盘。 + +### GParted 的特色 + +你可以使用 GParted 做很多事,排列一下简单地格式化任务到重要的分区任务。我将使用一些屏幕截图推荐关键特色,以帮助你在安装它前了解更多信息。 + +#### 创建分区表 + +你可以为你的新的磁盘创建一个新的分区表,或者擦除你现存的磁盘内容来修改分区表。 + +![][5] + +你将能够选择 msdos ,gpt ,atari ,以及更多类型的分区表。 + +#### 创建,移动,标记,删除和修改分区表 + +你可以使用 GParted 中一系列可用的选项来简单地创建,标记,删除或修改分区表。 + +![][6] + +当然,你将不得不小心你想做什么。 + +好的一些东西是,GParted 确保你不能直接应用任何更改 – 在你点击应用更改之前,它将排队你选择的操作/任务,并询问另外一处最后的确认。 + +在顶部的对号标记符号 ✓ 允许你来确认更改,只有你更改时开始生效。 + +这样有另一个你可用的分区选项的屏幕截图: + +![][7] + +#### 尝试数据救援 + +除了编辑分区,你也可以尝试使用“**尝试数据救援**”特色以[在Linux 中恢复你丢失的数据][8],像下面的屏幕截图所示。 + +![][9] + +值得注意的是,默认情况下你没有安装这个功能 – 你仅能看到可见的选项。所以,对于数据恢复特色作业来说,你必需使用下面的命令来单独地安装 gpart (在基于 Ubuntu/Debian 的发行版上): + +``` +sudo apt install gpart +``` + +除了所有关键的特色外,它支持大量的存储设备和文件系统。在它们的官方网站上,你可以从[特色列表][10]中学到很多。 + +### 在 Ubuntu 和其它 Linux 发行版上安装 GParted + +你可能已经预先安装 GParted 。所以,务必核实一下。如果你没有安装它,你可以前往进入软件中心安装它。 + +以备你想使用终端,简单地键入下面的命令: + +``` +sudo apt install gparted +``` + +像我如上所述,如果你想要数据恢复选项,除了 gparted 软件包外,你应该安装 gpart 软件包。 + +如果你正在使用一些其它 Linux 发行版,你可以在各自的软件管理器中找到它,或者简单地查看[官方下载操作指南][11]。 + +[下载 GParted][11] + +**总结** + +当涉及处理磁盘管理和分区时,GParted 是一个非常有用和重要的工具。但是,因为显而易见的原因,当你使用它时,你将不得不小心。 + +你尝试过 GParted 吗?你在 Linux 上使用的其它分区工具是什么?请在下面的评论中分享你的体验。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gparted/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/gparted-screenshot.png?ssl=1 +[2]: https://itsfoss.com/partition-managers-linux/ +[3]: https://gparted.org/ +[4]: https://itsfoss.com/format-usb-drive-sd-card-ubuntu/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/gparted-create-partition-table.png?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/gparted-modify-partitions.png?ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/gparted-partition-options.png?ssl=1 +[8]: https://itsfoss.com/recover-deleted-files-linux/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/gparted-attempt-data-rescue-feature.png?ssl=1 +[10]: https://gparted.org/features.php +[11]: https://gparted.org/download.php From e2970c5d5149b477378c48886ab4c41dacaa6ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 7 Jan 2020 08:25:42 +0800 Subject: [PATCH 244/430] Translating --- sources/tech/20191121 Simulate gravity in your Python game.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191121 Simulate gravity in your Python game.md b/sources/tech/20191121 Simulate gravity in your Python game.md index 977c234d8d..45e4b4ce50 100644 --- a/sources/tech/20191121 Simulate gravity in your Python game.md +++ b/sources/tech/20191121 Simulate gravity in your Python game.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1f3269c9014cacb7cab002a2ffe3ffd69ec976e6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 7 Jan 2020 08:44:15 +0800 Subject: [PATCH 245/430] translated --- ...et- Screen Recorder. Here-s How to Use it.md | 103 ----------------- ...et- Screen Recorder. Here-s How to Use it.md | 104 ++++++++++++++++++ 2 files changed, 104 insertions(+), 103 deletions(-) delete mode 100644 sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md create mode 100644 translated/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md diff --git a/sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md b/sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md deleted file mode 100644 index f761c28dd1..0000000000 --- a/sources/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md +++ /dev/null @@ -1,103 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (GNOME has a ‘Secret’ Screen Recorder. Here’s How to Use it!) -[#]: via: (https://itsfoss.com/gnome-screen-recorder/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -GNOME has a ‘Secret’ Screen Recorder. Here’s How to Use it! -====== - -[GNOME][1] is one of the [most popular desktop environments][2] and for good reasons. It has a modern UI and it comes with a number of GNOME-specific applications that blend well with the overall desktop appearance. - -You can [tweak GNOME][3] to your liking as much as you want but I am not here to discuss that. GNOME desktop has some hidden features that you probably are not aware of. - -One of such not-so-obvious feature is a built in screen recorder. - -Yes, you read that right. If you are using GNOME desktop, you don’t necessarily need to install other [screen recorders in Linux][4]. You just need to know the correct keyboard shortcut. - -### Instantly record your screen with GNOME Screen Recorder - -To quickly access the GNOME screen recorder, you have to press this [keyboard shortcut in Ubuntu][5] or other distributions using GNOME desktop: - -``` -Ctrl + Alt + Shift + R -``` - -This will immediately start recording your desktop. You can tell that the screen recording is in progress by looking at the red dot in the system tray area of the top panel: - -![The red dot in the system tray area indicates that screen recording is in progress][6] - -#### Increase the screencast duration - -The default maximum record time is just 30 seconds. It can be increased though. - -Open a terminal and use the following command: - -``` -gsettings set org.gnome.settings-daemon.plugins.media-keys max-screencast-length 300 -``` - -In the above command, I have increased the maximum length of the recording to 300 seconds (i.e. 5 minutes). You can change it to any other value but it should be in seconds. - -If you **don’t want any limit on the maximum recording time, set it to 0** and then the recording won’t stop until you manually stop it or your disk runs out of space. - -#### Stop the screen recording - -As I mentioned, your desktop recording will stop automatically after it reaches the maximum time limit. - -To stop the recording before that, you can press the same key combination: - -``` -Ctrl + Alt + Shift + R -``` - -Your recordings are saved in [webm][7] format in the Videos folder of your Home directory. - -#### Limitations - -While it might be handy to record your desktop quickly with this handy little tool, it has its several limitations when compared to a full-fledged screen recording tool like [Simple Screen Recorder][8]. - - * There is no time delay option before the recording starts - * There is no pause and play option - * It records the entire screen. No option to record only an application window or a ceratin area or a certain monitor (if you have a multi-monitor setup). - * Videos are saved in webm format in the user’s Videos directory. You cannot change it. You’ll have to use a tool like [HandBrake to convert the videos to other format][9]. - - - -As you can see, the secret GNOME screen recorder is no where near to the features provided by the likes of [Kazam][10] or other such tools. - -But it doesn’t try to be a full-fledged screen recorder. It just provides you a quick way of recording a small screencast. That’s it. - -GNOME is a versatile modern desktop environments. You can [tweak GNOME][3] extensively. The [GNOME Extensions][11] provide another dimension to the desktop customization. - -This screen recorder is one of the hidden features of GNOME like the suspend option that you won’t easily find on your own. - -_How do you like it? Do you know some other hidden GNOME features that you would like to share with us? The comment section is all yours._ - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/gnome-screen-recorder/ - -作者:[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://gnome.org/ -[2]: https://itsfoss.com/best-linux-desktop-environments/ -[3]: https://itsfoss.com/gnome-tweak-tool/ -[4]: https://itsfoss.com/best-linux-screen-recorders/ -[5]: https://itsfoss.com/ubuntu-shortcuts/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/gnome_screen_recording.jpg?ssl=1 -[7]: https://www.webmproject.org/about/ -[8]: https://itsfoss.com/record-screen-ubuntu-simplescreenrecorder/ -[9]: https://itsfoss.com/handbrake/ -[10]: https://itsfoss.com/kazam-screen-recorder/ -[11]: https://itsfoss.com/best-gnome-extensions/ diff --git a/translated/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md b/translated/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md new file mode 100644 index 0000000000..84d72051eb --- /dev/null +++ b/translated/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (GNOME has a ‘Secret’ Screen Recorder. Here’s How to Use it!) +[#]: via: (https://itsfoss.com/gnome-screen-recorder/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +GNOME 有一个“秘密”的屏幕录像机。下面是使用方法! +====== + +[GNOME][1]是[最受欢迎的桌面环境][2]之一。它有现代的 UI,并且带有许多特定于 GNOME 的应用,这些应用与桌面整体外观完美融合。 + +你可以根据自己的喜好来[调整 GNOME][3],但我不在这里讨论。GNOME 桌面有一些你可能不知道的隐藏功能。 + +这种不太明显的功能之一是内置的屏幕录像机。 + +是的,你没有看错。如果你使用的是 GNOME 桌面,那么不必安装其他的 [Linux 屏幕录像机][4]。你只需要知道正确的快捷键即可。 + +### 立即使用 GNOME 屏幕录像机录制屏幕 + +要快速打开 GNOME 屏幕录像机,你需要[在 Ubuntu 或其他带有 GNOME 桌面的发行版中按下此快捷键][5]: + +``` +Ctrl + Alt + Shift + R +``` + +这将会立即开始录制你的桌面。你可以通过顶部的系统托盘区域的红点了解到正在录制: + +![The red dot in the system tray area indicates that screen recording is in progress][6] + +#### 增加录制时间 + +默认的最大录制时间仅为 30 秒。但是可以增加。 + +打开终端并使用以下命令: + +``` +gsettings set org.gnome.settings-daemon.plugins.media-keys max-screencast-length 300 +``` + +在上面的命令中,我将录音的最大长度增加到 300 秒(即5分钟)。你可以将其更改为任何其他值,但应以秒为单位。 + +如果你**不希望最长录音时间有任何限制,请将其设置为0**,之后它会在你手动停止或者磁盘空间不足才会停止。 + +#### 停止屏幕录制 + +如前所述,你的桌面录制将在达到最大时间限制后自动停止。 + +要在此之前停止录制,你可以按下相同的组合键: + +``` +Ctrl + Alt + Shift + R +``` + +你的录制内容将以 [webm][7 ]格式保存在家目录的 “Videos” 文件夹中。 + +#### 局限性 + +尽管使用这个小工具可以方便地快速录制桌面,但是与功能强大的 [Simple Screen Recorder][8] 这样的屏幕录制工具相比,它有一些局限性。 + + + * 录制开始之前没有时间延迟选项 +  * 没有暂停和播放选项 +  * 它录制整个屏幕。无法仅录制应用窗口、特定区域或特定屏幕(如果你有多个屏幕)。 +  * 视频以 webm 格式保存在用户的 “Videos” 目录中。你无法更改。你必须使用 [HandBrake 之类的工具将视频转换为其他格式][9]。 + + + +如你所见,秘密的 GNOME 屏幕录像机与 [Kazam][10] 之类的工具或其他此类工具所提供的功能相差很远。 + +但是,它并不会尝试成为全功能的屏幕录像机。它只是为你提供录制屏幕的快速方法。 + +GNOME 是一个多功能的现代桌面环境。你可以大量地[调整 GNOME][3]。[GNOME 扩展][11]为桌面自定义提供了另一个维度。 + +该屏幕录像机是 GNOME 的隐藏功能之一,就像你自己很难轻易找到的挂起选项。 + +_你喜欢它吗?你是否还想与我们分享其他隐藏的 GNOME 功能?请在评论区留言。_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gnome-screen-recorder/ + +作者:[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://gnome.org/ +[2]: https://itsfoss.com/best-linux-desktop-environments/ +[3]: https://itsfoss.com/gnome-tweak-tool/ +[4]: https://itsfoss.com/best-linux-screen-recorders/ +[5]: https://itsfoss.com/ubuntu-shortcuts/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/gnome_screen_recording.jpg?ssl=1 +[7]: https://www.webmproject.org/about/ +[8]: https://itsfoss.com/record-screen-ubuntu-simplescreenrecorder/ +[9]: https://itsfoss.com/handbrake/ +[10]: https://itsfoss.com/kazam-screen-recorder/ +[11]: https://itsfoss.com/best-gnome-extensions/ From 83fab6c4a597314ba0e57516a697b2b45cbfb722 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 7 Jan 2020 08:54:37 +0800 Subject: [PATCH 246/430] translating --- ...200103 My Raspberry Pi retrospective- 6 projects and more.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md b/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md index b68e15a924..181276fb45 100644 --- a/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md +++ b/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 98fade2a5db741a607d63a5ccee3a42983da5195 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Jan 2020 09:00:12 +0800 Subject: [PATCH 247/430] TSL --- ...191130 7 maker gifts for kids and teens.md | 185 ------------------ ...191130 7 maker gifts for kids and teens.md | 176 +++++++++++++++++ 2 files changed, 176 insertions(+), 185 deletions(-) delete mode 100644 sources/tech/20191130 7 maker gifts for kids and teens.md create mode 100644 translated/tech/20191130 7 maker gifts for kids and teens.md diff --git a/sources/tech/20191130 7 maker gifts for kids and teens.md b/sources/tech/20191130 7 maker gifts for kids and teens.md deleted file mode 100644 index 72a9debb38..0000000000 --- a/sources/tech/20191130 7 maker gifts for kids and teens.md +++ /dev/null @@ -1,185 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (7 maker gifts for kids and teens) -[#]: via: (https://opensource.com/article/19/11/maker-gifts-kids) -[#]: author: (Jess Weichler https://opensource.com/users/cyanide-cupcake) - -7 maker gifts for kids and teens -====== -Make your holiday gift shopping easy with this guide to gifts sure to -spark creativity and innovation in babies, kids, tweens, teens, and -beyond. -![Gift box opens with colors coming out][1] - -Struggling with what gifts to give the young person in your life this holiday season? Here are my top picks for open source presents that will spark creativity and inspire for years to come. - -### Hummingbird Robotics Kit - -![Hummingbird Robotics Kit][2] - -**Ages**: 8 to adult - -**What it is:** The [Hummingbird Robotics Kit][3] is a complete robotics kit with a microcontroller, motors, LEDs, and sensors. The robot brain has special ports that little hands can easily attach robot components to. The Hummingbird kits don't come with a body, empowering users to create their own. - -**Why I love it:** The Hummingbird works with multiple programming languages—from visual (BirdBlox, MakeCode, Snap) to text (Python and Java)— making it scalable as users' coding skills increase. All the components are exactly as you'd find them at an electronics store, not obscured by plastic like other robot kits. This demystifies the inner workings of robots and makes it easy to source more parts if needed. - -Because there is no set project, the Hummingbird is the perfect robot for creativity. - -The Hummingbird Bit has open source software and firmware. It works on Linux, Windows, Mac, Chromebook, Android, and iOS. - -**Cost:** Starts at US$ 99. - -### Makey Makey Classic - -![Makey Makey Classic][4] - -**Ages:** 6 to adult - -**What it is:** [Makey Makey Classic][5] turns any conductive object, from marshmallows to a friend, into a computer key. - -You use alligator clips to connect the Makey Makey to the conductive object of your choice. Then, you close the circuit between the ground connection and any trigger key by touching both conductive objects at the same time. The Makey Makey is a good way to safely explore electricity at home while creating interesting ways to interact with your computer. - -**Why I love it:** Makey Makey can be paired with video games made in Scratch to create unique controllers that further immerse users in the game. The possibilities are endless, from instruments made of toilet rolls and foil to interactive art and stories. It works on Linux, Windows, and Mac computers with a USB port. - -**Cost:** US$ 49.95 - -### Arduino Uno - -![Arduino Uno][6] - -**Ages**: 10 to adult - -**What it is:** Arduinos are microcontrollers that can be purchased with or without an electronics kit, and they come in many different flavors, though I like the [Arduino Uno][7] the best. Additional components, such as LEDs, motors, and sensors can be purchased as needed from any electronics shop. - -**Why I love it:** The Arduino Uno is well-documented, so it's easy for makers to find tutorials online. The Arduino can bring a wide variety of electronic projects to life, from simple to complex. The Arduino features open source firmware and hardware. It works on Linux, Mac, and Windows. - -**Cost:** Starts at US$ 22.00 for the board. The overall cost varies depending on projects and skill level. - -### DIY maker kit - -![A maker kit assembled in a quick trip to the hardware store][8] - -**Ages**: 8 to adult - -**What it is:** Many of today's makers, creators, and programmers started out tinkering with objects that happened to be lying around. You can create an awesome maker kit for the young person in your life with a quick trip to the nearest electronics store. Here's what's in my maker kit: - - * Eye goggles - * Hammer - * Nails and screws - * Scraps of wood - * Screwdrivers - * Wire - * LEDs - * Piezo buzzer - * Motors - * AA battery pack with leads - * Wire cutters - * Cardboard - * Masking tape - * Scrap fabric - * Buttons - * Thread - * Needles - * Zippers - * Hooks - * A cool tackle box to store everything in - - - -**Why I love it: **Remember when you were a kid and your parents brought home an empty cardboard box that you turned into a spaceship or a house or a supercomputer? That's what a DIY maker kit can be for older kids. - -Raw components empower kids to experiment and use their imaginations. A DIY maker kit can be completely customized for the recipient. Be sure to throw in some components the giftee may have never thought to create with, like giving an avid sewer some LEDs or a woodworker fabric. - -**Cost:** Variable - -### Heuristic play basket - -![Heuristic play kit][9] - -**Ages:** 8 months to 5 years - -**What it is:** Heuristic play baskets are filled with interesting objects made from natural, non-toxic materials for infants and toddlers to explore using their five senses. It's open-ended, self-directed play at its best. The idea is that an adult will supervise (but not direct) a child's use of the basket and its items for a half-hour, then put the basket away until the next time. - -It's easy to create a lovely play basket with common household objects. Try to include items with varying textures, sounds, smells, shapes, and weights. Here are some ideas to get you started. - - * Colander or ridged wicker basket to hold everything - * Wooden spoon - * Metal whisks and spoons - * Scrubbing brush - * Sponge - * Small egg carton - * Cardboard tubes - * Small rolling pin - * Textured washcloth - * Rocks - * Handbells - * Crochet doily - * Small tin with a lid - - - -Play baskets should not include anything easily breakable or small enough to fit inside a paper towel roll, as these are choking hazards, and all objects should be cleaned thoroughly before being given to a child. - -**Why I love it:** Play baskets are fantastic for sensory development and helping young children ask questions and explore the world around them. This is an important part of developing a maker mindset! - -It's easy to obtain suitable items for a play basket; you probably already have many interesting objects in your home or at your nearest second-hand store. Toddlers will use their play baskets differently than infants. These objects will grow with children as they begin to mimic adult life and tell stories through their play. - -**Cost:** Variable - -### Hello Ruby - -![Hello Ruby book cover][10] - -**Ages**: 5–8 - -**What it is:** _[Hello Ruby][11]: Adventures in Coding_ is an illustrated book by Linda Liukas that introduces children to programming concepts through a fun narrative about a girl who encounters problems and friends, each of which represents code. Liukas' other _Hello Ruby_ books are subtitled _Expedition to the Internet_ and _Journey Inside the Computer_, and _Adventures in Coding_ has been published in more than 20 languages. - -**Why I love it:** The author accompanies the book with a number of free, fun, and unplugged activities that can be downloaded and printed out from the Hello Ruby website. These activities teach coding concepts and also touch on artistic expression, communication, and even time management. - -**Cost:** List price for the hardcover book is US$ 17.99, but you may find it at a lower price through local or online booksellers. - -### Girls Who Code: Learn to Code and Change the World - -![Girls Who Code book cover][12] - -**Ages**: 10 to adult - -**What it is:** Written by Reshma Saujani, the founder of Girls Who Code, _[Girls Who Code: Learn to Code and Change the World][13]_ gives practical information about the tech world for young girls (and boys). It covers a wide variety of topics, including coding languages, use-cases, terminology and vocabulary, career options, and profiles and interviews with people in the tech industry. - -**Why I love it:** This book tells the story of tech in ways even most websites meant for adults miss out on. Technology encompasses so many disciplines, and it's important for young people to understand they can use it to solve real-world problems and make a difference. - -**Cost:** List price for the hardcover book is US$ 17.99 and US$ 10.99 for the paperback, but you may find it at a lower price through local or online booksellers. - -I can see the brightness of curiosity in my six year old niece Shuchi's eyes when she explores a... - -Scratch is a free educational programming language for kids, available in 50 different languages... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/11/maker-gifts-kids - -作者:[Jess Weichler][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/cyanide-cupcake -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_gift_giveaway_box_520x292.png?itok=w1YQhNH1 (Gift box opens with colors coming out) -[2]: https://opensource.com/sites/default/files/uploads/hummingbird.png (Hummingbird Robotics Kit) -[3]: https://www.birdbraintechnologies.com/hummingbirdbit/ -[4]: https://opensource.com/sites/default/files/uploads/makeymakey2.jpg (Makey Makey Classic) -[5]: https://makeymakey.com/ -[6]: https://opensource.com/sites/default/files/uploads/arduinouno.jpg (Arduino Uno) -[7]: https://www.arduino.cc/ -[8]: https://opensource.com/sites/default/files/makerbox-makerkit.jpg (A maker kit assembled in a quick trip to the hardware store) -[9]: https://opensource.com/sites/default/files/makerbox-sensorykit.jpg (Heuristic play kit) -[10]: https://opensource.com/sites/default/files/uploads/helloruby2.jpg (Hello Ruby book cover) -[11]: https://www.helloruby.com/ -[12]: https://opensource.com/sites/default/files/uploads/girlswhocodebook.jpg (Girls Who Code book cover) -[13]: https://girlswhocode.com/book/girls-code-learn-code-change-world/ diff --git a/translated/tech/20191130 7 maker gifts for kids and teens.md b/translated/tech/20191130 7 maker gifts for kids and teens.md new file mode 100644 index 0000000000..59bc3fc837 --- /dev/null +++ b/translated/tech/20191130 7 maker gifts for kids and teens.md @@ -0,0 +1,176 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 maker gifts for kids and teens) +[#]: via: (https://opensource.com/article/19/11/maker-gifts-kids) +[#]: author: (Jess Weichler https://opensource.com/users/cyanide-cupcake) + +7 个给儿童和少年的创客礼物 +====== +> 这份礼物指南可给婴儿、儿童、青少年及年龄更大的人们带来创造和创新能力,使你轻松完成节日礼物的采购。 + +![Gift box opens with colors coming out][1] + +还在纠结这个假期给年轻人买什么礼物?这是我精选的开源礼物,这些礼物将激发未来的创意和灵感。 + +### 蜂鸟机器人套件 + +![Hummingbird Robotics Kit][2] + +**年龄:**8 岁 - 成人 + +**这是什么:**[蜂鸟机器人套件][3]是一套完整的机器人套件,带有微控制器、电机、LED 和传感器。机器人的大脑具有特殊的端口,小手可以轻松地将其连接到机器人的组件上。蜂鸟套件并没有身体,鼓励用户自己创建一个。 + +**为什么我喜欢它:**蜂鸟可以使用多种编程语言 —— 从可视化编程(BirdBlox、MakeCode、Snap)到代码编程(Python 和 Java)—— 可以随着用户编码技能的提高而可扩展。所有组件均与你在电子商店中找到的组件完全相同,没有像其他机器人套件那样被塑料所遮盖。这使机器人的内部工作不再神秘,并在你需要时易于采购更多零件。 + +由于没有固定组合项目,因此蜂鸟是发挥创造力的完美机器人。 + +蜂鸟具有开源的软件和固件。它适用于 Linux、Windows、Mac、Chromebook、Android 和 iOS。 + +**费用:**起价为 99 美元。 + +### Makey Makey 经典版 + +![Makey Makey Classic][4] + +**年龄:** 6岁 - 成人 + +**这是什么:** [Makey Makey 经典版][5]可将任何导电物体(从棉花糖到朋友)变成计算机钥匙。 + +你可以使用鳄鱼夹将 Makey Makey 连接到你选择的导电物体上。然后,通过同时触摸两个导电物体来闭合接地和任何触发键之间的电路。Makey Makey 是一种安全的方法,可以安全地在家中探索电力,同时创造与计算机进行交互的有趣方式。 + +**为什么我喜欢它:** Makey Makey 可以与 Scratch 开发的视频游戏搭配使用,以创建独特的控制器,使用户进一步沉浸在游戏中。从用卫生纸卷和铝箔制成的工具到互动艺术和故事,可能性是无限的。它可以在具有 USB 端口的 Linux、Windows 和 Mac 计算机上使用。 + +**费用:** 49.95 美金 + +### Arduino Uno + +![Arduino Uno][6] + +**年龄:** 10 岁 - 成人 + +**这是什么:** Arduino 是随同电子套件购买的微控制器,也可以单独购买,它们具有多种版本,尽管我最喜欢[Arduino Uno][7]。可以根据需要从任何电子商店购买其他组件,例如 LED、电机和传感器。 + +**为什么我喜欢它:** Arduino Uno 的文档很完善,因此创客们很容易在线上找到教程。Arduino 可以实现从简单到复杂的各种电子项目。Arduino 具有开源的固件和硬件。它适用于 Linux、Mac 和 Windows。 + +**费用:**主板的起价为 22.00 美元。总成本取决于项目和技能水平。 + +### DIY 创客套件 + +![A maker kit assembled in a quick trip to the hardware store][8] + +**年龄**:8 岁 - 成人 + +**这是什么:**当今许多创客、发明家和程序员都是从碰巧修补附加的东西开始的。你可以快速前往最近的电子产品商店,为家里的年轻人创建一套出色的创客工具包。这是我的创客工具包中的内容: + +* 护目镜 +* 锤子 +* 钉子和螺丝 +* 碎木 +* 螺丝起子 +* 电线 +* LED +* 压电蜂鸣器 +* 马达 +* 带引线的AA电池组 +* 剪线钳 +* 纸板 +* 美纹纸胶带 +* 废布 +* 纽扣 +* 线程 +* 针 +* 拉链 +* 钩子 +* 一个很酷的工具盒,用来存放所有东西 +   +**我为什么喜欢它:**还记得小时候,你把父母带回家的空纸箱变成了宇宙飞船、房屋或超级计算机吗?这就是为大孩子们准备的 DIY 创客工具包。 + +原始的组件使孩子们可以尝试并运用他们的想象力。DIY 创客工具包可以完全针对接收者定制。可以放入一些接受这份礼品的人可能从未想到过用之发挥创意的某些组件,例如为下水道提供一些 LED 或木工结构。 + +**费用:**不等 + +### 启发式游戏篮 + +![Heuristic play kit][9] + +**年龄:** 8 个月至 5 岁 + +**这是什么:**启发式游戏篮充满了由天然、无毒材料制成的有趣物品,可供婴幼儿使用其五种感官进行探索。这是一种开放式、自娱自乐的游戏。其想法是,成年人将监督(但不指导)儿童使用篮子及其物品半小时,然后将篮子拿走下一次再玩。 + +创建带有常见家用物品的可爱游戏篮很容易。尝试包括质地、声音、气味、形状和重量各不相同的物品。这里有一些想法可以帮助您入门。 + +* 漏勺或脊状柳条篮可容纳所有物品 +* 木勺子 +* 金属打蛋器和汤匙 +* 板刷 +* 海绵 +* 小鸡蛋纸箱 +* 纸板管 +* 小擀面杖 +* 带纹理的毛巾 +* 岩石 +* 手铃 +* 钩针桌巾 +* 带盖的小铁罐 +   +游戏篮中不应包括任何容易破碎的东西或足够小到可以装入纸巾卷的东西,因为它们有窒息危险,应将所有物品彻底清洁后再交给孩子。 + +**我为什么喜欢它:**游戏篮非常适合感官发育,并可以帮助幼儿提出问题和探索周围的世界。这是培养创客思维方式的重要组成部分! + +很容易获得适合这个游戏篮的物品。你可能已经在家中或附近的二手店里有很多有趣的物品。幼儿使用游戏篮的方式与婴儿不同。随着孩子开始模仿成人生活并通过他们的游戏讲故事,这些物品将随孩子一起成长。 + +**费用:**不等 + +### 《Hello Ruby》 + +![Hello Ruby book cover][10] + +**年龄**:5-8 岁 + +**这是什么:** 《[Hello Ruby][11]:编码历险记》是 Linda Liukas 的插图书,通过有趣的故事讲述了一个遇到各种问题和朋友(每个都用一个码代表)的女孩,向孩子们介绍了编程概念。Liukas 还有其他副标题为《互联网探险》和《计算机内的旅程》的《Hello Ruby》书籍,而《编码历险记》已以 20 多种语言出版。 + +**为什么我喜欢它:**作者在书中附带了许多免费、有趣和无障碍的活动,可以从 Hello Ruby 网站下载和打印这些活动。这些活动教授编码概念、还涉及艺术表达、沟通、甚至时间安排。 + +**费用:**精装书的标价为 17.99 美元,但你可以通过本地或在线书店以较低的价格买到这本书。 + +### 《编程少女:学会编程和改变世界》 + +![Girls Who Code book cover][12] + +**年龄**:10 岁 - 成人 + +**内容是什么:**由《编程少女》的创始人 Reshma Saujani 撰写,《[编程少女:学会编程和改变世界][13]》为年轻女孩(以及男孩)提供了科技领域的实用信息。它涵盖了广泛的主题,包括编程语言、用例、术语和词汇、职业选择以及技术行业人士的个人简介和访谈。 + +**为什么我喜欢它:**本书以讲述了大多数面向成年人的网站没有的技术故事。技术涉及许多学科,对于年轻人来说,重要的是要了解他们可以使用它来解决现实世界中的问题并有所作为。 + +**成本:**精装书的标价为 17.99 美元,平装书的标价为 10.99 美元,但你可以通过本地或在线书店以更低的价格找到。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/11/maker-gifts-kids + +作者:[Jess Weichler][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cyanide-cupcake +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_gift_giveaway_box_520x292.png?itok=w1YQhNH1 (Gift box opens with colors coming out) +[2]: https://opensource.com/sites/default/files/uploads/hummingbird.png (Hummingbird Robotics Kit) +[3]: https://www.birdbraintechnologies.com/hummingbirdbit/ +[4]: https://opensource.com/sites/default/files/uploads/makeymakey2.jpg (Makey Makey Classic) +[5]: https://makeymakey.com/ +[6]: https://opensource.com/sites/default/files/uploads/arduinouno.jpg (Arduino Uno) +[7]: https://www.arduino.cc/ +[8]: https://opensource.com/sites/default/files/makerbox-makerkit.jpg (A maker kit assembled in a quick trip to the hardware store) +[9]: https://opensource.com/sites/default/files/makerbox-sensorykit.jpg (Heuristic play kit) +[10]: https://opensource.com/sites/default/files/uploads/helloruby2.jpg (Hello Ruby book cover) +[11]: https://www.helloruby.com/ +[12]: https://opensource.com/sites/default/files/uploads/girlswhocodebook.jpg (Girls Who Code book cover) +[13]: https://girlswhocode.com/book/girls-code-learn-code-change-world/ From 0968a3bb4ecea07d8c0c117c8600be79e60e9240 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 7 Jan 2020 09:01:55 +0800 Subject: [PATCH 248/430] Rename sources/tech/20200106 Open Source Supply Chain- A Matter of Trust.md to sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md --- .../20200106 Open Source Supply Chain- A Matter of Trust.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200106 Open Source Supply Chain- A Matter of Trust.md (100%) diff --git a/sources/tech/20200106 Open Source Supply Chain- A Matter of Trust.md b/sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md similarity index 100% rename from sources/tech/20200106 Open Source Supply Chain- A Matter of Trust.md rename to sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md From 1eca447b19eddb900bd0ea73f4f75c11d780f2fa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Jan 2020 09:33:32 +0800 Subject: [PATCH 249/430] PRF @lxbwolf --- ...01 5 predictions for Kubernetes in 2020.md | 59 ++++++++++++------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/translated/tech/20200101 5 predictions for Kubernetes in 2020.md b/translated/tech/20200101 5 predictions for Kubernetes in 2020.md index f760fcfe4a..f87eb41b9f 100644 --- a/translated/tech/20200101 5 predictions for Kubernetes in 2020.md +++ b/translated/tech/20200101 5 predictions for Kubernetes in 2020.md @@ -1,42 +1,49 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 predictions for Kubernetes in 2020) [#]: via: (https://opensource.com/article/20/1/kubernetes-2020) [#]: author: (Scott McCarty https://opensource.com/users/fatherlinux) -2020 年对 Kubernetes 的 5 项预测 +2020 年对 Kubernetes 的 5 个预测 ====== -请先回顾下 2019 年网站上最受欢迎的 Kubernetes 的文章。 + +> 以及,对 2019 年最受欢迎的 Kubernetes 文章的回顾。 + ![Person drinking a hat drink at the computer][1] -你怎么追踪一个广受欢迎的项目(如 Kubernetes)的发展轨迹?你怎么能了解它发展到什么程度了?如果你在为这个项目作贡献或加入了 SIG(Special Interest Group),可能你会在潜移默化中了解到它的发展轨迹,但如果你的全日工作不涉及到为 Kubernetes 作贡献,那么你可能需要一点关于未来的预测来帮助你了解。对于一个诸如 Kubernetes 的快速发展的项目,年末是回顾过去的一年和展望新的一年的最好时机。 +你是怎么追踪一个广受欢迎的项目(如 Kubernetes)的发展轨迹?你是怎么了解它发展到什么程度了?如果你在为这个项目作贡献或加入了特殊兴趣组(SIG),可能你会在潜移默化中了解到它的发展轨迹,但如果你的全日工作不涉及到为 Kubernetes 作贡献,那么你可能需要一点关于未来的预测来帮助你了解。对于一个诸如 Kubernetes 的快速发展的项目,年末是回顾过去的一年和展望新的一年的最好时机。 -今年,Kubernetes 取得了很大的进展。除了去查看源码、文档、会议笔记,你也可以去浏览博客。为了深入了解,我在 Opensource.com 上看了 Kubernetes 的 top 10 文章。通过这些文章,我们能了解开发者们更喜欢读和写哪些话题的文章。我们开始吧! +今年,Kubernetes 取得了很大的进展。除了去查看源码、文档、会议笔记,你也可以去浏览博客。为了深入了解,我在 Opensource.com 上找到了 Kubernetes 排名前十的文章。通过这些文章,我们能了解开发者们更喜欢读和写哪些话题的文章。我们开始吧! -(2019 年末获取 Kubernetes 文章的 top 10。) +- [为什么数据科学家喜欢Kubernetes][13] +- [Kubernetes 机密信息和 ConfigMap 简介][14] +- [怎样在 Kubernetes 上运行 PostgreSQL][15](译文) +- [为什么说 Kubernetes 是一辆翻斗车][16](译文) +- [安全扫描你的 DevOps 流程][17] +- [在 Kubernetes 上部署 InfluxDB 和 Grafana 以收集 Twitter 统计信息][18] +- [使用 Kubernetes 操作器扩展 PostgreSQL][19] +- [使用 Kubernetes 控制器减少系统管理员的工作量][20] +- [将 Kubernetes 带到裸金属边缘计算][21] +- [为什么你不必担心 Kubernetes][22] -首先,我要指明这些文章中有 5 篇是关于 Kubernetes 工作负载的扩展以及它们可以运行在什么场景。这些工作负载涵盖数据科学、PostgreSQL、InfluxDB、Grafana(不仅仅监控集群本身)和 Edge。从历史角度看,Kubernetes 和容器都是在虚拟机上运行的,尤其是运行在由云提供的基础设施上时。抛开对于 Kubernetes 的兴趣因素,这也表明了终端用户们极度希望在裸机上安装 Kubernetes(参照[OpenShift 环境安装 Kubernetes][2])。 +首先,我要指明这些文章中有 5 篇是关于 Kubernetes 工作负载的扩展以及它们可以运行在什么场景。这些工作负载涵盖数据科学、PostgreSQL、InfluxDB、Grafana(不仅仅监控集群本身)和边缘计算。从历史角度看,Kubernetes 和容器都是在虚拟机上运行的,尤其是运行在由云提供的基础设施上时。抛开对于 Kubernetes 的兴趣因素,这也表明了终端用户们极度希望在裸机上安装 Kubernetes(参照 [用 OpenShift 在裸机环境运行 Kubernetes][2])。 -其次,也有很多开发者希望了解操作相关的知识以及 Kubernetes 的最佳实践。从 [Kubernetes 操作][3] 到 [Kubernetes 控制器][4],从 [Secrets][5] 到 [ConfigMaps][6],开发者和运维人员都希望能找到简化部署和管理工作的最佳实践。我们经常纠结在怎么去修改配置文件或别人会怎么配置,而不去回头想想这些配置是怎么让应用部署运转的(不是怎么安装,也不是怎么运行 Kubernetes)。 +其次,也有很多开发者希望了解操作相关的知识以及 Kubernetes 的最佳实践。从 [Kubernetes 操作器][3] 到 [Kubernetes 控制器][4],从 [机密信息][5] 到 [ConfigMaps][6],开发者和运维人员都希望能找到简化部署和管理工作的最佳实践。我们经常纠结在怎么去修改配置文件或别人会怎么配置,而不去回头想想这些配置是怎么让应用部署运转的(不是怎么安装,也不是怎么运行 Kubernetes)。 -最后,人们似乎对入门教程真的感兴趣。事实上,构建 Kubernetes 所需了解的信息太多了,以至于让人们望而却步,也使他们走了错误的路。流行度高的文章中有几篇讲述了为什么你需要了解用 Kubernetes 运行应用程序,而不仅仅是安装它。就是最佳实践类的文章一样,人们也通常不会回头分析在入门时他们应该在什么地方花费时间。我一直秉持的理念是,把有限的时间和金钱投入到如何使用某项技术上,而不是如何构建它。 +最后,人们似乎对入门教程真的感兴趣。事实上,构建 Kubernetes 所需了解的信息太多了,以至于让人们望而却步,也使他们走了错误的路。流行度高的文章中有几篇讲述了为什么你需要了解用 Kubernetes 运行应用程序,而不仅仅是安装它。就像最佳实践类的文章一样,人们也通常不会回头分析在入门时他们应该在什么地方花费时间。我一直秉持的理念是,把有限的时间和金钱投入到如何使用某项技术上,而不是如何构建它。 -### 2020 年对 Kubernetes 的 5 项预测 +### 2020 年对 Kubernetes 的 5 个预测 -回顾下 2019 年的相关主题,这些主题告诉我们 2020 年将如何发展?结合这些文章中的观点,加上我自己的看法,我来分享下我对于 2020 年以及未来发展趋势的想法: +回顾了 2019 年的相关主题,这些主题告诉我们 2020 年将如何发展?结合这些文章中的观点,加上我自己的看法,我来分享下我对于 2020 年以及未来发展趋势的想法: - 1. 工作负载扩展。我会关注高性能计算,AI/ML 以及使用 Operator 的有状态工作负载。 - - 2. 更多的生产中的最佳实践,尤其是跟一些成熟的标准相关的,像 PCI,HIPAA,NIST 等等. - - 3. rootless 相关的更好的安全性和 [runtimes classes][7](如 [gVisor][8],[Kata Containers][9] 等等)更高的安全性。 - - 4. 在部署和开发者们共享应用时,把 Kubernetes 清单的更好的规范标准作为部署的核心要素。如 [podman generate kube][10], [podman play kube][11], 还有多合一 Kubernetes 环境,如 [CodeReady Containers (CRC)][12] - - 5. 一个前所未有的网络、存储和专业硬件(如 GPU 等等)供应商的生态系统,为 Kubernetes 提供 BoB(译注:best of breed,单项最佳品牌)解决方案(在免费软件中,我们相信开放的生态系统好过垂直整合的解决方案)。 +1. 工作负载扩展。我会关注高性能计算、AI/ML 以及使用操作器的有状态工作负载。 +2. 更多的生产中的最佳实践,尤其是跟一些成熟的标准相关的,像 PCI、HIPAA、NIST 等等。 +3. 提升免 root 和更安全的[运行时类][7](如 [gVisor][8]、[Kata Containers][9] 等等)的安全性。 +4. 在部署和开发者们共享应用时,把 Kubernetes 清单的更好的规范标准作为部署的核心要素。如 [podman 生成 kube][10]、[podman 运行 kube][11],还有多合一 Kubernetes 环境,如 [CodeReady Containers (CRC)][12] +5. 一个前所未有的网络、存储和专业硬件(如 GPU 等等)供应商的生态系统,为 Kubernetes 提供 BoB(LCTT 译注:best of breed,单项最佳品牌)解决方案(在自由软件中,我们相信开放的生态系统好过垂直整合的解决方案)。 期待 Kubernetes 在新的一年里再创辉煌! @@ -47,7 +54,7 @@ via: https://opensource.com/article/20/1/kubernetes-2020 作者:[Scott McCarty][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -65,3 +72,13 @@ via: https://opensource.com/article/20/1/kubernetes-2020 [10]: https://developers.redhat.com/blog/2019/01/29/podman-kubernetes-yaml/ [11]: https://www.redhat.com/en/blog/rhel-81-minor-release-major-new-container-capabilities [12]: https://developers.redhat.com/products/codeready-containers/overview +[13]: https://opensource.com/article/19/1/why-data-scientists-love-kubernetes +[14]: https://opensource.com/article/19/6/introduction-kubernetes-secrets-and-configmaps +[15]: https://linux.cn/article-10762-1.html +[16]: https://linux.cn/article-11011-1.html +[17]: https://opensource.com/article/19/7/security-scanning-your-devops-pipeline +[18]: https://opensource.com/article/19/2/deploy-influxdb-grafana-kubernetes +[19]: https://opensource.com/article/19/2/scaling-postgresql-kubernetes-operators +[20]: https://opensource.com/article/19/3/reducing-sysadmin-toil-kubernetes-controllers +[21]: https://opensource.com/article/19/3/bringing-kubernetes-bare-metal-edge +[22]: https://opensource.com/article/19/10/kubernetes-complex-business-problem From 1b5a922346f752a62b238fcd96d16344cd9a462e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Jan 2020 09:44:59 +0800 Subject: [PATCH 250/430] PUB @lxbwolf https://linux.cn/article-11758-1.html --- .../20200101 5 predictions for Kubernetes in 2020.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20200101 5 predictions for Kubernetes in 2020.md (97%) diff --git a/translated/tech/20200101 5 predictions for Kubernetes in 2020.md b/published/20200101 5 predictions for Kubernetes in 2020.md similarity index 97% rename from translated/tech/20200101 5 predictions for Kubernetes in 2020.md rename to published/20200101 5 predictions for Kubernetes in 2020.md index f87eb41b9f..2ad58abd67 100644 --- a/translated/tech/20200101 5 predictions for Kubernetes in 2020.md +++ b/published/20200101 5 predictions for Kubernetes in 2020.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11758-1.html) [#]: subject: (5 predictions for Kubernetes in 2020) [#]: via: (https://opensource.com/article/20/1/kubernetes-2020) [#]: author: (Scott McCarty https://opensource.com/users/fatherlinux) @@ -12,7 +12,7 @@ > 以及,对 2019 年最受欢迎的 Kubernetes 文章的回顾。 -![Person drinking a hat drink at the computer][1] +![](https://img.linux.net.cn/data/attachment/album/202001/07/094358qucr5o2lu2lo23od.jpg) 你是怎么追踪一个广受欢迎的项目(如 Kubernetes)的发展轨迹?你是怎么了解它发展到什么程度了?如果你在为这个项目作贡献或加入了特殊兴趣组(SIG),可能你会在潜移默化中了解到它的发展轨迹,但如果你的全日工作不涉及到为 Kubernetes 作贡献,那么你可能需要一点关于未来的预测来帮助你了解。对于一个诸如 Kubernetes 的快速发展的项目,年末是回顾过去的一年和展望新的一年的最好时机。 From 923e0da51ed798d772ab2a283d831cf23664657c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Jan 2020 23:12:11 +0800 Subject: [PATCH 251/430] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @BrunoJu 恭喜你完成了第一篇翻译贡献! --- ...es to accelerate your automation skills.md | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/translated/tech/20191231 10 Ansible resources to accelerate your automation skills.md b/translated/tech/20191231 10 Ansible resources to accelerate your automation skills.md index f50180a6d7..f7805c35f0 100644 --- a/translated/tech/20191231 10 Ansible resources to accelerate your automation skills.md +++ b/translated/tech/20191231 10 Ansible resources to accelerate your automation skills.md @@ -1,43 +1,45 @@ [#]: collector: (lujun9972) [#]: translator: (BrunoJu) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (10 Ansible resources to accelerate your automation skills) [#]: via: (https://opensource.com/article/19/12/ansible-resources) [#]: author: (James Farrell https://opensource.com/users/jamesf) -提升自动化技巧的10大Ansible资源 +提升自动化技巧的 10 篇 Ansible 文章 ====== -今年,准备好,用出色的Ansible自动化技能装备自己的技能包吧。 -![Gears above purple clouds][1] +> 今年,准备好,用出色的 Ansible 自动化技能装备自己的技能包吧。 -今年我关注了大量关于Ansible的文章,以下这些内容都值得每个人学习,无论是否是Ansible的新手。 +![](https://img.linux.net.cn/data/attachment/album/202001/07/231057fbtfjwrn29ficxj0.jpg) -这些文章值得大家标记为书签,或者设置个计划任务(亦或者是设置一个Tower/AWX job),用来提醒自己常读常新。 -如果你是Ansible的新手,那么就从这些文章开始着手吧: - * [_A quickstart guide to Ansible_][2] 拥有一些对新手非常有用的信息,同时还有一些更高级的话题。 - * [_10 Ansible modules you need to know_][3] 和 [_5 ops tasks to do with Ansible_][4] 这篇文章有每一位Ansible的管理者都应该熟悉并认真研习的一些最基础的Ansible功能 - * [_How to use Ansible to document procedures_][5] 这篇文章是对一些额外话题的纵览,我猜你一定会感到很有趣。 +今年我关注了大量关于 Ansible 的文章,以下这些内容都值得每个人学习,无论是否是 Ansible 的新手。 +这些文章值得大家标记为书签,或者设置个计划任务(亦或者是设置一个 Tower/AWX 任务),用来提醒自己常读常新。 -剩余的这些文章包含了更多高级的话题,比如Windows管理,测试、硬件、云和容器,甚至包括了一个案例研究,如何管理那些对技术有兴趣的孩子的需求。 +如果你是 Ansible 的新手,那么就从这些文章开始着手吧: -我希望你能像我一样好好享受Ansible带来的乐趣。不要停止学习哦! - 1. _[How Ansible brought peace to my home][6]_ 这个异想天开的案例,你能看到如何利用Ansible为孩子们快速部署一个新的笔记本(或者重装旧笔记本) - 2. _[Ansible for the Windows admin][7]_ 你知道Ansible也可以管理Windows的节点吗?这篇文章以部署一个IIS为案例,阐述了基础的Ansible服务器和Windows客户端的安装。 - 3. _[10 Ansible modules you need to know][3]_ 这是个学习你最应该知道的那些最常见最基础Ansible模块的好文章。执行命令、安装系统包和操作文件是许多有用的自动化工作的基础。 - 4. _[How to use Ansible to document procedures][5]_  Ansible的YAML文件易于阅读,因此它们可以被用于记录完成任务所需的手动步骤。这一特性可以帮助你调试与扩展,这令工作变得异常轻松。同时,这篇文章还包含关于测试和分析等Ansible相关主题的指导。 - 5. _[Using Testinfra with Ansible to verify server state][8]_ 测试环节是任何一个 CI/CD 开发型运维场景不可或缺的一部分。所以为什么不把测试Ansible的运行结果也纳入其中呢?这个有关于Ansible测试架构的入门级文章可以被用来帮助你配置。 - 6. _[Hardware bootstrapping with Ansible][9]_ 这个世界并不是完全已经被容器和虚拟机所占据。许多系统管理员仍然需要管理众多硬件资源。通过Ansible与PXE、DHCP以及其他一些技术的结合,你可以创建一个简单的管理框架,对硬件实施控制。 - 7. _[What you need to know about Ansible modules][10]_ 模块给Ansible带来了巨大的潜力,许多模块我们已经可以拿来利用。但如果没有你所需的模块,那你可以尝试给自己造一个。看看这篇文章吧,它能让你了解如何从零开始打造自己所需的模块。 - 8. _[5 ops tasks to do with Ansible][4]_ 这是另一个有关于如何使用Ansible来管理常见的系统操作任务的文章。这里描述了一系列可以取代命令行操作的Tower(AWX)的案例。 - 9. _[A quickstart guide to Ansible][2]_ 这篇文章是个可以下载的PDF文档。它可以作为一本随时拿来翻阅的手册。这篇文章的开头有助于初学者入门。同时,还包括了一些其他的研究领域,比如模块测试、系统管理任务和针对K8S对象的管理。 - 10. _[An Ansible reference guide, CI/CD with Ansible Tower and GitHub, and more news][11]_ 这是一篇每月进行总结更新的文章,充满了有趣的链接。话题包括了Ansible的基础内容、管理Netapp的E系列存储产品、调试、打补丁包和其他一些相关内容。文章中还包括了一些视频以及指导性文章的链接。击这里查看详情! +* 《[Ansible 快速入门指南][2]》拥有一些对新手非常有用的信息,同时还介绍了一些更高级的话题。 +* 《[你需要知道的 10 个 Ansible 模块][3]》和《[5 个 Ansible 运维任务][4]》(译文)这两篇文章有每一位 Ansible 管理员都应该熟悉并认真研习的一些最基础的 Ansible 功能。 +* 《[如何使用 Ansible 记录流程][5]》这篇文章是对一些额外话题的纵览,我猜你一定会感到很有趣。 +剩余的这些文章包含了更多高级的话题,比如 Windows 管理、测试、硬件、云和容器,甚至包括了一个案例研究,如何管理那些对技术有兴趣的孩子的需求。 -如果你也有一些你喜爱的Ansible文章,那请留言告诉我们吧。 +我希望你能像我一样好好享受 Ansible 带来的乐趣。不要停止学习哦! + +1. 《[Ansible 如何为我的家庭带来和平][6]》这个异想天开的案例,你能看到如何利用 Ansible 为孩子们快速部署一个新的笔记本(或者重装旧笔记本) +2. Taz Brown 和 Abner Malivert 的《[适用于 Windows 管理员的 Ansible][7]》:你知道 Ansible 也可以管理 Windows 的节点吗?这篇文章以部署一个 IIS 为案例,阐述了基础的 Ansible 服务器和 Windows 客户端的安装。 +3. Shashank Hegde 的《[你需要知道的 10 个 Ansible 模块][3]》是个学习你最应该知道的那些最常见、最基础的 Ansible 模块的好文章。运行命令、安装软件包和操作文件是许多有用的自动化工作的基础。 +4. Marco Bravo 的《[如何使用 Ansible 记录流程][5]》:Ansible 的 YAML 文件易于阅读,因此它们可以被用于记录完成任务所需的手动步骤。这一特性可以帮助你调试与扩展,这令工作变得异常轻松。同时,这篇文章还包含关于测试和分析等 Ansible 相关主题的指导。 +5. Clement Verna 的《[使用 Testinfra 和 Ansible 验证服务器状态][8]》(译文):测试环节是任何一个 CI/CD DevOps 流程不可或缺的一部分。所以为什么不把测试 Ansible 的运行结果也纳入其中呢?这个测试架构 Testinfra 的入门级文章可以帮助你检查配置结果。 +6. Mark Phillips 的《[Ansible 硬件起步][9]》:这个世界并不是完全已经被容器和虚拟机所占据。许多系统管理员仍然需要管理众多硬件资源。通过 Ansible 与一点 PXE、DHCP 以及其他技巧的结合,你可以创建一个方便的管理框架使硬件易于启动和运行。 +7. Jairo da Silva Junior 的《[你需要了解的关于 Ansible 模块的知识][10]》:模块给 Ansible 带来了巨大的潜力,已经有许多模块可以拿来利用。但如果没有你所需的模块,那你可以尝试给自己打造一个。看看这篇文章吧,它能让你了解如何从零开始打造自己所需的模块。 +8. Mark Phillips 的《[5 个 Ansible 运维任务][4]》(译文):这是另一个有关于如何使用 Ansible 来管理常见的系统操作任务的文章。这里描述了一系列可以取代命令行操作的 Tower(或 AWX)的案例。 +9. Chris Short 的《[Ansible 快速入门指南][2]》是个可以下载的 PDF 文档。它可以作为一本随时拿来翻阅的手册。这篇文章的开头有助于初学者入门。同时,还包括了一些其他的研究领域,比如模块测试、系统管理任务和针对 K8S 对象的管理。 +10. Mark Phillips 的《[Ansible 参考指南,带有 Ansible Tower 和 GitHub 的 CI/CD,等等][11]》:这是一篇每月进行总结更新的文章,充满了有趣的链接。话题包括了 Ansible 的基础内容、管理 Netapp 的 E 系列存储产品、调试、打补丁包和其他一些相关内容。文章中还包括了一些视频以及一些聚会的链接。请查看详情。 + +如果你也有一些你喜爱的 Ansible 文章,那请留言告诉我们吧。 -------------------------------------------------------------------------------- @@ -45,8 +47,8 @@ via: https://opensource.com/article/19/12/ansible-resources 作者:[James Farrell][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/BrunoJu) -校对:[校对者ID](https://github.com/校对者ID) +译者:[BrunoJu](https://github.com/BrunoJu) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -55,11 +57,11 @@ via: https://opensource.com/article/19/12/ansible-resources [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chaos_engineer_monster_scary_devops_gear_kubernetes.png?itok=GPYLvfVh (Gears above purple clouds) [2]: https://opensource.com/article/19/2/quickstart-guide-ansible [3]: https://opensource.com/article/19/9/must-know-ansible-modules -[4]: https://opensource.com/article/19/8/ops-tasks-ansible +[4]: https://linux.cn/article-11312-1.html [5]: https://opensource.com/article/19/4/ansible-procedures [6]: https://opensource.com/article/19/9/ansible-documentation-kids-laptops [7]: https://opensource.com/article/19/2/ansible-windows-admin -[8]: https://opensource.com/article/19/5/using-testinfra-ansible-verify-server-state +[8]: https://linux.cn/article-10943-1.html [9]: https://opensource.com/article/19/5/hardware-bootstrapping-ansible [10]: https://opensource.com/article/19/3/developing-ansible-modules [11]: https://opensource.com/article/19/7/ansible-news-edition-one From 9de7cd49aa0d08d79a379e08ffd875f2d72ff746 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Jan 2020 23:13:18 +0800 Subject: [PATCH 252/430] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @BrunoJu 本文首发地址:https://linux.cn/article-11760-1.html 您的 LCTT 专页地址: https://linux.cn/lctt/BrunoJu 请注册以领取 LCCN:https://lctt.linux.cn/ --- ... Ansible resources to accelerate your automation skills.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191231 10 Ansible resources to accelerate your automation skills.md (98%) diff --git a/translated/tech/20191231 10 Ansible resources to accelerate your automation skills.md b/published/20191231 10 Ansible resources to accelerate your automation skills.md similarity index 98% rename from translated/tech/20191231 10 Ansible resources to accelerate your automation skills.md rename to published/20191231 10 Ansible resources to accelerate your automation skills.md index f7805c35f0..00d31b98a2 100644 --- a/translated/tech/20191231 10 Ansible resources to accelerate your automation skills.md +++ b/published/20191231 10 Ansible resources to accelerate your automation skills.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (BrunoJu) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11760-1.html) [#]: subject: (10 Ansible resources to accelerate your automation skills) [#]: via: (https://opensource.com/article/19/12/ansible-resources) [#]: author: (James Farrell https://opensource.com/users/jamesf) From d817e328b23780246cb240b9f19e1f1fc4af841b Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Wed, 8 Jan 2020 00:20:46 +0800 Subject: [PATCH 253/430] translated --- ... Lessons learned from programming in Go.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/sources/tech/20191210 Lessons learned from programming in Go.md b/sources/tech/20191210 Lessons learned from programming in Go.md index 93e9af3398..682b6c798c 100644 --- a/sources/tech/20191210 Lessons learned from programming in Go.md +++ b/sources/tech/20191210 Lessons learned from programming in Go.md @@ -7,28 +7,28 @@ [#]: via: "https://opensource.com/article/19/12/go-common-pitfalls" [#]: author: "Eduardo Ferreira https://opensource.com/users/edufgf" -用 Go 编程受到的启发 +Go 编程中的经验教训 ====== 通过学习如何定位并发处理的陷阱来避免未来处理这些问题时的困境。 ![Goland gopher illustration][1] -在复杂的分布式系统进行任务处理时,你通常会需要进行并发的操作。[Mode.net][2] 公司系统每天要处理实时、快速和灵活的以毫秒为单位动态路由数据包的全球专用网络和数据,需要高度并发的系统。他们的动态路由是基于网络状态的,而这个过程需要考虑众多因素,我们只考虑关系链的监控。在我们的环境中,调用关系链监控可以是任何跟网络调用关系链有关的状态和当前属性(如连接延迟)。 +在复杂的分布式系统进行任务处理时,你通常会需要进行并发的操作。[Mode.net][2] 公司系统每天要处理实时、快速和灵活的以毫秒为单位动态路由数据包的全球专用网络和数据,需要高度并发的系统。这个动态路由是基于网络状态的,而这个过程需要考虑众多因素,我们只考虑关系链的监控。在我们的环境中,调用关系链监控可以是任何跟网络调用关系链有关的状态和当前属性(如链接延迟)。 -### 并发探测链接指标 +### 并发探测链接监控 -[H.A.L.O.][4] (Hop-by-Hop Adaptive Link-State Optimal Routing,译注:逐跳自适应链路状态最佳路由), 我们的动态路由算法部分依赖于链路度量来计算路由表。 这些指标由位于每个PoP(译注:存活节点)上的独立组件收集。PoP是表示我们的网络中单个路由实体的机器,通过链路连接并分布在我们的网络拓扑中的各个位置。某个组件使用网络数据包探测周围的机器,周围的机器回复数据包给前者。从接收到的探测包中可以获得链路延迟。由于每个 PoP 都有多个临近节点,所以这种探测任务实质上是并发的:我们需要实时测量每个临近连接点的延迟。我们不能串行地处理;为了计算这个指标,必须尽快处理每个探针。 +[H.A.L.O.][4] (Hop-by-Hop Adaptive Link-State Optimal Routing,译注:逐跳自适应链路状态最佳路由),我们的动态路由算法部分依赖于链路度量来计算路由表。 这些指标由位于每个PoP(译注:存活节点)上的独立组件收集。PoP是表示我们的网络中单个路由实体的机器,通过链路连接并分布在我们的网络拓扑中的各个位置。某个组件使用网络数据包探测周围的机器,周围的机器回复数据包给前者。从接收到的探测包中可以获得链路延迟。由于每个 PoP 都有不止一个临近节点,所以这种探测任务实质上是并发的:我们需要实时测量每个临近连接点的延迟。我们不能串行地处理;为了计算这个指标,必须尽快处理每个探针。 ![latency computation graph][6] ### 序列号和重置:一个记录场景 -我们的探测组件互相发送和接收数据包并依靠序列号进行数据包处理。旨在避免处理重复的包或顺序被打乱的包。我们的第一个实现依靠特殊的序列号0来重置序列号。这个数字仅在组件初始化时使用。主要的问题是我们只考虑了始终从 0 开始递增的序列号。组件重启后,包的顺序可能会重新排列,某个包的序列号可能会轻易地被替换成重置之前使用过的值。这意味着,直到排到重置之前用到的值之前,它后面的包都会被忽略掉。 +我们的探测组件互相发送和接收数据包并依靠序列号进行数据包处理。旨在避免处理重复的包或顺序被打乱的包。我们的第一个实现依靠特殊的序列号 0 来重置序列号。这个数字仅在组件初始化时使用。主要的问题是我们只考虑了始终从 0 开始递增的序列号。组件重启后,包的顺序可能会重新排列,某个包的序列号可能会轻易地被替换成重置之前使用过的值。这意味着,直到排到重置之前用到的值之前,它后面的包都会被忽略掉。 ### UDP 握手和有限状态机 这里的问题是重启前后的序列号是否一致。有几种方法可以解决这个问题,经过讨论,我们选择了实现一个带有清晰状态定义的三向交握协议。这个握手过程在初始化时通过链接建立 session。这样可以确保节点通过同一个 session 进行通信且使用了适当的序列号。 -为了正确实现这个过程,我们必须顶一个一个有清晰状态和过渡的有限状态机。这样我们就可以正确管理握手过程中的所有极端情况。 +为了正确实现这个过程,我们必须定义一个有清晰状态和过渡的有限状态机。这样我们就可以正确管理握手过程中的所有极端情况。 ![finite state machine diagram][7] @@ -43,7 +43,7 @@ session ID 由握手的初始化程序生成。一个完整的交换顺序如下 ### 处理状态超时 -Basically, at each state, you need to handle, at most, three types of events: link events, packet events, and timeout events. And those events show up concurrently, so here you have to handle concurrency properly.基本上,每种状态下你都需要处理最多三种类型的事件:链接事件、数据包事件和超时事件。这些事件会并发地出现,因此你必须正确处理并发。 +基本上,每种状态下你都需要处理最多三种类型的事件:链接事件、数据包事件和超时事件。这些事件会并发地出现,因此你必须正确处理并发。 * 链接事件包括连接和断开,连接时会初始化一个链接 session,断开时会断开一个已建立的 seesion。 * 数据包事件是控制数据包 **(SYN/SYN-ACK/ACK)** 或只是探测响应。 @@ -59,7 +59,7 @@ Basically, at each state, you need to handle, at most, three types of events: li ![gophers hacking together][9] -gophers hacking together +gopher 们聚众狂欢 首先,你可以设计两个分别表示我们的 **Session** 和 **Timeout Handlers** 的结构体。 @@ -147,19 +147,19 @@ func synCallback(session Session) {   ### 数据竞争和引用 -你的解决方案已经有了。可以通过检查计时器到期后超时回调是否执行来进行一个简单的测试。为此,注册一个超时,在 *duration* 时间内 sleep,然后检查是否执行的回调的处理。执行这个测试后,最好取消预定的超时时间(因为它会重新调度),这样才不会在下次测试时产生副作用。 +你的解决方案已经有了。可以通过检查计时器到期后超时回调是否执行来进行一个简单的测试。为此,注册一个超时,在 *duration* 时间内 sleep,然后检查是否执行了回调的处理。执行这个测试后,最好取消预定的超时时间(因为它会重新调度),这样才不会在下次测试时产生副作用。 令人惊讶的是,这个简单的测试发现了这个解决方案中的一个 bug。使用 cancel 方法来取消超时并没有正确处理。以下顺序的事件会导致数据资源竞争: 1. 你有一个已调度的超时 handler。 2. 线程 1: -a) 你接收到一个控制数据包,现在你要取消已注册的超时并切换到下一个 session 状态(如 发送 **SYN** 后接收到一个 **SYN-ACK**) -b) 你调用了 **timeout.Cancel()**,这个函数调用了 **timer.Stop()**。(请注意,Golang 计时器的 stop 不会终止一个已过期的计时器。) +a)你接收到一个控制数据包,现在你要取消已注册的超时并切换到下一个 session 状态(如 发送 **SYN** 后接收到一个 **SYN-ACK**) +b)你调用了 **timeout.Cancel()**,这个函数调用了 **timer.Stop()**。(请注意,Golang 计时器的 stop 不会终止一个已过期的计时器。) 3. 线程 2: -a) 在调用 cancel 之前,计时器已过期,回调即将执行。 -b) 执行回调,它调度一次新的超时并更新全局 map。 +a)在调用 cancel 之前,计时器已过期,回调即将执行。 +b)执行回调,它调度一次新的超时并更新全局 map。 4. 线程 1: -a) 切换到新的 session 状态并注册新的超时,更新全局 map。 +a)切换到新的 session 状态并注册新的超时,更新全局 map。 @@ -187,9 +187,9 @@ func (timeout* TimeoutHandler) Register() {   你可以使用取消 channel,而不必依赖不能阻止到期的计时器执行的 golang 函数 **timer.Stop()**。 -这是一个略有不同的方法。现在你可以不用再通过回调进行递归地重新调度;而是注册一个死循环,这个循环接收到取消信号或超时事件是终止。 +这是一个略有不同的方法。现在你可以不用再通过回调进行递归地重新调度;而是注册一个死循环,这个循环接收到取消信号或超时事件时终止。 -新的 **Register()** 产生一个新的 go 协程,这个协程在在超时后执行你的回调,并在前一个超时执行后调度新的超时。返回给调用发一个取消 channel,用来控制循环的终止。 +新的 **Register()** 产生一个新的 go 协程,这个协程在在超时后执行你的回调,并在前一个超时执行后调度新的超时。返回给调用方一个取消 channel,用来控制循环的终止。 ```go @@ -254,11 +254,11 @@ func (timeout* TimeoutHandler) Cancel() {   ![gophers on a wire, talking][11] -还有人吗? +有人在听吗? 已获得 Trevor Forrey 授权。 -这里的解决方案是创建 channel 时指定大小至少为 1,这样向 channel 发送数据就不会阻塞,也显式地使发送变成非阻塞的,避免了并发调用。这样可以确保取消操作只发送一次,并且不会则色后续的取消调用。 +这里的解决方案是创建 channel 时指定大小至少为 1,这样向 channel 发送数据就不会阻塞,也显式地使发送变成非阻塞的,避免了并发调用。这样可以确保取消操作只发送一次,并且不会阻塞后续的取消调用。 ```go @@ -281,29 +281,29 @@ func (timeout* TimeoutHandler) Cancel() {   #### 在非同步的情况下更新共享数据 -This seems like an obvious one, but it’s actually hard to spot if your concurrent updates happen in different locations. The result is data race, where multiple updates to the same data can cause update loss, due to one update overriding another. In our case, we were updating the scheduled timeout reference on the same shared map. (Interestingly, if Go detects a concurrent read/write on the same Map object, it throws a fatal error —you can try to run Go’s [data race detector][12]). This eventually results in losing a timeout reference and making it impossible to cancel that given timeout. Always remember to use locks when they are needed. +这似乎是个很明显的问题,但如果并发更新发生在不同的位置,就很难发现。结果就是数据竞争,由于一个更新会覆盖另一个,因此对同一数据的多次更新中会有某些更新丢失。在我们的案例中,我们是在同时更新同一个共享 map 里的调度超时引用。有趣的是,(如果 Go 检测到在同一个 map 对象上的并发读写,会抛出 fatal 错误 — 你可以尝试下运行 Go 的[数据竞争检测器](https://golang.org/doc/articles/race_detector.html))。这最终会导致丢失超时引用,且无法取消给定的超时。当有必要时,永远不要忘记使用锁。 ![gopher assembly line][13] -don’t forget to synchronize gophers’ work +不要忘记同步 gopher 们的工作 -#### Missing condition checks +#### 缺少条件检查 -Condition checks are needed in situations where you can’t rely only on the lock exclusivity. Our situation is a bit different, but the core idea is the same as [condition variables][14]. Imagine a classic situation where you have one producer and multiple consumers working with a shared queue. A producer can add one item to the queue and wake up all consumers. The wake-up call means that some data is available at the queue, and because the queue is shared, access must be synchronized through a lock. Every consumer has a chance to grab the lock; however, you still need to check if there are items in the queue. A condition check is needed because you don’t know the queue status by the time you grab the lock. +在不能仅依赖锁的独占性的情况下,就需要进行条件检查。我们遇到的场景稍微有点不一样,但是核心思想跟[条件变量][14]是一样的。假设有个经典的一个生产者和多个消费者使用一个共享队列的场景,生产者可以将一个元素添加到队列并唤醒所有消费者。这个唤醒调用意味着队列中的数据是可访问的,并且由于队列是共享的,消费者必须通过锁来进行同步访问。每个消费者都可能拿到锁;然而,你仍然需要检查队列中是否有元素。因为在你拿到锁的瞬间并不知道队列的状态,所以还是需要进行条件检查。 -In our example, the timeout handler got a ‘wake up’ call from a timer expiration, but it still needed to check if a cancel signal was sent to it before it could proceed with the callback execution. +在我们的例子中,超时 handler 收到了计时器到期时发出的「唤醒」调用,但是它仍需要检查是否已向其发送了取消信号,然后才能继续执行回调。 ![gopher boot camp][15] -condition checks might be needed if you wake up multiple gophers +如果你要唤醒多个 gopher,可能就需要进行条件检查 -#### Deadlocks +#### 死锁 -This happens when one thread is stuck, waiting indefinitely for a signal to wake up, but this signal will never arrive. Those can completely kill your application by halting your entire program execution. +当一个线程被卡住,无限期地等待一个唤醒信号,但是这个信号永远不会到达时,就会发生这种情况。死锁可以通过让你的整个程序 halt 来彻底杀死你的应用。 -In our case, this happened due to multiple send calls to a non-buffered and blocking channel. This meant that the send call would only return after a receive is done on the same channel. Our timeout thread loop was promptly receiving signals on the cancellation channel; however, after the first signal is received, it would break off the loop and never read from that channel again. The remaining callers are stuck forever. To avoid this situation, you need to carefully think through your code, handle blocking calls with care, and guarantee that thread starvation doesn’t happen. The fix in our example was to make the cancellation calls non-blocking—we didn’t need a blocking call for our needs. +在我们的案例中,这种情况的发生是由于多次发送请求到一个非缓冲且阻塞的 channel。这意味着向 channel 发送数据只有在从这个 channel 接收完数据后才能 return。我们的超时线程循环迅速从取消 channel 接收信号;然而,在接收到第一个信号后,它将跳出循环,并且再也不会从这个 channel 读取数据。其他的调用会一直被卡住。为避免这种情况,你需要仔细检查代码,谨慎处理阻塞调用,并确保不会发生线程饥饿。我们例子中的解决方法是使取消调用成为非阻塞调用 — 我们不需要阻塞调用。 -------------------------------------------------------------------------------- @@ -311,7 +311,7 @@ via: https://opensource.com/article/19/12/go-common-pitfalls 作者:[Eduardo Ferreira][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[lxbwolf](https://github.com/lxbwolf) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e37b92517847b91b7e86bcbb64f0897f44f1f50a Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Wed, 8 Jan 2020 00:23:40 +0800 Subject: [PATCH 254/430] modify md --- ... Lessons learned from programming in Go.md | 47 ++++++------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/sources/tech/20191210 Lessons learned from programming in Go.md b/sources/tech/20191210 Lessons learned from programming in Go.md index 682b6c798c..0c17e142a8 100644 --- a/sources/tech/20191210 Lessons learned from programming in Go.md +++ b/sources/tech/20191210 Lessons learned from programming in Go.md @@ -1,11 +1,11 @@ -[#]: collector: "lujun9972" -[#]: translator: "lxbwolf" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " -[#]: subject: "Lessons learned from programming in Go" -[#]: via: "https://opensource.com/article/19/12/go-common-pitfalls" -[#]: author: "Eduardo Ferreira https://opensource.com/users/edufgf" +[#]: collector: (lujun9972) +[#]: translator: (lxbwolf) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Lessons learned from programming in Go) +[#]: via: (https://opensource.com/article/19/12/go-common-pitfalls) +[#]: author: (Eduardo Ferreira https://opensource.com/users/edufgf) Go 编程中的经验教训 ====== @@ -39,8 +39,6 @@ session ID 由握手的初始化程序生成。一个完整的交换顺序如下 3. sender 接收到 **SYN-ACK (ID)** _并发送一个 **ACK (ID)**_。它还发送一个从序列号 0 开始的数据包。 4. receiver 检查最后接收到的 **ID**,如果 ID 匹配,_则接受 **ACK (ID)**_。它还开始接受序列号为 0 的数据包。 - - ### 处理状态超时 基本上,每种状态下你都需要处理最多三种类型的事件:链接事件、数据包事件和超时事件。这些事件会并发地出现,因此你必须正确处理并发。 @@ -49,8 +47,6 @@ session ID 由握手的初始化程序生成。一个完整的交换顺序如下 * 数据包事件是控制数据包 **(SYN/SYN-ACK/ACK)** 或只是探测响应。 * 超时事件在当前 session 状态的预定超时时间到期后触发。 - - 这里面临的最主要的问题是如何处理并发超时到期和其他事件。这里很容易陷入死锁和资源竞争的陷阱。 ### 第一种方法 @@ -63,7 +59,6 @@ gopher 们聚众狂欢 首先,你可以设计两个分别表示我们的 **Session** 和 **Timeout Handlers** 的结构体。 - ```go type Session struct {     State SessionState   @@ -85,14 +80,12 @@ type TimeoutHandler struct {   每一个临近连接点的 session 都包含一个保存调度 `TimeoutHandler` 的全局 map。 - ``` `SessionTimeout map[Session]*TimeoutHandler` ``` 下面方法注册和取消超时: - ```go // schedules the timeout callback function.   func (timeout* TimeoutHandler) Register() {   @@ -111,7 +104,6 @@ func (timeout* TimeoutHandler) Cancel() {   你可以使用类似下面的方法来创建和存储超时: - ```go func CreateTimeoutHandler(callback func(Session), session Session, duration int) *TimeoutHandler {     if sessionTimeout[session] == nil {   @@ -130,7 +122,6 @@ func CreateTimeoutHandler(callback func(Session), session Session, duration int) 为此,你可以让回调函数重新调度一次超时: - ```go func synCallback(session Session) {     sendSynPacket(session) @@ -161,15 +152,12 @@ b)执行回调,它调度一次新的超时并更新全局 map。 4. 线程 1: a)切换到新的 session 状态并注册新的超时,更新全局 map。 - - 两个线程同时更新超时 map。最终结果是你无法取消注册的超时,然后你也会丢失对线程 2 重新调度的超时的引用。这导致 handler 在一段时间内持续执行和重新调度,出现非预期行为。 ### 锁也解决不了问题 使用锁也不能完全解决问题。如果你在处理所有事件和执行回调之前加锁,它仍然不能阻止一个过期的回调运行: - ```go func (timeout* TimeoutHandler) Register() {     timeout.timer = time.AfterFunc(time.Duration(timeout.duration) * time._Second_, func() {   @@ -191,7 +179,6 @@ func (timeout* TimeoutHandler) Register() {   新的 **Register()** 产生一个新的 go 协程,这个协程在在超时后执行你的回调,并在前一个超时执行后调度新的超时。返回给调用方一个取消 channel,用来控制循环的终止。 - ```go func (timeout *TimeoutHandler) Register() chan struct{} {     cancelChan := make(chan struct{})   @@ -225,7 +212,6 @@ func (timeout* TimeoutHandler) Cancel() {   这里的解决方案是,在拿到锁之后,检查一下超时范围内的取消 channel。 - ```go   case _ = <- time.AfterFunc(time.Duration(timeout.duration) * time.Second):       func () {   @@ -260,7 +246,6 @@ func (timeout* TimeoutHandler) Cancel() {   这里的解决方案是创建 channel 时指定大小至少为 1,这样向 channel 发送数据就不会阻塞,也显式地使发送变成非阻塞的,避免了并发调用。这样可以确保取消操作只发送一次,并且不会阻塞后续的取消调用。 - ```go func (timeout* TimeoutHandler) Cancel() {     if timeout.cancelChan == nil {   @@ -283,8 +268,6 @@ func (timeout* TimeoutHandler) Cancel() {   这似乎是个很明显的问题,但如果并发更新发生在不同的位置,就很难发现。结果就是数据竞争,由于一个更新会覆盖另一个,因此对同一数据的多次更新中会有某些更新丢失。在我们的案例中,我们是在同时更新同一个共享 map 里的调度超时引用。有趣的是,(如果 Go 检测到在同一个 map 对象上的并发读写,会抛出 fatal 错误 — 你可以尝试下运行 Go 的[数据竞争检测器](https://golang.org/doc/articles/race_detector.html))。这最终会导致丢失超时引用,且无法取消给定的超时。当有必要时,永远不要忘记使用锁。 - - ![gopher assembly line][13] 不要忘记同步 gopher 们的工作 @@ -318,18 +301,18 @@ via: https://opensource.com/article/19/12/go-common-pitfalls [a]: https://opensource.com/users/edufgf [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/go-golang.png?itok=OAW9BXny "Goland gopher illustration" +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/go-golang.png?itok=OAW9BXny (Goland gopher illustration) [2]: http://mode.net [3]: https://en.wikipedia.org/wiki/Metrics_%28networking%29 [4]: https://people.ece.cornell.edu/atang/pub/15/HALO_ToN.pdf [5]: https://en.wikipedia.org/wiki/Point_of_presence -[6]: https://opensource.com/sites/default/files/uploads/image2_0_3.png "latency computation graph" -[7]: https://opensource.com/sites/default/files/uploads/image3_0.png "finite state machine diagram" +[6]: https://opensource.com/sites/default/files/uploads/image2_0_3.png (latency computation graph) +[7]: https://opensource.com/sites/default/files/uploads/image3_0.png (finite state machine diagram) [8]: https://golang.org/ -[9]: https://opensource.com/sites/default/files/uploads/image4.png "gophers hacking together" +[9]: https://opensource.com/sites/default/files/uploads/image4.png (gophers hacking together) [10]: https://en.wikipedia.org/wiki/Deadlock -[11]: https://opensource.com/sites/default/files/uploads/image5_0_0.jpg "gophers on a wire, talking" +[11]: https://opensource.com/sites/default/files/uploads/image5_0_0.jpg (gophers on a wire, talking) [12]: https://golang.org/doc/articles/race_detector.html -[13]: https://opensource.com/sites/default/files/uploads/image6.jpeg "gopher assembly line" +[13]: https://opensource.com/sites/default/files/uploads/image6.jpeg (gopher assembly line) [14]: https://en.wikipedia.org/wiki/Monitor_%28synchronization%29#Condition_variables -[15]: https://opensource.com/sites/default/files/uploads/image7.png "gopher boot camp" +[15]: https://opensource.com/sites/default/files/uploads/image7.png (gopher boot camp) From 327565767baa82996ecd556f11f27a6907183d03 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Wed, 8 Jan 2020 00:24:07 +0800 Subject: [PATCH 255/430] move file --- .../tech/20191210 Lessons learned from programming in Go.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20191210 Lessons learned from programming in Go.md (100%) diff --git a/sources/tech/20191210 Lessons learned from programming in Go.md b/translated/tech/20191210 Lessons learned from programming in Go.md similarity index 100% rename from sources/tech/20191210 Lessons learned from programming in Go.md rename to translated/tech/20191210 Lessons learned from programming in Go.md From 90dcfb8cbe828bff61e12427e2aebf571a89ca9c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Jan 2020 00:54:36 +0800 Subject: [PATCH 256/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200107=205=20wa?= =?UTF-8?q?ys=20to=20improve=20your=20Bash=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200107 5 ways to improve your Bash scripts.md --- ...107 5 ways to improve your Bash scripts.md | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 sources/tech/20200107 5 ways to improve your Bash scripts.md diff --git a/sources/tech/20200107 5 ways to improve your Bash scripts.md b/sources/tech/20200107 5 ways to improve your Bash scripts.md new file mode 100644 index 0000000000..ae4dd4fcf7 --- /dev/null +++ b/sources/tech/20200107 5 ways to improve your Bash scripts.md @@ -0,0 +1,177 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 ways to improve your Bash scripts) +[#]: via: (https://opensource.com/article/20/1/improve-bash-scripts) +[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) + +5 ways to improve your Bash scripts +====== +Find out how Bash can help you tackle the most challenging tasks. +![A person working.][1] + +A system admin often writes Bash scripts, some short and some quite lengthy, to accomplish various tasks. + +Have you ever looked at an installation script provided by a software vendor? They often add a lot of functions and logic in order to ensure that the installation works properly and doesn’t result in damage to the customer’s system. Over the years, I’ve amassed a collection of various techniques for enhancing my Bash scripts, and I’d like to share some of them in hopes they can help others. Here is a collection of small scripts created to illustrate these simple examples. + +### Starting out + +When I was starting out, my Bash scripts were nothing more than a series of commands, usually meant to save time with standard shell operations like deploying web content. One such task was extracting static content into the home directory of an Apache web server. My script went something like this: + + +``` +cp january_schedule.tar.gz /usr/apache/home/calendar/ +cd /usr/apache/home/calendar/ +tar zvxf january_schedule.tar.gz +``` + +While this saved me some time and typing, it certainly was not a very interesting or useful script in the long term. Over time, I learned other ways to use Bash scripts to accomplish more challenging tasks, such as creating software packages, installing software, or backing up a file server. + +### 1\. The conditional statement + +Just as with so many other programming languages, the conditional has been a powerful and common feature. A conditional is what enables logic to be performed by a computer program. Most of my examples are based on conditional logic. + +The basic conditional uses an "if" statement. This allows us to test for some condition that we can then use to manipulate how a script performs. For instance, we can check for the existence of a Java bin directory, which would indicate that Java is installed. If found, the executable path can be updated with the location to enable calls by Java applications. + + +``` +if [ -d "$JAVA_HOME/bin" ] ; then +    PATH="$JAVA_HOME/bin:$PATH" +``` + +### 2\. Limit execution + +You might want to limit a script to only be run by a specific user. Although Linux has standard permissions for users and groups, as well as SELinux for enabling this type of protection, you could choose to place logic within a script. Perhaps you want to be sure that only the owner of a particular web application can run its startup script. You could even use code to limit a script to the root user. Linux has a couple of environment variables that we can test in this logic. One is **$USER**, which provides the username. Another is **$UID**, which provides the user’s identification number (UID) and, in the case of a script, the UID of the executing user. + +#### User + +The first example shows how I could limit a script to the user jboss1 in a multi-hosting environment with several application server instances. The conditional "if" statement essentially asks, "Is the executing user not jboss1?" When the condition is found to be true, the first echo statement is called, followed by the **exit 1,** which terminates the script. + + +``` +if [ "$USER" != 'jboss1' ]; then +     echo "Sorry, this script must be run as JBOSS1!" +     exit 1 +fi +echo "continue script" +``` + +#### Root + +This next example script ensures that only the root user can execute it. Because the UID for root is 0, we can use the **-gt** option in the conditional if statement to prohibit all UIDs greater than zero. + + +``` +if [ "$UID" -gt 0 ]; then +     echo "Sorry, this script must be run as ROOT!" +     exit 1 +fi +echo "continue script" +``` + +### 3\. Use arguments + +Just like any executable program, Bash scripts can take arguments as input. Below are a few examples. But first, you should understand that good programming means that we don’t just write applications that do what we want; we must write applications that _can’t_ do what we _don’t_ want. I like to ensure that a script doesn’t do anything destructive in the case where there is no argument. Therefore, this is the first check that y. The condition checks the number of arguments, **$#**, for a value of zero and terminates the script if true. + + +``` +if [ $# -eq 0 ]; then +    echo "No arguments provided" +    exit 1 +fi +echo "arguments found: $#" +``` + +#### Multiple arguments + +You can pass more than one argument to a script. The internal variables that the script uses to reference each argument are simply incremented, such as **$1**, **$2**, **$3**, and so on. I’ll just expand my example above with the following line to echo the first three arguments. Obviously, additional logic will be needed for proper argument handling based on the total number. This example is simple for the sake of demonstration. + + +``` +`echo $1 $2 $3` +``` + +While we’re discussing these argument variables, you might have wondered, "Did he skip zero?" + +Well, yes, I did, but I have a great reason! There is indeed a **$0** variable, and it is very useful. Its value is simply the name of the script being executed. + + +``` +`echo $0` +``` + +An important reason to reference the name of the script during execution is to generate a log file that includes the script’s name in its own name. The simplest form might just be an echo statement. + + +``` +`echo test >> $0.log` +``` + +However, you will probably want to add a bit more code to ensure that the log is written to a location with the name and information that you find helpful to your use case. + +### 4\. User input + +Another useful feature to use in a script is its ability to accept input during execution. The simplest is to offer the user some input. + + +``` +echo "enter a word please:" + read word + echo $word +``` + +This also allows you to provide choices to the user. + + +``` +read -p "Install Software ?? [Y/n]: " answ + if [ "$answ" == 'n' ]; then +   exit 1 + fi +   echo "Installation starting..." +``` + +### 5\. Exit on failure + +Some years ago, I wrote a script for installing the latest version of the Java Development Kit (JDK) on my computer. The script extracts the JDK archive to a specific directory, updates a symbolic link, and uses the alternatives utility to make the system aware of the new version. If the extraction of the JDK archive failed, continuing could break Java system-wide. So, I wanted the script to abort in such a situation. I don’t want the script to make the next set of system changes unless the archive was successfully extracted. The following is an excerpt from that script: + + +``` +tar kxzmf jdk-8u221-linux-x64.tar.gz -C /jdk --checkpoint=.500; ec=$? +if [ $ec -ne 0 ]; then +     echo "Installation failed - exiting." +     exit 1 +fi +``` + +A quick way for you to demonstrate the usage of the **$?** variable is with this short one-liner: + + +``` +`ls T; ec=$?; echo $ec` +``` + +First, run **touch T** followed by this command. The value of **ec** will be 0. Then, delete **T**, **rm T**, and repeat the command. The value of **ec** will now be 2 because ls reports an error condition since **T** was not found. + +You can take advantage of this error reporting to include logic, as I have above, to control the behavior of your scripts. + +### Takeaway + +We might assume that we need to employ languages, such as Python, C, or Java, for higher functionality, but that’s not necessarily true. The Bash scripting language is very powerful. There is a lot to learn to maximize its usefulness. I hope these few examples will shed some light on the potential of coding with Bash. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/improve-bash-scripts + +作者:[Alan Formy-Duval][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003784_02_os.comcareers_os_rh2x.png?itok=jbRfXinl (A person working.) From 909fa992fb18d393ca1463f0f2d57ec01e9d0c51 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Jan 2020 00:55:09 +0800 Subject: [PATCH 257/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200107=20How=20?= =?UTF-8?q?piwheels=20will=20save=20Raspberry=20Pi=20users=20time=20in=202?= =?UTF-8?q?020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md --- ...ll save Raspberry Pi users time in 2020.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md diff --git a/sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md b/sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md new file mode 100644 index 0000000000..aa43d04f90 --- /dev/null +++ b/sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How piwheels will save Raspberry Pi users time in 2020) +[#]: via: (https://opensource.com/article/20/1/piwheels) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + +How piwheels will save Raspberry Pi users time in 2020 +====== +By making pre-compiled Python packages for Raspberry Pi available, the +piwheels project saves users significant time and effort. +![rainbow colors on pinwheels in the sun][1] + +Piwheels automates building Python wheels (pre-compiled Python packages) for all of the projects on [PyPI][2], the Python Package Index, using Raspberry Pi hardware to ensure compatibility. This means that when a Raspberry Pi user wants to install a Python library using **pip**, they get a ready-made compiled version that's guaranteed to work on the Raspberry Pi. This makes it much easier for Raspberry Pi users to dive in and get started with their projects. + +![Piwheels logo][3] + +When I wrote [_piwheels: Speedy Python package installation for the Raspberry Pi_][4] in October 2018, the piwheels project was in its first year and already proving its purpose of saving Raspberry Pi users considerable time and effort. But the project, which makes pre-compiled Python packages available for Raspberry Pi, has come a long way in its second year. + +![Raspberry Pi 4][5] + +### How it works + +[Raspbian][6], the primary OS for Raspberry Pi, comes pre-configured to use piwheels, so users don't need to do anything special to get access to the wheels. + +The configuration file (at **/etc/pip.conf**) tells pip to use [piwheels.org][7] as an _additional index_, so pip looks at PyPI first, then piwheels. The Piwheels website is hosted on a Raspberry Pi 3, and all the wheels built by the project are hosted on that Pi. It serves over 1 million packages per month—not bad for a $35 computer! + +In addition to the main Raspberry Pi that serves the website, the piwheels project uses seven other Pis to build the packages. Some run Raspbian Jessie, building wheels for Python 3.4, some run Raspbian Stretch for Python 3.5, and some run Raspbian Buster for Python 3.7. The project doesn't generally support other Python versions. There's also a "proper server"—a virtual machine running the Postgres database. Since the Pi 3 has just 1GB of RAM, the (very large) database doesn't run well on it, so we moved it to a VM. The Pi 4 with 4GB RAM would probably be suitable, so we may move to this in the future. + +The Pis are all on an IPv6-only network in a "Pi Cloud"—a brilliant service provided by Cambridge-based hosting company [Mythic Beasts][8]. + +![Mythic Beasts hosting service][9] + +### Downloads and trends + +Every time a wheel file is downloaded, it is logged in the database. This provides insight into what packages are most popular and what Python versions and operating systems people are using. We don't have much information from the user agent, but because the architecture of Pi 1/Zero shows as "armv6" and Pi 2/3/4 show as "armv7," we can tell them apart. + +As of mid-December 2019, over 14 million packages have been downloaded from piwheels, with nearly 9 million in 2019 alone. + +The 10 most popular packages since the project's inception are: + + 1. [pycparser][10] (821,060 downloads) + 2. [PyYAML][11] (366,979) + 3. [numpy][12] (354,531) + 4. [cffi][13] (336,982) + 5. [MarkupSafe][14] (318,878) + 6. [future][15] (282,349) + 7. [aiohttp][16] (277,046) + 8. [cryptography][17] (276,167) + 9. [home-assistant-frontend][18] (266,667) + 10. [multidict][19] (256,185) + + + +Note that many pure-Python packages, such as [urllib3][20], are provided as wheels on PyPI; because these are compatible across platforms, they're not usually downloaded from piwheels because PyPI takes precedence. + +We also see trends in things like which Python versions are used over time. This shows the quick takeover of Python 3.7 from 3.5 when Raspbian Buster was released: + +![Data from piwheels on Python versions used over time][21] + +You can see more trends in our [stats blog posts][22]. + +### Time saved + +Every package build is logged in the database, and every download is also stored. Cross-referencing downloads with build duration shows how much time has been saved. One example is numpy—the latest version took about 11 minutes to build. + +So far, piwheels has saved users a total of over 165 years of build time. At the current usage rate, piwheels saves _over 200 days per day_. + +As well as saving build time, having pre-compiled wheels also means people don't have to install various development tools to build packages. Some packages require other apt packages for them to access shared libraries. Figuring out which ones you need can be a pain, so we made that step easier, too. First, we figured out the process and [documented it on our blog][23]. Then we added this logic to the build process so that when a wheel is built, its dependencies are automatically calculated and added to the package's project page: + +![numpy dependencies][24] + +### What next for piwheels? + +We launched project pages (e.g., [numpy][25]) this year, which are a really useful way to let people look up information about a project in a human-readable way. They also make it easier for people to report issues, such as if a project is missing from piwheels or they have an issue with a package they've downloaded. + +In early 2020, we're planning to roll out some upgrades to piwheels that will enable a new JSON API, so you can automatically check which versions are available, look up dependencies for a project, and lots more. + +The next Debian/Raspbian upgrade won't happen until mid-2021, so we won't start building wheels for any new Python versions until then. + +You can read more about piwheels on the project's [blog][26], where I'll be publishing a 2019 roundup early in 2020. You can also follow [@piwheels][27] on Twitter, where you'll see daily and monthly stats along with any milestones reached. + +Of course, piwheels is an open source project, and you can see the entire project [source code on GitHub][28]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/piwheels + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rainbow-pinwheel-piwheel-diversity-inclusion.png?itok=di41Wd3V (rainbow colors on pinwheels in the sun) +[2]: https://pypi.org/ +[3]: https://opensource.com/sites/default/files/uploads/piwheels.png (Piwheels logo) +[4]: https://opensource.com/article/18/10/piwheels-python-raspberrypi +[5]: https://opensource.com/sites/default/files/uploads/raspberry-pi-4_0.jpg (Raspberry Pi 4) +[6]: https://www.raspberrypi.org/downloads/raspbian/ +[7]: http://piwheels.org +[8]: https://www.mythic-beasts.com/order/rpi +[9]: https://opensource.com/sites/default/files/uploads/pi-cloud.png (Mythic Beasts hosting service) +[10]: https://www.piwheels.org/project/pycparser +[11]: https://www.piwheels.org/project/PyYAML +[12]: https://www.piwheels.org/project/numpy +[13]: https://www.piwheels.org/project/cffi +[14]: https://www.piwheels.org/project/MarkupSafe +[15]: https://www.piwheels.org/project/future +[16]: https://www.piwheels.org/project/aiohttp +[17]: https://www.piwheels.org/project/cryptography +[18]: https://www.piwheels.org/project/home-assistant-frontend +[19]: https://www.piwheels.org/project/multidict +[20]: https://piwheels.org/project/urllib3/ +[21]: https://opensource.com/sites/default/files/uploads/pyvers2019.png (Data from piwheels on Python versions used over time) +[22]: https://blog.piwheels.org/piwheels-stats-for-2019/ +[23]: https://blog.piwheels.org/how-to-work-out-the-missing-dependencies-for-a-python-package/ +[24]: https://opensource.com/sites/default/files/uploads/numpy-deps.png (numpy dependencies) +[25]: https://www.piwheels.org/project/numpy/ +[26]: https://blog.piwheels.org/ +[27]: https://twitter.com/piwheels +[28]: https://github.com/piwheels/ From e1088cdf2c4aee98fff42e8232b1227161721579 Mon Sep 17 00:00:00 2001 From: MonkeyDEcho <863626156@qq.com> Date: Wed, 8 Jan 2020 01:20:21 +0800 Subject: [PATCH 258/430] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E8=AF=A5=E6=96=87?= =?UTF-8?q?=E7=AB=A0=EF=BC=8C=E7=BF=BB=E8=AF=9150%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20181105 5 Minimal Web Browsers for Linux.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md index 1fbc18aeae..34c0c1e18e 100644 --- a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md +++ b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MonkeyDEcho ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: subject: (5 Minimal Web Browsers for Linux) @@ -9,19 +9,27 @@ 5 Minimal Web Browsers for Linux ====== +linux上的五种微型浏览器 +====== + ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimal.jpg?itok=ifA0Y3pV) There are so many reasons to enjoy the Linux desktop. One reason I often state up front is the almost unlimited number of choices to be found at almost every conceivable level. From how you interact with the operating system (via a desktop interface), to how daemons run, to what tools you use, you have a multitude of options. +有太多理由去选择使用linux系统。很重要的一个理由是,我们可以按照我们自己的想法去选择想要的。从操作系统的交互方式(桌面系统)到守护系统的运行方式,在到使用的工具,你用更多的选择。 The same thing goes for web browsers. You can use anything from open source favorites, such as [Firefox][1] and [Chromium][2], or closed sourced industry darlings like [Vivaldi][3] and [Chrome][4]. Those options are full-fledged browsers with every possible bell and whistle you’ll ever need. For some, these feature-rich browsers are perfect for everyday needs. +web浏览器也是如此。你可以使用开源的[火狐][1],[Chromium][2];或者未开源的[Vivaldi][3],[Chrome][4]。这些功能强大的浏览器有你需要的各种功能。对于某些人,这些功能完备的浏览器是日常必需的。 There are those, however, who prefer using a web browser without all the frills. In fact, there are many reasons why you might prefer a minimal browser over a standard browser. For some, it’s about browser security, while others look at a web browser as a single-function tool (as opposed to a one-stop shop application). Still others might be running low-powered machines that cannot handle the requirements of, say, Firefox or Chrome. Regardless of the reason, Linux has you covered. +但是,有些人更喜欢没有冗余功能的纯粹的浏览器。实际上,有很多原因导致你会选择微型的浏览器而不选择上述功能完备的浏览器。对于某些人来说,与浏览器的安全有关;而有些人则将浏览器当作一种简单的工具(而不是一站式商店应用程序);还有一些可能运行在低功率的计算机上,这些计算机无法满足火狐,chrome浏览器的运行要求。无论出于何种原因,在linux系统上都可以满足你的要求。 Let’s take a look at five of the minimal browsers that can be installed on Linux. I’ll be demonstrating these browsers on the Elementary OS platform, but each of these browsers are available to nearly every distribution in the known Linuxverse. Let’s dive in. +让我们看一下可以在linux上安装运行的五种微型浏览器。我将在 Elementary 的操作系统平台上演示这些浏览器,在已知的linux发型版中几乎每个版本都可以使用这些浏览器。让我们一起来看一下吧! ### GNOME Web GNOME Web (codename Epiphany, which means [“a usually sudden manifestation or perception of the essential nature or meaning of something”][5]) is the default web browser for Elementary OS, but it can be installed from the standard repositories. (Note, however, that the recommended installation of Epiphany is via Flatpak or Snap). If you choose to install via the standard package manager, issue a command such as sudo apt-get install epiphany-browser -y for successful installation. +GNOME web (Epiphany 含义:[顿悟][5])是Elementary系统默认的web浏览器,也可以从标准存储库中安装。(注意,建议通过使用 Flatpak 或者 Snap 工具安装),如果你想选择标准软件包管理器进行安装,请执行 ```sudo apt-get install epiphany-browser -y``` 命令成功安装。 Epiphany uses the WebKit rendering engine, which is the same engine used in Apple’s Safari browser. Couple that rendering engine with the fact that Epiphany has very little in terms of bloat to get in the way, you will enjoy very fast page-rendering speeds. Epiphany development follows strict adherence to the following guidelines: From 42f1a83728463efea3411631f34a871d0e1305c6 Mon Sep 17 00:00:00 2001 From: MonkeyDEcho <863626156@qq.com> Date: Wed, 8 Jan 2020 01:23:58 +0800 Subject: [PATCH 259/430] fix --- sources/tech/20181105 5 Minimal Web Browsers for Linux.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md index 34c0c1e18e..e3ee66f40a 100644 --- a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md +++ b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md @@ -9,27 +9,20 @@ 5 Minimal Web Browsers for Linux ====== -linux上的五种微型浏览器 -====== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimal.jpg?itok=ifA0Y3pV) There are so many reasons to enjoy the Linux desktop. One reason I often state up front is the almost unlimited number of choices to be found at almost every conceivable level. From how you interact with the operating system (via a desktop interface), to how daemons run, to what tools you use, you have a multitude of options. -有太多理由去选择使用linux系统。很重要的一个理由是,我们可以按照我们自己的想法去选择想要的。从操作系统的交互方式(桌面系统)到守护系统的运行方式,在到使用的工具,你用更多的选择。 The same thing goes for web browsers. You can use anything from open source favorites, such as [Firefox][1] and [Chromium][2], or closed sourced industry darlings like [Vivaldi][3] and [Chrome][4]. Those options are full-fledged browsers with every possible bell and whistle you’ll ever need. For some, these feature-rich browsers are perfect for everyday needs. -web浏览器也是如此。你可以使用开源的[火狐][1],[Chromium][2];或者未开源的[Vivaldi][3],[Chrome][4]。这些功能强大的浏览器有你需要的各种功能。对于某些人,这些功能完备的浏览器是日常必需的。 There are those, however, who prefer using a web browser without all the frills. In fact, there are many reasons why you might prefer a minimal browser over a standard browser. For some, it’s about browser security, while others look at a web browser as a single-function tool (as opposed to a one-stop shop application). Still others might be running low-powered machines that cannot handle the requirements of, say, Firefox or Chrome. Regardless of the reason, Linux has you covered. -但是,有些人更喜欢没有冗余功能的纯粹的浏览器。实际上,有很多原因导致你会选择微型的浏览器而不选择上述功能完备的浏览器。对于某些人来说,与浏览器的安全有关;而有些人则将浏览器当作一种简单的工具(而不是一站式商店应用程序);还有一些可能运行在低功率的计算机上,这些计算机无法满足火狐,chrome浏览器的运行要求。无论出于何种原因,在linux系统上都可以满足你的要求。 Let’s take a look at five of the minimal browsers that can be installed on Linux. I’ll be demonstrating these browsers on the Elementary OS platform, but each of these browsers are available to nearly every distribution in the known Linuxverse. Let’s dive in. -让我们看一下可以在linux上安装运行的五种微型浏览器。我将在 Elementary 的操作系统平台上演示这些浏览器,在已知的linux发型版中几乎每个版本都可以使用这些浏览器。让我们一起来看一下吧! ### GNOME Web GNOME Web (codename Epiphany, which means [“a usually sudden manifestation or perception of the essential nature or meaning of something”][5]) is the default web browser for Elementary OS, but it can be installed from the standard repositories. (Note, however, that the recommended installation of Epiphany is via Flatpak or Snap). If you choose to install via the standard package manager, issue a command such as sudo apt-get install epiphany-browser -y for successful installation. -GNOME web (Epiphany 含义:[顿悟][5])是Elementary系统默认的web浏览器,也可以从标准存储库中安装。(注意,建议通过使用 Flatpak 或者 Snap 工具安装),如果你想选择标准软件包管理器进行安装,请执行 ```sudo apt-get install epiphany-browser -y``` 命令成功安装。 Epiphany uses the WebKit rendering engine, which is the same engine used in Apple’s Safari browser. Couple that rendering engine with the fact that Epiphany has very little in terms of bloat to get in the way, you will enjoy very fast page-rendering speeds. Epiphany development follows strict adherence to the following guidelines: From ad719218b29a617feb3d0fe931e90c9976409350 Mon Sep 17 00:00:00 2001 From: MonkeyDEcho <863626156@qq.com> Date: Wed, 8 Jan 2020 01:31:32 +0800 Subject: [PATCH 260/430] Update 20181105 5 Minimal Web Browsers for Linux.md --- sources/tech/20181105 5 Minimal Web Browsers for Linux.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md index e3ee66f40a..70d75f74e7 100644 --- a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md +++ b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md @@ -9,7 +9,6 @@ 5 Minimal Web Browsers for Linux ====== - ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimal.jpg?itok=ifA0Y3pV) There are so many reasons to enjoy the Linux desktop. One reason I often state up front is the almost unlimited number of choices to be found at almost every conceivable level. From how you interact with the operating system (via a desktop interface), to how daemons run, to what tools you use, you have a multitude of options. From 1cd57105714a3362b0c1acc0e74a58da5c0c5c79 Mon Sep 17 00:00:00 2001 From: MonkeyDEcho <863626156@qq.com> Date: Wed, 8 Jan 2020 01:35:03 +0800 Subject: [PATCH 261/430] fix --- sources/tech/20181105 5 Minimal Web Browsers for Linux.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md index 70d75f74e7..34c0c1e18e 100644 --- a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md +++ b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md @@ -9,19 +9,27 @@ 5 Minimal Web Browsers for Linux ====== +linux上的五种微型浏览器 +====== + ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimal.jpg?itok=ifA0Y3pV) There are so many reasons to enjoy the Linux desktop. One reason I often state up front is the almost unlimited number of choices to be found at almost every conceivable level. From how you interact with the operating system (via a desktop interface), to how daemons run, to what tools you use, you have a multitude of options. +有太多理由去选择使用linux系统。很重要的一个理由是,我们可以按照我们自己的想法去选择想要的。从操作系统的交互方式(桌面系统)到守护系统的运行方式,在到使用的工具,你用更多的选择。 The same thing goes for web browsers. You can use anything from open source favorites, such as [Firefox][1] and [Chromium][2], or closed sourced industry darlings like [Vivaldi][3] and [Chrome][4]. Those options are full-fledged browsers with every possible bell and whistle you’ll ever need. For some, these feature-rich browsers are perfect for everyday needs. +web浏览器也是如此。你可以使用开源的[火狐][1],[Chromium][2];或者未开源的[Vivaldi][3],[Chrome][4]。这些功能强大的浏览器有你需要的各种功能。对于某些人,这些功能完备的浏览器是日常必需的。 There are those, however, who prefer using a web browser without all the frills. In fact, there are many reasons why you might prefer a minimal browser over a standard browser. For some, it’s about browser security, while others look at a web browser as a single-function tool (as opposed to a one-stop shop application). Still others might be running low-powered machines that cannot handle the requirements of, say, Firefox or Chrome. Regardless of the reason, Linux has you covered. +但是,有些人更喜欢没有冗余功能的纯粹的浏览器。实际上,有很多原因导致你会选择微型的浏览器而不选择上述功能完备的浏览器。对于某些人来说,与浏览器的安全有关;而有些人则将浏览器当作一种简单的工具(而不是一站式商店应用程序);还有一些可能运行在低功率的计算机上,这些计算机无法满足火狐,chrome浏览器的运行要求。无论出于何种原因,在linux系统上都可以满足你的要求。 Let’s take a look at five of the minimal browsers that can be installed on Linux. I’ll be demonstrating these browsers on the Elementary OS platform, but each of these browsers are available to nearly every distribution in the known Linuxverse. Let’s dive in. +让我们看一下可以在linux上安装运行的五种微型浏览器。我将在 Elementary 的操作系统平台上演示这些浏览器,在已知的linux发型版中几乎每个版本都可以使用这些浏览器。让我们一起来看一下吧! ### GNOME Web GNOME Web (codename Epiphany, which means [“a usually sudden manifestation or perception of the essential nature or meaning of something”][5]) is the default web browser for Elementary OS, but it can be installed from the standard repositories. (Note, however, that the recommended installation of Epiphany is via Flatpak or Snap). If you choose to install via the standard package manager, issue a command such as sudo apt-get install epiphany-browser -y for successful installation. +GNOME web (Epiphany 含义:[顿悟][5])是Elementary系统默认的web浏览器,也可以从标准存储库中安装。(注意,建议通过使用 Flatpak 或者 Snap 工具安装),如果你想选择标准软件包管理器进行安装,请执行 ```sudo apt-get install epiphany-browser -y``` 命令成功安装。 Epiphany uses the WebKit rendering engine, which is the same engine used in Apple’s Safari browser. Couple that rendering engine with the fact that Epiphany has very little in terms of bloat to get in the way, you will enjoy very fast page-rendering speeds. Epiphany development follows strict adherence to the following guidelines: From 0e6d1adb756702f050b674b34988029175449188 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 8 Jan 2020 08:43:15 +0800 Subject: [PATCH 262/430] translated --- ...VLC More Awesome With These Simple Tips.md | 131 ----------------- ...VLC More Awesome With These Simple Tips.md | 132 ++++++++++++++++++ 2 files changed, 132 insertions(+), 131 deletions(-) delete mode 100644 sources/tech/20191214 Make VLC More Awesome With These Simple Tips.md create mode 100644 translated/tech/20191214 Make VLC More Awesome With These Simple Tips.md diff --git a/sources/tech/20191214 Make VLC More Awesome With These Simple Tips.md b/sources/tech/20191214 Make VLC More Awesome With These Simple Tips.md deleted file mode 100644 index a4dd3b7bd5..0000000000 --- a/sources/tech/20191214 Make VLC More Awesome With These Simple Tips.md +++ /dev/null @@ -1,131 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Make VLC More Awesome With These Simple Tips) -[#]: via: (https://itsfoss.com/simple-vlc-tips/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Make VLC More Awesome With These Simple Tips -====== - -[VLC][1] is one of the [best open source video players][2], if not the best. What most people don’t know about it is that it is a lot more than just a video player. - -You can do a lot of complex tasks like broadcasting live videos, capturing devices etc. Just open its menu and you’ll see how many options it has. - -It’s FOSS has a detailed tutorial discussing some of the [pro VLC tricks][3] but those are way too complicated for normal users. - -This is why I am writing another article to show you some of the simple tips that you can use with VLC. - -### Do more with VLC with these simple tips - -Let’s see what can you do with VLC other than just playing a video file. - -#### 1\. Watch YouTube videos with VLC - -![][4] - -If you do not want to watch the annoying advertisements on [YouTube][5] or simply want a distraction-free experience for watching a YouTube video, you can use VLC. - -Yes, it is very easy to stream a YouTube video on VLC. - -Simply launch the VLC player, head to the Media settings and click on “**Open Network Stream**” or **CTRL + N** as a shortcut to that. - -![][6] - -Next, you just have to paste the URL of the video that you want to watch. There are some options to tweak – usually, you should not bother using them. But, if you are curious you can click on the “**Advanced options**” to explore. - -You can also add subtitles to the YouTube videos this way. However, an easier way to [watch YouTube or any online video with subtitles is using Penguin subtitle player][7]. - -#### 2\. Convert videos to different formats - -![][8] - -You can [use ffmpeg to convert videos in Linux command line][9]. You can also use a graphical tool like [HandBrake to convert video formats][10]. - -But if you do not want a separate app to transcode videos, you can use VLC media player to get the job done. - -To do that, just head on to the Media option on VLC and then click on “**Convert/Save**” or press CTRL + R as a shortcut to get there while you have VLC media player active. - -Next, you will need to either import the video from your computer/disk or paste the URL of the video that you want to save/convert. - -Whatever your input source is – just hit the “**Convert/Save**” button after selecting the file. - -Now, you will find another window that gives you the option to change the “**Profile**” from the settings. Click on it and choose a format that you’d like the video to be converted to (and saved). - -You can also change the storage path for the converted file by setting the destination folder at the bottom of the screen before converting it. - -#### 3\. Record Audio/Video From Source - -![Vlc Advanced Controls][11] - -Do you want to record the audio/video you’re playing on VLC Media Player? - -If yes, there’s an easy solution to that. Simply navigate your way through **View->click on “Advanced Controls”**. - -Once you do that, you should observe new buttons (including a red record button in your VLC player). - -#### 4\. Download subtitles automatically - -![][12] - -Yes, you can [automatically download subtitles with VLC][13]. You do not even have to look for it on a separate website. You just have to navigate your way to **View->VLSub**. - -By default, it is deactivated, so when you click on the option it gets activated and lets you search/download the subtitles you wanted. - -[VLC also lets you synchronize the subtitles][14] with simple keyboard shortcuts. - -#### 5\. Take A Snapshot - -![][15] - -With VLC, you can get some screenshots/images of the video while watching it. - -You just need to right-click on the player while the video is playing/paused, you will notice a bunch of options now, navigate through **Video->Take Snapshot**. - -If you have an old version installed, you might observe the snapshot option right after performing a right-click. - -#### Bonus Tip: Add Audio/Video Effects to a video - -From the menu, go to the “**Tools**” option. Now, click on “**Effects and Filters**” or simply press **CTRL + E** from the VLC player window to open up the option. - -Here, you can observe audio effects and video effects that you can add to your video. You may not be able to see all the changes in real-time, so you will have to tweak it and save it in order to see what happens. - -![][16] - -I’ll suggest keeping a backup of the original video before you modify the video. - -#### What’s your favorite VLC tip? - -I shared some of my favourite VLC tips. Do you know some cool tip that you use regularly with VLC? Why not share it with us? I may add it to the list here. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/simple-vlc-tips/ - -作者:[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.videolan.org/ -[2]: https://itsfoss.com/video-players-linux/ -[3]: https://itsfoss.com/vlc-pro-tricks-linux/ -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/youtube-video-stream.jpg?ssl=1 -[5]: https://www.youtube.com/ -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/youtube-video-play.jpg?ssl=1 -[7]: https://itsfoss.com/penguin-subtitle-player/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc-video-convert.jpg?ssl=1 -[9]: https://itsfoss.com/ffmpeg/ -[10]: https://itsfoss.com/handbrake/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc-advanced-controls.png?ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc-subtitles-automatic.png?ssl=1 -[13]: https://itsfoss.com/download-subtitles-automatically-vlc-media-player-ubuntu/ -[14]: https://itsfoss.com/how-to-synchronize-subtitles-with-movie-quick-tip/ -[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc-snapshot.png?ssl=1 -[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc-effects-screenshot.jpg?ssl=1 diff --git a/translated/tech/20191214 Make VLC More Awesome With These Simple Tips.md b/translated/tech/20191214 Make VLC More Awesome With These Simple Tips.md new file mode 100644 index 0000000000..7363cb7992 --- /dev/null +++ b/translated/tech/20191214 Make VLC More Awesome With These Simple Tips.md @@ -0,0 +1,132 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Make VLC More Awesome With These Simple Tips) +[#]: via: (https://itsfoss.com/simple-vlc-tips/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +这些简单的技巧使 VLC 更加出色 +====== + +如果 [VLC][1] 不是最好的播放器,那它是[最好的开源视频播放器][2]之一。大多数人不知道的是,它不仅仅是视频播放器。 + +你可以进行许多复杂的任务,如直播视频、捕捉设备等。只需打开菜单,你就可以看到它有多少选项。 + +它的 FOSS 页面有一个详细的教程,讨论一些[专业的 VLC 技巧][3],但这些对于普通用户太复杂。 + +这就是为什么我写另一篇文章的原因,来向你展示一些可以在 VLC 中使用的简单技巧。 + +### 使用这些简单技巧让 VLC 做更多事 + +Let’s see what can you do with VLC other than just playing a video file. +让我们看看除了播放视频文件之外,你还可以使用 VLC 做什么。 + +#### 1\. 使用 VLC 观看 YouTube 视频 + +![][4] + +如果你不想在 [YouTube][5] 上观看令人讨厌的广告,或者只想体验没有打扰地观看 YouTube 视频,你可以使用 VLC。 + +是的,在 VLC 上流式传输 YouTube 视频是非常容易的。 + +只需启动 VLC 播放器,前往媒体设置,然后单击 ”**Open Network Stream**“ 或使用快捷方式 **CTRL + N**。 + +![][6] + +接下来,你只需要粘贴要观看的视频的 URL。有一些选项可以调整,但通常你无需担心这些。如果你好奇,你可以点击 ”**Advanced options**“ 来探索。 + +你还可以通过这种方式向 YouTube 视频添加字幕。然而,[一个更简单的带字幕观看 Youtube 视频的办法是使用 Penguin 字幕播放器][7]。 + +#### 2\. 将视频转换为不同格式 + +![][8] + +你可以[在 Linux 命令行使用 ffmpeg 转换视频][9]。你还可以使用图形工具,如 [HandBrake 转换视频格式][10]。 + +但是,如果你不想用一个单独的应用转码视频,你可以使用 VLC 播放器来完成该工作。 + +为此,只需点击 VLC 上的媒体选项,然后单击 **Convert/Save**,或者在 VLC 播放器处于活动状态时按下快捷键 CTRL + R。 + +接下来,你需要从计算机/硬盘或者 URL 导入你想保存/转换的的视频。 + +不管什么来源,只需选择文件后点击 ”**Convert/Save**“ 按钮 + +你现在会看到另外一个窗口给你更改 ”**Profile**“ 设置。点击并选择你想转换的格式(并保存)。 + +你还可以在转换之前通过在屏幕底部设置目标文件夹来更改转换文件的存储路径。 + +#### 3\. 从源录制音频/视频 + +![Vlc Advanced Controls][11] + +你是否想在 VLC 播放器中录制正在播放的音频/视频? + +如果是的话,有一个简单的解决方案。只需**通过 View,然后点击 ”Advanced Controls“**。 + +完成后,你会看到一个新按钮(包括 VLC 播放器中的红色录制按钮)。 + +#### 4\. 自动下载字幕 + +![][12] + +是的,你可以[使用 VLC 自动下载字幕][13]。你甚至不必在单独的网站上查找字幕。你只需点击 **View->VLSub**。 + +默认情况下,它是禁用的,因此当你单击该选项时,它会被激活,并允许你搜索/下载想要的字幕。 + +[VLC 还能让你使用简单的键盘快捷键同步字幕][14] + +#### 5\. 截图 + +![][15] + +你可以在观看视频时使用 VLC 获取一些视频的截图/图像。 + +你只需在视频播放/暂停时右击播放器,你会看到一组选项,点击 **Video->Take Snapshot**。 + +如果安装了旧版本,你可能在右键时看到截图选项。 + +#### 额外技巧:给视频添加音频/视频效果 + +在菜单中,进入 ”**Tools**“ 选项。单击 ”**Effects and Filters**“,或者在 VLC 播放器窗口中按 **CTRL + E** 打开选项。 + +好了,你可以观察你给视频添加的音频和视频效果了。你也许无法实时看到效果,因此你需要调整并保存来看发生了什么。 + +![][16] + +我建议在修改视频之前保存一份原始视频备份。 + +#### 你最喜欢的 VLC 技巧是什么? + +我分享了一些我最喜欢的 VLC 技巧。你知道什么你经常使用的很酷的 VLC 技巧吗?为什么不和我们分享呢?我可以把它添加到列表中。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/simple-vlc-tips/ + +作者:[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.videolan.org/ +[2]: https://itsfoss.com/video-players-linux/ +[3]: https://itsfoss.com/vlc-pro-tricks-linux/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/youtube-video-stream.jpg?ssl=1 +[5]: https://www.youtube.com/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/youtube-video-play.jpg?ssl=1 +[7]: https://itsfoss.com/penguin-subtitle-player/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc-video-convert.jpg?ssl=1 +[9]: https://itsfoss.com/ffmpeg/ +[10]: https://itsfoss.com/handbrake/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc-advanced-controls.png?ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc-subtitles-automatic.png?ssl=1 +[13]: https://itsfoss.com/download-subtitles-automatically-vlc-media-player-ubuntu/ +[14]: https://itsfoss.com/how-to-synchronize-subtitles-with-movie-quick-tip/ +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc-snapshot.png?ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/vlc-effects-screenshot.jpg?ssl=1 From 4a0eed84886d7440734a2900198135556a798d83 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 8 Jan 2020 08:47:19 +0800 Subject: [PATCH 263/430] translating --- .../tech/20200105 PaperWM- tiled window management for GNOME.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200105 PaperWM- tiled window management for GNOME.md b/sources/tech/20200105 PaperWM- tiled window management for GNOME.md index 0948014fba..fa99f6c352 100644 --- a/sources/tech/20200105 PaperWM- tiled window management for GNOME.md +++ b/sources/tech/20200105 PaperWM- tiled window management for GNOME.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f213a05ee5b45f7a12ca8772157b6ccc91268dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=B3=A5?= <24203166+fuzheng1998@users.noreply.github.com> Date: Wed, 8 Jan 2020 10:29:19 +0800 Subject: [PATCH 264/430] Update 20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md --- ...- EA is Permanently Banning Linux Gamers on Battlefield V.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md b/sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md index b0d8bb3874..b0818e5fe8 100644 --- a/sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md +++ b/sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (fuzheng1998) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d25e4d31152b2f43164afb5e92fdac207274fb37 Mon Sep 17 00:00:00 2001 From: BrunoJu Date: Wed, 8 Jan 2020 11:59:16 +0800 Subject: [PATCH 265/430] Update 20200107 Kali Linux Will No Longer Have The Default Root User.md --- ...0107 Kali Linux Will No Longer Have The Default Root User.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md b/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md index 2ffcd8f715..0f087529b9 100644 --- a/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md +++ b/sources/tech/20200107 Kali Linux Will No Longer Have The Default Root User.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (BrunoJu) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7114530f7fa58b5a473b638039ad6bcf7db09bca Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Jan 2020 13:55:50 +0800 Subject: [PATCH 266/430] PRF @wxy --- ...191130 7 maker gifts for kids and teens.md | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/translated/tech/20191130 7 maker gifts for kids and teens.md b/translated/tech/20191130 7 maker gifts for kids and teens.md index 59bc3fc837..002e97e442 100644 --- a/translated/tech/20191130 7 maker gifts for kids and teens.md +++ b/translated/tech/20191130 7 maker gifts for kids and teens.md @@ -1,15 +1,16 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (7 maker gifts for kids and teens) [#]: via: (https://opensource.com/article/19/11/maker-gifts-kids) [#]: author: (Jess Weichler https://opensource.com/users/cyanide-cupcake) -7 个给儿童和少年的创客礼物 +给儿童和青少年的 7 件创客礼物 ====== -> 这份礼物指南可给婴儿、儿童、青少年及年龄更大的人们带来创造和创新能力,使你轻松完成节日礼物的采购。 + +> 这份礼物指南使你轻松完成节日礼物的采购,它们可给婴儿、儿童、青少年及年龄更大的人们带来创造和创新能力。 ![Gift box opens with colors coming out][1] @@ -19,13 +20,13 @@ ![Hummingbird Robotics Kit][2] -**年龄:**8 岁 - 成人 +**年龄:**8 岁 - 成人 -**这是什么:**[蜂鸟机器人套件][3]是一套完整的机器人套件,带有微控制器、电机、LED 和传感器。机器人的大脑具有特殊的端口,小手可以轻松地将其连接到机器人的组件上。蜂鸟套件并没有身体,鼓励用户自己创建一个。 +**这是什么:**[蜂鸟机器人套件][3]是一套完整的机器人套件,带有微控制器、电机、LED 和传感器。机器人的大脑具有特殊的端口,小手可以轻松地将其连接到机器人的组件上。蜂鸟套件并没有身体,而是鼓励用户自己创建一个。 **为什么我喜欢它:**蜂鸟可以使用多种编程语言 —— 从可视化编程(BirdBlox、MakeCode、Snap)到代码编程(Python 和 Java)—— 可以随着用户编码技能的提高而可扩展。所有组件均与你在电子商店中找到的组件完全相同,没有像其他机器人套件那样被塑料所遮盖。这使机器人的内部工作不再神秘,并在你需要时易于采购更多零件。 -由于没有固定组合项目,因此蜂鸟是发挥创造力的完美机器人。 +由于没有固定组装项目,因此蜂鸟是发挥创造力的完美机器人。 蜂鸟具有开源的软件和固件。它适用于 Linux、Windows、Mac、Chromebook、Android 和 iOS。 @@ -37,7 +38,7 @@ **年龄:** 6岁 - 成人 -**这是什么:** [Makey Makey 经典版][5]可将任何导电物体(从棉花糖到朋友)变成计算机钥匙。 +**这是什么:** [Makey Makey 经典版][5]可将任何导电物体(从棉花糖到你的朋友)变成计算机钥匙。 你可以使用鳄鱼夹将 Makey Makey 连接到你选择的导电物体上。然后,通过同时触摸两个导电物体来闭合接地和任何触发键之间的电路。Makey Makey 是一种安全的方法,可以安全地在家中探索电力,同时创造与计算机进行交互的有趣方式。 @@ -51,11 +52,11 @@ **年龄:** 10 岁 - 成人 -**这是什么:** Arduino 是随同电子套件购买的微控制器,也可以单独购买,它们具有多种版本,尽管我最喜欢[Arduino Uno][7]。可以根据需要从任何电子商店购买其他组件,例如 LED、电机和传感器。 +**这是什么:** Arduino 是随同电子套件购买的微控制器,也可以单独购买,它们具有多种版本,而我最喜欢 [Arduino Uno][7]。你可以根据需要从任何电子商店购买其他组件,例如 LED、电机和传感器。 **为什么我喜欢它:** Arduino Uno 的文档很完善,因此创客们很容易在线上找到教程。Arduino 可以实现从简单到复杂的各种电子项目。Arduino 具有开源的固件和硬件。它适用于 Linux、Mac 和 Windows。 -**费用:**主板的起价为 22.00 美元。总成本取决于项目和技能水平。 +**费用:** 主板的起价为 22.00 美元。总成本取决于项目和技能水平。 ### DIY 创客套件 @@ -63,7 +64,7 @@ **年龄**:8 岁 - 成人 -**这是什么:**当今许多创客、发明家和程序员都是从碰巧修补附加的东西开始的。你可以快速前往最近的电子产品商店,为家里的年轻人创建一套出色的创客工具包。这是我的创客工具包中的内容: +**这是什么:**当今许多创客、发明家和程序员都是从鼓捣碰巧出现在身边东西开始的。你可以快速前往最近的电子产品商店,为家里的年轻人创建一套出色的创客工具包。这是我的创客工具包中的内容: * 护目镜 * 锤子 @@ -74,7 +75,7 @@ * LED * 压电蜂鸣器 * 马达 -* 带引线的AA电池组 +* 带引线的 AA 电池组 * 剪线钳 * 纸板 * 美纹纸胶带 @@ -85,7 +86,7 @@ * 拉链 * 钩子 * 一个很酷的工具盒,用来存放所有东西 -   + **我为什么喜欢它:**还记得小时候,你把父母带回家的空纸箱变成了宇宙飞船、房屋或超级计算机吗?这就是为大孩子们准备的 DIY 创客工具包。 原始的组件使孩子们可以尝试并运用他们的想象力。DIY 创客工具包可以完全针对接收者定制。可以放入一些接受这份礼品的人可能从未想到过用之发挥创意的某些组件,例如为下水道提供一些 LED 或木工结构。 @@ -98,7 +99,7 @@ **年龄:** 8 个月至 5 岁 -**这是什么:**启发式游戏篮充满了由天然、无毒材料制成的有趣物品,可供婴幼儿使用其五种感官进行探索。这是一种开放式、自娱自乐的游戏。其想法是,成年人将监督(但不指导)儿童使用篮子及其物品半小时,然后将篮子拿走下一次再玩。 +**这是什么:**启发式游戏篮充满了由天然、无毒材料制成的有趣物品,可供婴幼儿使用其五种感官进行探索。这是一种开放式、自娱自乐的游戏。其想法是,成年人将监督(但不指导)儿童使用篮子及其物品半小时,然后将篮子拿走,等下一次再玩。 创建带有常见家用物品的可爱游戏篮很容易。尝试包括质地、声音、气味、形状和重量各不相同的物品。这里有一些想法可以帮助您入门。 @@ -107,7 +108,7 @@ * 金属打蛋器和汤匙 * 板刷 * 海绵 -* 小鸡蛋纸箱 +* 小型鸡蛋纸箱 * 纸板管 * 小擀面杖 * 带纹理的毛巾 @@ -120,7 +121,7 @@ **我为什么喜欢它:**游戏篮非常适合感官发育,并可以帮助幼儿提出问题和探索周围的世界。这是培养创客思维方式的重要组成部分! -很容易获得适合这个游戏篮的物品。你可能已经在家中或附近的二手店里有很多有趣的物品。幼儿使用游戏篮的方式与婴儿不同。随着孩子开始模仿成人生活并通过他们的游戏讲故事,这些物品将随孩子一起成长。 +很容易获得适合这个游戏篮的物品。你可能已经在家中或附近的二手商店里找到了很多有趣的物品。幼儿使用游戏篮的方式与婴儿不同。随着孩子们开始模仿成人生活并通过他们的游戏讲故事,这些物品将随孩子一起成长。 **费用:**不等 @@ -130,7 +131,7 @@ **年龄**:5-8 岁 -**这是什么:** 《[Hello Ruby][11]:编码历险记》是 Linda Liukas 的插图书,通过有趣的故事讲述了一个遇到各种问题和朋友(每个都用一个码代表)的女孩,向孩子们介绍了编程概念。Liukas 还有其他副标题为《互联网探险》和《计算机内的旅程》的《Hello Ruby》书籍,而《编码历险记》已以 20 多种语言出版。 +**这是什么:** 《[Hello Ruby][11]:编码历险记》是 Linda Liukas 的插图书,通过有趣的故事讲述了一个遇到各种问题和朋友(每个都用一个码代表)的女孩,向孩子们介绍了编程概念。Liukas 还有其他副标题为《互联网探险》和《计算机内的旅程》的《Hello Ruby》系列书籍,而《编码历险记》已以 20 多种语言出版。 **为什么我喜欢它:**作者在书中附带了许多免费、有趣和无障碍的活动,可以从 Hello Ruby 网站下载和打印这些活动。这些活动教授编码概念、还涉及艺术表达、沟通、甚至时间安排。 @@ -144,7 +145,7 @@ **内容是什么:**由《编程少女》的创始人 Reshma Saujani 撰写,《[编程少女:学会编程和改变世界][13]》为年轻女孩(以及男孩)提供了科技领域的实用信息。它涵盖了广泛的主题,包括编程语言、用例、术语和词汇、职业选择以及技术行业人士的个人简介和访谈。 -**为什么我喜欢它:**本书以讲述了大多数面向成年人的网站没有的技术故事。技术涉及许多学科,对于年轻人来说,重要的是要了解他们可以使用它来解决现实世界中的问题并有所作为。 +**为什么我喜欢它:**本书以讲述了大多数面向成年人的网站都没有的技术故事。这些技术涉及许多学科,对于年轻人来说,重要的是要了解他们可以使用它来解决现实世界中的问题并有所作为。 **成本:**精装书的标价为 17.99 美元,平装书的标价为 10.99 美元,但你可以通过本地或在线书店以更低的价格找到。 @@ -155,7 +156,7 @@ via: https://opensource.com/article/19/11/maker-gifts-kids 作者:[Jess Weichler][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5fea83c3ca13a218e3c68bf908fdf9c11c93033f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Jan 2020 14:08:32 +0800 Subject: [PATCH 267/430] PUB @wxy https://linux.cn/article-11762-1.html --- .../20191130 7 maker gifts for kids and teens.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20191130 7 maker gifts for kids and teens.md (98%) diff --git a/translated/tech/20191130 7 maker gifts for kids and teens.md b/published/20191130 7 maker gifts for kids and teens.md similarity index 98% rename from translated/tech/20191130 7 maker gifts for kids and teens.md rename to published/20191130 7 maker gifts for kids and teens.md index 002e97e442..c92bcc29c9 100644 --- a/translated/tech/20191130 7 maker gifts for kids and teens.md +++ b/published/20191130 7 maker gifts for kids and teens.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11762-1.html) [#]: subject: (7 maker gifts for kids and teens) [#]: via: (https://opensource.com/article/19/11/maker-gifts-kids) [#]: author: (Jess Weichler https://opensource.com/users/cyanide-cupcake) @@ -12,7 +12,7 @@ > 这份礼物指南使你轻松完成节日礼物的采购,它们可给婴儿、儿童、青少年及年龄更大的人们带来创造和创新能力。 -![Gift box opens with colors coming out][1] +![](https://img.linux.net.cn/data/attachment/album/202001/08/140516t4ewey9ryu24tpz5.jpg) 还在纠结这个假期给年轻人买什么礼物?这是我精选的开源礼物,这些礼物将激发未来的创意和灵感。 From 50e8ec4229d440d6ca3ab56aa765b1d1eaaecef7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Jan 2020 00:53:24 +0800 Subject: [PATCH 268/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200108=20How=20?= =?UTF-8?q?to=20setup=20multiple=20monitors=20in=20sway?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200108 How to setup multiple monitors in sway.md --- ... How to setup multiple monitors in sway.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20200108 How to setup multiple monitors in sway.md diff --git a/sources/tech/20200108 How to setup multiple monitors in sway.md b/sources/tech/20200108 How to setup multiple monitors in sway.md new file mode 100644 index 0000000000..f156d204dc --- /dev/null +++ b/sources/tech/20200108 How to setup multiple monitors in sway.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to setup multiple monitors in sway) +[#]: via: (https://fedoramagazine.org/how-to-setup-multiple-monitors-in-sway/) +[#]: author: (arte219 https://fedoramagazine.org/author/arte219/) + +How to setup multiple monitors in sway +====== + +![][1] + +Sway is a tiling Wayland compositor which has mostly the same features, look and workflow as the [i3 X11 window manager][2]. Because Sway uses Wayland instead of X11, the tools to setup X11 don’t always work in sway. This includes tools like _xrandr_, which are used in X11 window managers or desktops to setup monitors. This is why monitors have to be setup by editing the sway config file, and that’s what this article is about. + +## **Getting your monitor ID’s** + +First, you have to get the names sway uses to refer to your monitors. You can do this by running: + +``` +$ swaymsg -t get_outputs +``` + +You will get information about all of your monitors, every monitor separated by an empty line. + +You have to look for the first line of every section, and for what’s after “Output”. For example, when you see a line like “_Output DVI-D-1 ‘Philips Consumer Electronics Company’_”, the output ID is “DVI-D-1”. Note these ID’s and which physical monitors they belong to. + +## **Editing the config file** + +If you haven’t edited the Sway config file before, you have to copy it to your home directory by running this command: + +``` +cp -r /etc/sway/config ~/.config/sway/config +``` + +Now the default config file is located in _~/.config/sway_ and called “config”. You can edit it using any text editor. + +Now you have to do a little bit of math. Imagine a grid with the origin in the top left corner. The units of the X and Y coordinates are pixels. The Y axis is inverted. This means that if you, for example, start at the origin and you move 100 pixels to the right and 80 pixels down, your coordinates will be (100, 80). + +You have to calculate where your displays are going to end up on this grid. The locations of the displays are specified with the top left pixel. For example, if we want to have a monitor with name HDMI1 and a resolution of 1920×1080, and to the right of it a laptop monitor with name eDP1 and a resolution of 1600×900, you have to type this in your config file: + +``` +output HDMI1 pos 0 0 +output eDP1 pos 1920 0 +``` + +You can also specify the resolutions manually by using the _res_ option:  + +``` +output HDMI1 pos 0 0 res 1920x1080 +output eDP1 pos 1920 0 res 1600x900 +``` + +## **Binding workspaces to monitors** + +Using sway with multiple monitors can be a little bit tricky with workspace management. Luckily, you can bind workspaces to a specific monitor, so you can easily switch to that monitor and use your displays more efficiently. This can simply be done by the workspace command in your config file. For example, if you want to bind workspace 1 and 2 to monitor DVI-D-1 and workspace 8 and 9 to monitor HDMI-A-1, you can do that by using: + +``` +workspace 1 output DVI-D-1 +workspace 2 output DVI-D-1 +``` + +``` +workspace 8 output HDMI-A-1 +workspace 9 output HDMI-A-1 +``` + +That’s it! These are the basics of multi monitor setup in sway. A more detailed guide can be found at . + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-setup-multiple-monitors-in-sway/ + +作者:[arte219][a] +选题:[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/arte219/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/sway-multiple-monitors-816x345.png +[2]: https://fedoramagazine.org/getting-started-i3-window-manager/ From 233e9833d0e95677b396bf973cd430454f508085 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Jan 2020 00:53:46 +0800 Subject: [PATCH 269/430] add done: 20200108 How to setup multiple monitors in sway.md --- ...duction to the Linux goto shell utility.md | 599 ++++++++++++++++++ 1 file changed, 599 insertions(+) create mode 100644 sources/tech/20200107 Introduction to the Linux goto shell utility.md diff --git a/sources/tech/20200107 Introduction to the Linux goto shell utility.md b/sources/tech/20200107 Introduction to the Linux goto shell utility.md new file mode 100644 index 0000000000..b683f34449 --- /dev/null +++ b/sources/tech/20200107 Introduction to the Linux goto shell utility.md @@ -0,0 +1,599 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Introduction to the Linux goto shell utility) +[#]: via: (https://opensource.com/article/20/1/directories-autocomplete-linux) +[#]: author: (Lazarus Lazaridis https://opensource.com/users/iridakos) + +Introduction to the Linux goto shell utility +====== +Learn how to use goto to alias and navigate to directories with +autocomplete in Linux. +![Files in a folder][1] + +The goto shell utility allows users to navigate to aliased directories and also supports autocompletion. + +## How it works + +Before you can use goto, you need to register your directory aliases. For example: + + +``` +`goto -r dev /home/iridakos/development` +``` + +then change to that directory, e.g.: + + +``` +`goto dev` +``` + +![goto demo][2] + +## Autocompletion in goto + +**goto** comes with a nice autocompletion script—whenever you press the Tab key after the **goto** command, Bash or Zsh will prompt you with suggestions of the aliases that are available: + + +``` +$ goto <tab> +bc /etc/bash_completion.d                     +dev /home/iridakos/development +rubies /home/iridakos/.rvm/rubies +``` + +## Installing goto + +There are several ways to install goto. + +### Via script + +Clone the repository and run the install script as a superuser or root: + + +``` +git clone +cd goto +sudo ./install +``` + +### Manually + +Copy the file **goto.sh** somewhere in your filesystem and add a line in your **.zshrc** or **.bashrc** to source it. + +For example, if you placed the file in your home folder, all you have to do is add the following line to your **.zshrc** or **.bashrc** file: + + +``` +`source ~/goto.sh` +``` + +### MacOS Homebrew + +A formula named **goto** is available for the Bash shell in MacOS: + + +``` +`brew install goto` +``` + +### Add colored output + + +``` +`echo -e "\$include /etc/inputrc\nset colored-completion-prefix on" >> ~/.inputrc` +``` + +**Notes:** + + * You need to restart your shell after installation. + * You need to have the Bash completion feature enabled for Bash in MacOS (see this [issue][3]). + * You can install it with **brew install bash-completion** if you don't have it enabled. + + + +## Ways to use goto + +### Change to an aliased directory + +To change to an aliased directory, type: + + +``` +`goto ` +``` + +For example: + + +``` +`goto dev` +``` + +### Register an alias + +To register a directory alias, type: + + +``` +`goto -r ` +``` + +or + + +``` +`goto --register ` +``` + +For example: + + +``` +`goto -r blog /mnt/external/projects/html/blog` +``` + +or + + +``` +`goto --register blog /mnt/external/projects/html/blog` +``` + +**Notes:** + + * **goto** **expands** the directories, so you can easily alias your current directory with the following command and it will automatically be aliased to the whole path: [code]`goto -r last_release .` +``` + * Pressing the Tab key after the alias name provides the shell's default directory suggestions. + + + +### Unregister an alias + +To unregister an alias, use: +``` +`goto -u ` +``` +or +``` +`goto --unregister ` +``` +For example: +``` +`goto -u last_release` +``` +or +``` +`goto --unregister last_release` +``` +**Note:** By pressing the Tab key after the command (**-u** or **\--unregister**), the completion script will prompt you with the list of registered aliases. + +### List aliases + +To get a list of your currently registered aliases, use: +``` +`goto -l` +``` +or +``` +`goto --list` +``` +### Expand an alias + +To expand an alias to its value, use: +``` +`goto -x ` +``` +or +``` +`goto --expand ` +``` +For example: +``` +`goto -x last_release` +``` +or +``` +`goto --expand last_release` +``` +### Clean up aliases + +To clean up the aliases from directories that are no longer accessible in your filesystem, use: +``` +`goto -c` +``` +or +``` +`goto --cleanup` +``` +### Get help + +To view the tool's help information, use: +``` +`goto -h` +``` +or +``` +`goto --help` +``` +### Check the version + +To view the tool's version, use: +``` +`goto -v` +``` +or +``` +`goto --version` +``` +### Push before changing directories + +To push the current directory onto the directory stack before changing directories, type: +``` +`goto -p ` +``` +or +``` +`goto --push ` +``` +### Revert to a pushed directory + +To return to a pushed directory, type: +``` +`goto -o` +``` +or +``` +`goto --pop` +``` +**Note:** This command is equivalent to **popd** but within the **goto** command. + +## Troubleshooting + +If you see the error **command not found: compdef** in Zsh, it means you need to load **bashcompinit**. To do so, append this to your **.zshrc** file: +``` + + +autoload bashcompinit +bashcompinit + +``` +## Get involved + +The goto tool is open source under the [MIT License][4] terms, and contributions are welcomed. To learn more, visit the [Contributing][5] section in goto's GitHub repository. + +## The goto script +``` + + +goto() +{ +  local target +  _goto_resolve_db + +  if [ -z "$1" ]; then +    # display usage and exit when no args +    _goto_usage +    return +  fi + +  subcommand="$1" +  shift +  case "$subcommand" in +    -c|--cleanup) +      _goto_cleanup "$@" +      ;; +    -r|--register) # Register an alias +      _goto_register_alias "$@" +      ;; +    -u|--unregister) # Unregister an alias +      _goto_unregister_alias "$@" +      ;; +    -p|--push) # Push the current directory onto the pushd stack, then goto +      _goto_directory_push "$@" +      ;; +    -o|--pop) # Pop the top directory off of the pushd stack, then change that directory +      _goto_directory_pop +      ;; +    -l|--list) +      _goto_list_aliases +      ;; +    -x|--expand) # Expand an alias +      _goto_expand_alias "$@" +      ;; +    -h|--help) +      _goto_usage +      ;; +    -v|--version) +      _goto_version +      ;; +    *) +      _goto_directory "$subcommand" +      ;; +  esac +  return $? +} + +_goto_resolve_db() +{ +  GOTO_DB="${GOTO_DB:-$HOME/.goto}" +  touch -a "$GOTO_DB" +} + +_goto_usage() +{ +  cat <<\USAGE +usage: goto [<option>] <alias> [<directory>] + +default usage: +  goto <alias> \- changes to the directory registered for the given alias + +OPTIONS: +  -r, --register: registers an alias +    goto -r|--register <alias> <directory> +  -u, --unregister: unregisters an alias +    goto -u|--unregister <alias> +  -p, --push: pushes the current directory onto the stack, then performs goto +    goto -p|--push <alias> +  -o, --pop: pops the top directory from the stack, then changes to that directory +    goto -o|--pop +  -l, --list: lists aliases +    goto -l|--list +  -x, --expand: expands an alias +    goto -x|--expand <alias> +  -c, --cleanup: cleans up non existent directory aliases +    goto -c|--cleanup +  -h, --help: prints this help +    goto -h|--help +  -v, --version: displays the version of the goto script +    goto -v|--version +USAGE +} + +# Displays version +_goto_version() +{ +  echo "goto version 1.2.4.1" +} + +# Expands directory. +# Helpful for ~, ., .. paths +_goto_expand_directory() +{ +  builtin cd "$1" 2>/dev/null && pwd +} + +# Lists registered aliases. +_goto_list_aliases() +{ +  local IFS=$' ' +  if [ -f "$GOTO_DB" ]; then +    while read -r name directory; do +      printf '\e[1;36m%20s  \e[0m%s\n' "$name" "$directory" +    done < "$GOTO_DB" +  else +    echo "You haven't configured any directory aliases yet." +  fi +} + +# Expands a registered alias. +_goto_expand_alias() +{ +  if [ "$#" -ne "1" ]; then +    _goto_error "usage: goto -x|--expand <alias>" +    return +  fi + +  local resolved + +  resolved=$(_goto_find_alias_directory "$1") +  if [ -z "$resolved" ]; then +    _goto_error "alias '$1' does not exist" +    return +  fi + +  echo "$resolved" +} + +# Lists duplicate directory aliases +_goto_find_duplicate() +{ +  local duplicates= + +  duplicates=$(sed -n 's:[^ ]* '"$1"'$:&:p' "$GOTO_DB" 2>/dev/null) +  echo "$duplicates" +} + +# Registers and alias. +_goto_register_alias() +{ +  if [ "$#" -ne "2" ]; then +    _goto_error "usage: goto -r|--register <alias> <directory>" +    return 1 +  fi + +  if ! [[ $1 =~ ^[[:alnum:]]+[a-zA-Z0-9_-]*$ ]]; then +    _goto_error "invalid alias - can start with letters or digits followed by letters, digits, hyphens or underscores" +    return 1 +  fi + +  local resolved +  resolved=$(_goto_find_alias_directory "$1") + +  if [ -n "$resolved" ]; then +    _goto_error "alias '$1' exists" +    return 1 +  fi + +  local directory +  directory=$(_goto_expand_directory "$2") +  if [ -z "$directory" ]; then +    _goto_error "failed to register '$1' to '$2' - can't cd to directory" +    return 1 +  fi + +  local duplicate +  duplicate=$(_goto_find_duplicate "$directory") +  if [ -n "$duplicate" ]; then +    _goto_warning "duplicate alias(es) found: \\\n$duplicate" +  fi + +  # Append entry to file. +  echo "$1 $directory" >> "$GOTO_DB" +  echo "Alias '$1' registered successfully." +} + +# Unregisters the given alias. +_goto_unregister_alias() +{ +  if [ "$#" -ne "1" ]; then +    _goto_error "usage: goto -u|--unregister <alias>" +    return 1 +  fi + +  local resolved +  resolved=$(_goto_find_alias_directory "$1") +  if [ -z "$resolved" ]; then +    _goto_error "alias '$1' does not exist" +    return 1 +  fi + +  # shellcheck disable=SC2034 +  local readonly GOTO_DB_TMP="$HOME/.goto_" +  # Delete entry from file. +  sed "/^$1 /d" "$GOTO_DB" > "$GOTO_DB_TMP" && mv "$GOTO_DB_TMP" "$GOTO_DB" +  echo "Alias '$1' unregistered successfully." +} + +# Pushes the current directory onto the stack, then goto +_goto_directory_push() +{ +  if [ "$#" -ne "1" ]; then +    _goto_error "usage: goto -p|--push <alias>" +    return +  fi + +  { pushd . || return; } 1>/dev/null 2>&1 + +  _goto_directory "$@" +} + +# Pops the top directory from the stack, then goto +_goto_directory_pop() +{ +  { popd || return; } 1>/dev/null 2>&1 +} + +# Unregisters aliases whose directories no longer exist. +_goto_cleanup() +{ +  if ! [ -f "$GOTO_DB" ]; then +    return +  fi + +  while IFS= read -r i && [ -n "$i" ]; do +    echo "Cleaning up: $i" +    _goto_unregister_alias "$i" +  done <<< "$(awk '{al=$1; $1=""; dir=substr($0,2); +                    system("[ ! -d \"" dir "\" ] && echo " al)}' "$GOTO_DB")" +} + +# Changes to the given alias' directory +_goto_directory() +{ +  local target + +  target=$(_goto_resolve_alias "$1") || return 1 + +  builtin cd "$target" 2> /dev/null || \ +    { _goto_error "Failed to goto '$target'" && return 1; } +} + +# Fetches the alias directory. +_goto_find_alias_directory() +{ +  local resolved + +  resolved=$(sed -n "s/^$1 \\\\(.*\\\\)/\\\1/p" "$GOTO_DB" 2>/dev/null) +  echo "$resolved" +} + +# Displays the given error. +# Used for common error output. +_goto_error() +{ +  (>&2 echo -e "goto error: $1") +} + +# Displays the given warning. +# Used for common warning output. +_goto_warning() +{ +  (>&2 echo -e "goto warning: $1") +} + +# Displays entries with aliases starting as the given one. +_goto_print_similar() +{ +  local similar + +  similar=$(sed -n "/^$1[^ ]* .*/p" "$GOTO_DB" 2>/dev/null) +  if [ -n "$similar" ]; then +    (>&2 echo "Did you mean:") +    (>&2 column -t <<< "$similar") +  fi +} + +# Fetches alias directory, errors if it doesn't exist. +_goto_resolve_alias() +{ +  local resolved + +  resolved=$(_goto_find_alias_directory "$1") + +  if [ -z "$resolved" ]; then +    _goto_error "unregistered alias $1" +    _goto_print_similar "$1" +    return 1 +  else +    echo "${resolved}" +  fi +} + +# Completes the goto function with the available commands +_complete_goto_commands() +{ +  local IFS=$' \t\n' + +  # shellcheck disable=SC2207 +  COMPREPLY=($(compgen -W "-r --register -u --unregister -p --push -o --pop -l --list -x --expand -c --cleanup -v --version" -- "$1")) +} + +# Completes the goto function with the available aliases +_complete_goto_aliases() +{ +  local IFS=$'\n' matches +  _goto_resolve_db + +  # shellcheck disable=SC2207 +  matches=($(sed -n "/^$1/p" "$GOTO_DB" 2>/dev/null)) + +  if [ "${#matches[@]}" -eq "1" ]; then +    # remove the filenames attribute from the completion method +    compopt +o filenames 2>/dev/null + +    # if you find only one alias don't append the directory +    COMPREPLY=("${matches[0]// *}") +  else +    for i in "${!matches[@]}"; do +      # remove the filenames attribute from the completion method +      compopt +o filenames 2>/dev/null + +      if ! [[ $(uname -s) =~ Darwin* ]]; then +        matches[$i]=$(printf '%*s' "-$COLUMNS" "${matches[$i]}") + +        COMPREPLY+=("$(compgen -W "${matches[$i]}")") +      els \ No newline at end of file From e1c683242121cb7793991a55ca35754e11cdb387 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Jan 2020 00:57:11 +0800 Subject: [PATCH 270/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200109=20Huawei?= =?UTF-8?q?=E2=80=99s=20Linux=20Distribution=20openEuler=20is=20Available?= =?UTF-8?q?=20Now!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200109 Huawei-s Linux Distribution openEuler is Available Now.md --- ...Distribution openEuler is Available Now.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20200109 Huawei-s Linux Distribution openEuler is Available Now.md diff --git a/sources/tech/20200109 Huawei-s Linux Distribution openEuler is Available Now.md b/sources/tech/20200109 Huawei-s Linux Distribution openEuler is Available Now.md new file mode 100644 index 0000000000..93c4330b52 --- /dev/null +++ b/sources/tech/20200109 Huawei-s Linux Distribution openEuler is Available Now.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Huawei’s Linux Distribution openEuler is Available Now!) +[#]: via: (https://itsfoss.com/openeuler/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Huawei’s Linux Distribution openEuler is Available Now! +====== + +Huawei offers a CentOS based enterprise Linux distribution called EulerOS. Recently, Huawei has released a community edition of EulerOS called [openEuler][1]. + +The source code of openEuler is released as well. You won’t find it on Microsoft owned GitHub – the source code is available at [Gitee][2], a Chinese [alternative of GitHub][3]. + +There are two separate repositories, one for the [source code][2] and the other as a [package source][4] to store software packages that help to build the OS. + +![][5] + +The openEuler infrastructure team shared their experience to make the source code available: + +> We are very excited at this moment. It was hard to imagine that we will manage thousands of repositories. And to ensure that they can be compiled successfully, we would like to thank all those who participated in contributing + +### openEuler is a Linux distribution based on CentOS + +Like EulerOS, openEuler OS is also based on [CentOS][6] but is further developed by Huawei Technologies for enterprise applications. + +It is tailored for ARM64 architecture servers and Huawei claims to have made changes to boost its performance. You can read more about it at [Huawei’s dev blog][7]. + +![][8] + +At the moment, as per the official openEuler announcement, there are more than 50 contributors with nearly 600 commits for openEuler. + +The contributors made it possible to make the source code available to the community. + +It is also worth noting that the repositories also include two new projects (or sub-projects) associated with it, [iSulad][9] **and A-Tune**. + +A-Tune is an AI-based OS tuning software and iSulad is a lightweight container runtime daemon that is designed for IoT and Cloud infrastructure, as mentioned on [Gitee][2]. + +Also, the official [announcement post][10] mentioned that these systems are built on the Huawei Cloud through script automation. So, that is definitely something interesting. + +### Downloading openEuler + +![][11] + +As of now, you won’t find the documentation for it in English – so you will have to wait for it or choose to help them with the [documentation][12]. + +You can download the ISO directly from its [official website][13] to test it out: + +[Download openEuler][13] + +### What do you think of Huawei openEuler? + +As per cnTechPost, Huawei had announced that EulerOS would become open source under the new name openEuler. + +At this point, it’s not clear if openEuler is replacing EulerOS or both will exist together like CentOS (community edition) and Red Hat (commercial edition). + +I haven’t tested it yet so I cannot say if openEuler is suitable for English speaking users or not. + +Are you willing to give this a try? In case you’ve already tried it out, feel free to let me know your experience with it in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/openeuler/ + +作者:[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://openeuler.org/en/ +[2]: https://gitee.com/openeuler +[3]: https://itsfoss.com/github-alternatives/ +[4]: https://gitee.com/src-openeuler +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/openEuler-website.jpg?ssl=1 +[6]: https://www.centos.org/ +[7]: https://developer.huaweicloud.com/en-us/euleros/euleros-introduction.html +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/openeuler-gitee.jpg?ssl=1 +[9]: https://gitee.com/openeuler/iSulad +[10]: https://openeuler.org/en/news/20200101.html +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/openEuler.jpg?ssl=1 +[12]: https://gitee.com/openeuler/docs +[13]: https://openeuler.org/en/download.html From 2fde18756ccb5a314085545668e8b2a53dc0c5e8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Jan 2020 00:57:48 +0800 Subject: [PATCH 271/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200108=206=20re?= =?UTF-8?q?quirements=20of=20cloud-native=20software?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200108 6 requirements of cloud-native software.md --- ...6 requirements of cloud-native software.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/tech/20200108 6 requirements of cloud-native software.md diff --git a/sources/tech/20200108 6 requirements of cloud-native software.md b/sources/tech/20200108 6 requirements of cloud-native software.md new file mode 100644 index 0000000000..fcdbe9818c --- /dev/null +++ b/sources/tech/20200108 6 requirements of cloud-native software.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 requirements of cloud-native software) +[#]: via: (https://opensource.com/article/20/1/cloud-native-software) +[#]: author: (Daniel Oh https://opensource.com/users/daniel-oh) + +6 requirements of cloud-native software +====== +A checklist for developing and implementing cloud-native +(container-first) software. +![Team checklist][1] + +For many years, monolithic applications were the standard enterprise architecture for achieving business requirements. But that changed significantly once cloud infrastructure began treating business acceleration at scale and speed. Application architectures have also transformed to fit into the cloud-native applications and the [microservices][2], [serverless][3], and event-driven services that are running on immutable infrastructures across hybrid and multi-cloud platforms. + +### The cloud-native connection to Kubernetes + +According to the [Cloud Native Computing Foundation][4] (CNCF): + +> "Cloud native technologies empower organizations to build and run scalable applications in modern, dynamic environments such as public, private, and hybrid clouds. Containers, service meshes, microservices, immutable infrastructure, and declarative APIs exemplify this approach. +> +> "These techniques enable loosely coupled systems that are resilient, manageable, and observable. Combined with robust automation, they allow engineers to make high-impact changes frequently and predictably with minimal toil." + +Container orchestration platforms like [Kubernetes][5] allow DevOps teams to build immutable infrastructures to develop, deploy, and manage application services. The speed at which rapid iteration is possible now aligns with business needs. Developers building containers to run in Kubernetes need an effective place to do so. + +### Requirements for cloud-native software + +What capabilities are required to create a cloud-native application architecture, and what benefits will developers gain from it? + +While there are many ways to build and architect cloud-native applications, the following are some ingredients to consider: + + * **Runtimes:** They are more likely to be written in the container-first or/and Kubernetes-native language, which means runtimes such as Java, Node.js, Go, Python, and Ruby. + * **Security:** When deploying and maintaining applications in a multi-cloud or hybrid cloud application environment, security is of utmost importance and should be part of the environment. + * **Observability:** Use tools such as Prometheus, Grafana, and Kiali that can enhance observability by providing realtime metrics and more information about how applications are being used and behave in the cloud. + * **Efficiency:** Focus on a tiny memory footprint, small artifact size, and fast boot time to make applications portable across hybrid/multi-cloud platforms. + * **Interoperability:** Integrate cloud-native apps with open source technologies that enable you to meet the requirements listed above, including Infinispan, MicroProfile, Hibernate, Kafka, Jaeger, Prometheus, and more, for building standard runtime architectures. + * **DevOps/DevSecOps:** These methodologies are designed for continuous deployment to production, in-line with the minimum viable product (MVP) and with security as part of the tooling. + + + +### Making cloud-native concrete + +Cloud-native can seem like an abstract term, but reviewing the definition and thinking like a developer can make it more concrete. In order for cloud-native applications to be successful, they need to include a long, well-defined list of ingredients. + +How are you planning for cloud-native application design? Share your thoughts in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/cloud-native-software + +作者:[Daniel Oh][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://opensource.com/resources/what-are-microservices +[3]: https://opensource.com/article/18/11/open-source-serverless-platforms +[4]: https://github.com/cncf/toc/blob/master/DEFINITION.md +[5]: https://opensource.com/resources/what-is-kubernetes From 97617dac363ed042ac5eb37338cfd2741aa08e8d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Jan 2020 00:58:21 +0800 Subject: [PATCH 272/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200108=20Automa?= =?UTF-8?q?ting=20the=20creation=20of=20research=20artifacts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200108 Automating the creation of research artifacts.md --- ...ting the creation of research artifacts.md | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 sources/tech/20200108 Automating the creation of research artifacts.md diff --git a/sources/tech/20200108 Automating the creation of research artifacts.md b/sources/tech/20200108 Automating the creation of research artifacts.md new file mode 100644 index 0000000000..e5d3f96163 --- /dev/null +++ b/sources/tech/20200108 Automating the creation of research artifacts.md @@ -0,0 +1,232 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Automating the creation of research artifacts) +[#]: via: (https://opensource.com/article/20/1/automating-documentation) +[#]: author: (Kiko Fernandez-Reyes https://opensource.com/users/kikofernandez) + +Automating the creation of research artifacts +====== +A simple way to automate generating source code documentation, creating +HTML and PDF versions of user documentation, compiling a technical +(research) document to PDF, generating the bibliography, and +provisioning virtual machines. +![Files in a folder][1] + +In my work as a programming language researcher, I need to create [artifacts][2] that are easy to understand and well-documented. To make my work easier, I found a simple way to automate generating source code documentation, creating HTML and PDF versions of user documentation, compiling a technical (research) document to PDF, generating the bibliography, and provisioning of virtual machines with the software artefact installed for ease of reproducibility of my research. + +The tools I use are: + + * [Make][3] makefiles for overall orchestration of all components + * [Haddock][4] for generating source code documentation + * [Pandoc][5] for generating PDF and HTML files from a Markdown file + * [Vagrant][6] for provisioning virtual machines + * [Stack][7] for downloading Haskell dependencies, compiling, running tests, etc + * [pdflaTeX][8] for compiling a LaTeX file to PDF format + * [BibTeX][9] for generating a bibliography + * [Zip][10] to pack everything and get it ready for distribution + + + +I use the following folder and file structure: + + +``` +├── Makefile +├── Vagrantfile +├── code +│   └── typechecker-oopl (Project) +│       ├── Makefile +│       └── ... +│ +├── documentation +│   ├── Makefile +│   ├── README.md +│   ├── assets +│   │   ├── pandoc.css (Customised CSS for Pandoc) +│   │   └── submitted-version.pdf (PDF of your research) +│   └── meta.yaml +│ +├── research +│   ├── Makefile +│   ├── ACM-Reference-Format.bst +│   ├── acmart.cls +│   ├── biblio.bib +│   └── typecheckingMonad.tex +``` + +The Makefile glues together the output from all of the tools listed above. The **code** folder contains the source code of the tool/language I created. The **documentation** folder contains a Makefile that has instructions on how to generate PDF and HTML versions of the user instructions, located in the README.md file. I generate the PDF and HTML user documentation using Pandoc. The **assets** are simply the CSS style to use and a PDF of my research article that will be hyperlinked from the user-generated documentation, so that it is easy to follow. **meta.yaml** contains meta instructions for generating the user documentation, used by Pandoc for e.g., for author names. The **research** folder contains my research article in LaTeX format, but it could hold any other technical document. + +As you can see in the structure, I have a [Makefile][11] for each folder to decouple each Makefile's responsibility and keep a (somewhat) maintainable design. Here is an overview of the top-level Makefile, which orchestrates generating the user documentation, research paper, bibliography, documentation from source code, and provisioning of a virtual machine. + + +``` +all: doc gen + +doc: +        make -C $(DOC_SRC) $@ +        make -C $(CODE_PATH) $@ +        make -C $(RESEARCH) + +gen: +        # Creation of folder with artefact, empty at the moment +        mkdir -p $(ARTEFACT_FOLDER) + +        # Moving user documentation to artefact folder +        cp $(DOC_SRC)/$(README).pdf $(ARTEFACT_FOLDER) +        cp $(DOC_SRC)/$(README).html $(ARTEFACT_FOLDER) +        cp -r $(DOC_SRC)/$(ASSETS) $(ARTEFACT_FOLDER) + +        # Moving research article to artefact folder +        cp $(RESEARCH)/$(RESEARCH_PAPER).pdf $(ARTEFACT_FOLDER)/$(ASSETS)/submitted-version.pdf + +        # Moving code and autogenerated doc to artefact folder +        cp -r $(CODE_PATH) $(ARTEFACT_FOLDER) +        cd $(ARTEFACT_FOLDER)/$(CODE_SRC) +        $(STACK) +        cd ../.. +        rm -rf $(ARTEFACT_FOLDER)/$(DOC_SRC) +        mv $(ARTEFACT_FOLDER)/$(CODE_SRC)/$(HADDOCK) $(ARTEFACT_FOLDER)/$(DOC_SRC) + +        # zip it! +        zip $(ZIP_FILE) $(ARTEFACT_FOLDER) + +update: +        vagrant up +        vagrant provision + +clean: +        rm -rf $(ARTEFACT_FOLDER) + +.PHONY: all clean doc gen update +``` + +First, the **doc** target generates the user documentation using Pandoc, then it uses Haddock to generate the documentation from the Haskell library source code, and finally, it creates a PDF from the LaTeX file. As depicted in the image below, the generated user documentation is in HTML and CSS. The user documentation contains links to the generated source code documentation, also in HTML and CSS, and to the technical (research) paper . The generated source code documentation links directly to the source code, in case the reader would like to understand the implementation. + +![Artifact automation structure][12] + +The user documentation is generated with the following Makefile: + + +``` +DOCS=README.md +META=meta.yaml +NUMBER_SECTION_HEADINGS=-N + +.PHONY: all doc clean + +all: doc + +doc: $(DOC) +        pandoc -s $(META) $(DOCS) --listings --pdf-engine=xelatex -c assets/pandoc.css -o $(DOCS:md=pdf) +        pandoc -s $(META) $(DOCS) --self-contained -c assets/pandoc.css -o $(DOCS:md=html) + +clean: +        rm $(DOCS:md=pdf) $(DOCS:md=html) +``` + +To generate documentation from Haskell code, I use this other Makefile, which makes use of Stack to compile the library and download dependencies, and Haddock (inside its OPTS, or options) to create documentation in HMTL: + + +``` +OPTS=exec -- haddock --html --hyperlinked-source --odir=docs + +doc: +        stack $(OPTS) src/Initial/AST.hs src/Initial/Typechecker.hs \ +        src/Reader/AST.hs src/Reader/Typechecker.hs \ +        src/Backtrace/AST.hs src/Backtrace/Typechecker.hs \ +        src/Warning/AST.hs src/Warning/Typechecker.hs \ +        src/MultiError/AST.hs src/MultiError/Typechecker.hs \ +        src/PhantomFunctors/AST.hs src/PhantomFunctors/Typechecker.hs \ +        src/PhantomPhases/AST.hs src/PhantomPhases/Typechecker.hs \ +        src/Applicative/AST.hs src/Applicative/Typechecker.hs \ +        src/Final/AST.hs src/Final/Typechecker.hs + +.PHONY: doc +``` + +I compile the research paper from LaTeX to PDF with this simple Makefile: + + +``` +.PHONY: research + +research: +        pdflatex typecheckingMonad.tex +        bibtex typecheckingMonad +        pdflatex typecheckingMonad.tex +        pdflatex typecheckingMonad.tex +``` + +The virtual machine (VM) relies on Vagrant and the Vagrantfile, where I can write all the commands to set up the VM. The one thing that I do not know how to automate is moving all of the documentation, once it is generated, into the VM. If you know how to transfer the file from the host machine to the VM, please share your solution in the comments. That means that, currently, I manually enter in the VM and place the documentation in the Desktop folder. + + +``` +# All Vagrant configuration is done below. The "2" in Vagrant.configure +# configures the configuration version (we support older styles for +# backwards compatibility). Please don't change it unless you know what +# you're doing. +Vagrant.configure("2") do |config| +  config.vm.box = "ubuntu/trusty64" +  config.ssh.username = "vagrant" +  config.ssh.password = "vagrant" +  config.vm.provider "virtualbox" do |vb| +    # Display the VirtualBox GUI when booting the machine +    vb.gui = true + +    # Customize the amount of memory on the VM: +    vb.memory = "2048" +    vb.customize ["modifyvm", :id, "--vram", "64"] +  end +  config.vm.provision "shell", inline: <<-SHELL +    ## Installing dependencies, comment after this has been done once. +    # sudo apt-get update -y +    # sudo apt-get install ubuntu-desktop -y +    # sudo apt-get install -y build-essential linux-headers-server + +    # echo 'PATH="/home/vagrant/.local/bin:$PATH"' >> /home/vagrant/.profile + +    ## Comment and remove the folder sharing before submission +    mkdir -p /home/vagrant/Desktop/TypeChecker +    cp -r /vagrant/artefact-submission/* /home/vagrant/Desktop/TypeChecker/ +    chown -R vagrant:vagrant /home/vagrant/Desktop/TypeChecker/ +  SHELL +end +``` + +With this final step, everything has been wired. You can see one example of the result [in HTML][13] and [in PDF][14]. I have created a [GitHub repo with all the source code][15] for ease of study and reproducibility. + +I have used this setup for two conferences—the European Conference on Object-Oriented Programming (ECOOP) and the International Conference on Software Language Engineering (SLE), where we won (in both) the Disguinshed Artifact Award. + +Pinterest software engineer Baogang Song tells us about Pinrepo, Pinterest's open source solution... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/automating-documentation + +作者:[Kiko Fernandez-Reyes][a] +选题:[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/kikofernandez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder) +[2]: https://en.wikipedia.org/wiki/Artifact_%28software_development%29 +[3]: https://en.wikipedia.org/wiki/Make_%28software%29 +[4]: https://www.haskell.org/haddock/ +[5]: https://pandoc.org/ +[6]: https://www.vagrantup.com/ +[7]: https://docs.haskellstack.org/en/stable/README/ +[8]: https://linux.die.net/man/1/pdflatex +[9]: http://www.bibtex.org/ +[10]: https://linux.die.net/man/1/zip +[11]: https://opensource.com/article/18/8/what-how-makefile +[12]: https://opensource.com/sites/default/files/uploads/makefile_pandoc_haddock.png (Artifact automation structure) +[13]: https://www.plresearcher.com/files/monadic-typechecker/README.html +[14]: https://www.plresearcher.com/files/monadic-typechecker/README.pdf +[15]: https://github.com/kikofernandez/pandoc-examples/tree/master/artefact-creation From 19eadcbbf2a66030e12856229b463f6a45cd897c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Jan 2020 00:58:49 +0800 Subject: [PATCH 273/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200108=20Detect?= =?UTF-8?q?ing=20CPU=20steal=20time=20in=20guest=20virtual=20machines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200108 Detecting CPU steal time in guest virtual machines.md --- ...PU steal time in guest virtual machines.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20200108 Detecting CPU steal time in guest virtual machines.md diff --git a/sources/tech/20200108 Detecting CPU steal time in guest virtual machines.md b/sources/tech/20200108 Detecting CPU steal time in guest virtual machines.md new file mode 100644 index 0000000000..ed532cecd5 --- /dev/null +++ b/sources/tech/20200108 Detecting CPU steal time in guest virtual machines.md @@ -0,0 +1,70 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Detecting CPU steal time in guest virtual machines) +[#]: via: (https://opensource.com/article/20/1/cpu-steal-time) +[#]: author: (Jamie Fargen https://opensource.com/users/jamiefargen) + +Detecting CPU steal time in guest virtual machines +====== +Is your VM getting all of its vitamin CPU? Use GNU top to find out +what's causing guest performance issues. +![and old computer and a new computer, representing migration to new software or hardware][1] + +CPU steal time is defined in the [GNU **top**][2] command as "time stolen from [a] VM by the hypervisor." CPU steal time occurs when a hypervisor process and a guest instance are trying to utilize the same hypervisor physical core (pCPU) at the same time. This results in less processor time available to the guest's virtual CPU (vCPU) and performance degradation for the guest. + +In today's virtualized environments (which have become nearly universal with the adoption of public and private clouds), a guest instance can experience performance CPU steal time under several scenarios: + + * Oversubscription of the hypervisor and multiple guest VMs' vCPUs with high CPU utilization are running on the same pCPUs. + * The guest vCPU and its emulator thread are pinned to the same pCPU resulting in vhost processes stealing CPU time from the guest vCPU while processing I/O. + * Hypervisor processes, like monitoring, logging, and I/O processes, are concurrently using a pCPU that is also in use by a guest VM vCPU. + + + +Normally, a systems engineer brought in to investigate an application or system performance issue will find that the system's performance is degraded due to CPU time stolen from the guest. The guest's performance issues usually become apparent in the form of low disk or network I/O performance, network packet loss, and other application performance anomalies. + +Even when a system administrator is observing the guest and the hypervisor, it can be difficult to narrow down the cause of the guest instance's degraded performance due to CPU steal time. There are a few reasons for the difficulty. First, CPU steal time is not logged by any of the commonly monitored log files. A hypervisor that is being observed may be expected to be under heavy load but steal time can occur on hypervisors that are under normal load. And finally, administrators may not be aware that hypervisor CPU contention can be observed from within the guest VM instance using GNU top. + +Fortunately, GNU top indeed makes it quite easy to detect CPU steal time on a guest VM instance. Steal time is displayed in top's output at the end of line 3, which beings with **%Cpu(s)**, as shown in the following screenshots (it is the value at the end, labeled **st**.) The first example shows a guest with little steal time: + +![Output of the top command showing low CPU steal time][3] + +Output of the top command from a guest experiencing a low CPU steal time of 0.2 st. + +This screenshot shows a guest experiencing heavy CPU steal time: + +![Output of the top command showing high CPU steal time][4] + +Output of the top command from a guest experiencing a heavy CPU steal time of 9.0 st. + +In both examples, the stress tool was executed with four processes that consumed all four vCPUs of the guest instance. In the first example, the hypervisor was relatively idle, so the guest's steal time was just 0.2. But in the second example, the stress tool was executed at the same time on the hypervisor with eight processes that consumed all eight of the hypervisors' pCPUs, which produced a high CPU steal time of 9.0. + +There is another sign of steal time in the second example: the stress utility process cannot consume ~100% of the guests' vCPUs; it can only consume 99.3%, 99.3%, 86.4%, and 74.4%, respectively. In total, this is equal to 40.3% of a guest vCPU's being stolen. This is because the hypervisor is consuming cycles on the same pCPUs that the guest vCPU's processes are using. + +### Using top to mitigate poor performance + +This example shows how the oversubscription of guest VM instances and other processes on a hypervisor can contend with a guest, and how to use GNU top to detect it based on the CPU steal time percentage on a guest VM. + +It is important to detect this type of performance degradation in a guest VM so that you can mitigate the cause of poor system and application performance. In a public cloud, the only solution might be migrating the instance or changing to an instance type with guaranteed pCPU service-level agreements (SLAs). In a private cloud, there are more options, but again, the simplest approach may be to migrate the instance to a hypervisor with lower utilization. However, if many guest instances experience high CPU steal time, you will need to make changes to how guests' and hypervisors' processes are managed to attain guest instances' performance SLAs. + +David Both explains the importance of keeping hardware cool and shares some Linux tools that can... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/cpu-steal-time + +作者:[Jamie Fargen][a] +选题:[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/jamiefargen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/migration_innovation_computer_software.png?itok=VCFLtd0q (and old computer and a new computer, representing migration to new software or hardware) +[2]: https://en.wikipedia.org/wiki/Top_(software) +[3]: https://opensource.com/sites/default/files/uploads/cpu-steal-time_1.png (Output of the top command showing low CPU steal time) +[4]: https://opensource.com/sites/default/files/uploads/cpu-steal-time_2.png (Output of the top command showing high CPU steal time) From ee350a59516a6c51bce189bc7e0a8300bb70af6f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Jan 2020 01:01:41 +0800 Subject: [PATCH 274/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200107=20Genera?= =?UTF-8?q?ting=20numeric=20sequences=20with=20the=20Linux=20seq=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200107 Generating numeric sequences with the Linux seq command.md --- ...ic sequences with the Linux seq command.md | 165 ++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 sources/tech/20200107 Generating numeric sequences with the Linux seq command.md diff --git a/sources/tech/20200107 Generating numeric sequences with the Linux seq command.md b/sources/tech/20200107 Generating numeric sequences with the Linux seq command.md new file mode 100644 index 0000000000..9375e70fa6 --- /dev/null +++ b/sources/tech/20200107 Generating numeric sequences with the Linux seq command.md @@ -0,0 +1,165 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Generating numeric sequences with the Linux seq command) +[#]: via: (https://www.networkworld.com/article/3511954/generating-numeric-sequences-with-the-linux-seq-command.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Generating numeric sequences with the Linux seq command +====== +The Linux seq command can generate lists of numbers and at lightning speed. It's easy to use and flexible, too. +[Jamie][1] [(CC BY 2.0)][2] + +One of the easiest ways to generate a list of numbers in Linux is to use the **seq** (sequence) command. In its simplest form, **seq** will take a single number and then list all the numbers from 1 to that number. For example: + +``` +$ seq 5 +1 +2 +3 +4 +5 +``` + +Unless directed otherwise, **seq** always starts with 1. You can start a sequence with a different number by inserting it before the final number. + +``` +$ seq 3 5 +3 +4 +5 +``` + +### Specifying an increment + +You can also specify an increment. Say you want to list multiples of 3. Specify your starting point (first 3 in this example), increment (second 3) and end point (18). + +[][3] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][3] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +``` +$ seq 3 3 18 +3 +6 +9 +12 +15 +18 +``` + +You can elect to go from larger to smaller numbers by using a negative increment (i.e., a decrement). + +``` +$ seq 18 -3 3 +18 +15 +12 +9 +6 +3 +``` + +The **seq** command is also very fast. You can probably generate a list of a million numbers in under 10 seconds. + +Advertisement + +``` +$ time seq 1000000 +1 +2 +3 +… +… +999998 +999999 +1000000 + +real 0m9.290s <== 9+ seconds +user 0m0.020s +sys 0m0.899s +``` + +## Using a separator + +Another very useful option is to use a separator. Instead of listing a single number on each line, you can insert commas, colons or some other characters. The -s option followed by the character you wish to use. + +``` +$ seq -s: 3 3 18 +3:6:9:12:15:18 +``` + +In fact, if you simply want your numbers to be listed on a single line, you can use a blank as your separator in place of the default linefeed. + +**[ Also see [Invaluable tips and tricks for troubleshooting Linux][4]. ]** + +``` +$ seq -s' ' 3 3 18 +3 6 9 12 15 18 +``` + +### Getting to the math + +It may seem like a big leap to go from generating a sequence of numbers to doing math, but given the right separators, **seq** can easily prepare calculations that you can pass to **bc**. For example: + +``` +$ seq -s* 5 | bc +120 +``` + +What is going on in this command? Let’s take a look. First, **seq** is generating a list of numbers and using * as the separator. + +``` +$ seq -s* 5 +1*2*3*4*5 +``` + +It’s then passing the string to the calculator (**bc**) which promptly multiplies the numbers. And you can do a fairly extensive calculation in a fraction of a second. + +``` +$ time seq -s* 117 | bc +39699371608087208954019596294986306477904063601683223011297484643104\ +22041758630649341780708631240196854767624444057168110272995649603642\ +560353748940315749184568295424000000000000000000000000000 + +real 0m0.003s +user 0m0.004s +sys 0m0.000s +``` + +### Limitations + +You only get to choose one separator, so your calculations will be very limited. Use **bc** by itself for more complicated math. In addition, **seq** only works with numbers. To generate a sequence of single letters, use a command like this instead: + +``` +$ echo {a..g} +a b c d e f g +``` + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3511954/generating-numeric-sequences-with-the-linux-seq-command.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://creativecommons.org/licenses/by/2.0/ +[2]: https://creativecommons.org/licenses/by/2.0/legalcode +[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[4]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 535f97f782d7e1d8f43fdefb4662e1d6f0b38bc9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Jan 2020 01:02:19 +0800 Subject: [PATCH 275/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200107=20Resear?= =?UTF-8?q?chers=20aim=20for=20transistors=20that=20compute=20and=20store?= =?UTF-8?q?=20in=20one=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200107 Researchers aim for transistors that compute and store in one component.md --- ...that compute and store in one component.md | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 sources/talk/20200107 Researchers aim for transistors that compute and store in one component.md diff --git a/sources/talk/20200107 Researchers aim for transistors that compute and store in one component.md b/sources/talk/20200107 Researchers aim for transistors that compute and store in one component.md new file mode 100644 index 0000000000..6a0bb4f471 --- /dev/null +++ b/sources/talk/20200107 Researchers aim for transistors that compute and store in one component.md @@ -0,0 +1,56 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Researchers aim for transistors that compute and store in one component) +[#]: via: (https://www.networkworld.com/article/3510638/researchers-aim-to-build-transistors-that-can-compute-and-store-information-in-one-component.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Researchers aim for transistors that compute and store in one component +====== +Materials incompatibilities have stalled efforts to integrate transistors and memory in a single on-chip, commercial component. That might be about to change. +iStock + +Researchers at Purdue University have made progress towards an elusive goal: building a transistor that can both process and store information. In the future, a single on-chip component could integrate the processing functions of transistors with the storage capabilities of ferroelectric RAM, potentially creating a process-memory combo that enables faster computing and is just atoms thick. + +The ability to cram more functions onto a chip, allowing for greater speed and power without increasing the footprint, is a core goal of electronics design. To get where they are today, engineers at Purdue had to overcome incompatibilities between transistors – the switching and amplification mechanisms used in almost all electronics – and ferroelectric RAM. Ferroelectric RAM is higher-performing memory technology; the material introduces non-volatility, which means it retains information when power is lost, unlike traditional dielectric-layer-constructed DRAM. + +**SEE ALSO:** [Researchers experiment with glass-based storage that doesn't require electronics cooling][1] + +In the past, materials conflicts have hampered the design of commercial electronics that integrate transistors and memory. “Researchers have been trying for decades to integrate the two, but issues happen at the interface between a ferroelectric material and silicon, the semiconductor material that makes up transistors. Instead, ferroelectric RAM operates as a separate unit on-chip, limiting its potential to make computing much more efficient,” Purdue explains in a [statement][2]. + +**[ [Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][3] ]** + +A team of engineers at Purdue, led by Peide Ye, came up with a solution: “We used a semiconductor that has ferroelectric properties. This way two materials become one material, and you don’t have to worry about the interface issues,” said Ye, who is a professor of electrical and computer engineering at the university. + +The Purdue engineers’ method revolves around a material called alpha indium selenide. It has ferroelectric properties, but it overcomes a limitation of conventional ferroelectric material, which generally acts as an insulator and doesn’t allow electricity to pass through. The alpha indium selenide material can become a semiconductor, which is necessary for the transistor element, and a room-temperature-stable, low voltage-requiring ferroelectric component, which is needed for the ferroelectric RAM. + +Advertisement + +Alpha indium selenide has a smaller band gap than other materials, the university explains. Band gaps are where no electrons can exist. That shrunken band gap, found in the material natively, means that material isn’t a serious insulator and isn’t too thick for electrical current to pass through — yet there is still a ferroelectric layer. The smaller band gap “[makes] it possible for the material to be a semiconductor without losing ferroelectric properties,” according to Purdue. + +“The result is a so-called ferroelectric semiconductor field-effect transistor, built in the same way as transistors currently used on computer chips.” + +More information is available [here][2]. + +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/3510638/researchers-aim-to-build-transistors-that-can-compute-and-store-information-in-one-component.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3488556/researchers-experiment-with-glass-based-storage-that-doesnt-require-electronics-cooling.html +[2]: https://www.purdue.edu/newsroom/releases/2019/Q4/reorganizing-a-computer-chip-transistors-can-now-both-process-and-store-information.html +[3]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[4]: https://www.facebook.com/NetworkWorld/ +[5]: https://www.linkedin.com/company/network-world From 527cdab9d4822f2da562833a4b53371e90007c78 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Jan 2020 01:03:09 +0800 Subject: [PATCH 276/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200107=20Wi-Fi?= =?UTF-8?q?=206=20is=20slowly=20gathering=20steam?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200107 Wi-Fi 6 is slowly gathering steam.md --- ...00107 Wi-Fi 6 is slowly gathering steam.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/talk/20200107 Wi-Fi 6 is slowly gathering steam.md diff --git a/sources/talk/20200107 Wi-Fi 6 is slowly gathering steam.md b/sources/talk/20200107 Wi-Fi 6 is slowly gathering steam.md new file mode 100644 index 0000000000..cc11b7fdc8 --- /dev/null +++ b/sources/talk/20200107 Wi-Fi 6 is slowly gathering steam.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Wi-Fi 6 is slowly gathering steam) +[#]: via: (https://www.networkworld.com/article/3512153/wi-fi-6-will-slowly-gather-steam-in-2020.html) +[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) + +Wi-Fi 6 is slowly gathering steam +====== +There’s a lot to look forward to about 802.11ax, aka Wi-Fi 6, just don’t expect it to be a top-to-bottom revolution in 2020. +Thinkstock + +The next big wave of Wi-Fi technology, 802.11ax, is going to become more commonplace in enterprise installations over the course of the coming year, just as the marketing teams for the makers of Wi-Fi equivalent will have you believe. Yet the rosiest predictions of revolutionary change in what enterprise Wi-Fi is capable of are still a bit farther off than 2020, according to industry experts. + +The crux of the matter is that, while access points with 802.11ax’s Wi-Fi 6 branding will steadily move into enterprise deployments in, the broader Wi-Fi ecosystem will not be dominated by the new standard for several years, according to Farpoint Group principal Craig Mathias. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][1] [][2] + +“Keep in mind, we’ve got lots and lots of people that are still in the middle of deploying [802.11]ac,” he said, referring to the previous top-end Wi-Fi standard. The deployment of 802.11ax will tend to follow the same pattern as the deployment of 802.11ac and, indeed, most [previous new Wi-Fi standards][3]. The most common scenario will be businesses waiting for a refresh cycle, testing the new technology and then rolling it out. + +[][4] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][4] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +In the near term, enterprises installing 802.11ax access points will bring performance increases – the system’s [MU-MIMO][5] antenna technology is more advanced than that present in previous versions of the Wi-Fi standard, and better suited to high-density environments with large numbers of endpoints connecting at the same time. Yet those increases will be small compared to those that will ensue once 802.11ax endpoints – that is, phones, tablets, computers and more specialized devices like [IoT][6] sensors and medical devices – hit the market. + +That, unfortunately, is still some way off, and Mathias said it will take around five years for 802.11ax to become ubiquitous. + +Advertisement + +“We’re not expecting a lot of [802.11]ax devices for a while,” he said. + +Making sure devices are compliant with modern Wi-Fi standards will be crucial in the future, though it shouldn’t be a serious issue that requires a lot of device replacement outside of fields that are using some of the aforementioned specialized endpoints, like medicine. Healthcare, heavy industry and the utility sector all have much longer-than-average expected device lifespans, which means that some may still be on 802.11ac. + +That’s bad, both in terms of security and throughput, but according to Shrihari Pandit, CEO of Stealth Communications, a fiber ISP based in New York, 802.11ax access points could still prove an advantage in those settings thanks to the technology that underpins them. + +“Wi-Fi 6 devices have eight radios inside them,” he said. “MIMO and beamforming will still mean a performance upgrade, since they’ll handle multiple connections more smoothly.” + +A critical point is that some connected devices on even older 802.11 versions – n, g, and even b in some cases – won’t be able to benefit from the numerous technological upsides of the new standard. Making sure that a given network is completely cross-compatible will be a central issue for IT staff looking to realize performance gains on networks that service legacy gear.” + +Pandit said that, increasingly, data-hungry customers like tech companies are looking to 802.11ax to act as a wireline replacement for those settings. “Lots of the tech companies we service here, some of them want Wi-Fi 6 so that they can use gigabit performance without having to run wires,” he said. + +Whether it goes by Wi-Fi 6 or 802.11ax, the next generation of Wi-Fi technology is likely to be marketed a bit differently than new Wi-Fi standards have been in the past, according to Mathias. It’s less about the mere fact that there’s a new Wi-Fi standard providing faster connectivity, and more about enabling new functionality that 802.11ax makes possible, including better handling of IoT devices and integration with AI/machine learning systems. + +Luckily, prices for top-end Wi-Fi equipment shouldn’t change much compared to the current top of the line, making it easy for almost any organization to budget for the switch. + +“We’re not expecting anyone to pay a premium for [802.11ax],” said Mathias. + +**Now see ["How to determine if Wi-Fi 6 is right for you"][2]** + +Join the Network World communities on [Facebook][7] and [LinkedIn][8] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3512153/wi-fi-6-will-slowly-gather-steam-in-2020.html + +作者:[Jon Gold][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Jon-Gold/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/newsletters/signup.html +[2]: https://www.networkworld.com/article/3356838/how-to-determine-if-wi-fi-6-is-right-for-you.html +[3]: https://www.networkworld.com/article/3238664/80211-wi-fi-standards-and-speeds-explained.html +[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[5]: https://www.networkworld.com/article/3256905/13-things-you-need-to-know-about-mu-mimo-wi-fi.html +[6]: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html +[7]: https://www.facebook.com/NetworkWorld/ +[8]: https://www.linkedin.com/company/network-world From 8e70dfcf9da63cf7f69f25de3ae0b65060e0daa3 Mon Sep 17 00:00:00 2001 From: MonkeyDEcho <863626156@qq.com> Date: Thu, 9 Jan 2020 01:03:43 +0800 Subject: [PATCH 277/430] =?UTF-8?q?=E7=BF=BB=E8=AF=9180%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...181105 5 Minimal Web Browsers for Linux.md | 55 +++++++++---------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md index 34c0c1e18e..e71e21ac1e 100644 --- a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md +++ b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md @@ -7,79 +7,73 @@ [#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) [#]: url: ( ) -5 Minimal Web Browsers for Linux -====== + linux上的五种微型浏览器 ====== ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimal.jpg?itok=ifA0Y3pV) -There are so many reasons to enjoy the Linux desktop. One reason I often state up front is the almost unlimited number of choices to be found at almost every conceivable level. From how you interact with the operating system (via a desktop interface), to how daemons run, to what tools you use, you have a multitude of options. 有太多理由去选择使用linux系统。很重要的一个理由是,我们可以按照我们自己的想法去选择想要的。从操作系统的交互方式(桌面系统)到守护系统的运行方式,在到使用的工具,你用更多的选择。 -The same thing goes for web browsers. You can use anything from open source favorites, such as [Firefox][1] and [Chromium][2], or closed sourced industry darlings like [Vivaldi][3] and [Chrome][4]. Those options are full-fledged browsers with every possible bell and whistle you’ll ever need. For some, these feature-rich browsers are perfect for everyday needs. web浏览器也是如此。你可以使用开源的[火狐][1],[Chromium][2];或者未开源的[Vivaldi][3],[Chrome][4]。这些功能强大的浏览器有你需要的各种功能。对于某些人,这些功能完备的浏览器是日常必需的。 -There are those, however, who prefer using a web browser without all the frills. In fact, there are many reasons why you might prefer a minimal browser over a standard browser. For some, it’s about browser security, while others look at a web browser as a single-function tool (as opposed to a one-stop shop application). Still others might be running low-powered machines that cannot handle the requirements of, say, Firefox or Chrome. Regardless of the reason, Linux has you covered. 但是,有些人更喜欢没有冗余功能的纯粹的浏览器。实际上,有很多原因导致你会选择微型的浏览器而不选择上述功能完备的浏览器。对于某些人来说,与浏览器的安全有关;而有些人则将浏览器当作一种简单的工具(而不是一站式商店应用程序);还有一些可能运行在低功率的计算机上,这些计算机无法满足火狐,chrome浏览器的运行要求。无论出于何种原因,在linux系统上都可以满足你的要求。 -Let’s take a look at five of the minimal browsers that can be installed on Linux. I’ll be demonstrating these browsers on the Elementary OS platform, but each of these browsers are available to nearly every distribution in the known Linuxverse. Let’s dive in. 让我们看一下可以在linux上安装运行的五种微型浏览器。我将在 Elementary 的操作系统平台上演示这些浏览器,在已知的linux发型版中几乎每个版本都可以使用这些浏览器。让我们一起来看一下吧! ### GNOME Web -GNOME Web (codename Epiphany, which means [“a usually sudden manifestation or perception of the essential nature or meaning of something”][5]) is the default web browser for Elementary OS, but it can be installed from the standard repositories. (Note, however, that the recommended installation of Epiphany is via Flatpak or Snap). If you choose to install via the standard package manager, issue a command such as sudo apt-get install epiphany-browser -y for successful installation. GNOME web (Epiphany 含义:[顿悟][5])是Elementary系统默认的web浏览器,也可以从标准存储库中安装。(注意,建议通过使用 Flatpak 或者 Snap 工具安装),如果你想选择标准软件包管理器进行安装,请执行 ```sudo apt-get install epiphany-browser -y``` 命令成功安装。 -Epiphany uses the WebKit rendering engine, which is the same engine used in Apple’s Safari browser. Couple that rendering engine with the fact that Epiphany has very little in terms of bloat to get in the way, you will enjoy very fast page-rendering speeds. Epiphany development follows strict adherence to the following guidelines: +Epiphany 使用WebKit的渲染引擎,该引擎与Apple的Safari浏览器中使用的引擎相同。这个引擎和Epiphany非常契合,可以达到非常快的页面渲染速度。Epiphany严格遵守以下准则: - * Simplicity - Feature bloat and user interface clutter are considered evil. + * Simplicity简单性 - Feature bloat and user interface clutter are considered evil功能复杂和用户界面混乱都是不被允许的. - * Standards compliance - No non-standard features will ever be introduced to the codebase. + * 规范性 - 任何非标准特性都不会引入到代码库中。 - * Software freedom - Epiphany will always be released under a license that respects freedom. + * 软件开源 - Epiphany始终遵守自由开源许可证。 - * Human interface - Epiphany follows the [GNOME Human Interface Guidelines][6]. + * 人机交互 - Epiphany 始终遵守[GNOME的人机交互指南][6]。 - * Minimal preferences - Preferences are only added when they make sense and after careful consideration. + * 最小首选项 - 经过慎重考虑才添加首选项。 - * Target audience - Non-technical users are the primary target audience (which helps to define the types of features that are included). + * 受众群体 - 非技术用户是主要的受众目标,(有助于定义所包含功能的类型)。 -GNOME Web is as clean and simple a web browser as you’ll find (Figure 1). +GNOME web浏览器就像看到的一样干净简洁 (Figure 1)。 + ![GNOME Web][8] -Figure 1: The GNOME Web browser displaying a minimal amount of preferences for the user. +Figure 1: GNOME 浏览器为用户展示最少的首选项. -[Used with permission][9] +[许可证书][9] -The GNOME Web manifesto reads: - -A web browser is more than an application: it is a way of thinking, a way of seeing the world. Epiphany's principles are simplicity, standards compliance, and software freedom. +GNOME Web 的声明如下: +web 浏览器它不仅仅是一个应用程序,还是一种思维方式,一种看世界的方式。 Epiphany 的原则是简洁,标准和自由。 ### Netsurf -The [Netsurf][10] minimal web browser opens almost faster than you can release the mouse button. Netsurf uses its own layout and rendering engine (designed completely from scratch), which is rather hit and miss in its rendering (Figure 2). +[Netsurf][10] 浏览器是最小的浏览器,他的打开速度几乎和你松开鼠标一样。Netsurf 使用自己的布局和渲染引擎(完全从零开始设计的) 在渲染过程的设计中屡屡碰壁(Figure 2). ![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_2.jpg?itok=KhGhIKlj) -Although you might find Netsurf to suffer from rendering issues on certain sites, understand the Hubbub HTML parser is following the work-in-progress HTML5 specification, so there will be issues popup now and then. To ease those rendering headaches, Netsurf does include HTTPS support, web page thumbnailing, URL completion, scale view, bookmarks, full-screen mode, keyboard shorts, and no particular GUI toolkit requirements. That last bit is important, especially when you switch from one desktop to another. +尽管你可能在特定的站点上发现 Netsurf的问题,但如果你了解Hubbub解析器的话,知道它正在兼容html5规范,是不是的会有一点问题。Netsurf对https的支持,网页缩略图,URL解析,缩放视图,书签,全屏模式,快捷键和GUI的工具包的功能;最后一点十分重要,当你桌面来回切换时,为了缓解渲染带来的问题。 -For those curious as to the requirements for Netsurf, the browser can run on a machine as slow as a 30Mhz ARM 6 computer with 16MB of RAM. That’s impressive, by today’s standard. +对于那些对Netsurf 存在好奇的人来说,以现在的标准,他能在 16MB内存,30Mhz的ARM cpu的机器上运行,是让人惊奇的。 ### QupZilla -If you’re looking for a minimal browser that uses the Qt Framework and the QtWebKit rendering engine, [QupZilla][11] might be exactly what you’re looking for. QupZilla does include all the standard features and functions you’d expect from a web browser, such as bookmarks, history, sidebar, tabs, RSS feeds, ad blocking, flash blocking, and CA Certificates management. Even with those features, QupZilla still manages to remain a very fast lightweight web browser. Other features include: Fast startup, speed dial homepage, built-in screenshot tool, browser themes, and more. -One feature that should appeal to average users is that QupZilla has a more standard preferences tools than found in many lightweight browsers (Figure 3). So, if going too far outside the lines isn’t your style, but you still want something lighter weight, QupZilla is the browser for you. +如果你找寻使用Qt Framework 和 the QtWebKit 渲染引擎的最小浏览器,QupZilla][11]是你最佳的选择。QupZilla 包含web浏览所有的标准功能,例如:书签,历史记录,侧边栏,选项卡,RSS,广告屏蔽,flash屏蔽,和CA证书管理。及时拥有这么多的功能,QupZilla 仍然是快速,轻量级的浏览器。另外还有其他的功能:快速启动,快速拨号主页,内置屏幕截图工具,浏览器主题等。 +吸引用户的一点是,与许多轻量级浏览器相比,QupZilla有更标准的首选项工具(图3)。所以,如果你很多功能,但你仍然想要更轻量,那么QupZilla就是你最好的选择。 ![QupZilla][13] -Figure 3: The QupZilla preferences tool. +Figure 3: QupZilla 首选项工具. -[Used with permission][9] +[许可证书][9] ### Otter Browser @@ -130,11 +124,12 @@ Figure 5: The Lynx browser rendering the Linux.com page. I have also found Lynx an invaluable tool when troubleshooting certain aspects of a website (or if some feature on a website is preventing me from viewing the content in a regular browser). Another good reason to use Lynx is when you only want to view the content (and not the extraneous elements). -### Plenty More Where This Came From +### Plenty More Where This Came From 更多 -There are plenty more minimal browsers than this. But the list presented here should get you started down the path of minimalism. One (or more) of these browsers are sure to fill that need, whether you’re running it on a low-powered machine or not. +There are plenty more minimal browsers than this. But the list presented here should get you started down the path of minimalism. One (or more) of these browsers are sure to fill that need, whether you’re running it on a low-powered machine or not.微型浏览器还有很多。但是这里列出的清单应该使你开始走极简主义的道路。无论您是否在低功率计算机上运行,​​这些浏览器中的一个(或多个)都一定可以满足这一需求。 Learn more about Linux through the free ["Introduction to Linux" ][20]course from The Linux Foundation and edX. +了解linux 更多信息可以通过免费的["Linux 简洁" ][20]课程,该课程来源Linux基金和edX平台提供的。 -------------------------------------------------------------------------------- @@ -142,7 +137,7 @@ via: https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-li 作者:[Jack Wallen][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[MonkeyDEcho](https://github.com/MonkeyDEcho) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 63e67a8c6b71839c423ddaf6f8c03c6be2639aeb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 9 Jan 2020 07:49:22 +0800 Subject: [PATCH 278/430] Rename sources/tech/20200109 Huawei-s Linux Distribution openEuler is Available Now.md to sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md --- ...0109 Huawei-s Linux Distribution openEuler is Available Now.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200109 Huawei-s Linux Distribution openEuler is Available Now.md (100%) diff --git a/sources/tech/20200109 Huawei-s Linux Distribution openEuler is Available Now.md b/sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md similarity index 100% rename from sources/tech/20200109 Huawei-s Linux Distribution openEuler is Available Now.md rename to sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md From d70944391b3315f9b20ee1ceb0111473b81cffb4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 9 Jan 2020 07:56:49 +0800 Subject: [PATCH 279/430] PRF @geekpi --- ...al- A Secure, Open Source Messaging App.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20200101 Signal- A Secure, Open Source Messaging App.md b/translated/tech/20200101 Signal- A Secure, Open Source Messaging App.md index 812a97f32f..a9d70b7f96 100644 --- a/translated/tech/20200101 Signal- A Secure, Open Source Messaging App.md +++ b/translated/tech/20200101 Signal- A Secure, Open Source Messaging App.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Signal: A Secure, Open Source Messaging App) @@ -10,7 +10,7 @@ Signal:安全、开源的聊天应用 ====== -** _简介:Signal 是一款智能手机上的安全开源聊天应用。它还提供了适用于 Linux、Windows 和 macOS 的独立桌面应用。在本文中,我们来看看它的功能和可用性。_** +> Signal 是一款智能手机上的安全开源聊天应用。它还提供了适用于 Linux、Windows 和 macOS 的独立桌面应用。在本文中,我们来看看它的功能和可用性。 ### 对于关注隐私的人来说,Signal 是 WhatsApp(和 Telegram)的绝佳替代品 @@ -20,11 +20,13 @@ Signal 是一款关注隐私的开源应用。像[爱德华·斯诺登][2]这样 它可能没有 Telegram 或 WhatsApp 这么多的功能。但是,如果你想在交流时增强隐私,这是一个可靠的开源方案。 -你可以在智能手机(iOS][3]/[Android][4])上安装,也可以在 Linux、Windows 和 macOS 上安装。 +你可以在智能手机([iOS][3]/[Android][4])上安装,也可以在 Linux、Windows 和 macOS 上安装。 ### Signal 的功能 -**注意:** _某些功能是智能手机特有的。你可能无法在桌面应用上看到所有功能。_ +**注意:** 某些功能是智能手机特有的。你可能无法在桌面应用上看到所有功能。 + +另请注意,目前,Signal 需要电话号码才能注册。如果你不想公开自己的私人电话号码,则可以使用 Google 语音或类似服务。 正如我已经提到的,这是为增强你的隐私而量身定制的。因此,用户体验可能不是你见过“最佳”的。但是,从隐私/安全角度考虑,我认为这是一个不错的选择。 @@ -38,7 +40,7 @@ Signal 是一款关注隐私的开源应用。像[爱德华·斯诺登][2]这样 #### 用作默认短信应用 -如果你想在短信中使用开源应用,那么只需口进入 Signal 的设置,并将其设置为短信和彩信的默认设置。 +如果你想在短信中使用开源应用,那么只需进入 Signal 的设置,并将其设置为短信和彩信的默认设置。 #### 屏幕安全 @@ -64,15 +66,13 @@ Signal 是一款关注隐私的开源应用。像[爱德华·斯诺登][2]这样 ![][6] -如你所期待的聊天应用,你可以使用几个标签,并且可以根据需要创建一个组。 - -但是,你无法管理你的组,你只能添加成员和更改群头像。 +如你所期待的聊天应用,你可以使用几个标签,并且可以根据需要创建一个组。但是,你无法管理你的组,你只能添加成员和更改群头像。 此外,Signal 还为其应用支持生物识别。 ### 在 Ubuntu/Linux 上安装 Signal -不幸的是,你无法在你的 Linux 发行版上找到 .**deb** 或者 .**AppImage**。因此,你需要根据[官方安装说明][7]在终端上安装。 +不幸的是,你无法在你的 Linux 发行版上找到 .deb 或者 .AppImage。因此,你需要根据[官方安装说明][7]在终端上安装。 在终端中输入以下内容: @@ -105,7 +105,7 @@ via: https://itsfoss.com/signal-messaging-app/ 作者:[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 18eedba7e573051ecf28bc5572210b1eddbd718a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 9 Jan 2020 07:57:16 +0800 Subject: [PATCH 280/430] PUB @geekpi https://linux.cn/article-11764-1.html --- .../20200101 Signal- A Secure, Open Source Messaging App.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200101 Signal- A Secure, Open Source Messaging App.md (98%) diff --git a/translated/tech/20200101 Signal- A Secure, Open Source Messaging App.md b/published/20200101 Signal- A Secure, Open Source Messaging App.md similarity index 98% rename from translated/tech/20200101 Signal- A Secure, Open Source Messaging App.md rename to published/20200101 Signal- A Secure, Open Source Messaging App.md index a9d70b7f96..4248470b90 100644 --- a/translated/tech/20200101 Signal- A Secure, Open Source Messaging App.md +++ b/published/20200101 Signal- A Secure, Open Source Messaging App.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11764-1.html) [#]: subject: (Signal: A Secure, Open Source Messaging App) [#]: via: (https://itsfoss.com/signal-messaging-app/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From db6842b0a1e8e3ff637473dc194107f260fc5281 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 9 Jan 2020 08:51:50 +0800 Subject: [PATCH 281/430] translated --- ...y Pi retrospective- 6 projects and more.md | 67 ------------------- ...y Pi retrospective- 6 projects and more.md | 65 ++++++++++++++++++ 2 files changed, 65 insertions(+), 67 deletions(-) delete mode 100644 sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md create mode 100644 translated/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md diff --git a/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md b/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md deleted file mode 100644 index 181276fb45..0000000000 --- a/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md +++ /dev/null @@ -1,67 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (My Raspberry Pi retrospective: 6 projects and more) -[#]: via: (https://opensource.com/article/20/1/raspberry-pi-best) -[#]: author: (Anderson Silva https://opensource.com/users/ansilva) - -My Raspberry Pi retrospective: 6 projects and more -====== -See what I've done with the fun, educational, and useful Raspberry Pi. -![Raspberry Pi 4 board, posterized filter][1] - -Historically and theoretically speaking, a decade, a century, or a millennium starts when the clock turns midnight on January 1 of the year one of its decimal order. For example, the 20th century started on January 1, 1901, not on January 1, 1900. The reason for this is simple: there is no year 0 in our modern calendar, so these periods of time start on year 1 (using the Gregorian calendar). But that's not how we refer to time periods colloquially and culturally; for example, when we mention '80s music or movies, we're talking about the period from 1980 to 1989. - -The recently passed 2010s, I could argue, was the decade of the cloud, social media, mobile technology, and the Internet of Things (IoT), which includes the [Raspberry Pi][2]. Recently, _Time_ magazine called the Raspberry Pi one of the [10 best gadgets of the past decade][3]. And I very much agree. - -The original Raspberry Pi launched in 2012, and it took me a couple of years to jump on the bandwagon and ride on the Pi-train. But since then, I have built many fun educational projects at home and even documented a few of them for Opensource.com. - -### The Christmas light trilogy - -I wrote three articles over three years that explored controlling Christmas lights with the Raspberry Pi and the open source project LightShowPi. The first article, [_Create your own musical light show with Raspberry Pi_][4], was a mix between a very basic introduction to electronics development and building a Christmas light show. The second article, [_SSH into your Christmas tree with Raspberry Pi_][5], went a little deeper into controlling the lights with things such as remote management and electronic buttons. The last chapter of the trilogy, [_Set the holiday mood with your Raspberry Pi_][6], reviewed changes introduced in the LightShowPi project in the prior year. - -### DIY projects - -Over the years, I've turned my Raspberry Pi into several useful devices. One time, I turned the Pi into a [music-playing device with the Pi MusicBox][7], which allows you to plug your favorite music streaming services into a common web interface and play your favorite tunes around the house. - -Making the Raspberry Pi into a [mobile video recording device][8] was another DIY project I put together. It required a few extra pieces of hardware, like a touchscreen, a Pi Camera, and a battery pack, but it worked. One of the biggest drawbacks of this setup was the small amount of memory available on the Pi at the time. I think the capabilities of this little portable camera could be a lot better if I re-did it on a Raspberry Pi 4 with 4GB of RAM. This may be a project to revisit in 2020. - -Another small project I built, a [digital clock for my living room][9], used the small Adafruit PiTFT screen. As simple as this project was, it probably was the one that I used the longest. That clock stood by my TV set for over a year, running 24 hours a day… until the day the screen burned out. - -### The Pi Day series - -Last but not least, in 2019, I contributed [14 articles in 14 days][10] leading up to Pi Day (March 14). This was by far the most challenging writing project I've ever done, but it allowed me to cover many different topics and hopefully expose readers to even more ideas about the versatility of the Raspberry Pi. - -### To infinity and beyond - -I don't know anyone in the Raspberry Pi Foundation, so I don't have any special access to its roadmaps and future plans. I could (but I won't) speculate on what the future holds for the brand and its devices that have allowed so many people of different social statuses around the world to expand their knowledge about computer science, electronics, and open source development. All I hope is for the foundation's management to stay true to its vision and mission and continue making affordable technology for people everywhere. - -The 2010s are over, and what a sweet decade it was. To me, it smelled like pie, raspberry pie. - -Having recently co-authored a book about building things with the Raspberry Pi ( Raspberry Pi Hacks... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/raspberry-pi-best - -作者:[Anderson Silva][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ansilva -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberrypi4_board_hardware.jpg?itok=KnFU7NvR (Raspberry Pi 4 board, posterized filter) -[2]: https://www.raspberrypi.org/ -[3]: https://time.com/5745302/best-gadgets-of-the-2010s-decade/?utm_source=reddit.com -[4]: https://opensource.com/life/15/2/music-light-show-with-raspberry-pi -[5]: https://opensource.com/life/15/12/ssh-your-christmas-tree-raspberry-pi -[6]: https://opensource.com/article/18/12/lightshowpi-raspberry-pi -[7]: https://opensource.com/life/15/3/pi-musicbox-guide -[8]: https://opensource.com/life/15/9/turning-raspberry-pi-portable-streaming-camera -[9]: https://opensource.com/article/17/7/raspberry-pi-clock -[10]: https://opensource.com/article/19/3/happy-pi-day diff --git a/translated/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md b/translated/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md new file mode 100644 index 0000000000..2e3d16258d --- /dev/null +++ b/translated/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (My Raspberry Pi retrospective: 6 projects and more) +[#]: via: (https://opensource.com/article/20/1/raspberry-pi-best) +[#]: author: (Anderson Silva https://opensource.com/users/ansilva) + +我的树莓派回顾:不止 6 个项目 +====== +看看我在有趣的、有教育意义和有用的树莓派上做了什么。 +![Raspberry Pi 4 board, posterized filter][1] + +从历史和理论上讲,十年、一个世纪或一千年从十进制一那年的 1 月 1 日物业开始。例如,20 世纪始于 1901 年 1 月 1 日,而不是 1900 年 1 月 1 日。原因很简单:现代日历中没有 0 年,因此这些时间段始于 1 年(使用公历)。但这不是我们在口语上和文化上指代时间段的方式。例如,当我们提到 80 年代的音乐或电影时,我们所说的是 1980 年至 1989 年。 + +我可以说,最近过去的 21 世纪 10 年代是云计算、社交媒体、移动技术和物联网 (IoT) 的十年,这其中包括[树莓派][2]。最近,《时代》杂志将树莓派称为[过去十年中 10 个最佳小玩意][3]之一。我非常同意这点。 + +最初的树莓派于 2012 年推出,我过了几年才使用上了它。但是从那以后,我在家中做了许多有趣的教育项目,甚至在 Opensource.com 中记录了一些。 + +### 圣诞灯三部曲 + +三年来,我写了三篇探讨如何使用树莓派和开源项目 LightShowPi 控制圣诞灯的文章。第一篇文章[_用树莓派创建你自己的音乐灯光秀_][4],是基础电子开发介绍和灯光秀的结合。第二篇文章,[_ 使用树莓派 SSH 进入你的圣诞树_][5],更深入地介绍了通过远程管理和电子按钮控制灯光的方法。三部曲的最后一章[_用树莓派设置假期心情_][6],回顾了上一年 LightShowPi 项目中引入的更改。 + +### DIY 项目 + +多年来,我已经将树莓派变成了几种有用的设备。有一次,我将树莓派变成了[带有 Pi MusicBox 的音乐播放设备][7],它可以让你在 Web 界面中导入你喜欢的音乐流并在房间中播放。 + +将树莓派做成[移动视频录制设备][8]是另一个 DIY 项目。它需要一些额外的硬件,例如触摸屏、Pi 摄像头和电池组,但是可以使用。这个设备的最大缺点之一是当时树莓派的可用内存很小。我认为如果我将它重新配置在具有 4GB 内存的树莓派 4 上,那么这款便携式摄像机的功能可能会更好。这可能是一个会在 2020 年重新做项目。 + +我做的另一个小项目[客厅的数字时钟][9]使用了 Adafruit PiTFT 小屏幕。尽管这个项目很简单,但它可能是我使用时间最长的项目。那个时钟在我的电视机上呆了一年多,一天 24 小时不间断运行,直到屏幕烧坏为止。 + +### 圆周率日系列 + +最后但并非最不重要的一点是,在 2019 年的圆周率日(3 月 14 日)之前,我在 [14 内发布了 14 篇文章][10]。这是迄今为止我完成过的最具挑战性的写作项目,但是它使我能够涵盖许多不同的主题,并希望使读者对树莓派的丰富功能有更多的了解。 + +### 走向未来 + +我在树莓派基金会中不认识任何人,因此我不了解任何它的路线图和未来计划。我可以(但我不会)推测品牌及其设备的未来,它们让世界各地这么多不同社会地位的人扩展他们对计算机科学、电子和开源开发的知识。我希望基金会的管理层能够忠于其愿景和使命,并继续为世界各地的人们提供价格合理的技术。 + +21 世纪 10 年代过去了,那是多么甜蜜的十年。对我来说,它闻起来就像树莓派馅饼。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/raspberry-pi-best + +作者:[Anderson Silva][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ansilva +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberrypi4_board_hardware.jpg?itok=KnFU7NvR (Raspberry Pi 4 board, posterized filter) +[2]: https://www.raspberrypi.org/ +[3]: https://time.com/5745302/best-gadgets-of-the-2010s-decade/?utm_source=reddit.com +[4]: https://opensource.com/life/15/2/music-light-show-with-raspberry-pi +[5]: https://opensource.com/life/15/12/ssh-your-christmas-tree-raspberry-pi +[6]: https://opensource.com/article/18/12/lightshowpi-raspberry-pi +[7]: https://opensource.com/life/15/3/pi-musicbox-guide +[8]: https://opensource.com/life/15/9/turning-raspberry-pi-portable-streaming-camera +[9]: https://opensource.com/article/17/7/raspberry-pi-clock +[10]: https://opensource.com/article/19/3/happy-pi-day From a58c6703ded107a8e30a6a127512efe650297462 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 9 Jan 2020 09:00:43 +0800 Subject: [PATCH 282/430] translating --- ...7 Generating numeric sequences with the Linux seq command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200107 Generating numeric sequences with the Linux seq command.md b/sources/tech/20200107 Generating numeric sequences with the Linux seq command.md index 9375e70fa6..7ae48a2785 100644 --- a/sources/tech/20200107 Generating numeric sequences with the Linux seq command.md +++ b/sources/tech/20200107 Generating numeric sequences with the Linux seq command.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4441d79f592697bef790364e41156f5dae9dbfca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Thu, 9 Jan 2020 13:49:35 +0800 Subject: [PATCH 283/430] Translated by robsean --- ...urce interior design with Sweet Home 3D.md | 142 ------------------ ...urce interior design with Sweet Home 3D.md | 141 +++++++++++++++++ 2 files changed, 141 insertions(+), 142 deletions(-) delete mode 100644 sources/tech/20191016 Open source interior design with Sweet Home 3D.md create mode 100644 translated/tech/20191016 Open source interior design with Sweet Home 3D.md diff --git a/sources/tech/20191016 Open source interior design with Sweet Home 3D.md b/sources/tech/20191016 Open source interior design with Sweet Home 3D.md deleted file mode 100644 index 309b816f81..0000000000 --- a/sources/tech/20191016 Open source interior design with Sweet Home 3D.md +++ /dev/null @@ -1,142 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Open source interior design with Sweet Home 3D) -[#]: via: (https://opensource.com/article/19/10/interior-design-sweet-home-3d) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -Open source interior design with Sweet Home 3D -====== -Try out furniture layouts, color schemes, and more in virtual reality -before you go shopping in the real world. -![Several houses][1] - -There are three schools of thought on how to go about decorating a room: - - 1. Buy a bunch of furniture and cram it into the room - 2. Take careful measurements of each item of furniture, calculate the theoretical capacity of the room, then cram it all in, ignoring the fact that you've placed a bookshelf on top of your bed - 3. Use a computer for pre-visualization - - - -Historically, I practiced the little-known fourth principle: don't have furniture. However, since I became a remote worker, I've found that a home office needs conveniences like a desk and a chair, a bookshelf for reference books and tech manuals, and so on. Therefore, I have been formulating a plan to populate my living and working space with actual furniture, made of actual wood rather than milk crates (or glue and sawdust, for that matter), with an emphasis on _plan_. The last thing I want is to bring home a great find from a garage sale to discover that it doesn't fit through the door or that it's oversized compared to another item of furniture. - -It was time to do what the professionals do. It was time to pre-viz. - -### Open source interior design - -[Sweet Home 3D][2] is an open source (GPLv2) interior design application that helps you draw your home's floor plan and then define, resize, and arrange furniture. You can do all of this with precise measurements, down to fractions of a centimeter, without having to do any math and with the ease of basic drag-and-drop operations. And when you're done, you can view the results in 3D. If you can create a basic table (not the furniture kind) in a word processor, you can plan the interior design of your home in Sweet Home 3D. - -### Installing - -Sweet Home 3D is a [Java][3] application, so it's universal. It runs on any operating system that can run Java, which includes Linux, Windows, MacOS, and BSD. Regardless of your OS, you can [download][4] the application from the website. - - * On Linux, [untar][5] the archive. Right-click on the SweetHome3D file and select **Properties**. In the **Permission** tab, grant the file executable permission. - * On MacOS and Windows, expand the archive and launch the application. You must grant it permission to run on your system when prompted. - - - -![Sweet Home 3D permissions][6] - -On Linux, you can also install Sweet Home 3D as a Snap package, provided you have **snapd** installed and enabled. - -### Measures of success - -First thing first: Break out your measuring tape. To get the most out of Sweet Home 3D, you must know the actual dimensions of the living space you're planning for. You may or may not need to measure down to the millimeter or 16th of an inch; you know your own tolerance for variance. But you must get the basic dimensions, including measuring walls and windows and doors. - -Use your best judgment for common sense. For instance, When measuring doors, include the door frame; while it's not technically part of the _door_ itself, it is part of the wall space that you probably don't want to cover with furniture. - -![Measure twice, execute once][7] - -CC-SA-BY opensource.com - -### Creating a room - -When you first launch Sweet Home 3D, it opens a blank canvas in its default viewing mode, a blueprint view in the top panel, and a 3D rendering in the bottom panel. On my [Slackware][8] desktop computer, this works famously, but my desktop is also my video editing and gaming computer, so it's got a great graphics card for 3D rendering. On my laptop, this view was a lot slower. For best performance (especially on a computer not dedicated to 3D rendering), go to the **3D View** menu at the top of the window and select **Virtual Visit**. This view mode renders your work from a ground-level point of view based on the position of a virtual visitor. That means you get to control what is rendered and when. - -It makes sense to switch to this view regardless of your computer's power because an aerial 3D rendering doesn't provide you with much more detail than what you have in your blueprint plan. Once you have changed the view mode, you can start designing. - -The first step is to define the walls of your home. This is done with the **Create Walls** tool, found to the right of the **Hand** icon in the top toolbar. Drawing walls is simple: Click where you want a wall to begin, click to anchor it, and continue until your room is complete. - -![Drawing walls in Sweet Home 3D][9] - -Once you close the walls, press **Esc** to exit the tool. - -#### Defining a room - -Sweet Home 3D is flexible on how you create walls. You can draw the outer boundary of your house first, and then subdivide the interior, or you can draw each room as conjoined "containers" that ultimately form the footprint of your house. This flexibility is possible because, in real life and in Sweet Home 3D, walls don't always define a room. To define a room, use the **Create Rooms** button to the right of the **Create Walls** button in the top toolbar. - -If the room's floor space is defined by four walls, then all you need to do to define that enclosure as a room is double-click within the four walls. Sweet Home 3D defines the space as a room and provides you with its area in feet or meters, depending on your preference. - -For irregular rooms, you must manually define each corner of the room with a click. Depending on the complexity of the room shape, you may have to experiment to find whether you need to work clockwise or counterclockwise from your origin point to avoid quirky Möbius-strip flooring. Generally, however, defining the floor space of a room is straightforward. - -![Defining rooms in Sweet Home 3D][10] - -After you give the room a floor, you can change to the **Arrow** tool and double-click on the room to give it a name. You can also set the color and texture of the flooring, walls, ceiling, and baseboards. - -![Modifying room floors, ceilings, etc. in Sweet Home 3D][11] - -None of this is rendered in your blueprint view by default. To enable room rendering in your blueprint panel, go to the **File** menu and select **Preferences**. In the **Preferences** panel, set **Room rendering in plan** to **Floor color or texture**. - -### Doors and windows - -Once you've finished the basic floor plan, you can switch permanently to the **Arrow** tool. - -You can find doors and windows in the left column of Sweet Home 3D, in the **Doors and Windows** category. You have many choices, so choose whatever is closest to what you have in your home. - -![Moving a door in Sweet Home 3D][12] - -To place a door or window into your plan, drag-and-drop it on the appropriate wall in your blueprint panel. To adjust its position and size, double-click the door or window. - -### Adding furniture - -With the base plan complete, the part of the job that feels like _work_ is over! From this point onward, you can play with furniture arrangements and other décor. - -You can find furniture in the left column, organized by the room for which each is intended. You can drag-and-drop any item into your blueprint plan and control orientation and size with the tools visible when you hover your mouse over the item's corners. Double-click on any item to adjust its color and finish. - -### Visiting and exporting - -To see what your future home will look like, drag the "person" icon in your blueprint view into a room. - -![Sweet Home 3D rendering][13] - -You can strike your own balance between realism and just getting a feel for space, but your imagination is your only limit. You can get additional assets to add to your home from the Sweet Home 3D [download page][4]. You can even create your own furniture and textures with the **Library Editor** applications, which are optional downloads from the project site. - -Sweet Home 3D can export your blueprint plan to SVG format for use in [Inkscape][14], and it can export your 3D model to OBJ format for use in [Blender][15]. To export your blueprint, go to the **Plan** menu and select **Export to SVG format**. To export a 3D model, go to the **3D View** menu and select **Export to OBJ format**. - -You can also take "snapshots" of your home so that you can refer to your ideas without opening Sweet Home 3D. To create a snapshot, go to the **3D View** menu and select **Create Photo**. The snapshot is rendered from the perspective of the person icon in the blueprint view, so adjust as required, then click the **Create** button in the **Create Photo** window. If you're happy with the photo, click **Save**. - -### Home sweet home - -There are many more features in Sweet Home 3D. You can add a sky and a lawn, position lights for your photos, set ceiling height, add another level to your house, and much more. Whether you're planning for a flat you're renting or a house you're buying—or a house that doesn't even exist (yet), Sweet Home 3D is an engaging and easy application that can entertain and help you make better purchasing choices when scurrying around for furniture, so you can finally stop eating breakfast at the kitchen counter and working while crouched on the floor. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/10/interior-design-sweet-home-3d - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_housing.png?itok=s7i6pQL1 (Several houses) -[2]: http://www.sweethome3d.com/ -[3]: https://opensource.com/resources/java -[4]: http://www.sweethome3d.com/download.jsp -[5]: https://opensource.com/article/17/7/how-unzip-targz-file -[6]: https://opensource.com/sites/default/files/uploads/sweethome3d-permissions.png (Sweet Home 3D permissions) -[7]: https://opensource.com/sites/default/files/images/life/sweethome3d-measure.jpg (Measure twice, execute once) -[8]: http://www.slackware.com/ -[9]: https://opensource.com/sites/default/files/uploads/sweethome3d-walls.jpg (Drawing walls in Sweet Home 3D) -[10]: https://opensource.com/sites/default/files/uploads/sweethome3d-rooms.jpg (Defining rooms in Sweet Home 3D) -[11]: https://opensource.com/sites/default/files/uploads/sweethome3d-rooms-modify.jpg (Modifying room floors, ceilings, etc. in Sweet Home 3D) -[12]: https://opensource.com/sites/default/files/uploads/sweethome3d-move.jpg (Moving a door in Sweet Home 3D) -[13]: https://opensource.com/sites/default/files/uploads/sweethome3d-view.jpg (Sweet Home 3D rendering) -[14]: http://inkscape.org -[15]: http://blender.org diff --git a/translated/tech/20191016 Open source interior design with Sweet Home 3D.md b/translated/tech/20191016 Open source interior design with Sweet Home 3D.md new file mode 100644 index 0000000000..ebc4a3bc70 --- /dev/null +++ b/translated/tech/20191016 Open source interior design with Sweet Home 3D.md @@ -0,0 +1,141 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open source interior design with Sweet Home 3D) +[#]: via: (https://opensource.com/article/19/10/interior-design-sweet-home-3d) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + + Sweet Home 3D 开放源码室内设计 +====== +在你去真实世界购物前,在虚拟世界中尝试家具布局,配色方案等等。 +![Several houses][1] + +这里有关于如何装饰房间的三大流派: + + 1. 购买一堆家具,并把它们塞进房间。 + 2. 仔细测量每件家具,计算房间的理论容量,然后把它们全部塞进房间,忽略你在床上放置一个书架的事实。 + 3. 使用一台计算机进行预先可视化。 + + + +从历史观点上说,我实践了鲜为人知的第四条原则:没有家具。然而,自从我成为一个远程工作者,我发现家庭办公需要一些便利的设施,像一张桌子和一张椅子,一个用于存放参考书和技术手册的书架等等。因此,我一直在制定一个使用实际的家具来迁移我的生活和工作空间的计划,在 _计划_ 上强调由实木制作,而不是牛奶箱子(或胶水和锯末,或同样的东西)。我最不想做的一件事:从旧货市场淘到得宝贝带回家时,发现其进不了门,或者比另一件家具大很多。 + +是时候做专业人士该做的事了。是时候视觉预览了。 + +### 开放源码室内设计 + +[Sweet Home 3D][2] 是一个开放源码 (GPLv2) 室内设计应用程序,帮助你绘制你的住宅平面图,然后定义,重新调整大小以及安排家具。你可以使用精确的尺寸来完成这些,精确到一厘米以下,而不使用任何数学运算,仅使用简单的拖拽操作。当你完成后,你可以在 3D 中查看结果。如果你可以在一个 word 程序中创建一个基本的表格(不是家具类),你可以在 Sweet Home 3D 中规划你家的室内设计。 + +### 安装 + +Sweet Home 3D 是一个 [Java][3] 应用程序,因此它是通用的。它运行在任何可以运行 Java 的操作系统上,包括 Linux ,Windows ,MacOS 和 BSD 。不用理会你的操作系统,你可以从网站 [下载][4] 应用程序。 + + * 在 Linux 上,[untar][5] 存档文件。在 SweetHome3D 文件上右键单击,并选择**属性**。在**权限**选项卡中,授予文件可执行权限。 + * 在 MacOS 和 Windows 上,展开存档文件并启动应用程序。当系统提示时,你必需授予它权限来在你的系统上运行。 + +![Sweet Home 3D permissions][6] + +在 Linux 上,你也可以像一个 Snap 软件包一样安装 Sweet Home 3D ,前提是你已经安装并启用 **snapd** 。 + +### 成功的测量 + +首先:打开你的卷尺。为充分利用 Sweet Home 3D ,你必须知道你计划生活空间的实际尺寸。你可能需要测量到毫米或1/16英寸;你知道你自己对变化幅度的容忍度。但是你必需获得基本的尺寸,包括材料墙壁和门窗。 + +用你最好的判断力来判断常识。例如,当测量门时,包括门框; + +虽然从技术上讲它不是 _门_ 本身的一部分,它可能是你不想用家具覆盖的墙壁空间的一部分。 + +![Measure twice, execute once][7] + +CC-SA-BY opensource.com + +### 创建一间房间 + +当你第一次启动 Sweet Home 3D 时,它会以它的默认查看模式来打开一个空白的画布,蓝图视图在顶部面板中,3D 渲染在底部面板中。在我的 [Slackware][8] 桌面计算机上,这项工作非常友好,但是我的桌面计算机也是我的视频编辑和游戏计算机,所以它有一个极好的 3D 渲染显卡。在我的笔记本计算机上,这种视图模式是非常慢的。为了最好的性能(尤其是在一台计没有 3D 渲染的专用计算机上),转到窗口顶部的 **3D 视图** 菜单,并选择 **虚拟访问** 。这个视图模式基于虚拟访客的位置从地面视图渲染你的工作。这意味着你可以控制渲染的东西和时机。 + +不顾你计算机的功率来切换到这个视图的有意义的,因为地表以上的 3D 渲染不比蓝图平面图向你提供更多有用的详细信息。在你更改视图模式后,你可以开始设计。 + +第一步是定义你家的墙壁。使用**创建墙壁**工具完成,在顶部工具栏的右侧找到 **手** 图标。绘制墙壁很简单:单击你想要墙壁开始的位置,单击以锚定位置,不断单击锚定,直到你的房间完成。 + +![Drawing walls in Sweet Home 3D][9] + +在你闭合墙壁后,按**Esc**来退出工具。 + +#### 定义一间房间 + +Sweet Home 3D 在你如何创建墙壁的问题上是灵活的。你可以先绘制你房子的外部边界,然后再细分内部,或者你可以绘制每个房间作为结成一体的"容器",最终形成你房子所占的空间量。这种灵活性是能做到的,因为在现实生活中和在 Sweet Home 3D 中,墙壁并不总是定义一间房间。为定义一间房间,使用在顶部工具栏的**创建墙壁** 按钮右侧的 **创建房间** 按钮。 + +如果房间的地板空间是通过四面墙所定义,你们你需要做的全部的定义是像一间房间一样在四面墙壁内双击来圈占地方。Sweet Home 3D 将定义空间为一间房间,并根据你的喜好,以英尺或米为单位向你提供房间的面积。 + +对于不规则的房间,你必需使用每次单击来手动定义房间的每个墙角。根据房间形状的复杂性,你可能不得不进行试验来发现你是否需要从你的原点来顺时针或逆时针工作,以避免奇怪的莫比斯条形地板。不过,一般来说,定义一间房间的地板空间是简单的。 + +![Defining rooms in Sweet Home 3D][10] + +在你给定房间一层地板后,你可以更改到 **箭头** 工具,并在房间上双击来给予它一个名称。你也可以设置地板,墙壁,天花板和踢脚板的颜色及纹理。 + +![Modifying room floors, ceilings, etc. in Sweet Home 3D][11] + +默认情况下,这些都不会在蓝图视图中渲染。为启用在你蓝图面板中的房间渲染,转到 **文件** 菜单并选择 **首选项** 。在 **首选项** 面板中,设置 **平面图中房间渲染** 为 **地板颜色或纹理** 。 + +### 门和窗 + +在你完成基本的地板平面图后,你可以长期地切换到 **箭头** 工具。 + +你可以在 Sweet Home 3D 的左栏中的 **门和窗** 类别下找到门和窗。你有很多选择,所以选择最接近你家的东西。 + +![Moving a door in Sweet Home 3D][12] + +为放置一扇门或窗到你的平面图中,在你的蓝图平面图中的合适的墙壁上拖拽门或窗。为调整它的位置和大小,双击门或窗。 + +### 添加家具 + +随着基本计划完成,部分工作感觉像 _工作_ 结束了!从这点继续,你可以玩弄家具布置以及其它装饰。 + +你可以在左栏中找到家具,按每个计划的房间来组织。你可以拖拽任何项目到你的蓝图平面图中,当你的鼠标悬停在项目的区域上时,使用可视化工具控制方向和大小。在任何项目上双击双击来调整它的颜色和成品表面。 + +### 访问和导出 + +为了看看你未来的家将会看起来是什么样子,在你的蓝图视图中拖拽"人"图标到一个房间中。 + +![Sweet Home 3D rendering][13] + +你可以在现实主义和仅感受空间感之间找到自己的平衡,只要你的想象力是你唯一的限制。你可以从 Sweet Home 3D [下载页面][4] 获取附加的有用的资源来添加到你的家中。你甚至可以使用 **库编辑器** 应用程序创建你自己的家具和纹理,它们可以从项目网站有选择地下载。 + +Sweet Home 3D 可以导出你的蓝图平面图为 SVG 格式,以便在 [Inkscape][14] 中使用,并且它可以导出你的 3D 模型为 OBJ 格式,以便在 [Blender][15] 中使用。为导出你的蓝图,转到**平面图**菜单,并选择**导出为 SVG 格式**。为导出一个 3D 模型,转到 **3D 视图** 菜单并选择**导出为 OBJ 格式**。 + +你也可以拍摄你家的"快照,以便于不打开 Sweet Home 3D 而参考你的想法。为创建一个快照,转到 **3D视图** 菜单并选择 **创建照片**。快照是按照蓝图视图中的人的图标的角度展现的,因此按照需要调整,然后在 **创建照片** 窗口中单击 **创建** 按钮。 如果你对快照满意,单击 **保存** 。 + +### 甜蜜的家 + +在 Sweet Home 3D 中有更多的特色。你可以添加一片天空和一片草坪,为你的照片定位光线,设置天花板高度,给你房子添加另一楼层等等。不管你打算租一套公寓,还是买一套房子—或是(还)尚不存在的房子,Sweet Home 3D 是一款简单迷人的应用程序,当你匆忙购买家具时,它可以娱乐并帮助你做出更好的购买选择。因此,你终于可以停止在厨房的柜台上吃早餐以及蹲在地上工作。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/10/interior-design-sweet-home-3d + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LIFE_housing.png?itok=s7i6pQL1 (Several houses) +[2]: http://www.sweethome3d.com/ +[3]: https://opensource.com/resources/java +[4]: http://www.sweethome3d.com/download.jsp +[5]: https://opensource.com/article/17/7/how-unzip-targz-file +[6]: https://opensource.com/sites/default/files/uploads/sweethome3d-permissions.png (Sweet Home 3D permissions) +[7]: https://opensource.com/sites/default/files/images/life/sweethome3d-measure.jpg (Measure twice, execute once) +[8]: http://www.slackware.com/ +[9]: https://opensource.com/sites/default/files/uploads/sweethome3d-walls.jpg (Drawing walls in Sweet Home 3D) +[10]: https://opensource.com/sites/default/files/uploads/sweethome3d-rooms.jpg (Defining rooms in Sweet Home 3D) +[11]: https://opensource.com/sites/default/files/uploads/sweethome3d-rooms-modify.jpg (Modifying room floors, ceilings, etc. in Sweet Home 3D) +[12]: https://opensource.com/sites/default/files/uploads/sweethome3d-move.jpg (Moving a door in Sweet Home 3D) +[13]: https://opensource.com/sites/default/files/uploads/sweethome3d-view.jpg (Sweet Home 3D rendering) +[14]: http://inkscape.org +[15]: http://blender.org From 60eada912bb8adb854f5b4b5c4de497d6cef9ebd Mon Sep 17 00:00:00 2001 From: MonkeyDEcho <863626156@qq.com> Date: Thu, 9 Jan 2020 23:50:36 +0800 Subject: [PATCH 284/430] =?UTF-8?q?=E7=BF=BB=E8=AF=91done?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...181105 5 Minimal Web Browsers for Linux.md | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md index e71e21ac1e..1a533e6557 100644 --- a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md +++ b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md @@ -27,7 +27,7 @@ GNOME web (Epiphany 含义:[顿悟][5])是Elementary系统默认的web浏览 Epiphany 使用WebKit的渲染引擎,该引擎与Apple的Safari浏览器中使用的引擎相同。这个引擎和Epiphany非常契合,可以达到非常快的页面渲染速度。Epiphany严格遵守以下准则: - * Simplicity简单性 - Feature bloat and user interface clutter are considered evil功能复杂和用户界面混乱都是不被允许的. + * 简单性 - 功能复杂和用户界面混乱都是不被允许的. * 规范性 - 任何非标准特性都不会引入到代码库中。 @@ -77,58 +77,59 @@ Figure 3: QupZilla 首选项工具. ### Otter Browser -Otter Browser is a free, open source attempt to recreate the closed-source offerings found in the Opera Browser. Otter Browser uses the WebKit rendering engine and has an interface that should be immediately familiar with any user. Although lightweight, Otter Browser does include full-blown features such as: +Otter 浏览器是一种免费开源的,旨在重建Opera 12.x的浏览器。它使用WebKit渲染引擎,并且有用户的熟悉界面。虽然它轻量,但它有丰富的功能: - * Passwords manager + * 密码管理 - * Add-on manager + * 插件管理 + + * 内容拦截 - * Content blocking + * 拼写检查 - * Spell checking + * 自定义界面 - * Customizable GUI + * 网址补全 - * URL completion + * 快速访问 (Figure 4) - * Speed dial (Figure 4) + * 书签和其他相关功能 - * Bookmarks and various related features + * 鼠标手势 - * Mouse gestures + * 用户样式表 - * User style sheets - - * Built-in Note tool + * 内建笔记功能 ![Otter][15] -Figure 4: The Otter Browser Speed Dial tab. +Figure 4: Otter 浏览器快起标签项. -[Used with permission][9] +[许可证书][9] -Otter Browser can be run on nearly any Linux distribution from an [AppImage][16], so there’s no installation required. Just download the AppImage file, give the file executable permissions (with the command chmod u+x otter-browser-*.AppImage), and then launch the app with the command ./otter-browser*.AppImage. +Otter浏览器可以在几乎所有Linux发行版上运行通过[AppImage][16]软件格式,因此无需安装。只需下载AppImage文件,授予文件可执行权限(使用命令 `chmod u+x otter-browser-.AppImage`),然后使用命令`./otter-browser.AppImage` 启动应用程序。 + +Otter浏览器在网站展示方面做得非常出色,可以轻松地用作你的微型浏览器。 -Otter Browser does an outstanding job of rendering websites and could function as your go-to minimal browser with ease. ### Lynx -Let’s get really minimal. When I first started using Linux, back in ‘97, one of the web browsers I often turned to was a text-only take on the app called [Lynx][17]. It should come as no surprise that Lynx is still around and available for installation from the standard repositories. As you might expect, Lynx works from the terminal window and doesn’t display pretty pictures or render much in the way of advanced features (Figure 5). In fact, Lynx is as bare-bones a browser as you will find available. Because of how bare-bones this web browser is, it’s not recommended for everyone. But if you happen to have a gui-less web server and you have a need to be able to read the occasional website, Lynx can be a real lifesaver. +让我们见识真正的微型浏览器。早在97年,当我使用Linux时,就经常使用的[Lynx][17]纯文本模式的网页浏览器。 +Lynx的存在并且可以从标准存储库中进行安装。正如您可能期望的那样,Lynx在终端窗口中工作,并且不会显示漂亮的图片和高级功能的渲染方式(图5)。事实上,Lynx是你能找到的最简单的浏览器。由于这个网页浏览器是如此简陋,所以不建议每个人都使用它。但如果你碰巧有一个没有界面的服务器,你需要能够偶尔访问的网站,Lynx是一个真正的救星。 ![Lynx][19] -Figure 5: The Lynx browser rendering the Linux.com page. +Figure 5: Lynx 浏览器展示 Linux.com 网址界面. -[Used with permission][9] +[许可证书][9] -I have also found Lynx an invaluable tool when troubleshooting certain aspects of a website (or if some feature on a website is preventing me from viewing the content in a regular browser). Another good reason to use Lynx is when you only want to view the content (and not the extraneous elements). +我还发现Lynx是一个非常有用的工具,它可以帮助我解决网站某些方面的故障(或者如果网站上的某些功能阻止我在常规浏览器中查看内容)。使用Lynx的另一个重要原因是它可以让我们更加专注内容(而不是其他无关的元素)。 ### Plenty More Where This Came From 更多 -There are plenty more minimal browsers than this. But the list presented here should get you started down the path of minimalism. One (or more) of these browsers are sure to fill that need, whether you’re running it on a low-powered machine or not.微型浏览器还有很多。但是这里列出的清单应该使你开始走极简主义的道路。无论您是否在低功率计算机上运行,​​这些浏览器中的一个(或多个)都一定可以满足这一需求。 +微型浏览器还有很多。但是这里列出的清单应该使你开始走极简主义的道路。无论您是否在低功率计算机上运行,​​这些浏览器中的一个(或多个)都一定可以满足这一需求。 -Learn more about Linux through the free ["Introduction to Linux" ][20]course from The Linux Foundation and edX. 了解linux 更多信息可以通过免费的["Linux 简洁" ][20]课程,该课程来源Linux基金和edX平台提供的。 -------------------------------------------------------------------------------- From 299f273a2f4c02ab8d84beeed762e9e106960e9e Mon Sep 17 00:00:00 2001 From: MonkeyDEcho <863626156@qq.com> Date: Thu, 9 Jan 2020 23:55:08 +0800 Subject: [PATCH 285/430] done --- ...181105 5 Minimal Web Browsers for Linux.md | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 translated/tech/20181105 5 Minimal Web Browsers for Linux.md diff --git a/translated/tech/20181105 5 Minimal Web Browsers for Linux.md b/translated/tech/20181105 5 Minimal Web Browsers for Linux.md new file mode 100644 index 0000000000..1a533e6557 --- /dev/null +++ b/translated/tech/20181105 5 Minimal Web Browsers for Linux.md @@ -0,0 +1,167 @@ +[#]: collector: (lujun9972) +[#]: translator: (MonkeyDEcho ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (5 Minimal Web Browsers for Linux) +[#]: via: (https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-linux) +[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) +[#]: url: ( ) + + +linux上的五种微型浏览器 +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimal.jpg?itok=ifA0Y3pV) + +有太多理由去选择使用linux系统。很重要的一个理由是,我们可以按照我们自己的想法去选择想要的。从操作系统的交互方式(桌面系统)到守护系统的运行方式,在到使用的工具,你用更多的选择。 + +web浏览器也是如此。你可以使用开源的[火狐][1],[Chromium][2];或者未开源的[Vivaldi][3],[Chrome][4]。这些功能强大的浏览器有你需要的各种功能。对于某些人,这些功能完备的浏览器是日常必需的。 + +但是,有些人更喜欢没有冗余功能的纯粹的浏览器。实际上,有很多原因导致你会选择微型的浏览器而不选择上述功能完备的浏览器。对于某些人来说,与浏览器的安全有关;而有些人则将浏览器当作一种简单的工具(而不是一站式商店应用程序);还有一些可能运行在低功率的计算机上,这些计算机无法满足火狐,chrome浏览器的运行要求。无论出于何种原因,在linux系统上都可以满足你的要求。 + +让我们看一下可以在linux上安装运行的五种微型浏览器。我将在 Elementary 的操作系统平台上演示这些浏览器,在已知的linux发型版中几乎每个版本都可以使用这些浏览器。让我们一起来看一下吧! + +### GNOME Web + +GNOME web (Epiphany 含义:[顿悟][5])是Elementary系统默认的web浏览器,也可以从标准存储库中安装。(注意,建议通过使用 Flatpak 或者 Snap 工具安装),如果你想选择标准软件包管理器进行安装,请执行 ```sudo apt-get install epiphany-browser -y``` 命令成功安装。 + +Epiphany 使用WebKit的渲染引擎,该引擎与Apple的Safari浏览器中使用的引擎相同。这个引擎和Epiphany非常契合,可以达到非常快的页面渲染速度。Epiphany严格遵守以下准则: + + * 简单性 - 功能复杂和用户界面混乱都是不被允许的. + + * 规范性 - 任何非标准特性都不会引入到代码库中。 + + * 软件开源 - Epiphany始终遵守自由开源许可证。 + + * 人机交互 - Epiphany 始终遵守[GNOME的人机交互指南][6]。 + + * 最小首选项 - 经过慎重考虑才添加首选项。 + + * 受众群体 - 非技术用户是主要的受众目标,(有助于定义所包含功能的类型)。 + + + + +GNOME web浏览器就像看到的一样干净简洁 (Figure 1)。 + + +![GNOME Web][8] + +Figure 1: GNOME 浏览器为用户展示最少的首选项. + +[许可证书][9] + +GNOME Web 的声明如下: + +web 浏览器它不仅仅是一个应用程序,还是一种思维方式,一种看世界的方式。 Epiphany 的原则是简洁,标准和自由。 +### Netsurf + +[Netsurf][10] 浏览器是最小的浏览器,他的打开速度几乎和你松开鼠标一样。Netsurf 使用自己的布局和渲染引擎(完全从零开始设计的) 在渲染过程的设计中屡屡碰壁(Figure 2). + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_2.jpg?itok=KhGhIKlj) + +尽管你可能在特定的站点上发现 Netsurf的问题,但如果你了解Hubbub解析器的话,知道它正在兼容html5规范,是不是的会有一点问题。Netsurf对https的支持,网页缩略图,URL解析,缩放视图,书签,全屏模式,快捷键和GUI的工具包的功能;最后一点十分重要,当你桌面来回切换时,为了缓解渲染带来的问题。 + +对于那些对Netsurf 存在好奇的人来说,以现在的标准,他能在 16MB内存,30Mhz的ARM cpu的机器上运行,是让人惊奇的。 + +### QupZilla + +如果你找寻使用Qt Framework 和 the QtWebKit 渲染引擎的最小浏览器,QupZilla][11]是你最佳的选择。QupZilla 包含web浏览所有的标准功能,例如:书签,历史记录,侧边栏,选项卡,RSS,广告屏蔽,flash屏蔽,和CA证书管理。及时拥有这么多的功能,QupZilla 仍然是快速,轻量级的浏览器。另外还有其他的功能:快速启动,快速拨号主页,内置屏幕截图工具,浏览器主题等。 +吸引用户的一点是,与许多轻量级浏览器相比,QupZilla有更标准的首选项工具(图3)。所以,如果你很多功能,但你仍然想要更轻量,那么QupZilla就是你最好的选择。 + +![QupZilla][13] + +Figure 3: QupZilla 首选项工具. + +[许可证书][9] + +### Otter Browser + +Otter 浏览器是一种免费开源的,旨在重建Opera 12.x的浏览器。它使用WebKit渲染引擎,并且有用户的熟悉界面。虽然它轻量,但它有丰富的功能: + + * 密码管理 + + * 插件管理 + + * 内容拦截 + + * 拼写检查 + + * 自定义界面 + + * 网址补全 + + * 快速访问 (Figure 4) + + * 书签和其他相关功能 + + * 鼠标手势 + + * 用户样式表 + + * 内建笔记功能 + + +![Otter][15] + +Figure 4: Otter 浏览器快起标签项. + +[许可证书][9] + +Otter浏览器可以在几乎所有Linux发行版上运行通过[AppImage][16]软件格式,因此无需安装。只需下载AppImage文件,授予文件可执行权限(使用命令 `chmod u+x otter-browser-.AppImage`),然后使用命令`./otter-browser.AppImage` 启动应用程序。 + +Otter浏览器在网站展示方面做得非常出色,可以轻松地用作你的微型浏览器。 + + +### Lynx + +让我们见识真正的微型浏览器。早在97年,当我使用Linux时,就经常使用的[Lynx][17]纯文本模式的网页浏览器。 +Lynx的存在并且可以从标准存储库中进行安装。正如您可能期望的那样,Lynx在终端窗口中工作,并且不会显示漂亮的图片和高级功能的渲染方式(图5)。事实上,Lynx是你能找到的最简单的浏览器。由于这个网页浏览器是如此简陋,所以不建议每个人都使用它。但如果你碰巧有一个没有界面的服务器,你需要能够偶尔访问的网站,Lynx是一个真正的救星。 + +![Lynx][19] + +Figure 5: Lynx 浏览器展示 Linux.com 网址界面. + +[许可证书][9] + +我还发现Lynx是一个非常有用的工具,它可以帮助我解决网站某些方面的故障(或者如果网站上的某些功能阻止我在常规浏览器中查看内容)。使用Lynx的另一个重要原因是它可以让我们更加专注内容(而不是其他无关的元素)。 + +### Plenty More Where This Came From 更多 + +微型浏览器还有很多。但是这里列出的清单应该使你开始走极简主义的道路。无论您是否在低功率计算机上运行,​​这些浏览器中的一个(或多个)都一定可以满足这一需求。 + +了解linux 更多信息可以通过免费的["Linux 简洁" ][20]课程,该课程来源Linux基金和edX平台提供的。 + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-linux + +作者:[Jack Wallen][a] +选题:[lujun9972][b] +译者:[MonkeyDEcho](https://github.com/MonkeyDEcho) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/jlwallen +[b]: https://github.com/lujun9972 +[1]: https://www.mozilla.org/en-US/firefox/new/ +[2]: https://www.chromium.org/ +[3]: https://vivaldi.com/ +[4]: https://www.google.com/chrome/ +[5]: https://www.merriam-webster.com/dictionary/epiphany +[6]: https://developer.gnome.org/hig/stable/ +[7]: /files/images/minimalbrowsers1jpg +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_1.jpg?itok=Q7wZLF8B (GNOME Web) +[9]: /licenses/category/used-permission +[10]: https://www.netsurf-browser.org/ +[11]: https://qupzilla.com/ +[12]: /files/images/minimalbrowsers3jpg +[13]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_3.jpg?itok=O8iMALWO (QupZilla) +[14]: /files/images/minimalbrowsers4jpg +[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_4.jpg?itok=5bCa0z-e (Otter) +[16]: https://sourceforge.net/projects/otter-browser/files/ +[17]: https://lynx.browser.org/ +[18]: /files/images/minimalbrowsers5jpg +[19]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_5.jpg?itok=p_Lmiuxh (Lynx) +[20]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 90ad890789888cfa40b34f020f22983b4399bd0b Mon Sep 17 00:00:00 2001 From: MonkeyDEcho <863626156@qq.com> Date: Thu, 9 Jan 2020 23:56:31 +0800 Subject: [PATCH 286/430] rm done --- ...181105 5 Minimal Web Browsers for Linux.md | 167 ------------------ 1 file changed, 167 deletions(-) delete mode 100644 sources/tech/20181105 5 Minimal Web Browsers for Linux.md diff --git a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md deleted file mode 100644 index 1a533e6557..0000000000 --- a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md +++ /dev/null @@ -1,167 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MonkeyDEcho ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (5 Minimal Web Browsers for Linux) -[#]: via: (https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-linux) -[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) -[#]: url: ( ) - - -linux上的五种微型浏览器 -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimal.jpg?itok=ifA0Y3pV) - -有太多理由去选择使用linux系统。很重要的一个理由是,我们可以按照我们自己的想法去选择想要的。从操作系统的交互方式(桌面系统)到守护系统的运行方式,在到使用的工具,你用更多的选择。 - -web浏览器也是如此。你可以使用开源的[火狐][1],[Chromium][2];或者未开源的[Vivaldi][3],[Chrome][4]。这些功能强大的浏览器有你需要的各种功能。对于某些人,这些功能完备的浏览器是日常必需的。 - -但是,有些人更喜欢没有冗余功能的纯粹的浏览器。实际上,有很多原因导致你会选择微型的浏览器而不选择上述功能完备的浏览器。对于某些人来说,与浏览器的安全有关;而有些人则将浏览器当作一种简单的工具(而不是一站式商店应用程序);还有一些可能运行在低功率的计算机上,这些计算机无法满足火狐,chrome浏览器的运行要求。无论出于何种原因,在linux系统上都可以满足你的要求。 - -让我们看一下可以在linux上安装运行的五种微型浏览器。我将在 Elementary 的操作系统平台上演示这些浏览器,在已知的linux发型版中几乎每个版本都可以使用这些浏览器。让我们一起来看一下吧! - -### GNOME Web - -GNOME web (Epiphany 含义:[顿悟][5])是Elementary系统默认的web浏览器,也可以从标准存储库中安装。(注意,建议通过使用 Flatpak 或者 Snap 工具安装),如果你想选择标准软件包管理器进行安装,请执行 ```sudo apt-get install epiphany-browser -y``` 命令成功安装。 - -Epiphany 使用WebKit的渲染引擎,该引擎与Apple的Safari浏览器中使用的引擎相同。这个引擎和Epiphany非常契合,可以达到非常快的页面渲染速度。Epiphany严格遵守以下准则: - - * 简单性 - 功能复杂和用户界面混乱都是不被允许的. - - * 规范性 - 任何非标准特性都不会引入到代码库中。 - - * 软件开源 - Epiphany始终遵守自由开源许可证。 - - * 人机交互 - Epiphany 始终遵守[GNOME的人机交互指南][6]。 - - * 最小首选项 - 经过慎重考虑才添加首选项。 - - * 受众群体 - 非技术用户是主要的受众目标,(有助于定义所包含功能的类型)。 - - - - -GNOME web浏览器就像看到的一样干净简洁 (Figure 1)。 - - -![GNOME Web][8] - -Figure 1: GNOME 浏览器为用户展示最少的首选项. - -[许可证书][9] - -GNOME Web 的声明如下: - -web 浏览器它不仅仅是一个应用程序,还是一种思维方式,一种看世界的方式。 Epiphany 的原则是简洁,标准和自由。 -### Netsurf - -[Netsurf][10] 浏览器是最小的浏览器,他的打开速度几乎和你松开鼠标一样。Netsurf 使用自己的布局和渲染引擎(完全从零开始设计的) 在渲染过程的设计中屡屡碰壁(Figure 2). - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_2.jpg?itok=KhGhIKlj) - -尽管你可能在特定的站点上发现 Netsurf的问题,但如果你了解Hubbub解析器的话,知道它正在兼容html5规范,是不是的会有一点问题。Netsurf对https的支持,网页缩略图,URL解析,缩放视图,书签,全屏模式,快捷键和GUI的工具包的功能;最后一点十分重要,当你桌面来回切换时,为了缓解渲染带来的问题。 - -对于那些对Netsurf 存在好奇的人来说,以现在的标准,他能在 16MB内存,30Mhz的ARM cpu的机器上运行,是让人惊奇的。 - -### QupZilla - -如果你找寻使用Qt Framework 和 the QtWebKit 渲染引擎的最小浏览器,QupZilla][11]是你最佳的选择。QupZilla 包含web浏览所有的标准功能,例如:书签,历史记录,侧边栏,选项卡,RSS,广告屏蔽,flash屏蔽,和CA证书管理。及时拥有这么多的功能,QupZilla 仍然是快速,轻量级的浏览器。另外还有其他的功能:快速启动,快速拨号主页,内置屏幕截图工具,浏览器主题等。 -吸引用户的一点是,与许多轻量级浏览器相比,QupZilla有更标准的首选项工具(图3)。所以,如果你很多功能,但你仍然想要更轻量,那么QupZilla就是你最好的选择。 - -![QupZilla][13] - -Figure 3: QupZilla 首选项工具. - -[许可证书][9] - -### Otter Browser - -Otter 浏览器是一种免费开源的,旨在重建Opera 12.x的浏览器。它使用WebKit渲染引擎,并且有用户的熟悉界面。虽然它轻量,但它有丰富的功能: - - * 密码管理 - - * 插件管理 - - * 内容拦截 - - * 拼写检查 - - * 自定义界面 - - * 网址补全 - - * 快速访问 (Figure 4) - - * 书签和其他相关功能 - - * 鼠标手势 - - * 用户样式表 - - * 内建笔记功能 - - -![Otter][15] - -Figure 4: Otter 浏览器快起标签项. - -[许可证书][9] - -Otter浏览器可以在几乎所有Linux发行版上运行通过[AppImage][16]软件格式,因此无需安装。只需下载AppImage文件,授予文件可执行权限(使用命令 `chmod u+x otter-browser-.AppImage`),然后使用命令`./otter-browser.AppImage` 启动应用程序。 - -Otter浏览器在网站展示方面做得非常出色,可以轻松地用作你的微型浏览器。 - - -### Lynx - -让我们见识真正的微型浏览器。早在97年,当我使用Linux时,就经常使用的[Lynx][17]纯文本模式的网页浏览器。 -Lynx的存在并且可以从标准存储库中进行安装。正如您可能期望的那样,Lynx在终端窗口中工作,并且不会显示漂亮的图片和高级功能的渲染方式(图5)。事实上,Lynx是你能找到的最简单的浏览器。由于这个网页浏览器是如此简陋,所以不建议每个人都使用它。但如果你碰巧有一个没有界面的服务器,你需要能够偶尔访问的网站,Lynx是一个真正的救星。 - -![Lynx][19] - -Figure 5: Lynx 浏览器展示 Linux.com 网址界面. - -[许可证书][9] - -我还发现Lynx是一个非常有用的工具,它可以帮助我解决网站某些方面的故障(或者如果网站上的某些功能阻止我在常规浏览器中查看内容)。使用Lynx的另一个重要原因是它可以让我们更加专注内容(而不是其他无关的元素)。 - -### Plenty More Where This Came From 更多 - -微型浏览器还有很多。但是这里列出的清单应该使你开始走极简主义的道路。无论您是否在低功率计算机上运行,​​这些浏览器中的一个(或多个)都一定可以满足这一需求。 - -了解linux 更多信息可以通过免费的["Linux 简洁" ][20]课程,该课程来源Linux基金和edX平台提供的。 - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-linux - -作者:[Jack Wallen][a] -选题:[lujun9972][b] -译者:[MonkeyDEcho](https://github.com/MonkeyDEcho) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/jlwallen -[b]: https://github.com/lujun9972 -[1]: https://www.mozilla.org/en-US/firefox/new/ -[2]: https://www.chromium.org/ -[3]: https://vivaldi.com/ -[4]: https://www.google.com/chrome/ -[5]: https://www.merriam-webster.com/dictionary/epiphany -[6]: https://developer.gnome.org/hig/stable/ -[7]: /files/images/minimalbrowsers1jpg -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_1.jpg?itok=Q7wZLF8B (GNOME Web) -[9]: /licenses/category/used-permission -[10]: https://www.netsurf-browser.org/ -[11]: https://qupzilla.com/ -[12]: /files/images/minimalbrowsers3jpg -[13]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_3.jpg?itok=O8iMALWO (QupZilla) -[14]: /files/images/minimalbrowsers4jpg -[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_4.jpg?itok=5bCa0z-e (Otter) -[16]: https://sourceforge.net/projects/otter-browser/files/ -[17]: https://lynx.browser.org/ -[18]: /files/images/minimalbrowsers5jpg -[19]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_5.jpg?itok=p_Lmiuxh (Lynx) -[20]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From 5da985aef58c487b224082f6906c8ab9aba5dfc3 Mon Sep 17 00:00:00 2001 From: MonkeyDEcho <863626156@qq.com> Date: Fri, 10 Jan 2020 00:08:33 +0800 Subject: [PATCH 287/430] Update 20180416 Cgo and Python.md --- sources/tech/20180416 Cgo and Python.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/tech/20180416 Cgo and Python.md b/sources/tech/20180416 Cgo and Python.md index e5688d43c8..c78a820276 100644 --- a/sources/tech/20180416 Cgo and Python.md +++ b/sources/tech/20180416 Cgo and Python.md @@ -1,4 +1,5 @@ Cgo and Python +[#] MonkeyDEcho translating ============================================================ ![](https://datadog-prod.imgix.net/img/blog/engineering/cgo-and-python/cgo_python_hero.png?auto=format&w=1900&dpr=1) From 2cb066da2fc0d37f930cc94cf7a3cd54cd9d97a2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Jan 2020 00:52:36 +0800 Subject: [PATCH 288/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200110=20Bash?= =?UTF-8?q?=20Script=20to=20Send=20eMail=20With=20a=20List=20of=20User=20A?= =?UTF-8?q?ccounts=20Expiring=20in=20=E2=80=9CX=E2=80=9D=20Days?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md --- ...t of User Accounts Expiring in -X- Days.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md diff --git a/sources/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md b/sources/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md new file mode 100644 index 0000000000..1b3330a6e8 --- /dev/null +++ b/sources/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md @@ -0,0 +1,140 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Bash Script to Send eMail With a List of User Accounts Expiring in “X” Days) +[#]: via: (https://www.2daygeek.com/bash-script-to-check-user-account-password-expiry-linux/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +Bash Script to Send eMail With a List of User Accounts Expiring in “X” Days +====== + +The password enforcement policy is common to all operating systems and applications. + +If you want to **[implement a password enforcement policy on Linux][1]**, go to the following article. + +The password enforcement policy will be enforced by most companies by default, but the time period will be different depending on the company’s requirements. + +Usually everyone uses a 90-days password cycle. + +The user will only **[change the password][2]** on some of the servers they use, and they won’t change the password on the servers they don’t use often. + +In particular, most team forget to change the service account password, which can lead to breaking regular jobs even if they are configured to work with **[SSH key-based authentication][3]**. + +SSH key-based authentication and **[cronjobs][4]** will not work if the user account password expires. + +To avoid this situation, we have created a **[shell script][5]** that sends you a list of user accounts that expire within 10 days. + +There are two **[bash scripts][6]** included in this tutorial that will help you collect information about user expiration days on your system. + +### 1) Bash Script to Check List of User Accounts Expiring in 10 Days + +This script will help you to check the list of user accounts that expire in 10 days on your terminal. + +``` +# vi /opt/script/user-password-expiry.sh + +#!/bin/sh +/tmp/user-expiry-1.txt +/tmp/user-expiry.txt +echo "-------------------------------------------------" +echo "UserName The number of days the password expires" +echo "-------------------------------------------------" +for usern in u1 u2 u3 u4 +do +today=$(date +%s) +userexpdate=$(chage -l $usern | grep 'Password expires' |cut -d: -f2) +passexp=$(date -d "$userexpdate" "+%s") +exp=`expr \( $passexp - $today \)` +expday=`expr \( $exp / 86400 \)` +echo "$usern $expday" >> /tmp/user-expiry.txt +done +cat /tmp/user-expiry.txt | awk '$2 <= 10' > /tmp/user-expiry-1.txt +cat /tmp/user-expiry-1.txt | column -t +``` + +Set an executable Linux file permission to **“user-password-expiry.sh”** file. + +``` +# chmod +x /opt/script/user-password-expiry.sh +``` + +You will get an output like the one below. But the username and days may be different + +``` +# sh /opt/script/user-password-expiry.sh + +------------------------------------------------- +UserName The number of days the password expires +------------------------------------------------- +u1 -25 +u2 9 +u3 3 +u4 5 +``` + +### 2) Bash Script to Send eMail With a List of User Accounts Expiring in 10 Days + +This script will send a mail with a list of user accounts expiring in 10 days. + +``` +# vi /opt/script/user-password-expiry-mail.sh + +#!/bin/sh +SUBJECT="Information About User Password Expiration on "`date`"" +MESSAGE="/tmp/user-expiry.txt" +MESSAGE1="/tmp/user-expiry-1.txt" +TO="[email protected]" +echo "-------------------------------------------------" >> $MESSAGE1 +echo "UserName The number of days the password expires" >> $MESSAGE1 +echo "-------------------------------------------------" >> $MESSAGE1 +for usern in u1 u2 u3 u4 +do +today=$(date +%s) +userexpdate=$(chage -l $usern | grep 'Password expires' |cut -d: -f2) +passexp=$(date -d "$userexpdate" "+%s") +exp=`expr \( $passexp - $today \)` +expday=`expr \( $exp / 86400 \)` +echo "$usern $expday" >> $MESSAGE +done +cat $MESSAGE | awk '$2 <= 10' >> $MESSAGE1 +mail -s "$SUBJECT" "$TO" < $MESSAGE1 +rm $MESSAGE +rm $MESSAGE1 +``` + +Set an executable Linux file permission to **“user-password-expiry-mail.sh”** file. + +``` +# chmod +x /opt/script/user-password-expiry-mail.sh +``` + +Finally add a **[cronjob][4]** to automate this. It runs once in a day at 8AM. + +``` +# crontab -e +0 8 * * * /bin/bash /opt/script/user-password-expiry-mail.sh +``` + +You will receive a mail similar to the first shell script output. + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/bash-script-to-check-user-account-password-expiry-linux/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/ +[2]: https://www.2daygeek.com/linux-passwd-chpasswd-command-set-update-change-users-password-in-linux-using-shell-script/ +[3]: https://www.2daygeek.com/configure-setup-passwordless-ssh-key-based-authentication-linux/ +[4]: https://www.2daygeek.com/linux-crontab-cron-job-to-schedule-jobs-task/ +[5]: https://www.2daygeek.com/category/shell-script/ +[6]: https://www.2daygeek.com/category/bash-script/ From 874447fbc6fc18bac8b6dbb27ef9133e75a3742f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Jan 2020 00:55:49 +0800 Subject: [PATCH 289/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200109=20My=20f?= =?UTF-8?q?avorite=20Bash=20hacks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200109 My favorite Bash hacks.md --- .../tech/20200109 My favorite Bash hacks.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 sources/tech/20200109 My favorite Bash hacks.md diff --git a/sources/tech/20200109 My favorite Bash hacks.md b/sources/tech/20200109 My favorite Bash hacks.md new file mode 100644 index 0000000000..857f10e160 --- /dev/null +++ b/sources/tech/20200109 My favorite Bash hacks.md @@ -0,0 +1,142 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (My favorite Bash hacks) +[#]: via: (https://opensource.com/article/20/1/bash-scripts-aliases) +[#]: author: (Katie McLaughlin https://opensource.com/users/glasnt) + +My favorite Bash hacks +====== +Improve your productivity with aliases and other shortcuts for the +things you forget too often. +![bash logo on green background][1] + +When you work with computers all day, it's fantastic to find repeatable commands and tag them for easy use later on. They all sit there, tucked away in **~/.bashrc** (or ~/.zshrc for [Zsh users][2]), waiting to help improve your day! + +In this article, I share some of my favorite of these helper commands for things I forget a lot, in hopes that they will save you, too, some heartache over time. + +### Say when it's over + +When I'm using longer-running commands, I often multitask and then have to go back and check if the action has completed. But not anymore, with this helpful invocation of **say** (this is on MacOS; change for your local equivalent): + + +``` +function looooooooong { +    START=$(date +%s.%N) +    $* +    EXIT_CODE=$? +    END=$(date +%s.%N) +    DIFF=$(echo "$END - $START" | bc) +    RES=$(python -c "diff = $DIFF; min = int(diff / 60); print('%s min' % min)") +    result="$1 completed in $RES, exit code $EXIT_CODE." +    echo -e "\n⏰  $result" +    ( say -r 250 $result 2>&1 > /dev/null & ) +} +``` + +This command marks the start and end time of a command, calculates the minutes it takes, and speaks the command invoked, the time taken, and the exit code. I find this super helpful when a simple console bell just won't do. + +### Install helpers + +I started using Ubuntu back in the Lucid days, and one of the first things I needed to learn was how to install packages. And one of the first aliases I ever added was a helper for this (named based on the memes of the day): + + +``` +`alias canhas="sudo apt-get install -y"` +``` + +### GNU Privacy Guard (GPG) signing + +On the off chance I have to sign a [GPG][3] email without having an extension or application to do it for me, I drop down into the command line and use these terribly dorky aliases: + + +``` +alias gibson="gpg --encrypt --sign --armor" +alias ungibson="gpg --decrypt" +``` + +### Docker + +There are many Docker commands, but there are even more **docker compose** commands. I used to forget the **\--rm** flags, but not anymore with these useful aliases: + + +``` +alias dc="docker-compose" +alias dcr="docker-compose run --rm" +alias dcb="docker-compose run --rm --build" +``` + +### gcurl helper for Google Cloud + +This one is relatively new to me, but it's [heavily documented][4]. gcurl is an alias to ensure you get all the correct flags when using local curl commands with authentication headers when working with Google Cloud APIs.  + +### Git and ~/.gitignore + +I work a lot in Git, so I have a special section dedicated to Git helpers. + +One of my most useful helpers is one I use to clone GitHub repos. Instead of having to run: + + +``` +`git clone git@github.com:org/repo /Users/glasnt/git/org/repo` +``` + +I set up a clone function: + + +``` +clone(){ +    echo Cloning $1 to ~/git/$1 +    cd ~/git +    git clone [git@github.com][5]:$1 $1 +    cd $1 +} +``` + +Even though I always forget and giggle any time I'm diving into my **~/.bashrc** file, I also have my "refresh upstream" command: + + +``` +`alias yoink="git checkout master && git fetch upstream master && git merge upstream/master"` +``` + +Another helper for Git-ville is a global ignore file. In your **git config --global --list** you should see a **core.excludesfile**. If not, [create one][6], and fill it full of things that you always put into your individual **.gitignore** files. As a Python developer on MacOS, for me this is: + + +``` +.DS_Store     # macOS clutter +venv/         # I never want to commit my virtualenv +*.egg-info/*  # ... nor any locally compiled packages +__pycache__   # ... or source +*.swp         # ... nor any files open in vim +``` + +You can find other suggestions over on [Gitignore.io][7] or on the [Gitignore repo][8] on GitHub. + +### Your turn + +What are your favorite helper commands? Please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/bash-scripts-aliases + +作者:[Katie McLaughlin][a] +选题:[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/glasnt +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: https://opensource.com/article/19/9/getting-started-zsh +[3]: https://gnupg.org/ +[4]: https://cloud.google.com/service-infrastructure/docs/service-control/getting-started +[5]: mailto:git@github.com +[6]: https://help.github.com/en/github/using-git/ignoring-files#create-a-global-gitignore +[7]: https://www.gitignore.io/ +[8]: https://github.com/github/gitignore From bc0fe0c7b43c19ad14d1e0cd619235f5fead93f4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Jan 2020 00:56:11 +0800 Subject: [PATCH 290/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200109=20Create?= =?UTF-8?q?=20demo=20project=20templates=20with=20one=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200109 Create demo project templates with one script.md --- ... demo project templates with one script.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/tech/20200109 Create demo project templates with one script.md diff --git a/sources/tech/20200109 Create demo project templates with one script.md b/sources/tech/20200109 Create demo project templates with one script.md new file mode 100644 index 0000000000..950ec0e85f --- /dev/null +++ b/sources/tech/20200109 Create demo project templates with one script.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Create demo project templates with one script) +[#]: via: (https://opensource.com/article/20/1/initsh-script) +[#]: author: (Eric D. Schabell https://opensource.com/users/eschabell) + +Create demo project templates with one script +====== +This init.sh script makes it easier to create demos to convince your +customers, team, and boss that your project is exactly what they need. +![Person using a laptop][1] + +When you're standing on a stage or doing a live demo in an online session, getting your project into a perfect-looking state may appear easy. But a lot of work goes on behind the scenes to create working, easy to use, and repeatable demo projects. + +When you're doing a demo, the technology in a project must support your bigger story about the project without failing. My fellow JBoss technology evangelists and I often have to set up different technologies, so it became necessary for us to tune some sort of generic framework or template to put these demo projects into. + +Achieving this goal was guided by three principles: + + * KISS (keep it simple, stupid) + * Consistency + * Repeatability + + + +These stem from our aim to support anyone who wants to explore and get started with a JBoss technology. Note that while the order of these principles has some significance about what is most important, they all have to balance each other. + +If one must be weighed more heavily, when using technology, it is KISS. Therefore, you will find that this principle is followed almost religiously when deciding how to solve anything within the demo project template. + +### Simple + +The demos need to have a simple set up, taking almost no effort to get them started or, more realistically, the least amount of effort possible. + +Each project requires just three steps to get going: + + 1. Download and unzip the project. + 2. Add products to the project's **installs** directory. + 3. Run **init.sh** (for Unix) or **init.bat** (for Windows) to install the project. + + + +That's it; just watch the install's output to continue with the project as you see fit. + +This setup also relies on the very smallest or most basic set of dependencies that are physically possible for Unix- and Windows-based systems—Java and Maven, nothing more than that. + +A demo is all about learning what the project in front of you does, so it must be clear and offer the possibility to explore how the project is set up, configured, and runs. Based on users' feedback over the years, full automation is not desirable, as it takes the project out of the user's learning sphere. + +There is a balance offered when installing a project with autoconfiguration and setup, but there are still some steps that allow you to pause, consider, and explore what has been done. + +### Consistent + +The only way for people to be able to jump between our various technologies and products is to have some consistency in our demo projects. A customer, partner, or interested party needs to be able to recognize a simple and clear form of project setup. + +This is done with a simple and clear project template structure: + + * **docs/** contains project documentation and screenshots. + * **installs/** is where you place needed products. + * **projects/** contains sources for services, clients, or other project-based code. + * **support/** holds all other configuration, setup, or other necessary files and utilities. + * **init.{sh|bat}** stores installation scripts needed to set up the project. + + + +That's it; every single time it will look like this. + +### Repeatable + +Nothing is worse than spending a large amount of time to provide a demo project and only being able to run it one time. Often, there is some factor that rushes a project's completion so that you have little chance to bring some sort of order to it. + +Our template allows you to develop a demo project while saving its repeatability. Note that the entire setup is done in a new directory called **target**, where you can throw it all away and just set the project up again (with the initial **init** script). + +This is a golden rule: Every demo project should be repeatable in minutes, if not less. + +### Generic demo template project + +You want to create your own awesome demo to convince your friends, team, and boss that your project is exactly what the doctor ordered? This template will provide the tools to set up simple, consistent and easily repeatable demo projects. + +### Getting started with this template + + 1. [Download and unzip it][2]. + + + +Run **init.sh** to populate a project, and see the README files that are generated for how to use it: + + +``` +`$ ./init.sh PROJECTNAME` +``` + +#### + +![Setting up your project][3] + +#### Released versions + + * v2.0—Updated to generic template project creation + * v1.0—Image added and final touches + + + +  + +![Installing the template][4] + +![Installing the template][5] + +_This article is adapted from "How to create simple, consistent, repeatable demo projects" on [Eric D. Schabell's blog][6] and is reused with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/initsh-script + +作者:[Eric D. Schabell][a] +选题:[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/eschabell +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://github.com/jbossdemocentral/jboss-demo-template/archive/master.zip +[3]: https://opensource.com/sites/default/files/uploads/settingup_demotemplate.png (Setting up your project) +[4]: https://opensource.com/sites/default/files/uploads/install_eric_schabell.png (Installing the template) +[5]: https://opensource.com/sites/default/files/uploads/install-2_eric_schabell.png (Installing the template) +[6]: http://www.schabell.org/2015/02/jboss-evangelist-howto-create-demo-projects.html From 4a9fdf4bc73831fe8672886073243403ffeaef22 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Jan 2020 00:56:33 +0800 Subject: [PATCH 291/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200109=20What's?= =?UTF-8?q?=20HTTPS=20for=20secure=20computing=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200109 What-s HTTPS for secure computing.md --- ...00109 What-s HTTPS for secure computing.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/20200109 What-s HTTPS for secure computing.md diff --git a/sources/tech/20200109 What-s HTTPS for secure computing.md b/sources/tech/20200109 What-s HTTPS for secure computing.md new file mode 100644 index 0000000000..364ff39b13 --- /dev/null +++ b/sources/tech/20200109 What-s HTTPS for secure computing.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What's HTTPS for secure computing?) +[#]: via: (https://opensource.com/article/20/1/confidential-computing) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) + +What's HTTPS for secure computing? +====== +Security by default hasn't arrived yet. +![Secure https browser][1] + +Over the past few years, it's become difficult to find a website that is just "http://…" This is because the industry has finally realised that security on the web is "a thing," and also because it has become easy for both servers and clients to set up and use HTTPS connections. A similar shift may be on its way in computing across cloud, edge, Internet of Things, blockchain, artificial intelligence, machine learning, and beyond. We've known for a long time that we should encrypt data at rest (in storage) and in transit (on the network), but encrypting it in use (while processing) has been difficult and expensive. Confidential computing—providing this type of protection for data and algorithms in use using hardware capabilities such as trusted execution environments (TEEs)—protects data on hosted systems or vulnerable environments. + +I've written several times about [TEEs][2] and, of course, the [Enarx project][3] of which I'm a co-founder with Nathaniel McCallum (see [_Enarx for everyone (a quest)_][4] and [_Enarx goes multi-platform_][5] for examples). Enarx uses TEEs and provides a platform- and language-independent deployment platform to allow you safely to deploy sensitive applications or components (such as microservices) onto hosts that you don't trust. Enarx is, of course, completely open source (we're using the Apache 2.0 licence, for those with an interest). Being able to run workloads on hosts that you don't trust is the promise of confidential computing, which extends normal practice for sensitive data at rest and in transit to data in use: + + * **Storage:** You encrypt your data at rest because you don't fully trust the underlying storage infrastructure. + * **Networking:** You encrypt your data in transit because you don't fully trust the underlying network infrastructure. + * **Compute:** You encrypt your data in use because you don't fully trust the underlying compute infrastructure. + + + +I've got a lot to say about trust, and the word "fully" in the statements above is important (I added it on re-reading what I'd written). In each case, you have to trust the underlying infrastructure to some degree, whether it's to deliver your packets or store your blocks, for instance. In the case of the compute infrastructure, you're going to have to trust the CPU and associated firmware, just because you can't really do computing without trusting them (there are techniques such as homomorphic encryption, which are beginning to offer some opportunities here, but they're limited and the technology still immature). + +Questions sometimes come up about whether you should fully trust CPUs, given some of the security problems that have been found with them, and also about whether they are fully secure against physical attacks on the host on which they reside. + +The answer to both questions is "no," but this is the best technology we currently have available at scale and at a price point to make it generally deployable. To address the second question, nobody is pretending that this (or any other technology) is fully secure: what we need to do is consider our [threat model][6] and decide whether TEEs (in this case) provide sufficient security for our specific requirements. In terms of the first question, the model that Enarx adopts is to allow decisions to be made at deployment time as to whether you trust a particular set of CPUs. So, for example, if vendor Q's generation R chips are found to contain a vulnerability, it will be easy to say "refuse to deploy my workloads to R-type CPUs from Q, but continue to deploy to S-type, T-type, and U-type chips from Q and any CPUs from vendors P, M, and N." + +I think there are three changes in the landscape that are leading to the interest and adoption of confidential computing right now: + + 1. **Hardware availability:** It is only over the past six to 12 months that hardware supporting TEEs has started to become widely available, with the key examples in the market at the moment being Intel's SGX and AMD's SEV. We can expect to see other examples of TEE-enabled hardware coming out in the fairly near future. + 2. **Industry readiness:** Just as cloud use is increasingly becoming accepted as a model for application deployment, regulators and legislators are increasing the requirements on organisations to protect the data they manage. Organisations are beginning to clamour for ways to run sensitive applications (or applications that handle sensitive data) on untrusted hosts—or, to be more accurate, on hosts that they cannot fully trust with that sensitive data. This should be no surprise: the chip vendors would not have invested so much money into this technology if they saw no likely market for it. Formation of the Linux Foundation's [Confidential Computing Consortium][7] (CCC) is another example of how the industry is interested in finding common models for the use of confidential computing and encouraging open source projects to employ these technologies.[1][8] + 3. **Open source:** Like blockchain, confidential computing is one of those technologies where it's an absolute no-brainer to use open source. If you are going to run sensitive applications, you need to trust what's doing the running for you. That's not just the CPU and firmware but also the framework that supports the execution of your workload within the TEE. It's all very well saying, "I don't trust the host machine and its software stack, so I'm going to use a TEE," but if you don't have visibility into the TEE software environment, then you're just swapping one type of software opacity for another. Open source support for TEEs allows you or the community—in fact, you _and_ the community—to check and audit what you're running in a way that is impossible for proprietary software. This is why the CCC sits within the Linux Foundation (which is committed to the open development model) and is encouraging TEE-related software projects to join and go open source (if they weren't already). + + + +I'd argue that this triad of hardware availability, industry readiness, and open source has become the driver for technology change over the past 15 to 20 years. Blockchain, AI, cloud computing, webscale computing, big data, and internet commerce are all examples of these three meeting at the same time and leading to extraordinary changes in our industry. + +Security by default is a promise that we've been hearing for decades now, and it hasn't arrived yet. Honestly, I'm not sure it ever will. But as new technologies become available, security ubiquity for particular use cases becomes more practical and more expected within the industry. It seems that confidential computing is ready to be the next big change—and you, dear reader, can join the revolution (it's open source, after all). + +* * * + + 1. Enarx, initiated by Red Hat, is a CCC project. + + + +* * * + +_This article was originally published on [Alice, Eve, and Bob][9] and is reprinted with the author's permission._ + +Get a sneak peek at Daniel Roesler's Texas Linux Fest talk, "If you're not using HTTPS, your... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/confidential-computing + +作者:[Mike Bursell][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mikecamel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/secure_https_url_browser.jpg?itok=OaPuqBkG (Secure https browser) +[2]: https://aliceevebob.com/2019/02/26/oh-how-i-love-my-tee-or-do-i/ +[3]: https://enarx.io/ +[4]: https://aliceevebob.com/2019/08/20/enarx-for-everyone-a-quest/ +[5]: https://aliceevebob.com/2019/10/29/enarx-goes-multi-platform/ +[6]: https://aliceevebob.com/2018/02/20/there-are-no-absolutes-in-security/ +[7]: https://confidentialcomputing.io/ +[8]: tmp.VEZpFGxsLv#1 +[9]: https://aliceevebob.com/2019/12/03/confidential-computing-the-new-https/ From d4c144561acc823fa28e5ac6704ead91dfbdde89 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Jan 2020 00:57:29 +0800 Subject: [PATCH 292/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200109=20How=20?= =?UTF-8?q?to=20Deliver=20Affordable=20and=20Optimized=20Application=20Acc?= =?UTF-8?q?ess=20Worldwide=20with=20SASE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200109 How to Deliver Affordable and Optimized Application Access Worldwide with SASE.md --- ... Application Access Worldwide with SASE.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/talk/20200109 How to Deliver Affordable and Optimized Application Access Worldwide with SASE.md diff --git a/sources/talk/20200109 How to Deliver Affordable and Optimized Application Access Worldwide with SASE.md b/sources/talk/20200109 How to Deliver Affordable and Optimized Application Access Worldwide with SASE.md new file mode 100644 index 0000000000..9e217c7d24 --- /dev/null +++ b/sources/talk/20200109 How to Deliver Affordable and Optimized Application Access Worldwide with SASE.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Deliver Affordable and Optimized Application Access Worldwide with SASE) +[#]: via: (https://www.networkworld.com/article/3512640/how-to-deliver-affordable-and-optimized-application-access-worldwide-with-sase.html) +[#]: author: (Cato Networks https://www.networkworld.com/author/Matt-Conran/) + +How to Deliver Affordable and Optimized Application Access Worldwide with SASE +====== +Gartner tells you to use your MPLS renewal budget to transition into SASE, but not every SASE can replace MPLS. Here's what to look for. +Vit_Mar + +Global expansion is a common goal for many enterprises. In some verticals, like manufacturing, running production lines globally is an established practice. However, deploying international sales, service, and engineering teams is becoming the norm for many other sectors including high tech, finance, retail, and more. + +A global enterprise footprint creates a unique set of challenges that do not occur in regional businesses. Users in a remote office will need to securely access data-center applications, cloud applications, or both. Depending on the distance between the remote location and the application—and the sensitivity of the application to high latency, packet loss, and jitter—an expensive set of technologies and capabilities will be needed to optimize the user experience. + +[SD-WAN][1] focuses on affordable, high-performance site connectivity. Alone it cannot solve the broader networking and security challenges faced by global enterprises, which is why Gartner and other analysts are already recognizing the need to look beyond SD-WAN for a new class of enterprise solutions. Gartner has coined the term [secure access service edge (SASE, pronounced “sassy”)][2] for solutions that converge SD-WAN capabilities with enterprise security into a global, cloud-native platform. Let’s take a deeper look. + +#### **The Application Access Optimization Challenge** + +Across the enterprise, IT finds itself facing various challenges delivering network access to users and data everywhere. While those challenges will vary, their impact point remains the same—the user experience and IT budget. + +For data-center access, organizations traditionally relied on global MPLS providers. The predictability of MPLS ensured consistent latency and low packet loss and jitter needed to support critical applications like voice and ERP. The challenge with global MPLS was the cost per megabit that required organizations to spend heavily on limited bandwidth, creating a capacity constraint. The introduction of SD-WAN appliances and Internet-based connectivity does little to address the global connectivity challenge because SD-WAN appliances can't control the packet routing once the packet is placed on the Internet-leg of the SD-WAN. + +Another option to address global connectivity challenges was to shorten the distance between users and applications. Enterprises built regional data centers or hubs to get applications closer to end users. This is a very costly and complex endeavor that is most suitable for very large organizations with distributed IT staff who can optimize application performance and availability. + +#### **Global Cloud Access** + +The migration to cloud applications and cloud data centers created a new challenge for remote users. While MPLS was optimized for the organization’s on-premises data-center access, cloud data centers often reside in different geographic locations. Special connectivity solutions, such as [AWS DirectConnect and Azure ExpressRoute][3], are used to optimally connect physical enterprise locations to the cloud data centers. And while SD-WAN appliances claim cloud optimization, they require deploying a second appliance into the cloud — no easy task. + +Regardless of application location, none of the network solutions discussed are extensible to home offices and mobile users, where deploying edge appliances for SD-WAN or WAN optimization is not possible. This creates an application access challenge because the users must use the public internet to access the edge of the data center hosting their application. This access is subject to the unpredictable quality of the network from the user’s location to the destination. + +#### **SASE Delivers Optimized and Secured Application Access Anywhere** + +Global expansion, the migration from on-premises to cloud data centers, and the emergence of the mobile and telecommuting workforce are straining legacy network architectures. The network “patches” created to address this challenge, such as edge-SD-WAN, hybrid MPLS, Internet transports, and premium cloud connectivity, are costly and incomplete. + +To address this architectural challenge, a new architecture that connects and optimizes all edges—physical, virtual, cloud, mobile—anywhere in the world, must be created. That’s the story of [SASE][2]. SASE services converge networking and security into an identity-aware, cloud-native software stack. It’s the convergence that is key. Without the necessary network optimizations and capabilities, the SASE platform will not be able to meet performance expectations everywhere. + +#### **Cloud-Native: Built for and Delivered from the Cloud** + +A core characteristic of SASE is a cloud-native, as-a-service model. A cloud-native architecture leverages key cloud capabilities, including elasticity, adaptability, self-healing, and self-maintenance. + +SASE calls for the creation of a network of cloud points of presence (PoPs), which comprise the SASE Cloud. The PoPs run the provider software that delivers a wide range of networking and network security capabilities as a service. The PoPs should seamlessly scale to adapt to changes in traffic load via the addition of compute nodes. The PoPs software can be upgraded to deliver new features or bug fixes seamlessly and without IT involvement. The cloud architecture must include self-healing capabilities to automatically move processing away from failing compute nodes and PoPs and into healthy ones. + +These capabilities can't be achieved by spinning up virtual appliances in the cloud. Appliances are designed to serve a single customer (single tenant) and lack the overall cloud orchestration layer to ensure elasticity and self-healing. + +**Globally Distributed: Available Near All Edges** + +SASE Cloud is implemented as a globally distributed cloud platform. The SASE Cloud design guarantees that wherever your edges are, the full range of networking and security capabilities will be available to support them. SASE providers will have to strategically deploy PoPs to support business locations, cloud applications, and mobile users. As Gartner notes, SASE PoPs must extend beyond public cloud providers’ footprints (like AWS and Azure) to deliver a low-latency service to enterprise edges. + +Building a global cloud platform requires providers to hone their ability to rapidly deploy PoPs into cloud and physical data centers, ensure high capacity and redundant connectivity to support both WAN and cloud access, and apply security and optimization end-to-end across all edges. + +#### **Thin Edge: DC, Branch, Cloud, User** + +By placing processing and business logic in the cloud, SASE has minimal requirements for connecting various edges. This is a key challenge for SD-WAN edges especially in the context of NFV and uCPE. Running SD-WAN and network security side by side on the same appliance increases the likelihood of an overload, forcing the need to over-spec the underlying appliance.  This isn't a theoretical issue: An increase in branch throughput or rise in encrypted traffic volume can force an out-of-budget expansion. A Thin Edge approach has the following benefits:** ** + + * **Low cost:** By minimizing edge processing, low-cost appliances can achieve high throughput as most resource-intensive processing, such as deep packet inspection, is done using cloud resources that can scale better. + * **Low maintenance:** By keeping the over-functionality limited, it is possible to run a slower upgrade cycle to the edges, which has a higher potential for disruption vs. introducing new capabilities in the cloud. + * **Low impact:** Cloud integration is achieved with no edge appliances at all (agentless), while security and global network optimization remains intact. Mobile devices and new kinds of IoT devices no longer need significant processing resources to participate in the corporate network. They can automatically connect to the nearest SASE PoP with minimal battery impact. + + + +#### **End-to-End Optimization** + +Combining intelligent routing at the WAN edge with a software-defined global private backbone enables end-to-end traffic optimization. Last-mile optimizations focus on addressing last-mile issues, such as packet loss, by dynamically routing traffic over multiple ISPs. Middle-mile optimizations focus on optimizing routing globally and over multiple carriers comprising a diverse underlay. The middle-mile optimization extends to all edges—physical, virtual, and mobile—which is a unique benefit to a cloud-based, rather than an edge appliance-based, architecture. + +In short, SASE implements a new architecture that is built to support the modern global enterprise and address the various resources, requirements, and use cases in a holistic platform. Yes, SASE provides a fresh way to secure the network, but SASE also needs the “networking capabilities” of the network if companies are to deliver users everywhere an optimum user experience. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3512640/how-to-deliver-affordable-and-optimized-application-access-worldwide-with-sase.html + +作者:[Cato Networks][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Matt-Conran/ +[b]: https://github.com/lujun9972 +[1]: https://www.catonetworks.com/sd-wan?utm_source=idg +[2]: https://www.catonetworks.com/sase?utm_source=idg +[3]: https://www.catonetworks.com/cato-cloud#cloud-datacenter From ab89bd8d00f5d056bad82cef582c82835be90792 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 10 Jan 2020 08:51:05 +0800 Subject: [PATCH 293/430] translated --- ...erWM- tiled window management for GNOME.md | 71 ------------------- ...erWM- tiled window management for GNOME.md | 71 +++++++++++++++++++ 2 files changed, 71 insertions(+), 71 deletions(-) delete mode 100644 sources/tech/20200105 PaperWM- tiled window management for GNOME.md create mode 100644 translated/tech/20200105 PaperWM- tiled window management for GNOME.md diff --git a/sources/tech/20200105 PaperWM- tiled window management for GNOME.md b/sources/tech/20200105 PaperWM- tiled window management for GNOME.md deleted file mode 100644 index fa99f6c352..0000000000 --- a/sources/tech/20200105 PaperWM- tiled window management for GNOME.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (PaperWM: tiled window management for GNOME) -[#]: via: (https://jvns.ca/blog/2020/01/05/paperwm/) -[#]: author: (Julia Evans https://jvns.ca/) - -PaperWM: tiled window management for GNOME -====== - -When I started using Linux on my personal computer, one of the first things I got excited about was tiny lightweight window managers, largely because my laptop at the time had 32MB of RAM and anything else was unusable. - -Then I got into tiling window managers like [xmonad][1]! I could manage my windows with my keyboard! They were so fast! I could configure xmonad by writing a Haskell program! I could customize everything in all kinds of fun ways (like using [dmenu][2] as a launcher)! I used 3 or 4 different tiling window managers over the years and it was fun. - -About 6 years ago I decided configuring my tiling window manager wasn’t fun for me anymore and switched to using the Ubuntu stock desktop environment: Gnome. (which is much faster now that I have 500x more RAM in my laptop :) ) - -So I’ve been using Gnome for a long time, but I still kind of missed tiling window managers. Then 6 months ago a friend told me about [PaperWM][3], which lets you tile your windows in Gnome! I installed it immediately and I’ve been using it ever since. - -### PaperWM: tiling window management for Gnome - -The basic idea of [PaperWM][3] is: you want to keep using Gnome (because all kinds of things Just Work in Gnome) but you also kinda wish you were using a tiling window manager. - -It’s a Gnome extension (instead of being a standalone window manager) and it’s in Javascript. - -### “Paper” means all of your windows are in a line - -The main idea in PaperWM is it puts all your windows in a line, which is actually quite different from traditional tiling window managers where you can tile your windows any way you want. Here’s a gif of me moving between / resizing some windows while writing this blog post (there’s a browser and two terminal windows): - -![][4] - -PaperWM’s Github README links to this video: , which describes a similar system as a “linear window manager”. - -I’d never heard of this way of organizing windows before but I like the simplicity of it – if I’m looking for a specific window I just move left/right until I find it. - -### everything I do in PaperWM - -there are lots of other features but these are the only ones I use: - - * move left and right between windows (`Super + ,`, `Super + .`) - * move the window left/right in the ordering (`Super+Shift+,`, `Super+Shift+.`) - * full screen a window (`Super + f`) - * make a window smaller (`Super + r`) - - - -### I like tools that I don’t have to configure - -I’ve been using PaperWM for 6 months on a laptop and I really like it! I also really appreciate that even though it’s configurable (by writing a Javascript configuration file), it does the things I want out of the box without me having to research how to configure it. - -The [fish shell][5] is another delightful tool like that – I basically don’t configure fish at all (except to set environment variables etc) and I really like the default feature set. - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2020/01/05/paperwm/ - -作者:[Julia Evans][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://xmonad.org/ -[2]: https://wiki.archlinux.org/index.php/Dmenu -[3]: https://github.com/paperwm/PaperWM -[4]: https://jvns.ca/images/paperwm.gif -[5]: https://jvns.ca/blog/2017/04/23/the-fish-shell-is-awesome/ diff --git a/translated/tech/20200105 PaperWM- tiled window management for GNOME.md b/translated/tech/20200105 PaperWM- tiled window management for GNOME.md new file mode 100644 index 0000000000..dab0726417 --- /dev/null +++ b/translated/tech/20200105 PaperWM- tiled window management for GNOME.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (PaperWM: tiled window management for GNOME) +[#]: via: (https://jvns.ca/blog/2020/01/05/paperwm/) +[#]: author: (Julia Evans https://jvns.ca/) + +PaperWM:GNOME 下的平铺窗口管理 +====== + +当我开始在个人计算机上使用 Linux 时,令我兴奋的第一件事就是轻巧的窗口管理器,这主要是因为当时我的笔记本电脑只有有 32MB 的内存,且没有其他可使用的内存。 + +接着我开始接触 [xmonad][1] 之类的平铺窗口管理器!我可以用键盘管理窗口了!它们太快了!我可以通过编写 Haskell 程序来配置 xmonad!我可以用各种有趣的方式自定义所有内容(例如使用 [dmenu][2] 作为启动器)!这些年来,我用过 3,4 个不同的平铺窗口管理器,它们很有趣。 + +大约 6 年前,我觉得配置平铺窗口管理器对我来说不再是一件有趣的事情,因此转而使用 Ubuntu 桌面环境 Gnome。 (现在,我的笔记本电脑中的内存增加了 500 倍,这要快得多 :) ) + +我使用 Gnome 已有很长时间了,但是我仍然有点想念平铺窗口管理器。六个月前,一个朋友告诉我有关 [PaperWM][3] 的消息,它使你可以在 Gnome中 平铺窗口!我立即安装了它,并从那时起我一直在使用它。 + +### PaperWM:Gnome 下的平铺窗口管理 + +[PaperWM][3] 的基本思想是:你想继续使用 Gnome(因为在 Gnome 中各种任务都能完成),但是你也希望使用平铺窗口管理器。 + +它是一个 Gnome 扩展程序(而不是一个独立的窗口管理器),并且使用 Javascript。 + +### “Paper” 表示你的所有窗户都在一行中 + +PaperWM 的主要思想是将所有窗口排成一行,这实际上与传统的平铺窗口管理器大不相同,在传统的平铺窗口管理器中,你可以按任意方式平铺窗口。这是我写这篇博客时在几个窗口之间切换/调整大小的 gif 图像(有一个浏览器和两个终端窗口): + +![][4] + +PaperWM 的 Github README 链接了此视频:,它描述为一个类似的”线性窗口管理器“。 + +我以前从未听说过这种组织窗口的方式,但是我喜欢它的简单性。如果要查找特定的窗口,只需向左/向右移动,直到找到它。 + +### 我在 PaperWM 中所做的一切 + +还有很多其他功能,但这是我使用的功能: + + * 在窗口之间左右移动(`Super + ,`, `Super + .`) +  * 按顺序向左/向右移动窗口(`Super+Shift+,`,`Super+Shift+.`) +  * 全屏显示窗口(`Super + f`) +  * 缩小窗口(`Super + r`) + + + +### 我喜欢不需要配置的工具 + +我在笔记本上使用 PaperWM 已经6个月了,我真的很喜欢它!即使它是可配置(通过编写 Javascript 配置文件),我也非常欣赏它,它自带我想要的功能,我无需研究如何去配置。 + +[fish shell][5] 是另一个类似的令人愉悦的工具,我基本上没有配置 fish(除了设置环境变量等),我真的很喜欢它的默认功能。 + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2020/01/05/paperwm/ + +作者:[Julia Evans][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://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://xmonad.org/ +[2]: https://wiki.archlinux.org/index.php/Dmenu +[3]: https://github.com/paperwm/PaperWM +[4]: https://jvns.ca/images/paperwm.gif +[5]: https://jvns.ca/blog/2017/04/23/the-fish-shell-is-awesome/ From fa31c8aab28d211786a5992d469b039891f2cd8a Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 10 Jan 2020 08:57:45 +0800 Subject: [PATCH 294/430] translating --- ...06 How to write a Python web API with Pyramid and Cornice.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200106 How to write a Python web API with Pyramid and Cornice.md b/sources/tech/20200106 How to write a Python web API with Pyramid and Cornice.md index 2b10ef953a..eaab46c5bc 100644 --- a/sources/tech/20200106 How to write a Python web API with Pyramid and Cornice.md +++ b/sources/tech/20200106 How to write a Python web API with Pyramid and Cornice.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 357183cce76c020e080a7515e1c79e484db92910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 10 Jan 2020 09:17:48 +0800 Subject: [PATCH 295/430] Translated --- ...21 Simulate gravity in your Python game.md | 96 ++++++++++--------- 1 file changed, 49 insertions(+), 47 deletions(-) rename {sources => translated}/tech/20191121 Simulate gravity in your Python game.md (64%) diff --git a/sources/tech/20191121 Simulate gravity in your Python game.md b/translated/tech/20191121 Simulate gravity in your Python game.md similarity index 64% rename from sources/tech/20191121 Simulate gravity in your Python game.md rename to translated/tech/20191121 Simulate gravity in your Python game.md index 45e4b4ce50..fd02e851d6 100644 --- a/sources/tech/20191121 Simulate gravity in your Python game.md +++ b/translated/tech/20191121 Simulate gravity in your Python game.md @@ -7,29 +7,28 @@ [#]: via: (https://opensource.com/article/19/11/simulate-gravity-python) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -Simulate gravity in your Python game +在你的 Python 游戏中模拟引力 ====== -Learn how to program video games with Python's Pygame module and start -manipulating gravity. +学习如何使用 Python 的 Pygame 模块编程电脑游戏,并开始操作引力。 ![Cosmic stars in outer space][1] -The real world is full of movement and life. The thing that makes the real world so busy and dynamic is physics. Physics is the way matter moves through space. Since a video game world has no matter, it also has no physics, so game programmers have to _simulate_ physics. +真实的世界充满了运动和生活。物理学使得真实的生活如此忙碌和动态。物理学是物质在空间中运动的方式。既然一个电脑游戏世界没有物质,它也就没有物理学规律,使用游戏程序员不得不 _模拟_ 物理学。 -In terms of most video games, there are basically only two aspects of physics that are important: gravity and collision. +从大多数电脑游戏来说,这里基本上仅有物理学的两个方向是重要的:引力和碰撞。 -You implemented some collision detection when you [added an enemy][2] to your game, but this article adds more because gravity requires collision detection. Think about why gravity might involve collisions. If you can't think of any reasons, don't worry—it'll become apparent as you work through the sample code. +当你[添加一个敌人][2]到你的游戏中时,你实现了一下碰撞检测,但是这篇文章添加更多的东西,因为引力需要碰撞检测。想想为什么引力可能涉及碰撞。如果你不能想到任何原因,不要担心—当你通过示例代码工作时,它将变得明显。 -Gravity in the real world is the tendency for objects with mass to be drawn toward one another. The larger the object, the more gravitational influence it exerts. In video game physics, you don't have to create objects with mass great enough to justify a gravitational pull; you can just program a tendency for objects to fall toward the presumed largest object in the video game world: the world itself. +引力在真实世界中的是有质量的物体来相互吸引的趋势。物体(质量)越大,它施加越大的引力作用。在电脑游戏物理学中,你不必创建质量足够大的物体来证明引力的正确;你可以在电脑游戏世界本身中仅编程一个物体落向假设的最大的对象的倾向。 -### Adding a gravity function +### 添加一个引力函数 -Remember that your player already has a property to determine motion. Use this property to pull the player sprite toward the bottom of the screen. +记住你的玩家已经有一个属性来决定动作。使用这个属性来将玩家精灵拉向屏幕底部。 -In Pygame, higher numbers are closer to the bottom edge of the screen. +在 Pygame 中,较高的数字更接近屏幕的底部边缘。 -In the real world, gravity affects everything. In platformers, however, gravity is selective—if you add gravity to your entire game world, all of your platforms would fall to the ground. Instead, you add gravity just to your player and enemy sprites. +在真实的世界中,引力影响一切。然而,在平台中,引力是有选择性的—如果你添加引力到你的整个游戏世界,你所有平台都将掉到地上。作为替换,你仅添加引力到你的玩家和敌人精灵中。 -First, add a **gravity** function in your **Player** class: +首先,在你的 **Player** 类中添加一个 **引力** 函数: ``` @@ -37,11 +36,11 @@ First, add a **gravity** function in your **Player** class:         self.movey += 3.2 # how fast player falls ``` -This is a simple function. First, you set your player in vertical motion, whether your player wants to be in motion or not. In other words, you have programmed your player to always be falling. That's basically gravity. +这是一个简单的函数。首先,不管你的玩家是否想运动,你设置你的玩家垂直运动。也就是说,你已经编程你的玩家总是在下降。这基本上就是引力。 -For the gravity function to have an effect, you must call it in your main loop. This way, Python applies the falling motion to your player once every clock tick. +为使引力函数生效,你必需在你的主循环中调用它。这样,当每一个时钟滴答作响时,Python 应用下落运动到你玩家。 -In this code, add the first line to your loop: +在这代码中,添加第一行到你的循环中: ``` @@ -49,49 +48,50 @@ In this code, add the first line to your loop:     player.update() ``` -Launch your game to see what happens. Look sharp, because it happens fast: your player falls out of the sky, right off your game screen. +启动你的游戏来看看会发生什么。注意,因为它快速地发生:你是玩家从天空上下落,恰好从你的游戏屏幕落下。 -Your gravity simulation is working, but maybe too well. +你的引力模拟是工作的,但是,也许太好了。 -As an experiment, try changing the rate at which your player falls. +作为一次试验,尝试更改你玩家下落的速度。 -### Adding a floor to gravity +### 添加一个地板到引力 -The problem with your character falling off the world is that there's no way for your game to detect it. In some games, if a player falls off the world, the sprite is deleted and respawned somewhere new. In other games, the player loses points or a life. Whatever you want to happen when a player falls off the world, you have to be able to detect when the player disappears offscreen. +你的游戏没有办法发现你的角色掉落出世界的问题。在一些游戏中,如果一个玩家掉落出世界,该精灵被删除,并在新的位置重生。在其它的游戏中,玩家丢失分数或一条生命。当一个玩家掉落出世界时,不管你想发生什么,你必需能够侦测出玩家何时消失在屏幕外。 -In Python, to check for a condition, you can use an **if** statement. +在 Python 中,要检查一个条件,你可以使用一个 **if** 语句。 -You must check to see **if** your player is falling and how far your player has fallen. If your player falls so far that it reaches the bottom of the screen, then you can do _something_. To keep things simple, set the position of the player sprite to 20 pixels above the bottom edge. +你必需查看你玩家**是否**正在掉落,以及你的玩家掉落到什么程度。如果你的玩家掉落到屏幕的底部,那么你可以做 _一些事情_ 。 为保持事情简单,设置玩家精灵的位置为底部边缘上方20像素。 -Make your **gravity** function look like this: +使你的 **引力** 函数看起来像这样: ```     def gravity(self):         self.movey += 3.2 # how fast player falls         -        if self.rect.y > worldy and self.movey >= 0: +        if self.rect.y > worldy and self.movey >= 0:             self.movey = 0             self.rect.y = worldy-ty ``` -Then launch your game. Your sprite still falls, but it stops at the bottom of the screen. You may not be able to _see_ your sprite behind the ground layer, though. An easy fix is to make your player sprite bounce higher by adding another **-ty** to its new Y position after it hits the bottom of the game world: +然后,启动你的游戏。你的精灵仍然下落,但是它停在屏幕的底部。不过,你也许不能 _看到_ 你在地面层下的精灵。一个简单的解决方法是,在精灵碰撞游戏世界的底部后,通过添加另一个 **-ty** 到它的新 Y 位置,从而使你的精灵弹跳更高: ```     def gravity(self):         self.movey += 3.2 # how fast player falls         -        if self.rect.y > worldy and self.movey >= 0: +        if self.rect.y > worldy and self.movey >= 0:             self.movey = 0             self.rect.y = worldy-ty-ty ``` -Now your player bounces at the bottom of the screen, just behind your ground sprites. +现在你的玩家在屏幕底部弹跳,恰好在你地面层精灵的后面。 -What your player really needs is a way to fight gravity. The problem with gravity is, you can't fight it unless you have something to push off of. So, in the next article, you'll add ground and platform collision and the ability to jump. In the meantime, try applying gravity to the enemy sprite. +你的玩家真正需要的是反抗引力的方法。引力问题是,你不能反抗它,除非你有一些东西来推开引力作用。因此,在接下来的文章中,你将添加地面和平台碰撞以及跳跃能力。在这期间,尝试应用引力到敌人精灵。 -Here's all the code so far: + +到目前为止,这里是全部的代码: ``` @@ -150,7 +150,7 @@ class Player(pygame.sprite.Sprite):     def gravity(self):         self.movey += 3.2 # how fast player falls         -        if self.rect.y > worldy and self.movey >= 0: +        if self.rect.y > worldy and self.movey >= 0:             self.movey = 0             self.rect.y = worldy-ty-ty         @@ -170,16 +170,16 @@ class Player(pygame.sprite.Sprite):         self.rect.y = self.rect.y + self.movey         # moving left -        if self.movex < 0: +        if self.movex < 0:             self.frame += 1 -            if self.frame > ani*3: +            if self.frame > ani*3:                 self.frame = 0             self.image = self.images[self.frame//ani]         # moving right -        if self.movex > 0: +        if self.movex > 0:             self.frame += 1 -            if self.frame > ani*3: +            if self.frame > ani*3:                 self.frame = 0             self.image = self.images[(self.frame//ani)+4] @@ -215,9 +215,9 @@ class Enemy(pygame.sprite.Sprite):         distance = 80         speed = 8 -        if self.counter >= 0 and self.counter <= distance: +        if self.counter >= 0 and self.counter <= distance:             self.rect.x += speed -        elif self.counter >= distance and self.counter <= distance*2: +        elif self.counter >= distance and self.counter <= distance*2:             self.rect.x -= speed         else:             self.counter = 0 @@ -243,7 +243,7 @@ class Level():         ground_list = pygame.sprite.Group()         i=0         if lvl == 1: -            while i < len(gloc): +            while i < len(gloc):                 ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png')                 ground_list.add(ground)                 i=i+1 @@ -262,9 +262,9 @@ class Level():             ploc.append((300,worldy-ty-256,3))             ploc.append((500,worldy-ty-128,4)) -            while i < len(ploc): +            while i < len(ploc):                 j=0 -                while j <= ploc[i][2]: +                while j <= ploc[i][2]:                     plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png')                     plat_list.add(plat)                     j=j+1 @@ -311,7 +311,7 @@ tx = 64 #tile size ty = 64 #tile size i=0 -while i <= (worldx/tx)+tx: +while i <= (worldx/tx)+tx:     gloc.append(i*tx)     i=i+1 @@ -366,13 +366,14 @@ while main == True: * * * -This is part 6 in an ongoing series about creating video games in [Python 3][3] using the [Pygame][4] module. Previous articles are: +这是仍在进行中的关于使用 [Pygame][4] 模块来在 [Python 3][3] 在创建电脑游戏的第七部分。先前的文章是: - * [Learn how to program in Python by building a simple dice game][5] - * [Build a game framework with Python using the Pygame module][6] - * [How to add a player to your Python game][7] - * [Using Pygame to move your game character around][8] - * [What's a hero without a villain? How to add one to your Python game][2] + * [通过构建一个简单的掷骰子游戏去学习怎么用 Python 编程][5] + * [使用 Python 和 Pygame 模块构建一个游戏框架][6] + * [如何在你的 Python 游戏中添加一个玩家][7] + * [用 Pygame 使你的游戏角色移动起来][8] + * [如何向你的 Python 游戏中添加一个敌人][2] + * [在 Pygame 游戏中放置平台][9] @@ -382,7 +383,7 @@ via: https://opensource.com/article/19/11/simulate-gravity-python 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[robsean](https://github.com/robsean) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -397,3 +398,4 @@ via: https://opensource.com/article/19/11/simulate-gravity-python [6]: https://opensource.com/article/17/12/game-framework-python [7]: https://opensource.com/article/17/12/game-python-add-a-player [8]: https://opensource.com/article/17/12/game-python-moving-player +[9]: https://opensource.com/article/18/7/put-platforms-python-game From 98e4b4bedc17c4c9995afc79595c695b5aa29608 Mon Sep 17 00:00:00 2001 From: cycoe Date: Fri, 10 Jan 2020 10:29:46 +0800 Subject: [PATCH 296/430] Translating by cycoe --- .../tech/20191205 Add jumping to your Python platformer game.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191205 Add jumping to your Python platformer game.md b/sources/tech/20191205 Add jumping to your Python platformer game.md index 9d64001082..5c4ec0507e 100644 --- a/sources/tech/20191205 Add jumping to your Python platformer game.md +++ b/sources/tech/20191205 Add jumping to your Python platformer game.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (cycoe) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2bc8a25f50d20410b4d452514ceec332b4e55f58 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Jan 2020 10:36:40 +0800 Subject: [PATCH 297/430] PRF @geekpi --- ...et- Screen Recorder. Here-s How to Use it.md | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/translated/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md b/translated/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md index 84d72051eb..f8d1db0dd7 100644 --- a/translated/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md +++ b/translated/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md @@ -1,20 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (GNOME has a ‘Secret’ Screen Recorder. Here’s How to Use it!) [#]: via: (https://itsfoss.com/gnome-screen-recorder/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -GNOME 有一个“秘密”的屏幕录像机。下面是使用方法! +GNOME 有一个“隐藏”的屏幕录像机 ====== -[GNOME][1]是[最受欢迎的桌面环境][2]之一。它有现代的 UI,并且带有许多特定于 GNOME 的应用,这些应用与桌面整体外观完美融合。 +[GNOME][1] 是[最受欢迎的桌面环境][2]之一。它有现代的 UI,并且带有许多特定于 GNOME 的应用,这些应用与桌面整体外观完美融合。 你可以根据自己的喜好来[调整 GNOME][3],但我不在这里讨论。GNOME 桌面有一些你可能不知道的隐藏功能。 -这种不太明显的功能之一是内置的屏幕录像机。 +这种不太显眼的功能之一是内置的屏幕录像机。 是的,你没有看错。如果你使用的是 GNOME 桌面,那么不必安装其他的 [Linux 屏幕录像机][4]。你只需要知道正确的快捷键即可。 @@ -40,9 +40,9 @@ Ctrl + Alt + Shift + R gsettings set org.gnome.settings-daemon.plugins.media-keys max-screencast-length 300 ``` -在上面的命令中,我将录音的最大长度增加到 300 秒(即5分钟)。你可以将其更改为任何其他值,但应以秒为单位。 +在上面的命令中,我将录音的最大长度增加到 300 秒(即 5 分钟)。你可以将其更改为任何其它值,但应以秒为单位。 -如果你**不希望最长录音时间有任何限制,请将其设置为0**,之后它会在你手动停止或者磁盘空间不足才会停止。 +如果你**不希望最长录音时间有任何限制,请将其设置为 `0`**,之后它会在你手动停止或者磁盘空间不足才会停止。 #### 停止屏幕录制 @@ -54,29 +54,24 @@ gsettings set org.gnome.settings-daemon.plugins.media-keys max-screencast-length Ctrl + Alt + Shift + R ``` -你的录制内容将以 [webm][7 ]格式保存在家目录的 “Videos” 文件夹中。 +你的录制内容将以 [webm][7] 格式保存在家目录的 `Videos` 文件夹中。 #### 局限性 尽管使用这个小工具可以方便地快速录制桌面,但是与功能强大的 [Simple Screen Recorder][8] 这样的屏幕录制工具相比,它有一些局限性。 +* 录制开始之前没有时间延迟选项 +* 没有暂停和播放选项 +* 它录制整个屏幕。无法仅录制应用窗口、特定区域或特定屏幕(如果你有多个屏幕)。 +* 视频以 webm 格式保存在用户的 `Videos` 目录中。你无法更改。你必须使用 [HandBrake 之类的工具将视频转换为其他格式][9]。 - * 录制开始之前没有时间延迟选项 -  * 没有暂停和播放选项 -  * 它录制整个屏幕。无法仅录制应用窗口、特定区域或特定屏幕(如果你有多个屏幕)。 -  * 视频以 webm 格式保存在用户的 “Videos” 目录中。你无法更改。你必须使用 [HandBrake 之类的工具将视频转换为其他格式][9]。 - - - -如你所见,秘密的 GNOME 屏幕录像机与 [Kazam][10] 之类的工具或其他此类工具所提供的功能相差很远。 - -但是,它并不会尝试成为全功能的屏幕录像机。它只是为你提供录制屏幕的快速方法。 +如你所见,这个秘密的 GNOME 屏幕录像机与 [Kazam][10] 之类的工具或其他此类工具所提供的功能相差很远。但是,它并不会尝试成为全功能的屏幕录像机。它只是为你提供录制屏幕的快速方法。 GNOME 是一个多功能的现代桌面环境。你可以大量地[调整 GNOME][3]。[GNOME 扩展][11]为桌面自定义提供了另一个维度。 该屏幕录像机是 GNOME 的隐藏功能之一,就像你自己很难轻易找到的挂起选项。 -_你喜欢它吗?你是否还想与我们分享其他隐藏的 GNOME 功能?请在评论区留言。_ +你喜欢它吗?你是否还想与我们分享其他隐藏的 GNOME 功能?请在评论区留言。 -------------------------------------------------------------------------------- @@ -85,7 +80,7 @@ via: https://itsfoss.com/gnome-screen-recorder/ 作者:[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 6924452c356a4ea7ded256846182ec79f2d1e709 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Jan 2020 10:37:32 +0800 Subject: [PATCH 298/430] PUB @geekpi https://linux.cn/article-11766-1.html --- ...ME has a ‘Secret- Screen Recorder. Here-s How to Use it.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md (98%) diff --git a/translated/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md b/published/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md similarity index 98% rename from translated/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md rename to published/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md index f8d1db0dd7..87e445c9b0 100644 --- a/translated/tech/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md +++ b/published/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11766-1.html) [#]: subject: (GNOME has a ‘Secret’ Screen Recorder. Here’s How to Use it!) [#]: via: (https://itsfoss.com/gnome-screen-recorder/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 480defaa87da0c8e6d029aa4a573dc35c74ddf06 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 10 Jan 2020 10:42:14 +0800 Subject: [PATCH 299/430] =?UTF-8?q?Rename=2020200103=20GNOME=20has=20a=20?= =?UTF-8?q?=E2=80=98Secret-=20Screen=20Recorder.=20Here-s=20How=20to=20Use?= =?UTF-8?q?=20it.md=20to=2020200103=20GNOME=20has=20a=20Secret-=20Screen?= =?UTF-8?q?=20Recorder.=20Here-s=20How=20to=20Use=20it.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...03 GNOME has a Secret- Screen Recorder. Here-s How to Use it.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename published/{20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md => 20200103 GNOME has a Secret- Screen Recorder. Here-s How to Use it.md} (100%) diff --git a/published/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md b/published/20200103 GNOME has a Secret- Screen Recorder. Here-s How to Use it.md similarity index 100% rename from published/20200103 GNOME has a ‘Secret- Screen Recorder. Here-s How to Use it.md rename to published/20200103 GNOME has a Secret- Screen Recorder. Here-s How to Use it.md From 0778586a45ccd97d95ea036c047d5945a1235c21 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 10 Jan 2020 11:16:17 +0800 Subject: [PATCH 300/430] Revert "Fiveweb done" --- ...181105 5 Minimal Web Browsers for Linux.md | 171 ++++++++++++++++++ ...181105 5 Minimal Web Browsers for Linux.md | 167 ----------------- 2 files changed, 171 insertions(+), 167 deletions(-) create mode 100644 sources/tech/20181105 5 Minimal Web Browsers for Linux.md delete mode 100644 translated/tech/20181105 5 Minimal Web Browsers for Linux.md diff --git a/sources/tech/20181105 5 Minimal Web Browsers for Linux.md b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md new file mode 100644 index 0000000000..34c0c1e18e --- /dev/null +++ b/sources/tech/20181105 5 Minimal Web Browsers for Linux.md @@ -0,0 +1,171 @@ +[#]: collector: (lujun9972) +[#]: translator: (MonkeyDEcho ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: subject: (5 Minimal Web Browsers for Linux) +[#]: via: (https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-linux) +[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) +[#]: url: ( ) + +5 Minimal Web Browsers for Linux +====== +linux上的五种微型浏览器 +====== + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimal.jpg?itok=ifA0Y3pV) + +There are so many reasons to enjoy the Linux desktop. One reason I often state up front is the almost unlimited number of choices to be found at almost every conceivable level. From how you interact with the operating system (via a desktop interface), to how daemons run, to what tools you use, you have a multitude of options. +有太多理由去选择使用linux系统。很重要的一个理由是,我们可以按照我们自己的想法去选择想要的。从操作系统的交互方式(桌面系统)到守护系统的运行方式,在到使用的工具,你用更多的选择。 + +The same thing goes for web browsers. You can use anything from open source favorites, such as [Firefox][1] and [Chromium][2], or closed sourced industry darlings like [Vivaldi][3] and [Chrome][4]. Those options are full-fledged browsers with every possible bell and whistle you’ll ever need. For some, these feature-rich browsers are perfect for everyday needs. +web浏览器也是如此。你可以使用开源的[火狐][1],[Chromium][2];或者未开源的[Vivaldi][3],[Chrome][4]。这些功能强大的浏览器有你需要的各种功能。对于某些人,这些功能完备的浏览器是日常必需的。 + +There are those, however, who prefer using a web browser without all the frills. In fact, there are many reasons why you might prefer a minimal browser over a standard browser. For some, it’s about browser security, while others look at a web browser as a single-function tool (as opposed to a one-stop shop application). Still others might be running low-powered machines that cannot handle the requirements of, say, Firefox or Chrome. Regardless of the reason, Linux has you covered. +但是,有些人更喜欢没有冗余功能的纯粹的浏览器。实际上,有很多原因导致你会选择微型的浏览器而不选择上述功能完备的浏览器。对于某些人来说,与浏览器的安全有关;而有些人则将浏览器当作一种简单的工具(而不是一站式商店应用程序);还有一些可能运行在低功率的计算机上,这些计算机无法满足火狐,chrome浏览器的运行要求。无论出于何种原因,在linux系统上都可以满足你的要求。 + +Let’s take a look at five of the minimal browsers that can be installed on Linux. I’ll be demonstrating these browsers on the Elementary OS platform, but each of these browsers are available to nearly every distribution in the known Linuxverse. Let’s dive in. +让我们看一下可以在linux上安装运行的五种微型浏览器。我将在 Elementary 的操作系统平台上演示这些浏览器,在已知的linux发型版中几乎每个版本都可以使用这些浏览器。让我们一起来看一下吧! + +### GNOME Web + +GNOME Web (codename Epiphany, which means [“a usually sudden manifestation or perception of the essential nature or meaning of something”][5]) is the default web browser for Elementary OS, but it can be installed from the standard repositories. (Note, however, that the recommended installation of Epiphany is via Flatpak or Snap). If you choose to install via the standard package manager, issue a command such as sudo apt-get install epiphany-browser -y for successful installation. +GNOME web (Epiphany 含义:[顿悟][5])是Elementary系统默认的web浏览器,也可以从标准存储库中安装。(注意,建议通过使用 Flatpak 或者 Snap 工具安装),如果你想选择标准软件包管理器进行安装,请执行 ```sudo apt-get install epiphany-browser -y``` 命令成功安装。 + +Epiphany uses the WebKit rendering engine, which is the same engine used in Apple’s Safari browser. Couple that rendering engine with the fact that Epiphany has very little in terms of bloat to get in the way, you will enjoy very fast page-rendering speeds. Epiphany development follows strict adherence to the following guidelines: + + * Simplicity - Feature bloat and user interface clutter are considered evil. + + * Standards compliance - No non-standard features will ever be introduced to the codebase. + + * Software freedom - Epiphany will always be released under a license that respects freedom. + + * Human interface - Epiphany follows the [GNOME Human Interface Guidelines][6]. + + * Minimal preferences - Preferences are only added when they make sense and after careful consideration. + + * Target audience - Non-technical users are the primary target audience (which helps to define the types of features that are included). + + + + +GNOME Web is as clean and simple a web browser as you’ll find (Figure 1). + +![GNOME Web][8] + +Figure 1: The GNOME Web browser displaying a minimal amount of preferences for the user. + +[Used with permission][9] + +The GNOME Web manifesto reads: + +A web browser is more than an application: it is a way of thinking, a way of seeing the world. Epiphany's principles are simplicity, standards compliance, and software freedom. + +### Netsurf + +The [Netsurf][10] minimal web browser opens almost faster than you can release the mouse button. Netsurf uses its own layout and rendering engine (designed completely from scratch), which is rather hit and miss in its rendering (Figure 2). + +![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_2.jpg?itok=KhGhIKlj) + +Although you might find Netsurf to suffer from rendering issues on certain sites, understand the Hubbub HTML parser is following the work-in-progress HTML5 specification, so there will be issues popup now and then. To ease those rendering headaches, Netsurf does include HTTPS support, web page thumbnailing, URL completion, scale view, bookmarks, full-screen mode, keyboard shorts, and no particular GUI toolkit requirements. That last bit is important, especially when you switch from one desktop to another. + +For those curious as to the requirements for Netsurf, the browser can run on a machine as slow as a 30Mhz ARM 6 computer with 16MB of RAM. That’s impressive, by today’s standard. + +### QupZilla + +If you’re looking for a minimal browser that uses the Qt Framework and the QtWebKit rendering engine, [QupZilla][11] might be exactly what you’re looking for. QupZilla does include all the standard features and functions you’d expect from a web browser, such as bookmarks, history, sidebar, tabs, RSS feeds, ad blocking, flash blocking, and CA Certificates management. Even with those features, QupZilla still manages to remain a very fast lightweight web browser. Other features include: Fast startup, speed dial homepage, built-in screenshot tool, browser themes, and more. +One feature that should appeal to average users is that QupZilla has a more standard preferences tools than found in many lightweight browsers (Figure 3). So, if going too far outside the lines isn’t your style, but you still want something lighter weight, QupZilla is the browser for you. + +![QupZilla][13] + +Figure 3: The QupZilla preferences tool. + +[Used with permission][9] + +### Otter Browser + +Otter Browser is a free, open source attempt to recreate the closed-source offerings found in the Opera Browser. Otter Browser uses the WebKit rendering engine and has an interface that should be immediately familiar with any user. Although lightweight, Otter Browser does include full-blown features such as: + + * Passwords manager + + * Add-on manager + + * Content blocking + + * Spell checking + + * Customizable GUI + + * URL completion + + * Speed dial (Figure 4) + + * Bookmarks and various related features + + * Mouse gestures + + * User style sheets + + * Built-in Note tool + + +![Otter][15] + +Figure 4: The Otter Browser Speed Dial tab. + +[Used with permission][9] + +Otter Browser can be run on nearly any Linux distribution from an [AppImage][16], so there’s no installation required. Just download the AppImage file, give the file executable permissions (with the command chmod u+x otter-browser-*.AppImage), and then launch the app with the command ./otter-browser*.AppImage. + +Otter Browser does an outstanding job of rendering websites and could function as your go-to minimal browser with ease. + +### Lynx + +Let’s get really minimal. When I first started using Linux, back in ‘97, one of the web browsers I often turned to was a text-only take on the app called [Lynx][17]. It should come as no surprise that Lynx is still around and available for installation from the standard repositories. As you might expect, Lynx works from the terminal window and doesn’t display pretty pictures or render much in the way of advanced features (Figure 5). In fact, Lynx is as bare-bones a browser as you will find available. Because of how bare-bones this web browser is, it’s not recommended for everyone. But if you happen to have a gui-less web server and you have a need to be able to read the occasional website, Lynx can be a real lifesaver. + +![Lynx][19] + +Figure 5: The Lynx browser rendering the Linux.com page. + +[Used with permission][9] + +I have also found Lynx an invaluable tool when troubleshooting certain aspects of a website (or if some feature on a website is preventing me from viewing the content in a regular browser). Another good reason to use Lynx is when you only want to view the content (and not the extraneous elements). + +### Plenty More Where This Came From + +There are plenty more minimal browsers than this. But the list presented here should get you started down the path of minimalism. One (or more) of these browsers are sure to fill that need, whether you’re running it on a low-powered machine or not. + +Learn more about Linux through the free ["Introduction to Linux" ][20]course from The Linux Foundation and edX. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-linux + +作者:[Jack Wallen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/users/jlwallen +[b]: https://github.com/lujun9972 +[1]: https://www.mozilla.org/en-US/firefox/new/ +[2]: https://www.chromium.org/ +[3]: https://vivaldi.com/ +[4]: https://www.google.com/chrome/ +[5]: https://www.merriam-webster.com/dictionary/epiphany +[6]: https://developer.gnome.org/hig/stable/ +[7]: /files/images/minimalbrowsers1jpg +[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_1.jpg?itok=Q7wZLF8B (GNOME Web) +[9]: /licenses/category/used-permission +[10]: https://www.netsurf-browser.org/ +[11]: https://qupzilla.com/ +[12]: /files/images/minimalbrowsers3jpg +[13]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_3.jpg?itok=O8iMALWO (QupZilla) +[14]: /files/images/minimalbrowsers4jpg +[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_4.jpg?itok=5bCa0z-e (Otter) +[16]: https://sourceforge.net/projects/otter-browser/files/ +[17]: https://lynx.browser.org/ +[18]: /files/images/minimalbrowsers5jpg +[19]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_5.jpg?itok=p_Lmiuxh (Lynx) +[20]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux diff --git a/translated/tech/20181105 5 Minimal Web Browsers for Linux.md b/translated/tech/20181105 5 Minimal Web Browsers for Linux.md deleted file mode 100644 index 1a533e6557..0000000000 --- a/translated/tech/20181105 5 Minimal Web Browsers for Linux.md +++ /dev/null @@ -1,167 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MonkeyDEcho ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: subject: (5 Minimal Web Browsers for Linux) -[#]: via: (https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-linux) -[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen) -[#]: url: ( ) - - -linux上的五种微型浏览器 -====== - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimal.jpg?itok=ifA0Y3pV) - -有太多理由去选择使用linux系统。很重要的一个理由是,我们可以按照我们自己的想法去选择想要的。从操作系统的交互方式(桌面系统)到守护系统的运行方式,在到使用的工具,你用更多的选择。 - -web浏览器也是如此。你可以使用开源的[火狐][1],[Chromium][2];或者未开源的[Vivaldi][3],[Chrome][4]。这些功能强大的浏览器有你需要的各种功能。对于某些人,这些功能完备的浏览器是日常必需的。 - -但是,有些人更喜欢没有冗余功能的纯粹的浏览器。实际上,有很多原因导致你会选择微型的浏览器而不选择上述功能完备的浏览器。对于某些人来说,与浏览器的安全有关;而有些人则将浏览器当作一种简单的工具(而不是一站式商店应用程序);还有一些可能运行在低功率的计算机上,这些计算机无法满足火狐,chrome浏览器的运行要求。无论出于何种原因,在linux系统上都可以满足你的要求。 - -让我们看一下可以在linux上安装运行的五种微型浏览器。我将在 Elementary 的操作系统平台上演示这些浏览器,在已知的linux发型版中几乎每个版本都可以使用这些浏览器。让我们一起来看一下吧! - -### GNOME Web - -GNOME web (Epiphany 含义:[顿悟][5])是Elementary系统默认的web浏览器,也可以从标准存储库中安装。(注意,建议通过使用 Flatpak 或者 Snap 工具安装),如果你想选择标准软件包管理器进行安装,请执行 ```sudo apt-get install epiphany-browser -y``` 命令成功安装。 - -Epiphany 使用WebKit的渲染引擎,该引擎与Apple的Safari浏览器中使用的引擎相同。这个引擎和Epiphany非常契合,可以达到非常快的页面渲染速度。Epiphany严格遵守以下准则: - - * 简单性 - 功能复杂和用户界面混乱都是不被允许的. - - * 规范性 - 任何非标准特性都不会引入到代码库中。 - - * 软件开源 - Epiphany始终遵守自由开源许可证。 - - * 人机交互 - Epiphany 始终遵守[GNOME的人机交互指南][6]。 - - * 最小首选项 - 经过慎重考虑才添加首选项。 - - * 受众群体 - 非技术用户是主要的受众目标,(有助于定义所包含功能的类型)。 - - - - -GNOME web浏览器就像看到的一样干净简洁 (Figure 1)。 - - -![GNOME Web][8] - -Figure 1: GNOME 浏览器为用户展示最少的首选项. - -[许可证书][9] - -GNOME Web 的声明如下: - -web 浏览器它不仅仅是一个应用程序,还是一种思维方式,一种看世界的方式。 Epiphany 的原则是简洁,标准和自由。 -### Netsurf - -[Netsurf][10] 浏览器是最小的浏览器,他的打开速度几乎和你松开鼠标一样。Netsurf 使用自己的布局和渲染引擎(完全从零开始设计的) 在渲染过程的设计中屡屡碰壁(Figure 2). - -![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_2.jpg?itok=KhGhIKlj) - -尽管你可能在特定的站点上发现 Netsurf的问题,但如果你了解Hubbub解析器的话,知道它正在兼容html5规范,是不是的会有一点问题。Netsurf对https的支持,网页缩略图,URL解析,缩放视图,书签,全屏模式,快捷键和GUI的工具包的功能;最后一点十分重要,当你桌面来回切换时,为了缓解渲染带来的问题。 - -对于那些对Netsurf 存在好奇的人来说,以现在的标准,他能在 16MB内存,30Mhz的ARM cpu的机器上运行,是让人惊奇的。 - -### QupZilla - -如果你找寻使用Qt Framework 和 the QtWebKit 渲染引擎的最小浏览器,QupZilla][11]是你最佳的选择。QupZilla 包含web浏览所有的标准功能,例如:书签,历史记录,侧边栏,选项卡,RSS,广告屏蔽,flash屏蔽,和CA证书管理。及时拥有这么多的功能,QupZilla 仍然是快速,轻量级的浏览器。另外还有其他的功能:快速启动,快速拨号主页,内置屏幕截图工具,浏览器主题等。 -吸引用户的一点是,与许多轻量级浏览器相比,QupZilla有更标准的首选项工具(图3)。所以,如果你很多功能,但你仍然想要更轻量,那么QupZilla就是你最好的选择。 - -![QupZilla][13] - -Figure 3: QupZilla 首选项工具. - -[许可证书][9] - -### Otter Browser - -Otter 浏览器是一种免费开源的,旨在重建Opera 12.x的浏览器。它使用WebKit渲染引擎,并且有用户的熟悉界面。虽然它轻量,但它有丰富的功能: - - * 密码管理 - - * 插件管理 - - * 内容拦截 - - * 拼写检查 - - * 自定义界面 - - * 网址补全 - - * 快速访问 (Figure 4) - - * 书签和其他相关功能 - - * 鼠标手势 - - * 用户样式表 - - * 内建笔记功能 - - -![Otter][15] - -Figure 4: Otter 浏览器快起标签项. - -[许可证书][9] - -Otter浏览器可以在几乎所有Linux发行版上运行通过[AppImage][16]软件格式,因此无需安装。只需下载AppImage文件,授予文件可执行权限(使用命令 `chmod u+x otter-browser-.AppImage`),然后使用命令`./otter-browser.AppImage` 启动应用程序。 - -Otter浏览器在网站展示方面做得非常出色,可以轻松地用作你的微型浏览器。 - - -### Lynx - -让我们见识真正的微型浏览器。早在97年,当我使用Linux时,就经常使用的[Lynx][17]纯文本模式的网页浏览器。 -Lynx的存在并且可以从标准存储库中进行安装。正如您可能期望的那样,Lynx在终端窗口中工作,并且不会显示漂亮的图片和高级功能的渲染方式(图5)。事实上,Lynx是你能找到的最简单的浏览器。由于这个网页浏览器是如此简陋,所以不建议每个人都使用它。但如果你碰巧有一个没有界面的服务器,你需要能够偶尔访问的网站,Lynx是一个真正的救星。 - -![Lynx][19] - -Figure 5: Lynx 浏览器展示 Linux.com 网址界面. - -[许可证书][9] - -我还发现Lynx是一个非常有用的工具,它可以帮助我解决网站某些方面的故障(或者如果网站上的某些功能阻止我在常规浏览器中查看内容)。使用Lynx的另一个重要原因是它可以让我们更加专注内容(而不是其他无关的元素)。 - -### Plenty More Where This Came From 更多 - -微型浏览器还有很多。但是这里列出的清单应该使你开始走极简主义的道路。无论您是否在低功率计算机上运行,​​这些浏览器中的一个(或多个)都一定可以满足这一需求。 - -了解linux 更多信息可以通过免费的["Linux 简洁" ][20]课程,该课程来源Linux基金和edX平台提供的。 - --------------------------------------------------------------------------------- - -via: https://www.linux.com/blog/intro-to-linux/2018/11/5-minimal-web-browsers-linux - -作者:[Jack Wallen][a] -选题:[lujun9972][b] -译者:[MonkeyDEcho](https://github.com/MonkeyDEcho) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.linux.com/users/jlwallen -[b]: https://github.com/lujun9972 -[1]: https://www.mozilla.org/en-US/firefox/new/ -[2]: https://www.chromium.org/ -[3]: https://vivaldi.com/ -[4]: https://www.google.com/chrome/ -[5]: https://www.merriam-webster.com/dictionary/epiphany -[6]: https://developer.gnome.org/hig/stable/ -[7]: /files/images/minimalbrowsers1jpg -[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_1.jpg?itok=Q7wZLF8B (GNOME Web) -[9]: /licenses/category/used-permission -[10]: https://www.netsurf-browser.org/ -[11]: https://qupzilla.com/ -[12]: /files/images/minimalbrowsers3jpg -[13]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_3.jpg?itok=O8iMALWO (QupZilla) -[14]: /files/images/minimalbrowsers4jpg -[15]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_4.jpg?itok=5bCa0z-e (Otter) -[16]: https://sourceforge.net/projects/otter-browser/files/ -[17]: https://lynx.browser.org/ -[18]: /files/images/minimalbrowsers5jpg -[19]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/minimalbrowsers_5.jpg?itok=p_Lmiuxh (Lynx) -[20]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux From bfdde198d60206c3f109adfdcaf35d04f6bf0adb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Jan 2020 11:39:24 +0800 Subject: [PATCH 301/430] PRF&PUB @wxy https://linux.cn/article-11768-1.html --- .../20190405 File sharing with Git.md | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) rename {translated/tech => published}/20190405 File sharing with Git.md (66%) diff --git a/translated/tech/20190405 File sharing with Git.md b/published/20190405 File sharing with Git.md similarity index 66% rename from translated/tech/20190405 File sharing with Git.md rename to published/20190405 File sharing with Git.md index a1ad1bc228..57d89c14c8 100644 --- a/translated/tech/20190405 File sharing with Git.md +++ b/published/20190405 File sharing with Git.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11768-1.html) [#]: subject: (File sharing with Git) [#]: via: (https://opensource.com/article/19/4/file-sharing-git) [#]: author: (Seth Kenlon) -用 Git 共享文件 +用 Git 来共享文件 ====== -> SparkleShare 是一个开源的基于 Git、Dropbox 风格的文件共享应用程序。在我们的系列文章中了解有关 Git 鲜为人知的用法。 +> SparkleShare 是一个开源的基于 Git 的 Dropbox 风格的文件共享应用程序。在我们的系列文章中了解有关 Git 鲜为人知的用法。 -![][1] +![](https://img.linux.net.cn/data/attachment/album/202001/10/113645qb2ufvuu2ttimugv.png) [Git][2] 是一个少有的能将如此多的现代计算封装到一个程序之中的应用程序,它可以用作许多其他应用程序的计算引擎。虽然它以跟踪软件开发中的源代码更改而闻名,但它还有许多其他用途,可以让你的生活更轻松、更有条理。在这个 Git 系列中,我们将分享七种鲜为人知的使用 Git 的方法。 @@ -22,13 +22,13 @@ Git 的优点之一是它具有固有的分发能力。它可用来建立共享。即使你只是与自己网络上的其他计算机共享资源库,Git 也会为从共享位置获取文件的行为带来透明性。 -随着其界面的发展,Git 变得非常简单。虽然因用户而异,他们坐下来完成一些工作时的共同点仅仅是 `git pull` 或稍微复杂一点的 `git pull && git checkout -b my-branch`。但是,对于某些人来说,将*命令输入*到他们的计算机中的做法完全是令人困惑或烦恼的。计算机旨在使生活变得轻松,计算机擅长重复性工作,因此有更简便的方法可以与 Git 共享文件。 +随着其界面的发展,Git 变得非常简单。虽然因用户而异,他们坐下来完成一些工作时的共同点仅仅是 `git pull` 或稍微复杂一点的 `git pull && git checkout -b my-branch`。但是,对于某些人来说,将*命令输入*到他们的计算机中的做法完全是令人困惑或烦恼的。计算机旨在使生活变得轻松,它擅长于重复性工作,因此有更简便的方法可以与 Git 共享文件。 ### SparkleShare -[SparkleShare][3] 项目是一个基于 Git 的跨平台的开源的 Dropbox 式的文件共享应用程序。它通过将文件拖放到专门指定的 SparkleShare 目录中的简单操作,自动执行所有 Git 命令,触发添加、提交、推送和拉取过程。因为它基于 Git,所以你可以获得基于差异(diff)的快速推送和拉取,并且继承了 Git 版本控制和后端基础设施(如 Git 挂钩)的所有优点。它可以完全自托管,也可以将其与 [GitLab][4]、GitHub、Bitbucket 等 Git 托管服务一起使用。此外,由于它基本上只是一个 Git 的前端,因此你可以在可能没有 SparkleShare 客户端但有 Git 客户端的设备上访问 SparkleShare 中的文件。 +[SparkleShare][3] 项目是一个基于 Git 的跨平台的、开源的 Dropbox 式的文件共享应用程序。它通过将文件拖放到专门指定的 SparkleShare 目录中的简单操作,自动执行所有 Git 命令,触发添加、提交、推送和拉取过程。因为它基于 Git,所以你可以获得基于差异(diff)的快速推送和拉取,并且继承了 Git 版本控制和后端基础设施(如 Git 挂钩)的所有优点。它可以完全自托管,也可以将其与 [GitLab][4]、GitHub、Bitbucket 等 Git 托管服务一起使用。此外,由于它基本上只是一个 Git 的前端,因此你可以在可能没有 SparkleShare 客户端但有 Git 客户端的设备上访问 SparkleShare 中的文件。 -正如你获得 Git 的所有好处一样,你也会受到所有常见的 Git 限制:使用 SparkleShare 存储数百张照片、音乐和视频是不切实际的,因为 Git 是为文本而设计和优化的。Git 当然可以存储二进制文件的大文件,但是因为它可以跟踪历史记录,因此一旦将文件添加到其中,几乎就不可能完全删除它。这在某种程度上限制了 SparkleShare 对某些人的实用性,但使其非常适合许多工作流程,包括 [日程安排][5]。 +正如你获得 Git 的所有好处一样,你也会受到所有常见的 Git 限制:使用 SparkleShare 存储数百张照片、音乐和视频是不切实际的,因为 Git 是为文本而设计和优化的。Git 当然可以存储二进制文件的大文件,但是因为它可以跟踪历史记录,因此一旦将文件添加到其中,几乎就不可能完全删除它。这在某种程度上限制了 SparkleShare 对某些人的实用性,但使其非常适合许多工作流程,包括[日程安排][5]。 #### 安装 SparkleShare @@ -41,17 +41,17 @@ $ sudo flatpak install flathub org.sparkleshare.SparkleShare ### 创建一个 Git 存储库 -SparkleShare 并不是软件即服务(SaaS)。你在计算机上运行 SparkleShare 以与 Git 存储库进行通信,而 SparkleShare 并不存储你的数据。如果你还没有与文件夹同步的 Git 存储库,则必须在启动 SparkleShare 之前创建一个文件夹。你有三个选择:托管的 Git、自托管 Git 或自托管 SparkleShare。 +SparkleShare 并不是软件即服务(SaaS)。你在计算机上运行 SparkleShare 与 Git 存储库进行通信,而 SparkleShare 并不存储你的数据。如果你还没有与文件夹同步的 Git 存储库,则必须在启动 SparkleShare 之前创建一个文件夹。你有三个选择:托管的 Git、自托管 Git 或自托管 SparkleShare。 -#### 托管的 Git +#### 托管的 Git -SparkleShare 可以使用你可以访问的任何 Git 存储库进行存储,因此,如果你拥有(或可在其中创建的)GitLab 或任何其他托管服务的帐户,则它可以成为 SparkleShare 的后端。例如,开源 [Notabug.org][8] 服务是一个类似于 GitHub 和 GitLab 的 Git 托管服务,但其独特性足以证明 SparkleShare 的灵活性。根据用户界面的不同,不同的托管服务创建新存储库的方法也有所不同,但是所有主要存储库都遵循相同的通用模型。 +SparkleShare 可以使用你能访问的任何 Git 存储库进行存储,因此,如果你拥有 GitLab 或任何其他托管服务的帐户(或创建一个),则它可以成为 SparkleShare 的后端。例如,开源 [Notabug.org][8] 服务是一个类似于 GitHub 和 GitLab 的 Git 托管服务,但其独特性足以证明 SparkleShare 的灵活性。根据用户界面的不同,不同的托管服务创建新存储库的方法也有所不同,但是所有主要存储库都遵循相同的通用模型。 -首先,在托管服务中找到创建一个新项目或存储库的按钮,单击它以开始。然后逐步完成存储库的创建过程,为存储库提供名称、隐私级别(存储库通常默认为公共),以及是否使用 `README` 文件初始化存储库。无论你是否需要个 `README` 文件,请初始化建立一个。使用一个文件创立存储库不是绝对必要的,但是它会强制 Git 主机实例化存储库中的 `master` 分支,这有助于确保前端应用程序(例如 SparkleShare)具有要提交并推送的分支。即使文件几乎是空的 `README` 文件,也可以用来查看该文件以确认你已连接成功。 +首先,在托管服务中找到创建新项目或存储库的按钮,单击它以开始。然后逐步完成存储库的创建过程,为存储库提供名称、隐私级别(存储库通常默认为公共),以及是否使用 `README` 文件初始化存储库。无论你是否需要个 `README` 文件,请初始化建立一个。使用一个文件来创建存储库不是绝对必要的,但是它会强制 Git 主机实例化存储库中的 `master` 分支,这有助于确保前端应用程序(例如 SparkleShare)具有要提交并推送的分支。即使文件是几乎空的 `README` 文件,也可以用来查看该文件以确认你已连接成功。 ![Creating a Git repository][9] -创建存储库后,获取其用于 SSH 克隆的 URL。你可以像获取任何人从 Git 项目获得其 URL 一样获得此 URL:导航至存储库页面并查找 “Clone” 按钮或字段。 +创建存储库后,获取其用于 SSH 克隆的 URL。就像从 Git 项目获得其 URL 一样,你也可以获取此 URL:导航至存储库页面并查找 “Clone” 按钮或字段。 ![Cloning a URL on GitHub][10] @@ -63,7 +63,6 @@ SparkleShare 可以使用你可以访问的任何 Git 存储库进行存储, 这是 SparkleShare 用于获取数据的地址,因此请记下它。你的 Git 存储库现已配置好。 - #### 自托管的 Git 你可以使用 SparkleShare 访问你有权访问的任何计算机上的 Git 存储库。除了一个 Git 裸存储库外,无需任何特殊设置。但是,如果你想将对 Git 存储库的访问权授予其他任何人,则应运行 [Gitolite][12] 之类的 Git 管理器或 SparkleShare 自己的 Dazzle 服务器来帮助你管理 SSH 密钥和帐户。至少,创建一个特定于 Git 的用户,以便有权访问你的 Git 存储库的用户不会自动获得对服务器其余部分的访问权限。 @@ -99,21 +98,21 @@ $ dazzle create sparkly ### 配置 SparkleShare -首次启动 SparkleShare 时,系统会提示你配置要让 SparkleShare 用于存储的服务器。这个过程可能看起来像一个首次运行的安装向导,但实际上是在 SparkleShare 中设置新共享位置的通常过程。与许多共享驱动器应用程序不同,使用 SparkleShare 可以一次配置多个位置。你配置的第一个共享位置并不比你以后可以设置的任何共享位置重要,并且你也没有注册 SparkleShare 或任何其他服务。你只是将 SparkleShare 指向 Git 存储库,以便它知道如何使第一个 SparkleShare 文件夹保持同步。 +首次启动 SparkleShare 时,系统会提示你配置 SparkleShare 用于存储的服务器。这个过程可能看起来像一个首次运行的安装向导,但实际上是在 SparkleShare 中设置新共享位置的通常过程。与许多共享驱动器应用程序不同,使用 SparkleShare 可以一次配置多个位置。你配置的第一个共享位置并不比你以后可以配置的任何共享位置更重要,并且你也不用注册 SparkleShare 或任何其他服务。你只是将 SparkleShare 指向 Git 存储库,以便它知道如何使第一个 SparkleShare 文件夹保持同步。 -在第一个屏幕上,给出一个身份,SparkleShare 将在代表你进行的 Git 提交记录中使用这些信息。你可以使用任何内容,甚至可以不代表任何意义的伪造信息。它仅用于提交消息,如果你对审查 Git 后端进程没有兴趣,你可能甚至看不到它们。 +在第一个屏幕上,给出一个身份信息,SparkleShare 将在代表你进行的 Git 提交记录中使用这些信息。你可以使用任何内容,甚至可以使用不代表任何意义的伪造信息。它仅用于提交消息,如果你对审查 Git 后端进程没有兴趣,你可能甚至看不到它们。 下一个屏幕提示你选择主机类型。如果你使用的是 GitLab、GitHub、Planio 或 Bitbucket,则可以选择一个适当的。否则,请选择“自己的服务器”。 ![Choosing a Sparkleshare host][14] -在此屏幕底部,您必须输入 SSH 的克隆 URL。如果你是自托管的 Git,则地址类似于 ``,而远程路径是为此目的而创建的 Git 存储库的绝对路径。 +在此屏幕底部,你必须输入 SSH 的克隆 URL。如果你是自托管的 Git,则地址类似于 ``,而远程路径是为此目的而创建的 Git 存储库的绝对路径。 -根据上面的自托管示例,我虚构的服务器的地址为 `ssh://git@example.com:22122`(`:22122` 表示非标准的 SSH 端口),远程路径为 `/home/git/sparkly.git`。 +根据上面的自托管示例,我虚构的服务器的地址为 `ssh://git@example.com:22122`(`:22122` 表示一个非标准的 SSH 端口),远程路径为 `/home/git/sparkly.git`。 如果我改用 Notabug.org 帐户,则上例中的地址为 `ssh://git@notabug.org`,路径为 `seth/sparkly.git`。 -SparkleShare 首次尝试连接到主机时将失败,因为你尚未将 SparkleShare 客户端 ID(特定于 SparkleShare 应用程序的 SSH 密钥)复制到 Git 主机。这是预料之中的,所以不要取消该过程。将 SparkleShare 设置窗口保持打开状态,并从系统任务栏中的 SparkleShare 图标处获取客户端 ID。然后将客户端 ID 复制到剪贴板,以便可以将其添加到 Git 主机。 +SparkleShare 首次尝试连接到主机时会失败,因为你尚未将 SparkleShare 客户端 ID(特定于 SparkleShare 应用程序的 SSH 密钥)复制到 Git 主机。这是预料之中的,所以不要取消该过程。将 SparkleShare 设置窗口保持打开状态,并从系统任务栏中的 SparkleShare 图标处获取客户端 ID。然后将客户端 ID 复制到剪贴板,以便可以将其添加到 Git 主机。 ![Getting the client ID from Sparkleshare][16] @@ -127,7 +126,7 @@ SparkleShare 首次尝试连接到主机时将失败,因为你尚未将 Sparkl #### 将你的客户端 ID 添加到自托管的 Git 帐户 -SparkleShare 客户端 ID 只是一个 SSH 密钥,因此将其复制并粘贴到 Git 用户的 `~/.ssh/authorized_keys`文件中。 +SparkleShare 客户端 ID 只是一个 SSH 密钥,因此将其复制并粘贴到 Git 用户的 `~/.ssh/authorized_keys` 文件中。 #### 使用 Dazzle 添加你的客户 ID @@ -153,7 +152,7 @@ $ dazzle link #### 排除某些文件 -由于 Git 从设计上就是要记住*一切*,因此你可能希望从记录中排除特定的文件类型。排除一些文件是有原因的。通过定义摆脱 SparkleShare 限制的文件,可以避免意外复制大文件。你还可以为自己设计一种方案,使你可以将存储在一个目录中的逻辑上属于同一文件(例如,MIDI 文件及其 .flac 导出文件),但是可以自己手动备份大文件,而同时让 SparkleShare 备份基于文本的文件。 +由于 Git 从设计上就是要记住*一切*,因此你可能希望从记录中排除特定的文件类型。排除一些文件是有原因的。通过定义摆脱 SparkleShare 管理的文件,可以避免意外复制大文件。你还可以为自己设计一种方案,使你可以将存储在一个目录中的逻辑上属于同一个文件(例如,MIDI 文件及其 .flac 导出文件),但是可以自己手动备份大文件,而同时让 SparkleShare 备份基于文本的文件。 如果在系统的文件管理器中看不到隐藏的文件,请显示它们。导航到你的 SparkleShare 文件夹,然后到代表你的存储库的目录,找到一个名为 `.gitignore` 的文件,然后在文本编辑器中将其打开。你可以在 `.gitignore` 中输入文件扩展名或文件名(每行一个),任何与你列出的文件匹配的文件都会被忽略(如文件名所示)。 @@ -186,13 +185,13 @@ $RECYCLE.BIN/ *.cbz ``` -你知道最经常遇到哪些文件类型,因此请集中精力处理最有可能潜入你的 SparkleShare 目录的文件。如果您想稍微矫枉过正一些,可以在 Notabug.org 以及整个网上找到 `.gitignore` 文件的好集合。 +你知道最经常遇到哪些文件类型,因此请集中精力处理最有可能潜入你的 SparkleShare 目录的文件。如果你想稍微矫枉过正一些,可以在 Notabug.org 以及整个网上找到 `.gitignore` 文件的好集合。 -通过将这些条目保存在 `.gitignore` 文件中,你可以将不需要发送到 Git 主机的大文件放在 SparkleShare 目录中,SparkleShare 将完全忽略它们。当然,这意味着您需要确保它们可以备份或通过其他方式分发给你的 SparkleShare 合作者。 +通过将这些条目保存在 `.gitignore` 文件中,你可以将不需要发送到 Git 主机的大文件放在 SparkleShare 目录中,SparkleShare 将完全忽略它们。当然,这意味着你需要确保它们可以备份或通过其他方式分发给你的 SparkleShare 协作者。 ### 自动化 -[自动化][20] 是我们与计算机达成的默契之一:计算机执行重复的、无聊的工作,而我们人类要么不擅长做这些,要么不擅长记忆这些。SparkleShare 是一种很好的、简单的自动执行例行数据分发的方法。无论如何,这并不适合每个 Git 存储库。它没有用于高级 Git 功能的接口,它没有暂停按钮或手动管理的操作。没关系,因为它的范围是有意限制的。SparkleShare 可以完成 SparkleShare 计划要做的事情,它做得很好,而且它是你无需关心的一个 Git 存储库。 +[自动化][20] 是我们与计算机达成的默契之一:计算机执行重复的、无聊的工作,而我们人类要么不擅长做这些,要么不擅长记忆这些。SparkleShare 是一种很好的、简单的自动执行例行数据分发的方法。但不管怎么说,这并不适合每个 Git 存储库。它没有用于高级 Git 功能的接口,它没有暂停按钮或手动管理的操作。没关系,因为它的使用范围是有意限制的。SparkleShare 可以完成它计划要做的事情,它做得很好,而且它是你无需关心的一个 Git 存储库。 如果你想使用这种稳定的、看不见的自动化,请尝试一下 SparkleShare。 @@ -203,7 +202,7 @@ via: https://opensource.com/article/19/4/file-sharing-git 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0eb14f0a7e4df77df754a01b62fa34094fe0d546 Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Fri, 10 Jan 2020 14:35:51 +0800 Subject: [PATCH 302/430] Update 20200102 Put some loot in your Python platformer game.md --- .../20200102 Put some loot in your Python platformer game.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200102 Put some loot in your Python platformer game.md b/sources/tech/20200102 Put some loot in your Python platformer game.md index 678fb69516..296739c2b9 100644 --- a/sources/tech/20200102 Put some loot in your Python platformer game.md +++ b/sources/tech/20200102 Put some loot in your Python platformer game.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (heguangzhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -514,7 +514,7 @@ via: https://opensource.com/article/20/1/loot-python-platformer-game 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[heguangzhi](https://github.com/heguangzhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9ab354cdb30e23b5a7644e4ddd88ca6f9698716d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 10 Jan 2020 16:16:37 +0800 Subject: [PATCH 303/430] Translating --- sources/tech/20200103 Add scorekeeping to your Python game.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200103 Add scorekeeping to your Python game.md b/sources/tech/20200103 Add scorekeeping to your Python game.md index d2055cc067..0bcfe955c7 100644 --- a/sources/tech/20200103 Add scorekeeping to your Python game.md +++ b/sources/tech/20200103 Add scorekeeping to your Python game.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 740bbe6981c5350dc71e39edf31ea16d005417f5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Jan 2020 22:00:54 +0800 Subject: [PATCH 304/430] PRF @robsean --- ...n Source Disk Partitioning Tool GParted.md | 66 ++++++++++--------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/translated/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md b/translated/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md index 6fa07d80a3..6721773f69 100644 --- a/translated/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md +++ b/translated/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md @@ -1,94 +1,96 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (App Highlight: Open Source Disk Partitioning Tool GParted) [#]: via: (https://itsfoss.com/gparted/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -应用程序推荐:开源磁盘分区工具 GParted +应用推荐:开源磁盘分区工具 GParted ====== -_**摘要:GParted 是一个非常流行的自由的可用于 Linux 发行版的分区编辑器。在这里,我们简单地看看它提供了什么。**_ +![](https://img.linux.net.cn/data/attachment/album/202001/10/220015lp58jjjt22xfppjj.jpg) -### GParted:一个基于自由和开放源码的图形化分区管理器 +> GParted 是一个可用于 Linux 发行版的非常受欢迎且免费的分区编辑器。在这里,我们简要地介绍一下它提供的功能。 + +### GParted:一个自由开源的图形化分区管理器 ![][1] -GParted 无疑是[在 Linux 下的最好的分区管理器][2]之一。用户界面非常简单,可用完成任务。 +GParted 无疑是 [Linux 下的最好的分区管理器][2]之一。用户界面非常简单而可以完成任务。 -在一些情况下,你最终也需要使用 [GParted][3] 来修复或格式化你的 USB 驱动器。我有一个[我不能在 Ubuntu 中格式化的 USB 磁盘][4],使用该“磁盘”应用程序 – 这里是 GParted 用来救援的地方。 +在某些情况下,你最终还是会使用 [GParted][3] 来修复或格式化你的 USB 驱动器。我有一个[在 Ubuntu 中使用“磁盘”应用程序不能格式化的 USB 磁盘][4],而这是 GParted 用来救援的地方。 -所以,它是非常有用的工具,有很多好的特色。让我为你们推荐一下。 +所以,它是一个非常有用的工具,有很多出色的功能。让我为你们重点介绍一下。 -警告! +> 警告! +> +> 进行磁盘分区是一件危险的工作。除非绝对必要,否则不要做。否则,你可能最终擦除了整个磁盘。 -玩弄磁盘分区是一件危险的工作。除非绝对必要,否则不要做。否则,你可能最终会擦除整个磁盘。 +### GParted 的功能 -### GParted 的特色 - -你可以使用 GParted 做很多事,排列一下简单地格式化任务到重要的分区任务。我将使用一些屏幕截图推荐关键特色,以帮助你在安装它前了解更多信息。 +从简单地格式化任务到重要的分区任务,你可以使用 GParted 做很多事。我将使用一些屏幕截图突出关键功能,以帮助你在安装它前进一步了解它。 #### 创建分区表 -你可以为你的新的磁盘创建一个新的分区表,或者擦除你现存的磁盘内容来修改分区表。 +你可以为新磁盘创建一个新的分区表,也可以擦除你现存的磁盘内容来修改分区表。 ![][5] -你将能够选择 msdos ,gpt ,atari ,以及更多类型的分区表。 +你能够选择 msdos、gpt、atari,以及更多类型的分区表。 -#### 创建,移动,标记,删除和修改分区表 +#### 创建、移动、标记、删除和修改分区表 -你可以使用 GParted 中一系列可用的选项来简单地创建,标记,删除或修改分区表。 +你可以使用 GParted 中一系列选项来轻松地创建、标记、删除或修改分区表。 ![][6] -当然,你将不得不小心你想做什么。 +当然,你必须要谨慎你要做的事情。 -好的一些东西是,GParted 确保你不能直接应用任何更改 – 在你点击应用更改之前,它将排队你选择的操作/任务,并询问另外一处最后的确认。 +好的是,GParted 可以确保你不能直接应用任何更改 —— 在你点击应用更改之前,它将排队你选择的操作/任务,并在你执行前最后再要求确认一次。 -在顶部的对号标记符号 ✓ 允许你来确认更改,只有你更改时开始生效。 +顶部的对号标记符号 `✓` 可以让你确认更改,然后你的更改才会生效。 -这样有另一个你可用的分区选项的屏幕截图: +这是分区可用选项的另一个屏幕截图: ![][7] #### 尝试数据救援 -除了编辑分区,你也可以尝试使用“**尝试数据救援**”特色以[在Linux 中恢复你丢失的数据][8],像下面的屏幕截图所示。 +除了编辑分区以外,你也可以试着使用“尝试数据救援”功能以[在 Linux 中恢复丢失的数据][8],如下面的屏幕截图所示。 ![][9] -值得注意的是,默认情况下你没有安装这个功能 – 你仅能看到可见的选项。所以,对于数据恢复特色作业来说,你必需使用下面的命令来单独地安装 gpart (在基于 Ubuntu/Debian 的发行版上): +值得注意的是,默认情况下你没有安装此功能 —— 你只是能看到这个选项。因此,要使这个数据恢复功能可以正常工作,你必须使用下面的命令来单独地安装 gpart (在基于 Ubuntu/Debian 的发行版上): ``` sudo apt install gpart ``` -除了所有关键的特色外,它支持大量的存储设备和文件系统。在它们的官方网站上,你可以从[特色列表][10]中学到很多。 +除了所有这些关键功能以外,它支持各种存储设备和文件系统。你可以从其官方网站的[功能列表][10]中了解到更多信息。 ### 在 Ubuntu 和其它 Linux 发行版上安装 GParted -你可能已经预先安装 GParted 。所以,务必核实一下。如果你没有安装它,你可以前往进入软件中心安装它。 +你可能已经预安装了 GParted 。所以,务必核实一下。如果你尚未安装它,则可以进入软件中心安装它。 -以备你想使用终端,简单地键入下面的命令: +如果你想使用终端,简单地键入下面的命令: ``` sudo apt install gparted ``` -像我如上所述,如果你想要数据恢复选项,除了 gparted 软件包外,你应该安装 gpart 软件包。 +如上所述,如果你想要使用数据恢复选项,除了安装 gparted 软件包外,还应该安装 gpart 软件包。 -如果你正在使用一些其它 Linux 发行版,你可以在各自的软件管理器中找到它,或者简单地查看[官方下载操作指南][11]。 +如果你使用的是其它 Linux 发行版,你可以在各自的软件管理器中找到它,或者直接查看[官方下载操作说明][11]。 -[下载 GParted][11] +- [下载 GParted][11] -**总结** +### 总结 -当涉及处理磁盘管理和分区时,GParted 是一个非常有用和重要的工具。但是,因为显而易见的原因,当你使用它时,你将不得不小心。 +当涉及处理磁盘管理和分区时,GParted 是一个非常有用且重要的工具。但是,因为显而易见的原因,当你使用它时,你必须要小心。 -你尝试过 GParted 吗?你在 Linux 上使用的其它分区工具是什么?请在下面的评论中分享你的体验。 +你尝试过 GParted 吗?你在 Linux 上使用的其它哪个分区工具?请在下面的评论中分享你的经验。 -------------------------------------------------------------------------------- @@ -97,7 +99,7 @@ via: https://itsfoss.com/gparted/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cf4ee95d88ad27ac988e9e34a9ff078fb2c4ac1b Mon Sep 17 00:00:00 2001 From: chen ni Date: Fri, 10 Jan 2020 23:05:58 +0800 Subject: [PATCH 305/430] =?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 --- ... Still Using an ‘Outdated- Linux Kernel.md | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md b/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md index 6152697eb3..3b2ef30859 100644 --- a/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md +++ b/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md @@ -7,93 +7,93 @@ [#]: via: (https://itsfoss.com/why-distros-use-old-kernel/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -Explained! Why Your Distribution Still Using an ‘Outdated’ Linux Kernel? +为什么你的发行版仍然在使用“过时的”Linux 内核? ====== -[Check your Linux kernel version][1]. Chances are that you’ll find that the kernel version your system is using has already reached end of life (EOL) as listed on Linux Kernel website. +[检查一下你的系统所使用的 Linux 内核版本][1],你十有八九会发现,按照 Linux 内核官网提供的信息,该内核版本已经达到使用寿命终期了。 -End of life means a software won’t get bug fixes and support anymore. +如果一个软件达到了使用寿命终期,这就意味着它再也不会得到 bug 修复和维护了。 -That poses some valid questions. Why is my Linux distribution using a kernel that has reached end of life? Is this not a security risk? Is my system safe? +这自然会引发一连串问题:为什么我的 Linux 发行版会使用一个已经达到使用寿命终期的内核呢?这样做有没有安全风险?我的系统还安全吗? -Let me explain all these questions in this article. +下面将逐一解答这些问题。 -Summary +总结 -The upstream kernel support and the your distribution’s kernel support are two different things. +上游内核维护与你的发行版的内核维护是两个不同的概念。 -For example, Linux kernel 4.15 might have reached end of life (as per the official Linux kernel website) but Ubuntu 18.04 LTS release will use it and maintain it till April 2023 by backporting security patches and bug fixes. +例如,根据 Linux 内核官网,Linux 内核 4.15 版本可能已经达到使用寿命终期了,但是在 2023 年 4 月之前,Ubuntu 18.04 长期维护版本将会继续使用这个版本,并通过向后移植安全补丁和修复 bug 来提供维护。 -### Checking Linux kernel version and finding its end of life status +### 检查 Linux 内核版本,以及是否达到使用寿命终期 -Let’s first check the Linux kernel version on your system: +首先,查看你的系统所使用的 Linux 内核版本: ``` uname -r ``` -I am using Ubuntu 18.04 here and it shows the Linux kernel version like this: +我使用的是 Ubuntu 18.04,输出的 Linux 内核版本如下: ``` [email protected]:~$ uname -r 5.0.0-37-generic ``` -Now, you may go to the official Linux kernel website and see what Linux kernels are still being supported. It’s displayed on the homepage itself. +接下来,可以到 Linux 内核官网上看看哪些 Linux 内核版本仍然在维护状态。在网站主页上就可以看到相关信息。 -[Linux Kernel Official Website][2] +[Linux 内核官网][2] -You should see a status like this: +你看到的内核版本状态应该类似于下图: -![Linux Kernel Status][3] +![Linux 内核状态][3] -If you don’t see a kernel version listed on the homepage of kernel website, it means that specific version has reached end of life. +如果你的内核版本没有列在内核官网主页上,那么就说明该版本已经达到了使用寿命终期。 -As you can see, kernel 5.0 is not listed here. It indicates that this kernel version is not being supported anymore. Actually, it [reached end of life in June 2019][4]. +可以看到,5.0 内核版本并不在列,这说明该内核版本已经不再得到维护。事实上,该版本在 [2019 年 6 月就已经达到使用寿命终期了][4]。 -The life cycle of a Linux kernel doesn’t follow a set pattern, unfortunately. It’s NOT like a regular kernel stable release will be supported for X months and a long term support(LTS) kernel will be supported for Y years. +不幸的是,Linux 内核的生命周期没有任何规律可循。不是说常规的内核稳定发布版可以得到 X 月的维护、长期维护版本(LTS)可以得到 Y 年的维护。没有这回事。 -Based on the demand and requirements, there could be several LTS kernel versions with different EOL. You can find them along with their projected EOL on [this page][5]. +根据实际需求,可能会存在内核的多个 LTS 版本,其使用寿命终期各不相同。在[这个页面][5]上可以查到这些 LTS 版本的相关信息,包括推定的使用寿命终期。 -Now comes the big question. Why is Ubuntu providing kernel 5.0 if the Linux kernel website shows that it has reached its end of life? +那么问题来了:既然 Linux 内核官网上明确表示 5.0 版本的内核已经达到了使用寿命终期,那 Ubuntu 为什么还在提供这个内核版本呢? -### Your distribution uses an EOL Linux kernel but that’s Okay! +### 你的发行版使用的 Linux 内核已经达到了使用寿命终期,但是没关系! ![][6] -Have you ever wondered why Ubuntu/Debian/Fedora etc are called Linux distributions? It’s because they ‘distribute’ the Linux kernel. +你是否想过,为什么 Ubuntu/Debian/Fedora 等发行版被称为 Linux “发行版”?这是因为,它们“发行” Linux 内核。 -They have their own modification of the Linux kernel, they add the GUI elements (desktop environment, display server etc) and software and they make it available to their users. +这些发行版会对 Linux 内核进行不同的修改,并添加各种 GUI 元素(包括桌面环境,显示服务器等)以及软件,然后再呈现给用户。 -In the typical workflow, a Linux distribution will choose a kernel to provide to its users. And then it will hold on to this kernel for months or years even after the kernel has reached end of life. +按照通常的工作流,Linux 发行版会选择一个内核,提供给其用户,然后在接下来的几个月、几年中,甚至是达到内核的使用寿命终期之后,仍然会继续使用该内核。 -How is it safe then? It’s because the _**distribution maintains the kernel by backporting all the important fixes to its kernel**_. +这样能够保障安全吗?其实是可以的,因为 _**发行版会通过向后移植全部的重要修补来维护内核**_。 -In other words, your Linux distribution makes sure that your Linux kernel is patched well and has all the bug fixes and important new features backported to it. There will be thousands of changes on top of the ‘old outdated Linux kernel’. +换句话说,你的 Linux 发行版会确保 Linux 内核没有漏洞和 bug,并且通过向后移植获得了重要的新特性。在“过时的旧版本 Linux 内核”上,其实有着数以千计的改动。 -When the Linux kernel website says that a certain kernel version has reached EOL, it means that the core Linux kernel maintainers are not going to update/patch that kernel version anymore. +如果 Linux 内核网站上说某个内核版本已经达到了使用寿命终期,那么就意味着 Linux 内核的核心维护团队不会再对该内核版本进行升级和打补丁了。 -But at the same time, the developers at Debian/Ubuntu or other distributions work to keep the same old version alive by bringing the relevant changes from the newer kernel versions (being maintained by the core kernel team) to your distribution’s old kernel. +但与此同时,Debian/Ubuntu 或者其他发行版的开发者们会继续工作,通过从(由内核核心团队维护的)更新的内核版本中迁移相关的修改,维持这个老版本的生命力。 -Bottom line is that even if it seems like your distribution is using an outdated Linux kernel, it is actually being well maintained and not really outdated. +重点在于,即使你的发行版看上去是在使用一个已经过时的 Linux 内核,其实该内核也得到了良好的维护,并非是真的过时了。 -### Should you use the latest stable kernel version? +### 是否应该使用最新的稳定内核版本? ![][7] -A new stable Linux kernel version is released every 2-3 months. And this makes many users wonder who they can get their hands on that new shiny thing. +新的 Linux 内核稳定版本每隔 2 到 3 个月发布一次,有不少用户跃跃欲试。 -To be frank, you should not do that unless you have a pretty good reason for it. Your distribution doesn’t provide it to you. You cannot just use ‘_sudo apt give-me-the-latest-stable-kernel_‘. +实话说,除非有十分充分的理由,否则不应该使用最新版本的稳定内核。你使用的发行版并不会提供这个选项,你也不可能指望在键盘上敲出“_sudo apt give-me-the-latest-stable-kernel_”就解决问题。 -Now, manually [installing the mainline Linux kernel version][8] could be a challenge in itself. Even if you manage to install it, it is now up to you to make sure that this kernel is updated every time there is a bug fix. And when this new kernel reaches end of life, it becomes your responsibility to upgrade to the newer kernel version. It won’t be handled with apt upgrade like regular [Ubuntu updates][9]. +此外,手动[安装主流 Linux 内核版本][8]本身就是一个挑战。即使安装成功,之后每次发布 bug 修复的时候,负责更新内核的就会使你了。此外,当新内核达到使用寿命终期之后,你就有责任将它升级到更新的内核版本了。和常规的[Ubuntu 更新][9]不同,内核升级无法通过 apt upgrade 完成。 -You should also keep in mind that your distribution also has drivers and patches which you may not be able to use if you switch to the mainline kernel. +同样需要记住的是,切换到主流内核之后,可能就无法使用你的发行版提供的一些驱动程序和补丁了。 -As [Greg Kroah-Hartman][10] puts it, “_**the best kernel you can use is one that someone else supports**_“. And who can be better at this job then your Linux distribution! +正如 [Greg Kroah-Hartman][10]所言,“_**你能使用的最好的内核,就是别人在维护的内核。**_”除了你的 Linux 发行版之外,又有谁更胜任这份工作呢。 -I hope you have a better understanding on this topic and you won’t panic the next time you find out that the kernel version your system is using has reached end of life. +希望你对这个主题已经有了更好的理解。下回发现你的系统正在使用的内核版本已经达到使用寿命终期的时候,希望你不会感到惊慌失措。 -I welcome your questions and suggestions. Please feel free to use the comment section. +欢迎在下面的评论区中留下你的疑问或建议。 -------------------------------------------------------------------------------- From e1fda19f43f01a46f1c01ce689884d9cb69dce2f Mon Sep 17 00:00:00 2001 From: chen ni Date: Fri, 10 Jan 2020 23:13:48 +0800 Subject: [PATCH 306/430] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E5=B9=B6=E7=A7=BB=E5=8A=A8=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ion Still Using an ‘Outdated- Linux Kernel.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename {sources => translated}/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md (88%) diff --git a/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md b/translated/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md similarity index 88% rename from sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md rename to translated/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md index 3b2ef30859..b8af543814 100644 --- a/sources/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md +++ b/translated/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md @@ -12,7 +12,7 @@ [检查一下你的系统所使用的 Linux 内核版本][1],你十有八九会发现,按照 Linux 内核官网提供的信息,该内核版本已经达到使用寿命终期了。 -如果一个软件达到了使用寿命终期,这就意味着它再也不会得到 bug 修复和维护了。 +一个软件一旦达到了使用寿命终期,那么就意味着它再也不会得到 bug 修复和维护了。 这自然会引发一连串问题:为什么我的 Linux 发行版会使用一个已经达到使用寿命终期的内核呢?这样做有没有安全风险?我的系统还安全吗? @@ -47,7 +47,7 @@ uname -r ![Linux 内核状态][3] -如果你的内核版本没有列在内核官网主页上,那么就说明该版本已经达到了使用寿命终期。 +如果你的内核版本没有列在内核官网主页上,就说明该版本已经达到了使用寿命终期。 可以看到,5.0 内核版本并不在列,这说明该内核版本已经不再得到维护。事实上,该版本在 [2019 年 6 月就已经达到使用寿命终期了][4]。 @@ -55,7 +55,7 @@ uname -r 根据实际需求,可能会存在内核的多个 LTS 版本,其使用寿命终期各不相同。在[这个页面][5]上可以查到这些 LTS 版本的相关信息,包括推定的使用寿命终期。 -那么问题来了:既然 Linux 内核官网上明确表示 5.0 版本的内核已经达到了使用寿命终期,那 Ubuntu 为什么还在提供这个内核版本呢? +那么问题来了:既然 Linux 内核官网上明确表示 5.0 版本的内核已经达到了使用寿命终期,Ubuntu 为什么还在提供这个内核版本呢? ### 你的发行版使用的 Linux 内核已经达到了使用寿命终期,但是没关系! @@ -69,7 +69,7 @@ uname -r 这样能够保障安全吗?其实是可以的,因为 _**发行版会通过向后移植全部的重要修补来维护内核**_。 -换句话说,你的 Linux 发行版会确保 Linux 内核没有漏洞和 bug,并且通过向后移植获得了重要的新特性。在“过时的旧版本 Linux 内核”上,其实有着数以千计的改动。 +换句话说,你的 Linux 发行版会确保 Linux 内核没有漏洞和 bug,并且已经通过向后移植获得了重要的新特性。在“过时的旧版本 Linux 内核”上,其实有着数以千计的改动。 如果 Linux 内核网站上说某个内核版本已经达到了使用寿命终期,那么就意味着 Linux 内核的核心维护团队不会再对该内核版本进行升级和打补丁了。 @@ -77,19 +77,19 @@ uname -r 重点在于,即使你的发行版看上去是在使用一个已经过时的 Linux 内核,其实该内核也得到了良好的维护,并非是真的过时了。 -### 是否应该使用最新的稳定内核版本? +### 你是否应该使用最新的稳定内核版本? ![][7] 新的 Linux 内核稳定版本每隔 2 到 3 个月发布一次,有不少用户跃跃欲试。 -实话说,除非有十分充分的理由,否则不应该使用最新版本的稳定内核。你使用的发行版并不会提供这个选项,你也不可能指望在键盘上敲出“_sudo apt give-me-the-latest-stable-kernel_”就解决问题。 +实话说,除非有十分充分的理由,否则不应该使用最新版本的稳定内核。你使用的发行版并不会提供这个选项,你也不能指望通过在键盘上敲出“_sudo apt give-me-the-latest-stable-kernel_”解决问题。 -此外,手动[安装主流 Linux 内核版本][8]本身就是一个挑战。即使安装成功,之后每次发布 bug 修复的时候,负责更新内核的就会使你了。此外,当新内核达到使用寿命终期之后,你就有责任将它升级到更新的内核版本了。和常规的[Ubuntu 更新][9]不同,内核升级无法通过 apt upgrade 完成。 +此外,手动[安装主流 Linux 内核版本][8]本身就是一个挑战。即使安装成功,之后每次发布 bug 修复的时候,负责更新内核的就会是你了。此外,当新内核达到使用寿命终期之后,你就有责任将它升级到更新的内核版本了。和常规的[Ubuntu 更新][9]不同,内核升级无法通过 apt upgrade 完成。 同样需要记住的是,切换到主流内核之后,可能就无法使用你的发行版提供的一些驱动程序和补丁了。 -正如 [Greg Kroah-Hartman][10]所言,“_**你能使用的最好的内核,就是别人在维护的内核。**_”除了你的 Linux 发行版之外,又有谁更胜任这份工作呢。 +正如 [Greg Kroah-Hartman][10]所言,“_**你能使用的最好的内核,就是别人在维护的内核。**_”除了你的 Linux 发行版之外,又有谁更胜任这份工作呢! 希望你对这个主题已经有了更好的理解。下回发现你的系统正在使用的内核版本已经达到使用寿命终期的时候,希望你不会感到惊慌失措。 From a39d5cbd63dcb84d3ebfd6452319226c0e727a49 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 11 Jan 2020 00:57:45 +0800 Subject: [PATCH 307/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200111=20Don?= =?UTF-8?q?=E2=80=99t=20Use=20ZFS=20on=20Linux:=20Linus=20Torvalds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md --- ... Don-t Use ZFS on Linux- Linus Torvalds.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/tech/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md diff --git a/sources/tech/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md b/sources/tech/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md new file mode 100644 index 0000000000..7323b77a8e --- /dev/null +++ b/sources/tech/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Don’t Use ZFS on Linux: Linus Torvalds) +[#]: via: (https://itsfoss.com/linus-torvalds-zfs/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Don’t Use ZFS on Linux: Linus Torvalds +====== + +_“Don’t use ZFS. It’s that simple. It was always more of a buzzword than anything else, I feel, and the licensing issues just make it a non-starter for me.”_ + +This is what Linus Torvalds [said in a mailing list][1] to once again express his disliking for [ZFS filesystem][2] specially over its licensing. + +To avoid unnecessary confusion, this is more intended for Linux distributions, kernel developers and maintainers rather than individual Linux users. + +### What’s the licensing issue with ZFS and Linux kernel? + +![][3] + +ZFS was open sourced around 2003. This would have meant that Linux distributions start supporting ZFS. But that didn’t really happen because of the complexity of [open source licenses][4]. + +ZFS is open source under [Common Development and Distribution License][5] (CDDL) 1.0 whereas Linux kernel is licensed under the GNU General Public License (GPL) 2.0. + +These two open source licenses are not fully compatible with each other. As noted by [PCWorld][6], if ZFS with this license is included in the Linux kernel, this would mean that kernel+ZFS is a derivative work of the (original ZFS-less) Linux kernel. + +### Torvalds doesn’t trust Oracle + +![][7] + +While the whole derivative thing is a matter of debate for legal and licensing experts, Torvalds is skeptical of Oracle. Oracle has a history of suing enterprises for using its code. Remember [Oracle vs Android lawsuit over the use of Java][8]? + +> Other people think it can be ok to merge ZFS code into the kernel and that the module interface makes it ok, and that’s their decision. But considering Oracle’s litigious nature, and the questions over licensing, there’s no way I can feel safe in ever doing so. +> +> And I’m not at all interested in some “ZFS shim layer” thing either that some people seem to think would isolate the two projects. That adds no value to our side, and given Oracle’s interface copyright suits (see Java), I don’t think it’s any real licensing win either. + +Torvalds doesn’t want Linux kernel to get into legal troubles with Oracle in future and hence he refuses to include ZFS in mainline kernel until Orcale provides a signed letter that a kernel with ZFS will be under GPL license. + +> And honestly, there is no way I can merge any of the ZFS efforts until I get an official letter from Oracle that is signed by their main legal counsel or preferably by Larry Ellison himself that says that yes, it’s ok to do so and treat the end result as GPL’d. + +He is not stopping other (distributions) from using ZFS. But they are on their own. + +> If somebody adds a kernel module like ZFS, they are on their own. I can’t maintain it, and I can not be bound by other peoples kernel changes. + +Canonical, Ubuntu’s parent company, has been too keen on ZFS. Their [legal department thinks that including ZFS in kernel doesn’t make it a derivative work][9]. So they took their chances and now they provide an option to [use ZFS on root from Ubuntu 19.10][10]. + +### Torvalds is also not impressed with ZFS in general + +![][11] + +While some people drool over ZFS, Linus Torvalds is not that impressed with ZFS. He doesn’t think it’s using ZFS is a good idea specially when it is not actively maintained by Oracle (after they open sourced it) + +> The benchmarks I’ve seen do not make ZFS look all that great. And as far as I can tell, it has no real maintenance behind it either any more, so from a long-term stability standpoint, why would you ever want to use it in the first place? + +I am no legal expert but if there is even a slightest doubt, I would prefer staying away from ZFS. What do you think of the whole ZFS debate? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linus-torvalds-zfs/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.realworldtech.com/forum/?threadid=189711&curpostid=189841 +[2]: https://itsfoss.com/what-is-zfs/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/dont_use_zfs_torvalds.jpg?ssl=1 +[4]: https://itsfoss.com/open-source-licenses-explained/ +[5]: https://opensource.org/licenses/CDDL-1.0 +[6]: https://www.pcworld.com/article/3061924/ubuntu-1604s-support-for-the-zfs-file-system-may-violate-the-general-public-license.html +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/linus-torvalds-zfs-quotes-1.jpg?ssl=1 +[8]: https://itsfoss.com/oracle-google-dispute/ +[9]: https://ubuntu.com/blog/zfs-licensing-and-linux +[10]: https://itsfoss.com/zfs-ubuntu/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/linus-torvalds-zfs-quotes-2.jpg?ssl=1 From ec111ac4a5dd9faeece3a98ec010a2aac5bde9f7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 11 Jan 2020 00:58:26 +0800 Subject: [PATCH 308/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200110=205=20op?= =?UTF-8?q?s=20hacks=20for=20sysadmins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200110 5 ops hacks for sysadmins.md --- .../20200110 5 ops hacks for sysadmins.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20200110 5 ops hacks for sysadmins.md diff --git a/sources/tech/20200110 5 ops hacks for sysadmins.md b/sources/tech/20200110 5 ops hacks for sysadmins.md new file mode 100644 index 0000000000..409d5a0716 --- /dev/null +++ b/sources/tech/20200110 5 ops hacks for sysadmins.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 ops hacks for sysadmins) +[#]: via: (https://opensource.com/article/20/1/ops-hacks-sysadmins) +[#]: author: (Stephen Bancroft https://opensource.com/users/stevereaver) + +5 ops hacks for sysadmins +====== +Five tools to help you find the source of your users' IT problems when +you don't know where to start. +![Wratchet set tools][1] + +As a sysadmin, every day I am faced with problems I need to solve quickly because there are users and managers who expect things to run smoothly. In a large environment like the one I manage, it's nearly impossible to know all of the systems and products from end to end, so I have to use creative techniques to find the source of the problems and (hopefully) come up with solutions. + +This has been my daily experience for well over 20 years, and I love it! Coming to work each day, I never quite know what will happen. So, I have a few quick and dirty tricks that I default to when a problem lands on my lap, but I don't know where to start. + +_BUT WAIT!_ Before you jump straight onto the command line, spend some time talking to your users. Yes, it can be tedious, but they will have some good information for you. Keep in mind that users probably don't have as much experience as you have, and you will need to do some interpreting of whatever they say. Try to get a clear picture of what _is_ happening and what _should be_ happening, then describe the fault to yourself in technical language. Be aware that most users don't read what is on the screen in front of them; it's sad but true. Make sure you and the user are reading all of the text to gather as much information as possible. Once you have that together, jump onto the command line with these five tools. + +### Telnet + +I am starting with a classic. [Telnet][2] was the predecessor to SSH, and, in the olden days, it was used on Unix systems to connect to a remote terminal just like SSH does, but it was not encrypted. Telnet has a very neat and invaluable trick for diagnosing network connectivity issues: you can Telnet into TCP ports that are not reserved for it. To do so, use Telnet like you normally would, but add the TCP port onto the end (**telnet localhost 80,** for instance) to connect to a web server. This enables you to check a server to see if a service is running or if a firewall is blocking it. So, without having the application client or even a login for the application, you can check if the TCP port is responding. If you know how, sometimes you can elicit a response from the server by manually typing into the Telnet prompt and checking the response. Web servers and mail servers are two examples where you can do this. + +![Getting a response from a webserver with Telnet][3] + +### Tcpdump + +The [tcpdump][4] tool lets you inspect what data is being transmitted on the network. Most network protocols are fairly simple and, if you combine tcpdump with a tool like [Wireshark][5], you will have a nice, easy way to browse the traffic that you have captured. In the example below, I am inspecting packets in the bottom window and connecting to TCP port 3260 in the top. + +![Inspecting packets in real time with tcpdump][6] + +This screenshot shows a real-world use of Wireshark to look at the iSCSI protocol; in this case, I was able to identify that there was a problem with the way our QNAP network-attached storage was configured. + +![Using Wireshark to inspect a TCP session][7] + +### find + +The [find][8] command is simply the best tool if you don't know where to start. In its most simple form, you can use it to "find" files. For example, if I wanted to do a recursive search through all directories and get a list of the conf files, I could enter: + + +``` +`find . -name '*.conf'.` +``` + +![find command output][9] + +But one of find's hidden gems is that you can use it to execute a command against each item it finds. For example, if I wanted to get a long list of each file, I could enter: + + +``` +`find . -name '*.conf' -exec ls -las {} \;` +``` + +![find command output][10] + +Once you know this technique, you can use it in all sorts of creative ways to find, search, and execute programs in specific ways. + +### strace + +I was introduced to the concept of [strace][11] on Solaris, where it is called truss. It is still as useful today as it was all those years ago. strace allows you to inspect what a process is doing as it runs in real time. Using it is simple; just use the command **ps -ef** and find the process ID that you are interested in. Start strace with **strace -p <pid>**; this will start printing out a whole lot of stuff, which at first looks like junk. But if you look closer, you will see text that you recognize, such as words like **OPEN** and **CLOSE** and filenames. This can lead you in the right direction if you are trying to figure out why a program is not working. + +### grep + +Leaving the best for last: [grep][12]. This tool is so useful and powerful that I have trouble coming up with a succinct way to describe it. Put simply, it's a search tool, but the way it searches is what makes it so powerful. In problem analysis, I typically grep over a bunch of logs to search for something. A companion command called zgrep does the same thing with zipped files. In the following example, I used **zgrep /var/log/* bancroft** to grep across all the log files to see what I have been up to on the system. I used zgrep because there are zipped files in the directory. + +![grep command output][13] + +Another great way to use grep is for piping the output of other tools into it; this way, it can be used as a filter of sorts. In the following example, I listed the auth file and grepped for my login to see what I have been doing by using **cat auth.log |grep bancroft**. This can also be written as **grep bancroft auth.log**, but I used the pipe (**|**) to demonstrate the point. + +![grep command output][14] + +### Other tools to consider + +You can do a lot more with these tools, but I hope this brief introduction gives you a window into how to use them to solve the nasty problems that come your way. Another tool worth your attention is [Nmap][15], which I did not include because it is so comprehensive that it needs an entire article (or more) to explain it. Finally, I recommend learning some white hat and hacking techniques; they can be very beneficial when trying to get to the bottom of a problem because they can help you collect information that can be crucial in decision making. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/ops-hacks-sysadmins + +作者:[Stephen Bancroft][a] +选题:[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/stevereaver +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_osyearbook2016_sysadmin_cc.png?itok=Y1AHCKI4 (Wratchet set tools) +[2]: https://en.wikipedia.org/wiki/Telnet +[3]: https://opensource.com/sites/default/files/uploads/telnet_1.png (Getting a response from a webserver with Telnet) +[4]: https://www.tcpdump.org/ +[5]: https://www.wireshark.org/ +[6]: https://opensource.com/sites/default/files/uploads/tcpdump_1.png (Inspecting packets in real time with tcpdump) +[7]: https://opensource.com/sites/default/files/uploads/tcpdump_2.png (Using Wireshark to inspect a TCP session) +[8]: https://en.wikipedia.org/wiki/Find_%28Unix%29 +[9]: https://opensource.com/sites/default/files/uploads/find_1_0.png (find command output) +[10]: https://opensource.com/sites/default/files/uploads/find_2.png (find command output) +[11]: https://strace.io/ +[12]: https://en.wikipedia.org/wiki/Grep +[13]: https://opensource.com/sites/default/files/uploads/grep_1.png (grep command output) +[14]: https://opensource.com/sites/default/files/uploads/grep_2.png (grep command output) +[15]: https://nmap.org/ From f56bef9e248961cdb05a8f0631cac035fe6a78bf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 11 Jan 2020 00:59:27 +0800 Subject: [PATCH 309/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200110=20How=20?= =?UTF-8?q?I=20upgraded=20my=20CuBox=20open=20source=20music=20server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200110 How I upgraded my CuBox open source music server.md --- ...raded my CuBox open source music server.md | 237 ++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 sources/tech/20200110 How I upgraded my CuBox open source music server.md diff --git a/sources/tech/20200110 How I upgraded my CuBox open source music server.md b/sources/tech/20200110 How I upgraded my CuBox open source music server.md new file mode 100644 index 0000000000..b4651d48c4 --- /dev/null +++ b/sources/tech/20200110 How I upgraded my CuBox open source music server.md @@ -0,0 +1,237 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I upgraded my CuBox open source music server) +[#]: via: (https://opensource.com/article/20/1/upgrade-cubox-open-source-music-server) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) + +How I upgraded my CuBox open source music server +====== +Our resident audiophile explains how he updated his CuBox music server +after more than five years of excellent use. +![open source music with piano keys background][1] + +Back in early 2014, I purchased my first [ARM-based computer][2], a [SolidRun CuBox-i4][3]. My goal for the CuBox was to have a headless device (e.g., no display) that takes up minimal space in the audio equipment shelf, makes minimal noise, and serves music files to my digital-to-analog converter (DAC) and thus to the rest of the stereo. On paper, the CuBox was a perfect fit. It is fanless, works with various Linux distros, provides a separate [eSATA interface][4] for a locally mounted hard drive and therefore leaves the USB ports free for other stuff, provides a [TOSLINK port][5] for digital audio, uses a [MicroSD card][6] (by default, anyway) for the system installation and boot drive, and comes with 2GB of RAM and a reasonably fast [i.MX6q quad-core processor][7], all in an unobtrusive 5x5x5cm black plastic box. + +And as luck would (sometimes) have it, those promises have mostly been kept. The box still runs and provides my family with a great deal of musical enjoyment. The attached hard drive contains about 275GB of music files—a bit over 7,500 FLAC files with some 300 or so MP3 files thrown in. + +As our home music server, the CuBox runs a barebones Linux server distro with Music Player Daemon ([MPD][8]) as the music-serving software, sending digital data to the DAC via the [ALSA][9] with no software mixing, up- or down-sampling, or volume control on the server. Lately, I've found it convenient to run [lighttpd][10], a lightweight, simple-to-configure HTTP server, to provide cover images to the various MPD clients that we run in the house. (But now MPD provides that capability, so that convenience may soon go away.) For the user interfaces to play music, we use [Cantata][11] on the desktop and [MPD Remote][12] (caution: it may not be open source) on our Android phones to browse, select, and play music. + +In 2017, I wrote about [my experiences using the CuBox][13]. I had tried [Voyage Linux][14], [Volumio][15], and [Archphile Linux][16], and had just moved to [Armbian][17], which at that time was based on Ubuntu 16.04 LTS (long term support). This fall, I decided it was time to upgrade the server, get the latest version of MPD, and deal with a few other bothersome details along the way. + +### The upgrade + +Given my generally great experience with Armbian, I decided to go there again for upgrade materials. There are two supported options: a Debian Buster-based server configuration and an Ubuntu 18.04 desktop configuration. Bearing in mind my desire to keep the system display-free and minimalist, I selected the Debian version. + +![Armbian versions][18] + +The download was trouble-free, and I soon had an install image in my Downloads folder. As before, I was impressed with the quality and "to the point" nature of the [Armbian documentation][19], which notes: + +> Images shall only be written with Etcher on all platforms since, unlike other tools, Etcher validates burning results **saving you from corrupted SD card contents**. + +This was my first experience using [Etcher][20], and I was duly impressed with its usability (yet another wonderful reason to use open source software). I inserted the resulting MicroSD card into the CuBox, connected the Ethernet cable, DAC, and eSATA drive, and powered it on. Soon, I could SSH into the CuBox to configure it. Talk about a painless experience! Here's what I see when I log into that machine using SSH: + +![CuBox login][21] + +In terms of configuration, I had the following objectives: + + * Finish the initial configuration + * Configure static IP addressing for the wired networking connection + * Get the installed system up to date + * Disable the wireless + * Install and configure MPD + * Install and configure lighttpd + * Listen to some music! + + + +I used the excellent [Armbian Config program][22] to carry out a bunch of these initial configuration tasks. + +![Armbian-Config screen][23] + +Choosing System presents this menu: + +![Armbian-Config settings][24] + +I used this to disable root login over SSH and enable password and public key authentication. + +In the Network subsystem, I set static IP addressing (to conform to my home router settings), and in the Personal subsystem, I changed the time zone and hostname. I probably could have used the Software subsystem to run the initial update, but I chose to exit to the shell and use apt to finish up this initial configuration with: + + +``` +sudo apt update +sudo apt upgrade +``` + +I also used apt to install MPD and lighttpd with: + + +``` +`sudo apt install mpd lighttpd` +``` + +I had my previous MPD configuration file (**/etc/mpd.conf**); generally, I prefer to use these types of older files as guides to configure a new one, rather than just plunking the old one on top of the new. In the end, there weren't many changes to make; here are the differences between the old and new files: + + +``` +clh@stereo:/etc$ diff mpd.conf.orig mpd.conf +85c85,86 +< bind_to_address               "localhost" +\--- +> #bind_to_address              "localhost" +> bind_to_address               "192.168.1.21" +241c242,249 +<       name            "My ALSA Device" +\--- +>       name            "Drop Airist R2R" +>       device          "hw:CARD=U20,DEV=0" +>       mixer_type      "none" +>       replay_gain_handler      "none" +> #     name            "Schit Bifrost 4490" +> #     device          "hw:CARD=S2,DEV=0" +> #     mixer_type      "none" +> #     replay_gain_handler      "none" +clh@stereo:/etc$ +``` + +You can see that I have two DACs (just because), and the second is commented out (and not connected). Also, I had to change **bind_to_address** so that MPD will listen over the local area network. + +As for lighttpd, I only had to change the **document-root**: + + +``` +clh@stereo:/etc/lighttpd$ diff lighttpd.conf.orig lighttpd.conf +8c8,13 +< server.document-root        = "/var/www/html" +\--- +> # Used this config documentation +> # +> # which wasn't good - wrong user name, didn't need to add +> # the mime config +> # in the end just changed the document root. +> +> server.document-root        = "/var/lib/mpd/music/" +clh@stereo:/etc/lighttpd$ +``` + +To get to the music files, I added the following line to **/etc/fstab**: + + +``` +`/dev/sda1 /mnt/eSATA ext4 rw 0 0` +``` + +and created the mount point with: + + +``` +`sudo mkdir /mnt/eSATA` +``` + +At this point, I mounted the external hard drive with: + + +``` +`sudo mount /dev/sda1` +``` + +Finally, I linked MPD's configuration directory to the music with: + + +``` +sudo rmdir /var/lib/mpd/music +sudo ln -s /mnt/eSATA/Music /var/lib/mpd/music +``` + +I used this approach because I'd rather not futz around with MPD's configuration more than I have to. + +It's a good idea to check that the music files are owned by the correct MPD user ID. Do this with: + + +``` +clh@stereo:~$ ls -ld /var/lib/mpd/music/* | head +drwxrwxrwx   5 mpd audio  4096 Jan 22  2017 /var/lib/mpd/music/Academy of St. Martin-in-the-Fields +drwxrwxrwx   3 mpd audio  4096 Jan 22  2017 /var/lib/mpd/music/Acantus +drwxrwxrwx   3 mpd audio  4096 Dec 13  2014 /var/lib/mpd/music/Afrikan_Sciences +drwxrwxrwx   5 mpd audio  4096 Sep 25  2016 /var/lib/mpd/music/Afro Celt Sound System +drwxrwxrwx   3 mpd audio  4096 Mar 11  2014 /var/lib/mpd/music/Agnes Obel +drwxrwxrwx   3 mpd audio  4096 Oct  9  2013 /var/lib/mpd/music/Alexander Malter, Dietmar Schwalke, Vladimir Spiakov, Sergej Bezrodny +drwxrwxrwx   3 mpd audio  4096 Oct  8  2013 /var/lib/mpd/music/Ali Farka Toure & Toumani Diabate +drwxrwxrwx   3 mpd audio  4096 Oct  8  2013 /var/lib/mpd/music/Ali Farka Touré with Ry Cooder +drwxrwxrwx   5 mpd audio  4096 Jan  1  2018 /var/lib/mpd/music/Amadou et Mariam +drwxrwxrwx   3 mpd audio  4096 Jul 11  2017 /var/lib/mpd/music/American Authors +clh@stereo:~$ +``` + +This looks fine (user ID **mpd**, group ID **audio**). + +Finally, to disable the wireless, I entered: + + +``` +`sudo nmcli radio wifi off` +``` + +And I'm done! Time for a reboot: + + +``` +`sudo systemctl reboot` +``` + +Once it rebooted, I used Cantata to force MPD to refresh its database. Here's what it looks like when that's done, and I'm listening to [Frameworks' latest album, _Imagine Gold_][25]: + +![Frameworks "Imagine Gold" in Cantata][26] + +Just to the left of the track listings, you can see the cover images that lighttpd serves. + +### And speaking of music + +I really do like Frameworks' latest album. It's quite similar to his previous work, and he always has the greatest hooks with very dance-able stuff and just that great bit of "yearning." It's nice to buy his stuff on Bandcamp, as usual (see link above, where you can also listen). + +Lately, I've also been buying stuff in that other great open source format, vinyl records. In particular, two fine recent albums from the [Erased Tapes][27] label, [Anne Müller's _Heliopause_][28], which is a beautiful record of her own solo cello and supporting instruments and sounds, "focusing on novel approaches to classical instrumentation," and [Penguin Cafe's _Handfuls of Night_][29], which "began life after Greenpeace commissioned [Arthur] Jeffes [of Penguin Cafe] to write four pieces of music corresponding to four breeds of penguins to help raise awareness for the endangered Antarctic seas." How could a Linux user not have music about penguins by Penguin Cafe? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/upgrade-cubox-open-source-music-server + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_LIFE_music_520x292_0411_ma.png?itok=v_ARy1ZT (open source music with piano keys background) +[2]: https://en.wikipedia.org/wiki/ARM_architecture +[3]: https://www.solid-run.com/nxp-family/cubox-i/ +[4]: https://en.wikipedia.org/wiki/Serial_ATA +[5]: https://en.wikipedia.org/wiki/TOSLINK +[6]: https://www.makeuseof.com/tag/5-mistakes-avoid-buying-next-microsd-card/ +[7]: https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i.mx-applications-processors/i.mx-6-processors/i.mx-6quad-processors-high-performance-3d-graphics-hd-video-arm-cortex-a9-core:i.MX6Q?&cid=ps_PRG100148_CAM262037_EETECH&gclid=CjwKCAiA27LvBRB0EiwAPc8XWfLpyKIpi4OPNrPLdmXpSynIaDP0FG2jQ9PPZ1q49ENp1CbQU2fKxxoCKtMQAvD_BwE +[8]: https://www.musicpd.org/ +[9]: https://en.wikipedia.org/wiki/Advanced_Linux_Sound_Architecture +[10]: https://www.lighttpd.net/ +[11]: https://opensource.com/article/17/8/cantata-music-linux +[12]: https://play.google.com/store/apps/details?id=net.prezz.mpr&hl=en_CA +[13]: https://opensource.com/article/17/6/armbian-cubox-i4pro +[14]: https://wiki.debian.org/Derivatives/Census/VoyageLinux +[15]: https://volumio.org/ +[16]: https://archphile.org/ +[17]: https://www.armbian.com/ +[18]: https://opensource.com/sites/default/files/uploads/armbianversions.png (Armbian versions) +[19]: https://docs.armbian.com/ +[20]: https://www.etcher.io/ +[21]: https://opensource.com/sites/default/files/uploads/cuboxlogin.png (CuBox login) +[22]: https://docs.armbian.com/User-Guide_Armbian-Config/ +[23]: https://opensource.com/sites/default/files/uploads/armbian-config.png (Armbian-config screen) +[24]: https://opensource.com/sites/default/files/uploads/armbian-config_settings.png (Armbian-config settings) +[25]: https://frameworksuk.bandcamp.com/album/imagine-gold +[26]: https://opensource.com/sites/default/files/uploads/frameworks-imaginegold.png (Frameworks "Imagine Gold" in Cantata) +[27]: https://www.erasedtapes.com/ +[28]: https://www.erasedtapes.com/release/eratp128-anne-mueller-heliopause +[29]: https://www.erasedtapes.com/release/eratp127-penguin-cafe-handfuls-of-night From a3fcdcbbc510200eb296b88038513dbbadde86e6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Jan 2020 08:40:59 +0800 Subject: [PATCH 310/430] PUB @robsean https://linux.cn/article-11770-1.html --- ...p Highlight- Open Source Disk Partitioning Tool GParted.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md (98%) diff --git a/translated/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md b/published/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md similarity index 98% rename from translated/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md rename to published/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md index 6721773f69..088b578c82 100644 --- a/translated/tech/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md +++ b/published/20191217 App Highlight- Open Source Disk Partitioning Tool GParted.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11770-1.html) [#]: subject: (App Highlight: Open Source Disk Partitioning Tool GParted) [#]: via: (https://itsfoss.com/gparted/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 18e314b9e43f2f2b83de1ca60b78f147df21a4d5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 11 Jan 2020 08:46:22 +0800 Subject: [PATCH 311/430] Rename sources/tech/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md to sources/talk/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md --- .../20200111 Don-t Use ZFS on Linux- Linus Torvalds.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md (100%) diff --git a/sources/tech/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md b/sources/talk/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md similarity index 100% rename from sources/tech/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md rename to sources/talk/20200111 Don-t Use ZFS on Linux- Linus Torvalds.md From b6f217100ff0ecadaa85b5903bfcc515abc89dea Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Jan 2020 09:20:28 +0800 Subject: [PATCH 312/430] PRF @geekpi --- ...y Pi retrospective- 6 projects and more.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/translated/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md b/translated/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md index 2e3d16258d..001d8cd841 100644 --- a/translated/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md +++ b/translated/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md @@ -7,26 +7,28 @@ [#]: via: (https://opensource.com/article/20/1/raspberry-pi-best) [#]: author: (Anderson Silva https://opensource.com/users/ansilva) -我的树莓派回顾:不止 6 个项目 +我的树莓派项目回顾 ====== -看看我在有趣的、有教育意义和有用的树莓派上做了什么。 -![Raspberry Pi 4 board, posterized filter][1] -从历史和理论上讲,十年、一个世纪或一千年从十进制一那年的 1 月 1 日物业开始。例如,20 世纪始于 1901 年 1 月 1 日,而不是 1900 年 1 月 1 日。原因很简单:现代日历中没有 0 年,因此这些时间段始于 1 年(使用公历)。但这不是我们在口语上和文化上指代时间段的方式。例如,当我们提到 80 年代的音乐或电影时,我们所说的是 1980 年至 1989 年。 +> 看看我在好玩、能学习、有用处的树莓派上做了些什么。 -我可以说,最近过去的 21 世纪 10 年代是云计算、社交媒体、移动技术和物联网 (IoT) 的十年,这其中包括[树莓派][2]。最近,《时代》杂志将树莓派称为[过去十年中 10 个最佳小玩意][3]之一。我非常同意这点。 +![](https://img.linux.net.cn/data/attachment/album/202001/11/091748wekfv77t5ux5zzv2.jpg) -最初的树莓派于 2012 年推出,我过了几年才使用上了它。但是从那以后,我在家中做了许多有趣的教育项目,甚至在 Opensource.com 中记录了一些。 +无论是从历史上,还是从理论上讲,当时钟走到一个十年份第一年的 1 月 1 日的午夜 0 点时,就开始了一个十年或一个世纪或一个千年纪元。例如,20 世纪始于 1901 年 1 月 1 日,而不是 1900 年 1 月 1 日。原因很简单:现代日历中没有 0 年,因此这些时间段始于 1 年(使用公历)。但这不是我们在口语上和文化上指代时间段的方式。例如,当我们提到 80 年代的音乐或电影时,我们所说的是 1980 年至 1989 年。 + +我可以说,最近过去的 21 世纪 10 年代是云计算、社交媒体、移动技术和物联网(IoT)的十年,这其中就包括[树莓派][2]。最近,《时代》杂志将树莓派称为[过去十年中 10 个最佳小玩意][3]之一。我非常同意这点。 + +树莓派最初的于 2012 年推出,我过了几年才使用上了它。不过从那以后,我在家中做了许多有趣的教育项目,还在 Opensource.com 中记录了一些。 ### 圣诞灯三部曲 -三年来,我写了三篇探讨如何使用树莓派和开源项目 LightShowPi 控制圣诞灯的文章。第一篇文章[_用树莓派创建你自己的音乐灯光秀_][4],是基础电子开发介绍和灯光秀的结合。第二篇文章,[_ 使用树莓派 SSH 进入你的圣诞树_][5],更深入地介绍了通过远程管理和电子按钮控制灯光的方法。三部曲的最后一章[_用树莓派设置假期心情_][6],回顾了上一年 LightShowPi 项目中引入的更改。 +三年来,我写了三篇探讨如何使用树莓派和开源项目 LightShowPi 控制圣诞灯的文章。第一篇文章《[用树莓派创建你自己的音乐灯光秀][4]》,非常基础地介绍了电子开发介绍和灯光秀的结合。第二篇文章,《[使用树莓派 SSH 进入你的圣诞树][5]》,稍微深入地介绍了通过远程管理和电子按钮控制灯光的方法。三部曲的最后一章《[用树莓派设置假期心情][6]》,回顾了上一年 LightShowPi 项目中引入的更改。 ### DIY 项目 -多年来,我已经将树莓派变成了几种有用的设备。有一次,我将树莓派变成了[带有 Pi MusicBox 的音乐播放设备][7],它可以让你在 Web 界面中导入你喜欢的音乐流并在房间中播放。 +多年来,我已经将树莓派变成了几种有用的设备。有一次,我将树莓派变成了 [Pi MusicBox 音乐播放设备][7],它可以让你在 Web 界面中导入你喜欢的音乐流并在房间中播放。 -将树莓派做成[移动视频录制设备][8]是另一个 DIY 项目。它需要一些额外的硬件,例如触摸屏、Pi 摄像头和电池组,但是可以使用。这个设备的最大缺点之一是当时树莓派的可用内存很小。我认为如果我将它重新配置在具有 4GB 内存的树莓派 4 上,那么这款便携式摄像机的功能可能会更好。这可能是一个会在 2020 年重新做项目。 +将树莓派做成[移动视频录制设备][8]是另一个 DIY 项目。它需要一些额外的硬件,例如触摸屏、树莓派摄像头和电池组,但是它工作的很好。这个设备的最大缺点之一是当时树莓派的可用内存很小。我认为如果我将它重新配置在具有 4GB 内存的树莓派 4 上,那么这款便携式摄像机的功能可能会更好。这可能是一个会在 2020 年重新打造的项目。 我做的另一个小项目[客厅的数字时钟][9]使用了 Adafruit PiTFT 小屏幕。尽管这个项目很简单,但它可能是我使用时间最长的项目。那个时钟在我的电视机上呆了一年多,一天 24 小时不间断运行,直到屏幕烧坏为止。 @@ -36,7 +38,7 @@ ### 走向未来 -我在树莓派基金会中不认识任何人,因此我不了解任何它的路线图和未来计划。我可以(但我不会)推测品牌及其设备的未来,它们让世界各地这么多不同社会地位的人扩展他们对计算机科学、电子和开源开发的知识。我希望基金会的管理层能够忠于其愿景和使命,并继续为世界各地的人们提供价格合理的技术。 +我不认识树莓派基金会中的任何人,因此我不了解它的任何路线图和未来计划。我可以(但我不会)推测品牌及其设备的未来,它们让世界各地这么多不同社会地位的人扩展他们对计算机科学、电子和开源开发的知识。我希望基金会的管理层能够忠于其愿景和使命,并继续为世界各地的人们提供价格合理的技术。 21 世纪 10 年代过去了,那是多么甜蜜的十年。对我来说,它闻起来就像树莓派馅饼。 @@ -47,7 +49,7 @@ via: https://opensource.com/article/20/1/raspberry-pi-best 作者:[Anderson Silva][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f08f47ea1e16aaea73e208503b3aed5771c07ab3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Jan 2020 09:21:10 +0800 Subject: [PATCH 313/430] PUB @geekpi https://linux.cn/article-11771-1.html --- ...03 My Raspberry Pi retrospective- 6 projects and more.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20200103 My Raspberry Pi retrospective- 6 projects and more.md (98%) diff --git a/translated/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md b/published/20200103 My Raspberry Pi retrospective- 6 projects and more.md similarity index 98% rename from translated/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md rename to published/20200103 My Raspberry Pi retrospective- 6 projects and more.md index 001d8cd841..ad2ff90485 100644 --- a/translated/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md +++ b/published/20200103 My Raspberry Pi retrospective- 6 projects and more.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11771-1.html) [#]: subject: (My Raspberry Pi retrospective: 6 projects and more) [#]: via: (https://opensource.com/article/20/1/raspberry-pi-best) [#]: author: (Anderson Silva https://opensource.com/users/ansilva) From d6cc786096a61d066f3a18be662e62a44808ccc1 Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Sat, 11 Jan 2020 09:46:16 +0800 Subject: [PATCH 314/430] Update 20200102 Put some loot in your Python platformer game.md --- ...ome loot in your Python platformer game.md | 84 ++++++++----------- 1 file changed, 37 insertions(+), 47 deletions(-) diff --git a/sources/tech/20200102 Put some loot in your Python platformer game.md b/sources/tech/20200102 Put some loot in your Python platformer game.md index 296739c2b9..998b7da88d 100644 --- a/sources/tech/20200102 Put some loot in your Python platformer game.md +++ b/sources/tech/20200102 Put some loot in your Python platformer game.md @@ -8,40 +8,36 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) Put some loot in your Python platformer game +在你的 Python 平台类游戏中放一些奖励 ====== -Give your players some treasures to collect and boost their score in -this installment on programming video games with Python's Pygame module. + +这部分是关于在使用 Python Pygame 模块开发视频游戏给你的玩家提供收集的宝物和经验值的内容。 ![Hearts, stars, and dollar signs][1] -This is part 9 in an ongoing series about creating video games in [Python 3][2] using the [Pygame][3] module. Previous articles are: +这是正在进行的关于使用 [Python 3][2]的[Pygame][3]模块创建视频游戏的系列文章的第9部分。以前的文章有: - * [Learn how to program in Python by building a simple dice game][4] - * [Build a game framework with Python using the Pygame module][5] - * [How to add a player to your Python game][6] - * [Using Pygame to move your game character around][7] - * [What's a hero without a villain? How to add one to your Python game][8] - * [Simulate gravity in your Python game][9] - * [Add jumping to your Python platformer game][10] - * [Enable your Python game player to run forward and backward][11] + * [通过构建一个简单的骰子游戏学习如何用 Python 编程][4] + * [使用 Pygame 模块用 Python 构建游戏框架][5] + * [如何在 Python 游戏中添加玩家][6] + * [使用 Pygame 移动你的游戏角色][7] + * [没有恶棍的哪里来的英雄?如何在您的 Python 游戏中添加一个][8] + * [在你的 Python 游戏中模拟重力][9] + * [将跳跃添加到您的 Python 平台游戏中][10] + * [使你的 Python 游戏玩家能够向前和向后跑][11] +如果你已经阅读了本系列的前几篇文章,那么你已经了解了编写游戏的所有基础知识。现在你可以在这些基础上,创造一个全功能的游戏。当你第一次学习时,遵循像本系列代码示例,这样的“用例”是有帮助的,但是,用例也会约束你。现在是时候运用你学到的知识,以新的方式应用它们了。 +如果说,说起来容易做起来难,这篇文章展示了一个如何将你已经了解的内容用于新目的的例子中。具体来说,就是它涵盖了如何使用你以前的课程中已经了解到的来实现奖励系统。 -If you've followed along with the previous articles in this series, then you know all the basics of programming video game mechanics. You can build upon these basics to create a fully functional video game all your own. Following a "recipe" like the code samples in this series is helpful when you're first learning, but eventually, the recipe becomes a constraint. It's time to use the principles you've learned and apply them in new ways. +在大多数电子游戏中,你有机会在游戏世界中获得“奖励”或收集到宝物和其他物品。奖励通常会增加你的分数或者你的健康指数,或者为你的下一次任务提供信息。 -If that sounds easier said than done, this article demonstrates an example of how to leverage what you already know for new purposes. Specifically, it covers how to implement a looting system +游戏中包含的奖励类似于编程平台。像平台一样,奖励没有用户控制,随着游戏世界的滚动,并且必须检查与玩家的碰撞。 -using what you have already learned about platforms from previous lessons. +### 创建奖励函数 -In most video games, you have the opportunity to "loot," or collect treasures and other items within the game world. Loot usually increases your score or your health or provides information leading to your next quest. - -Including loot in your game is similar to programming platforms. Like platforms, loot has no user controls, scrolls with the game world, and must check for collisions with the player sprite. - -### Creating the loot function - -Loot is so similar to platforms that you don't even need a Loot class. You can just reuse the **Platform** class and call the results loot. - -Since loot type and placement probably differ from level to level, create a new function called **loot** in your **Level** class, if you don't already have one. Since loot items are not platforms, you must also create a new **loot_list** group and then add loot objects to it. As with platforms, ground, and enemies, this group is used when checking for collisions: +奖励和平台非常相似,你甚至不需要奖励类。您可以重用 **Platform** 类,并将结果称为奖励。 +由于奖励类型和位置可能因级别不同而不同,如果你还没有一个新的功能,请在你的 **Level** 中创建一个名为 **Level** 的新功能。因为奖励物品不是平台,你也必须创建一个新的 **loot_list** 组,然后添加奖励物品。与平台、地面和敌人一样,该组用于检查冲突: ```     def loot(lvl,lloc): @@ -56,10 +52,9 @@ Since loot type and placement probably differ from level to level, create a new         return loot_list ``` -You can add as many loot objects as you like; just remember to add each one to your loot list. The arguments for the **Platform** class are the X position, the Y position, the width and height of the loot sprite (it's usually easiest to keep your loot sprite the same size as all other tiles), and the image you want to use as loot. Placement of loot can be just as complex as mapping platforms, so use the level design document you created when creating the level. - -Call your new loot function in the **Setup** section of your script. In the following code, the first three lines are for context, so just add the fourth: +你可以随意添加任意数量的奖励对象;记住把每一个都加到你的奖励清单上。***Platform** 类的参数是奖励图标的X位置、Y位置、宽度和高度(通常最容易让你的奖励图标保持和所有其他方块一样的大小),以及你想要用作的奖励图标。奖励的放置可以和贴图平台一样复杂,所以使用创建关卡时需要创建关卡设计文档。 +在脚本的 **Setup** 部分调用新的奖励函数。在下面的代码中,前三行是上下文,所以只需添加第四行: ``` enemy_list = Level.bad( 1, eloc ) @@ -68,8 +63,7 @@ plat_list = Level.platform( 1,tx,ty ) loot_list = Level.loot(1,tx,ty) ``` -As you know by now, the loot won't get drawn to the screen unless you include it in your main loop. Add the final line from the following code sample to your loop: - +正如你现在所知道的,除非你把它包含在你的主循环中,否则奖励不会被显示到屏幕上。将下面代码示例的最后一行添加到循环中: ```     enemy_list.draw(world) @@ -78,16 +72,16 @@ As you know by now, the loot won't get drawn to the screen unless you include it     loot_list.draw(world) ``` -Launch your game to see what happens. +启动你的游戏看看会发生什么。 ![Loot in Python platformer][12] -Your loot objects are spawned, but they don't do anything when your player runs into them, nor do they scroll when your player runs past them. Fix these issues next. +你的奖励会产生,但是当你的玩家碰到它们时,它们不会做任何事情,当你的玩家经过它们时,它们也不会滚动。接下来解决这些问题。 -### Scrolling loot +### 滚动奖励 Like platforms, loot has to scroll when the player moves through the game world. The logic is identical to platform scrolling. To scroll the loot forward, add the last two lines: - +像平台一样,当玩家在游戏世界中移动时,奖励必须滚动。逻辑与平台滚动相同。要向前滚动战利品,添加最后两行: ```         for e in enemy_list: @@ -96,7 +90,7 @@ Like platforms, loot has to scroll when the player moves through the game world.             l.rect.x -= scroll ``` -To scroll it backward, add the last two lines: +要向后滚动,请添加最后两行: ``` @@ -106,16 +100,15 @@ To scroll it backward, add the last two lines:             l.rect.x += scroll ``` -Launch your game again to see that your loot objects now act like they're _in_ the game world instead of just painted on top of it. +再次启动你的游戏,看看你的奖励物品现在表现得像在游戏世界里一样,而不是仅仅画在上面。 -### Detecting collisions +### 检测碰撞 -As with platforms and enemies, you can check for collisions between loot and your player. The logic is the same as other collisions, except that a hit doesn't (necessarily) affect gravity or health. Instead, a hit causes the loot to disappear and increment the player's score. +就像平台和敌人一样,你可以检查奖励物品和玩家之间的碰撞。逻辑与其他碰撞相同,除了撞击不会(必然)影响重力或健康。取而代之的是,命中会导致奖励物品会消失并增加玩家的分数。 -When your player touches a loot object, you can remove that object from the **loot_list**. This means that when your main loop redraws all loot items in **loot_list**, it won't redraw that particular object, so it will look like the player has grabbed the loot. - -Add the following code above the platform collision detection in the **update** function of your **Player** class (the last line is just for context): +当你的玩家触摸到一个奖励对象时,你可以从 **奖励列表** 中移除该对象。这意味着当你的主循环在 **loot_list** 中重绘所有奖励物品时,它不会重绘那个特定的对象,所以看起来玩家已经获得了奖励物品。 +在 **Player** 类的 **update** 函数中的平台碰撞检测之上添加以下代码(最后一行仅用于上下文): ```                 loot_hit_list = pygame.sprite.spritecollide(self, loot_list, False) @@ -127,8 +120,7 @@ Add the following code above the platform collision detection in the **update**         plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) ``` -Not only do you remove the loot object from its group when a collision happens, but you also award your player a bump in score. You haven't created a score variable yet, so add that to your player's properties, created in the **__init__** function of the **Player** class. In the following code, the first two lines are for context, so just add the score variable: - +当碰撞发生时,你不仅要把奖励从它的组中移除,还要给你的玩家一个分数提升。你还没有创建分数变量,所以请将它添加到你的玩家属性中,该属性是在***Player** 类的**__init__**函数中创建的。在下面的代码中,前两行是上下文,所以只需添加分数变量: ```         self.frame = 0 @@ -136,20 +128,18 @@ Not only do you remove the loot object from its group when a collision happens,         self.score = 0 ``` -When calling the **update** function in your main loop, include the **loot_list**: - +当在主循环中调用**update**函数时,需要包括**loot_list**: ```         player.gravity()         player.update() ``` -As you can see, you've got all the basics. All you have to do now is use what you know in new ways. +如你所见,你已经掌握了所有的基本知识。你现在要做的就是用新的方式使用你所知道的。 -There are a few more tips in the next article, but in the meantime, use what you've learned to make a few simple, single-level games. Limiting the scope of what you are trying to create is important so that you don't overwhelm yourself. It also makes it easier to end up with a finished product that looks and feels finished. - -Here's all the code you've written for this Python platformer so far: +在下一篇文章中还有一些提示,但是与此同时,用你学到的知识来制作一些简单的单层游戏。限制你试图创造的东西的范围是很重要的,这样你就不会埋没自己。这也使得最终的成品看起来和感觉上更容易完成。 +以下是迄今为止你为这个 Python 平台编写的所有代码: ``` #!/usr/bin/env python3 From b74afa0013d3aa652767befc7bc5686330967f90 Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Sat, 11 Jan 2020 10:52:36 +0800 Subject: [PATCH 315/430] heguangzhi translated --- ...ut some loot in your Python platformer game.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) rename {sources => translated}/tech/20200102 Put some loot in your Python platformer game.md (94%) diff --git a/sources/tech/20200102 Put some loot in your Python platformer game.md b/translated/tech/20200102 Put some loot in your Python platformer game.md similarity index 94% rename from sources/tech/20200102 Put some loot in your Python platformer game.md rename to translated/tech/20200102 Put some loot in your Python platformer game.md index 998b7da88d..14d2715438 100644 --- a/sources/tech/20200102 Put some loot in your Python platformer game.md +++ b/translated/tech/20200102 Put some loot in your Python platformer game.md @@ -11,7 +11,7 @@ Put some loot in your Python platformer game 在你的 Python 平台类游戏中放一些奖励 ====== -这部分是关于在使用 Python Pygame 模块开发视频游戏给你的玩家提供收集的宝物和经验值的内容。 +这部分是关于在使用 Python 的 Pygame 模块开发视频游戏给你的玩家提供收集的宝物和经验值的内容。 ![Hearts, stars, and dollar signs][1] 这是正在进行的关于使用 [Python 3][2]的[Pygame][3]模块创建视频游戏的系列文章的第9部分。以前的文章有: @@ -25,19 +25,19 @@ Put some loot in your Python platformer game * [将跳跃添加到您的 Python 平台游戏中][10] * [使你的 Python 游戏玩家能够向前和向后跑][11] -如果你已经阅读了本系列的前几篇文章,那么你已经了解了编写游戏的所有基础知识。现在你可以在这些基础上,创造一个全功能的游戏。当你第一次学习时,遵循像本系列代码示例,这样的“用例”是有帮助的,但是,用例也会约束你。现在是时候运用你学到的知识,以新的方式应用它们了。 +如果你已经阅读了本系列的前几篇文章,那么你已经了解了编写游戏的所有基础知识。现在你可以在这些基础上,创造一个全功能的游戏。当你第一次学习时,遵循本系列代码示例,这样的“用例”是有帮助的,但是,用例也会约束你。现在是时候运用你学到的知识,以新的方式应用它们了。 如果说,说起来容易做起来难,这篇文章展示了一个如何将你已经了解的内容用于新目的的例子中。具体来说,就是它涵盖了如何使用你以前的课程中已经了解到的来实现奖励系统。 在大多数电子游戏中,你有机会在游戏世界中获得“奖励”或收集到宝物和其他物品。奖励通常会增加你的分数或者你的健康指数,或者为你的下一次任务提供信息。 -游戏中包含的奖励类似于编程平台。像平台一样,奖励没有用户控制,随着游戏世界的滚动,并且必须检查与玩家的碰撞。 +游戏中包含的奖励类似于编程平台。像平台一样,奖励没有用户控制,随着游戏世界的滚动进行,并且必须检查与玩家的碰撞。 ### 创建奖励函数 奖励和平台非常相似,你甚至不需要奖励类。您可以重用 **Platform** 类,并将结果称为奖励。 -由于奖励类型和位置可能因级别不同而不同,如果你还没有一个新的功能,请在你的 **Level** 中创建一个名为 **Level** 的新功能。因为奖励物品不是平台,你也必须创建一个新的 **loot_list** 组,然后添加奖励物品。与平台、地面和敌人一样,该组用于检查冲突: +由于奖励类型和位置可能因关卡不同而不同,如果你还没有一个新的功能,请在你的 **Level** 中创建一个名为 **Level** 的新功能。因为奖励物品不是平台,你也必须创建一个新的 **loot_list** 组,然后添加奖励物品。与平台、地面和敌人一样,该组用于检查玩家碰撞: ```     def loot(lvl,lloc): @@ -76,12 +76,11 @@ loot_list = Level.loot(1,tx,ty) ![Loot in Python platformer][12] -你的奖励会产生,但是当你的玩家碰到它们时,它们不会做任何事情,当你的玩家经过它们时,它们也不会滚动。接下来解决这些问题。 +你的奖励将会显示出来,但是当你的玩家碰到它们时,它们不会做任何事情,当你的玩家经过它们时,它们也不会滚动。接下来解决这些问题。 ### 滚动奖励 -Like platforms, loot has to scroll when the player moves through the game world. The logic is identical to platform scrolling. To scroll the loot forward, add the last two lines: -像平台一样,当玩家在游戏世界中移动时,奖励必须滚动。逻辑与平台滚动相同。要向前滚动战利品,添加最后两行: +像平台一样,当玩家在游戏世界中移动时,奖励必须滚动。逻辑与平台滚动相同。要向前滚动奖励物品,添加最后两行: ```         for e in enemy_list: @@ -100,7 +99,7 @@ Like platforms, loot has to scroll when the player moves through the game world.             l.rect.x += scroll ``` -再次启动你的游戏,看看你的奖励物品现在表现得像在游戏世界里一样,而不是仅仅画在上面。 +再次启动你的游戏,看看你的奖励物品现在表现得像在游戏世界里一样了,而不是仅仅画在上面。 ### 检测碰撞 From 74d6c1c6f61dac8a069b4f035608ee99eed748d1 Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Sat, 11 Jan 2020 14:20:38 +0800 Subject: [PATCH 316/430] Update 20200107 How piwheels will save Raspberry Pi users time in 2020.md --- ... How piwheels will save Raspberry Pi users time in 2020.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md b/sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md index aa43d04f90..9a05b56b50 100644 --- a/sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md +++ b/sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (heguangzhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -90,7 +90,7 @@ via: https://opensource.com/article/20/1/piwheels 作者:[Ben Nuttall][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[heguangzhi](https://github.com/heguangzhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From df7d6ab3e32d36eeb84f0265b96b8a6ce93b5aba Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Jan 2020 14:25:49 +0800 Subject: [PATCH 317/430] PRF @MjSeven --- ...w to write a Python web API with Django.md | 126 +++++++++--------- 1 file changed, 64 insertions(+), 62 deletions(-) diff --git a/translated/tech/20191129 How to write a Python web API with Django.md b/translated/tech/20191129 How to write a Python web API with Django.md index aaf4acefb8..5ba1650a1f 100644 --- a/translated/tech/20191129 How to write a Python web API with Django.md +++ b/translated/tech/20191129 How to write a Python web API with Django.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (MjSeven) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to write a Python web API with Django) @@ -9,12 +9,14 @@ 如何借助 Django 来编写一个 Python Web API ====== -Django 是 Python API 开发中最流行的框架之一,在这个教程中,我们来学习如何使用它。 -![拿起 Python 书来学习吧][1] + +> Django 是 Python API 开发中最流行的框架之一,在这个教程中,我们来学习如何使用它。 + +![](https://img.linux.net.cn/data/attachment/album/202001/11/142503aio2325mk5weiozz.jpg) [Django][2] 所有 Web 框架中最全面的,也是最受欢迎的一个。自 2005 年以来,其流行度大幅上升。 -Django 是由 Django 软件基金会维护,并且获得了社区的大力支持,在全球拥有超过 11,600 名会员。在 Stack Overflow 上,Django 约有 191,000 个带标签的问题。Spotify、YouTube 和 Instagram 等都使用 Django 来构建应用程序和数据管理。 +Django 是由 Django 软件基金会维护,并且获得了社区的大力支持,在全球拥有超过 11,600 名成员。在 Stack Overflow 上,约有 191,000 个带 Django 标签的问题。Spotify、YouTube 和 Instagram 等都使用 Django 来构建应用程序和数据管理。 本文演示了一个简单的 API,通过它可以使用 HTTP 协议的 GET 方法来从服务器获取数据。 @@ -34,11 +36,11 @@ $ python3 -m venv env $ source env/bin/activate ``` -在 Windows 上,使用命令 **env\Scripts\activate** 来激活虚拟环境: +在 Windows 上,使用命令 `env\Scripts\activate` 来激活虚拟环境。 ### 安装 Django 和 Django REST framework -然后,安装 Django 和 Django REST: +然后,安装 Django 和 Django REST 模块: ``` $ pip3 install django @@ -47,7 +49,7 @@ $ pip3 install djangorestframework ### 实例化一个新的 Django 项目 -现在你的应用程序已经有了一个工作环境,你必须实例化一个新的 Django 项目。与 [Flask][3] 这样微框架不同的是,Django 有专门的命令来创建(注意第一条命令后的 **.** 字符)。 +现在你的应用程序已经有了一个工作环境,你必须实例化一个新的 Django 项目。与 [Flask][3] 这样微框架不同的是,Django 有专门的命令来创建(注意第一条命令后的 `.` 字符)。 ``` $ django-admin startproject tutorial . @@ -55,68 +57,68 @@ $ cd tutorial $ django-admin startapp quickstart ``` -Django 使用数据库来管理后端,所以你应该在开始开发之前同步数据库,数据库可以通过 **manage.py** 脚本管理,它是在你运行 **django-admin** 命令时创建的。因为你现在在 **tutorial** 目录,所以使用 **../** 符号来运行脚本,它位于上一层目录: +Django 使用数据库来管理后端,所以你应该在开始开发之前同步数据库,数据库可以通过 `manage.py` 脚本管理,它是在你运行 `django-admin` 命令时创建的。因为你现在在 `tutorial` 目录,所以使用 `../` 符号来运行脚本,它位于上一层目录: ``` $ python3 ../manage.py makemigrations No changes detected $ python4 ../manage.py migrate Operations to perform: -  Apply all migrations: admin, auth, contenttypes, sessions + Apply all migrations: admin, auth, contenttypes, sessions Running migrations: -  Applying contenttypes.0001_initial... OK -  Applying auth.0001_initial... OK -  Applying admin.0001_initial... OK -  Applying admin.0002_logentry_remove_auto_add... OK -  Applying admin.0003_logentry_add_action_flag_choices... OK -  Applying contenttypes.0002_remove_content_type_name... OK -  Applying auth.0002_alter_permission_name_max_length... OK -  Applying auth.0003_alter_user_email_max_length... OK -  Applying auth.0004_alter_user_username_opts... OK -  Applying auth.0005_alter_user_last_login_null... OK -  Applying auth.0006_require_contenttypes_0002... OK -  Applying auth.0007_alter_validators_add_error_messages... OK -  Applying auth.0008_alter_user_username_max_length... OK -  Applying auth.0009_alter_user_last_name_max_length... OK -  Applying auth.0010_alter_group_name_max_length... OK -  Applying auth.0011_update_proxy_permissions... OK -  Applying sessions.0001_initial... OK + Applying contenttypes.0001_initial... OK + Applying auth.0001_initial... OK + Applying admin.0001_initial... OK + Applying admin.0002_logentry_remove_auto_add... OK + Applying admin.0003_logentry_add_action_flag_choices... OK + Applying contenttypes.0002_remove_content_type_name... OK + Applying auth.0002_alter_permission_name_max_length... OK + Applying auth.0003_alter_user_email_max_length... OK + Applying auth.0004_alter_user_username_opts... OK + Applying auth.0005_alter_user_last_login_null... OK + Applying auth.0006_require_contenttypes_0002... OK + Applying auth.0007_alter_validators_add_error_messages... OK + Applying auth.0008_alter_user_username_max_length... OK + Applying auth.0009_alter_user_last_name_max_length... OK + Applying auth.0010_alter_group_name_max_length... OK + Applying auth.0011_update_proxy_permissions... OK + Applying sessions.0001_initial... OK ``` ### 在 Django 中创建用户 -创建一个名为 **admin**,密码为 **password123** 的初始用户: +创建一个名为 `admin`,示例密码为 `password123` 的初始用户: ``` $ python3 ../manage.py createsuperuser \ -  --email [admin@example.com][4] \ -  --username admin + --email admin@example.com \ + --username admin ``` 在提示时创建密码。 ### 在 Django 中实现序列化和视图 -为了使 Django 能够将信息传递给 HTTP GET 请求,必须将信息对象转化为有效的响应数据。Django 为此实现了“序列化类”。 +为了使 Django 能够将信息传递给 HTTP GET 请求,必须将信息对象转化为有效的响应数据。Django 为此实现了“序列化类” `serializers`。 -在你的项目中,创建一个名为 **quickstart/serializers.py** 的新模块,使用它来定义一些序列化器,模块将用于数据展示: +在你的项目中,创建一个名为 `quickstart/serializers.py` 的新模块,使用它来定义一些序列化器,模块将用于数据展示: ``` from django.contrib.auth.models import User, Group from rest_framework import serializers class UserSerializer(serializers.HyperlinkedModelSerializer): -    class Meta: -        model = User -        fields = ['url', 'username', 'email', 'groups'] + class Meta: + model = User + fields = ['url', 'username', 'email', 'groups'] class GroupSerializer(serializers.HyperlinkedModelSerializer): -    class Meta: -        model = Group -        fields = ['url', 'name'] + class Meta: + model = Group + fields = ['url', 'name'] ``` -Django 中的 [view][5] 是一个接受 Web 请求并返回 Web 响应的函数。响应可以是 HTML、HTTP 重定向、HTTP 错误、JSON 或 XML 文档、图像或 TAR 文件,或者可以是从 Internet 获得的任何其他内容。要创建视图,打开 **quickstart/views.py** 并输入以下代码。该文件已经存在,并且其中包含一些示例文本,保留这些文本并将以下代码添加到文件中: +Django 中的[视图][5]是一个接受 Web 请求并返回 Web 响应的函数。响应可以是 HTML、HTTP 重定向、HTTP 错误、JSON 或 XML 文档、图像或 TAR 文件,或者可以是从 Internet 获得的任何其他内容。要创建视图,打开 `quickstart/views.py` 并输入以下代码。该文件已经存在,并且其中包含一些示例文本,保留这些文本并将以下代码添加到文件中: ``` from django.contrib.auth.models import User, Group @@ -124,23 +126,23 @@ from rest_framework import viewsets from tutorial.quickstart.serializers import UserSerializer, GroupSerializer class UserViewSet(viewsets.ModelViewSet): -    """ -    API 允许查看或编辑用户 -    """ -    queryset = User.objects.all().order_by('-date_joined') -    serializer_class = UserSerializer + """ + API 允许查看或编辑用户 + """ + queryset = User.objects.all().order_by('-date_joined') + serializer_class = UserSerializer class GroupViewSet(viewsets.ModelViewSet): -    """ -    API 允许查看或编辑组 -    """ -    queryset = Group.objects.all() -    serializer_class = GroupSerializer + """ + API 允许查看或编辑组 + """ + queryset = Group.objects.all() + serializer_class = GroupSerializer ``` ### 使用 Django 生成 URL -现在,你可以生成 URL 以便人们可以访问你刚起步的 API。在文本编辑器中打开 urls.py 并将默认示例代码替换为以下代码: +现在,你可以生成 URL 以便人们可以访问你刚起步的 API。在文本编辑器中打开 `urls.py` 并将默认示例代码替换为以下代码: ``` from django.urls import include, path @@ -154,19 +156,19 @@ router.register(r'groups', views.GroupViewSet) # 使用自动路由 URL # 还有登录 URL urlpatterns = [ -    path('', include(router.urls)), -    path('api-auth/', include('rest_framework.urls', namespace='rest_framework')) + path('', include(router.urls)), + path('api-auth/', include('rest_framework.urls', namespace='rest_framework')) ] ``` ### 调整你的 Django 项目设置 -这个示例项目的设置模块存储在 **tutorial/settings.py** 中,因此在文本编辑器中将其打开,然后在 **INSTALLED_APPS** 列表的末尾添加 **rest_framework**: +这个示例项目的设置模块存储在 `tutorial/settings.py` 中,因此在文本编辑器中将其打开,然后在 `INSTALLED_APPS` 列表的末尾添加 `rest_framework`: ``` INSTALLED_APPS = [ -    ... -    'rest_framework', + ... + 'rest_framework', ] ``` @@ -175,17 +177,17 @@ INSTALLED_APPS = [ 现在,你可以测试构建的 API。首先,从命令行启动内置服务器: ``` -`$ python3 manage.py runserver` +$ python3 manage.py runserver ``` -你可以通过使用 **curl** 导航至 URL **** 来访问 API: +你可以通过使用 `curl` 导航至 URL `http://localhost:8000/users` 来访问 API: ``` -$ curl --get -[{"url":" +$ curl --get http://localhost:8000/users/?format=json +[{"url":"http://localhost:8000/users/1/?format=json","username":"admin","email":"admin@example.com","groups":[]}] ``` -使用 Firefox 或[开源浏览器][6]: +使用 Firefox 或你选择的[开源浏览器][6]: ![一个简单的 Django API][7] @@ -197,10 +199,10 @@ Django 的主要优点: 1. Django 社区的规模正在不断扩大,因此即使你做一个复杂项目,也会有大量的指导资源。 2. 默认包含模板、路由、表单、身份验证和管理工具等功能,你不必寻找外部工具,也不必担心第三方工具会引入兼容性问题。 - 3. 用户,循环和条件的简单结构使你可以专注于编写代码。 + 3. 用户、循环和条件的简单结构使你可以专注于编写代码。 4. 这是一个成熟且经过优化的框架,它非常快速且可靠。 -Django 的主要缺点是: +Django 的主要缺点: 1. Django 很复杂!从开发人员视角的角度来看,它可能比简单的框架更难学。 2. Django 有一个很大的生态系统。一旦你熟悉它,这会很棒,但是当你深入学习时,它可能会令人感到无所适从。 @@ -214,7 +216,7 @@ via: https://opensource.com/article/19/11/python-web-api-django 作者:[Rachel Waston][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 5cab9d11e26dab1ec1f0627644a30246e36028f3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Jan 2020 14:26:27 +0800 Subject: [PATCH 318/430] PUB @MjSeven https://linux.cn/article-11773-1.html --- .../20191129 How to write a Python web API with Django.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20191129 How to write a Python web API with Django.md (100%) diff --git a/translated/tech/20191129 How to write a Python web API with Django.md b/published/20191129 How to write a Python web API with Django.md similarity index 100% rename from translated/tech/20191129 How to write a Python web API with Django.md rename to published/20191129 How to write a Python web API with Django.md From ae7bb0737328a4f038ff5bfd7cfbed0263e5827f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Jan 2020 14:33:21 +0800 Subject: [PATCH 319/430] APL --- sources/tech/20190406 Run a server with Git.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190406 Run a server with Git.md b/sources/tech/20190406 Run a server with Git.md index 2d7749a465..7387669ac0 100644 --- a/sources/tech/20190406 Run a server with Git.md +++ b/sources/tech/20190406 Run a server with Git.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 904d29fbcc86e71876530e2cdc110d1dc074e79d Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Sat, 11 Jan 2020 15:45:33 +0800 Subject: [PATCH 320/430] heguangzhi translated --- ...ll save Raspberry Pi users time in 2020.md | 127 ----------------- ...ll save Raspberry Pi users time in 2020.md | 128 ++++++++++++++++++ 2 files changed, 128 insertions(+), 127 deletions(-) delete mode 100644 sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md create mode 100644 translated/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md diff --git a/sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md b/sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md deleted file mode 100644 index 9a05b56b50..0000000000 --- a/sources/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md +++ /dev/null @@ -1,127 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (heguangzhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How piwheels will save Raspberry Pi users time in 2020) -[#]: via: (https://opensource.com/article/20/1/piwheels) -[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) - -How piwheels will save Raspberry Pi users time in 2020 -====== -By making pre-compiled Python packages for Raspberry Pi available, the -piwheels project saves users significant time and effort. -![rainbow colors on pinwheels in the sun][1] - -Piwheels automates building Python wheels (pre-compiled Python packages) for all of the projects on [PyPI][2], the Python Package Index, using Raspberry Pi hardware to ensure compatibility. This means that when a Raspberry Pi user wants to install a Python library using **pip**, they get a ready-made compiled version that's guaranteed to work on the Raspberry Pi. This makes it much easier for Raspberry Pi users to dive in and get started with their projects. - -![Piwheels logo][3] - -When I wrote [_piwheels: Speedy Python package installation for the Raspberry Pi_][4] in October 2018, the piwheels project was in its first year and already proving its purpose of saving Raspberry Pi users considerable time and effort. But the project, which makes pre-compiled Python packages available for Raspberry Pi, has come a long way in its second year. - -![Raspberry Pi 4][5] - -### How it works - -[Raspbian][6], the primary OS for Raspberry Pi, comes pre-configured to use piwheels, so users don't need to do anything special to get access to the wheels. - -The configuration file (at **/etc/pip.conf**) tells pip to use [piwheels.org][7] as an _additional index_, so pip looks at PyPI first, then piwheels. The Piwheels website is hosted on a Raspberry Pi 3, and all the wheels built by the project are hosted on that Pi. It serves over 1 million packages per month—not bad for a $35 computer! - -In addition to the main Raspberry Pi that serves the website, the piwheels project uses seven other Pis to build the packages. Some run Raspbian Jessie, building wheels for Python 3.4, some run Raspbian Stretch for Python 3.5, and some run Raspbian Buster for Python 3.7. The project doesn't generally support other Python versions. There's also a "proper server"—a virtual machine running the Postgres database. Since the Pi 3 has just 1GB of RAM, the (very large) database doesn't run well on it, so we moved it to a VM. The Pi 4 with 4GB RAM would probably be suitable, so we may move to this in the future. - -The Pis are all on an IPv6-only network in a "Pi Cloud"—a brilliant service provided by Cambridge-based hosting company [Mythic Beasts][8]. - -![Mythic Beasts hosting service][9] - -### Downloads and trends - -Every time a wheel file is downloaded, it is logged in the database. This provides insight into what packages are most popular and what Python versions and operating systems people are using. We don't have much information from the user agent, but because the architecture of Pi 1/Zero shows as "armv6" and Pi 2/3/4 show as "armv7," we can tell them apart. - -As of mid-December 2019, over 14 million packages have been downloaded from piwheels, with nearly 9 million in 2019 alone. - -The 10 most popular packages since the project's inception are: - - 1. [pycparser][10] (821,060 downloads) - 2. [PyYAML][11] (366,979) - 3. [numpy][12] (354,531) - 4. [cffi][13] (336,982) - 5. [MarkupSafe][14] (318,878) - 6. [future][15] (282,349) - 7. [aiohttp][16] (277,046) - 8. [cryptography][17] (276,167) - 9. [home-assistant-frontend][18] (266,667) - 10. [multidict][19] (256,185) - - - -Note that many pure-Python packages, such as [urllib3][20], are provided as wheels on PyPI; because these are compatible across platforms, they're not usually downloaded from piwheels because PyPI takes precedence. - -We also see trends in things like which Python versions are used over time. This shows the quick takeover of Python 3.7 from 3.5 when Raspbian Buster was released: - -![Data from piwheels on Python versions used over time][21] - -You can see more trends in our [stats blog posts][22]. - -### Time saved - -Every package build is logged in the database, and every download is also stored. Cross-referencing downloads with build duration shows how much time has been saved. One example is numpy—the latest version took about 11 minutes to build. - -So far, piwheels has saved users a total of over 165 years of build time. At the current usage rate, piwheels saves _over 200 days per day_. - -As well as saving build time, having pre-compiled wheels also means people don't have to install various development tools to build packages. Some packages require other apt packages for them to access shared libraries. Figuring out which ones you need can be a pain, so we made that step easier, too. First, we figured out the process and [documented it on our blog][23]. Then we added this logic to the build process so that when a wheel is built, its dependencies are automatically calculated and added to the package's project page: - -![numpy dependencies][24] - -### What next for piwheels? - -We launched project pages (e.g., [numpy][25]) this year, which are a really useful way to let people look up information about a project in a human-readable way. They also make it easier for people to report issues, such as if a project is missing from piwheels or they have an issue with a package they've downloaded. - -In early 2020, we're planning to roll out some upgrades to piwheels that will enable a new JSON API, so you can automatically check which versions are available, look up dependencies for a project, and lots more. - -The next Debian/Raspbian upgrade won't happen until mid-2021, so we won't start building wheels for any new Python versions until then. - -You can read more about piwheels on the project's [blog][26], where I'll be publishing a 2019 roundup early in 2020. You can also follow [@piwheels][27] on Twitter, where you'll see daily and monthly stats along with any milestones reached. - -Of course, piwheels is an open source project, and you can see the entire project [source code on GitHub][28]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/piwheels - -作者:[Ben Nuttall][a] -选题:[lujun9972][b] -译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/bennuttall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rainbow-pinwheel-piwheel-diversity-inclusion.png?itok=di41Wd3V (rainbow colors on pinwheels in the sun) -[2]: https://pypi.org/ -[3]: https://opensource.com/sites/default/files/uploads/piwheels.png (Piwheels logo) -[4]: https://opensource.com/article/18/10/piwheels-python-raspberrypi -[5]: https://opensource.com/sites/default/files/uploads/raspberry-pi-4_0.jpg (Raspberry Pi 4) -[6]: https://www.raspberrypi.org/downloads/raspbian/ -[7]: http://piwheels.org -[8]: https://www.mythic-beasts.com/order/rpi -[9]: https://opensource.com/sites/default/files/uploads/pi-cloud.png (Mythic Beasts hosting service) -[10]: https://www.piwheels.org/project/pycparser -[11]: https://www.piwheels.org/project/PyYAML -[12]: https://www.piwheels.org/project/numpy -[13]: https://www.piwheels.org/project/cffi -[14]: https://www.piwheels.org/project/MarkupSafe -[15]: https://www.piwheels.org/project/future -[16]: https://www.piwheels.org/project/aiohttp -[17]: https://www.piwheels.org/project/cryptography -[18]: https://www.piwheels.org/project/home-assistant-frontend -[19]: https://www.piwheels.org/project/multidict -[20]: https://piwheels.org/project/urllib3/ -[21]: https://opensource.com/sites/default/files/uploads/pyvers2019.png (Data from piwheels on Python versions used over time) -[22]: https://blog.piwheels.org/piwheels-stats-for-2019/ -[23]: https://blog.piwheels.org/how-to-work-out-the-missing-dependencies-for-a-python-package/ -[24]: https://opensource.com/sites/default/files/uploads/numpy-deps.png (numpy dependencies) -[25]: https://www.piwheels.org/project/numpy/ -[26]: https://blog.piwheels.org/ -[27]: https://twitter.com/piwheels -[28]: https://github.com/piwheels/ diff --git a/translated/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md b/translated/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md new file mode 100644 index 0000000000..3b7ec879eb --- /dev/null +++ b/translated/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md @@ -0,0 +1,128 @@ +[#]: collector: (lujun9972) +[#]: translator: (heguangzhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How piwheels will save Raspberry Pi users time in 2020) +[#]: via: (https://opensource.com/article/20/1/piwheels) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) + + +piwheels 是如何在2020年节省树莓派用户的时间的 +====== +通过为树莓派提供预编译的 Python 包,piwheels 项目为用户节省了大量的时间和精力。![rainbow colors on pinwheels in the sun][1] + +piwheels 自动为[PiPi][2]上的所有项目构建 Python wheels( 预编译的 Python包 ),即 Python 包索引,使用树莓派硬件确保其兼容性。这意味着,当树莓派用户想要使用 **pip**,安装一个Python库时,他们会得到一个现成的编译版本,并保证可以在树莓派上良好的工作。这使得树莓派用户更容易进入和开始他们的项目。 + +![Piwheels logo][3] + +当我在2018年10月写[piwheels:为树莓派提供快速 Python 包安装][4]时,piwheels 项目已经进入第一年,并且已经证明了其为树莓派用户节省大量时间和精力。但是这个项目已经进入第二年,它为树莓派提供了预编译的 Python 包走了更长的路。 + +![Raspberry Pi 4][5] + +### 它是怎么工作的 + +[Raspbian][6],树莓派的主要操作系统,预配置使用 piwheels,所以用户不需要做任何特殊的事情就可以使用piwheels。 + +配置文件(在 **/etc/pip.conf**)告诉 pip 使用[piwheels.org][7]作为 _附加索引_,因此 pip 首先查看PyPI,然后查看 piwheels。piwheels 网站位于树莓派 3的 hosts中,该项目建造的所有 wheels 都位于该派上。它每月提供100多万套服务——对于一台35美元的电脑来说还不错! + +网站除了主要服务于树莓派以外,piwheels 项目还对使用其他七个派系统并构建软件包。有人运行 Raspbian Jessie,为 Python 3.4 建造 wheels,有人运行 Raspbian Stretch 为 Python 3.5,有人运行 Raspbian Buster 为 Python 3.7。该项目通常不支持其他 Python 版本。还有一个“合适的服务器”——运行 Postgres 数据库的虚拟机。由于 派3 只有1GB的内存,所以(非常大的)数据库不能在其上很好地运行,所以我们把它移到了虚拟机上。带 4GB 内存的 派4 可能是合适的,所以我们将来可能会用到它。 + +派都在“派云”中的 IPv6 网络上——这是一项由总部位于剑桥的托管公司[Mythic Beasts][8]提供的卓越的服务。 +![Mythic Beasts hosting service][9] + +### 下载和统计趋势 + +每次下载 piwheels 文件时,它都会记录在数据库中。这提供了对什么包最受欢迎以及人们使用什么 Python 版本和操作系统的统计。我们没有太多来自用户代理的信息,但是因为 派1/Zero 的架构显示为 “armv6”,派2/3/4显示为“armv7”,所以我们可以将它们区分开来。 + +截至2019年12月中旬,从派风车下载的软件包超过1,400万个,仅2019年就有近900万个。 + +自项目开始以来最受欢迎的10个软件包是: + + 1. [pycparser][10] (821,060 downloads) + 2. [PyYAML][11] (366,979) + 3. [numpy][12] (354,531) + 4. [cffi][13] (336,982) + 5. [MarkupSafe][14] (318,878) + 6. [future][15] (282,349) + 7. [aiohttp][16] (277,046) + 8. [cryptography][17] (276,167) + 9. [home-assistant-frontend][18] (266,667) + 10. [multidict][19] (256,185) + + + +请注意,许多纯 Python 包,如[urllib3][20],都是作为 PyPI 上的 wheels 提供的;因为这些是跨平台兼容的,所以通常不会从 piwheels 下载,因为PyPI优先。 + +随着时间的推移,我们也看到了使用哪些 Python 版本的趋势。这里显示了 Raspbian Buster 发布时从3.5版快速升级到了Python 3.7: + +![Data from piwheels on Python versions used over time][21] + + +你可以看到更多的统计趋势在[stats blog posts][22]。 + +### 节省时间 + + +每个包构建都被记录在数据库中,并且每个下载也被存储。带有构建持续时间的交叉引用下载显示了节省了多少时间。一个例子是 numpy ——最新版本大约需要11分钟来构建。 + +迄今为止,piwheels 项目已经为用户节省了总计超过165年的构建时间。按照目前的使用率,piwheels 项目每天节省200多天。 + + +除了节省构建时间,拥有预编译的 wheels 也意味着人们不必安装各种开发工具来构建包。一些包需要其他apt包来访问共享库。弄清楚你需要哪一个可能会很痛苦,所以我们也让这一步变得容易了。首先,我们找到了这个过程,[在博客上记录了这个过程][23]。然后,我们将这个逻辑添加到构建过程中,这样当构建一个 wheels 时,它的依赖关系会被自动计算并添加到包的项目页面中: + +![numpy dependencies][24] + +### 派风车的下一步是什么? + +今年,我们推出了项目页面(例如,[numpy][25),这是一种非常有用的方式,可以让人们以人类可读的方式查找项目信息。它们还使人们更容易报告问题,例如 piwheels 中缺少一个项目,或者他们下载的包有问题。 + +2020年初,我们计划对 piwheels 项目进行一些升级,以启用新的JSON应用编程接口,这样你就可以自动检查哪些版本可用,查找项目的依赖关系,等等。 + +下一次 Debian/Raspbian 升级要到2021年年中才会发生,所以在那之前我们不会开始为任何新的 Python 版本 制造 wheels。 + +你可以在这个项目的[博客][26]上读到更多关于 piwheels 的信息,我将在2020年初在那里发表一篇2019年的综述。你也可以在推特上关注[@piwheels][27],在那里你可以看到每日和每月的统计数据以及任何达到的里程碑。 + +当然,piwheels 是一个开源项目,你可以在[GitHub][28]上看到整个项目源代码。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/piwheels + +作者:[Ben Nuttall][a] +选题:[lujun9972][b] +译者:[heguangzhi](https://github.com/heguangzhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rainbow-pinwheel-piwheel-diversity-inclusion.png?itok=di41Wd3V (rainbow colors on pinwheels in the sun) +[2]: https://pypi.org/ +[3]: https://opensource.com/sites/default/files/uploads/piwheels.png (Piwheels logo) +[4]: https://opensource.com/article/18/10/piwheels-python-raspberrypi +[5]: https://opensource.com/sites/default/files/uploads/raspberry-pi-4_0.jpg (Raspberry Pi 4) +[6]: https://www.raspberrypi.org/downloads/raspbian/ +[7]: http://piwheels.org +[8]: https://www.mythic-beasts.com/order/rpi +[9]: https://opensource.com/sites/default/files/uploads/pi-cloud.png (Mythic Beasts hosting service) +[10]: https://www.piwheels.org/project/pycparser +[11]: https://www.piwheels.org/project/PyYAML +[12]: https://www.piwheels.org/project/numpy +[13]: https://www.piwheels.org/project/cffi +[14]: https://www.piwheels.org/project/MarkupSafe +[15]: https://www.piwheels.org/project/future +[16]: https://www.piwheels.org/project/aiohttp +[17]: https://www.piwheels.org/project/cryptography +[18]: https://www.piwheels.org/project/home-assistant-frontend +[19]: https://www.piwheels.org/project/multidict +[20]: https://piwheels.org/project/urllib3/ +[21]: https://opensource.com/sites/default/files/uploads/pyvers2019.png (Data from piwheels on Python versions used over time) +[22]: https://blog.piwheels.org/piwheels-stats-for-2019/ +[23]: https://blog.piwheels.org/how-to-work-out-the-missing-dependencies-for-a-python-package/ +[24]: https://opensource.com/sites/default/files/uploads/numpy-deps.png (numpy dependencies) +[25]: https://www.piwheels.org/project/numpy/ +[26]: https://blog.piwheels.org/ +[27]: https://twitter.com/piwheels +[28]: https://github.com/piwheels/ From 41b815b26883c112122b6b1b7065933445a0d4f8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Jan 2020 22:17:31 +0800 Subject: [PATCH 321/430] TSL --- .../tech/20190406 Run a server with Git.md | 240 ------------------ .../tech/20190406 Run a server with Git.md | 226 +++++++++++++++++ 2 files changed, 226 insertions(+), 240 deletions(-) delete mode 100644 sources/tech/20190406 Run a server with Git.md create mode 100644 translated/tech/20190406 Run a server with Git.md diff --git a/sources/tech/20190406 Run a server with Git.md b/sources/tech/20190406 Run a server with Git.md deleted file mode 100644 index 7387669ac0..0000000000 --- a/sources/tech/20190406 Run a server with Git.md +++ /dev/null @@ -1,240 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Run a server with Git) -[#]: via: (https://opensource.com/article/19/4/server-administration-git) -[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/seth) - -Run a server with Git -====== -Thanks to Gitolite, you can manage a Git server with Git. Learn how in -our series about little-known Git uses. -![computer servers processing data][1] - -As I've tried to demonstrate in this series leading up to Git's 14th anniversary on April 7, [Git][2] can do a wide range of things beyond tracking source code. Believe it or not, Git can even manage your Git server, so you can, more or less, run a Git server with Git itself. - -Of course, this involves a lot of components beyond everyday Git, not the least of which is [Gitolite][3], the backend application managing the fiddly bits that you configure using Git. The great thing about Gitolite is that, because it uses Git as its frontend interface, it's easy to integrate Git server administration within the rest of your Git-based workflow. Gitolite provides precise control over who can access specific repositories on your server and what permissions they have. You can manage that sort of thing yourself with the usual Linux system tools, but it takes a lot of work if you have more than just one or two repos across a half-dozen users. - -Gitolite's developers have done the hard work to make it easy for you to provide many users with access to your Git server without giving them access to your entire environment—and you can do it all with Git. - -What Gitolite is _not_ is a GUI admin and user panel. That sort of experience is available with the excellent [Gitea][4] project, but this article focuses on the simple elegance and comforting familiarity of Gitolite. - -### Install Gitolite - -Assuming your Git server runs Linux, you can install Gitolite with your package manager ( **yum** on CentOS and RHEL, **apt** on Debian and Ubuntu, **zypper** on OpenSUSE, and so on). For example, on RHEL: - - -``` -`$ sudo yum install gitolite3` -``` - -Many repositories still have older versions of Gitolite for legacy support, but the current version is version 3. - -You must have passwordless SSH access to your server. You can use a password to log in if you prefer, but Gitolite relies on SSH keys, so you must configure the option to log in with keys. If you don't know how to configure a server for passwordless SSH access, go learn how to do that first (the [Setting up SSH key authentication][5] section of Steve Ovens's Ansible article explains it well). It's an essential part of secure server administration—as well as of running Gitolite. - -### Configure a Git user - -Without Gitolite, if a person requests access to a Git repository you host on a server, you have to provide that person with a user account. Git provides a special shell, the **git-shell** , which is an ultra-specific shell that performs only Git tasks. This lets you have users who can access your server only through the filter of a very limited shell environment. - -That solution works, but it usually means a user gains access to all repositories on your server unless you have a very good schema for group permissions and maintain those permissions strictly whenever a new repository is created. It also requires a lot of manual configuration at the system level, an area usually reserved for a specific tier of sysadmins and not necessarily the person usually in charge of Git repositories. - -Gitolite sidesteps this issue entirely by designating one username for every person who needs access to any repository. By default, the username is **git** , and because Gitolite's documentation assumes that's what is used, it's a good default to keep when you're learning the tool. It's also a well-known convention for anyone who's ever used GitLab or GitHub or any other Git hosting service. - -Gitolite calls this user the _hosting user_. Create an account on your server to act as the hosting user (I'll stick with **git** because that's the convention): - - -``` -` $ sudo adduser --create-home git` -``` - -For you to control the **git** user account, it must have a valid public SSH key that belongs to you. You should already have this set up, so **cp** your public key ( _not your private key_ ) to the **git** user's home directory: - - -``` -$ sudo cp ~/.ssh/id_ed25519.pub /home/git/ -$ sudo chown git:git /home/git/id_ed25519.pub -``` - -If your public key doesn't end with the extension **.pub** , Gitolite will not use it, so rename the file accordingly. Change to that user account to run Gitolite's setup: - - -``` -$ sudo su - git -$ gitolite setup --pubkey id_ed25519.pub -``` - -After the setup script runs, the **git** home's user directory will have a **repositories** directory, which (for now) contains the files **git-admin.git** and **testing.git**. That's all the setup the server requires, so log out. - -### Use Gitolite - -Managing Gitolite is a matter of editing text files in a Git repository, specifically **gitolite-admin.git**. You won't SSH into your server for Git administration, and Gitolite encourages you not to try. The repositories you and your users store on the Gitolite server are _bare_ repositories, so it's best to stay out of them. - - -``` -$ git clone [git@example.com][6]:gitolite-admin.git gitolite-admin.git -$ cd gitolite-admin.git -$ ls -1 -conf -keydir -``` - -The **conf** directory in this repository contains a file called **gitolite.conf**. Open it in a text editor or use **cat** to view its contents: - - -``` -repo gitolite-admin -RW+ = id_ed22519 - -repo testing -RW+ = @all -``` - -You may have an idea of what this configuration file does: **gitolite-admin** represents this repository, and the owner of the **id_ed25519** key has read, write, and Git administrative privileges. In other words, rather than mapping users to normal local Unix users (because all your users log in using the **git** hosting user identity), Gitolite maps users to SSH keys listed in the **keydir** directory. - -The **testing.git** repository gives full permissions to everyone with access to the server using special group notation. - -#### Add users - -If you want to add a user called **alice** to your Git server, the person Alice must send you her public SSH key. Gitolite uses whatever is to the left of the **.pub** extension as the identifier for your Git users. Rather than using the default key name values, give keys a name indicative of the key owner. If a user has more than one key (e.g., one for her laptop, one for her desktop), you can use subdirectories to avoid file name collisions. For instance, the key Alice uses from her laptop might come to you as the default **id_rsa.pub** , so rename it **alice.pub** or similar (or let the users name the key according to their local user accounts on their computers), and place it into the **gitolite-admin.git/keydir/work/laptop/** directory. If she sends you another key from her desktop, name it **alice.pub** (the same as the previous one) and add it to **keydir/work/desktop/**. Another key might go into **keydir/home/desktop/** , and so on. Gitolite recursively searches **keydir** for a **.pub** file matching a repository "user" and treats any match as the same identity. - -When you add keys to the **keydir** directory, you must commit them back to your server. This is such an easy thing to forget that there's a real argument here for using an automated Git application like [**Sparkleshare**][7] so any change is committed back to your Gitolite admin immediately. The first time you forget to commit and push—and waste three hours of your time and your user's time troubleshooting—you'll see that Gitolite is the perfect justification for using Sparkleshare. - - -``` -$ git add keydir -$ git commit -m 'added alice-laptop-0.pub' -$ git push origin HEAD -``` - -Alice, by default, gains access to the **testing.git** directory so she can test connectivity and functionality with that. - -#### Set permissions - -As with users, directory permissions and groups are abstracted away from the normal Unix tools you might be used to (or find information about online). Permissions to projects are granted in the **gitolite.conf** file in **gitolite-admin.git/conf** directory. There are four levels of permissions: - - * **R** allows read-only. A user with **R** permissions on a repository may clone it, and that's all. - * **RW** allows a user to perform a fast-forward push of a branch, create new branches, and create new tags. More or less, this one feels like a "normal" Git repository to most users. - * **RW+** allows Git actions that are potentially destructive. A user can perform normal fast-forward pushes, as well as rewind pushes, do rebases, and delete branches and tags. This may or may not be something you want to grant to all contributors on a project. - * **-** explicitly denies access to a repository. This is essentially the same as a user not being listed in the repository's configuration. - - - -Create a new repository or modify an existing repository's permissions by adjusting **gitolite.conf**. For instance, to give Alice permissions to administrate a new repository called **widgets.git** : - - -``` -repo gitolite-admin -RW+ = id_ed22519 - -repo testing -RW+ = @all - -repo widgets -RW+ = alice -``` - -Now Alice—and Alice alone—can clone the repo: - - -``` -[alice]$ git clone [git@example.com][6]:widgets.git -Cloning into 'widgets'... -warning: You appear to have cloned an empty repository. -``` - -On her initial push, Alice must use the **-u** option to send her branch to the empty repository (as she would have to do with any Git host). - -To make user management easier, you can define groups of repositories: - - -``` -@qtrepo = widgets -@qtrepo = games - -repo gitolite-admin -RW+ = id_ed22519 - -repo testing -RW+ = @all - -repo @qtrepo -RW+ = alice -``` - -Just as you can create group repositories, you can group users. One user group exists by default: **@all**. As you might expect, it includes all users, without exception. You can create your own: - - -``` -@qtrepo = widgets -@qtrepo = games - -@developers = alice bob - -repo gitolite-admin -RW+ = id_ed22519 - -repo testing -RW+ = @all - -repo @qtrepo -RW+ = @developers -``` - -As with adding or modifying key files, any change to the **gitolite.conf** file must be committed and pushed to take effect. - -### Create a repository - -By default, Gitolite assumes repository creation happens from the top down. For instance, a project manager with access to the Git server creates a project repository and, through the Gitolite administration repo, adds developers. - -In practice, you might prefer to grant users permission to create repositories. Gitolite calls these "wild repos" (I'm not sure whether that's commentary on how the repos come into being or a reference to the wildcard characters required by the configuration file to let it happen). Here's an example: - - -``` -@managers = alice bob - -repo foo/CREATOR/[a-z]..* -C = @managers -RW+ = CREATOR -RW = WRITERS -R = READERS -``` - -The first line defines a group of users: the group is called **@managers** and contains users **alice** and **bob**. The next line sets up a wildcard allowing repositories that do not yet exist to be created in a directory called **foo** followed by a subdirectory named for the user creating the repo. For example: - - -``` -[alice]$ git clone [git@example.com][6]:foo/alice/cool-app.git -Cloning into cool-app'... -Initialized empty Git repository in /home/git/repositories/foo/alice/cool-app.git -warning: You appear to have cloned an empty repository. -``` - -There are some mechanisms for the creator of a wild repo to define who can read and write to their repository, but they're limited in scope. For the most part, Gitolite assumes that a specific set of users governs project permission. One solution is to grant all users access to **gitolite-admin** using a Git hook to require manager approval to merge changes into the master branch. - -### Learn more - -Gitolite has many more features than what this introductory article covers, so try it out. The [documentation][8] is excellent, and once you read through it, you can customize your Gitolite server to provide your users whatever level of control you are comfortable with. Gitolite is a low-maintenance, simple system that you can install, set up, and then more or less forget about. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/4/server-administration-git - -作者:[Seth Kenlon (Red Hat, Community Moderator)][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/server_data_system_admin.png?itok=q6HCfNQ8 (computer servers processing data) -[2]: https://git-scm.com/ -[3]: http://gitolite.com -[4]: http://gitea.io -[5]: Setting%20up%20SSH%20key%20authentication -[6]: mailto:git@example.com -[7]: https://opensource.com/article/19/4/file-sharing-git -[8]: http://gitolite.com/gitolite/quick_install.html diff --git a/translated/tech/20190406 Run a server with Git.md b/translated/tech/20190406 Run a server with Git.md new file mode 100644 index 0000000000..c52295591e --- /dev/null +++ b/translated/tech/20190406 Run a server with Git.md @@ -0,0 +1,226 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Run a server with Git) +[#]: via: (https://opensource.com/article/19/4/server-administration-git) +[#]: author: (Seth Kenlon https://opensource.com/users/seth/users/seth) + +使用 Git 来管理 Git 服务器 +====== + +> 借助 Gitolite,你可以使用 Git 来管理 Git 服务器。在我们的系列中了解这些鲜为人知的 Git 用途。 + +![computer servers processing data][1] + +正如我在系列文章中演示的那样,[Git][2] 除了跟踪源代码外,还可以做很多事情。信不信由你,Git 甚至可以管理你的 Git 服务器,因此你可以或多或少地使用 Git 本身运行 Git 服务器。 + +当然,这涉及除日常使用 Git 之外的许多组件,其中最重要的是 [Gitolite][3],该后端应用程序可以管理你使用 Git 的每个细小的配置。Gitolite 的优点在于,由于它使用 Git 作为其前端接口,因此很容易将 Git 服务器管理集成到其他基于 Git 的工作流中。Gitolite 可以精确控制谁可以访问你服务器上的特定存储库以及他们具有哪些权限。你可以使用常规的 Linux 系统工具自行管理此类事务,但是如果在六个用户中只有一个或两个以上的仓库,则需要大量的工作。 + +Gitolite 的开发人员做了艰苦的工作,使你可以轻松地为许多用户提供对你的 Git 服务器的访问权,而又不让他们访问你的整个环境 —— 而这一切,你可以使用 Git 来完成全部工作。 + +Gitolite 并`不是` 图形化的管理员和用户面板。优秀的 [Gitea][4] 项目可提供这种经验,但是本文重点介绍 Gitolite 的简单优雅和令人舒适的熟悉感。 + +### 安装 Gitolite + +假设你的 Git 服务器运行 Linux,则可以使用包管理器安装 Gitolite(在 CentOS 和 RHEL 上为 `yum`,在 Debian 和 Ubuntu 上为 `apt`,在 OpenSUSE 上为 `zypper` 等)。例如,在 RHEL 上: + +``` +$ sudo yum install gitolite3 +``` + +许多发行版的存储库仍提供的是旧版本的 Gitolite,但当前版本为版本 3。 + +你必须具有对服务器的无密码 SSH 访问权限。如果愿意,你可以使用密码登录服务器,但是 Gitolite 依赖于 SSH 密钥,因此必须配置使用密钥登录的选项。如果你不知道如何配置服务器以进行无密码 SSH 访问,请首先学习如何进行操作(Steve Ovens 的 Ansible 文章的[设置 SSH 密钥身份验证][5]部分对此进行了很好的说明)。这是加强服务器管理的安全以及运行 Gitolite 的重要组成部分。 + +### 配置 Git 用户 + +如果没有 Gitolite,则如果某人请求访问你在服务器上托管的 Git 存储库,则必须向该人提供用户帐户。Git 提供了一个特殊的外壳,即 `git-shell`,这是一个仅执行 Git 任务的特别特定的 shell。这可以让你有个只能通过非常受限的 Shell 环境的过滤器来访问服务器的用户。 + +该解决方案可行,但通常意味着用户可以访问服务器上的所有存储库,除非你具有用于组权限的良好模式,并在创建新存储库时严格保持这些权限。这种方式还需要在系统级别进行大量手动配置,这通常是为特定级别的系统管理员保留的区域,而不一定是通常负责 Git 存储库的人员。 + +Gitolite 通过为需要访问任何存储库的每个人指定一个用户名来完全回避此问题。 默认情况下,用户名是 `git`,并且由于 Gitolite 的文档假定使用的是它,因此在学习该工具时保留它是一个很好的默认设置。对于曾经使用过 GitLab 或 GitHub 或任何其他 Git 托管服务的人来说,这也是一个众所周知的约定。 + +Gitolite 将此用户称为**托管用户**。在服务器上创建一个帐户以充当托管用户(我习惯使用 `git`,因为这是惯例): + +``` +$ sudo adduser --create-home git +``` + +为了控制该 `git` 用户帐户,该帐户必须具有属于你的有效 SSH 公钥。你应该已经进行了设置,因此复制你的公钥(**不是你的私钥**)添加到 `git` 用户的家目录中: + +``` +$ sudo cp ~/.ssh/id_ed25519.pub /home/git/ +$ sudo chown git:git /home/git/id_ed25519.pub +``` + +如果你的公钥不以扩展名 `.pub` 结尾,则 Gitolite 不会使用它,因此请相应地重命名该文件。切换为该用户帐户以运行 Gitolite 的安装程序: + +``` +$ sudo su - git +$ gitolite setup --pubkey id_ed25519.pub +``` + +安装脚本运行后,`git` 的家用户目录将有一个 `repository` 目录,该目录(目前)包含文件 `git-admin.git` 和 `testing.git`。这就是该服务器所需的全部设置,现在请登出 `git` 用户。 + +### 使用 Gitolite + +管理 Gitolite 就是编辑 Git 存储库中的文本文件,尤其是 `gitolite-admin.git`。你不会通过 SSH 进入服务器来进行 Git 管理,并且 Gitolite 也建议你不要这样尝试。你和你的用户存储在 Gitolite 服务器上的存储库是个**裸**存储库,因此最好不要使用它们。 + +``` +$ git clone git@example.com:gitolite-admin.git gitolite-admin.git +$ cd gitolite-admin.git +$ ls -1 +conf +keydir +``` + +该存储库中的 `conf` 目录包含一个名为 `gitolite.conf` 的文件。在文本编辑器中打开它,或使用`cat`查看其内容: + +``` +repo gitolite-admin + RW+ = id_ed22519 + +repo testing + RW+ = @all +``` + +你可能对该配置文件的功能有所了解:`gitolite-admin` 代表此存储库,并且 `id_ed25519` 密钥的所有者具有读取、写入和 Git 管理权限。换句话说,不是将用户映射到普通的本地 Unix 用户(因为所有用户都使用 `git` 用户托管用户身份),而是将用户映射到 `keydir` 目录中列出的 SSH 密钥。 + +`testing.git` 存储库使用特殊组符号为访问服务器的每个人提供了全部权限。 + +#### 添加用户 + +如果要向 Git 服务器添加一个名为 `alice` 的用户,Alice 必须向你发送她的 SSH 公钥。Gitolite 使用 `.pub` 扩展名左边的任何内容作为该 Git 用户的标识符。不要使用默认的密钥名称值,而是给密钥指定一个指示密钥所有者的名称。如果用户有多个密钥(例如,一个用于笔记本电脑,一个用于台式机),则可以使用子目录来避免文件名冲突。例如,Alice 在笔记本电脑上使用的密钥可能是默认的 `id_rsa.pub`,因此将其重命名为`alice.pub` 或类似名称(或让用户根据其计算机上的本地用户帐户来命名密钥),然后将其放入 `gitolite-admin.git/keydir/work/laptop/` 目录中。如果她从她的桌面发送了另一个密钥,命名为 `alice.pub`(与上一个相同),然后将其添加到 `keydir/home/desktop/` 中。另一个密钥可能放到 `keydir/home/desktop/` 中,依此类推。Gitolite 递归地在 `keydir` 中搜索与存储库“用户”匹配的 `.pub` 文件,并将所有匹配项视为相同的身份。 + +当你将密钥添加到 `keydir` 目录时,必须将它们提交回服务器。这是一件很容易忘记的事情,这里有一个使用自动化的 Git 应用程序(例如 [Sparkleshare] [7])的真正的理由,因此任何更改都将立即提交给你的 Gitolite 管理员。第一次忘记提交和推送,在浪费了三个小时的时间以及用户的故障排除时间之后,你会发现 Gitolite 是使用 Sparkleshare 的完美理由。 + +``` +$ git add keydir +$ git commit -m 'added alice-laptop-0.pub' +$ git push origin HEAD +``` + +默认情况下,Alice 可以访问 `testing.git` 目录,因此她可以使用该目录测试连接性和功能。 + +#### 设置权限 + +与用户一样,目录权限和组也是从你可能习惯的的常规 Unix 工具中抽象出来的(或可从在线信息查找)。在`gitolite-admin.git/conf` 目录中的 `gitolite.conf` 文件中授予对项目的权限。权限分为四个级别: + +* `R` 允许只读。在存储库上具有 `R` 权限的用户可以克隆它,仅此而已。 +* `RW` 允许用户执行分支的快进推送、创建新分支和创建新标签。对于大多数用户来说,这个或多或少感觉就像一个“普通”的 Git 存储库。 +* `RW+` 允许可能具有破坏性的 Git 动作。用户可以执行常规的快进推送、回滚推送、变基以及删除分支和标签。你可能想要或不希望将其授予项目中的所有贡献者。 +* `-` 明确拒绝访问存储库。这与未在存储库的配置中列出的用户相同。 + +通过调整 `gitolite.conf` 来创建一个新的存储库或修改现有存储库的权限。例如,授予 Alice 权限来管理一个名为 `widgets.git` 的新存储库: + +``` +repo gitolite-admin + RW+ = id_ed22519 + +repo testing + RW+ = @all + +repo widgets + RW+ = alice +``` + +现在,Alice(也仅 Alice 一个人)就可以克隆该存储库: + +``` +[alice]$ git clone git@example.com:widgets.git +Cloning into 'widgets'... +warning: You appear to have cloned an empty repository. +``` + +在第一次推送时,Alice 必须使用 `-u` 选项将其分支发送到空存储库(如同她在任何 Git 主机上做的一样)。 + +为了简化用户管理,你可以定义存储库组: + +``` +@qtrepo = widgets +@qtrepo = games + +repo gitolite-admin + RW+ = id_ed22519 + +repo testing + RW+ = @all + +repo @qtrepo + RW+ = alice +``` + +正如你可以创建组存储库一样,你也可以对用户进行分组。默认情况下存在一个用户组:`@all`。如你所料,它包括所有用户,无一例外。你也可以创建自己的组: + +``` +@qtrepo = widgets +@qtrepo = games + +@developers = alice bob + +repo gitolite-admin + RW+ = id_ed22519 + +repo testing + RW+ = @all + +repo @qtrepo + RW+ = @developers +``` + +与添加或修改密钥文件一样,对 `gitolite.conf` 文件的任何更改都必须提交并推送以生效。 + +### 创建存储库 + +默认情况下,Gitolite 假设存储库的创建是从上至下进行。例如,有权访问 Git 服务器的项目经理创建了一个项目存储库,并通过 Gitolite 管理仓库添加了开发人员。 + +实际上,你可能更愿意向用户授予创建存储库的权限。Gitolite 称这些为“野生仓库(通配仓库)wild repos”(我不确定这是关于仓库的形成方式的描述,还是指配置文件所需的通配符)。这是一个例子: + +``` +@managers = alice bob + +repo foo/CREATOR/[a-z]..* + C = @managers + RW+ = CREATOR + RW = WRITERS + R = READERS +``` + +第一行定义了一组用户:该组称为 `@managers`,其中包含用户 `alice` 和 `bob`。下一行设置了通配符允许创建尚不存在的存储库,放在名为 `foo` 的目录下的创建存储库的用户名的子目录中。例如: + +``` +[alice]$ git clone git@example.com:foo/alice/cool-app.git +Cloning into cool-app'... +Initialized empty Git repository in /home/git/repositories/foo/alice/cool-app.git +warning: You appear to have cloned an empty repository. +``` + +野生仓库的创建者可以使用一些机制来定义谁可以读取和写入其存储库,但是他们是被限定范围的。在大多数情况下,Gitolite 假定由一组特定的用户来管理项目权限。一种解决方案是使用 Git 挂钩授予所有用户对 `gitolite-admin` 的访问权限,以要求管理者批准将更改合并到 master 分支中。 + +### 了解更多 + +Gitolite 具有比此介绍性文章涵盖的更多功能,因此请尝试一下。其[文档][8]非常出色,一旦你通读了它,就可以自定义 Gitolite 服务器,以向用户提供你喜欢的任何级别的控制。Gitolite 是一种维护成本低、简单的系统,你可以安装、设置它,然后基本上就可以将其忘却。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/4/server-administration-git + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/server_data_system_admin.png?itok=q6HCfNQ8 (computer servers processing data) +[2]: https://git-scm.com/ +[3]: http://gitolite.com +[4]: http://gitea.io +[5]: Setting%20up%20SSH%20key%20authentication +[6]: mailto:git@example.com +[7]: https://opensource.com/article/19/4/file-sharing-git +[8]: http://gitolite.com/gitolite/quick_install.html From 8088857543ccc50aa24430c9481f64c85ae6d9ea Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 12 Jan 2020 00:57:21 +0800 Subject: [PATCH 322/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200111=20Sync?= =?UTF-8?q?=20files=20across=20multiple=20devices=20with=20Syncthing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200111 Sync files across multiple devices with Syncthing.md --- ... across multiple devices with Syncthing.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20200111 Sync files across multiple devices with Syncthing.md diff --git a/sources/tech/20200111 Sync files across multiple devices with Syncthing.md b/sources/tech/20200111 Sync files across multiple devices with Syncthing.md new file mode 100644 index 0000000000..75c6161189 --- /dev/null +++ b/sources/tech/20200111 Sync files across multiple devices with Syncthing.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Sync files across multiple devices with Syncthing) +[#]: via: (https://opensource.com/article/20/1/sync-files-syncthing) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Sync files across multiple devices with Syncthing +====== +Learn how to sync files between devices with Syncthing in the first +article in our series on 20 ways to be more productive with open source +in 2020. +![Files in a folder][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Syncing files with Synthing + +Setting up a new machine is a pain. We all have our "standard setups" that we copy from machine to machine. And over the years, I've used a lot of ways to keep them in sync between machines. In the old days (and this will tell you how old I am), it was with floppy disks, then Zip disks, USB sticks, SCP, Rsync, Dropbox, ownCloud—you name it. And they never seemed to work right for me. + +Then I stumbled upon [Syncthing][2]. + +![syncthing console][3] + +Syncthing is a lightweight, peer-to-peer file-synchronization system. You don't need to pay for a service, you don't need a third-party server, and it's fast. Much faster, in my experience, than many of the "big names" in file synchronization. + +Syncthing is available for Linux, MacOS, Windows, and several flavors of BSD. There is also an Android app (but nothing official for iOS yet). There are even handy graphical frontends for all of the above (although I'm not going to cover those here). On Linux, there are packages available for most distributions, so installation is very straightforward. + +![Installing Syncthing on Ubuntu][4] + +When you start Syncthing the first time, it launches a web browser to configure the daemon. There's not much to do on the first machine, but it is a good chance to poke around the user interface (UI) a little bit. The most important thing to see is System ID under the **Actions** menu in the top-right. + +![Machine ID][5] + +Once the first machine is set up, repeat the installation on the second machine. In the UI, there will be a button on the lower-right labeled **Add Remote Device**. Click the button, and you will be presented with a box to enter a **Device ID and a Name**. Copy and paste the **Device ID** from the first machine and click **Save**. + +You should see a pop-up on the first node asking to add the second. Once you accept it, the new machine will show up on the lower-right of the first one. Share the default directory with the second machine. Click on **Default Folder** and then click the **Edit** button. There are four links at the top of the pop-up. Click on **Sharing** and then select the second machine. Click **Save** and look at the second machine. You should get a prompt to accept the shared directory. Once you accept that, it will start synchronizing files between the two machines. + +![Sharing a directory in Syncthing][6] + +Test it out by copying a file to the default directory (**/your/home/Share**) on one of the machines. It should show up on the other one very quickly. + +You can add as many directories as you want or need to the sharing, which is pretty handy. As you can see in the first image, I have one for **myconfigs**—that's where I keep my configuration files. When I get a new machine, I just install Syncthing, and if I tune a configuration on one, I don't have to update all of them—it happens automatically. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/sync-files-syncthing + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder) +[2]: https://syncthing.net/ +[3]: https://opensource.com/sites/default/files/uploads/productivity_1-1.png (syncthing console) +[4]: https://opensource.com/sites/default/files/uploads/productivity_1-2.png (Installing Syncthing on Ubuntu) +[5]: https://opensource.com/sites/default/files/uploads/productivity_1-3.png (Machine ID) +[6]: https://opensource.com/sites/default/files/uploads/productivity_1-4.png (Sharing a directory in Syncthing) From fce1ce02e1e0a3d85dee495e6bfc2cdf4001d3df Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Jan 2020 09:27:05 +0800 Subject: [PATCH 323/430] PRF @robsean --- ...urce interior design with Sweet Home 3D.md | 78 +++++++++---------- 1 file changed, 37 insertions(+), 41 deletions(-) diff --git a/translated/tech/20191016 Open source interior design with Sweet Home 3D.md b/translated/tech/20191016 Open source interior design with Sweet Home 3D.md index ebc4a3bc70..bfabda6d1e 100644 --- a/translated/tech/20191016 Open source interior design with Sweet Home 3D.md +++ b/translated/tech/20191016 Open source interior design with Sweet Home 3D.md @@ -1,115 +1,111 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Open source interior design with Sweet Home 3D) [#]: via: (https://opensource.com/article/19/10/interior-design-sweet-home-3d) [#]: author: (Seth Kenlon https://opensource.com/users/seth) - Sweet Home 3D 开放源码室内设计 +Sweet Home 3D 开放源码室内设计 ====== -在你去真实世界购物前,在虚拟世界中尝试家具布局,配色方案等等。 -![Several houses][1] + +> 在你去真实世界购物前,在虚拟世界中尝试家具布局、配色方案等等。 + +![](https://img.linux.net.cn/data/attachment/album/202001/12/092633eyc3c9f7u3gfgj4e.jpg) 这里有关于如何装饰房间的三大流派: - 1. 购买一堆家具,并把它们塞进房间。 - 2. 仔细测量每件家具,计算房间的理论容量,然后把它们全部塞进房间,忽略你在床上放置一个书架的事实。 - 3. 使用一台计算机进行预先可视化。 +1. 购买一堆家具,并把它们塞进房间。 +2. 仔细测量每件家具,计算房间的理论容量,然后把它们全部塞进房间,忽略你在床上放置一个书架的事实。 +3. 使用一台计算机进行预先可视化。 +之前,我还实践了鲜为人知的第四个方式:不要家具。然而,自从我成为一个远程工作者,我发现家庭办公需要一些便利的设施,像一张桌子和一张椅子,一个用于存放参考书和技术手册的书架等等。因此,我一直在制定一个使用实际的家具来迁移我的生活和工作空间的计划,在该*计划*上强调由实木制作,而不是牛奶箱子(或胶水和锯末板之类的东西)。我最不想做的一件事:从旧货市场淘到得宝贝带回家时,发现其进不了门,或者比另一件家具大很多。 - -从历史观点上说,我实践了鲜为人知的第四条原则:没有家具。然而,自从我成为一个远程工作者,我发现家庭办公需要一些便利的设施,像一张桌子和一张椅子,一个用于存放参考书和技术手册的书架等等。因此,我一直在制定一个使用实际的家具来迁移我的生活和工作空间的计划,在 _计划_ 上强调由实木制作,而不是牛奶箱子(或胶水和锯末,或同样的东西)。我最不想做的一件事:从旧货市场淘到得宝贝带回家时,发现其进不了门,或者比另一件家具大很多。 - -是时候做专业人士该做的事了。是时候视觉预览了。 +是时候做专业人士该做的事了,是时候做视觉预览了。 ### 开放源码室内设计 -[Sweet Home 3D][2] 是一个开放源码 (GPLv2) 室内设计应用程序,帮助你绘制你的住宅平面图,然后定义,重新调整大小以及安排家具。你可以使用精确的尺寸来完成这些,精确到一厘米以下,而不使用任何数学运算,仅使用简单的拖拽操作。当你完成后,你可以在 3D 中查看结果。如果你可以在一个 word 程序中创建一个基本的表格(不是家具类),你可以在 Sweet Home 3D 中规划你家的室内设计。 +[Sweet Home 3D][2] 是一个开源的(GPLv2)室内设计应用程序,可以帮助你绘制你的住宅平面图,然后定义、重新调整大小以及安排家具。你可以使用精确的尺寸来完成这些,精确到一厘米以下,而不使用任何数学运算,仅使用简单的拖拽操作就行。当你完成后,你可以以 3D 方式查看结果。在 Sweet Home 3D 中规划你家的室内设计,就和在 Word 程序中创建基本的表格一样简单。 ### 安装 -Sweet Home 3D 是一个 [Java][3] 应用程序,因此它是通用的。它运行在任何可以运行 Java 的操作系统上,包括 Linux ,Windows ,MacOS 和 BSD 。不用理会你的操作系统,你可以从网站 [下载][4] 应用程序。 +Sweet Home 3D 是一个 [Java][3] 应用程序,因此它是平台通用的。它运行在任何可以运行 Java 的操作系统上,包括 Linux、Windows、MacOS 和 BSD 。不用理会你的操作系统,你可以从网站[下载][4]该应用程序。 - * 在 Linux 上,[untar][5] 存档文件。在 SweetHome3D 文件上右键单击,并选择**属性**。在**权限**选项卡中,授予文件可执行权限。 - * 在 MacOS 和 Windows 上,展开存档文件并启动应用程序。当系统提示时,你必需授予它权限来在你的系统上运行。 +* 在 Linux 上,[untar][5] 存档文件。在 `SweetHome3D` 文件上右键单击,并选择**属性**。在**权限**选项卡中,授予文件可执行权限。 +* 在 MacOS 和 Windows 上,展开存档文件并启动应用程序。当系统提示时,你必需授予它权限来在你的系统上运行。 ![Sweet Home 3D permissions][6] -在 Linux 上,你也可以像一个 Snap 软件包一样安装 Sweet Home 3D ,前提是你已经安装并启用 **snapd** 。 +在 Linux 上,你也可以像一个 Snap 软件包一样安装 Sweet Home 3D ,前提是你已经安装并启用 **snapd**。 ### 成功的测量 -首先:打开你的卷尺。为充分利用 Sweet Home 3D ,你必须知道你计划生活空间的实际尺寸。你可能需要测量到毫米或1/16英寸;你知道你自己对变化幅度的容忍度。但是你必需获得基本的尺寸,包括材料墙壁和门窗。 +首先:打开你的卷尺。为充分利用 Sweet Home 3D,你必须知道你所计划的生活空间的实际尺寸。你可能需要测量精度到毫米或 1/16 英寸;你可以自己把握对偏差幅度的容忍度。但是你必需获得基本的尺寸,包括测量墙壁和门窗。 -用你最好的判断力来判断常识。例如,当测量门时,包括门框; - -虽然从技术上讲它不是 _门_ 本身的一部分,它可能是你不想用家具覆盖的墙壁空间的一部分。 +用你最好的判断力来判断常识。例如,当测量门时,包括门框;虽然从技术上讲它不是*门*本身的一部分,但它可能是你不想用家具遮挡的一部分墙壁空间。 ![Measure twice, execute once][7] -CC-SA-BY opensource.com - ### 创建一间房间 -当你第一次启动 Sweet Home 3D 时,它会以它的默认查看模式来打开一个空白的画布,蓝图视图在顶部面板中,3D 渲染在底部面板中。在我的 [Slackware][8] 桌面计算机上,这项工作非常友好,但是我的桌面计算机也是我的视频编辑和游戏计算机,所以它有一个极好的 3D 渲染显卡。在我的笔记本计算机上,这种视图模式是非常慢的。为了最好的性能(尤其是在一台计没有 3D 渲染的专用计算机上),转到窗口顶部的 **3D 视图** 菜单,并选择 **虚拟访问** 。这个视图模式基于虚拟访客的位置从地面视图渲染你的工作。这意味着你可以控制渲染的东西和时机。 +当你第一次启动 Sweet Home 3D 时,它会以其默认查看模式来打开一个空白的画布,蓝图视图在顶部面板中,3D 渲染在底部面板中。在我的 [Slackware][8] 桌面计算机上,它可以很好地工作,不过我的桌面计算机也是我的视频编辑和游戏计算机,所以它有一个极好的 3D 渲染显卡。在我的笔记本计算机上,这种视图模式是非常慢的。为了最好的性能(尤其是在一台计没有 3D 渲染的专用计算机上),转到窗口顶部的 **3D 视图** 菜单,并选择 **虚拟访问** 。这个视图模式基于虚拟访客的位置从地面视图渲染你的工作。这意味着你可以控制渲染的内容和时机。 -不顾你计算机的功率来切换到这个视图的有意义的,因为地表以上的 3D 渲染不比蓝图平面图向你提供更多有用的详细信息。在你更改视图模式后,你可以开始设计。 +不管你计算机是否强力,切换到这个视图的有意义的,因为地表以上的 3D 渲染不比蓝图平面图向你提供更多有用的详细信息。在你更改视图模式后,你可以开始设计。 -第一步是定义你家的墙壁。使用**创建墙壁**工具完成,在顶部工具栏的右侧找到 **手** 图标。绘制墙壁很简单:单击你想要墙壁开始的位置,单击以锚定位置,不断单击锚定,直到你的房间完成。 +第一步是定义你家的墙壁。使用**创建墙壁**工具完成,可以在顶部工具栏的**手形**图标右侧找到。绘制墙壁很简单:单击你想要墙壁开始的位置,单击以锚定位置,不断单击锚定,直到你的房间完成。 ![Drawing walls in Sweet Home 3D][9] -在你闭合墙壁后,按**Esc**来退出工具。 +在你闭合墙壁后,按 `Esc` 来退出工具。 #### 定义一间房间 -Sweet Home 3D 在你如何创建墙壁的问题上是灵活的。你可以先绘制你房子的外部边界,然后再细分内部,或者你可以绘制每个房间作为结成一体的"容器",最终形成你房子所占的空间量。这种灵活性是能做到的,因为在现实生活中和在 Sweet Home 3D 中,墙壁并不总是定义一间房间。为定义一间房间,使用在顶部工具栏的**创建墙壁** 按钮右侧的 **创建房间** 按钮。 +Sweet Home 3D 在你如何创建墙壁的问题上是灵活的。你可以先绘制你房子的外部边界,然后再细分内部,或者你可以绘制每个房间作为结成一体的“容器”,最终形成你房子所占的空间量。这种灵活性是能做到的,因为在现实生活中和在 Sweet Home 3D 中,墙壁并不总是用来定义一间房间。为定义一间房间,使用在顶部工具栏的**创建墙壁**按钮右侧的**创建房间**按钮。 -如果房间的地板空间是通过四面墙所定义,你们你需要做的全部的定义是像一间房间一样在四面墙壁内双击来圈占地方。Sweet Home 3D 将定义空间为一间房间,并根据你的喜好,以英尺或米为单位向你提供房间的面积。 +如果房间的地板空间是通过四面墙所定义,你需要做的全部的定义是像一间房间一样在四面墙壁内双击来圈占地方。Sweet Home 3D 将定义该空间为一间房间,并根据你的喜好,以英尺或米为单位向你提供房间的面积。 对于不规则的房间,你必需使用每次单击来手动定义房间的每个墙角。根据房间形状的复杂性,你可能不得不进行试验来发现你是否需要从你的原点来顺时针或逆时针工作,以避免奇怪的莫比斯条形地板。不过,一般来说,定义一间房间的地板空间是简单的。 ![Defining rooms in Sweet Home 3D][10] -在你给定房间一层地板后,你可以更改到 **箭头** 工具,并在房间上双击来给予它一个名称。你也可以设置地板,墙壁,天花板和踢脚板的颜色及纹理。 +在你给定房间一层地板后,你可以更改到**箭头**工具,并在房间上双击来给予它一个名称。你也可以设置地板、墙壁、天花板和踢脚线的颜色及纹理。 ![Modifying room floors, ceilings, etc. in Sweet Home 3D][11] -默认情况下,这些都不会在蓝图视图中渲染。为启用在你蓝图面板中的房间渲染,转到 **文件** 菜单并选择 **首选项** 。在 **首选项** 面板中,设置 **平面图中房间渲染** 为 **地板颜色或纹理** 。 +默认情况下,这些都不会在蓝图视图中渲染。为启用在你蓝图面板中的房间渲染,转到**文件**菜单并选择**首选项**。在**首选项**面板中,设置**平面图中房间渲染**为**地板颜色或纹理**。 ### 门和窗 -在你完成基本的地板平面图后,你可以长期地切换到 **箭头** 工具。 +在你完成基本的地板平面图后,你可以长期地切换到**箭头**工具。 -你可以在 Sweet Home 3D 的左栏中的 **门和窗** 类别下找到门和窗。你有很多选择,所以选择最接近你家的东西。 +你可以在 Sweet Home 3D 的左栏中的**门和窗**类别下找到门和窗。你有很多选择,所以选择最接近你家的东西。 ![Moving a door in Sweet Home 3D][12] -为放置一扇门或窗到你的平面图中,在你的蓝图平面图中的合适的墙壁上拖拽门或窗。为调整它的位置和大小,双击门或窗。 +为放置一扇门或窗到你的平面图中,在你的蓝图平面图中的合适的墙壁上拖拽门或窗。要调整它的位置和大小,请双击门或窗。 ### 添加家具 -随着基本计划完成,部分工作感觉像 _工作_ 结束了!从这点继续,你可以玩弄家具布置以及其它装饰。 +随着基本平面图完成,这部分工作感觉像是结束了!从这点继续,你可以摆弄家具布置以及其它装饰。 -你可以在左栏中找到家具,按每个计划的房间来组织。你可以拖拽任何项目到你的蓝图平面图中,当你的鼠标悬停在项目的区域上时,使用可视化工具控制方向和大小。在任何项目上双击双击来调整它的颜色和成品表面。 +你可以在左栏中找到家具,按预期的方式来组织每个房间。你可以拖拽任何项目到你的蓝图平面图中,当你的鼠标悬停在项目的区域上时,使用可视化工具控制方向和大小。在任何项目上双击双击来调整它的颜色和成品表面。 -### 访问和导出 +### 查看和导出 -为了看看你未来的家将会看起来是什么样子,在你的蓝图视图中拖拽"人"图标到一个房间中。 +为了看看你未来的家将会看起来是什么样子,在你的蓝图视图中拖拽“人”图标到一个房间中。 ![Sweet Home 3D rendering][13] -你可以在现实主义和仅感受空间感之间找到自己的平衡,只要你的想象力是你唯一的限制。你可以从 Sweet Home 3D [下载页面][4] 获取附加的有用的资源来添加到你的家中。你甚至可以使用 **库编辑器** 应用程序创建你自己的家具和纹理,它们可以从项目网站有选择地下载。 +你可以在现实和空间感受之间找到自己的平衡,你的想象力是你唯一的限制。你可以从 Sweet Home 3D [下载页面][4]获取附加的有用的资源来添加到你的家中。你甚至可以使用**库编辑器**应用程序创建你自己的家具和纹理,它可以从该项目的网站下载。 Sweet Home 3D 可以导出你的蓝图平面图为 SVG 格式,以便在 [Inkscape][14] 中使用,并且它可以导出你的 3D 模型为 OBJ 格式,以便在 [Blender][15] 中使用。为导出你的蓝图,转到**平面图**菜单,并选择**导出为 SVG 格式**。为导出一个 3D 模型,转到 **3D 视图** 菜单并选择**导出为 OBJ 格式**。 -你也可以拍摄你家的"快照,以便于不打开 Sweet Home 3D 而参考你的想法。为创建一个快照,转到 **3D视图** 菜单并选择 **创建照片**。快照是按照蓝图视图中的人的图标的角度展现的,因此按照需要调整,然后在 **创建照片** 窗口中单击 **创建** 按钮。 如果你对快照满意,单击 **保存** 。 +你也可以拍摄你家的"快照,以便于不打开 Sweet Home 3D 而回顾你的想法。为创建一个快照,转到 **3D 视图**菜单并选择**创建照片**。快照是按照蓝图视图中的人的图标的角度展现的,因此按照需要调整,然后在**创建照片**窗口中单击**创建**按钮。如果你对快照满意,单击**保存**。 ### 甜蜜的家 -在 Sweet Home 3D 中有更多的特色。你可以添加一片天空和一片草坪,为你的照片定位光线,设置天花板高度,给你房子添加另一楼层等等。不管你打算租一套公寓,还是买一套房子—或是(还)尚不存在的房子,Sweet Home 3D 是一款简单迷人的应用程序,当你匆忙购买家具时,它可以娱乐并帮助你做出更好的购买选择。因此,你终于可以停止在厨房的柜台上吃早餐以及蹲在地上工作。 +在 Sweet Home 3D 中有更多的特色。你可以添加一片天空和一片草坪,为你的照片定位光线,设置天花板高度,给你房子添加另一楼层等等。不管你是打算租一套公寓,还是买一套房子,或是(尚)不存在的房子,Sweet Home 3D 是一款简单迷人的应用程序,当你匆忙购买家具时,它可以帮助你快乐地做出更好的购买选择。因此,你终于可以停止在厨房的柜台上吃早餐以及蹲在地上工作了。 -------------------------------------------------------------------------------- @@ -118,7 +114,7 @@ via: https://opensource.com/article/19/10/interior-design-sweet-home-3d 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9cbad661076712210ebe606cdbb80d3dcf7a2839 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Jan 2020 09:29:37 +0800 Subject: [PATCH 324/430] PUB @robsean https://linux.cn/article-11774-1.html --- ...20191016 Open source interior design with Sweet Home 3D.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191016 Open source interior design with Sweet Home 3D.md (99%) diff --git a/translated/tech/20191016 Open source interior design with Sweet Home 3D.md b/published/20191016 Open source interior design with Sweet Home 3D.md similarity index 99% rename from translated/tech/20191016 Open source interior design with Sweet Home 3D.md rename to published/20191016 Open source interior design with Sweet Home 3D.md index bfabda6d1e..814f0bdb23 100644 --- a/translated/tech/20191016 Open source interior design with Sweet Home 3D.md +++ b/published/20191016 Open source interior design with Sweet Home 3D.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11774-1.html) [#]: subject: (Open source interior design with Sweet Home 3D) [#]: via: (https://opensource.com/article/19/10/interior-design-sweet-home-3d) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 5a3a8442208994562e3494b29e5d5b5bc948624c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 13 Jan 2020 00:52:44 +0800 Subject: [PATCH 325/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200112=20What?= =?UTF-8?q?=20I=20learned=20going=20from=20prison=20to=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200112 What I learned going from prison to Python.md --- ...t I learned going from prison to Python.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20200112 What I learned going from prison to Python.md diff --git a/sources/tech/20200112 What I learned going from prison to Python.md b/sources/tech/20200112 What I learned going from prison to Python.md new file mode 100644 index 0000000000..84dfa73ecb --- /dev/null +++ b/sources/tech/20200112 What I learned going from prison to Python.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What I learned going from prison to Python) +[#]: via: (https://opensource.com/article/20/1/prison-to-python) +[#]: author: (Shadeed "Sha" Wallace-Stepter https://opensource.com/users/shastepter) + +What I learned going from prison to Python +====== +How open source programming can offer opportunities after incarceration. +![Programming books on a shelf][1] + +Less than a year ago, I was in San Quentin State Prison serving a life sentence. + +In my junior year in high school, I shot a man while robbing him. Now, it took a while for me to see or even admit that what I did was wrong, but after going through a jury trial and seeing the devastating consequences of my actions, I knew that I needed to make a change, and I did. And although it was a great thing that I had changed, I had still shot a man and nearly killed him. And there are consequences to doing something like that, and rightfully so. So at the age of 18, I was sentenced to life in prison. + +Now prison is a terrible place; I do not recommend it. But I had to go and so I went. I’ll spare you the details, but you can rest assured it’s a place where there isn’t much incentive to change, and many people pick up more bad habits than they went in with. + +I’m one of the lucky ones. While I was in prison, something different happened. I started to imagine a future for myself beyond the prison bars where, up until that point, I had spent all of my adult life. + +Now YOU think about this: I’m black, with nothing more than a high school education. I had no work history, and if I ever were to leave prison, I would be a convicted felon upon my release. And I think I’m being fair when I say that the first thought for an employer who sees this profile is not "I need to hire this person." + +My options weren’t clear, but my mind was made up. I needed to do something to survive that wouldn’t look anything like my life before prison. + +### A path to Python + +Eventually, I wound up in San Quentin State Prison, and I had no idea how lucky I was to be there. San Quentin offered several self-help and education programs. These [rehabilitation opportunities][2] ensured prisoners had skills that helped them avoid being repeat offenders upon release. + +As part of one of these programs, I met [Jessica McKellar][3] in 2017 through her work with the San Quentin Media Program. Jessica is an enthusiast of the programming language [Python][4], and she started to sell me on how great Python is and how it’s the perfect language to learn for someone just starting out. And this is where the story becomes stranger than fiction. + +  + +> Thanks [@northbaypython][5] for letting [@ShaStepter][6] and me reprise our [@pycon][7] keynotes to get them recorded. I'm honored to share: +> +> From Prison to Python: +> +> Mass Decarceration: If We Don't Hire People With Felony Convictions, Who Will? [pic.twitter.com/Kpjo8d3ul6][8] +> +> — Jessica McKellar (@jessicamckellar) [November 5, 2019][9] + +  + +Jessica told me about these Python video tutorials that she did for a company called [O’Reilly Media][10], that they were online, and how great it would be if I could get access to them. Unfortunately, internet access in prison isn’t a thing. But, I had met this guy named Tim O’Reilly, who had recently come to San Quentin. It turns out that, after his visit, Tim had donated a ton of content from his company, O’Reilly Media, to the prison’s programming class. I wound up getting my hands on a tablet that had Jessica’s Python tutorials on it and learned how to code using those Python tutorials. + +It was incredible. Total strangers with a very different background and life from my own had connected the dots in a way that led to me learning to code. + +### The love of the Python community + +After this point, I started meeting with Jessica pretty frequently, and she began to tell me about the open source community. What I learned is that, on a fundamental level, open source is about fellowship and collaboration. It works so well because no one is excluded. + +And for me, someone who struggled to see where they fit, what I saw was a very basic form of love—love by way of collaboration and acceptance, love by way of access, love by way of inclusion. And my spirit yearned to be a part of it. So I continued my education with Python, and, unfortunately, I wasn’t able to get more tutorials, but I was able to draw from the vast wealth of written knowledge that has been compiled by the open source community. I read anything that even mentioned Python, from paperback books to obscure magazine articles, and I used the tablet that I had to solve the Python problems that I read about. + +My passion for Python and programming wasn’t something that many of my peers shared. Aside from the very small group of people who were in the prison’s programming class, no one else that I knew had ever mentioned programming; it’s just not on the average prisoner’s radar. I believe that this is due to the perception that programming isn’t accessible to people who have experienced incarceration, especially if you are a person of color. + +### Life with Python outside of prison + +Then, on August 17, 2018, I got the surprise of my life. Then-Governor Jerry Brown commuted my 27-years-to-life sentence, and I was released from prison after serving almost 19 years. + +But here’s the reality of my situation and why I believe that programming and the open source community are so valuable. I am a 37-year-old, black, convicted felon, with no work history, who just served 18 years in prison. There aren’t many professions that exist that would prevent me from being at the mercy of the stigmas and biases that inevitably accompany my criminal past. But one of the few exceptions is programming. + +The people who are now returning back to society after incarceration are in desperate need of inclusion, but when the conversation turns to diversity in the workplace and how much it’s needed, you really don’t hear this group being mentioned or included. + +  + +> What else: +> +> 1\. Background checks: ask how they are used at your company. +> +> 2\. Entry-level roles: remove fake, unnecessary prerequisites that will exclude qualified people with records. +> +> 3\. Active outreach: partner with local re-entry programs to create hiring pipelines. [pic.twitter.com/WnzdEUTuxr][11] +> +> — Jessica McKellar (@jessicamckellar) [May 12, 2019][12] + +  + +So with that, I want to humbly challenge all of the programmers and members of the open source community to expand your thinking around inclusion and diversity. I proudly stand before you today as the representative of a demographic that most people don’t think about—formerly incarcerated people. But we exist, and we are eager to prove our value, and, above all else, we are looking to be accepted. Many challenges await us upon our reentry back into society, and I ask that you allow us to have the opportunity to demonstrate our worth. Welcome us, accept us, and, more than anything else, include us. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/prison-to-python + +作者:[Shadeed "Sha" Wallace-Stepter][a] +选题:[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/shastepter +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/books_programming_languages.jpg?itok=KJcdnXM2 (Programming books on a shelf) +[2]: https://www.dailycal.org/2019/02/27/san-quentin-rehabilitation-programs-offer-inmates-education-a-voice/ +[3]: https://twitter.com/jessicamckellar?lang=en +[4]: https://www.python.org/ +[5]: https://twitter.com/northbaypython?ref_src=twsrc%5Etfw +[6]: https://twitter.com/ShaStepter?ref_src=twsrc%5Etfw +[7]: https://twitter.com/pycon?ref_src=twsrc%5Etfw +[8]: https://t.co/Kpjo8d3ul6 +[9]: https://twitter.com/jessicamckellar/status/1191601209917837312?ref_src=twsrc%5Etfw +[10]: http://shop.oreilly.com/product/110000448.do +[11]: https://t.co/WnzdEUTuxr +[12]: https://twitter.com/jessicamckellar/status/1127640222504636416?ref_src=twsrc%5Etfw From 47cae5389da7cf4d305b6ca36f25dfb8bb0bd097 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 13 Jan 2020 00:53:18 +0800 Subject: [PATCH 326/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200112=20Use=20?= =?UTF-8?q?Stow=20for=20configuration=20management=20of=20multiple=20machi?= =?UTF-8?q?nes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200112 Use Stow for configuration management of multiple machines.md --- ...uration management of multiple machines.md | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 sources/tech/20200112 Use Stow for configuration management of multiple machines.md diff --git a/sources/tech/20200112 Use Stow for configuration management of multiple machines.md b/sources/tech/20200112 Use Stow for configuration management of multiple machines.md new file mode 100644 index 0000000000..68a1eb0ebc --- /dev/null +++ b/sources/tech/20200112 Use Stow for configuration management of multiple machines.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Stow for configuration management of multiple machines) +[#]: via: (https://opensource.com/article/20/1/configuration-management-stow) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Use Stow for configuration management of multiple machines +====== +Learn how to use Stow to manage configurations across machines in the +second article in our series on 20 ways to be more productive with open +source in 2020. +![A person programming][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Manage symlinks with Stow + +Yesterday, I explained how I keep my files in sync across multiple machines with [Syncthing][2]. But that's only one of the tools I use to keep my configurations consistent. The other is a seemingly simple tool called [Stow][3]. + +![Stow help screen][4] + +Stow manages symlinks. By default, it makes symlinks from the directory it is in to the directory below it. There are also options to set a source and target directory, but I don't usually use them. + +As I mentioned in the Syncthing [article][5], I use Syncthing to keep a directory called **myconfigs** consistent across all of my machines. The **myconfigs** directory has several subdirectories underneath it. Each subdirectory contains the configuration files for one of the applications I use regularly. + +![myconfigs directory][6] + +On each machine, I change to the **myconfigs** directory and run **stow -S <directory name>** to symlink the files inside the directory to my home directory. For example, under the **vim** directory, I have my **.vimrc** and **.vim** directories. On each machine, I run **stow -S vim** to create the symlinks **~/.vimrc** and **~/.vim**. When I make a change to my Vim configuration on one machine, it applies to ALL of my machines. + +Sometimes, though, I need something machine-specific, which is why I have directories like **msmtp-personal** and **msmtp-elastic** (my employer). Since my **msmtp** SMTP client needs to know what email server to relay through, and each one has different setups and credentials, I can use Stow to swap between the two by "unstowing" one with the **-D** flag and then putting the other in place. + +![Unstow one, stow the other][7] + +Sometimes I find myself adding files to a configuration. For that, there is the "restow" option with **-R**. For example, I like to use a specific font when I use Vim as a graphical application and not a console. The **.gvimrc** file lets me set options that apply only to the graphical version, in addition to the standard **.vimrc** file. When I first set this up, I moved **~/.gvimrc** to **~/myconfigs/vim** and then ran **stow -R vim**, which unlinks and relinks everything in that directory. + +Stow lets me switch between several configurations with a simple command line and, in combination with Syncthing, I can be sure that I have the setup I like for the tools I use ready to go, no matter where I am or where I make changes. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/configuration-management-stow + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming) +[2]: https://syncthing.net/ +[3]: https://www.gnu.org/software/stow/ +[4]: https://opensource.com/sites/default/files/uploads/productivity_2-1.png (Stow help screen) +[5]: https://opensource.com/article/20/1/20-productivity-tools-syncthing +[6]: https://opensource.com/sites/default/files/uploads/productivity_2-2.png (myconfigs directory) +[7]: https://opensource.com/sites/default/files/uploads/productivity_2-3.png (Unstow one, stow the other) From 773790f4d732b098da0a4de7b1de6cc4dd2a2d18 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 13 Jan 2020 09:00:41 +0800 Subject: [PATCH 327/430] translating --- ...ic sequences with the Linux seq command.md | 165 ------------------ ...ic sequences with the Linux seq command.md | 153 ++++++++++++++++ 2 files changed, 153 insertions(+), 165 deletions(-) delete mode 100644 sources/tech/20200107 Generating numeric sequences with the Linux seq command.md create mode 100644 translated/tech/20200107 Generating numeric sequences with the Linux seq command.md diff --git a/sources/tech/20200107 Generating numeric sequences with the Linux seq command.md b/sources/tech/20200107 Generating numeric sequences with the Linux seq command.md deleted file mode 100644 index 7ae48a2785..0000000000 --- a/sources/tech/20200107 Generating numeric sequences with the Linux seq command.md +++ /dev/null @@ -1,165 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Generating numeric sequences with the Linux seq command) -[#]: via: (https://www.networkworld.com/article/3511954/generating-numeric-sequences-with-the-linux-seq-command.html) -[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) - -Generating numeric sequences with the Linux seq command -====== -The Linux seq command can generate lists of numbers and at lightning speed. It's easy to use and flexible, too. -[Jamie][1] [(CC BY 2.0)][2] - -One of the easiest ways to generate a list of numbers in Linux is to use the **seq** (sequence) command. In its simplest form, **seq** will take a single number and then list all the numbers from 1 to that number. For example: - -``` -$ seq 5 -1 -2 -3 -4 -5 -``` - -Unless directed otherwise, **seq** always starts with 1. You can start a sequence with a different number by inserting it before the final number. - -``` -$ seq 3 5 -3 -4 -5 -``` - -### Specifying an increment - -You can also specify an increment. Say you want to list multiples of 3. Specify your starting point (first 3 in this example), increment (second 3) and end point (18). - -[][3] - -BrandPost Sponsored by HPE - -[Take the Intelligent Route with Consumption-Based Storage][3] - -Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. - -``` -$ seq 3 3 18 -3 -6 -9 -12 -15 -18 -``` - -You can elect to go from larger to smaller numbers by using a negative increment (i.e., a decrement). - -``` -$ seq 18 -3 3 -18 -15 -12 -9 -6 -3 -``` - -The **seq** command is also very fast. You can probably generate a list of a million numbers in under 10 seconds. - -Advertisement - -``` -$ time seq 1000000 -1 -2 -3 -… -… -999998 -999999 -1000000 - -real 0m9.290s <== 9+ seconds -user 0m0.020s -sys 0m0.899s -``` - -## Using a separator - -Another very useful option is to use a separator. Instead of listing a single number on each line, you can insert commas, colons or some other characters. The -s option followed by the character you wish to use. - -``` -$ seq -s: 3 3 18 -3:6:9:12:15:18 -``` - -In fact, if you simply want your numbers to be listed on a single line, you can use a blank as your separator in place of the default linefeed. - -**[ Also see [Invaluable tips and tricks for troubleshooting Linux][4]. ]** - -``` -$ seq -s' ' 3 3 18 -3 6 9 12 15 18 -``` - -### Getting to the math - -It may seem like a big leap to go from generating a sequence of numbers to doing math, but given the right separators, **seq** can easily prepare calculations that you can pass to **bc**. For example: - -``` -$ seq -s* 5 | bc -120 -``` - -What is going on in this command? Let’s take a look. First, **seq** is generating a list of numbers and using * as the separator. - -``` -$ seq -s* 5 -1*2*3*4*5 -``` - -It’s then passing the string to the calculator (**bc**) which promptly multiplies the numbers. And you can do a fairly extensive calculation in a fraction of a second. - -``` -$ time seq -s* 117 | bc -39699371608087208954019596294986306477904063601683223011297484643104\ -22041758630649341780708631240196854767624444057168110272995649603642\ -560353748940315749184568295424000000000000000000000000000 - -real 0m0.003s -user 0m0.004s -sys 0m0.000s -``` - -### Limitations - -You only get to choose one separator, so your calculations will be very limited. Use **bc** by itself for more complicated math. In addition, **seq** only works with numbers. To generate a sequence of single letters, use a command like this instead: - -``` -$ echo {a..g} -a b c d e f g -``` - -Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3511954/generating-numeric-sequences-with-the-linux-seq-command.html - -作者:[Sandra Henry-Stocker][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ -[b]: https://github.com/lujun9972 -[1]: https://creativecommons.org/licenses/by/2.0/ -[2]: https://creativecommons.org/licenses/by/2.0/legalcode -[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) -[4]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html -[5]: https://www.facebook.com/NetworkWorld/ -[6]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20200107 Generating numeric sequences with the Linux seq command.md b/translated/tech/20200107 Generating numeric sequences with the Linux seq command.md new file mode 100644 index 0000000000..0b12dfb508 --- /dev/null +++ b/translated/tech/20200107 Generating numeric sequences with the Linux seq command.md @@ -0,0 +1,153 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Generating numeric sequences with the Linux seq command) +[#]: via: (https://www.networkworld.com/article/3511954/generating-numeric-sequences-with-the-linux-seq-command.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +使用 Linux seq 命令生成数字序列 +====== +Linux seq 命令可以以闪电般的速度生成数字列表。它易于使用而且灵活。 +[Jamie][1] [(CC BY 2.0)][2] + +在 Linux 中生成数字列表的最简单方法之一是使用 **seq**(sequence)命令。最简单的形式是,**seq** 接收一个数字,并输出从 1 到该数字的列表。例如: + +``` +$ seq 5 +1 +2 +3 +4 +5 +``` + +除非另有指定,否则 **seq** 始终以 1 开头。你可以在最终数字前面插上不同数字开始。 + +``` +$ seq 3 5 +3 +4 +5 +``` + +### 指定增量 + +你还可以指定增量。假设你要列出 3 的倍数。指定起点(在此示例中为第一个 3 ),增量(第二个 3)和终点(18)。 + +``` +$ seq 3 3 18 +3 +6 +9 +12 +15 +18 +``` + +你可以选择使用负增量(即减量)将数字从大变小。 + +``` +$ seq 18 -3 3 +18 +15 +12 +9 +6 +3 +``` + +**seq** 命令也非常快。你或许可以在 10 秒内生成一百万个数字的列表。 + +Advertisement + +``` +$ time seq 1000000 +1 +2 +3 +… +… +999998 +999999 +1000000 + +real 0m9.290s <== 9+ seconds +user 0m0.020s +sys 0m0.899s +``` + +## 使用分隔符 + +另一个非常有用的选项是使用分隔符。你可以插入逗号,冒号或其他一些字符,而不是在每行上列出单个数字。-s 选项后跟要使用的字符。 + +``` +$ seq -s: 3 3 18 +3:6:9:12:15:18 +``` + +实际上,如果只是希望将数字列在一行上,那么可以使用空格代替默认的换行符。 + +``` +$ seq -s' ' 3 3 18 +3 6 9 12 15 18 +``` + +### 开始数学运算 + +从生成数字序列到进行数学运算似乎是一个巨大的飞跃,但是有了正确的分隔符,**seq** 可以轻松地传递给 **bc** 进行计算。例如: + +``` +$ seq -s* 5 | bc +120 +``` + +该命令中发生了什么?让我们来看看。首先,**seq** 生成一个数字列表,并使用 \* 作为分隔符。 + +``` +$ seq -s* 5 +1*2*3*4*5 +``` + +然后,它将字符串传递给计算器 (**bc**),计算器立即将数字相乘。你可以在不到一秒的时间内进行相当广泛的计算。 + +``` +$ time seq -s* 117 | bc +39699371608087208954019596294986306477904063601683223011297484643104\ +22041758630649341780708631240196854767624444057168110272995649603642\ +560353748940315749184568295424000000000000000000000000000 + +real 0m0.003s +user 0m0.004s +sys 0m0.000s +``` + +### 局限性 + +你只能选择一个分隔符,因此计算将非常有限。单独使用 **bc** 可进行更复杂的数学运算。此外,**seq** 仅适用于数字。要生成单个字母序列,请改用如下命令: + +``` +$ echo {a..g} +a b c d e f g +``` + +加入 [Facebook][5] 和 [LinkedIn][6] 上的 Network World 社区,评论热门主题。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3511954/generating-numeric-sequences-with-the-linux-seq-command.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://creativecommons.org/licenses/by/2.0/ +[2]: https://creativecommons.org/licenses/by/2.0/legalcode +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 0bd08ea3ea61f05e9c26a8a5d88480ebb7dae16a Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 13 Jan 2020 09:05:58 +0800 Subject: [PATCH 328/430] translating --- ...0200111 Sync files across multiple devices with Syncthing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200111 Sync files across multiple devices with Syncthing.md b/sources/tech/20200111 Sync files across multiple devices with Syncthing.md index 75c6161189..d662fc1a78 100644 --- a/sources/tech/20200111 Sync files across multiple devices with Syncthing.md +++ b/sources/tech/20200111 Sync files across multiple devices with Syncthing.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 753e745388fb59dcf9ef49365286c9f9987b132a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Jan 2020 09:06:51 +0800 Subject: [PATCH 329/430] PRF @geekpi --- ...VLC More Awesome With These Simple Tips.md | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/translated/tech/20191214 Make VLC More Awesome With These Simple Tips.md b/translated/tech/20191214 Make VLC More Awesome With These Simple Tips.md index 7363cb7992..350fa16604 100644 --- a/translated/tech/20191214 Make VLC More Awesome With These Simple Tips.md +++ b/translated/tech/20191214 Make VLC More Awesome With These Simple Tips.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Make VLC More Awesome With These Simple Tips) @@ -10,20 +10,19 @@ 这些简单的技巧使 VLC 更加出色 ====== -如果 [VLC][1] 不是最好的播放器,那它是[最好的开源视频播放器][2]之一。大多数人不知道的是,它不仅仅是视频播放器。 +如果 [VLC][1] 不是最好的播放器,那它也是[最好的开源视频播放器][2]之一。大多数人不知道的是,它不仅仅是视频播放器。 你可以进行许多复杂的任务,如直播视频、捕捉设备等。只需打开菜单,你就可以看到它有多少选项。 -它的 FOSS 页面有一个详细的教程,讨论一些[专业的 VLC 技巧][3],但这些对于普通用户太复杂。 +我们有一个详细的教程,讨论一些[专业的 VLC 技巧][3],但这些对于普通用户太复杂。 -这就是为什么我写另一篇文章的原因,来向你展示一些可以在 VLC 中使用的简单技巧。 +这就是为什么我要写另一篇文章的原因,来向你展示一些可以在 VLC 中使用的简单技巧。 ### 使用这些简单技巧让 VLC 做更多事 -Let’s see what can you do with VLC other than just playing a video file. 让我们看看除了播放视频文件之外,你还可以使用 VLC 做什么。 -#### 1\. 使用 VLC 观看 YouTube 视频 +#### 1、使用 VLC 观看 YouTube 视频 ![][4] @@ -31,65 +30,60 @@ Let’s see what can you do with VLC other than just playing a video file. 是的,在 VLC 上流式传输 YouTube 视频是非常容易的。 -只需启动 VLC 播放器,前往媒体设置,然后单击 ”**Open Network Stream**“ 或使用快捷方式 **CTRL + N**。 +只需启动 VLC 播放器,前往媒体设置,然后单击 ”Open Network Stream“ 或使用快捷方式 `CTRL + N`。 ![][6] -接下来,你只需要粘贴要观看的视频的 URL。有一些选项可以调整,但通常你无需担心这些。如果你好奇,你可以点击 ”**Advanced options**“ 来探索。 +接下来,你只需要粘贴要观看的视频的 URL。有一些选项可以调整,但通常你无需担心这些。如果你好奇,你可以点击 ”Advanced options“ 来探索。 你还可以通过这种方式向 YouTube 视频添加字幕。然而,[一个更简单的带字幕观看 Youtube 视频的办法是使用 Penguin 字幕播放器][7]。 -#### 2\. 将视频转换为不同格式 +#### 2、将视频转换为不同格式 ![][8] 你可以[在 Linux 命令行使用 ffmpeg 转换视频][9]。你还可以使用图形工具,如 [HandBrake 转换视频格式][10]。 -但是,如果你不想用一个单独的应用转码视频,你可以使用 VLC 播放器来完成该工作。 +但是,如果你不想用一个单独的应用来转码视频,你可以使用 VLC 播放器来完成该工作。 -为此,只需点击 VLC 上的媒体选项,然后单击 **Convert/Save**,或者在 VLC 播放器处于活动状态时按下快捷键 CTRL + R。 +为此,只需点击 VLC 上的媒体选项,然后单击 “Convert/Save”,或者在 VLC 播放器处于活动状态时按下快捷键 `CTRL + R`。接下来,你需要从计算机/硬盘或者 URL 导入你想保存/转换的的视频。 -接下来,你需要从计算机/硬盘或者 URL 导入你想保存/转换的的视频。 - -不管什么来源,只需选择文件后点击 ”**Convert/Save**“ 按钮 - -你现在会看到另外一个窗口给你更改 ”**Profile**“ 设置。点击并选择你想转换的格式(并保存)。 +不管是什么来源,只需选择文件后点击 “Convert/Save” 按钮。你现在会看到另外一个窗口可以更改 “Profile” 设置。点击并选择你想转换的格式(并保存)。 你还可以在转换之前通过在屏幕底部设置目标文件夹来更改转换文件的存储路径。 -#### 3\. 从源录制音频/视频 +#### 3、从源录制音频/视频 ![Vlc Advanced Controls][11] 你是否想在 VLC 播放器中录制正在播放的音频/视频? -如果是的话,有一个简单的解决方案。只需**通过 View,然后点击 ”Advanced Controls“**。 +如果是的话,有一个简单的解决方案。只需通过 “View”,然后点击 “Advanced Controls”。 完成后,你会看到一个新按钮(包括 VLC 播放器中的红色录制按钮)。 -#### 4\. 自动下载字幕 +#### 4、自动下载字幕 ![][12] -是的,你可以[使用 VLC 自动下载字幕][13]。你甚至不必在单独的网站上查找字幕。你只需点击 **View->VLSub**。 +是的,你可以[使用 VLC 自动下载字幕][13]。你甚至不必在单独的网站上查找字幕。你只需点击 +“View”->“VLSub”。 默认情况下,它是禁用的,因此当你单击该选项时,它会被激活,并允许你搜索/下载想要的字幕。 [VLC 还能让你使用简单的键盘快捷键同步字幕][14] -#### 5\. 截图 +#### 5、截图 ![][15] -你可以在观看视频时使用 VLC 获取一些视频的截图/图像。 - -你只需在视频播放/暂停时右击播放器,你会看到一组选项,点击 **Video->Take Snapshot**。 +你可以在观看视频时使用 VLC 获取一些视频的截图/图像。你只需在视频播放/暂停时右击播放器,你会看到一组选项,点击 “Video”->“Take Snapshot”。 如果安装了旧版本,你可能在右键时看到截图选项。 #### 额外技巧:给视频添加音频/视频效果 -在菜单中,进入 ”**Tools**“ 选项。单击 ”**Effects and Filters**“,或者在 VLC 播放器窗口中按 **CTRL + E** 打开选项。 +在菜单中,进入 “Tools” 选项。单击 “Effects and Filters”,或者在 VLC 播放器窗口中按 `CTRL + E` 打开选项。 好了,你可以观察你给视频添加的音频和视频效果了。你也许无法实时看到效果,因此你需要调整并保存来看发生了什么。 @@ -108,7 +102,7 @@ via: https://itsfoss.com/simple-vlc-tips/ 作者:[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 ad881c80d06f0bf4e17d7e676e08359696bede69 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Jan 2020 09:08:08 +0800 Subject: [PATCH 330/430] PUB @geekpi https://linux.cn/article-11776-1.html --- ...20191214 Make VLC More Awesome With These Simple Tips.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191214 Make VLC More Awesome With These Simple Tips.md (97%) diff --git a/translated/tech/20191214 Make VLC More Awesome With These Simple Tips.md b/published/20191214 Make VLC More Awesome With These Simple Tips.md similarity index 97% rename from translated/tech/20191214 Make VLC More Awesome With These Simple Tips.md rename to published/20191214 Make VLC More Awesome With These Simple Tips.md index 350fa16604..3bb170df03 100644 --- a/translated/tech/20191214 Make VLC More Awesome With These Simple Tips.md +++ b/published/20191214 Make VLC More Awesome With These Simple Tips.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11776-1.html) [#]: subject: (Make VLC More Awesome With These Simple Tips) [#]: via: (https://itsfoss.com/simple-vlc-tips/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) @@ -10,6 +10,8 @@ 这些简单的技巧使 VLC 更加出色 ====== +![](https://img.linux.net.cn/data/attachment/album/202001/13/090635eu9va9999rr4ue92.jpeg) + 如果 [VLC][1] 不是最好的播放器,那它也是[最好的开源视频播放器][2]之一。大多数人不知道的是,它不仅仅是视频播放器。 你可以进行许多复杂的任务,如直播视频、捕捉设备等。只需打开菜单,你就可以看到它有多少选项。 From 622d09bde11060169652ebba0b1ae948989a7ab1 Mon Sep 17 00:00:00 2001 From: qianmingtian <40565099+qianmingtian@users.noreply.github.com> Date: Mon, 13 Jan 2020 13:10:30 +0800 Subject: [PATCH 331/430] Translating by qianmingtian --- ...d eMail With a List of User Accounts Expiring in -X- Days.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md b/sources/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md index 1b3330a6e8..efc52e33f9 100644 --- a/sources/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md +++ b/sources/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qianmingtian) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c36faf34d18c4363c7011a8bb6e9bcb7cbe86c24 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Jan 2020 15:13:06 +0800 Subject: [PATCH 332/430] PRF @lxbwolf --- ... Lessons learned from programming in Go.md | 116 +++++++++--------- 1 file changed, 59 insertions(+), 57 deletions(-) diff --git a/translated/tech/20191210 Lessons learned from programming in Go.md b/translated/tech/20191210 Lessons learned from programming in Go.md index 0c17e142a8..aeef69681e 100644 --- a/translated/tech/20191210 Lessons learned from programming in Go.md +++ b/translated/tech/20191210 Lessons learned from programming in Go.md @@ -1,63 +1,65 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Lessons learned from programming in Go) [#]: via: (https://opensource.com/article/19/12/go-common-pitfalls) [#]: author: (Eduardo Ferreira https://opensource.com/users/edufgf) -Go 编程中的经验教训 +Go 并发编程中的经验教训 ====== -通过学习如何定位并发处理的陷阱来避免未来处理这些问题时的困境。 -![Goland gopher illustration][1] -在复杂的分布式系统进行任务处理时,你通常会需要进行并发的操作。[Mode.net][2] 公司系统每天要处理实时、快速和灵活的以毫秒为单位动态路由数据包的全球专用网络和数据,需要高度并发的系统。这个动态路由是基于网络状态的,而这个过程需要考虑众多因素,我们只考虑关系链的监控。在我们的环境中,调用关系链监控可以是任何跟网络调用关系链有关的状态和当前属性(如链接延迟)。 +> 通过学习如何定位并发处理的陷阱来避免未来处理这些问题时的困境。 + +![](https://img.linux.net.cn/data/attachment/album/202001/13/150539n217ak1vcf717uzx.jpg) + +在复杂的分布式系统进行任务处理时,你通常会需要进行并发的操作。在 [Mode.net][2] 公司,我们每天都要和实时、快速和灵活的软件打交道。而没有一个高度并发的系统,就不可能构建一个毫秒级的动态地路由数据包的全球专用网络。这个动态路由是基于网络状态的,尽管这个过程需要考虑众多因素,但我们的重点是链路指标。在我们的环境中,链路指标可以是任何跟网络链接的状态和当前属性(如链接延迟)有关的任何内容。 ### 并发探测链接监控 -[H.A.L.O.][4] (Hop-by-Hop Adaptive Link-State Optimal Routing,译注:逐跳自适应链路状态最佳路由),我们的动态路由算法部分依赖于链路度量来计算路由表。 这些指标由位于每个PoP(译注:存活节点)上的独立组件收集。PoP是表示我们的网络中单个路由实体的机器,通过链路连接并分布在我们的网络拓扑中的各个位置。某个组件使用网络数据包探测周围的机器,周围的机器回复数据包给前者。从接收到的探测包中可以获得链路延迟。由于每个 PoP 都有不止一个临近节点,所以这种探测任务实质上是并发的:我们需要实时测量每个临近连接点的延迟。我们不能串行地处理;为了计算这个指标,必须尽快处理每个探针。 +我们的动态路由算法 [H.A.L.O.][4](逐跳自适应链路状态最佳路由Hop-by-Hop Adaptive Link-State Optimal Routing)部分依赖于链路指标来计算路由表。这些指标由位于每个 PoP(存活节点Point of Presence)上的独立组件收集。PoP 是表示我们的网络中单个路由实体的机器,通过链路连接并分布在我们的网络拓扑中的各个位置。某个组件使用网络数据包探测周围的机器,周围的机器回复数据包给前者。从接收到的探测包中可以获得链路延迟。由于每个 PoP 都有不止一个临近节点,所以这种探测任务实质上是并发的:我们需要实时测量每个临近连接点的延迟。我们不能串行地处理;为了计算这个指标,必须尽快处理每个探测。 ![latency computation graph][6] -### 序列号和重置:一个记录场景 +### 序列号和重置:一个重新排列场景 -我们的探测组件互相发送和接收数据包并依靠序列号进行数据包处理。旨在避免处理重复的包或顺序被打乱的包。我们的第一个实现依靠特殊的序列号 0 来重置序列号。这个数字仅在组件初始化时使用。主要的问题是我们只考虑了始终从 0 开始递增的序列号。组件重启后,包的顺序可能会重新排列,某个包的序列号可能会轻易地被替换成重置之前使用过的值。这意味着,直到排到重置之前用到的值之前,它后面的包都会被忽略掉。 +我们的探测组件互相发送和接收数据包,并依靠序列号进行数据包处理。这旨在避免处理重复的包或顺序被打乱的包。我们的第一个实现依靠特殊的序列号 0 来重置序列号。这个数字仅在组件初始化时使用。主要的问题是我们考虑了递增的序列号总是从 0 开始。在该组件重启后,包的顺序可能会重新排列,某个包的序列号可能会轻易地被替换成重置之前使用过的值。这意味着,后继的包都会被忽略掉,直到排到重置之前用到的序列值。 ### UDP 握手和有限状态机 -这里的问题是重启前后的序列号是否一致。有几种方法可以解决这个问题,经过讨论,我们选择了实现一个带有清晰状态定义的三向交握协议。这个握手过程在初始化时通过链接建立 session。这样可以确保节点通过同一个 session 进行通信且使用了适当的序列号。 +这里的问题是该组件重启前后的序列号是否一致。有几种方法可以解决这个问题,经过讨论,我们选择了实现一个带有清晰状态定义的三步握手协议。这个握手过程在初始化时通过链接建立会话。这样可以确保节点通过同一个会话进行通信且使用了适当的序列号。 为了正确实现这个过程,我们必须定义一个有清晰状态和过渡的有限状态机。这样我们就可以正确管理握手过程中的所有极端情况。 ![finite state machine diagram][7] -session ID 由握手的初始化程序生成。一个完整的交换顺序如下: +会话 ID 由握手的初始化程序生成。一个完整的交换顺序如下: - 1. sender 发送一个 **SYN (ID)** 数据包。 - 2. receiver 存储接收到的 **ID** 并发送一个 **SYN-ACK (ID)**. - 3. sender 接收到 **SYN-ACK (ID)** _并发送一个 **ACK (ID)**_。它还发送一个从序列号 0 开始的数据包。 - 4. receiver 检查最后接收到的 **ID**,如果 ID 匹配,_则接受 **ACK (ID)**_。它还开始接受序列号为 0 的数据包。 +1. 发送者发送一个 `SYN(ID)` 数据包。 +2. 接收者存储接收到的 `ID` 并发送一个 `SYN-ACK(ID)`。 +3. 发送者接收到 `SYN-ACK(ID)` 并发送一个 `ACK(ID)`。它还发送一个从序列号 0 开始的数据包。 +4. 接收者检查最后接收到的 `ID`,如果 ID 匹配,则接受 `ACK(ID)`。它还开始接受序列号为 0 的数据包。 ### 处理状态超时 基本上,每种状态下你都需要处理最多三种类型的事件:链接事件、数据包事件和超时事件。这些事件会并发地出现,因此你必须正确处理并发。 - * 链接事件包括连接和断开,连接时会初始化一个链接 session,断开时会断开一个已建立的 seesion。 - * 数据包事件是控制数据包 **(SYN/SYN-ACK/ACK)** 或只是探测响应。 - * 超时事件在当前 session 状态的预定超时时间到期后触发。 +* 链接事件包括网络连接或网络断开的变化,相应的初始化一个链接会话或断开一个已建立的会话。 +* 数据包事件是控制数据包(`SYN`/`SYN-ACK`/`ACK`)或只是探测响应。 +* 超时事件在当前会话状态的预定超时时间到期后触发。 -这里面临的最主要的问题是如何处理并发超时到期和其他事件。这里很容易陷入死锁和资源竞争的陷阱。 +这里面临的最主要的问题是如何处理并发的超时到期和其他事件。这里很容易陷入死锁和资源竞争的陷阱。 ### 第一种方法 -本项目使用的语言是 [Golang][8]. 它确实提供了原生的同步机制,如自带的 channel 和锁,并且能够使用轻量级线程来进行并发处理。 +本项目使用的语言是 [Golang][8]。它确实提供了原生的同步机制,如自带的通道和锁,并且能够使用轻量级线程来进行并发处理。 ![gophers hacking together][9] -gopher 们聚众狂欢 +*gopher 们聚众狂欢* -首先,你可以设计两个分别表示我们的 **Session** 和 **Timeout Handlers** 的结构体。 +首先,你可以设计两个分别表示我们的会话和超时处理程序的结构体。 ```go type Session struct {   @@ -74,14 +76,14 @@ type TimeoutHandler struct {   } ``` -**Session** 标识连接 session,内有表示 session ID、临近的连接点的 IP 和当前 session 状态的字段。 +`Session` 标识连接会话,内有表示会话 ID、临近的连接点的 IP 和当前会话状态的字段。 -**TimeoutHandler** 包含回调函数、对应的 session、持续时间和指向调度计时器的 timer 指针。 +`TimeoutHandler` 包含回调函数、对应的会话、持续时间和指向调度计时器的指针。 -每一个临近连接点的 session 都包含一个保存调度 `TimeoutHandler` 的全局 map。 +每一个临近连接点的会话都包含一个保存调度 `TimeoutHandler` 的全局映射。 ``` -`SessionTimeout map[Session]*TimeoutHandler` +SessionTimeout map[Session]*TimeoutHandler ``` 下面方法注册和取消超时: @@ -118,7 +120,7 @@ func CreateTimeoutHandler(callback func(Session), session Session, duration int) } ``` -超时 handler 创建后,会在经过了设置的 _duration_ 时间(秒)后执行回调函数。然而,有些事件会使你重新调度一个超时 handler(与 **SYN** 状态时的处理一样 — 每 3 秒一次)。 +超时处理程序创建后,会在经过了设置的 `duration` 时间(秒)后执行回调函数。然而,有些事件会使你重新调度一个超时处理程序(与 `SYN` 状态时的处理一样,每 3 秒一次)。 为此,你可以让回调函数重新调度一次超时: @@ -134,25 +136,25 @@ func synCallback(session Session) {   } ``` -这次回调在新的超时 handler 中重新调度自己,并更新全局 map **sessionTimeout**。 +这次回调在新的超时处理程序中重新调度自己,并更新全局映射 `sessionTimeout`。 ### 数据竞争和引用 -你的解决方案已经有了。可以通过检查计时器到期后超时回调是否执行来进行一个简单的测试。为此,注册一个超时,在 *duration* 时间内 sleep,然后检查是否执行了回调的处理。执行这个测试后,最好取消预定的超时时间(因为它会重新调度),这样才不会在下次测试时产生副作用。 +你的解决方案已经有了。可以通过检查计时器到期后超时回调是否执行来进行一个简单的测试。为此,注册一个超时,休眠 `duration` 秒,然后检查是否执行了回调的处理。执行这个测试后,最好取消预定的超时时间(因为它会重新调度),这样才不会在下次测试时产生副作用。 -令人惊讶的是,这个简单的测试发现了这个解决方案中的一个 bug。使用 cancel 方法来取消超时并没有正确处理。以下顺序的事件会导致数据资源竞争: +令人惊讶的是,这个简单的测试发现了这个解决方案中的一个问题。使用 `cancel` 方法来取消超时并没有正确处理。以下顺序的事件会导致数据资源竞争: - 1. 你有一个已调度的超时 handler。 - 2. 线程 1: -a)你接收到一个控制数据包,现在你要取消已注册的超时并切换到下一个 session 状态(如 发送 **SYN** 后接收到一个 **SYN-ACK**) -b)你调用了 **timeout.Cancel()**,这个函数调用了 **timer.Stop()**。(请注意,Golang 计时器的 stop 不会终止一个已过期的计时器。) - 3. 线程 2: -a)在调用 cancel 之前,计时器已过期,回调即将执行。 -b)执行回调,它调度一次新的超时并更新全局 map。 - 4. 线程 1: -a)切换到新的 session 状态并注册新的超时,更新全局 map。 +1. 你有一个已调度的超时处理程序。 +2. 线程 1: + 1. 你接收到一个控制数据包,现在你要取消已注册的超时并切换到下一个会话状态(如发送 `SYN` 后接收到一个 `SYN-ACK`) + 2. 你调用了 `timeout.Cancel()`,这个函数调用了 `timer.Stop()`。(请注意,Golang 计时器的停止不会终止一个已过期的计时器。) +3. 线程 2: + 1. 在取消调用之前,计时器已过期,回调即将执行。 + 2. 执行回调,它调度一次新的超时并更新全局映射。 +4. 线程 1: + 1. 切换到新的会话状态并注册新的超时,更新全局映射。 -两个线程同时更新超时 map。最终结果是你无法取消注册的超时,然后你也会丢失对线程 2 重新调度的超时的引用。这导致 handler 在一段时间内持续执行和重新调度,出现非预期行为。 +两个线程并发地更新超时映射。最终结果是你无法取消注册的超时,然后你也会丢失对线程 2 重新调度的超时的引用。这导致处理程序在一段时间内持续执行和重新调度,出现非预期行为。 ### 锁也解决不了问题 @@ -169,15 +171,15 @@ func (timeout* TimeoutHandler) Register() {   } ``` -现在的区别就是全局 map 的更新是同步的,但是这还是不能阻止在你调用 **timeout.Cancel() ** 后回调的执行 — 这种情况出现在调度计时器过期了但是还没有拿到锁的时候。你还是会丢失一个已注册的超时的引用。 +现在的区别就是全局映射的更新是同步的,但是这还是不能阻止在你调用 `timeout.Cancel()` 后回调的执行 —— 这种情况出现在调度计时器过期了但是还没有拿到锁的时候。你还是会丢失一个已注册的超时的引用。 -### 使用取消 channel +### 使用取消通道 -你可以使用取消 channel,而不必依赖不能阻止到期的计时器执行的 golang 函数 **timer.Stop()**。 +你可以使用取消通道,而不必依赖不能阻止到期的计时器执行的 golang 函数 `timer.Stop()`。 这是一个略有不同的方法。现在你可以不用再通过回调进行递归地重新调度;而是注册一个死循环,这个循环接收到取消信号或超时事件时终止。 -新的 **Register()** 产生一个新的 go 协程,这个协程在在超时后执行你的回调,并在前一个超时执行后调度新的超时。返回给调用方一个取消 channel,用来控制循环的终止。 +新的 `Register()` 产生一个新的 go 线程,这个线程在超时后执行你的回调,并在前一个超时执行后调度新的超时。返回给调用方一个取消通道,用来控制循环的终止。 ```go func (timeout *TimeoutHandler) Register() chan struct{} {   @@ -208,9 +210,9 @@ func (timeout* TimeoutHandler) Cancel() {   } ``` -这个方法提供了你注册的所有超时的取消 channel。对 cancel 的一次调用向 channel 发送一个空结构体并触发取消操作。然而,这并不能解决前面的问题;可能在你通过 channel 调用 cancel 超时线程还没有拿到锁之前,超时时间就已经到了。 +这个方法给你注册的所有超时提供了取消通道。一个取消调用向通道发送一个空结构体并触发取消操作。然而,这并不能解决前面的问题;可能在你通过通道取消之前以及超时线程拿到锁之前,超时时间就已经到了。 -这里的解决方案是,在拿到锁之后,检查一下超时范围内的取消 channel。 +这里的解决方案是,在拿到锁**之后**,检查一下超时范围内的取消通道。 ```go   case _ = <- time.AfterFunc(time.Duration(timeout.duration) * time.Second):   @@ -236,15 +238,15 @@ func (timeout* TimeoutHandler) Cancel() {   请阅读上面的代码,试着自己找到它。考虑下描述的所有函数的并发调用。 -这里的问题在取消 channel 本身。我们创建的是无缓冲 channel,即发送是阻塞调用。当你在一个超时 handler 中调用取消函数时,只有在该 handler 被取消后才能继续处理。问题出现在,当你有多个调用请求到同一个取消 channel 时,这时一个取消请求只被处理一次。当多个事件同时取消同一个超时 handler 时,如链接断开或控制包事件,很容易出现这种情况。这会导致死锁,可能会使应用程序 halt。 +这里的问题在取消通道本身。我们创建的是无缓冲通道,即发送的是阻塞调用。当你在一个超时处理程序中调用取消函数时,只有在该处理程序被取消后才能继续处理。问题出现在,当你有多个调用请求到同一个取消通道时,这时一个取消请求只被处理一次。当多个事件同时取消同一个超时处理程序时,如连接断开或控制包事件,很容易出现这种情况。这会导致死锁,可能会使应用程序停机。 ![gophers on a wire, talking][11] -有人在听吗? +*有人在听吗?* -已获得 Trevor Forrey 授权。 +(已获得 Trevor Forrey 授权。) -这里的解决方案是创建 channel 时指定大小至少为 1,这样向 channel 发送数据就不会阻塞,也显式地使发送变成非阻塞的,避免了并发调用。这样可以确保取消操作只发送一次,并且不会阻塞后续的取消调用。 +这里的解决方案是创建通道时指定缓存大小至少为 1,这样向通道发送数据就不会阻塞,也显式地使发送变成非阻塞的,避免了并发调用。这样可以确保取消操作只发送一次,并且不会阻塞后续的取消调用。 ```go func (timeout* TimeoutHandler) Cancel() {   @@ -266,27 +268,27 @@ func (timeout* TimeoutHandler) Cancel() {   #### 在非同步的情况下更新共享数据 -这似乎是个很明显的问题,但如果并发更新发生在不同的位置,就很难发现。结果就是数据竞争,由于一个更新会覆盖另一个,因此对同一数据的多次更新中会有某些更新丢失。在我们的案例中,我们是在同时更新同一个共享 map 里的调度超时引用。有趣的是,(如果 Go 检测到在同一个 map 对象上的并发读写,会抛出 fatal 错误 — 你可以尝试下运行 Go 的[数据竞争检测器](https://golang.org/doc/articles/race_detector.html))。这最终会导致丢失超时引用,且无法取消给定的超时。当有必要时,永远不要忘记使用锁。 +这似乎是个很明显的问题,但如果并发更新发生在不同的位置,就很难发现。结果就是数据竞争,由于一个更新会覆盖另一个,因此对同一数据的多次更新中会有某些更新丢失。在我们的案例中,我们是在同时更新同一个共享映射里的调度超时引用。(有趣的是,如果 Go 检测到在同一个映射对象上的并发读写,会抛出致命错误 — 你可以尝试下运行 Go 的[数据竞争检测器](https://golang.org/doc/articles/race_detector.html))。这最终会导致丢失超时引用,且无法取消给定的超时。当有必要时,永远不要忘记使用锁。 ![gopher assembly line][13] -不要忘记同步 gopher 们的工作 +*不要忘记同步 gopher 们的工作* #### 缺少条件检查 -在不能仅依赖锁的独占性的情况下,就需要进行条件检查。我们遇到的场景稍微有点不一样,但是核心思想跟[条件变量][14]是一样的。假设有个经典的一个生产者和多个消费者使用一个共享队列的场景,生产者可以将一个元素添加到队列并唤醒所有消费者。这个唤醒调用意味着队列中的数据是可访问的,并且由于队列是共享的,消费者必须通过锁来进行同步访问。每个消费者都可能拿到锁;然而,你仍然需要检查队列中是否有元素。因为在你拿到锁的瞬间并不知道队列的状态,所以还是需要进行条件检查。 +在不能仅依赖锁的独占性的情况下,就需要进行条件检查。我们遇到的场景稍微有点不一样,但是核心思想跟[条件变量][14]是一样的。假设有个一个生产者和多个消费者使用一个共享队列的经典场景,生产者可以将一个元素添加到队列并唤醒所有消费者。这个唤醒调用意味着队列中的数据是可访问的,并且由于队列是共享的,消费者必须通过锁来进行同步访问。每个消费者都可能拿到锁;然而,你仍然需要检查队列中是否有元素。因为在你拿到锁的瞬间并不知道队列的状态,所以还是需要进行条件检查。 -在我们的例子中,超时 handler 收到了计时器到期时发出的「唤醒」调用,但是它仍需要检查是否已向其发送了取消信号,然后才能继续执行回调。 +在我们的例子中,超时处理程序收到了计时器到期时发出的“唤醒”调用,但是它仍需要检查是否已向其发送了取消信号,然后才能继续执行回调。 ![gopher boot camp][15] -如果你要唤醒多个 gopher,可能就需要进行条件检查 +*如果你要唤醒多个 gopher,可能就需要进行条件检查* #### 死锁 -当一个线程被卡住,无限期地等待一个唤醒信号,但是这个信号永远不会到达时,就会发生这种情况。死锁可以通过让你的整个程序 halt 来彻底杀死你的应用。 +当一个线程被卡住,无限期地等待一个唤醒信号,但是这个信号永远不会到达时,就会发生这种情况。死锁可以通过让你的整个程序停机来彻底杀死你的应用。 -在我们的案例中,这种情况的发生是由于多次发送请求到一个非缓冲且阻塞的 channel。这意味着向 channel 发送数据只有在从这个 channel 接收完数据后才能 return。我们的超时线程循环迅速从取消 channel 接收信号;然而,在接收到第一个信号后,它将跳出循环,并且再也不会从这个 channel 读取数据。其他的调用会一直被卡住。为避免这种情况,你需要仔细检查代码,谨慎处理阻塞调用,并确保不会发生线程饥饿。我们例子中的解决方法是使取消调用成为非阻塞调用 — 我们不需要阻塞调用。 +在我们的案例中,这种情况的发生是由于多次发送请求到一个非缓冲且阻塞的通道。这意味着向通道发送数据只有在从这个通道接收完数据后才能返回。我们的超时线程循环迅速从取消通道接收信号;然而,在接收到第一个信号后,它将跳出循环,并且再也不会从这个通道读取数据。其他的调用会一直被卡住。为避免这种情况,你需要仔细检查代码,谨慎处理阻塞调用,并确保不会发生线程饥饿。我们例子中的解决方法是使取消调用成为非阻塞调用 — 我们不需要阻塞调用。 -------------------------------------------------------------------------------- @@ -295,7 +297,7 @@ via: https://opensource.com/article/19/12/go-common-pitfalls 作者:[Eduardo Ferreira][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0bec37da27bfe29e70dd019bc8ee083f94fe8ac1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Jan 2020 15:15:06 +0800 Subject: [PATCH 333/430] PUB @lxbwolf https://linux.cn/article-11778-1.html --- .../20191210 Lessons learned from programming in Go.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191210 Lessons learned from programming in Go.md (99%) diff --git a/translated/tech/20191210 Lessons learned from programming in Go.md b/published/20191210 Lessons learned from programming in Go.md similarity index 99% rename from translated/tech/20191210 Lessons learned from programming in Go.md rename to published/20191210 Lessons learned from programming in Go.md index aeef69681e..3c5e495b89 100644 --- a/translated/tech/20191210 Lessons learned from programming in Go.md +++ b/published/20191210 Lessons learned from programming in Go.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (lxbwolf) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11778-1.html) [#]: subject: (Lessons learned from programming in Go) [#]: via: (https://opensource.com/article/19/12/go-common-pitfalls) [#]: author: (Eduardo Ferreira https://opensource.com/users/edufgf) From 35320cdc6d9098c684ddde01089a3435a7f67114 Mon Sep 17 00:00:00 2001 From: qianmingtian Date: Mon, 13 Jan 2020 21:06:23 +0800 Subject: [PATCH 334/430] Translated by qianmingtian --- ...t of User Accounts Expiring in -X- Days.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) rename {sources => translated}/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md (62%) diff --git a/sources/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md b/translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md similarity index 62% rename from sources/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md rename to translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md index efc52e33f9..77fcbeed2b 100644 --- a/sources/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md +++ b/translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md @@ -7,30 +7,30 @@ [#]: via: (https://www.2daygeek.com/bash-script-to-check-user-account-password-expiry-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -Bash Script to Send eMail With a List of User Accounts Expiring in “X” Days +使用Bash 脚本发送包含 “X” 天内到期的用户账号列表的电子邮件 ====== -The password enforcement policy is common to all operating systems and applications. +密码强制策略对所有操作系统和应用程序都是通用的。 -If you want to **[implement a password enforcement policy on Linux][1]**, go to the following article. +如果要 **[在Linux上实现密码强制策略][1]** ,请参阅以下文章。 -The password enforcement policy will be enforced by most companies by default, but the time period will be different depending on the company’s requirements. +默认情况下,大多数公司都会强制执行密码强制策略,但根据公司的要求,密码的时间周期会有所不同。 -Usually everyone uses a 90-days password cycle. +通常每个人都使用 90 天的密码周期。 -The user will only **[change the password][2]** on some of the servers they use, and they won’t change the password on the servers they don’t use often. +用户只会在他们使用的一些服务器上 **[更改密码][2]**,而不会在他们不经常使用的服务器上更改密码。 -In particular, most team forget to change the service account password, which can lead to breaking regular jobs even if they are configured to work with **[SSH key-based authentication][3]**. +特别地,大多数团队忘记更改服务帐户密码,这可能导致日常工作的中断,即使他们配置有 **[SSH基于密钥的身份验证][3]** 。 -SSH key-based authentication and **[cronjobs][4]** will not work if the user account password expires. +如果用户帐户密码过期,基于SSH密钥的身份验证和 **[cronjobs][4]** 将不起作用。 -To avoid this situation, we have created a **[shell script][5]** that sends you a list of user accounts that expire within 10 days. +为了避免这种情况,我们创建了一个 **[shell脚本][5]** 来向您发送 10 天内到期的用户帐户列表。 -There are two **[bash scripts][6]** included in this tutorial that will help you collect information about user expiration days on your system. +本教程中包含两个 **[bash脚本][6]** 可以帮助您收集系统中用户到期日的信息。 -### 1) Bash Script to Check List of User Accounts Expiring in 10 Days +### 1) 检查10天后到期的用户帐户列表 -This script will help you to check the list of user accounts that expire in 10 days on your terminal. +此脚本将帮助您检查终端上 10 天内到期的用户帐户列表。 ``` # vi /opt/script/user-password-expiry.sh @@ -54,13 +54,13 @@ cat /tmp/user-expiry.txt | awk '$2 <= 10' > /tmp/user-expiry-1.txt cat /tmp/user-expiry-1.txt | column -t ``` -Set an executable Linux file permission to **“user-password-expiry.sh”** file. +将文件 **“user password expiry.sh”** 设置为 Linux 可执行文件权限。 ``` # chmod +x /opt/script/user-password-expiry.sh ``` -You will get an output like the one below. But the username and days may be different +你将得到如下输出,但用户与天数可能不同。 ``` # sh /opt/script/user-password-expiry.sh @@ -73,10 +73,9 @@ u2 9 u3 3 u4 5 ``` +### 2) 发送包含 10 天内到期的用户帐户列表的电子邮件 -### 2) Bash Script to Send eMail With a List of User Accounts Expiring in 10 Days - -This script will send a mail with a list of user accounts expiring in 10 days. +此脚本将发送一封包含 10 天内到期的用户帐户列表的邮件。 ``` # vi /opt/script/user-password-expiry-mail.sh @@ -104,20 +103,20 @@ rm $MESSAGE rm $MESSAGE1 ``` -Set an executable Linux file permission to **“user-password-expiry-mail.sh”** file. +将文件 **“user-password-expiry-mail.sh”** 设置为 Linux 可执行文件权限。 ``` # chmod +x /opt/script/user-password-expiry-mail.sh ``` -Finally add a **[cronjob][4]** to automate this. It runs once in a day at 8AM. +最后,添加一个 **[cronjob][4]** 去自动执行脚本。每天早上 8 点运行一次。 ``` # crontab -e 0 8 * * * /bin/bash /opt/script/user-password-expiry-mail.sh ``` -You will receive a mail similar to the first shell script output. +你将收到一封与第一个脚本输出类似的电子邮件。 -------------------------------------------------------------------------------- @@ -125,13 +124,14 @@ via: https://www.2daygeek.com/bash-script-to-check-user-account-password-expiry- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[qianmingtian][c] 校对:[校对者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 +[c]: https://github.com/qianmingtian [1]: https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/ [2]: https://www.2daygeek.com/linux-passwd-chpasswd-command-set-update-change-users-password-in-linux-using-shell-script/ [3]: https://www.2daygeek.com/configure-setup-passwordless-ssh-key-based-authentication-linux/ From f468498a3ba5289890df1293056eaa8dc924bcec Mon Sep 17 00:00:00 2001 From: cycoe Date: Mon, 13 Jan 2020 21:07:47 +0800 Subject: [PATCH 335/430] Translating by cycoe --- ... jumping to your Python platformer game.md | 161 +++++++++--------- 1 file changed, 80 insertions(+), 81 deletions(-) rename {sources => translated}/tech/20191205 Add jumping to your Python platformer game.md (52%) diff --git a/sources/tech/20191205 Add jumping to your Python platformer game.md b/translated/tech/20191205 Add jumping to your Python platformer game.md similarity index 52% rename from sources/tech/20191205 Add jumping to your Python platformer game.md rename to translated/tech/20191205 Add jumping to your Python platformer game.md index 5c4ec0507e..0487cc1491 100644 --- a/sources/tech/20191205 Add jumping to your Python platformer game.md +++ b/translated/tech/20191205 Add jumping to your Python platformer game.md @@ -7,28 +7,27 @@ [#]: via: (https://opensource.com/article/19/12/jumping-python-platformer-game) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -Add jumping to your Python platformer game +为你的 Python 平台类游戏添加跳跃功能 ====== -Learn how to fight gravity with jumping in this installment on -programming video games with Python's Pygame module. -![Arcade games][1] +在本期使用 Python Pygame 模块编写视频游戏中,学会如何使用跳跃来对抗重力。 +![游戏厅中的游戏][1] -In the [previous article][2] in this series, you simulated gravity, but now you need to give your player a way to fight against gravity by jumping. +在本系列的 [前一篇文章][2] 中,你已经模拟了重力。但现在,你需要赋予你的角色跳跃的能力来对抗重力。 -A jump is a temporary reprieve from gravity. For a few moments, you jump _up_ instead of falling down, the way gravity is pulling you. But once you hit the peak of your jump, gravity kicks in again and pulls you back down to earth. +跳跃是对重力作用的暂时延缓。在这一小段时间里,你是向_上_跳,而不是被重力拉着向下落。但你一旦到达了跳跃的最高点,重力就会重新发挥作用,将你拉回地面。 -In code, this translates to variables. First, you must establish variables for the player sprite so that Python can track whether or not the sprite is jumping. Once the player sprite is jumping, then gravity is applied to the player sprite again, pulling it back down to the nearest object. +在代码中,跳跃被表示为变量。首先,你需要为玩家对象建立一个变量,使得 Python 能够跟踪对象是否正在跳跃中。一旦玩家对象开始跳跃,他就会再次受到重力的作用,并被拉回最近的物体。 -### Setting jump state variables +### 设置跳跃状态变量 -You must add two new variables to your Player class: +你需要为你的 Player 类添加两个新变量: - * One to track whether your player is jumping or not, determined by whether or not your player sprite is standing on solid ground - * One to bring the player back down to the ground + * 一个是为了跟踪你的角色是否正在跳跃中,可通过你的玩家对象是否站在坚实的地面来确定 + * 一个是为了将玩家带回地面 -Add these variables to your **Player** class. In the following code, the lines above the comment are for context, so just add the final two lines: +将如下两个变量添加到你的 **Player** 类中。在下方的代码中,注释前的部分用于提示上下文,因此只需要添加最后两行: ``` @@ -36,20 +35,20 @@ Add these variables to your **Player** class. In the following code, the lines a                 self.movey = 0                 self.frame = 0                 self.health = 10 -                # gravity variables here +                # 此处是重力相关变量                 self.collide_delta = 0                 self.jump_delta = 6 ``` -The first variable (**collide_delta**) is set to 0 because, in its natural state, the player sprite is not in a mid-jump. The other variable (**jump_delta**) is set to 6 to prevent the sprite from bouncing (actually, jumping) when it first lands in the game world. When you've finished this article's examples, try setting it to 0 to see what happens. +第一个变量 **collide_delta** 被设为 0 是因为在正常状态下,玩家对象没有处在跳跃中的状态。另一个变量 **jump_delta** 被设为 6,是为了防止对象在第一次进入游戏世界时就发生反弹(实际上就是跳跃)。当你完成了本篇文章的示例,尝试把该变量设为 0 看看会发生什么。 -### Colliding mid-jump +### 跳跃中的碰撞 -If you jump on a trampoline, your jumps are pretty impressive. But what would happen if you jumped into a wall? (Don't try it to find out!) Your jump, no matter how impressively it started, would end very quickly when you collide with something much larger and much more solid than you. +如果你是跳到一个蹦床上,那你的跳跃一定非常优美。但是如果你是跳向一面墙会发生什么呢?(千万不要去尝试!)不管你的起跳多么令人印象深刻,当你撞到比你更大更硬的物体时,你都会立马停下。(译注:原理参考动量守恒定律) -To mimic this in your video game, you must set the **self.collide_delta** variable to 0 whenever your player sprite collides with something, like the ground. If **self.collide_delta** is anything other than 0, then your player is jumping, and your player can't jump when it hits a wall or the ground. +为了在你的视频游戏中模拟这一点,你需要在你的玩家对象与地面等东西发生碰撞时,将 **self.collide_delta** 变量设为 0。如果你的 **self.collide_delta** 不是 0 而是其它的什么值,那么你的玩家就会发生跳跃,并且当你的玩家与墙或者地面发生碰撞时无法跳跃。 -In the **update** function of your **Player** class, modify the ground collision block to look like this: +在你的 **Player** 类的 **update** 方法中,将地面碰撞相关代码块修改为如下所示: ``` @@ -57,54 +56,54 @@ In the **update** function of your **Player** class, modify the ground collision         for g in ground_hit_list:             self.movey = 0             self.rect.y = worldy-ty-ty -            self.collide_delta = 0 # stop jumping +            self.collide_delta = 0 # 停止跳跃             if self.rect.y > g.rect.y:                 self.health -=1                 print(self.health) ``` -This code block checks for collisions happening between the ground sprites and the player sprite. In the event of a collision, it sets the Y-position of the player to a value equal to the height of the game window (**worldy**) minus the height of a tile minus the height of another tile (so that the player sprite appears to be standing on top of the ground and not in the middle of it). It also sets **self.collide_delta** to 0 so that the program is aware that the player is not in mid-jump. Additionally, it sets **self.movey** to 0 so that the program is aware that the player is not being pulled by gravity (it's a quirk of game physics that you don't need to continue to pull your player toward earth once the player has been grounded). +这段代码块检查了地面对象和玩家对象之间发生的碰撞。当发生碰撞时,它会将玩家 Y 方向的坐标值设置为游戏窗口的高度减去一个瓷贴的高度再减去另一个瓷贴的高度。以此保证了玩家对象是站在地面**上**,而不是嵌在地面里。同时它也将 **self.collide_delta** 设为 0,使得程序能够知道玩家未处在跳跃中。除此之外,它将 **self.movey** 设为 0,使得程序能够知道玩家当前未受到重力的牵引作用(这是游戏物理引擎的奇怪之处,一旦玩家落地,也就没有必要继续将玩家拉向地面)。 -The **if** statement detects whether the player has descended _below_ the level of the ground; if so, it deducts health points as a penalty. This assumes that you want your player to lose health points for falling off the world. That's not strictly necessary; it's just a common convention in platformers. More than likely, you want this event to trigger something, though, or else your real-world player will be stuck playing a game with a sprite that's fallen off the screen. An easy recovery is to set **self.rect.y** to 0 again so that when the player sprite falls off the world, it respawns at the top of the world and falls back onto solid ground. +此处 **if** 语句用来检测玩家是否已经落到地面之_下_,如果是,那就扣除一点生命值作为惩罚。此处假定了你希望当你的玩家落到地图之外时失去生命值。这个设定不是必需的,它只是平台类游戏的一种惯例。更有可能的是,你希望这个事件能够触发另一些事件,或者说是一种能够让你的现实世界玩家沉迷于让对象掉到屏幕之外的东西。一种简单的恢复方式是在玩家对象掉落到地图之外时,将 **self.rect.y** 重新设置为 0,这样它就会在地图上方重新生成,并落到坚实的地面上。 -### Hitting the ground +### 撞向地面 -Your simulated gravity wants your player's Y-axis movement to be 0 or more. To create a jump, write code that sends your player sprite off solid ground and into the air. +模拟的重力使你玩家的 Y 坐标不断增大(译注:此处原文中为 0,但在 Pygame 中越靠下方 Y 坐标应越大)。要实现跳跃,完成如下代码使你的玩家对象离开地面,飞向空中。 -In the **update** function of your **Player** class, add a temporary reprieve from gravity: +在你的 **Player** 类的 **update** 方法中,添加如下代码来暂时延缓重力的作用: ```         if self.collide_delta < 6 and self.jump_delta < 6:             self.jump_delta = 6*2 -            self.movey -= 33  # how high to jump +            self.movey -= 33  # 跳跃的高度             self.collide_delta += 6             self.jump_delta    += 6 ``` -According to this code, a jump sends the player sprite 33 pixels into the air. It's _negative_ 33 because a lower number in Pygame means it's closer to the top of the screen. +根据此代码所示,跳跃使玩家对象向空中移动了 33 个像素。此处是_负_ 33 是因为在 Pygame 中,越小的数代表距离屏幕顶端越近。 -This event is conditional, though. It only happens if **self.collide_delta** is less than 6 (its default value established in the **init** function of your **Player** sprite) and if **self.jump_delta** is less than 6. This condition prevents the player from triggering another jump until it collides with a platform. In other words, it prevents mid-air jumps. +不过此事件视条件而定,只有当 **self.collide_delta** 小于 6(缺省值定义在你 **Player** 类的 **init** 方法中)并且 **self.jump_delta** 也于 6 的时候才会发生。此条件能够保证直到玩家碰到一个平台,才能触发另一次跳跃。换言之,它能够阻止空中二段跳。 -You don't have to prevent mid-air jumps, or you can allow for mid-air jumps under special conditions; for instance, if a player obtains a special loot item, then you could grant it the ability to perform mid-air jumps until the next time it is hit by an enemy. +在某些特殊条件下,你可能不想阻止空中二段跳,或者说你允许玩家进行空中二段跳。举个栗子,如果玩家获得了某个战利品,那么在他被敌人攻击到之前,都能够拥有空中二段跳的能力。 -When you've finished this article's examples, try setting **self.collide_delta** and **self.jump_delta** to 0 for a 100% chance to jump in mid-air. +当你完成本篇文章中的示例,尝试将 **self.collide_delta** 和 **self.jump_delta** 设置为 0,从而获得百分之百的几率触发空中二段跳。 -### Landing on a platform +### 在平台上着陆 -So far, you've defined an anti-gravity condition for when the player sprite hits the ground, but the game code keeps platforms and the ground in separate lists. (As with so many choices made in this article, that's not strictly necessary, and you can experiment with treating the ground as just another platform.) To enable a player sprite to stand on top of a platform, you must detect a collision between the player sprite and a platform sprite and then perform the same actions as you did for a ground collision. Place this code into your **update** function: +目前你已经定义了再玩家对象摔落地面时的抵抗重力条件,但此时你的游戏代码仍保持平台与地面置于不同的列表中(就像本文中做的很多其他选择一样,这个设定并不是必需的,你可以尝试将地面作为另一种平台)。为了允许玩家对象站在平台之上,你必须像检测地面碰撞一样,检测玩家对象与平台对象之间的碰撞。将如下代码放于你的 **update** 方法中: ```         plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False)         for p in plat_hit_list: -            self.collide_delta = 0 # stop jumping +            self.collide_delta = 0 # 跳跃结束             self.movey = 0 ``` -There's one additional concern, though: platforms hang in the air, meaning the player can interact with them by approaching them from either the top or the bottom. +但此处还有一点需要考虑:平台悬在空中,也就意味着玩家可以通过从上面或者从下面接触平台来与之互动。 -It's up to you how you want the platforms to react to your player. It's not uncommon to block a player from accessing a platform from below. Add this code to the above code block to treat platforms as a sort of ceiling or pergola, such that the player sprite can jump onto a platform as long as it jumps higher than the platform's topside, but obstructs the player when it tries to jump from beneath: +确定平台如何与玩家互动取决于你,阻止玩家从下方到达平台也并不稀奇。将如下代码加到上方的代码块中,使得平台表现得像天花板或者说是藤架。只有在玩家对象跳得比平台上沿更高时才能跳到平台上,但会阻止玩家从平台下方跳上来: ``` @@ -114,17 +113,17 @@ It's up to you how you want the platforms to react to your player. It's not unco                 self.rect.y = p.rect.y-ty ``` -The first clause of this **if** statement blocks the player from accessing a platform when the player sprite is directly under the platform. It does this by detecting that the player sprite's position is greater (in Pygame, that means lower on the screen, from top to bottom), and then sets the player sprite's new Y position to its current Y position plus the height of a tile, effectively keeping the player one tile's height away from ever passing through a platform from beneath it. +此处 **if** 语句代码块的第一个子句阻止玩家对象从平台正下方跳到平台上。如果它检测到玩家对象的坐标比平台更大(在 Pygame 中,坐标更大意味着在屏幕的更下方),那么将玩家对象新的 Y 坐标设置为当前平台的 Y 坐标加上一个瓷贴的高度。实际效果就是保证玩家对象距离平台一个瓷贴的高度,防止其从下方穿过平台。 -The **else** clause does the opposite. If the program is running this code, then the player sprite's Y position is _not_ greater than the platforms, meaning that the player sprite is falling from the sky (either because it has been freshly spawned there or because the player has jumped). In this event, the player sprite's position is set to the position of the platform minus one tile's height (because, remember, in Pygame, lower numbers mean something is higher up on the screen). This keeps the player on top of the platform unless it jumps or walks off of it. +**else** 子句做了相反的事情。当程序运行到此处时,如果玩家对象的 Y 坐标_不_比平台的更大,意味着玩家对象是从空中落下(不论是由于玩家刚刚从此处生成,或者是玩家执行了跳跃)。在这种情况下,玩家对象的 Y 坐标被设为平台的 Y 坐标减去一个瓷贴的高度(切记,在 Pygame 中更小的 Y 坐标代表在屏幕上的更高处)。这样就能保证玩家在平台_上_,除非他从平台上跳下来或者走下来。 -You can experiment with other ways of dealing with sprite and platform interaction. For instance, maybe the player is assumed to be "in front" of the platforms and can seamlessly jump through them to stand on top of one. Or a platform could slow a player's leap but not block it entirely. You can even mix and match by grouping platforms into different lists. +你也可以尝试其他的方式来处理玩家与平台之间的互动。举个栗子,也许玩家对象被设定为处在平台的“前面”,他能够无障碍地跳跃穿过平台并站在上面。或者你可以设计一种平台会减缓而又不完全阻止玩家的跳跃过程。甚至你可以通过将不同平台分到不同列表中来混合搭配使用。 -### Triggering a jump +### 触发一次跳跃 -Your code now simulates all the necessary jump conditions, but it still lacks a jump trigger. Your player sprite's **self.jump_delta** is set to 6 initially, and the jump update code is triggered only when it's less than 6. +目前为此,你的代码已经模拟了所有必需的跳跃条件,但仍缺少一个跳跃触发器。你的玩家对象的 **self.jump_delta** 初始值被设置为 6,只有当它比 6 小时才会触发更新跳跃的代码。 -To trigger a new setting for the jumping variable, create a **jump** function in your **Player** class that sets the **self.jump_delta** to less than 6, causing gravity to be temporarily reprieved by sending your player sprite 33 pixels into the air: +为跳跃变量设置一个新的设置方法,在你的 **Player** 类中创建一个 **jump** 方法,并将 **self.jump_delta** 设为小于 6 的值。通过使玩家对象向空中移动 33 个像素,来暂时减缓重力的作用。 ``` @@ -132,17 +131,17 @@ To trigger a new setting for the jumping variable, create a **jump** function in         self.jump_delta = 0 ``` -That's all the **jump** function requires, believe it or not. The rest happens in the **update** function, and you've already written that code. +不管你相信与否,这就是 **jump** 方法的全部。剩余的部分在 **update** 方法中,你已经在前面实现了相关代码。 -There's one last thing to do before jumping is functional in your game. If you can't think of what it is, try playing your game to see how jumping works for you. +要使你游戏中的跳跃功能生效,还有最后一件事情要做。如果你想不起来是什么,运行游戏并观察跳跃是如何生效的。 -The problem is that nothing in your main loop is calling the **jump** function. You made a placeholder keypress for it early on, but right now, all the jump key does is print **jump** to the terminal. +问题就在于你的主循环中没有调用 **jump** 方法。先前你已经为该方法创建了一个按键占位符,现在,跳跃键所做的就是将 **jump** 打印到终端。 -### Calling the jump function +### 调用 jump 方法 -In your main loop, change the result of the Up arrow from printing a debug statement to calling the **jump** function. +在你的主循环中,将_上_方向键的效果从打印一条调试语句,改为调用 **jump** 方法。 -Notice that the **jump** function, like the **update** function, needs to know about collisions, so you have to tell it which **plat_list** to use. +注意此处,与 **update** 方法类似,**jump** 方法也需要检测碰撞,因此你需要告诉它使用哪个 **plat_list**。 ``` @@ -150,13 +149,13 @@ Notice that the **jump** function, like the **update** function, needs to know a                 player.jump(plat_list) ``` -If you would rather use the Spacebar for jumping, set the key to **pygame.K_SPACE** instead of **pygame.K_UP**. Alternately, you can use both (as separate **if** statements) so that the player has a choice. +如果你倾向于使用空格键作为跳跃键,使用 **pygame.K_SPACE** 替代 **pygame.K_UP** 作为按键。另一种选择,你可以同时使用两种方式(使用单独的 **if** 语句),给玩家多一种选择。 -Try your game now. In the next article, you'll make your world scroll. +现在来尝试你的游戏吧!在下一篇文章中,你将让你的游戏卷动起来。 -![Pygame platformer][3] +![Pygame 平台类游戏][3] -Here's all the code so far: +以下是目前为止的所有代码: ``` @@ -184,7 +183,7 @@ Objects ''' class Platform(pygame.sprite.Sprite): -    # x location, y location, img width, img height, img file     + # x 坐标,y 坐标,图像宽度,图像高度,图像文件     def __init__(self,xloc,yloc,imgw,imgh,img):         pygame.sprite.Sprite.__init__(self)         self.image = pygame.image.load(os.path.join('images',img)).convert() @@ -195,7 +194,7 @@ class Platform(pygame.sprite.Sprite): class Player(pygame.sprite.Sprite):     ''' -    Spawn a player +    生成一个玩家     '''     def __init__(self):         pygame.sprite.Sprite.__init__(self) @@ -227,34 +226,34 @@ class Player(pygame.sprite.Sprite):             def control(self,x,y):         ''' -        control player movement +        控制玩家移动         '''         self.movex += x         self.movey += y             def update(self):         ''' -        Update sprite position +        更新对象位置         '''                 self.rect.x = self.rect.x + self.movex         self.rect.y = self.rect.y + self.movey -        # moving left +        # 向左移动         if self.movex < 0:             self.frame += 1             if self.frame > ani*3:                 self.frame = 0             self.image = self.images[self.frame//ani] -        # moving right +        # 向右移动         if self.movex > 0:             self.frame += 1             if self.frame > ani*3:                 self.frame = 0             self.image = self.images[(self.frame//ani)+4] -        # collisions +        # 碰撞         enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False)         for enemy in enemy_hit_list:             self.health -= 1 @@ -286,7 +285,7 @@ class Player(pygame.sprite.Sprite):             class Enemy(pygame.sprite.Sprite):     ''' -    Spawn an enemy +    生成一个敌人     '''     def __init__(self,x,y,img):         pygame.sprite.Sprite.__init__(self) @@ -302,7 +301,7 @@ class Enemy(pygame.sprite.Sprite):                     def move(self):         ''' -        enemy movement +        敌人移动         '''         distance = 80         speed = 8 @@ -337,9 +336,9 @@ class Enemy(pygame.sprite.Sprite): class Level():     def bad(lvl,eloc):         if lvl == 1: -            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy -            enemy_list = pygame.sprite.Group() # create enemy group -            enemy_list.add(enemy)              # add enemy to group +            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # 生成敌人 +            enemy_list = pygame.sprite.Group() # 创建敌人组 +            enemy_list.add(enemy)              # 将敌人添加到敌人组                     if lvl == 2:             print("Level " + str(lvl) ) @@ -392,8 +391,8 @@ Setup worldx = 960 worldy = 720 -fps = 40 # frame rate -ani = 4  # animation cycles +fps = 40 # 帧率 +ani = 4  # 动画循环 clock = pygame.time.Clock() pygame.init() main = True @@ -406,7 +405,7 @@ ALPHA = (0,255,0) world = pygame.display.set_mode([worldx,worldy]) backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() backdropbox = world.get_rect() -player = Player() # spawn player +player = Player() # 生成玩家 player.rect.x = 0 player.rect.y = 0 player_list = pygame.sprite.Group() @@ -418,8 +417,8 @@ eloc = [] eloc = [200,20] gloc = [] #gloc = [0,630,64,630,128,630,192,630,256,630,320,630,384,630] -tx = 64 #tile size -ty = 64 #tile size +tx = 64 # 瓷贴尺寸 +ty = 64 # 瓷贴尺寸 i=0 while i <= (worldx/tx)+tx: @@ -431,7 +430,7 @@ ground_list = Level.ground( 1,gloc,tx,ty ) plat_list = Level.platform( 1,tx,ty ) ''' -Main loop +主循环 ''' while main == True:     for event in pygame.event.get(): @@ -464,26 +463,26 @@ while main == True: #    world.fill(BLACK)     world.blit(backdrop, backdropbox) -    player.gravity() # check gravity +    player.gravity() # 检查重力     player.update() -    player_list.draw(world) #refresh player position -    enemy_list.draw(world)  # refresh enemies -    ground_list.draw(world)  # refresh enemies -    plat_list.draw(world)   # refresh platforms +    player_list.draw(world) # 刷新玩家位置 +    enemy_list.draw(world)  # 刷新敌人 +    ground_list.draw(world)  # 刷新地面 +    plat_list.draw(world)   # 刷新平台     for e in enemy_list:         e.move()     pygame.display.flip()     clock.tick(fps) ``` -This is the 7th installment in an ongoing series about creating video games in [Python 3][4] using the [Pygame][5] module. Previous articles are: +本期是使用 [Pygame][5] 模块在 [Python 3][4] 中创建视频游戏连载系列的第 7 期。往期文章为: - * [Learn how to program in Python by building a simple dice game][6] - * [Build a game framework with Python using the Pygame module][7] - * [How to add a player to your Python game][8] - * [Using Pygame to move your game character around][9] - * [What's a hero without a villain? How to add one to your Python game][10] - * [Simulate gravity in your Python game][2] + * [通过构建一个简单的掷骰子游戏去学习怎么用 Python 编程][6] + * [使用 Python 和 Pygame 模块构建一个游戏框架][7] + * [如何在你的 Python 游戏中添加一个玩家][8] + * [用 Pygame 使你的游戏角色移动起来][9] + * [如何向你的 Python 游戏中添加一个敌人][10] + * [在你的 Python 游戏中模拟重力][2] @@ -493,7 +492,7 @@ via: https://opensource.com/article/19/12/jumping-python-platformer-game 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[cycoe](https://github.com/cycoe) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fe1ad6440223a95d0726e563c47b1ef1b29d178a Mon Sep 17 00:00:00 2001 From: cycoe Date: Mon, 13 Jan 2020 21:10:23 +0800 Subject: [PATCH 336/430] Translated by cycoe --- ... jumping to your Python platformer game.md | 161 +++++++++--------- 1 file changed, 80 insertions(+), 81 deletions(-) rename {sources => translated}/tech/20191205 Add jumping to your Python platformer game.md (52%) diff --git a/sources/tech/20191205 Add jumping to your Python platformer game.md b/translated/tech/20191205 Add jumping to your Python platformer game.md similarity index 52% rename from sources/tech/20191205 Add jumping to your Python platformer game.md rename to translated/tech/20191205 Add jumping to your Python platformer game.md index 5c4ec0507e..0487cc1491 100644 --- a/sources/tech/20191205 Add jumping to your Python platformer game.md +++ b/translated/tech/20191205 Add jumping to your Python platformer game.md @@ -7,28 +7,27 @@ [#]: via: (https://opensource.com/article/19/12/jumping-python-platformer-game) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -Add jumping to your Python platformer game +为你的 Python 平台类游戏添加跳跃功能 ====== -Learn how to fight gravity with jumping in this installment on -programming video games with Python's Pygame module. -![Arcade games][1] +在本期使用 Python Pygame 模块编写视频游戏中,学会如何使用跳跃来对抗重力。 +![游戏厅中的游戏][1] -In the [previous article][2] in this series, you simulated gravity, but now you need to give your player a way to fight against gravity by jumping. +在本系列的 [前一篇文章][2] 中,你已经模拟了重力。但现在,你需要赋予你的角色跳跃的能力来对抗重力。 -A jump is a temporary reprieve from gravity. For a few moments, you jump _up_ instead of falling down, the way gravity is pulling you. But once you hit the peak of your jump, gravity kicks in again and pulls you back down to earth. +跳跃是对重力作用的暂时延缓。在这一小段时间里,你是向_上_跳,而不是被重力拉着向下落。但你一旦到达了跳跃的最高点,重力就会重新发挥作用,将你拉回地面。 -In code, this translates to variables. First, you must establish variables for the player sprite so that Python can track whether or not the sprite is jumping. Once the player sprite is jumping, then gravity is applied to the player sprite again, pulling it back down to the nearest object. +在代码中,跳跃被表示为变量。首先,你需要为玩家对象建立一个变量,使得 Python 能够跟踪对象是否正在跳跃中。一旦玩家对象开始跳跃,他就会再次受到重力的作用,并被拉回最近的物体。 -### Setting jump state variables +### 设置跳跃状态变量 -You must add two new variables to your Player class: +你需要为你的 Player 类添加两个新变量: - * One to track whether your player is jumping or not, determined by whether or not your player sprite is standing on solid ground - * One to bring the player back down to the ground + * 一个是为了跟踪你的角色是否正在跳跃中,可通过你的玩家对象是否站在坚实的地面来确定 + * 一个是为了将玩家带回地面 -Add these variables to your **Player** class. In the following code, the lines above the comment are for context, so just add the final two lines: +将如下两个变量添加到你的 **Player** 类中。在下方的代码中,注释前的部分用于提示上下文,因此只需要添加最后两行: ``` @@ -36,20 +35,20 @@ Add these variables to your **Player** class. In the following code, the lines a                 self.movey = 0                 self.frame = 0                 self.health = 10 -                # gravity variables here +                # 此处是重力相关变量                 self.collide_delta = 0                 self.jump_delta = 6 ``` -The first variable (**collide_delta**) is set to 0 because, in its natural state, the player sprite is not in a mid-jump. The other variable (**jump_delta**) is set to 6 to prevent the sprite from bouncing (actually, jumping) when it first lands in the game world. When you've finished this article's examples, try setting it to 0 to see what happens. +第一个变量 **collide_delta** 被设为 0 是因为在正常状态下,玩家对象没有处在跳跃中的状态。另一个变量 **jump_delta** 被设为 6,是为了防止对象在第一次进入游戏世界时就发生反弹(实际上就是跳跃)。当你完成了本篇文章的示例,尝试把该变量设为 0 看看会发生什么。 -### Colliding mid-jump +### 跳跃中的碰撞 -If you jump on a trampoline, your jumps are pretty impressive. But what would happen if you jumped into a wall? (Don't try it to find out!) Your jump, no matter how impressively it started, would end very quickly when you collide with something much larger and much more solid than you. +如果你是跳到一个蹦床上,那你的跳跃一定非常优美。但是如果你是跳向一面墙会发生什么呢?(千万不要去尝试!)不管你的起跳多么令人印象深刻,当你撞到比你更大更硬的物体时,你都会立马停下。(译注:原理参考动量守恒定律) -To mimic this in your video game, you must set the **self.collide_delta** variable to 0 whenever your player sprite collides with something, like the ground. If **self.collide_delta** is anything other than 0, then your player is jumping, and your player can't jump when it hits a wall or the ground. +为了在你的视频游戏中模拟这一点,你需要在你的玩家对象与地面等东西发生碰撞时,将 **self.collide_delta** 变量设为 0。如果你的 **self.collide_delta** 不是 0 而是其它的什么值,那么你的玩家就会发生跳跃,并且当你的玩家与墙或者地面发生碰撞时无法跳跃。 -In the **update** function of your **Player** class, modify the ground collision block to look like this: +在你的 **Player** 类的 **update** 方法中,将地面碰撞相关代码块修改为如下所示: ``` @@ -57,54 +56,54 @@ In the **update** function of your **Player** class, modify the ground collision         for g in ground_hit_list:             self.movey = 0             self.rect.y = worldy-ty-ty -            self.collide_delta = 0 # stop jumping +            self.collide_delta = 0 # 停止跳跃             if self.rect.y > g.rect.y:                 self.health -=1                 print(self.health) ``` -This code block checks for collisions happening between the ground sprites and the player sprite. In the event of a collision, it sets the Y-position of the player to a value equal to the height of the game window (**worldy**) minus the height of a tile minus the height of another tile (so that the player sprite appears to be standing on top of the ground and not in the middle of it). It also sets **self.collide_delta** to 0 so that the program is aware that the player is not in mid-jump. Additionally, it sets **self.movey** to 0 so that the program is aware that the player is not being pulled by gravity (it's a quirk of game physics that you don't need to continue to pull your player toward earth once the player has been grounded). +这段代码块检查了地面对象和玩家对象之间发生的碰撞。当发生碰撞时,它会将玩家 Y 方向的坐标值设置为游戏窗口的高度减去一个瓷贴的高度再减去另一个瓷贴的高度。以此保证了玩家对象是站在地面**上**,而不是嵌在地面里。同时它也将 **self.collide_delta** 设为 0,使得程序能够知道玩家未处在跳跃中。除此之外,它将 **self.movey** 设为 0,使得程序能够知道玩家当前未受到重力的牵引作用(这是游戏物理引擎的奇怪之处,一旦玩家落地,也就没有必要继续将玩家拉向地面)。 -The **if** statement detects whether the player has descended _below_ the level of the ground; if so, it deducts health points as a penalty. This assumes that you want your player to lose health points for falling off the world. That's not strictly necessary; it's just a common convention in platformers. More than likely, you want this event to trigger something, though, or else your real-world player will be stuck playing a game with a sprite that's fallen off the screen. An easy recovery is to set **self.rect.y** to 0 again so that when the player sprite falls off the world, it respawns at the top of the world and falls back onto solid ground. +此处 **if** 语句用来检测玩家是否已经落到地面之_下_,如果是,那就扣除一点生命值作为惩罚。此处假定了你希望当你的玩家落到地图之外时失去生命值。这个设定不是必需的,它只是平台类游戏的一种惯例。更有可能的是,你希望这个事件能够触发另一些事件,或者说是一种能够让你的现实世界玩家沉迷于让对象掉到屏幕之外的东西。一种简单的恢复方式是在玩家对象掉落到地图之外时,将 **self.rect.y** 重新设置为 0,这样它就会在地图上方重新生成,并落到坚实的地面上。 -### Hitting the ground +### 撞向地面 -Your simulated gravity wants your player's Y-axis movement to be 0 or more. To create a jump, write code that sends your player sprite off solid ground and into the air. +模拟的重力使你玩家的 Y 坐标不断增大(译注:此处原文中为 0,但在 Pygame 中越靠下方 Y 坐标应越大)。要实现跳跃,完成如下代码使你的玩家对象离开地面,飞向空中。 -In the **update** function of your **Player** class, add a temporary reprieve from gravity: +在你的 **Player** 类的 **update** 方法中,添加如下代码来暂时延缓重力的作用: ```         if self.collide_delta < 6 and self.jump_delta < 6:             self.jump_delta = 6*2 -            self.movey -= 33  # how high to jump +            self.movey -= 33  # 跳跃的高度             self.collide_delta += 6             self.jump_delta    += 6 ``` -According to this code, a jump sends the player sprite 33 pixels into the air. It's _negative_ 33 because a lower number in Pygame means it's closer to the top of the screen. +根据此代码所示,跳跃使玩家对象向空中移动了 33 个像素。此处是_负_ 33 是因为在 Pygame 中,越小的数代表距离屏幕顶端越近。 -This event is conditional, though. It only happens if **self.collide_delta** is less than 6 (its default value established in the **init** function of your **Player** sprite) and if **self.jump_delta** is less than 6. This condition prevents the player from triggering another jump until it collides with a platform. In other words, it prevents mid-air jumps. +不过此事件视条件而定,只有当 **self.collide_delta** 小于 6(缺省值定义在你 **Player** 类的 **init** 方法中)并且 **self.jump_delta** 也于 6 的时候才会发生。此条件能够保证直到玩家碰到一个平台,才能触发另一次跳跃。换言之,它能够阻止空中二段跳。 -You don't have to prevent mid-air jumps, or you can allow for mid-air jumps under special conditions; for instance, if a player obtains a special loot item, then you could grant it the ability to perform mid-air jumps until the next time it is hit by an enemy. +在某些特殊条件下,你可能不想阻止空中二段跳,或者说你允许玩家进行空中二段跳。举个栗子,如果玩家获得了某个战利品,那么在他被敌人攻击到之前,都能够拥有空中二段跳的能力。 -When you've finished this article's examples, try setting **self.collide_delta** and **self.jump_delta** to 0 for a 100% chance to jump in mid-air. +当你完成本篇文章中的示例,尝试将 **self.collide_delta** 和 **self.jump_delta** 设置为 0,从而获得百分之百的几率触发空中二段跳。 -### Landing on a platform +### 在平台上着陆 -So far, you've defined an anti-gravity condition for when the player sprite hits the ground, but the game code keeps platforms and the ground in separate lists. (As with so many choices made in this article, that's not strictly necessary, and you can experiment with treating the ground as just another platform.) To enable a player sprite to stand on top of a platform, you must detect a collision between the player sprite and a platform sprite and then perform the same actions as you did for a ground collision. Place this code into your **update** function: +目前你已经定义了再玩家对象摔落地面时的抵抗重力条件,但此时你的游戏代码仍保持平台与地面置于不同的列表中(就像本文中做的很多其他选择一样,这个设定并不是必需的,你可以尝试将地面作为另一种平台)。为了允许玩家对象站在平台之上,你必须像检测地面碰撞一样,检测玩家对象与平台对象之间的碰撞。将如下代码放于你的 **update** 方法中: ```         plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False)         for p in plat_hit_list: -            self.collide_delta = 0 # stop jumping +            self.collide_delta = 0 # 跳跃结束             self.movey = 0 ``` -There's one additional concern, though: platforms hang in the air, meaning the player can interact with them by approaching them from either the top or the bottom. +但此处还有一点需要考虑:平台悬在空中,也就意味着玩家可以通过从上面或者从下面接触平台来与之互动。 -It's up to you how you want the platforms to react to your player. It's not uncommon to block a player from accessing a platform from below. Add this code to the above code block to treat platforms as a sort of ceiling or pergola, such that the player sprite can jump onto a platform as long as it jumps higher than the platform's topside, but obstructs the player when it tries to jump from beneath: +确定平台如何与玩家互动取决于你,阻止玩家从下方到达平台也并不稀奇。将如下代码加到上方的代码块中,使得平台表现得像天花板或者说是藤架。只有在玩家对象跳得比平台上沿更高时才能跳到平台上,但会阻止玩家从平台下方跳上来: ``` @@ -114,17 +113,17 @@ It's up to you how you want the platforms to react to your player. It's not unco                 self.rect.y = p.rect.y-ty ``` -The first clause of this **if** statement blocks the player from accessing a platform when the player sprite is directly under the platform. It does this by detecting that the player sprite's position is greater (in Pygame, that means lower on the screen, from top to bottom), and then sets the player sprite's new Y position to its current Y position plus the height of a tile, effectively keeping the player one tile's height away from ever passing through a platform from beneath it. +此处 **if** 语句代码块的第一个子句阻止玩家对象从平台正下方跳到平台上。如果它检测到玩家对象的坐标比平台更大(在 Pygame 中,坐标更大意味着在屏幕的更下方),那么将玩家对象新的 Y 坐标设置为当前平台的 Y 坐标加上一个瓷贴的高度。实际效果就是保证玩家对象距离平台一个瓷贴的高度,防止其从下方穿过平台。 -The **else** clause does the opposite. If the program is running this code, then the player sprite's Y position is _not_ greater than the platforms, meaning that the player sprite is falling from the sky (either because it has been freshly spawned there or because the player has jumped). In this event, the player sprite's position is set to the position of the platform minus one tile's height (because, remember, in Pygame, lower numbers mean something is higher up on the screen). This keeps the player on top of the platform unless it jumps or walks off of it. +**else** 子句做了相反的事情。当程序运行到此处时,如果玩家对象的 Y 坐标_不_比平台的更大,意味着玩家对象是从空中落下(不论是由于玩家刚刚从此处生成,或者是玩家执行了跳跃)。在这种情况下,玩家对象的 Y 坐标被设为平台的 Y 坐标减去一个瓷贴的高度(切记,在 Pygame 中更小的 Y 坐标代表在屏幕上的更高处)。这样就能保证玩家在平台_上_,除非他从平台上跳下来或者走下来。 -You can experiment with other ways of dealing with sprite and platform interaction. For instance, maybe the player is assumed to be "in front" of the platforms and can seamlessly jump through them to stand on top of one. Or a platform could slow a player's leap but not block it entirely. You can even mix and match by grouping platforms into different lists. +你也可以尝试其他的方式来处理玩家与平台之间的互动。举个栗子,也许玩家对象被设定为处在平台的“前面”,他能够无障碍地跳跃穿过平台并站在上面。或者你可以设计一种平台会减缓而又不完全阻止玩家的跳跃过程。甚至你可以通过将不同平台分到不同列表中来混合搭配使用。 -### Triggering a jump +### 触发一次跳跃 -Your code now simulates all the necessary jump conditions, but it still lacks a jump trigger. Your player sprite's **self.jump_delta** is set to 6 initially, and the jump update code is triggered only when it's less than 6. +目前为此,你的代码已经模拟了所有必需的跳跃条件,但仍缺少一个跳跃触发器。你的玩家对象的 **self.jump_delta** 初始值被设置为 6,只有当它比 6 小时才会触发更新跳跃的代码。 -To trigger a new setting for the jumping variable, create a **jump** function in your **Player** class that sets the **self.jump_delta** to less than 6, causing gravity to be temporarily reprieved by sending your player sprite 33 pixels into the air: +为跳跃变量设置一个新的设置方法,在你的 **Player** 类中创建一个 **jump** 方法,并将 **self.jump_delta** 设为小于 6 的值。通过使玩家对象向空中移动 33 个像素,来暂时减缓重力的作用。 ``` @@ -132,17 +131,17 @@ To trigger a new setting for the jumping variable, create a **jump** function in         self.jump_delta = 0 ``` -That's all the **jump** function requires, believe it or not. The rest happens in the **update** function, and you've already written that code. +不管你相信与否,这就是 **jump** 方法的全部。剩余的部分在 **update** 方法中,你已经在前面实现了相关代码。 -There's one last thing to do before jumping is functional in your game. If you can't think of what it is, try playing your game to see how jumping works for you. +要使你游戏中的跳跃功能生效,还有最后一件事情要做。如果你想不起来是什么,运行游戏并观察跳跃是如何生效的。 -The problem is that nothing in your main loop is calling the **jump** function. You made a placeholder keypress for it early on, but right now, all the jump key does is print **jump** to the terminal. +问题就在于你的主循环中没有调用 **jump** 方法。先前你已经为该方法创建了一个按键占位符,现在,跳跃键所做的就是将 **jump** 打印到终端。 -### Calling the jump function +### 调用 jump 方法 -In your main loop, change the result of the Up arrow from printing a debug statement to calling the **jump** function. +在你的主循环中,将_上_方向键的效果从打印一条调试语句,改为调用 **jump** 方法。 -Notice that the **jump** function, like the **update** function, needs to know about collisions, so you have to tell it which **plat_list** to use. +注意此处,与 **update** 方法类似,**jump** 方法也需要检测碰撞,因此你需要告诉它使用哪个 **plat_list**。 ``` @@ -150,13 +149,13 @@ Notice that the **jump** function, like the **update** function, needs to know a                 player.jump(plat_list) ``` -If you would rather use the Spacebar for jumping, set the key to **pygame.K_SPACE** instead of **pygame.K_UP**. Alternately, you can use both (as separate **if** statements) so that the player has a choice. +如果你倾向于使用空格键作为跳跃键,使用 **pygame.K_SPACE** 替代 **pygame.K_UP** 作为按键。另一种选择,你可以同时使用两种方式(使用单独的 **if** 语句),给玩家多一种选择。 -Try your game now. In the next article, you'll make your world scroll. +现在来尝试你的游戏吧!在下一篇文章中,你将让你的游戏卷动起来。 -![Pygame platformer][3] +![Pygame 平台类游戏][3] -Here's all the code so far: +以下是目前为止的所有代码: ``` @@ -184,7 +183,7 @@ Objects ''' class Platform(pygame.sprite.Sprite): -    # x location, y location, img width, img height, img file     + # x 坐标,y 坐标,图像宽度,图像高度,图像文件     def __init__(self,xloc,yloc,imgw,imgh,img):         pygame.sprite.Sprite.__init__(self)         self.image = pygame.image.load(os.path.join('images',img)).convert() @@ -195,7 +194,7 @@ class Platform(pygame.sprite.Sprite): class Player(pygame.sprite.Sprite):     ''' -    Spawn a player +    生成一个玩家     '''     def __init__(self):         pygame.sprite.Sprite.__init__(self) @@ -227,34 +226,34 @@ class Player(pygame.sprite.Sprite):             def control(self,x,y):         ''' -        control player movement +        控制玩家移动         '''         self.movex += x         self.movey += y             def update(self):         ''' -        Update sprite position +        更新对象位置         '''                 self.rect.x = self.rect.x + self.movex         self.rect.y = self.rect.y + self.movey -        # moving left +        # 向左移动         if self.movex < 0:             self.frame += 1             if self.frame > ani*3:                 self.frame = 0             self.image = self.images[self.frame//ani] -        # moving right +        # 向右移动         if self.movex > 0:             self.frame += 1             if self.frame > ani*3:                 self.frame = 0             self.image = self.images[(self.frame//ani)+4] -        # collisions +        # 碰撞         enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False)         for enemy in enemy_hit_list:             self.health -= 1 @@ -286,7 +285,7 @@ class Player(pygame.sprite.Sprite):             class Enemy(pygame.sprite.Sprite):     ''' -    Spawn an enemy +    生成一个敌人     '''     def __init__(self,x,y,img):         pygame.sprite.Sprite.__init__(self) @@ -302,7 +301,7 @@ class Enemy(pygame.sprite.Sprite):                     def move(self):         ''' -        enemy movement +        敌人移动         '''         distance = 80         speed = 8 @@ -337,9 +336,9 @@ class Enemy(pygame.sprite.Sprite): class Level():     def bad(lvl,eloc):         if lvl == 1: -            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy -            enemy_list = pygame.sprite.Group() # create enemy group -            enemy_list.add(enemy)              # add enemy to group +            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # 生成敌人 +            enemy_list = pygame.sprite.Group() # 创建敌人组 +            enemy_list.add(enemy)              # 将敌人添加到敌人组                     if lvl == 2:             print("Level " + str(lvl) ) @@ -392,8 +391,8 @@ Setup worldx = 960 worldy = 720 -fps = 40 # frame rate -ani = 4  # animation cycles +fps = 40 # 帧率 +ani = 4  # 动画循环 clock = pygame.time.Clock() pygame.init() main = True @@ -406,7 +405,7 @@ ALPHA = (0,255,0) world = pygame.display.set_mode([worldx,worldy]) backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() backdropbox = world.get_rect() -player = Player() # spawn player +player = Player() # 生成玩家 player.rect.x = 0 player.rect.y = 0 player_list = pygame.sprite.Group() @@ -418,8 +417,8 @@ eloc = [] eloc = [200,20] gloc = [] #gloc = [0,630,64,630,128,630,192,630,256,630,320,630,384,630] -tx = 64 #tile size -ty = 64 #tile size +tx = 64 # 瓷贴尺寸 +ty = 64 # 瓷贴尺寸 i=0 while i <= (worldx/tx)+tx: @@ -431,7 +430,7 @@ ground_list = Level.ground( 1,gloc,tx,ty ) plat_list = Level.platform( 1,tx,ty ) ''' -Main loop +主循环 ''' while main == True:     for event in pygame.event.get(): @@ -464,26 +463,26 @@ while main == True: #    world.fill(BLACK)     world.blit(backdrop, backdropbox) -    player.gravity() # check gravity +    player.gravity() # 检查重力     player.update() -    player_list.draw(world) #refresh player position -    enemy_list.draw(world)  # refresh enemies -    ground_list.draw(world)  # refresh enemies -    plat_list.draw(world)   # refresh platforms +    player_list.draw(world) # 刷新玩家位置 +    enemy_list.draw(world)  # 刷新敌人 +    ground_list.draw(world)  # 刷新地面 +    plat_list.draw(world)   # 刷新平台     for e in enemy_list:         e.move()     pygame.display.flip()     clock.tick(fps) ``` -This is the 7th installment in an ongoing series about creating video games in [Python 3][4] using the [Pygame][5] module. Previous articles are: +本期是使用 [Pygame][5] 模块在 [Python 3][4] 中创建视频游戏连载系列的第 7 期。往期文章为: - * [Learn how to program in Python by building a simple dice game][6] - * [Build a game framework with Python using the Pygame module][7] - * [How to add a player to your Python game][8] - * [Using Pygame to move your game character around][9] - * [What's a hero without a villain? How to add one to your Python game][10] - * [Simulate gravity in your Python game][2] + * [通过构建一个简单的掷骰子游戏去学习怎么用 Python 编程][6] + * [使用 Python 和 Pygame 模块构建一个游戏框架][7] + * [如何在你的 Python 游戏中添加一个玩家][8] + * [用 Pygame 使你的游戏角色移动起来][9] + * [如何向你的 Python 游戏中添加一个敌人][10] + * [在你的 Python 游戏中模拟重力][2] @@ -493,7 +492,7 @@ via: https://opensource.com/article/19/12/jumping-python-platformer-game 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[cycoe](https://github.com/cycoe) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b01f40ea8d95136e54416029b39237baecc1ce0a Mon Sep 17 00:00:00 2001 From: qianmingtian <40565099+qianmingtian@users.noreply.github.com> Date: Mon, 13 Jan 2020 21:12:03 +0800 Subject: [PATCH 337/430] Translated and fixed a space by qianmingtian --- ...d eMail With a List of User Accounts Expiring in -X- Days.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md b/translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md index 77fcbeed2b..1e073e3051 100644 --- a/translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md +++ b/translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md @@ -28,7 +28,7 @@ 本教程中包含两个 **[bash脚本][6]** 可以帮助您收集系统中用户到期日的信息。 -### 1) 检查10天后到期的用户帐户列表 +### 1) 检查 10 天后到期的用户帐户列表 此脚本将帮助您检查终端上 10 天内到期的用户帐户列表。 From 759e2c8180270e8a9e3ca80f4818b74eb9333b0a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Jan 2020 21:17:58 +0800 Subject: [PATCH 338/430] APL --- .../tech/20200105 PaperWM- tiled window management for GNOME.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/tech/20200105 PaperWM- tiled window management for GNOME.md b/translated/tech/20200105 PaperWM- tiled window management for GNOME.md index dab0726417..a110310251 100644 --- a/translated/tech/20200105 PaperWM- tiled window management for GNOME.md +++ b/translated/tech/20200105 PaperWM- tiled window management for GNOME.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (PaperWM: tiled window management for GNOME) From 3309887a712ae7253bbdad911d99dff64ced4599 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Jan 2020 21:30:43 +0800 Subject: [PATCH 339/430] PRF @geekpi --- ...erWM- tiled window management for GNOME.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20200105 PaperWM- tiled window management for GNOME.md b/translated/tech/20200105 PaperWM- tiled window management for GNOME.md index a110310251..7693b5446a 100644 --- a/translated/tech/20200105 PaperWM- tiled window management for GNOME.md +++ b/translated/tech/20200105 PaperWM- tiled window management for GNOME.md @@ -10,13 +10,15 @@ PaperWM:GNOME 下的平铺窗口管理 ====== -当我开始在个人计算机上使用 Linux 时,令我兴奋的第一件事就是轻巧的窗口管理器,这主要是因为当时我的笔记本电脑只有有 32MB 的内存,且没有其他可使用的内存。 +![](https://img.linux.net.cn/data/attachment/album/202001/13/212936hsk572f4jrsj2jsh.jpg) -接着我开始接触 [xmonad][1] 之类的平铺窗口管理器!我可以用键盘管理窗口了!它们太快了!我可以通过编写 Haskell 程序来配置 xmonad!我可以用各种有趣的方式自定义所有内容(例如使用 [dmenu][2] 作为启动器)!这些年来,我用过 3,4 个不同的平铺窗口管理器,它们很有趣。 +当我开始在个人计算机上使用 Linux 时,首先令我兴奋的就是轻巧的窗口管理器,这主要是因为当时我的笔记本电脑只有有 32MB 的内存,其它的都运行不了了。 -大约 6 年前,我觉得配置平铺窗口管理器对我来说不再是一件有趣的事情,因此转而使用 Ubuntu 桌面环境 Gnome。 (现在,我的笔记本电脑中的内存增加了 500 倍,这要快得多 :) ) +接着我开始接触 [xmonad][1] 之类的平铺窗口管理器!我可以用键盘管理窗口了!它们是如此之快!我可以通过编写 Haskell 程序来配置 xmonad!我可以用各种有趣的方式自定义所有内容(例如使用 [dmenu][2] 作为启动器)!这些年来,我用过 3、4 个不同的平铺窗口管理器,它们都很有趣。 -我使用 Gnome 已有很长时间了,但是我仍然有点想念平铺窗口管理器。六个月前,一个朋友告诉我有关 [PaperWM][3] 的消息,它使你可以在 Gnome中 平铺窗口!我立即安装了它,并从那时起我一直在使用它。 +大约 6 年前,我觉得配置平铺窗口管理器对我来说不再是一件有趣的事情,因此转而使用 Ubuntu 桌面环境 Gnome。(现在,我的笔记本电脑中的内存增加了 500 倍,这要快得多 :) ) + +我使用 Gnome 已有很长时间了,但是我仍然有点想念平铺窗口管理器。六个月前,一个朋友告诉我有关 [PaperWM][3] 的消息,它使你可以在 Gnome 中平铺窗口!我立即安装了它,并从那时起我一直在使用它。 ### PaperWM:Gnome 下的平铺窗口管理 @@ -26,7 +28,7 @@ PaperWM:GNOME 下的平铺窗口管理 ### “Paper” 表示你的所有窗户都在一行中 -PaperWM 的主要思想是将所有窗口排成一行,这实际上与传统的平铺窗口管理器大不相同,在传统的平铺窗口管理器中,你可以按任意方式平铺窗口。这是我写这篇博客时在几个窗口之间切换/调整大小的 gif 图像(有一个浏览器和两个终端窗口): +PaperWM 的主要想法是将所有窗口排成一行,这实际上与传统的平铺窗口管理器大不相同,在传统的平铺窗口管理器中,你可以按任意方式平铺窗口。这是我写这篇博客时在几个窗口之间切换/调整大小的 gif 图像(有一个浏览器和两个终端窗口): ![][4] @@ -38,16 +40,14 @@ PaperWM 的 Github README 链接了此视频:,它 还有很多其他功能,但这是我使用的功能: - * 在窗口之间左右移动(`Super + ,`, `Super + .`) -  * 按顺序向左/向右移动窗口(`Super+Shift+,`,`Super+Shift+.`) -  * 全屏显示窗口(`Super + f`) -  * 缩小窗口(`Super + r`) - - +* 在窗口之间左右移动(`Super + ,`、`Super + .`) +* 按顺序向左/向右移动窗口(`Super+Shift+,`、`Super+Shift+.`) +* 全屏显示窗口(`Super + f`) +* 缩小窗口(`Super + r`) ### 我喜欢不需要配置的工具 -我在笔记本上使用 PaperWM 已经6个月了,我真的很喜欢它!即使它是可配置(通过编写 Javascript 配置文件),我也非常欣赏它,它自带我想要的功能,我无需研究如何去配置。 +我在笔记本上使用 PaperWM 已经 6 个月了,我真的很喜欢它!即使它是可配置(通过编写 Javascript 配置文件),我也非常欣赏它,它自带我想要的功能,我无需研究如何去配置。 [fish shell][5] 是另一个类似的令人愉悦的工具,我基本上没有配置 fish(除了设置环境变量等),我真的很喜欢它的默认功能。 @@ -58,7 +58,7 @@ via: https://jvns.ca/blog/2020/01/05/paperwm/ 作者:[Julia Evans][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 3218e4aa8b7e9e4871dd2c2ce3b9606c0d005408 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Jan 2020 21:38:16 +0800 Subject: [PATCH 340/430] PUB @geekpi https://linux.cn/article-11779-1.html --- .../20200105 PaperWM- tiled window management for GNOME.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200105 PaperWM- tiled window management for GNOME.md (98%) diff --git a/translated/tech/20200105 PaperWM- tiled window management for GNOME.md b/published/20200105 PaperWM- tiled window management for GNOME.md similarity index 98% rename from translated/tech/20200105 PaperWM- tiled window management for GNOME.md rename to published/20200105 PaperWM- tiled window management for GNOME.md index 7693b5446a..ea412dae95 100644 --- a/translated/tech/20200105 PaperWM- tiled window management for GNOME.md +++ b/published/20200105 PaperWM- tiled window management for GNOME.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11779-1.html) [#]: subject: (PaperWM: tiled window management for GNOME) [#]: via: (https://jvns.ca/blog/2020/01/05/paperwm/) [#]: author: (Julia Evans https://jvns.ca/) From 6608f4dfc7bb89c4df675a9a77578f5d0e6a7287 Mon Sep 17 00:00:00 2001 From: qianmingtian <40565099+qianmingtian@users.noreply.github.com> Date: Mon, 13 Jan 2020 22:09:24 +0800 Subject: [PATCH 341/430] Translating by qianmingtian --- ...09 Huawei-s Linux Distribution openEuler is Available Now.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md b/sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md index 93c4330b52..6f762fd0a2 100644 --- a/sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md +++ b/sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qianmingtian) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 21922e846dd44a124f1c9b409dd626f66356dda1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Jan 2020 22:39:55 +0800 Subject: [PATCH 342/430] PRF @robsean --- ...21 Simulate gravity in your Python game.md | 416 +++++++++--------- 1 file changed, 205 insertions(+), 211 deletions(-) diff --git a/translated/tech/20191121 Simulate gravity in your Python game.md b/translated/tech/20191121 Simulate gravity in your Python game.md index fd02e851d6..e220aca3ff 100644 --- a/translated/tech/20191121 Simulate gravity in your Python game.md +++ b/translated/tech/20191121 Simulate gravity in your Python game.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Simulate gravity in your Python game) @@ -9,91 +9,87 @@ 在你的 Python 游戏中模拟引力 ====== -学习如何使用 Python 的 Pygame 模块编程电脑游戏,并开始操作引力。 -![Cosmic stars in outer space][1] -真实的世界充满了运动和生活。物理学使得真实的生活如此忙碌和动态。物理学是物质在空间中运动的方式。既然一个电脑游戏世界没有物质,它也就没有物理学规律,使用游戏程序员不得不 _模拟_ 物理学。 +> 学习如何使用 Python 的 Pygame 模块编程电脑游戏,并开始操作引力。 -从大多数电脑游戏来说,这里基本上仅有物理学的两个方向是重要的:引力和碰撞。 +![](https://img.linux.net.cn/data/attachment/album/202001/13/223923k6t4zmvvmo6tfmmg.png) -当你[添加一个敌人][2]到你的游戏中时,你实现了一下碰撞检测,但是这篇文章添加更多的东西,因为引力需要碰撞检测。想想为什么引力可能涉及碰撞。如果你不能想到任何原因,不要担心—当你通过示例代码工作时,它将变得明显。 +真实的世界充满了运动和生活。物理学使得真实的生活如此忙碌和动态。物理学是物质在空间中运动的方式。既然一个电脑游戏世界没有物质,它也就没有物理学规律,使用游戏程序员不得不*模拟*物理学。 -引力在真实世界中的是有质量的物体来相互吸引的趋势。物体(质量)越大,它施加越大的引力作用。在电脑游戏物理学中,你不必创建质量足够大的物体来证明引力的正确;你可以在电脑游戏世界本身中仅编程一个物体落向假设的最大的对象的倾向。 +从大多数电脑游戏来说,这里基本上仅有两个方面的物理学是重要的:引力和碰撞。 + +当你[添加一个敌人][2]到你的游戏中时,你实现了一些碰撞检测,但是这篇文章要添加更多的东西,因为引力需要碰撞检测。想想为什么引力可能涉及碰撞。如果你不能想到任何原因,不要担心 —— 它会随着你开发示例代码工作而且显然。 + +在真实世界中的引力是有质量的物体来相互吸引的倾向性。物体(质量)越大,它施加越大的引力作用。在电脑游戏物理学中,你不必创建质量足够大的物体来证明引力的正确;你可以在电脑游戏世界本身中仅编程一个物体落向假设的最大的对象的倾向。 ### 添加一个引力函数 -记住你的玩家已经有一个属性来决定动作。使用这个属性来将玩家精灵拉向屏幕底部。 +记住你的玩家已经有了一个决定动作的属性。使用这个属性来将玩家精灵拉向屏幕底部。 在 Pygame 中,较高的数字更接近屏幕的底部边缘。 -在真实的世界中,引力影响一切。然而,在平台中,引力是有选择性的—如果你添加引力到你的整个游戏世界,你所有平台都将掉到地上。作为替换,你仅添加引力到你的玩家和敌人精灵中。 - -首先,在你的 **Player** 类中添加一个 **引力** 函数: +在真实的世界中,引力影响一切。然而,在平台游戏中,引力是有选择性的 —— 如果你添加引力到你的整个游戏世界,你的所有平台都将掉到地上。反之,你可以仅添加引力到你的玩家和敌人精灵中。 +首先,在你的 `Player` 类中添加一个 `gravity` 函数: ```     def gravity(self): -        self.movey += 3.2 # how fast player falls +        self.movey += 3.2 # 玩家掉落的多快 ``` 这是一个简单的函数。首先,不管你的玩家是否想运动,你设置你的玩家垂直运动。也就是说,你已经编程你的玩家总是在下降。这基本上就是引力。 -为使引力函数生效,你必需在你的主循环中调用它。这样,当每一个时钟滴答作响时,Python 应用下落运动到你玩家。 +为使引力函数生效,你必须在你的主循环中调用它。这样,当每一个处理循环时,Python 都应用下落运动到你的玩家。 在这代码中,添加第一行到你的循环中: - ``` -    player.gravity() # check gravity +    player.gravity() # 检查引力     player.update() ``` -启动你的游戏来看看会发生什么。注意,因为它快速地发生:你是玩家从天空上下落,恰好从你的游戏屏幕落下。 +启动你的游戏来看看会发生什么。要注意,因为它发生的很快:你是玩家从天空上下落,马上掉出了你的游戏屏幕。 你的引力模拟是工作的,但是,也许太好了。 作为一次试验,尝试更改你玩家下落的速度。 -### 添加一个地板到引力 +### 给引力添加一个地板 -你的游戏没有办法发现你的角色掉落出世界的问题。在一些游戏中,如果一个玩家掉落出世界,该精灵被删除,并在新的位置重生。在其它的游戏中,玩家丢失分数或一条生命。当一个玩家掉落出世界时,不管你想发生什么,你必需能够侦测出玩家何时消失在屏幕外。 +你的游戏没有办法发现你的角色掉落出世界的问题。在一些游戏中,如果一个玩家掉落出世界,该精灵被删除,并在某个新的位置重生。在另一些游戏中,玩家会丢失分数或一条生命。当一个玩家掉落出世界时,不管你想发生什么,你必须能够侦测出玩家何时消失在屏幕外。 -在 Python 中,要检查一个条件,你可以使用一个 **if** 语句。 +在 Python 中,要检查一个条件,你可以使用一个 `if` 语句。 -你必需查看你玩家**是否**正在掉落,以及你的玩家掉落到什么程度。如果你的玩家掉落到屏幕的底部,那么你可以做 _一些事情_ 。 为保持事情简单,设置玩家精灵的位置为底部边缘上方20像素。 - -使你的 **引力** 函数看起来像这样: +你必需查看你玩家**是否**正在掉落,以及你的玩家掉落的程度。如果你的玩家掉落到屏幕的底部,那么你可以做*一些事情*。简化一下,设置玩家精灵的位置为底部边缘上方 20 像素。 +使你的 `gravity` 函数看起来像这样: ```     def gravity(self): -        self.movey += 3.2 # how fast player falls +        self.movey += 3.2 # 玩家掉落的多快                 if self.rect.y > worldy and self.movey >= 0:             self.movey = 0             self.rect.y = worldy-ty ``` -然后,启动你的游戏。你的精灵仍然下落,但是它停在屏幕的底部。不过,你也许不能 _看到_ 你在地面层下的精灵。一个简单的解决方法是,在精灵碰撞游戏世界的底部后,通过添加另一个 **-ty** 到它的新 Y 位置,从而使你的精灵弹跳更高: - +然后,启动你的游戏。你的精灵仍然下落,但是它停在屏幕的底部。不过,你也许不能*看到*你在地面层之上的精灵。一个简单的解决方法是,在精灵碰撞游戏世界的底部后,通过添加另一个 `-ty` 到它的新 Y 位置,从而使你的精灵弹跳到更高处: ```     def gravity(self): -        self.movey += 3.2 # how fast player falls +        self.movey += 3.2 # 玩家掉落的多快                 if self.rect.y > worldy and self.movey >= 0:             self.movey = 0             self.rect.y = worldy-ty-ty ``` -现在你的玩家在屏幕底部弹跳,恰好在你地面层精灵的后面。 +现在你的玩家在屏幕底部弹跳,恰好在你地面精灵上面。 你的玩家真正需要的是反抗引力的方法。引力问题是,你不能反抗它,除非你有一些东西来推开引力作用。因此,在接下来的文章中,你将添加地面和平台碰撞以及跳跃能力。在这期间,尝试应用引力到敌人精灵。 - 到目前为止,这里是全部的代码: - ``` #!/usr/bin/env python3 # draw a world @@ -106,7 +102,7 @@ # GNU All-Permissive License # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved.  This file is offered as-is, +# notice and this notice are preserved. This file is offered as-is, # without any warranty. import pygame @@ -118,163 +114,163 @@ Objects ''' class Platform(pygame.sprite.Sprite): -    # x location, y location, img width, img height, img file     -    def __init__(self,xloc,yloc,imgw,imgh,img): -        pygame.sprite.Sprite.__init__(self) -        self.image = pygame.image.load(os.path.join('images',img)).convert() -        self.image.convert_alpha() -        self.rect = self.image.get_rect() -        self.rect.y = yloc -        self.rect.x = xloc + # x location, y location, img width, img height, img file + def __init__(self,xloc,yloc,imgw,imgh,img): + pygame.sprite.Sprite.__init__(self) + self.image = pygame.image.load(os.path.join('images',img)).convert() + self.image.convert_alpha() + self.rect = self.image.get_rect() + self.rect.y = yloc + self.rect.x = xloc class Player(pygame.sprite.Sprite): -    ''' -    Spawn a player -    ''' -    def __init__(self): -        pygame.sprite.Sprite.__init__(self) -        self.movex = 0 -        self.movey = 0 -        self.frame = 0 -        self.health = 10 -        self.score = 1 -        self.images = [] -        for i in range(1,9): -            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() -            img.convert_alpha() -            img.set_colorkey(ALPHA) -            self.images.append(img) -            self.image = self.images[0] -            self.rect  = self.image.get_rect() + ''' + Spawn a player + ''' + def __init__(self): + pygame.sprite.Sprite.__init__(self) + self.movex = 0 + self.movey = 0 + self.frame = 0 + self.health = 10 + self.score = 1 + self.images = [] + for i in range(1,9): + img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() + img.convert_alpha() + img.set_colorkey(ALPHA) + self.images.append(img) + self.image = self.images[0] + self.rect = self.image.get_rect() -    def gravity(self): -        self.movey += 3.2 # how fast player falls -        -        if self.rect.y > worldy and self.movey >= 0: -            self.movey = 0 -            self.rect.y = worldy-ty-ty -        -    def control(self,x,y): -        ''' -        control player movement -        ''' -        self.movex += x -        self.movey += y -        -    def update(self): -        ''' -        Update sprite position -        ''' + def gravity(self): + self.movey += 3.2 # how fast player falls + + if self.rect.y > worldy and self.movey >= 0: + self.movey = 0 + self.rect.y = worldy-ty-ty + + def control(self,x,y): + ''' + control player movement + ''' + self.movex += x + self.movey += y + + def update(self): + ''' + Update sprite position + ''' -        self.rect.x = self.rect.x + self.movex -        self.rect.y = self.rect.y + self.movey + self.rect.x = self.rect.x + self.movex + self.rect.y = self.rect.y + self.movey -        # moving left -        if self.movex < 0: -            self.frame += 1 -            if self.frame > ani*3: -                self.frame = 0 -            self.image = self.images[self.frame//ani] + # moving left + if self.movex < 0: + self.frame += 1 + if self.frame > ani*3: + self.frame = 0 + self.image = self.images[self.frame//ani] -        # moving right -        if self.movex > 0: -            self.frame += 1 -            if self.frame > ani*3: -                self.frame = 0 -            self.image = self.images[(self.frame//ani)+4] + # moving right + if self.movex > 0: + self.frame += 1 + if self.frame > ani*3: + self.frame = 0 + self.image = self.images[(self.frame//ani)+4] -        # collisions -        enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) -        for enemy in enemy_hit_list: -            self.health -= 1 -            print(self.health) + # collisions + enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) + for enemy in enemy_hit_list: + self.health -= 1 + print(self.health) -        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) -        for g in ground_hit_list: -            self.health -= 1 -            print(self.health) + ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) + for g in ground_hit_list: + self.health -= 1 + print(self.health) class Enemy(pygame.sprite.Sprite): -    ''' -    Spawn an enemy -    ''' -    def __init__(self,x,y,img): -        pygame.sprite.Sprite.__init__(self) -        self.image = pygame.image.load(os.path.join('images',img)) -        #self.image.convert_alpha() -        #self.image.set_colorkey(ALPHA) -        self.rect = self.image.get_rect() -        self.rect.x = x -        self.rect.y = y -        self.counter = 0 -        -    def move(self): -        ''' -        enemy movement -        ''' -        distance = 80 -        speed = 8 + ''' + Spawn an enemy + ''' + def __init__(self,x,y,img): + pygame.sprite.Sprite.__init__(self) + self.image = pygame.image.load(os.path.join('images',img)) + #self.image.convert_alpha() + #self.image.set_colorkey(ALPHA) + self.rect = self.image.get_rect() + self.rect.x = x + self.rect.y = y + self.counter = 0 + + def move(self): + ''' + enemy movement + ''' + distance = 80 + speed = 8 -        if self.counter >= 0 and self.counter <= distance: -            self.rect.x += speed -        elif self.counter >= distance and self.counter <= distance*2: -            self.rect.x -= speed -        else: -            self.counter = 0 + if self.counter >= 0 and self.counter <= distance: + self.rect.x += speed + elif self.counter >= distance and self.counter <= distance*2: + self.rect.x -= speed + else: + self.counter = 0 -        self.counter += 1 + self.counter += 1 class Level(): -    def bad(lvl,eloc): -        if lvl == 1: -            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy -            enemy_list = pygame.sprite.Group() # create enemy group -            enemy_list.add(enemy)              # add enemy to group -            -        if lvl == 2: -            print("Level " + str(lvl) ) + def bad(lvl,eloc): + if lvl == 1: + enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy + enemy_list = pygame.sprite.Group() # create enemy group + enemy_list.add(enemy) # add enemy to group + + if lvl == 2: + print("Level " + str(lvl) ) -        return enemy_list + return enemy_list -    def loot(lvl,lloc): -        print(lvl) + def loot(lvl,lloc): + print(lvl) -    def ground(lvl,gloc,tx,ty): -        ground_list = pygame.sprite.Group() -        i=0 -        if lvl == 1: -            while i < len(gloc): -                ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') -                ground_list.add(ground) -                i=i+1 + def ground(lvl,gloc,tx,ty): + ground_list = pygame.sprite.Group() + i=0 + if lvl == 1: + while i < len(gloc): + ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') + ground_list.add(ground) + i=i+1 -        if lvl == 2: -            print("Level " + str(lvl) ) + if lvl == 2: + print("Level " + str(lvl) ) -        return ground_list + return ground_list -    def platform(lvl,tx,ty): -        plat_list = pygame.sprite.Group() -        ploc = [] -        i=0 -        if lvl == 1: -            ploc.append((0,worldy-ty-128,3)) -            ploc.append((300,worldy-ty-256,3)) -            ploc.append((500,worldy-ty-128,4)) + def platform(lvl,tx,ty): + plat_list = pygame.sprite.Group() + ploc = [] + i=0 + if lvl == 1: + ploc.append((0,worldy-ty-128,3)) + ploc.append((300,worldy-ty-256,3)) + ploc.append((500,worldy-ty-128,4)) -            while i < len(ploc): -                j=0 -                while j <= ploc[i][2]: -                    plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png') -                    plat_list.add(plat) -                    j=j+1 -                print('run' + str(i) + str(ploc[i])) -                i=i+1 + while i < len(ploc): + j=0 + while j <= ploc[i][2]: + plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png') + plat_list.add(plat) + j=j+1 + print('run' + str(i) + str(ploc[i])) + i=i+1 -        if lvl == 2: -            print("Level " + str(lvl) ) + if lvl == 2: + print("Level " + str(lvl) ) -        return plat_list + return plat_list ''' Setup @@ -283,12 +279,12 @@ worldx = 960 worldy = 720 fps = 40 # frame rate -ani = 4  # animation cycles +ani = 4 # animation cycles clock = pygame.time.Clock() pygame.init() main = True -BLUE  = (25,25,200) +BLUE = (25,25,200) BLACK = (23,23,23 ) WHITE = (254,254,254) ALPHA = (0,255,0) @@ -312,8 +308,8 @@ ty = 64 #tile size i=0 while i <= (worldx/tx)+tx: -    gloc.append(i*tx) -    i=i+1 + gloc.append(i*tx) + i=i+1 enemy_list = Level.bad( 1, eloc ) ground_list = Level.ground( 1,gloc,tx,ty ) @@ -323,45 +319,45 @@ plat_list = Level.platform( 1,tx,ty ) Main loop ''' while main == True: -    for event in pygame.event.get(): -        if event.type == pygame.QUIT: -            pygame.quit(); sys.exit() -            main = False + for event in pygame.event.get(): + if event.type == pygame.QUIT: + pygame.quit(); sys.exit() + main = False -        if event.type == pygame.KEYDOWN: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                print("LEFT") -                player.control(-steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                print("RIGHT") -                player.control(steps,0) -            if event.key == pygame.K_UP or event.key == ord('w'): -                print('jump') + if event.type == pygame.KEYDOWN: + if event.key == pygame.K_LEFT or event.key == ord('a'): + print("LEFT") + player.control(-steps,0) + if event.key == pygame.K_RIGHT or event.key == ord('d'): + print("RIGHT") + player.control(steps,0) + if event.key == pygame.K_UP or event.key == ord('w'): + print('jump') -        if event.type == pygame.KEYUP: -            if event.key == pygame.K_LEFT or event.key == ord('a'): -                player.control(steps,0) -            if event.key == pygame.K_RIGHT or event.key == ord('d'): -                player.control(-steps,0) -            if event.key == pygame.K_UP or event.key == ord('w'): -                print('jump') + if event.type == pygame.KEYUP: + if event.key == pygame.K_LEFT or event.key == ord('a'): + player.control(steps,0) + if event.key == pygame.K_RIGHT or event.key == ord('d'): + player.control(-steps,0) + if event.key == pygame.K_UP or event.key == ord('w'): + print('jump') -            if event.key == ord('q'): -                pygame.quit() -                sys.exit() -                main = False + if event.key == ord('q'): + pygame.quit() + sys.exit() + main = False -    world.blit(backdrop, backdropbox) -    player.gravity() # check gravity -    player.update() -    player_list.draw(world) -    enemy_list.draw(world) -    ground_list.draw(world) -    plat_list.draw(world) -    for e in enemy_list: -        e.move() -    pygame.display.flip() -    clock.tick(fps) + world.blit(backdrop, backdropbox) + player.gravity() # check gravity + player.update() + player_list.draw(world) + enemy_list.draw(world) + ground_list.draw(world) + plat_list.draw(world) + for e in enemy_list: + e.move() + pygame.display.flip() + clock.tick(fps) ``` * * * @@ -375,8 +371,6 @@ while main == True: * [如何向你的 Python 游戏中添加一个敌人][2] * [在 Pygame 游戏中放置平台][9] - - -------------------------------------------------------------------------------- via: https://opensource.com/article/19/11/simulate-gravity-python @@ -384,7 +378,7 @@ via: https://opensource.com/article/19/11/simulate-gravity-python 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -394,8 +388,8 @@ via: https://opensource.com/article/19/11/simulate-gravity-python [2]: https://opensource.com/article/18/5/pygame-enemy [3]: https://www.python.org/ [4]: https://www.pygame.org -[5]: https://opensource.com/article/17/10/python-101 -[6]: https://opensource.com/article/17/12/game-framework-python -[7]: https://opensource.com/article/17/12/game-python-add-a-player -[8]: https://opensource.com/article/17/12/game-python-moving-player -[9]: https://opensource.com/article/18/7/put-platforms-python-game +[5]: https://linux.cn/article-9071-1.html +[6]: https://linux.cn/article-10850-1.html +[7]: https://linux.cn/article-10858-1.html +[8]: https://linux.cn/article-10874-1.html +[9]: https://linux.cn/article-10883-1.html From 5cb14926d2c1d394bf9da7746c85d586a9cb8345 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Jan 2020 22:40:22 +0800 Subject: [PATCH 343/430] PUB @robsean https://linux.cn/article-11780-1.html --- .../20191121 Simulate gravity in your Python game.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191121 Simulate gravity in your Python game.md (99%) diff --git a/translated/tech/20191121 Simulate gravity in your Python game.md b/published/20191121 Simulate gravity in your Python game.md similarity index 99% rename from translated/tech/20191121 Simulate gravity in your Python game.md rename to published/20191121 Simulate gravity in your Python game.md index e220aca3ff..e69c8a86ce 100644 --- a/translated/tech/20191121 Simulate gravity in your Python game.md +++ b/published/20191121 Simulate gravity in your Python game.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11780-1.html) [#]: subject: (Simulate gravity in your Python game) [#]: via: (https://opensource.com/article/19/11/simulate-gravity-python) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 26e965e2c3dd8d416ed59f1613f00500471152bf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Jan 2020 22:48:46 +0800 Subject: [PATCH 344/430] PRF --- published/20191121 Simulate gravity in your Python game.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20191121 Simulate gravity in your Python game.md b/published/20191121 Simulate gravity in your Python game.md index e69c8a86ce..309dbf2091 100644 --- a/published/20191121 Simulate gravity in your Python game.md +++ b/published/20191121 Simulate gravity in your Python game.md @@ -385,11 +385,11 @@ via: https://opensource.com/article/19/11/simulate-gravity-python [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/space_stars_cosmic.jpg?itok=bE94WtN- (Cosmic stars in outer space) -[2]: https://opensource.com/article/18/5/pygame-enemy +[2]: https://linux.cn/article-10883-1.html [3]: https://www.python.org/ [4]: https://www.pygame.org [5]: https://linux.cn/article-9071-1.html [6]: https://linux.cn/article-10850-1.html [7]: https://linux.cn/article-10858-1.html [8]: https://linux.cn/article-10874-1.html -[9]: https://linux.cn/article-10883-1.html +[9]: https://linux.cn/article-10902-1.html From 0e93ba1e8549748664271e32ef44dc4e6cf96496 Mon Sep 17 00:00:00 2001 From: qianmingtian Date: Mon, 13 Jan 2020 23:21:50 +0800 Subject: [PATCH 345/430] Translated by qianmingtian --- ...Distribution openEuler is Available Now.md | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md b/sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md index 93c4330b52..ea6b5d24a5 100644 --- a/sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md +++ b/sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (qianmingtian) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -7,58 +7,59 @@ [#]: via: (https://itsfoss.com/openeuler/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -Huawei’s Linux Distribution openEuler is Available Now! +华为的linux发行版 openEuler 可以使用了! ====== -Huawei offers a CentOS based enterprise Linux distribution called EulerOS. Recently, Huawei has released a community edition of EulerOS called [openEuler][1]. +华为提供了一个基于 CentOS 的企业 Linux 发行版 EulerOS 。最近,华为发布了一个名为 [openEuler][1] 的 EulerOS 社区版。 -The source code of openEuler is released as well. You won’t find it on Microsoft owned GitHub – the source code is available at [Gitee][2], a Chinese [alternative of GitHub][3]. +openEuler 的源代码也被发布了。你在微软旗下的 GitHub 上找不到它——源代码可以在 [Gitee][2] 找到,这是一个中文的 [GitHub 的替代品][3] 。 -There are two separate repositories, one for the [source code][2] and the other as a [package source][4] to store software packages that help to build the OS. +它有两个独立的存储库,一个用于存储[源代码][2],另一个作为[包源][4] 存储有助于构建操作系统的软件包。 -![][5] +![][5] -The openEuler infrastructure team shared their experience to make the source code available: +openuler 基础架构团队分享了他们使源代码可用的经验: -> We are very excited at this moment. It was hard to imagine that we will manage thousands of repositories. And to ensure that they can be compiled successfully, we would like to thank all those who participated in contributing +>我们现在很兴奋。很难想象我们会管理成千上万的仓库。为了确保它们能被成功地编译,我们要感谢所有参与贡献的人。 -### openEuler is a Linux distribution based on CentOS +### openEuler 是基于 CentOS 的 Linux 发行版 -Like EulerOS, openEuler OS is also based on [CentOS][6] but is further developed by Huawei Technologies for enterprise applications. +与 EulerOS 一样,openEuler OS 也是基于 [CentOS][6],但华为技术有限公司为企业应用进一步开发了该操作系统。 -It is tailored for ARM64 architecture servers and Huawei claims to have made changes to boost its performance. You can read more about it at [Huawei’s dev blog][7]. +它是为 ARM64 架构的服务器量身定做的,同时华为声称已经做了一些改变来提高其性能。你可以在[华为发展博客][7]上了解更多。 ![][8] -At the moment, as per the official openEuler announcement, there are more than 50 contributors with nearly 600 commits for openEuler. -The contributors made it possible to make the source code available to the community. +目前,根据 openEuler 的官方声明,有 50 多名贡献者为 openEuler 贡献了近 600 个提交。 -It is also worth noting that the repositories also include two new projects (or sub-projects) associated with it, [iSulad][9] **and A-Tune**. +贡献者使源代码对社区可用成为可能。 -A-Tune is an AI-based OS tuning software and iSulad is a lightweight container runtime daemon that is designed for IoT and Cloud infrastructure, as mentioned on [Gitee][2]. +值得注意的是,存储库还包括两个与之相关的新项目(或子项目),[iSulad][9] 和 **A-Tune**。 -Also, the official [announcement post][10] mentioned that these systems are built on the Huawei Cloud through script automation. So, that is definitely something interesting. +A-Tune 是一个基于 AI 的操作系统调优软件, iSulad 是一个轻量级的容器运行时守护进程,如[Gitee][2]中提到的那样,它是为物联网和云基础设施设计的。 -### Downloading openEuler +另外,官方的[公告][10]提到,这些系统是在华为云上通过脚本自动化构建的。这确实十分有趣。 + +### 下载 openEuler ![][11] -As of now, you won’t find the documentation for it in English – so you will have to wait for it or choose to help them with the [documentation][12]. +到目前为止,你找不到它的英文文档,所以你必须等待或选择通过[文档][12]帮助他们。 -You can download the ISO directly from its [official website][13] to test it out: +你可以直接从它的[官方网站][13]下载 ISO 来测试它: -[Download openEuler][13] +[下载 openEuler ][13] -### What do you think of Huawei openEuler? +### 你认为华为的 openEuler 怎么样? -As per cnTechPost, Huawei had announced that EulerOS would become open source under the new name openEuler. +据 cnTechPost 报道,华为曾宣布 EulerOS 将以新名字 openEuler 成为开源软件。 -At this point, it’s not clear if openEuler is replacing EulerOS or both will exist together like CentOS (community edition) and Red Hat (commercial edition). +目前还不清楚 openEuler 是否会取代 EulerOS ,或者两者会像 CentOS (社区版)和 Red Hat (商业版)一样同时存在。 -I haven’t tested it yet so I cannot say if openEuler is suitable for English speaking users or not. +我还没有测试过它,所以我不能说 openEuler 是否适合英文用户。 -Are you willing to give this a try? In case you’ve already tried it out, feel free to let me know your experience with it in the comments below. +你愿意试一试吗?如果你已经尝试过了,欢迎在下面的评论中告诉我你的体验。 -------------------------------------------------------------------------------- @@ -66,13 +67,14 @@ via: https://itsfoss.com/openeuler/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[qianmingtian][c] 校对:[校对者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 +[c]: (https://github.com/qianmingtian) [1]: https://openeuler.org/en/ [2]: https://gitee.com/openeuler [3]: https://itsfoss.com/github-alternatives/ From 6ded4c1e208b94712515a232db00fa7e35307e0c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Jan 2020 23:21:58 +0800 Subject: [PATCH 346/430] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @qianmingtian 恭喜你完成了第一篇翻译 --- ...t of User Accounts Expiring in -X- Days.md | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md b/translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md index 1e073e3051..a7264d60c7 100644 --- a/translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md +++ b/translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md @@ -1,40 +1,36 @@ [#]: collector: (lujun9972) [#]: translator: (qianmingtian) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Bash Script to Send eMail With a List of User Accounts Expiring in “X” Days) [#]: via: (https://www.2daygeek.com/bash-script-to-check-user-account-password-expiry-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) -使用Bash 脚本发送包含 “X” 天内到期的用户账号列表的电子邮件 +使用 Bash 脚本发送包含几天内到期的用户账号列表的电子邮件 ====== -密码强制策略对所有操作系统和应用程序都是通用的。 +![](https://img.linux.net.cn/data/attachment/album/202001/13/232047vfxkrr47mn7eapda.jpg) -如果要 **[在Linux上实现密码强制策略][1]** ,请参阅以下文章。 +密码强制策略对所有操作系统和应用程序都是通用的。如果要[在 Linux 上实现密码强制策略][1],请参阅以下文章。 -默认情况下,大多数公司都会强制执行密码强制策略,但根据公司的要求,密码的时间周期会有所不同。 +默认情况下,大多数公司都会强制执行密码强制策略,但根据公司的要求,密码的时间周期会有所不同。通常每个人都使用 90 天的密码周期。用户只会在他们使用的一些服务器上[更改密码][2],而不会在他们不经常使用的服务器上更改密码。 -通常每个人都使用 90 天的密码周期。 +特别地,大多数团队忘记更改服务帐户密码,这可能导致日常工作的中断,即使他们配置有[基于 SSH 密钥的身份验证][3]。如果用户帐户密码过期,基于SSH密钥的身份验证和 [cronjob][4] 将不起作用。 -用户只会在他们使用的一些服务器上 **[更改密码][2]**,而不会在他们不经常使用的服务器上更改密码。 +为了避免这种情况,我们创建了一个 [shell 脚本][5]来向你发送 10 天内到期的用户帐户列表。 -特别地,大多数团队忘记更改服务帐户密码,这可能导致日常工作的中断,即使他们配置有 **[SSH基于密钥的身份验证][3]** 。 - -如果用户帐户密码过期,基于SSH密钥的身份验证和 **[cronjobs][4]** 将不起作用。 - -为了避免这种情况,我们创建了一个 **[shell脚本][5]** 来向您发送 10 天内到期的用户帐户列表。 - -本教程中包含两个 **[bash脚本][6]** 可以帮助您收集系统中用户到期日的信息。 +本教程中包含两个 [bash 脚本][6]可以帮助你收集系统中用户到期天数的信息。 ### 1) 检查 10 天后到期的用户帐户列表 -此脚本将帮助您检查终端上 10 天内到期的用户帐户列表。 +此脚本将帮助你在终端上检查 10 天内到期的用户帐户列表。 ``` # vi /opt/script/user-password-expiry.sh +``` +``` #!/bin/sh /tmp/user-expiry-1.txt /tmp/user-expiry.txt @@ -54,7 +50,7 @@ cat /tmp/user-expiry.txt | awk '$2 <= 10' > /tmp/user-expiry-1.txt cat /tmp/user-expiry-1.txt | column -t ``` -将文件 **“user password expiry.sh”** 设置为 Linux 可执行文件权限。 +将文件 `user-password-expiry.sh` 设置为可执行的 Linux 文件权限。 ``` # chmod +x /opt/script/user-password-expiry.sh @@ -73,18 +69,21 @@ u2 9 u3 3 u4 5 ``` + ### 2) 发送包含 10 天内到期的用户帐户列表的电子邮件 此脚本将发送一封包含 10 天内到期的用户帐户列表的邮件。 ``` # vi /opt/script/user-password-expiry-mail.sh +``` +``` #!/bin/sh SUBJECT="Information About User Password Expiration on "`date`"" MESSAGE="/tmp/user-expiry.txt" MESSAGE1="/tmp/user-expiry-1.txt" -TO="[email protected]" +TO="magesh.m@rentacenter.com" echo "-------------------------------------------------" >> $MESSAGE1 echo "UserName The number of days the password expires" >> $MESSAGE1 echo "-------------------------------------------------" >> $MESSAGE1 @@ -103,13 +102,13 @@ rm $MESSAGE rm $MESSAGE1 ``` -将文件 **“user-password-expiry-mail.sh”** 设置为 Linux 可执行文件权限。 +将文件 `user-password-expiry-mail.sh` 设置为可执行的 Linux 文件权限。 ``` # chmod +x /opt/script/user-password-expiry-mail.sh ``` -最后,添加一个 **[cronjob][4]** 去自动执行脚本。每天早上 8 点运行一次。 +最后,添加一个 [cronjob][4] 去自动执行脚本。每天早上 8 点运行一次。 ``` # crontab -e @@ -125,14 +124,14 @@ via: https://www.2daygeek.com/bash-script-to-check-user-account-password-expiry- 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] 译者:[qianmingtian][c] -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.2daygeek.com/author/magesh/ [b]: https://github.com/lujun9972 [c]: https://github.com/qianmingtian -[1]: https://www.2daygeek.com/how-to-set-password-complexity-policy-on-linux/ +[1]: https://linux.cn/article-11709-1.html [2]: https://www.2daygeek.com/linux-passwd-chpasswd-command-set-update-change-users-password-in-linux-using-shell-script/ [3]: https://www.2daygeek.com/configure-setup-passwordless-ssh-key-based-authentication-linux/ [4]: https://www.2daygeek.com/linux-crontab-cron-job-to-schedule-jobs-task/ From 55a7462779e2e3f63029040fc61ef75b061f8665 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Jan 2020 23:23:21 +0800 Subject: [PATCH 347/430] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @qianmingtian 本文首发地址: https://linux.cn/article-11781-1.html 你的 LCTT 专页地址: https://linux.cn/lctt/qianmingtian 请注册以领取 LCCN: https://lctt.linux.cn/ --- ...eMail With a List of User Accounts Expiring in -X- Days.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md (98%) diff --git a/translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md b/published/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md similarity index 98% rename from translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md rename to published/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md index a7264d60c7..9a46a42281 100644 --- a/translated/tech/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md +++ b/published/20200110 Bash Script to Send eMail With a List of User Accounts Expiring in -X- Days.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qianmingtian) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11781-1.html) [#]: subject: (Bash Script to Send eMail With a List of User Accounts Expiring in “X” Days) [#]: via: (https://www.2daygeek.com/bash-script-to-check-user-account-password-expiry-linux/) [#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) From bf643db505d3ef992fcb4a83c946cbab81434d47 Mon Sep 17 00:00:00 2001 From: qianmingtian Date: Mon, 13 Jan 2020 23:29:29 +0800 Subject: [PATCH 348/430] Translated by qianmigntian and Creat a folder of news to store article --- ...0109 Huawei-s Linux Distribution openEuler is Available Now.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md (100%) diff --git a/sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md b/translated/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md similarity index 100% rename from sources/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md rename to translated/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md From bfb7d22eed4fd29929dabdd7ca7dccd33b065c8d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 14 Jan 2020 00:55:18 +0800 Subject: [PATCH 349/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200114=2016=20P?= =?UTF-8?q?laces=20to=20Buy=20a=20Pre-installed=20Linux=20Laptop=20Online?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200114 16 Places to Buy a Pre-installed Linux Laptop Online.md --- ...Buy a Pre-installed Linux Laptop Online.md | 368 ++++++++++++++++++ 1 file changed, 368 insertions(+) create mode 100644 sources/tech/20200114 16 Places to Buy a Pre-installed Linux Laptop Online.md diff --git a/sources/tech/20200114 16 Places to Buy a Pre-installed Linux Laptop Online.md b/sources/tech/20200114 16 Places to Buy a Pre-installed Linux Laptop Online.md new file mode 100644 index 0000000000..c57b44dfd3 --- /dev/null +++ b/sources/tech/20200114 16 Places to Buy a Pre-installed Linux Laptop Online.md @@ -0,0 +1,368 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (16 Places to Buy a Pre-installed Linux Laptop Online) +[#]: via: (https://www.2daygeek.com/buy-linux-laptops-computers-online/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +16 Places to Buy a Pre-installed Linux Laptop Online +====== + +Linux runs on most hardware these days, but most retailers do not have Linux operating systems pre-installed on their hardware. + +Gone are the days when users would only buy a Windows OS pre-installed laptop. + +Over the years, developers have purchased many Linux laptops as they work on major Linux applications related to Docker, Kubernetes, AI, cloud-native computing and machine learning. + +But now-a-days users are eager to buy a Linux laptop instead of Windows, which allows many vendors to choose Linux OS. + +### Why Pre-installed Linux? + +Now-a-days normal users also started using Linux OS because of its open source nature, security and reliability. + +But most of the retailers around the world do not sell Linux operating system pre-installed. + +It is difficult for Linux aspirants to find the compatible hardware and drivers to get Linux OS installed. + +So, we recommend to have Linux OS pre-installed computers instead of figuring out compatibility issues. + +Here we list the top 16 (not in particular order) manufacturer/vendor best known for preloaded Linux OS computers. + +### 1) Dell + +Dell is a US multinational computer technology company that commenced to sell and distribute pre-installed Ubuntu Linux computers for several years now. + +Initially it was started on 2012 as a community project called Sputnik. + +The strong community support to the project became a product. Over the year they launched the first Dell XPS 13 Developer Edition (Sputnik 3) after fixing some major issues in Sputnik 1 and Sputnik 2. + +[![][1]][2] + +They sells Red hat Enterprise Linux and Ubuntu Linux-based laptop for business use, developers and sysadmins. + +All systems are preloaded with Ubuntu but few of them were certified to install Red Hat Enterprise Linux 7.5 and RHEL 8. + +I hope you can install other distro as well if you want to run but i didn’t try it. + +The signature Linux products of Dell are **[XPS developer edition][3]**, **[Precision mobile workstation][4]** and Precision tower workstation. + + * **Availability:** Worldwide + * **Product Details:** [Dell Linux Systems][5] + + + +### 2) System 76 + +**[System76][6]** is an American computer manufacturer based in Denver, Colorado specializing in the sale of notebooks, desktops, and servers. + +From the year 2003, Sytem76 started to computers with the Linux operating system installed. + +They developed Linux distribution named Pop!_OS based on Ubuntu using the GNOME Desktop Environment for developers and professionals. + +[![][1]][7] + +The products are categorized majorly based on portability, storage, graphics and CPU performance. + +Lower laptop model Galago Pro is costing around $950 and higher models such as Adder WS and Serval WS are costing around $2000. + +They provide Destops(Thelio variants) in range of $800 to $2600. + +They also sell mini servers(Meerkat) ranges from $500 and Larger Servers(Jackal, Ibex and Starling) with preloaded Ubuntu ranges from $3000. + +They provide the laptop with the coreboot open source firmware, which is an alternative to the proprietary BIOS firmware. + +System76 ships their products to 60 countries all around the world in Africa, Europe, Asia, North America, South America, Australia and Zealandia. + + * **Availability:** To 60 countries worldwide + * **Product Details:** [System76][8] + + + +### 3) Purism + +Purism is a US-based company that commenced its operation in 2014. + +It manufactures the Librem personal computing devices with a focus on software freedom, computer security, and Internet privacy. + +[![][1]][9] + +Purism sell their products with PureOS installed, a Linux distribution based on Debain developed by purism. + +They sell multiple customized products such as Laptops, Tablets, Smartphones, Server and Librem key. + + * **Availability:** Worldwide + * **Product Details:** [Purism][10] + + + +### 4) Slimbook + +**[Slimbook][11]** commenced their operation in 2015 based in spain. + +It is a Linux friendly product that offers Laptops, Desktops, Mini Pc’s,All in one PC’s and Servers. + +[![][1]][12] + +It sell their products with with preloaded variety of Linux distributions, windows or both. + +They were the first to sell KDE OS installed. It is ideal for Linux beginners, since it is easy to use and easy to learn. + +The Laptop body is made of metal alloy based on aluminum and magnesium. + + * **Availability:** Worldwide + * **Product Details:** [Slimbook][13] + + + +### 5) Tuxedo Computers + +Tuxedo computers a german based company sells notebooks, desktops and mini computers with preloaded Linux. + +Their products desktop cost starts from around 480EUR, mini computers starts from 430EUR and notebooks starts from around 815EUR. + +They have both intel and AMD processors and come up with 5 years warranty and lifetime support. + +TUXEDO Computers are individually built computers and PCs being fully Linux-suitable. They sell their products to most part of Europe and USA. + + * **Availability:** Ships to many countries + * **Product Details:** [Tuxedo Computers][14] + + + +### 6) ThinkPenguin + +ThinkPengine is a US based company started their operation in 2008 to improve support for GNU/Linux and other free software operating systems. + +They sell desktops, notebooks, network equipment, storage devices, printers, scanners and other accessories that are compatible with Linux. + +They provide warranty from 90days to 3years based on the products. + + * **Availability:** Worldwide + * **Product Details:** [ThinkPenguin][15] + + + +### 7) Emperor Linux + +EmperorLinux is a US based company,since 1999 they provides Linux laptops with full hardware support under Linux. + +They offers Linux laptops with unique features such as Molecule RD3D using Sharp’s ground-breaking Auto-Stereo 3D display, Panasonic’s ToughBook line of rugged & semi-rugged Linux laptops. + +They also sell fully-functional Linux tablets, the Raven tablet (based on the ThinkPad X series). + + * **Availability:** USA (International shipping is available upon request). + * **Product Details:** [Emperor Linux][16] + + + +### 8) ZaReason + +ZaReason opened for business in the year 2007 based in US. + +They mainly focuses on R&D labs, businesses both small and large, universities and people’s homes. + +It has a long career building hardware for different distros such as Debian, Fedora, Ubuntu, Kubuntu, Edubuntu and Linux Mint Preloaded. + +[![][1]][17] + +And customer can even choose Linux disros of their choose other than specified. + +Their laptop ranges from $999 to $1699. Their desktop and mini computers ranges from $499 to $1199. + +They do sell desktop specific for game lovers (Gamebox9400). + +Default warranty will be for a year. Additional cost includes for extending the warranty till 3 years. + + * **Availability:** USA and Canada + * **Product Details:** [ZaReason][18] + + + +### 9) LAC Portland + +LAC(Los Alamos Computers) Portland is a US based company, provides Linux-based computers configured and supported by GNU and Linux professionals since 2000. + +They sell Lenovo desktops(ThinkCentre and ThinkStation) ranges from $845 to $2215 and laptops(ThinkPad) ranges from $926 to $2380. + +They install and sell Linux distors such as Ubuntu, Linux Mint, Debain, Fedora, CentOS, Scientific Linux, Open SUSE and Free DOS. + +They provide five years hardware and labor warranty with on-site support options backed worldwide by Lenovo. + + * **Availability:** USA + * **Product Details:** [LAC Portland][19] + + + +### 10) Entroware + +Entroware is a UK based company specialized in providing Ubuntu based computing solutions and services since early 2014 based on customers requirements. + +They sell Ubuntu and Ubuntu MATE powered Desktops, Laptops, and Servers using modern and high quality components. + +[![][1]][20] + +They do sell mini computers and All-in-one computers. + +Desktop ranges from $499 to $1900, laptops ranges from $740 to $1900 and server ranges from $1150 to $2000. + +They also sell accessories such as OS recovery drive, external hard drive, etc. + +The default warranty is for 3 years, they have three warranty plans for which additional may include. They also provide software support. + +Entroware currently ships to UK, Republic of Ireland, France, Germany, Italy and Spain. + + * **Availability:** UK and other European countries (Republic of Ireland, France, Germany, Italy and Spain). + * **Product Details:** [Entroware][21] + + + +### 11) Vikings + +Viking is based in Germany, sells Libre-friendly hardware certified by the Free Software Foundation with preinstalled Debian, Trisquel or Parabola Linux based on customer requirement. + +They sell desktops, laptops, servers, routers, mainboards, key generators, PCI cards and usb sound adaptors compatible with Linux. + +The Linux laptops and desktops by Vikings come with core boot or Libreboot. + +Their desktop ranges from 895EUR, laptop ranges from 250EUR and servers ranges from 990EUR. + +They provide refurbished/used parts: mainboard, CPU(s) with rigorous testing of all parts and also gives a comprehensive guarantee for all parts of the system. + +Their product warranty varies from 1year to 3year, with subsequent additional charges. + +They ship to all part of the world with very few exceptions such as North Korea. + + * **Availability:** Worldwide + * **Product Details:** [Viking][22] + + + +### 12) Juno Computers + +Juno Computers is company based in UK comes with pre-installed elementary OS or Ubuntu. + +They provide an application known as Kronos which allows for quick and easy installation of commercial applications such as Chrome, Dropbox, Spotify, Skype, etc. + +Their laptop ranges from $945/357EUR to $999/933EUR and mini PC ranges around $549/490EUR. + +They provide a 1-year limited warranty on all manufacture problems. + +Currently they ship to mainland USA, some Canadian provinces, and most part of the world includes South Africa, Asia and Europe. + + * **Availability:** Worldwide + * **Product Details:** [Juno Computers][23] + + + +### 13) Pine64 + +Pine64 is a US based community platform that offers laptops (**[Pinebooks][24]**), Pine Phones, Pine Watches(PineTime), Single board computers and other compatible Linux accessories. + +It commenced its operation in the year 2016 powered by ARM devices. + +[![][1]][25] + +The laptops ranges from $100 to $200. + +All single board and accessories sold on the Pine store are entitled to a 30 days Limited Warranty against defects in materials and workmanship, but provide online support through their forum. + +They almost ship to most part of the country, refer site shipping policy for more details. + + * **Availability:** Worldwide + * **Product Details:** [Pine64][26] + + + +### 14) Libiquity + +Libiquity is a US based company with R&D investments and its own personal computer brand since 2011. + +They offer laptop(Taurinus X200) preloaded with Trisquel and comes with ProteanOS, a free/libre and open source embedded operating system distribution endorsed by Free Software Foundation. + +Laptop ranges starts from $375. Product comes with limited warrant of 1 year. Currently their shipping are limited to US. + + * **Availability:** US + * **Product Details:** [Libiquity][27] + + + +### 15) LinuxCertified + +LinuxCertified an US based company offers lenovo desktops and laptops with Linux distros preinstalled. + +Various preloaded Linux distros offered are Ubuntu, Fedora, Open SUSE, CentOS, Redhat Enterprise Linux and Oracle Enterprise Linux. + +Desktops(ThinkStation) ranges from $899 to $2199 and laptops(Z1, LC series) ranges from $899 to $2199. + +Product warranty is for one year. They ship their product within US. + + * **Availability:** Worldwide + * **Product Details:** [LinuxCertified][28] + + + +### 16) Star Labs + +**[Star Labs][29]** was created by a group of Linux users, who created the ultimate Linux laptop for their own use. + +It’s based in the United Kingdom which sells laptops with Linux pre-installed. + +[![][1]][30] + +Star Labs offer a range of laptops designed and built specifically for Linux. + +All of their laptops come with a choice of Ubuntu Linux, Linux Mint or Zorin OS pre-installed. + +It is not limited to the above three distributions, and you can install any Linux distros on their hardware, and it runs flawlessly. + + * **Availability:** Worldwide + * **Product Details:** [Star Labs][31] + + + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/buy-linux-laptops-computers-online/ + +作者:[Magesh Maruthamuthu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.2daygeek.com/author/magesh/ +[b]: https://github.com/lujun9972 +[1]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 +[2]: https://www.2daygeek.com/wp-content/uploads/2020/01/dell-xps-13-developer-deition-2.png +[3]: https://www.linuxtechnews.com/dells-new-xps-13-developer-edition-is-powered-by-the-10th-generation/ +[4]: https://www.linuxtechnews.com/dell-launches-three-new-dell-precision-developer-editions-laptops-preloaded-with-ubuntu-linux/ +[5]: https://www.dell.com/en-us/work/shop/overview/cp/linuxsystems +[6]: https://www.linuxtechnews.com/system76-has-announced-new-gazelle-laptops/ +[7]: https://www.2daygeek.com/wp-content/uploads/2020/01/system76-1.jpg +[8]: https://system76.com/laptops +[9]: https://www.2daygeek.com/wp-content/uploads/2020/01/librem-1.jpg +[10]: https://puri.sm/products/ +[11]: https://www.linuxtechnews.com/slimbook-is-offering-a-new-laptop-called-slimbook-pro-x/ +[12]: https://www.2daygeek.com/wp-content/uploads/2020/01/slimbook.jpg +[13]: https://slimbook.es/en/comparison-slimbook-pro-x-with-other-ultrabooks +[14]: https://www.tuxedocomputers.com/en/Linux-Hardware/Linux-Notebooks.tuxedo +[15]: https://www.thinkpenguin.com/catalog/notebook-computers-gnu-linux-2 +[16]: http://www.emperorlinux.com/systems/ +[17]: https://www.2daygeek.com/wp-content/uploads/2020/01/zareason-1.jpg +[18]: https://zareason.com/Laptops/ +[19]: https://shop.lacpdx.com/laptops/ +[20]: https://www.2daygeek.com/wp-content/uploads/2020/01/entroware.jpg +[21]: https://www.entroware.com/store/laptops +[22]: https://store.vikings.net/libre-friendly-hardware/x200-ryf-certfied +[23]: https://junocomputers.com/store/ +[24]: https://www.linuxtechnews.com/pinebook-pro-199-linux-laptop-pre-orders-ansi-iso-keyboards/ +[25]: https://www.2daygeek.com/wp-content/uploads/2020/01/Pinebook_Pro-photo-1.jpg +[26]: https://store.pine64.org/ +[27]: https://shop.libiquity.com/ +[28]: https://www.linuxcertified.com/linux_laptops.html +[29]: https://www.linuxtechnews.com/star-labs-offering-a-range-of-linux-laptops-with-zorin-os-15-pre-installed/ +[30]: https://www.2daygeek.com/wp-content/uploads/2020/01/starlabs-1.jpg +[31]: https://earth.starlabs.systems/pages/laptops From cd647dc917170514127d397669929ffcbb675e9b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 14 Jan 2020 00:55:46 +0800 Subject: [PATCH 350/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200113=20How=20?= =?UTF-8?q?to=20setup=20a=20DNS=20server=20with=20bind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200113 How to setup a DNS server with bind.md --- ...113 How to setup a DNS server with bind.md | 387 ++++++++++++++++++ 1 file changed, 387 insertions(+) create mode 100644 sources/tech/20200113 How to setup a DNS server with bind.md diff --git a/sources/tech/20200113 How to setup a DNS server with bind.md b/sources/tech/20200113 How to setup a DNS server with bind.md new file mode 100644 index 0000000000..897dc825a8 --- /dev/null +++ b/sources/tech/20200113 How to setup a DNS server with bind.md @@ -0,0 +1,387 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to setup a DNS server with bind) +[#]: via: (https://fedoramagazine.org/how-to-setup-a-dns-server-with-bind/) +[#]: author: (Curt Warfield https://fedoramagazine.org/author/rcurtiswarfield/) + +How to setup a DNS server with bind +====== + +![][1] + +The Domain Name System, or DNS, as it’s more commonly known, translates or converts domain names into the IP addresses associated with that domain. DNS is the reason you are able to find your favorite website by name instead of typing an IP address into your browser. This guide shows you how to configure a Master DNS system and one client. + +Here are system details for the example used in this article: + +``` +dns01.fedora.local (192.168.1.160 ) - Master DNS server +client.fedora.local (192.168.1.136 ) - Client +``` + +### DNS server configuration + +Install the bind packages using sudo: + +``` +$ sudo dnf install bind bind-utils -y +``` + +The _/etc/named.conf_ configuration file is provided by the _bind_ package to allow you to configure the DNS server. + +Edit the _/etc/named.conf_ file: + +``` +sudo vi /etc/named.conf +``` + +Look for the following line: + +``` +listen-on port 53 { 127.0.0.1; }; +``` + +Add the IP address of your Master DNS server as follows: + +``` +listen-on port 53 { 127.0.0.1; 192.168.1.160; }; +``` + +Look for the next line: + +``` +allow-query { localhost; }; +``` + +Add your local network range. The example system uses IP addresses in the 192.168.1.X range. This is specified as follows: + +``` +allow-query { localhost; 192.168.1.0/24; }; +``` + +Specify a forward and reverse zone. Zone files are simply text files that have the DNS information, such as IP addresses and host-names, on your system. The forward zone file makes it possible for the translation of a host-name to its IP address. The reverse zone file does the opposite. It allows a remote system to translate an IP address to the host name. + +Look for the following line at the bottom of the /etc/named.conf file: + +``` +include "/etc/named.rfc1912.zones"; +``` + +Here, you’ll specify the zone file information _**directly above that line**_ as follows: + +``` +zone "dns01.fedora.local" IN { +type master; +file "forward.fedora.local"; +allow-update { none; }; +}; + +zone "1.168.192.in-addr.arpa" IN { +type master; +file "reverse.fedora.local"; +allow-update { none; }; +}; +``` + +The _forward.fedora.local_ and the file _reverse.fedora.local_ are just the names of the zone files you will be creating. They can be called anything you like. + +Save and exit. + +#### Create the zone files + +Create the forward and reverse zone files you specified in the /etc/named.conf file: + +``` +$ sudo vi /var/named/forward.fedora.local +``` + +Add the following lines: + +``` +$TTL 86400 +@ IN SOA dns01.fedora.local. root.fedora.local. ( + 2011071001 ;Serial + 3600 ;Refresh + 1800 ;Retry + 604800 ;Expire + 86400 ;Minimum TTL +) +@ IN NS dns01.fedora.local. +@ IN A 192.168.1.160 +dns01 IN A 192.168.1.160 +client IN A 192.168.1.136 +``` + +Everything in _**bold**_ is specific to your environment. Save the file and exit. Next, edit the _reverse.fedora.local_ file: + +``` +$ sudo vi /var/named/reverse.fedora.local +``` + +Add the following lines: + +``` +$TTL 86400 +@ IN SOA dns01.fedora.local. root.fedora.local. ( + 2011071001 ;Serial + 3600 ;Refresh + 1800 ;Retry + 604800 ;Expire + 86400 ;Minimum TTL +) +@ IN NS dns01.fedora.local. +@ IN PTR fedora.local. +dns01 IN A 192.168.1.160 +client IN A 192.168.1.136 +160 IN PTR dns01.fedora.local. +136 IN PTR client.fedora.local. +``` + +Everything in _**bold**_ is also specific to your environment. Save the file and exit. + +You’ll also need to configure SELinux and add the correct ownership for the configuration files. + +``` +sudo chgrp named -R /var/named +sudo chown -v root:named /etc/named.conf +sudo restorecon -rv /var/named +sudo restorecon /etc/named.conf +``` + +Configure the firewall: + +``` +sudo firewall-cmd --add-service=dns --perm +sudo firewall-cmd --reload +``` + +#### Check the configuration for any syntax errors + +``` +sudo named-checkconf /etc/named.conf +``` + +Your configuration is valid if no output or errors are returned. + +Check the forward and reverse zone files. + +``` +$ sudo named-checkzone forward.fedora.local /var/named/forward.fedora.local + +$ sudo named-checkzone reverse.fedora.local /var/named/reverse.fedora.local +``` + +You should see a response of OK: + +``` +zone forward.fedora.local/IN: loaded serial 2011071001 +OK + +zone reverse.fedora.local/IN: loaded serial 2011071001 +OK +``` + +#### Enable and start the DNS service + +``` +$ sudo systemctl enable named +$ sudo systemctl start named +``` + +#### Configuring the resolv.conf file + +Edit the _/etc/resolv.conf_ file: + +``` +$ sudo vi /etc/resolv.conf +``` + +Look for your current name server line or lines. On the example system, a cable modem/router is serving as the name server and so it currently looks like this: + +``` +nameserver 192.168.1.1 +``` + +This needs to be changed to the IP address of the Master DNS server: + +``` +nameserver 192.168.1.160 +``` + +Save your changes and exit. + +Unfortunately there is one caveat to be aware of. NetworkManager overwrites the _/etc/resolv.conf_ file if the system is rebooted or networking gets restarted. This means you will lose all of the changes that you made. + +To prevent this from happening, make _/etc/resolv.conf_ immutable: + +``` +$ sudo chattr +i /etc/resolv.conf +``` + +If you want to set it back and allow it to be overwritten again: + +``` +$ sudo chattr -i /etc/resolv.conf +``` + +#### Testing the DNS server + +``` +$ dig fedoramagazine.org +``` + +``` +; <<>> DiG 9.11.13-RedHat-9.11.13-2.fc30 <<>> fedoramagazine.org +;; global options: +cmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8391 +;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 6 + +;; OPT PSEUDOSECTION: + ; EDNS: version: 0, flags:; udp: 4096 + ; COOKIE: c7350d07f8efaa1286c670ab5e13482d600f82274871195a (good) + ;; QUESTION SECTION: + ;fedoramagazine.org. IN A + +;; ANSWER SECTION: + fedoramagazine.org. 50 IN A 35.197.52.145 + +;; AUTHORITY SECTION: + fedoramagazine.org. 86150 IN NS ns05.fedoraproject.org. + fedoramagazine.org. 86150 IN NS ns02.fedoraproject.org. + fedoramagazine.org. 86150 IN NS ns04.fedoraproject.org. + +;; ADDITIONAL SECTION: + ns02.fedoraproject.org. 86150 IN A 152.19.134.139 + ns04.fedoraproject.org. 86150 IN A 209.132.181.17 + ns05.fedoraproject.org. 86150 IN A 85.236.55.10 + ns02.fedoraproject.org. 86150 IN AAAA 2610:28:3090:3001:dead:beef:cafe:fed5 + ns05.fedoraproject.org. 86150 IN AAAA 2001:4178:2:1269:dead:beef:cafe:fed5 + + ;; Query time: 830 msec + ;; SERVER: 192.168.1.160#53(192.168.1.160) + ;; WHEN: Mon Jan 06 08:46:05 CST 2020 + ;; MSG SIZE rcvd: 266 +``` + +There are a few things to look at to verify that the DNS server is working correctly. Obviously getting the results back are important, but that by itself doesn’t mean the DNS server is actually doing the work. + +The QUERY, ANSWER, and AUTHORITY fields at the top should show non-zero as it in does in our example: + +``` +;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 6 +``` + +And the SERVER field should have the IP address of your DNS server: + +``` +;; SERVER: 192.168.1.160#53(192.168.1.160) +``` + +In case this is the first time you’ve run the _dig_ command, notice how it took 830 milliseconds for the query to complete: + +``` +;; Query time: 830 msec +``` + +If you run it again, the query will run much quicker: + +``` +$ dig fedoramagazine.org +``` + +``` +;; Query time: 0 msec +;; SERVER: 192.168.1.160#53(192.168.1.160) +``` + +### Client configuration + +The client configuration will be a lot simpler. + +Install the bind utilities: + +``` +$ sudo dnf install bind-utils -y +``` + +Edit the /etc/resolv.conf file and configure the Master DNS as the only name server: + +``` +$ sudo vi /etc/resolv.conf +``` + +This is how it should look: + +``` +nameserver 192.168.1.160 +``` + +Save your changes and exit. Then, make the _/etc/resolv.conf_ file immutable to prevent it from be overwritten and going back to its default settings: + +``` +$ sudo chattr +i /etc/resolv.conf +``` + +#### Testing the client + +You should get the same results as you did from the DNS server: + +``` +$ dig fedoramagazine.org +``` + +``` +; <<>> DiG 9.11.13-RedHat-9.11.13-2.fc30 <<>> fedoramagazine.org +;; global options: +cmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8391 +;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 6 + +;; OPT PSEUDOSECTION: + ; EDNS: version: 0, flags:; udp: 4096 + ; COOKIE: c7350d07f8efaa1286c670ab5e13482d600f82274871195a (good) + ;; QUESTION SECTION: + ;fedoramagazine.org. IN A + +;; ANSWER SECTION: + fedoramagazine.org. 50 IN A 35.197.52.145 + +;; AUTHORITY SECTION: + fedoramagazine.org. 86150 IN NS ns05.fedoraproject.org. + fedoramagazine.org. 86150 IN NS ns02.fedoraproject.org. + fedoramagazine.org. 86150 IN NS ns04.fedoraproject.org. + +;; ADDITIONAL SECTION: + ns02.fedoraproject.org. 86150 IN A 152.19.134.139 + ns04.fedoraproject.org. 86150 IN A 209.132.181.17 + ns05.fedoraproject.org. 86150 IN A 85.236.55.10 + ns02.fedoraproject.org. 86150 IN AAAA 2610:28:3090:3001:dead:beef:cafe:fed5 + ns05.fedoraproject.org. 86150 IN AAAA 2001:4178:2:1269:dead:beef:cafe:fed5 + + ;; Query time: 1 msec + ;; SERVER: 192.168.1.160#53(192.168.1.160) + ;; WHEN: Mon Jan 06 08:46:05 CST 2020 + ;; MSG SIZE rcvd: 266 +``` + +Make sure the SERVER output has the IP Address of your DNS server. + +Your DNS server is now ready to use and all requests from the client should be going through your DNS server now! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-setup-a-dns-server-with-bind/ + +作者:[Curt Warfield][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/rcurtiswarfield/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/dns-server-bind-1-816x345.png From 139dc9f8c316463b2407f431e8e42f033c3ec70c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 14 Jan 2020 00:56:24 +0800 Subject: [PATCH 351/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200114=20LMMS:?= =?UTF-8?q?=20A=20Free=20&=20Open=20Source=20Digital=20Audio=20Workstation?= =?UTF-8?q?=20(DAW)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200114 LMMS- A Free - Open Source Digital Audio Workstation (DAW).md --- ... Source Digital Audio Workstation (DAW).md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20200114 LMMS- A Free - Open Source Digital Audio Workstation (DAW).md diff --git a/sources/tech/20200114 LMMS- A Free - Open Source Digital Audio Workstation (DAW).md b/sources/tech/20200114 LMMS- A Free - Open Source Digital Audio Workstation (DAW).md new file mode 100644 index 0000000000..1b3358f7bd --- /dev/null +++ b/sources/tech/20200114 LMMS- A Free - Open Source Digital Audio Workstation (DAW).md @@ -0,0 +1,127 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (LMMS: A Free & Open Source Digital Audio Workstation (DAW)) +[#]: via: (https://itsfoss.com/lmms/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +LMMS: A Free & Open Source Digital Audio Workstation (DAW) +====== + +_**In this week’s Linux application highlight, we take a look at a free and open-source DAW that helps make music with most of the essential features offered.**_ + +### LMMS: A Free & Open Source Software To Help Make Music + +[LMMS][1] is a cross-platform open source [DAW][2] hosted on [GitHub][3]. It is completely free to use and you do not need to purchase any kind of license to use it. + +If you’re curious, there’s no specific full-form for “LMMS” acronym but you can consider it along the lines of “**Let’s Make Music**” or formerly known as “**Linux MultiMedia Studio**” as stated in one of their [official forum post][4] years back. + +So, with the help of LMMS, you should be able to work on making music on Linux. + +Of course, you should not expect a free DAW to replace a full-fledged professional DAW bundled with proprietary plugins – but for starters, it isn’t a bad one. + +![][5] + +If you’re used to other DAWs, it might take a while to get comfortable with the user interface. For instance, I’ve used [Studio One][6] and [Mixcraft][7] as a beginner – so the UI of LMMS looked different. + +But, the good news is – you get a [detailed official documentation][8] of LMMS. So, if you have trouble learning how it works, simply refer to the official documentation available on their [website][1]. + +**Recommended Read:** + +![][9] + +#### [Best Audio Editors For Linux][10] + +These awesome free and open source audio editors let you create awesome music in Linux. Check out the list of top Linux audio editors. + +### Features of LMMS + +![][11] + +Just like any other DAW, you will find plugins, samples to use, instruments, and MIDI support. However, it is indeed a long list of features. So, instead of taking a whole day explaining it, let me highlight all the necessary features that LMMS provides. + + * Ability to add notes within the project without needing a separate note-taking app + * Bundled free plugins to use + * Note playback via MIDI or typing keyboard + * MIDI Editor + * Separate editor for instruments + * Track Automation support + * 64-bit VST instrument support (for wine-based VSTs) + * Built-in synthesizers that include some popular emulators for Yamaha and Roland + * Feature-rich audio plugins built-in + * Demo projects to easily get started + * Several samples included + * Native multisample support for SoundFont (SF2), Giga (GIG) and Gravis UltraSound (GUS) formats for high-quality instrument patches and banks (only if it’s relevant for your work) + * [LADSPA][12] plugin support + * You will also find the essential delay/reverb/compressor/limiter and distortion tools built-in + * Spectrum analyzer + + + +You can find some extensive [documentation on using LMMS][8]. If you face any difficulties, LMMS also has its [own forum][13] where you can ask for help. + +### Installing LMMS on Linux + +![][14] + +You can also find LMMS listed in the software center of your distribution- however, it might not feature the latest version. + +To get the latest LMMS version, you can download the .**AppImage** file from the [official download page][15]. If you want to take a look at the latest or previous releases on GitHub, you can find those in their [releases][16] section. + +If you want to use the AppImage file, you can refer to our guide on [using AppImage file][17]. + +You may also try [installing the Flatpak package][18] available on [Flathub][19]. + +[Download LMMS][15] + +### My Thoughts On LMMS + +![][20] + +Even though this is a feature-rich free and open-source DAW – personally, I found the UX a little dull. + +Of course, technically, it offers quite a lot of features and this could be useful for anyone who does not want to break their wallet to produce music. And, after all, it is an open-source solution. + +If you want a full-fledged professional DAW using the VST plugins, you might just hold on to Windows/Mac (if you’re used to it) because you still need to utilize Wine on Linux in order to make sure that the 64-bit VSTs work. + +**Wrapping Up** + +That being said, I’m not a professional music producer – so feel free to explore LMMS on Linux and make the most out of it without spending a penny. + +If you’ve used LMMS (or any similar DAW), let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/lmms/ + +作者:[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://lmms.io/ +[2]: https://en.wikipedia.org/wiki/Digital_audio_workstation +[3]: https://github.com/LMMS/lmms +[4]: https://lmms.io/forum/viewtopic.php?t=5908 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/lmms-screenshot.png?ssl=1 +[6]: https://www.presonus.com/products/studio-one/ +[7]: https://acoustica.com/mixcraft +[8]: https://docs.lmms.io/user-manual/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/01/linux-audio-editors.jpeg?fit=800%2C450&ssl=1 +[10]: https://itsfoss.com/best-audio-editors-linux/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/lmms-project.png?ssl=1 +[12]: https://www.ladspa.org/ +[13]: https://lmms.io/forum/ +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/lmms-setup.jpg?ssl=1 +[15]: https://lmms.io/download#linux +[16]: https://github.com/LMMS/lmms/releases +[17]: https://itsfoss.com/use-appimage-linux/ +[18]: https://itsfoss.com/flatpak-guide/ +[19]: https://flathub.org/apps/details/io.lmms.LMMS +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/lmms-midi-editor.png?ssl=1 From 075737d8223d57a0b4752b81a1d08e86993c500b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 14 Jan 2020 00:57:16 +0800 Subject: [PATCH 352/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200113=20Keep?= =?UTF-8?q?=20your=20email=20in=20sync=20with=20OfflineIMAP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200113 Keep your email in sync with OfflineIMAP.md --- ...eep your email in sync with OfflineIMAP.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/tech/20200113 Keep your email in sync with OfflineIMAP.md diff --git a/sources/tech/20200113 Keep your email in sync with OfflineIMAP.md b/sources/tech/20200113 Keep your email in sync with OfflineIMAP.md new file mode 100644 index 0000000000..1cd8370870 --- /dev/null +++ b/sources/tech/20200113 Keep your email in sync with OfflineIMAP.md @@ -0,0 +1,79 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Keep your email in sync with OfflineIMAP) +[#]: via: (https://opensource.com/article/20/1/sync-email-offlineimap) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Keep your email in sync with OfflineIMAP +====== +Mirroring your email to a local folder is the first step in taming your +message pileup. Learn how in the third article in our series on 20 ways +to be more productive with open source in 2020. +![email or newsletters via inbox and browser][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Sync your email locally with OfflineIMAP + +I have a love/hate relationship with email. I love the way it allows me to communicate with people all over the world. But, like many of you, I get a lot of mail, much of it from lists as well as spammers, advertisers, and the like. And it builds up. + +![The OfflineIMAP "blinkenlights" UI][2] + +Almost all the tools I've tried (outside of the big mail providers) that work really well with large amounts of mail have one thing in common: they all rely on a local copy of your mail stored in [Maildir][3] format. And the most useful tool for that is [OfflineIMAP][4]. OfflineIMAP is a Python script that mirrors IMAP mailboxes to a local Maildir folder tree. I use it to create a local copy of my mail and keep it in sync. Most Linux distributions include it, and it is available via Python's pip package manager. + +The sample minimal configuration file is a good template to start with; begin by copying it to **~/.offlineimaprc**. Mine looks something like this: + + +``` +[general] +accounts = LocalSync +ui=Quiet +autorefresh=30 + +[Account LocalSync] +localrepository = LocalMail +remoterepository = MirrorIMAP + +[Repository MirrorIMAP] +type = IMAP +remotehost = my.mail.server +remoteuser = myusername +remotepass = mypassword +auth_mechanisms = LOGIN +createfolder = true +ssl = yes +sslcacertfile = OS-DEFAULT + +[Repository LocalMail] +type = Maildir +localfolders = ~/Maildir +sep = . +createfolder = true +``` + +What my configuration does is define two repositories: the remote IMAP server and the local Maildir folder. There is also the **Account** that tells OfflineIMAP what to sync when it runs. You can define multiple accounts linked to different repositories. This allows you to copy from one IMAP server to another as a backup, in addition to making a copy locally. + +The first run of OfflineIMAP will take a while if you have a lot of mail. But once it is done, future runs take a _lot_ less time. You can also run OfflineIMAP as a cron job (my preference) or as a daemon constantly syncing between repositories. The documentation covers all of this, as well as advanced configuration options for things like Gmail. + +Now that my mail is copied locally, there is a whole range of tools I can work with to speed up searching, filing, and managing mail. And I'll talk about that tomorrow. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/sync-email-offlineimap + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser) +[2]: https://opensource.com/sites/default/files/uploads/productivity_3-1.png (The OfflineIMAP "blinkenlights" UI) +[3]: https://en.wikipedia.org/wiki/Maildir +[4]: http://www.offlineimap.org/ From d8a14df8bdc22c8d4ac484714a578eba34fdddc6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 14 Jan 2020 00:57:54 +0800 Subject: [PATCH 353/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200113=20setV:?= =?UTF-8?q?=20A=20Bash=20function=20to=20maintain=20Python=20virtual=20env?= =?UTF-8?q?ironments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md --- ...to maintain Python virtual environments.md | 303 ++++++++++++++++++ 1 file changed, 303 insertions(+) create mode 100644 sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md diff --git a/sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md b/sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md new file mode 100644 index 0000000000..0a1192bccf --- /dev/null +++ b/sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md @@ -0,0 +1,303 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (setV: A Bash function to maintain Python virtual environments) +[#]: via: (https://opensource.com/article/20/1/setv-bash-function) +[#]: author: (Sachin Patil https://opensource.com/users/psachin) + +setV: A Bash function to maintain Python virtual environments +====== +Get to know setV, a lightweight Python virtual environment manager and +alternative to virtualenvwrapper. +![Coding on a computer][1] + +For more than a year, [setV][2] has been hidden away within my [bash_scripts][3] project, but it's time for it to become public. setV is a Bash function I use as an alternative to [virtualenvwrapper][4]. It provides basic features that enable you to do things such as: + + * Use Python 3 by default + * Create a new virtual environment + * Create a new virtual environment using a custom Python path with **-p** (or **\--python**) + * Delete an existing virtual environment + * List all existing virtual environment + * Use Tab completion (in case you don't remember the virtual environment name) + + + +### Installation + +To install setV, download the script: + + +``` +`curl https://gitlab.com/psachin/setV/raw/master/install.sh` +``` + +Review the script, and then run it: + + +``` +`sh ./install.sh` +``` + +When you install setV, the installation script asks you to source **~/.bashrc** or **~/.bash_profile**. Be sure to do that. + +### Usage + +The basic command is **setv**. + +#### Create a virtual environment: + + +``` +setv --new rango  # setv -n rango + +# Or using a custom Python binary path +setv --new --python /opt/python/python3 rango  # setv -n -p /opt/python/python3 rango +``` + +#### Activate an existing environment: + + +``` +setv VIRTUAL_ENVIRONMENT_NAME + +# For example +setv rango +``` + +#### List all virtual environments: + + +``` +setv --list +# or +setv [TAB] [TAB] +``` + +#### Delete a virtual environment: + + +``` +`setv --delete rango` +``` + +#### Switch to another virtual environment: + + +``` +# Assuming you are in 'rango', switch to 'tango' using +setv tango +``` + +#### Tab Completion + +If you don't fully remember the virtual environment's name, Bash-like Tab completion works for virtual environment names. + +### Get involved + +setV is open source under the GNU [GPLv3][5], and contributions are welcome. To learn more, visit the Contribute section of setV's [README][6] in its GitLab repository. + +### The setV script + + +``` +#!/usr/bin/env bash +# setV - A Lightweight Python virtual environment manager. +# Author: Sachin (psachin) <[iclcoolster@gmail.com][7]> +# Author's URL: +# +# License: GNU GPL v3, See LICENSE file +# +# Configure(Optional): +# Set `SETV_VIRTUAL_DIR_PATH` value to your virtual environments +# directory-path. By default it is set to '~/virtualenvs/' +# +# Usage: +# Manual install: Added below line to your .bashrc or any local rc script(): +# --- +# source /path/to/virtual.sh +# --- +# +# Now you can 'activate' the virtual environment by typing +# $ setv <YOUR VIRTUAL ENVIRONMENT NAME> +# +# For example: +# $ setv rango +# +# or type: +# setv [TAB] [TAB]  (to list all virtual envs) +# +# To list all your virtual environments: +# $ setv --list +# +# To create new virtual environment: +# $ setv --new new_virtualenv_name +# +# To delete existing virtual environment: +# $ setv --delete existing_virtualenv_name +# +# To deactivate, type: +# $ deactivate + +# Path to virtual environment directory +SETV_VIRTUAL_DIR_PATH="$HOME/virtualenvs/" +# Default python version to use. This decides whether to use `virtualenv` or `python3 -m venv` +SETV_PYTHON_VERSION=3  # Defaults to Python3 +SETV_PY_PATH=$(which python${SETV_PYTHON_VERSION}) + +function _setvcomplete_() +{ +    # Bash-autocompletion. +    # This ensures Tab-auto-completions work for virtual environment names. +    local cmd="${1##*/}" # to handle command(s). +                         # Not necessary as such. 'setv' is the only command + +    local word=${COMP_WORDS[COMP_CWORD]} # Words thats being completed +    local xpat='${word}'                 # Filter pattern. Include +                                         # only words in variable '$names' +    local names=$(ls -l "${SETV_VIRTUAL_DIR_PATH}" | egrep '^d' | awk -F " " '{print $NF}') # Virtual environment names + +    COMPREPLY=($(compgen -W "$names" -X "$xpat" -- "$word")) # compgen generates the results +} + +function _setv_help_() { +    # Echo help/usage message +    echo "Usage: setv [OPTIONS] [NAME]" +    echo Positional argument: +    echo -e "NAME                       Activate virtual env." +    echo Optional arguments: +    echo -e "-l, --list                 List all Virtual Envs." +    echo -e "-n, --new NAME             Create a new Python Virtual Env." +    echo -e "-d, --delete NAME          Delete existing Python Virtual Env." +    echo -e "-p, --python PATH          Python binary path." +} + +function _setv_custom_python_path() +{ +    if [ -f "${1}" ]; +    then +        if [ "`expr $1 : '.*python\\([2,3]\\)'`" = "3" ]; +        then +            SETV_PYTHON_VERSION=3 +        else +            SETV_PYTHON_VERSION=2 +        fi +        SETV_PY_PATH=${1} +        _setv_create $2 +    else +        echo "Error: Path ${1} does not exist!" +    fi +} + +function _setv_create() +{ +    # Creates new virtual environment if ran with -n|--new flag +    if [ -z ${1} ]; +    then +        echo "You need to pass virtual environment name" +        _setv_help_ +    else +        echo "Creating new virtual environment with the name: $1" + +        if [ ${SETV_PYTHON_VERSION} -eq 3 ]; +        then +            ${SETV_PY_PATH} -m venv ${SETV_VIRTUAL_DIR_PATH}${1} +        else +            virtualenv -p ${SETV_PY_PATH} ${SETV_VIRTUAL_DIR_PATH}${1} +        fi + +        echo "You can now activate the Python virtual environment by typing: setv ${1}" +    fi +} + +function _setv_delete() +{ +    # Deletes virtual environment if ran with -d|--delete flag +    # TODO: Refactor +    if [ -z ${1} ]; +    then +        echo "You need to pass virtual environment name" +        _setv_help_ +    else +        if [ -d ${SETV_VIRTUAL_DIR_PATH}${1} ]; +        then +            read -p "Really delete this virtual environment(Y/N)? " yes_no +            case $yes_no in +                Y|y) rm -rvf ${SETV_VIRTUAL_DIR_PATH}${1};; +                N|n) echo "Leaving the virtual environment as it is.";; +                *) echo "You need to enter either Y/y or N/n" +            esac +        else +            echo "Error: No virtual environment found by the name: ${1}" +        fi +    fi +} + +function _setv_list() +{ +    # Lists all virtual environments if ran with -l|--list flag +    echo -e "List of virtual environments you have under ${SETV_VIRTUAL_DIR_PATH}:\n" +    for virt in $(ls -l "${SETV_VIRTUAL_DIR_PATH}" | egrep '^d' | awk -F " " '{print $NF}') +    do +        echo ${virt} +    done +} + +function setv() { +    # Main function +    if [ $# -eq 0 ]; +    then +        _setv_help_ +    elif [ $# -le 3 ]; +    then +        case "${1}" in +            -n|--new) _setv_create ${2};; +            -d|--delete) _setv_delete ${2};; +            -l|--list) _setv_list;; +            *) if [ -d ${SETV_VIRTUAL_DIR_PATH}${1} ]; +               then +                   # Activate the virtual environment +                   source ${SETV_VIRTUAL_DIR_PATH}${1}/bin/activate +               else +                   # Else throw an error message +                   echo "Sorry, you don't have any virtual environment with the name: ${1}" +                   _setv_help_ +               fi +               ;; +        esac +    elif [ $# -le 5 ]; +    then +        case "${2}" in +            -p|--python) _setv_custom_python_path ${3} ${4};; +            *) _setv_help_;; +        esac +    fi +} + +# Calls bash-complete. The compgen command accepts most of the same +# options that complete does but it generates results rather than just +# storing the rules for future use. +complete  -F _setvcomplete_ setv +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/setv-bash-function + +作者:[Sachin Patil][a] +选题:[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/psachin +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) +[2]: https://gitlab.com/psachin/setV +[3]: https://github.com/psachin/bash_scripts +[4]: https://virtualenvwrapper.readthedocs.org/ +[5]: https://gitlab.com/psachin/setV/blob/master/LICENSE +[6]: https://gitlab.com/psachin/setV/blob/master/ReadMe.org +[7]: mailto:iclcoolster@gmail.com From 7d946a5580087bec358a2bf18add6885852c84ae Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 14 Jan 2020 00:58:20 +0800 Subject: [PATCH 354/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200113=20Use=20?= =?UTF-8?q?this=20script=20to=20create,=20save,=20and=20run=20different=20?= =?UTF-8?q?rsync=20configurations=20via=20named=20profiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200113 Use this script to create, save, and run different rsync configurations via named profiles.md --- ...rsync configurations via named profiles.md | 380 ++++++++++++++++++ 1 file changed, 380 insertions(+) create mode 100644 sources/tech/20200113 Use this script to create, save, and run different rsync configurations via named profiles.md diff --git a/sources/tech/20200113 Use this script to create, save, and run different rsync configurations via named profiles.md b/sources/tech/20200113 Use this script to create, save, and run different rsync configurations via named profiles.md new file mode 100644 index 0000000000..3b4e5fc6e4 --- /dev/null +++ b/sources/tech/20200113 Use this script to create, save, and run different rsync configurations via named profiles.md @@ -0,0 +1,380 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use this script to create, save, and run different rsync configurations via named profiles) +[#]: via: (https://opensource.com/article/20/1/create-save-run-rsync-configurations) +[#]: author: (Petr Beránek https://opensource.com/users/pberanek) + +Use this script to create, save, and run different rsync configurations via named profiles +====== +A quick explanation of the rpf script. +![Person drinking a hat drink at the computer][1] + +The **rpf** script allows you to create, save, and run different rsync configurations via named profiles. + +For example, create a new profile named **backup** by typing **rpf -c backup**. Assume that the username is **user**. + +**rpf** creates the following directories: + + * **/home/user/.rpf** + * **/home/user/.rpf/shared** where you can place config files shared by multiple profiles + * **/home/user/.rpf/profiles** where all profiles are saved as subdirectories + + + +**rpf** also created **/home/user/.rpf/profiles/backup** that contains the files **conf** and **excluded**. + +The **conf** file defines rsync's configuration: + + +``` +# rsync config template +# +# Write each rsync option on separate line. For option details see man rsync. +# Empty lines and lines starting with # are ignored. Dynamic references +# (e.g. using command substitution) are not supported. +# +# Config files shared between different profiles should be saved in +# /home/user/.rpf/shared +# +# Example configuration: +# +\--verbose +\--archive +\--human-readable +# exclude all files that match pattern in: +\--exclude-from=/home/user/.rpf/profiles/backup/exclude +\--relative +# perform trial run, make no changes +\--dry-run +# source, e.g. +/home/user +# destination, e.g. +/mnt/usb_drive/users_backup +``` + +Now you can edit, add, or remove rsync options as needed. + +In **exclude**, you can define paths or patterns of files and directories you want to exclude from the transfer. To exclude **Trash** and **Downloads**, add the following lines: + + +``` +\- /home/user/.local/share/Trash +\- /home/user/Downloads +``` + +Or to transfer only **Documents** and **Projects** and exclude everything else: + + +``` +\+ /home/user/Documents +\+ /home/user/Projects +\- ** +``` + +For subtler pattern configurations, see the FILTER RULES section of **man rsync**, or Google for tutorials. + +When you are ready, you can start rsync transfer by typing **rpf backup**. + +That's it. + +For additional **rpf** options, see **rpf --help**. + +### Security + +Please be aware that **rpf** is not secure against code injection in the **conf** file. Any additional code (e.g., **; ./run_evil_script**) will also be executed. Therefore, protect your **.rpf/** config directory from malicious users by implementing appropriate permissions. Moreover, exploiting this behavior can lead to unexpected side effects. + +### The script + + +``` +#!/usr/bin/env bash +# +# Simple rsync profiler +# +# Author: [petrberanek.mail@gmail.com][2] (Petr Beranek) +# +# For usage details type `rpf --help' +# + +set -o errexit +set -o nounset + +__name=$(basename "${0}") +__version="0.1" + +config_dir="${HOME}/.rpf" +profiles_dir="${config_dir}/profiles" +shared_dir="${config_dir}/shared" +help="\ +Usage: ${__name} [OPTION...] PROFILE_NAME + +${__name} is simple rsync profiler that stores your different rsync +configurations in named profiles. + +Options: +    -c, --create-profile PROFILE_NAME   create new profile (profile data +                            are stored in ${config_dir}/PROFILE_NAME). +                            Profile name can contain alphanumeric +                            characters only. +    -s, --show-profile-config PROFILE_NAME  show content of profile +                            configuration file (stored in +                            ${config_dir}/PROFILE_NAME) +    -l, --list-profiles     list all available profiles +    -h, --help              show this help + +Example: +    Create new profile by typing +    ${__name} -c PROFILE_NAME + +    edit its config files stored by default in +    ${profiles_dir}/PROFILE_NAME + +    and then run it by typing +    ${__name} PROFILE_NAME + +    That's it. + +${__name} comes with ABSOLUTELY NO WARRANTY. This is free software, +and you are welcome to redistribute it under certain conditions. See +the GNU General Public Licence for details. + +Email bug reports or enhancement requests to [petrberanek.mail@gmail.com][2]. +" + +create_profile() { +    # Create dir with given profile name and with default content. +    # +    # Arguments: $1 -- profile name +    # +    # Creates files: conf, exclude +    # +    # If dir with the same name already exists, exits with error. +    # + +    local profile_name="${1}" +    local profile_dir="${profiles_dir}/${profile_name}" + +    # create default rpf dirs if missing +    if [[ ! -d "${profiles_dir}" ]]; then +        echo "Creating ${profiles_dir}" +        mkdir --parents "${profiles_dir}" +    fi +    if [[ ! -d "${shared_dir}" ]]; then +        echo "Creating ${shared_dir}" +        mkdir --parents "${shared_dir}" +    fi + +    # don't overwrite existing profile +    if [[ -d "${profile_dir}" ]]; then +        echo "${__name}: error: profile already exists." +        exit 1 +    fi + +    echo "Creating ${profile_dir}" +    mkdir "${profile_dir}" + +    # create `conf' template +    local conf="${profile_dir}/conf" +    echo "Creating ${conf}" +    cat << EOF > "${conf}" +# rsync config template +# +# Write each rsync option on separate line. For details see man rsync. +# Empty lines and lines starting with # are ignored. Dynamic references +# (e.g. using command substitution) are not supported. +# +# Config files shared between different profiles should be saved in +# ${shared_dir} +# +# Example configuration: +# +\--verbose +\--archive +\--human-readable +# file with patterns of files and directories in source excluded +# from transfer +\--exclude-from="${profiles_dir}/${profile_name}/exclude" +\--relative +# perform trial run, make no changes +\--dry-run +# source, e.g. +${HOME} +# destination, e.g. +/mnt/usb_drive/my_backup +EOF + +    # create `exclude' template +    local exclude="${profile_dir}/exclude" +    echo "Creating ${exclude}" +    cat << EOF > "${exclude}" +# \\`exclude' template +# +# Lines starting with # or ; are ignored. For details see man rsync, +# section FILTER RULES. +# +EOF + +    # all done +    echo "OK" +    echo "Edit profile config files in ${profile_dir} to fit your needs." +} + +list_profiles() { +    # Show all available rpf profiles. +    # +    # Assumes that all dirs in $profiles_dir are profiles. +    # + +    for item in "${profiles_dir}"/*; do +        if [[ -d "${item}" ]]; then +            basename "${item}" +        fi +    done +} + +show_help() { echo "${help}"; } + +show_profile_config() { +    # Show configuration file for given profile. +    # +    # Arguments: $1 -- profile name +    # + +    local profile_name="${1}" +    less "${profiles_dir}/${profile_name}/conf" +} + +check_profile_name() { +    # Check that name is not empty and contains alphanumeric chars only. +    # +    # Arguments: $1 -- profile name +    # +    # If test fails, exits with error. +    # + +    if [[ -z "${1}" ]]; then +        echo "${__name}: error: empty profile name." +        exit 1 +    elif [[ "${1}" =~ [^a-zA-Z0-9] ]]; then +        echo "${__name}: error: non-alphanumeric characters in profile name." +        exit 1 +    fi +} + +check_profile_exists() { +    # Check that $profile_name exists and is a directory. +    # +    # Arguments: $1 -- profile name +    # +    # If test fails, exits with error. +    # + +    local profile_name="${1}" +    if [[ ! -d "${profiles_dir}/${profile_name}" ]]; then +        echo "${__name}: error: profile ${profile_name} does not exist." +        exit 1 +    fi +} + +check_num_args() { +    # Check that value of $1 = number of arguments (excluding $1) +    # +    # Arguments: $1 -- limit (positive int) +    # +    # If test fails, exits with error. +    # + +    local num_args=$(( ${#} - 1 ))  # do not count $1 in total num of args +    if [[ "${1}" -ne "${num_args}" ]]; then +        echo "${__name}: error: expected num args: ${1}, received: $num_args" +        exit 1 +    fi +} + +run_rsync() { +    # Run rsync with configuration coresponding to given profile name. +    # +    # Arguments: $1 -- profile name +    # + +    local profile_name="${1}" +    local visual_div="==============================" +    local parsed_args +    parsed_args=$(grep --invert-match '^#' "${profiles_dir}/${profile_name}/conf" \ +                    | tr '\n' ' ') + +    # Print debug info +    echo "${visual_div}" +    echo "${__name} version: ${__version}" +    echo "args: ${parsed_args}" +    echo "${visual_div}" + +    # Expand $parsed_args - each item from conf file becomes rsync argument +    # shellcheck disable=SC2086 +    rsync ${parsed_args} +} + +if [[ "${#}" == 0 ]]; then +    show_help +    exit 1 +fi +while [[ "${#}" -gt 0 ]]; do +    case "${1}" in +        -c | --create-profile) +            check_num_args 2 "${@}" +            shift +            check_profile_name "${1:-}" # If $1 is not declared, set it empty. +            create_profile "${1}" +            exit 0;; +        -s | --show-profile-config) +            check_num_args 2 "${@}" +            shift +            check_profile_name "${1:-}" +            check_profile_exists "${1}" +            show_profile_config "${1}" +            exit 0;; +        -l | --list-profiles) +            check_num_args 1 "${@}" +            list_profiles +            exit 0;; +        -h | --help) +            check_num_args 1 "${@}" +            show_help +            exit 0;; +        -*) +            echo "${__name}: error: unknown option \\`${1}'" +            exit 1;; +        *) +            check_num_args 1 "${@}" +            check_profile_name "${1:-}" +            check_profile_exists "${1}" +            run_rsync "${1}" +            exit 0;; +    esac +    shift +done +``` + +* * * + +This was originally published in [Petr Beranek's GitHub repository][3] and it is licensed under GPLv3. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/create-save-run-rsync-configurations + +作者:[Petr Beránek][a] +选题:[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/pberanek +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hat drink at the computer) +[2]: mailto:petrberanek.mail@gmail.com +[3]: https://github.com/beranep/rpf From 3a1a4153bef23632ef52e57e97615d89c75cd9a0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 14 Jan 2020 08:57:20 +0800 Subject: [PATCH 355/430] translated --- ...Python web API with Pyramid and Cornice.md | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) rename {sources => translated}/tech/20200106 How to write a Python web API with Pyramid and Cornice.md (52%) diff --git a/sources/tech/20200106 How to write a Python web API with Pyramid and Cornice.md b/translated/tech/20200106 How to write a Python web API with Pyramid and Cornice.md similarity index 52% rename from sources/tech/20200106 How to write a Python web API with Pyramid and Cornice.md rename to translated/tech/20200106 How to write a Python web API with Pyramid and Cornice.md index eaab46c5bc..ae3afc22af 100644 --- a/sources/tech/20200106 How to write a Python web API with Pyramid and Cornice.md +++ b/translated/tech/20200106 How to write a Python web API with Pyramid and Cornice.md @@ -7,21 +7,20 @@ [#]: via: (https://opensource.com/article/20/1/python-web-api-pyramid-cornice) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) -How to write a Python web API with Pyramid and Cornice +如何使用 Pyramid 和 Cornice 编写 Python Web API ====== -Use Pyramid and Cornice to build and document scalable RESTful web -services. +使用 Pyramid 和 Cornice 构建可扩展的 RESTful Web 服务。 ![Searching for code][1] -[Python][2] is a high-level, object-oriented programming language known for its simple syntax. It is consistently among the top-rated programming languages for building RESTful APIs. +[Python][2] 是一种高级的,面向对象的编程语言,它以其简单的语法而闻名。它一直是构建 RESTful API 的顶级编程语言之一。 -[Pyramid][3] is a Python web framework designed to scale up with an application: it's simple for simple applications but can grow for big, complex applications. Among other things, Pyramid powers PyPI, the Python package index. [Cornice][4] provides helpers to build and document REST-ish web services with Pyramid. +[Pyramid][3] 是一个 Python Web 框架,旨在随着应用的扩展而扩展:这对于简单的应用来说很简单,对于大型、复杂的应用也可以做到。Pyramid 为 PyPI (Python 软件包索引)提供了强大的支持。[Cornice][4] 提供了使用 Pyramid 构建 RESTful Web 服务的助手。 -This article will use the example of a web service to get famous quotes to show how to use these tools. +本文将使用 Web 服务的例子来获取名人名言,来展示如何使用这些工具。 -### Set up a Pyramid application +### 建立 Pyramid 应用 -Start by creating a virtual environment for your application and a file to hold the code: +首先为你的应用创建一个虚拟环境,并创建一个文件来保存代码: ``` @@ -33,9 +32,9 @@ $ source env/bin/activate (env) $ pip3 install cornice twisted ``` -### Import the Cornice and Pyramid modules +### 导入 Cornice 和 Pyramid 模块 -Import these modules with: +使用以下命令导入这些模块: ``` @@ -43,9 +42,9 @@ from pyramid.config import Configurator from cornice import Service ``` -### Define the service +### 定义服务 -Define the quotes service as a **Service** object: +将引用服务定义为 **Service** 对象: ``` @@ -54,9 +53,9 @@ QUOTES = Service(name='quotes',                  description='Get quotes') ``` -### Write the quotes logic +### 编写引用逻辑 -So far, this only supports **GET**ing quotes. Decorate the function with **QUOTES.get**; this is how you can tie in the logic to the REST service: +到目前为止,这仅支持 **GET** 获取名言。用 **QUOTES.get** 装饰函数。这是将逻辑绑定到 REST 服务的方法: ``` @@ -73,13 +72,13 @@ def get_quote(request):     } ``` -Note that unlike in other frameworks, the **get_quote** function is _not_ changed by the decorator. If you import this module, you can still call the function regularly and inspect the result. +请注意,与其他框架不同,装饰器_不能_更改 **get_quote** 函数。如果导入此模块,你仍然可以定期调用该函数并检查结果。 -This is useful when writing unit tests for Pyramid RESTful services. +在为 Pyramid RESTful 服务编写单元测试时,这很有用。 -### Define the application object +### 定义应用对象 -Finally, use **scan** to find all decorated functions and add them to the configuration:  +最后,使用 **scan** 查找所有修饰的函数并将其添加到配置中: ``` @@ -89,18 +88,18 @@ with Configurator() as config:     application = config.make_wsgi_app() ``` -The default for scan is to scan the current module. You can also give the name of a package if you want to scan all modules in a package. +默认扫描当前模块。如果要扫描软件包中的所有模块,你也可以提供软件包的名称。 -### Run the service +### 运行服务 -I use Twisted's WSGI server to run the application, but you can use any other [WSGI][5] server, like Gunicorn or uWSGI, if you want: +我使用 Twisted 的 WSGI 服务器运行该应用,但是如果需要,你可以使用任何其他 [WSGI][5] 服务器,例如 Gunicorn 或 uWSGI。 ``` `(env)$ python -m twisted web --wsgi=main.application` ``` -By default, Twisted's WSGI server runs on port 8080. You can test the service with [HTTPie][6]: +默认情况下,Twisted 的 WSGI 服务器运行在端口 8080 上。你可以使用 [HTTPie][6] 测试该服务: ``` @@ -129,11 +128,11 @@ X-Content-Type-Options: nosniff } ``` -### Why use Pyramid? +### 为什么要使用 Pyramid? -Pyramid is not the most popular framework, but it is used in some high-profile projects like [PyPI][7]. I like Pyramid because it is one of the frameworks that took unit testing seriously: because the decorators do not modify the function and there are no thread-local variables, functions are callable directly from unit tests. For example, functions that need access to the database will get it from the **request** object passed in via **request.config**. This allows a unit tester to put a mock (or real) database object in the request, instead of carefully setting globals, thread-local variables, or other framework-specific things. +Pyramid 不是最受欢迎的框架,但它已在 [PyPI][7] 等一些引人注目的项目中使用。我喜欢 Pyramid,因为它是认真对待单元测试的框架之一:因为装饰器不会修改函数并且没有线程局部变量,所以可以直接从单元测试中调用函数。例如,需要访问数据库的函数将从通过 **request.config** 传递的 **request.config** 对象中获取它。这允许单元测试人员将模拟(或真实)数据库对象放入请求中,而不用仔细设置全局变量,线程局部变量或其他特定于框架的东西。 -If you're looking for a well-tested library to build your next API, give Pyramid a try. You won't be disappointed. +如果你正在寻找一个经过测试的库来构建你接下来的 API,请尝试使用 Pyramid。你不会失望的。 -------------------------------------------------------------------------------- From d827e93709b6cbd73a92ced5e857ae5e81d76c1d Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 14 Jan 2020 09:02:35 +0800 Subject: [PATCH 356/430] translating --- ...se Stow for configuration management of multiple machines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200112 Use Stow for configuration management of multiple machines.md b/sources/tech/20200112 Use Stow for configuration management of multiple machines.md index 68a1eb0ebc..0d4a5f19d5 100644 --- a/sources/tech/20200112 Use Stow for configuration management of multiple machines.md +++ b/sources/tech/20200112 Use Stow for configuration management of multiple machines.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a29479a75b4e81e5133d646b63a6e56cfb6bb622 Mon Sep 17 00:00:00 2001 From: heguangzhi <7731226@qq.com> Date: Tue, 14 Jan 2020 10:03:59 +0800 Subject: [PATCH 357/430] Update 20200112 What I learned going from prison to Python.md --- .../20200112 What I learned going from prison to Python.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200112 What I learned going from prison to Python.md b/sources/tech/20200112 What I learned going from prison to Python.md index 84dfa73ecb..93da6f1700 100644 --- a/sources/tech/20200112 What I learned going from prison to Python.md +++ b/sources/tech/20200112 What I learned going from prison to Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (heguangzhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -84,7 +84,7 @@ via: https://opensource.com/article/20/1/prison-to-python 作者:[Shadeed "Sha" Wallace-Stepter][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[heguangzhi](https://github.com/heguangzhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 315c82742634f9de2047b0f3e9d7d40464f86673 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Tue, 14 Jan 2020 11:48:00 +0800 Subject: [PATCH 358/430] translating --- sources/tech/20200113 How to setup a DNS server with bind.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200113 How to setup a DNS server with bind.md b/sources/tech/20200113 How to setup a DNS server with bind.md index 897dc825a8..74cc32e747 100644 --- a/sources/tech/20200113 How to setup a DNS server with bind.md +++ b/sources/tech/20200113 How to setup a DNS server with bind.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 78bd977471aa002bd257e6f9bf960f164601b5a0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Jan 2020 01:00:05 +0800 Subject: [PATCH 359/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200115=20Root?= =?UTF-8?q?=20User=20in=20Ubuntu:=20Important=20Things=20You=20Should=20Kn?= =?UTF-8?q?ow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md --- ...buntu- Important Things You Should Know.md | 175 ++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md diff --git a/sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md b/sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md new file mode 100644 index 0000000000..247391ff82 --- /dev/null +++ b/sources/tech/20200115 Root User in Ubuntu- Important Things You Should Know.md @@ -0,0 +1,175 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Root User in Ubuntu: Important Things You Should Know) +[#]: via: (https://itsfoss.com/root-user-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Root User in Ubuntu: Important Things You Should Know +====== + +When you have just started using Linux, you’ll find many things that are different from Windows. One of those ‘different things’ is the concept of the root user. + +In this beginner series, I’ll explain a few important things about the root user in Ubuntu. + +**Please keep in mind that while I am writing this from Ubuntu user’s perspective, it should be valid for most Linux distributions.** + +You’ll learn the following in this article: + + * [Why root user is disabled in Ubuntu][1] + * [Using commands as root][2] + * [Switch to root user][3] + * [Unlock the root user][4] + + + +### What is root user? Why is it locked in Ubuntu? + +![][5] + +In Linux, there is always a super user called [root][6]. This is the super admin account that can do anything and everything with the system. It can access any file and run any command on your Linux system. + +With great power comes great responsibility. Root user gives you complete power over the system and hence it should be used with great cautious. Root user can access system files and run commands to make changes to the system configuration. And hence, an incorrect command may destroy the system. + +This is why [Ubuntu][7] and other Ubuntu-based distributions lock the root user by default to save you from accidental disasters. + +You don’t need to have root privilege for your daily tasks like moving file in your home directory, downloading files from internet, creating documents etc. + +_**Take this analogy for understanding it better. If you have to cut a fruit, you use a kitchen knife. If you have to cut down a tree, you have to use a saw. Now, you may use the saw to cut fruits but that’s not wise, is it?**_ + +Does this mean that you cannot be root in Ubuntu or use the system with root privileges? No, you can still have root access with the help of ‘sudo’ (explained in the next section). + +**Bottom line: +**Root user is too powerful to be used for regular tasks. This is why it is not recommended to use root all the time. You can still run specific commands with root. + +### How to run commands as root user in Ubuntu? + +![Image Credit: xkcd][8] + +You’ll need root privileges for some system specific tasks. For example, if you want to [update Ubuntu via command line][9], you cannot run the command as a regular user. It will give you permission denied error. + +``` +apt update +Reading package lists... Done +E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) +E: Unable to lock directory /var/lib/apt/lists/ +W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied) +W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied) +``` + +So, how do you run commands as root? The simple answer is to add sudo before the commands that require to be run as root. + +``` +sudo apt update +``` + +Ubuntu and many other Linux distributions use a special mechanism called sudo. Sudo is a program that controls access to running commands as root (or other users). + +Sudo is actually quite a versatile tool. It can be configured to allow a user to run all commands as root or only some commands as root. You can also configure if password is required for some commands or not to run it with sudo. It’s an extensive topic and maybe I’ll discuss it in details in another article. + +For the moment, you should know that [when you install Ubuntu][10], you are forced to create a user account. This user account works as the admin on your system and as per the default sudo policy in Ubuntu, it can run any command on your system with root privileges. + +The thing with sudo is that running **sudo doesn’t require root password but the user’s own password**. + +And this is why when you run a command with sudo, it asks for the password of the user who is running the sudo command: + +``` +[email protected]:~$ sudo apt update +[sudo] password for abhishek: +``` + +As you can see in the example above, user _abhishek_ was trying to run the ‘apt update’ command with _sudo_ and the system asked the password for _abhishek_. + +If you are absolutely new to Linux, you might be surprised that when you start typing your password in the terminal, nothing happens on the screen. This is perfectly normal because as the default security feature, nothing is displayed on the screen. Not even the asterisks (*). You type your password and press enter. + +**Bottom line: +**To run commands as root in Ubuntu, add sudo before the command. +When asked for password, enter your account’s password. +When you type the password on the screen, nothing is visible. Just keep on typing the password and press enter. + +### How to become root user in Ubuntu? + +You can use sudo to run the commands as root. However in situations, where you have to run several commands as root and you keep forogetting to add sudo before the commands, you may switch to root user temporarily. + +The sudo command allows you to simulate a root login shell with this command: + +``` +sudo -i +``` + +``` +[email protected]:~$ sudo -i +[sudo] password for abhishek: +[email protected]:~# whoami +root +[email protected]:~# +``` + +You’ll notice that when you switch to root, the shell command prompt changes from $ (dollar key sign) to # (pound key sign). This makes me crack a (lame) joke that pound is stronger than dollar. + +_**Though I have showed you how to become the root user, I must warn you that you should avoid using the system as root. It’s discouraged for a reason after all.**_ + +Another way to temporarily switch to root user is by using the su command: + +``` +sudo su +``` + +If you try to use the su command without sudo, you’ll encounter ‘su authentication failure’ error. + +You can go back to being the normal user by using the exit command. + +``` +exit +``` + +### How to enable root user in Ubuntu? + +By now you know that the root user is locked by default in Ubuntu based distributions. + +Linux gives you the freedom to do whatever you want with your system. Unlocking the root user is one of those freedoms. + +If, for some reasons, you decided to enable the root user, you can do so by setting up a password for it: + +``` +sudo passwd root +``` + +Again, this is not recommended and I won’t encourage you to do that on your desktop. If you forgot it, you won’t be able to [change the root password in Ubuntu][11] again. + +You can lock the root user again by removing the password: + +``` +sudo passwd -dl root +``` + +**In the end…** + +I hope you have a slightly better understanding of the root concept now. If you still have some confusion and questions about it, please let me know in the comments. I’ll try to answer your questions and might update the article as well. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/root-user-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: tmp.IrHYJBAqVn#what-is-root +[2]: tmp.IrHYJBAqVn#run-command-as-root +[3]: tmp.IrHYJBAqVn#become-root +[4]: tmp.IrHYJBAqVn#enable-root +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/root_user_ubuntu.png?ssl=1 +[6]: http://www.linfo.org/root.html +[7]: https://ubuntu.com/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/sudo_sandwich.png?ssl=1 +[9]: https://itsfoss.com/update-ubuntu/ +[10]: https://itsfoss.com/install-ubuntu/ +[11]: https://itsfoss.com/how-to-hack-ubuntu-password/ From 024c95a9e6b27345287ec0cad7fc43660fd918ff Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Jan 2020 01:00:41 +0800 Subject: [PATCH 360/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200114=20Organi?= =?UTF-8?q?ze=20your=20email=20with=20Notmuch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200114 Organize your email with Notmuch.md --- ...200114 Organize your email with Notmuch.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20200114 Organize your email with Notmuch.md diff --git a/sources/tech/20200114 Organize your email with Notmuch.md b/sources/tech/20200114 Organize your email with Notmuch.md new file mode 100644 index 0000000000..f881ff5ad9 --- /dev/null +++ b/sources/tech/20200114 Organize your email with Notmuch.md @@ -0,0 +1,111 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Organize your email with Notmuch) +[#]: via: (https://opensource.com/article/20/1/organize-email-notmuch) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Organize your email with Notmuch +====== +Notmuch indexes, tags, and sorts your email. Learn how to use it in the +fourth article in our series on 20 ways to be more productive with open +source in 2020. +![Filing cabinet for organization][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Index your email with Notmuch + +Yesterday, I talked about how I use OfflineIMAP to [sync my mail][2] to my local machine. Today, I'll talk about how I preprocess all that mail before I read it. + +![Notmuch][3] + +[Maildir][4] is probably one of the most useful mail storage formats out there. And there are a LOT of tools to help with managing your mail. The one I keep coming back to is a little program called [Notmuch][5] that indexes, tags, and searches mail messages. And there are several programs that work with Notmuch to make it even easier to handle a large amount of mail. + +Most Linux distributions include Notmuch, and you can also get it for MacOS. Windows users can access it through Windows Subsystem for Linux ([WSL][6]), but it may require some additional tweaks. + +![Notmuch's first run][7] + +On Notmuch's very first run, it will ask you some questions and create a **.notmuch-config** file in your home directory. Next, index and tag all your mail by running **notmuch new**. You can verify it with **notmuch search tag:new**; this will find all messages with the "new" tag. That's probably a lot of mail since Notmuch uses the "new" tag to indicate messages that are new to it, so you'll want to clean that up. + +Run **notmuch search tag:unread** to find any unread messages; that should result in quite a lot less mail. To remove the "new" tag from messages you've already seen, run **notmuch tag -new not tag:unread**, which will search for all messages without the "unread" tag and remove the "new" tag from them. Now when you run **notmuch search tag:new**, it should show only the unread mail messages. + +Tagging messages in bulk is probably more useful, though, since manually updating tags at every run can be really tedious. The **\--batch** command-line option tells Notmuch to read multiple lines of commands and execute them. There is also the **\--input=filename** option, which reads commands from a file and applies them. I have a file called **tagmail.notmuch** that I use to add tags to mail that is "new"; it looks something like this: + + +``` +# Manage sent, spam, and trash folders +-unread -new folder:Trash +-unread -new folder:Spam +-unread -new folder:Sent + +# Note mail sent specifically to me (excluding bug mail) ++to-me to:kevin at sonney.com and tag:new and not tag:to-me + +# And note all mail sent from me ++sent from:kevin at sonney.com and tag:new and not tag:sent + +# Remove the new tag from messages +-new tag:new +``` + +I can then run **notmuch tag --input=tagmail.notmuch** to bulk-process my mail messages after running **notmuch new**, and then I can search on those tags as well. + +Notmuch also supports running pre- and post-new hooks. These scripts, stored in **Maildir/.notmuch/hooks**, define actions to run before (pre-new) and after (post-new) to index new mail with **notmuch new**. In yesterday's article, I talked about using [OfflineIMAP][8] to sync mail from my IMAP server. It's very easy to run it from the "pre-new" hook: + + +``` +#!/bin/bash +# Remove the new tag from messages that are still tagged as new +notmuch tag -new tag:new + +# Sync mail messages +offlineimap -a LocalSync -u quiet +``` + +You can also use the Python application [afew][9], which interfaces with the Notmuch database, to tag things like _Mailing List_ and _Spam_ for you. You can run afew from the post-new hook in a similar way: + + +``` +#!/bin/bash +# tag with my custom tags +notmuch tag --input=~/tagmail.notmuch + +# Run afew to tag new mail +afew -t -n +``` + +I recommend that when using afew to tag messages, you do NOT use the **[ListMailsFilter]** since some mail handlers add obscure or downright junk List-ID headers to mail messages (I'm looking at you, Google). + +![alot email client][10] + +At this point, any mail reader that supports Notmuch or Maildir can work with my email. I'll sometimes use [alot][11], a Notmuch-specific client, to read mail at the console, but it's not as fancy as some other mail readers. + +In the coming days, I'll show you some other mail clients that will likely integrate with tools you already use. In the meantime, check out some of the other tools that work with Maildir mailboxes—you might find a hidden gem I've not tried yet. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/organize-email-notmuch + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_organize_letter.png?itok=GTtiiabr (Filing cabinet for organization) +[2]: https://opensource.com/article/20/1/sync-email-offlineimap +[3]: https://opensource.com/sites/default/files/uploads/productivity_4-1.png (Notmuch) +[4]: https://en.wikipedia.org/wiki/Maildir +[5]: https://notmuchmail.org/ +[6]: https://docs.microsoft.com/en-us/windows/wsl/install-win10 +[7]: https://opensource.com/sites/default/files/uploads/productivity_4-2.png (Notmuch's first run) +[8]: http://www.offlineimap.org/ +[9]: https://afew.readthedocs.io/en/latest/index.html +[10]: https://opensource.com/sites/default/files/uploads/productivity_4-3.png (alot email client) +[11]: https://github.com/pazz/alot From 633dd3a525b81e87caaa5fe5e6c18988852725f0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Jan 2020 01:01:59 +0800 Subject: [PATCH 361/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200114=20What?= =?UTF-8?q?=20communities=20of=20practice=20can=20do=20for=20your=20organi?= =?UTF-8?q?zation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200114 What communities of practice can do for your organization.md --- ...f practice can do for your organization.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20200114 What communities of practice can do for your organization.md diff --git a/sources/tech/20200114 What communities of practice can do for your organization.md b/sources/tech/20200114 What communities of practice can do for your organization.md new file mode 100644 index 0000000000..886fc05201 --- /dev/null +++ b/sources/tech/20200114 What communities of practice can do for your organization.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What communities of practice can do for your organization) +[#]: via: (https://opensource.com/open-organization/20/1/why-build-community-of-practice) +[#]: author: (Tracy Buckner https://opensource.com/users/tracyb) + +What communities of practice can do for your organization +====== +In open organizations, fostering passionate communities can increase +collaboration, accelerate problem solving, and lead to greater +innovation. +![Lots of people in a crowd.][1] + +As I discussed in the [first part of this series][2], community is a fundamental principle in open organizations. In open organizations, people often define their roles, responsibilities, and affiliations through shared interests and passions—[not title, role, or position on an organizational chart][3]. + +So fostering and supporting communities of practice (CoPs) can be a great strategy for building a more open organization. Members of communities of practice interact regularly, discuss various topics, and solve problems collectively and collaboratively. These communities provide members with an opportunity to share their expertise, learn from others, and network with one another. + +As Luis Gonçalves states in [Learning Organisation][4]: + +> CoPs provide a shared context where members of the organisation can communicate and share information; stimulate learning through peer-to-peer mentoring, coaching, self-reflection, and collaboration; generate new knowledge; and initiate projects that develop tangible results. + +But those aren't the only value such communities can offer. Communities of practice can also enhance an organization in the following ways (summarized in Figure 1). + +**Decreased learning curves**. Many organizations face the challenge of rapidly increasing productivity of new employees (or members). This task becomes especially challenging in organizations where an employee's manager may be located in a different state, country, or region. Communities of practice offer new employees a network of connections they can tap into more quickly and easily. By joining a CoP, they can immediately access a network of experts and share resources, ask questions, and seek guidance outside the formal lines of the organizational chart. + +Members of communities of practice interact regularly, discuss various topics, and solve problems collectively and collaboratively. + +**Increased collaboration.** A recent survey from My Customer.com [shows][5] that 40 percent of company employees report not feeling adequately supported by their colleagues—because "different departments have their own agendas." A lack of collaboration between departments limits innovation and increases opportunities for miscommunication. Communities of practice encourage members from _all_ roles across _all_ departments to unite in sharing their expertise. This increases collaboration and reduces the threat of organizational silos. + +**Rapid problem-solving.** Communities of practice provide a centralized location for communication and resources useful for solving organizational or business problems. Enabling people to come together—regardless of their organizational reporting structure, location, and/or management structure—encourages problem-solving and can lead to faster resolution of those problems. + +**Enhanced innovation.** Researchers Pouwels and Koster [recently argued][6] that “collaboration contributes to innovation." CoPs provide a unique opportunity for members to collaborate on topics within their shared domains of interest and passion. This passion ignites a desire to discover new and innovative ways to solve problems and create new ideas. + +![Benefits of Communities of Practice][7] + +_Figure 1: Benefits of communities of practice. Courtesy of Tracy Buckner. CC BY-SA._ + +[Étienne Wenger][8], an educational theorist and proponent of communities of practice, said that learning doesn't only occur through a master; it also happens among apprentices. Communities of practice foster learning by connecting apprentices, while encouraging collaboration and offering an opportunity for creative problem-solving and innovation. + +In the final article of this series, I'll explain how you can reap these benefits by creating your own community of practice. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/20/1/why-build-community-of-practice + +作者:[Tracy Buckner][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/tracyb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_community2.png?itok=1blC7-NY (Lots of people in a crowd.) +[2]: https://opensource.com/open-organization/19/11/what-is-community-practice +[3]: https://opensource.com/open-organization/resources/open-org-definition +[4]: https://www.organisationalmastery.com/category/learning-organisation/ +[5]: https://www.mycustomer.com/experience/engagement/the-stats-that-prove-silos-are-your-biggest-cx-challenge +[6]: https://www.researchgate.net/profile/Ferry_Koster/publication/313659568_Inter-organizational_cooperation_and_organizational_innovativeness_A_comparative_study/links/59e64d510f7e9b13aca3c224/Inter-organizational-cooperation-and-organizational-innovativeness-A-comparative-study.pdf +[7]: https://opensource.com/sites/default/files/images/open-org/cop_benefits.png (Benefits of Communities of Practice) +[8]: https://en.wikipedia.org/wiki/%C3%89tienne_Wenger From 269d986ccda0b7b05bbcbfe6452a0cab33f5eb0a Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 15 Jan 2020 08:51:01 +0800 Subject: [PATCH 362/430] translated --- ... across multiple devices with Syncthing.md | 65 ------------------- ... across multiple devices with Syncthing.md | 63 ++++++++++++++++++ 2 files changed, 63 insertions(+), 65 deletions(-) delete mode 100644 sources/tech/20200111 Sync files across multiple devices with Syncthing.md create mode 100644 translated/tech/20200111 Sync files across multiple devices with Syncthing.md diff --git a/sources/tech/20200111 Sync files across multiple devices with Syncthing.md b/sources/tech/20200111 Sync files across multiple devices with Syncthing.md deleted file mode 100644 index d662fc1a78..0000000000 --- a/sources/tech/20200111 Sync files across multiple devices with Syncthing.md +++ /dev/null @@ -1,65 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Sync files across multiple devices with Syncthing) -[#]: via: (https://opensource.com/article/20/1/sync-files-syncthing) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Sync files across multiple devices with Syncthing -====== -Learn how to sync files between devices with Syncthing in the first -article in our series on 20 ways to be more productive with open source -in 2020. -![Files in a folder][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Syncing files with Synthing - -Setting up a new machine is a pain. We all have our "standard setups" that we copy from machine to machine. And over the years, I've used a lot of ways to keep them in sync between machines. In the old days (and this will tell you how old I am), it was with floppy disks, then Zip disks, USB sticks, SCP, Rsync, Dropbox, ownCloud—you name it. And they never seemed to work right for me. - -Then I stumbled upon [Syncthing][2]. - -![syncthing console][3] - -Syncthing is a lightweight, peer-to-peer file-synchronization system. You don't need to pay for a service, you don't need a third-party server, and it's fast. Much faster, in my experience, than many of the "big names" in file synchronization. - -Syncthing is available for Linux, MacOS, Windows, and several flavors of BSD. There is also an Android app (but nothing official for iOS yet). There are even handy graphical frontends for all of the above (although I'm not going to cover those here). On Linux, there are packages available for most distributions, so installation is very straightforward. - -![Installing Syncthing on Ubuntu][4] - -When you start Syncthing the first time, it launches a web browser to configure the daemon. There's not much to do on the first machine, but it is a good chance to poke around the user interface (UI) a little bit. The most important thing to see is System ID under the **Actions** menu in the top-right. - -![Machine ID][5] - -Once the first machine is set up, repeat the installation on the second machine. In the UI, there will be a button on the lower-right labeled **Add Remote Device**. Click the button, and you will be presented with a box to enter a **Device ID and a Name**. Copy and paste the **Device ID** from the first machine and click **Save**. - -You should see a pop-up on the first node asking to add the second. Once you accept it, the new machine will show up on the lower-right of the first one. Share the default directory with the second machine. Click on **Default Folder** and then click the **Edit** button. There are four links at the top of the pop-up. Click on **Sharing** and then select the second machine. Click **Save** and look at the second machine. You should get a prompt to accept the shared directory. Once you accept that, it will start synchronizing files between the two machines. - -![Sharing a directory in Syncthing][6] - -Test it out by copying a file to the default directory (**/your/home/Share**) on one of the machines. It should show up on the other one very quickly. - -You can add as many directories as you want or need to the sharing, which is pretty handy. As you can see in the first image, I have one for **myconfigs**—that's where I keep my configuration files. When I get a new machine, I just install Syncthing, and if I tune a configuration on one, I don't have to update all of them—it happens automatically. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/sync-files-syncthing - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder) -[2]: https://syncthing.net/ -[3]: https://opensource.com/sites/default/files/uploads/productivity_1-1.png (syncthing console) -[4]: https://opensource.com/sites/default/files/uploads/productivity_1-2.png (Installing Syncthing on Ubuntu) -[5]: https://opensource.com/sites/default/files/uploads/productivity_1-3.png (Machine ID) -[6]: https://opensource.com/sites/default/files/uploads/productivity_1-4.png (Sharing a directory in Syncthing) diff --git a/translated/tech/20200111 Sync files across multiple devices with Syncthing.md b/translated/tech/20200111 Sync files across multiple devices with Syncthing.md new file mode 100644 index 0000000000..e4bc076533 --- /dev/null +++ b/translated/tech/20200111 Sync files across multiple devices with Syncthing.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Sync files across multiple devices with Syncthing) +[#]: via: (https://opensource.com/article/20/1/sync-files-syncthing) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用 Syncthing 在多个设备间同步文件 +====== +2020 年,在我们的 20 个使用开源提升生产力的系列文章中,首先了解如何使用 Syncthing 同步文件。 +![Files in a folder][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 使用 Synthing 同步文件 + +置新机器很麻烦。我们都有在机器之间复制的“标准设置”。多年来,我使用了很多方法来使它们在计算机之间同步。在过去(这会告诉你我年纪有多大了),曾经是软盘、然后是 Zip 磁盘、U 盘、SCP、Rsync、Dropbox、ownCloud,你想到的都试过。但这些似乎对我都不够好。 + +然后我偶然发现了 [Syncthing][2]。 + +![syncthing console][3] + +Syncthing 是一个轻量级的点对点文件同步系统。你不需要为服务付费,也不需要第三方服务器,而且速度很快。以我的经验,比文件同步中的许多“大牌”要快得多。 + +Syncthing 可在 Linux、MacOS、Windows 和多种 BSD 中使用。还有一个 Android 应用(但尚无官方 iOS 版本)。以上所有终端都有方便的图形化前端(尽管我不会在这里介绍)。在 Linux 上,大多数发行版都有可用的软件包,因此安装非常简单。 + +![Installing Syncthing on Ubuntu][4] + +首次启动 Syncthing 时,它将启动 Web 浏览器以配置守护程序。第一台计算机上没有太多要做,但是这是一个很好的机会来介绍一下用户界面 (UI)。最重要的是在右上方的 **Actions** 菜单下的 “System ID”。 + +![Machine ID][5] + +设置第一台计算机后,请在第二台计算机上重复安装。在 UI 中,右下方将显示一个按钮,名为 **Add Remote Device**。单击按钮,你将会看到一个要求输入**设备 ID 和设备名**的框。从第一台计算机上复制并粘贴**设备 ID**,然后单击 **Save**。 + +你应该会在第一台上看到一个请求添加第二台的弹出窗口。接受后,新机器将显示在第一台机器的右下角。与第二台计算机共享默认目录。单击 **Default Folder**,然后单击 **Edit** 按钮。弹出窗口的顶部有四个链接。单击 **Sharing**,然后选择第二台计算机。单击 **Save**,然后查看第二台计算机。你会看到一个接受共享目录的提示。接受后,它将开始在两台计算机之间同步文件。 + +![Sharing a directory in Syncthing][6] + +测试从一台计算机上复制文件到默认目录(**/your/home/Share**)。它应该很快会在另一台上出现。 + +你可以根据需要添加任意数量的目录,这非常方便。如你在第一张图中所看到的,我有一个用于保存配置的 **myconfigs** 文件夹。当我买了一台新机器时,我只需安装 Syncthing,如果我在一台机器上调整了配置,我不必更新所有,它会自动更新。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/sync-files-syncthing + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder) +[2]: https://syncthing.net/ +[3]: https://opensource.com/sites/default/files/uploads/productivity_1-1.png (syncthing console) +[4]: https://opensource.com/sites/default/files/uploads/productivity_1-2.png (Installing Syncthing on Ubuntu) +[5]: https://opensource.com/sites/default/files/uploads/productivity_1-3.png (Machine ID) +[6]: https://opensource.com/sites/default/files/uploads/productivity_1-4.png (Sharing a directory in Syncthing) From 2f97195dfc6e4d323771db85e669a52d25f09be4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 15 Jan 2020 09:02:17 +0800 Subject: [PATCH 363/430] translating --- .../tech/20200113 Keep your email in sync with OfflineIMAP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200113 Keep your email in sync with OfflineIMAP.md b/sources/tech/20200113 Keep your email in sync with OfflineIMAP.md index 1cd8370870..e4e1f1ba94 100644 --- a/sources/tech/20200113 Keep your email in sync with OfflineIMAP.md +++ b/sources/tech/20200113 Keep your email in sync with OfflineIMAP.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fdbaeceba81281f21573c06ff2db9f81be806165 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 Jan 2020 09:12:23 +0800 Subject: [PATCH 364/430] Rename sources/tech/20200114 What communities of practice can do for your organization.md to sources/talk/20200114 What communities of practice can do for your organization.md --- ...4 What communities of practice can do for your organization.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200114 What communities of practice can do for your organization.md (100%) diff --git a/sources/tech/20200114 What communities of practice can do for your organization.md b/sources/talk/20200114 What communities of practice can do for your organization.md similarity index 100% rename from sources/tech/20200114 What communities of practice can do for your organization.md rename to sources/talk/20200114 What communities of practice can do for your organization.md From 903775bc5ee9f0b08d86bcf60b03a86f8429b776 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Jan 2020 11:28:29 +0800 Subject: [PATCH 365/430] PRF @geekpi --- ...ic sequences with the Linux seq command.md | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/translated/tech/20200107 Generating numeric sequences with the Linux seq command.md b/translated/tech/20200107 Generating numeric sequences with the Linux seq command.md index 0b12dfb508..2a99b4b6b3 100644 --- a/translated/tech/20200107 Generating numeric sequences with the Linux seq command.md +++ b/translated/tech/20200107 Generating numeric sequences with the Linux seq command.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Generating numeric sequences with the Linux seq command) @@ -9,10 +9,12 @@ 使用 Linux seq 命令生成数字序列 ====== -Linux seq 命令可以以闪电般的速度生成数字列表。它易于使用而且灵活。 -[Jamie][1] [(CC BY 2.0)][2] -在 Linux 中生成数字列表的最简单方法之一是使用 **seq**(sequence)命令。最简单的形式是,**seq** 接收一个数字,并输出从 1 到该数字的列表。例如: +![](https://img.linux.net.cn/data/attachment/album/202001/15/112717drpb9nuwss84xebu.jpg) + +> Linux 的 seq 命令可以以闪电般的速度生成数字列表,而且它也易于使用而且灵活。 + +在 Linux 中生成数字列表的最简单方法之一是使用 `seq`(系列sequence)命令。其最简单的形式是,`seq` 接收一个数字参数,并输出从 1 到该数字的列表。例如: ``` $ seq 5 @@ -23,7 +25,7 @@ $ seq 5 5 ``` -除非另有指定,否则 **seq** 始终以 1 开头。你可以在最终数字前面插上不同数字开始。 +除非另有指定,否则 `seq` 始终以 1 开头。你可以在最终数字前面插上不同数字开始一个序列。 ``` $ seq 3 5 @@ -34,7 +36,7 @@ $ seq 3 5 ### 指定增量 -你还可以指定增量。假设你要列出 3 的倍数。指定起点(在此示例中为第一个 3 ),增量(第二个 3)和终点(18)。 +你还可以指定增量步幅。假设你要列出 3 的倍数。指定起点(在此示例中为第一个 3 ),增量(第二个 3)和终点(18)。 ``` $ seq 3 3 18 @@ -58,9 +60,7 @@ $ seq 18 -3 3 3 ``` -**seq** 命令也非常快。你或许可以在 10 秒内生成一百万个数字的列表。 - -Advertisement +`seq` 命令也非常快。你或许可以在 10 秒内生成一百万个数字的列表。 ``` $ time seq 1000000 @@ -78,9 +78,9 @@ user 0m0.020s sys 0m0.899s ``` -## 使用分隔符 +### 使用分隔符 -另一个非常有用的选项是使用分隔符。你可以插入逗号,冒号或其他一些字符,而不是在每行上列出单个数字。-s 选项后跟要使用的字符。 +另一个非常有用的选项是使用分隔符。你可以插入逗号、冒号或其他一些字符,而不是在每行上列出单个数字。`-s` 选项后跟要使用的字符。 ``` $ seq -s: 3 3 18 @@ -96,21 +96,21 @@ $ seq -s' ' 3 3 18 ### 开始数学运算 -从生成数字序列到进行数学运算似乎是一个巨大的飞跃,但是有了正确的分隔符,**seq** 可以轻松地传递给 **bc** 进行计算。例如: +从生成数字序列到进行数学运算似乎是一个巨大的飞跃,但是有了正确的分隔符,`seq` 可以轻松地传递给 `bc` 进行计算。例如: ``` $ seq -s* 5 | bc 120 ``` -该命令中发生了什么?让我们来看看。首先,**seq** 生成一个数字列表,并使用 \* 作为分隔符。 +该命令中发生了什么?让我们来看看。首先,`seq` 生成一个数字列表,并使用 `*` 作为分隔符。 ``` $ seq -s* 5 1*2*3*4*5 ``` -然后,它将字符串传递给计算器 (**bc**),计算器立即将数字相乘。你可以在不到一秒的时间内进行相当广泛的计算。 +然后,它将字符串传递给计算器(`bc`),计算器立即将数字相乘。你可以在不到一秒的时间内进行相当庞大的计算。 ``` $ time seq -s* 117 | bc @@ -125,15 +125,13 @@ sys 0m0.000s ### 局限性 -你只能选择一个分隔符,因此计算将非常有限。单独使用 **bc** 可进行更复杂的数学运算。此外,**seq** 仅适用于数字。要生成单个字母序列,请改用如下命令: +你只能选择一个分隔符,因此计算将非常有限。而单独使用 `bc` 可进行更复杂的数学运算。此外,`seq` 仅适用于数字。要生成单个字母的序列,请改用如下命令: ``` $ echo {a..g} a b c d e f g ``` -加入 [Facebook][5] 和 [LinkedIn][6] 上的 Network World 社区,评论热门主题。 - -------------------------------------------------------------------------------- via: https://www.networkworld.com/article/3511954/generating-numeric-sequences-with-the-linux-seq-command.html @@ -141,7 +139,7 @@ via: https://www.networkworld.com/article/3511954/generating-numeric-sequences-w 作者:[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 f562b347c6ebf6c067f8fc6cc3f9e951ad0c2aec Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Jan 2020 11:29:01 +0800 Subject: [PATCH 366/430] PUB @geekpi https://linux.cn/article-11784-1.html --- ...Generating numeric sequences with the Linux seq command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200107 Generating numeric sequences with the Linux seq command.md (98%) diff --git a/translated/tech/20200107 Generating numeric sequences with the Linux seq command.md b/published/20200107 Generating numeric sequences with the Linux seq command.md similarity index 98% rename from translated/tech/20200107 Generating numeric sequences with the Linux seq command.md rename to published/20200107 Generating numeric sequences with the Linux seq command.md index 2a99b4b6b3..c04fc6ff3a 100644 --- a/translated/tech/20200107 Generating numeric sequences with the Linux seq command.md +++ b/published/20200107 Generating numeric sequences with the Linux seq command.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11784-1.html) [#]: subject: (Generating numeric sequences with the Linux seq command) [#]: via: (https://www.networkworld.com/article/3511954/generating-numeric-sequences-with-the-linux-seq-command.html) [#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) From a8c19f772aceb32a5607c5f64001422cb29de015 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Jan 2020 13:06:04 +0800 Subject: [PATCH 367/430] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @heguangzhi 要是这篇更严谨一些会更好 --- ...ll save Raspberry Pi users time in 2020.md | 82 +++++++++---------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/translated/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md b/translated/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md index 3b7ec879eb..9b3a7f9226 100644 --- a/translated/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md +++ b/translated/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md @@ -1,89 +1,87 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How piwheels will save Raspberry Pi users time in 2020) [#]: via: (https://opensource.com/article/20/1/piwheels) [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) - -piwheels 是如何在2020年节省树莓派用户的时间的 +piwheels 是如何为树莓派用户节省时间的 ====== -通过为树莓派提供预编译的 Python 包,piwheels 项目为用户节省了大量的时间和精力。![rainbow colors on pinwheels in the sun][1] -piwheels 自动为[PiPi][2]上的所有项目构建 Python wheels( 预编译的 Python包 ),即 Python 包索引,使用树莓派硬件确保其兼容性。这意味着,当树莓派用户想要使用 **pip**,安装一个Python库时,他们会得到一个现成的编译版本,并保证可以在树莓派上良好的工作。这使得树莓派用户更容易进入和开始他们的项目。 +> 通过为树莓派提供预编译的 Python 包,piwheels 项目为用户节省了大量的时间和精力。 + +![rainbow colors on pinwheels in the sun][1] + +piwheels 自动为 Python 包索引 [PiPi][2] 上的所有项目构建 Python wheels(预编译的 Python包),并使用了树莓派硬件以确保其兼容性。这意味着,当树莓派用户想要使用 `pip` 安装一个 Python 库时,他们会得到一个现成编译好的版本,并保证可以在树莓派上良好的工作。这使得树莓派用户更容易入门并开始他们的项目。 ![Piwheels logo][3] -当我在2018年10月写[piwheels:为树莓派提供快速 Python 包安装][4]时,piwheels 项目已经进入第一年,并且已经证明了其为树莓派用户节省大量时间和精力。但是这个项目已经进入第二年,它为树莓派提供了预编译的 Python 包走了更长的路。 +当我在 2018 年 10 月写 [piwheels:为树莓派提供快速 Python 包安装][4]时,那时 piwheels 项目已经有一年了,并且已经证明了其为树莓派用户节省大量时间和精力。但当这个项目进入第二年时,它为树莓派提供了预编译的 Python 包做了更多工作。 ![Raspberry Pi 4][5] ### 它是怎么工作的 -[Raspbian][6],树莓派的主要操作系统,预配置使用 piwheels,所以用户不需要做任何特殊的事情就可以使用piwheels。 +树莓派的主要操作系统 [Raspbian][6] 预配置使用了 piwheels,所以用户不需要做任何特殊的事情就可以使用 piwheels。 -配置文件(在 **/etc/pip.conf**)告诉 pip 使用[piwheels.org][7]作为 _附加索引_,因此 pip 首先查看PyPI,然后查看 piwheels。piwheels 网站位于树莓派 3的 hosts中,该项目建造的所有 wheels 都位于该派上。它每月提供100多万套服务——对于一台35美元的电脑来说还不错! +配置文件(在 `/etc/pip.conf`)告诉 `pip` 使用 [piwheels.org][7] 作*附加索引*,因此 `pip` 会首先查找 PyPI,然后查找 piwheels。piwheels 的网站被托管在一个树莓派 3 上,该项目构建的所有 wheels 都托管在该树莓派上。它每月提供 100 多万个软件包——这对于一台 35 美元的电脑来说还真不赖! -网站除了主要服务于树莓派以外,piwheels 项目还对使用其他七个派系统并构建软件包。有人运行 Raspbian Jessie,为 Python 3.4 建造 wheels,有人运行 Raspbian Stretch 为 Python 3.5,有人运行 Raspbian Buster 为 Python 3.7。该项目通常不支持其他 Python 版本。还有一个“合适的服务器”——运行 Postgres 数据库的虚拟机。由于 派3 只有1GB的内存,所以(非常大的)数据库不能在其上很好地运行,所以我们把它移到了虚拟机上。带 4GB 内存的 派4 可能是合适的,所以我们将来可能会用到它。 +除了提供网站服务的主树莓派以外,piwheels 项目还使用其他七个树莓派来构建软件包。其中一些运行 Raspbian Jessie,为 Python 3.4 构建 wheels;另外一些运行 Raspbian Stretch 为 Python 3.5 构建;还有一些运行 Raspbian Buster 为 Python 3.7 构建。该项目通常不支持其他 Python 版本。还有一个“合适的服务器”——一台运行 Postgres 数据库的虚拟机。由于树莓派 3 只有 1GB 的内存,所以(非常大的)数据库不能在其上很好地运行,所以我们把它移到了虚拟机上。带 4GB 内存的树莓派 4 可能是合用的,所以我们将来可能会用到它。 + +这些树莓派都在“派云”中的 IPv6 网络上——这是一项由总部位于剑桥的托管公司 [Mythic Beasts][8] 提供的卓越服务。 -派都在“派云”中的 IPv6 网络上——这是一项由总部位于剑桥的托管公司[Mythic Beasts][8]提供的卓越的服务。 ![Mythic Beasts hosting service][9] ### 下载和统计趋势 -每次下载 piwheels 文件时,它都会记录在数据库中。这提供了对什么包最受欢迎以及人们使用什么 Python 版本和操作系统的统计。我们没有太多来自用户代理的信息,但是因为 派1/Zero 的架构显示为 “armv6”,派2/3/4显示为“armv7”,所以我们可以将它们区分开来。 +每次下载 piwheels 文件时,它都会记录在数据库中。这提供了对什么包最受欢迎以及人们使用什么 Python 版本和操作系统的统计。我们没有太多来自用户代理的信息,但是因为树莓派 1/Zero 的架构显示为 “armv6”,树莓派 2/3/4 显示为 “armv7”,所以我们可以将它们区分开来。 -截至2019年12月中旬,从派风车下载的软件包超过1,400万个,仅2019年就有近900万个。 +截至 2019 年 12 月中旬,从 piwheels 下载的软件包超过 1400 万个,仅 2019 年就有近 900 万个。 -自项目开始以来最受欢迎的10个软件包是: +自项目开始以来最受欢迎的 10 个软件包是: - 1. [pycparser][10] (821,060 downloads) - 2. [PyYAML][11] (366,979) - 3. [numpy][12] (354,531) - 4. [cffi][13] (336,982) - 5. [MarkupSafe][14] (318,878) - 6. [future][15] (282,349) - 7. [aiohttp][16] (277,046) - 8. [cryptography][17] (276,167) - 9. [home-assistant-frontend][18] (266,667) - 10. [multidict][19] (256,185) + 1. [pycparser][10](821,060 个下载) + 2. [PyYAML][11](366,979 个下载) + 3. [numpy][12](354,531 个下载) + 4. [cffi][13](336,982 个下载) + 5. [MarkupSafe][14](318,878 个下载) + 6. [future][15](282,349 个下载) + 7. [aiohttp][16](277,046 个下载) + 8. [cryptography][17](276,167 个下载) + 9. [home-assistant-frontend][18](266,667 个下载) + 10. [multidict][19](256,185 个下载) +请注意,许多纯 Python 包,如 [urllib3][20],都是作为 PyPI 上的 wheels 提供的;因为这些是跨平台兼容的,所以通常不会从 piwheels 下载,因为 PyPI 优先。 - -请注意,许多纯 Python 包,如[urllib3][20],都是作为 PyPI 上的 wheels 提供的;因为这些是跨平台兼容的,所以通常不会从 piwheels 下载,因为PyPI优先。 - -随着时间的推移,我们也看到了使用哪些 Python 版本的趋势。这里显示了 Raspbian Buster 发布时从3.5版快速升级到了Python 3.7: +随着时间的推移,我们也看到了使用哪些 Python 版本的趋势。这里显示了 Raspbian Buster 发布时从 3.5 版快速升级到了 Python 3.7: ![Data from piwheels on Python versions used over time][21] +你可以在我们的这篇 [统计博文][22] 看到更多的统计趋势。 -你可以看到更多的统计趋势在[stats blog posts][22]。 +### 节省的时间 -### 节省时间 +每个包构建都被记录在数据库中,并且每个下载也被存储。交叉引用下载数和构建时间显示了节省了多少时间。一个例子是 numpy —— 最新版本大约需要 11 分钟来构建。 +迄今为止,piwheels 项目已经为用户节省了总计超过 165 年的构建时间。按照目前的使用率,piwheels 项目每天可以节省 200 多天。 -每个包构建都被记录在数据库中,并且每个下载也被存储。带有构建持续时间的交叉引用下载显示了节省了多少时间。一个例子是 numpy ——最新版本大约需要11分钟来构建。 - -迄今为止,piwheels 项目已经为用户节省了总计超过165年的构建时间。按照目前的使用率,piwheels 项目每天节省200多天。 - - -除了节省构建时间,拥有预编译的 wheels 也意味着人们不必安装各种开发工具来构建包。一些包需要其他apt包来访问共享库。弄清楚你需要哪一个可能会很痛苦,所以我们也让这一步变得容易了。首先,我们找到了这个过程,[在博客上记录了这个过程][23]。然后,我们将这个逻辑添加到构建过程中,这样当构建一个 wheels 时,它的依赖关系会被自动计算并添加到包的项目页面中: +除了节省构建时间,拥有预编译的 wheels 也意味着人们不必安装各种开发工具来构建包。一些包需要其他 apt 包来访问共享库。弄清楚你需要哪一个可能会很痛苦,所以我们也让这一步变得容易了。首先,我们找到了这个过程,[在博客上记录了这个过程][23]。然后,我们将这个逻辑添加到构建过程中,这样当构建一个 wheels 时,它的依赖关系会被自动计算并添加到包的项目页面中: ![numpy dependencies][24] -### 派风车的下一步是什么? +### piwheels 的下一步是什么? -今年,我们推出了项目页面(例如,[numpy][25),这是一种非常有用的方式,可以让人们以人类可读的方式查找项目信息。它们还使人们更容易报告问题,例如 piwheels 中缺少一个项目,或者他们下载的包有问题。 +今年,我们推出了项目页面(例如,[numpy][25]),这是一种非常有用的方式,可以让人们以人类可读的方式查找项目信息。它们还使人们更容易报告问题,例如 piwheels 中缺少一个项目,或者他们下载的包有问题。 -2020年初,我们计划对 piwheels 项目进行一些升级,以启用新的JSON应用编程接口,这样你就可以自动检查哪些版本可用,查找项目的依赖关系,等等。 +2020 年初,我们计划对 piwheels 项目进行一些升级,以启用新的 JSON 应用编程接口,这样你就可以自动检查哪些版本可用,查找项目的依赖关系,等等。 -下一次 Debian/Raspbian 升级要到2021年年中才会发生,所以在那之前我们不会开始为任何新的 Python 版本 制造 wheels。 +下一次 Debian/Raspbian 升级要到 2021 年年中才会发生,所以在那之前我们不会开始为任何新的 Python 版本构建 wheels。 -你可以在这个项目的[博客][26]上读到更多关于 piwheels 的信息,我将在2020年初在那里发表一篇2019年的综述。你也可以在推特上关注[@piwheels][27],在那里你可以看到每日和每月的统计数据以及任何达到的里程碑。 +你可以在这个项目的[博客][26]上读到更多关于 piwheels 的信息,我将在 2020 年初在那里发表一篇 2019 年的综述。你也可以在推特上关注 [@piwheels][27],在那里你可以看到每日和每月的统计数据以及任何达到的里程碑。 -当然,piwheels 是一个开源项目,你可以在[GitHub][28]上看到整个项目源代码。 +当然,piwheels 是一个开源项目,你可以在 [GitHub][28] 上看到整个项目源代码。 -------------------------------------------------------------------------------- @@ -92,7 +90,7 @@ via: https://opensource.com/article/20/1/piwheels 作者:[Ben Nuttall][a] 选题:[lujun9972][b] 译者:[heguangzhi](https://github.com/heguangzhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2d28ac5fd922bc2f068c5144aecc7c8d1a3de642 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Jan 2020 13:06:55 +0800 Subject: [PATCH 368/430] PUB @heguangzhi https://linux.cn/article-11786-1.html --- ... How piwheels will save Raspberry Pi users time in 2020.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200107 How piwheels will save Raspberry Pi users time in 2020.md (99%) diff --git a/translated/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md b/published/20200107 How piwheels will save Raspberry Pi users time in 2020.md similarity index 99% rename from translated/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md rename to published/20200107 How piwheels will save Raspberry Pi users time in 2020.md index 9b3a7f9226..2fc0aafef9 100644 --- a/translated/tech/20200107 How piwheels will save Raspberry Pi users time in 2020.md +++ b/published/20200107 How piwheels will save Raspberry Pi users time in 2020.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (heguangzhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11786-1.html) [#]: subject: (How piwheels will save Raspberry Pi users time in 2020) [#]: via: (https://opensource.com/article/20/1/piwheels) [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) From 4b21e11eb78c294f0893546af0cb818174d947bb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Jan 2020 00:53:06 +0800 Subject: [PATCH 369/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200115=20Develo?= =?UTF-8?q?p=20GUI=20apps=20using=20Flutter=20on=20Fedora?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md --- ...evelop GUI apps using Flutter on Fedora.md | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md diff --git a/sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md b/sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md new file mode 100644 index 0000000000..afff65b34e --- /dev/null +++ b/sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md @@ -0,0 +1,199 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Develop GUI apps using Flutter on Fedora) +[#]: via: (https://fedoramagazine.org/develop-gui-apps-using-flutter-on-fedora/) +[#]: author: (Carmine Zaccagnino https://fedoramagazine.org/author/carzacc/) + +Develop GUI apps using Flutter on Fedora +====== + +![][1] + +When it comes to app development frameworks, Flutter is the latest and greatest. Google seems to be planning to take over the entire GUI app development world with Flutter, starting with mobile devices, which are already perfectly supported. Flutter allows you to develop cross-platform GUI apps for multiple targets — mobile, web, and desktop — from a single codebase. + +This post will go through how to install the Flutter SDK and tools on Fedora, as well as how to use them both for mobile development and web/desktop development. + +### Installing Flutter and Android SDKs on Fedora + +To get started building apps with Flutter, you need to install + + * the Android SDK; + * the Flutter SDK itself; and, + * optionally, an IDE and its Flutter plugins. + + + +#### Installing the Android SDK + +Flutter requires the installation of the Android SDK with the entire [Android Studio][2] suite of tools. Google provides a _tar.gz_ archive. The Android Studio executable can be found in the _android-studio/bin_ directory and is called _studio.sh_. To run it, open a terminal, _cd_ into the aforementioned directory, and then run: + +``` +$ ./studio.sh +``` + +#### Installing the Flutter SDK + +Before you install Flutter you may want to consider what release channel you want to be on. + +The _stable_ channel is least likely to give you a headache if you just want to build a mobile app using mainstream Flutter features. + +On the other hand, you may want to use the latest features, especially for desktop and web app development. In that case, you might be better off installing either the latest version of the _beta_ or even the _dev_ channel. + +Either way, you can switch between channels after you install using the _flutter channel_ command explained later in the article. + +Head over to the [official SDK archive page][3] and download the latest installation bundle for the release channel most appropriate for your use case. + +The installation bundle is simply a _xz-_compressed tarball (_.tar.xz_ extension). You can extract it wherever you want, given that you add the _flutter/bin_ subdirectory to the _PATH_ environment variable. + +#### Installing the IDE plugins + +To install the plugin for [Visual Studio Code][4], you need to search for _Flutter_ in the _Extensions_ tab. Installing it will also install the _Dart_ plugin. + +The same will happen when you install the plugin for Android Studio by opening the _Settings_, then the _Plugins_ tab and installing the _Flutter_ plugin. + +### Using the Flutter and Android CLI Tools on Fedora + +Now that you’ve installed Flutter, here’s how to use the CLI tool. + +#### Upgrading and Maintaining Your Flutter Installations + +The _flutter doctor_ command is used to check whether your installation and related tools are complete and don’t require any further action. + +For example, the output you may get from _flutter doctor_ right after installing on Fedora is: + +``` +Doctor summary (to see all details, run flutter doctor -v): + +[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Linux, locale it_IT.UTF-8) + +[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2) + + ✗ Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses + +[!] Android Studio (version 3.5) + + ✗ Flutter plugin not installed; this adds Flutter specific functionality. + + ✗ Dart plugin not installed; this adds Dart specific functionality. + +[!] Connected device + + ! No devices available + +! Doctor found issues in 3 categories. +``` + +Of course the issue with the Android toolchain has to be resolved in order to build for Android. Run this command to accept the licenses: + +``` +$ flutter doctor --android-licenses +``` + +Use the _flutter channel_ command to switch channels after installation. It’s just like switching branches on Git (and that’s actually what it does). You use it in the following way: + +``` +$ flutter channel +``` + +…where you’d replace _<channel_name>_ with the release channel you want to switch to. + +After doing that, or whenever you feel the need to do it, you need to update your installation. You might consider running this every once in a while or when a major update comes out if you follow Flutter news. Run this command: + +``` +$ flutter upgrade +``` + +#### Building for Mobile + +You can build for Android very easily: the _flutter build_ command supports it by default, and it allows you to build both APKs and newfangled app bundles. + +All you need to do is to create a project with _flutter create_, which will generate some code for an example app and the necessary _android_ and _ios_ folders. + +When you’re done coding you can either run: + + * _flutter build apk_ or _flutter build appbundle_ to generate the necessary app files to distribute, or + * _flutter run_ to run the app on a connected device or emulator directly. + + + +When you run the app on a phone or emulator with _flutter run_, you can use the _R_ button on the keyboard to use _stateful hot reload_. This feature updates what’s displayed on the phone or emulator to reflect the changes you’ve made to the code without requiring a full rebuild. + +If you input a capital _R_ character to the debug console, you trigger a _hot restart_. This restart doesn’t preserve state and is necessary for bigger changes to the app. + +If you’re using a GUI IDE, you can trigger a hot reload using the _bolt_ icon button and a hot restart with the typical _refresh_ button. + +#### Building for the Desktop + +To build apps for the desktop on Fedora, use the [flutter-desktop-embedding][5] repository. The _flutter create_ command doesn’t have templates for desktop Linux apps yet. That repository contains examples of desktop apps and files required to build on desktop, as well as examples of plugins for desktop apps. + +To build or run apps for Linux, you also need to be on the _master_ release channel and enable Linux desktop app development. To do this, run: + +``` +$ flutter config --enable-linux-desktop +``` + +After that, you can use _flutter run_ to run the app on your development workstation directly, or run _flutter build linux_ to build a binary file in the _build/_ directory. + +If those commands don’t work, run this command in the project directory to generate the required files to build in the _linux/_ directory: + +``` +$ flutter create . +``` + +#### Building for the Web + +Starting with Flutter 1.12, you can build Web apps using Flutter with the mainline codebase, without having to use the _flutter_web_ forked libraries, but you have to be running on the _beta_ channel. + +If you are (you can switch to it using _flutter channel beta_ and _flutter upgrade_ as we’ve seen earlier), you need to enable web development by running _flutter config –enable-web_. + +After doing that, you can run _flutter run -d web_ and a local web server will be started from which you can access your app. The command returns the URL at which the server is listening, including the port number. + +You can also run _flutter build web_ to build the static website files in the _build/_ directory. + +If those commands don’t work, run this command in the project directory to generate the required files to build in the _web/_ directory: + +``` +$ flutter create . +``` + +### Packages for Installing Flutter + +Other distributions have packages or community repositories to install and update in a more straightforward and intuitive way. However, at the time of writing, no such thing exists for Flutter. If you have experience packaging RPMs for Fedora, consider contributing to [this GitHub repository][6] for [this COPR package][7]. + +The next step is learning Flutter. You can do that in a number of ways: + + * Read the good API reference documentation on the official site + * Watching some of the introductory video courses available online + * Read one of the many books out there today. _[Check out the author’s bio for a suggestion! — Ed.]_ + + + +* * * + +_Photo by [Randall Ruiz][8] on [Unsplash][9]._ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/develop-gui-apps-using-flutter-on-fedora/ + +作者:[Carmine Zaccagnino][a] +选题:[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/carzacc/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/01/flutter-816x345.jpg +[2]: https://developer.android.com/studio +[3]: https://flutter.dev/docs/development/tools/sdk/releases?tab=linux +[4]: https://fedoramagazine.org/using-visual-studio-code-fedora/ +[5]: https://github.com/google/flutter-desktop-embedding +[6]: https://github.com/carzacc/flutter-copr +[7]: https://copr.fedorainfracloud.org/coprs/carzacc/flutter/ +[8]: https://unsplash.com/@ruizra?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[9]: https://unsplash.com/s/photos/flutter?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From 0d62e47c46ce814620f58368ba069f1004ca1aea Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Jan 2020 00:54:04 +0800 Subject: [PATCH 370/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200115=20Organi?= =?UTF-8?q?ze=20and=20sync=20your=20calendar=20with=20khal=20and=20vdirsyn?= =?UTF-8?q?cer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md --- ... your calendar with khal and vdirsyncer.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md diff --git a/sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md b/sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md new file mode 100644 index 0000000000..b78ad493af --- /dev/null +++ b/sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Organize and sync your calendar with khal and vdirsyncer) +[#]: via: (https://opensource.com/article/20/1/open-source-calendar) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Organize and sync your calendar with khal and vdirsyncer +====== +Keeping and sharing a calendar can be a pain. Learn how to make it +easier in the fifth article in our series on 20 ways to be more +productive with open source in 2020. +![Calendar close up snapshot][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Keep track of your schedule with khal and vdirsyncer + +Calendars are a _pain_ to deal with, and finding good tooling is always hard. But I've made some progress since last year when I listed calendaring as [one of my "fails."][2] + +The most difficult thing about calendars today is that now they almost always need to be shared online in some way. The two most popular online calendars are Google Calendar and Microsoft Outlook/Exchange. Both are used heavily in corporate environments, which means my calendar has to support one or both options. + +![khal calendar][3] + +[Khal][4] is a console-based calendar that reads and writes VCalendar files. It's fairly easy to configure, but it does not support syncing with other applications. + +Fortunately, khal works with [vdirsyncer][5], a nifty command-line program that can synchronize online calendars (and contacts, which I'll talk about in a separate article) to your local drive. And yes, this includes uploading new events, too. + +![vdirsyncer][6] + +Vdirsyncer is a Python 3 program, and it can be installed via your package manager or pip. It can synchronize CalDAV, VCalendar/iCalendar, Google Calendar, and local files in a directory. Since I use Google Calendar, I'll use that as an example, although it is not the easiest thing to set up. + +Setting vdirsyncer up for Google is [well-documented][7], so I won't go into the nuts and bolts here. The important thing is to make sure your sync pairs are set up in a way that sets Google Calendar as the "winner" for conflict resolution. That is, if there are two updates to the same event, it needs to know which one takes precedence. Do so with something like this: + + +``` +[general] +status_path = "~/.calendars/status" + +[pair personal_sync] +a = "personal" +b = "personallocal" +collections = ["from a", "from b"] +conflict_resolution = "a wins" +metadata = ["color"] + +[storage personal] +type = "google_calendar" +token_file = "~/.vdirsyncer/google_calendar_token" +client_id = "google_client_id" +client_secret = "google_client_secret" + +[storage personallocal] +type = "filesystem" +path = "~/.calendars/Personal" +fileext = ".ics" +``` + +After the first sync of vdirsyncer, you will end up with a series of directories in the storage path. Each will contain several files, one for each entry in the calendar. The next step is to get them into khal. Start by running **khal configure** to do the initial setup. + +![Configuring khal][8] + +Now, running **khal interactive** will bring up the display shown at the beginning of this article. Typing **n** will bring up the New Event dialog. One small thing to note here: the calendars are named to match the directories that vdirsyncer creates, but you can change the khal config file to give them clearer names. Adding colors to entries based on which calendar they're on will also help you identify which is which on the list: + + +``` +[calendars] +[[personal]] +path = ~/.calendars/Personal/kevin@sonney.com/ +color = light magenta +[[holidays]] +path = ~/.calendars/Personal/cln2stbjc4hmgrrcd5i62ua0ctp6utbg5pr2sor1dhimsp31e8n6errfctm6abj3dtmg@virtual/ +color = light blue +[[birthdays]] +path = ~/.calendars/Personal/c5i68sj5edpm4rrfdchm6rreehgm6t3j81jn4rrle0n7cbj3c5m6arj4c5p2sprfdtjmop9ecdnmq@virtual/ +color = brown +``` + +Now when you run **khal interactive**, each calendar will be colored to distinguish it from the others, and when you add a new entry, it will have a more descriptive name. + +![Adding a new calendar entry][9] + +The setup is a little tricky, but once it's done, khal with vdirsyncer gives you an easy way to manage calendar events and keep them in sync with your online services. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-calendar + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calendar.jpg?itok=jEKbhvDT (Calendar close up snapshot) +[2]: https://opensource.com/article/19/1/productivity-tool-wish-list +[3]: https://opensource.com/sites/default/files/uploads/productivity_5-1.png (khal calendar) +[4]: https://khal.readthedocs.io/en/v0.9.2/index.html +[5]: https://github.com/pimutils/vdirsyncer +[6]: https://opensource.com/sites/default/files/uploads/productivity_5-2.png (vdirsyncer) +[7]: https://vdirsyncer.pimutils.org/en/stable/config.html#google +[8]: https://opensource.com/sites/default/files/uploads/productivity_5-3.png (Configuring khal) +[9]: https://opensource.com/sites/default/files/uploads/productivity_5-4.png (Adding a new calendar entry) From dc866e23883e5a37de9e8e8a92af2b4ccafeaf32 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Jan 2020 00:54:31 +0800 Subject: [PATCH 371/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200115=20Why=20?= =?UTF-8?q?everyone=20is=20talking=20about=20WebAssembly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200115 Why everyone is talking about WebAssembly.md --- ...y everyone is talking about WebAssembly.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20200115 Why everyone is talking about WebAssembly.md diff --git a/sources/tech/20200115 Why everyone is talking about WebAssembly.md b/sources/tech/20200115 Why everyone is talking about WebAssembly.md new file mode 100644 index 0000000000..80b5a83060 --- /dev/null +++ b/sources/tech/20200115 Why everyone is talking about WebAssembly.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why everyone is talking about WebAssembly) +[#]: via: (https://opensource.com/article/20/1/webassembly) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) + +Why everyone is talking about WebAssembly +====== +Learn more about the newest way to run any code in a web browser. +![Digital creative of a browser on the internet][1] + +If you haven’t heard of [WebAssembly][2] yet, then you will soon. It’s one of the industry’s best-kept secrets, but it’s everywhere. It’s supported by all the major browsers, and it’s coming to the server-side, too. It’s fast. It’s being used for gaming. It’s an open World Wide Web Consortium (W3C), the main international standards organization for the web, standard. It’s platform-neutral and can run on Linux, Macs, and Windows. + +"Wow," you may be saying, "this sounds like something I should learn to code in!" You’d be right, but you’d be wrong too; you don’t code in WebAssembly. Let’s take some time to learn about the technology that’s often fondly abbreviated to "Wasm." + +### Where did it come from? + +Going back about ten years, there was a growing recognition that the widely-used JavaScript wasn’t fast enough for many purposes. JavaScript was undoubtedly successful and convenient. It ran in any browser and enabled the type of dynamic web pages that we take for granted today. But it was a high-level language and wasn’t designed with compute-intensive workloads in mind. + +However, although engineers responsible for the leading web browsers were generally in agreement about the performance problem, they weren’t aligned on what to do about it. Two camps emerged. Google began its Native Client project and, later, its Portable Native Client variation, to focus on allowing games and other software written in C/C++ to run in a secure compartment within Chrome. Mozilla, meanwhile, won the backing of Microsoft for asm.js, an approach that updated the browser so it can run a low-level subset of JavaScript instructions very quickly (another project enabled the conversion of C/C++ code into these instructions). + +With neither camp gaining widespread adoption, the various parties agreed to join forces in 2015 around a new standard called WebAssembly that built on the basic approach taken by asm.js. [As CNET’s Stephen Shankland wrote at the time][3], "On today’s Web, the browser’s JavaScript translates those instructions into machine code. But with WebAssembly, the programmer does a lot of the work earlier in the process, producing a program that’s in between the two states. That frees the browser from a lot of the hard work of creating the machine code, but it also fulfills the promise of the Web—that software will run on any device with a browser regardless of the underlying hardware details." + +In 2017, Mozilla declared it to be a minimum viable product and brought it out of preview. All the main browsers had adopted it by the end of that year. [In December 2019][4], the WebAssembly Working Group published the three WebAssembly specifications as W3C recommendations. + +WebAssembly defines a portable binary code format for executable programs, a corresponding textual assembly language, and interfaces for facilitating interactions between such programs and their host environment. WebAssembly code runs within a low-level virtual machine that mimics the functionality of the many microprocessors upon which it can be run. Either through Just-In-Time (JIT) compilation or interpretation, the WebAssembly engine can perform at nearly the speed of code compiled for a native platform. + +### Why the interest now? + +Certainly, some of the recent interest in WebAssembly stems from that initial desire to run more compute-intensive code in browsers. Laptop users, in particular, are spending more and more of their time in a browser (or, in the case of Chromebooks, essentially all their time). This trend has created an urgency around removing barriers to running a broad range of applications within a browser. And one of those barriers is often some aspect of performance, which is what WebAssembly and its predecessors were originally conceived to address. + +However, WebAssembly isn’t just for browsers. In 2019, [Mozilla announced a project called WASI][5] (WebAssembly System Interface) to standardize how WebAssembly code interacts with operating systems outside of a browser context. With the combination of browser support for WebAssembly and WASI, compiled binaries will be able to run both within and without browsers, across different devices and operating systems, at near-native speeds. + +WebAssembly’s low overhead immediately makes it practical for use beyond browsers, but that’s arguably table stakes; there are obviously other ways to run applications that don’t introduce performance bottlenecks. Why use WebAssembly, specifically? + +One important reason is its portability. Widely used compiled languages like C++ and Rust are probably the ones most associated with WebAssembly today. However, [a wide range of other languages][6] compile to or have their virtual machines in WebAssembly. Furthermore, while WebAssembly [assumes certain prerequisites][7] for its execution environments, it is designed to execute efficiently on a variety of operating systems and instruction set architectures. WebAssembly code can, therefore, be written using a wide range of languages and run on a wide range of operating systems and processor types. + +Another WebAssembly advantage stems from the fact that code runs within a virtual machine. As a result, each WebAssembly module executes within a sandboxed environment, separated from the host runtime using fault isolation techniques. This implies, among other things, that applications execute in isolation from the rest of their host environment and can’t escape the sandbox without going through appropriate APIs. + +### WebAssembly in action + +What does all this mean in practice? + +One example of WebAssembly in action is [Enarx][8]. + +Enarx is a project that provides hardware independence for securing applications using Trusted Execution Environments (TEE). Enarx lets you securely deliver an application compiled into WebAssembly all the way into a cloud provider and execute it remotely. As Red Hat security engineer [Nathaniel McCallum puts it][9], "The way that we do this is, we take your application as inputs, and we perform an attestation process with the remote hardware. We validate that the remote hardware is, in fact, the hardware that it claims to be, using cryptographic techniques. The end result of that is not only an increased level of trust in the hardware that we’re speaking to; it’s also a session key, which we can then use to deliver encrypted code and data into this environment that we have just asked for cryptographic attestation on." + +Another example is OPA, the Open Policy Agent, which [announced][10] in November 2019 that you could [compile][11] their policy definition language, Rego, into WebAssembly. Rego lets you write logic to search and combine JSON/YAML data from different sources to ask questions like, "Is this API allowed?" + +OPA has been used to policy-enable software including, but not limited to, Kubernetes. Simplifying policy using tools like OPA [is considered an important step][12] for properly securing Kubernetes deployments across a variety of different environments. WebAssembly’s portability and built-in security features are a good match for these tools. + +Our last example is [Unity][13]. Remember, we mentioned at the beginning of the article that WebAssembly is used for gaming? Well, Unity, the cross-platform game engine, was an early adopter of WebAssembly, providing the first demo of Wasm running in browsers, and, since August 2018, [has used WebAssembly][14] as the output target for the Unity WebGL build target. + +These are just a few of the ways WebAssembly has already begun to make an impact. Find out more and keep up to date with all things Wasm at + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/webassembly + +作者:[Mike Bursell][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mikecamel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://opensource.com/article/19/8/webassembly-speed-code-reuse +[3]: https://www.cnet.com/news/the-secret-alliance-that-could-give-the-web-a-massive-speed-boost/ +[4]: https://www.w3.org/blog/news/archives/8123 +[5]: https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ +[6]: https://github.com/appcypher/awesome-wasm-langs +[7]: https://webassembly.org/docs/portability/ +[8]: https://enarx.io +[9]: https://enterprisersproject.com/article/2019/9/application-security-4-facts-confidential-computing-consortium +[10]: https://blog.openpolicyagent.org/tagged/webassembly +[11]: https://github.com/open-policy-agent/opa/tree/master/wasm +[12]: https://enterprisersproject.com/article/2019/11/kubernetes-reality-check-3-takeaways-kubecon +[13]: https://opensource.com/article/20/1/www.unity.com +[14]: https://blogs.unity3d.com/2018/08/15/webassembly-is-here/ From 86b4b65f4d9ebede609b20fd6bfa7f73daa4e220 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Jan 2020 00:55:02 +0800 Subject: [PATCH 372/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200115=206=20ha?= =?UTF-8?q?ndy=20Bash=20scripts=20for=20Git?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200115 6 handy Bash scripts for Git.md --- .../20200115 6 handy Bash scripts for Git.md | 524 ++++++++++++++++++ 1 file changed, 524 insertions(+) create mode 100644 sources/tech/20200115 6 handy Bash scripts for Git.md diff --git a/sources/tech/20200115 6 handy Bash scripts for Git.md b/sources/tech/20200115 6 handy Bash scripts for Git.md new file mode 100644 index 0000000000..03464a840b --- /dev/null +++ b/sources/tech/20200115 6 handy Bash scripts for Git.md @@ -0,0 +1,524 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 handy Bash scripts for Git) +[#]: via: (https://opensource.com/article/20/1/bash-scripts-git) +[#]: author: (Bob Peterson https://opensource.com/users/bobpeterson) + +6 handy Bash scripts for Git +====== +These six Bash scripts will make your life easier when you're working +with Git repositories. +![Digital hand surrounding by objects, bike, light bulb, graphs][1] + +I wrote a bunch of Bash scripts that make my life easier when I'm working with Git repositories. Many of my colleagues say there's no need; that everything I need to do can be done with Git commands. While that may be true, I find the scripts infinitely more convenient than trying to figure out the appropriate Git command to do what I want. + +### 1\. gitlog + +**gitlog** prints an abbreviated list of current patches against the master version. It prints them from oldest to newest and shows the author and description, with **H** for **HEAD**, **^** for **HEAD^**, **2** for **HEAD~2,** and so forth. For example: + + +``` +$ gitlog +\-----------------------[ recovery25 ]----------------------- +(snip) +11 340d27a33895 Bob Peterson     gfs2: drain the ail2 list after io errors +10 9b3c4e6efb10 Bob Peterson     gfs2: clean up iopen glock mess in gfs2_create_inode + 9 d2e8c22be39b Bob Peterson     gfs2: Do proper error checking for go_sync family of glops + 8 9563e31f8bfd Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite + 7 ebac7a38036c Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing + 6 f703a3c27874 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency + 5 a3e86d2ef30e Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite + 4 da3c604755b0 Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite + 3 4525c2f5b46f Bob Peterson     Rafael Aquini's slab instrumentation + 2 a06a5b7dea02 Bob Peterson     GFS2: Add go_get_holdtime to gl_ops + ^ 8ba93c796d5c Bob Peterson     gfs2: introduce new function remaining_hold_time and use it in dq + H e8b5ff851bb9 Bob Peterson     gfs2: Allow rgrps to have a minimum hold time +``` + +If I want to see what patches are on a different branch, I can specify an alternate branch: + + +``` +`$ gitlog recovery24` +``` + +### 2\. gitlog.id + +**gitlog.id** just prints the patch SHA1 IDs: + + +``` +$ gitlog.id +\-----------------------[ recovery25 ]----------------------- +56908eeb6940 2ca4a6b628a1 fc64ad5d99fe 02031a00a251 f6f38da7dd18 d8546e8f0023 fc3cc1f98f6b 12c3e0cb3523 76cce178b134 6fc1dce3ab9c 1b681ab074ca 26fed8de719b 802ff51a5670 49f67a512d8c f04f20193bbb 5f6afe809d23 2030521dc70e dada79b3be94 9b19a1e08161 78a035041d3e f03da011cae2 0d2b2e068fcd 2449976aa133 57dfb5e12ccd 53abedfdcf72 6fbdda3474b3 49544a547188 187032f7a63c 6f75dae23d93 95fc2a261b00 ebfb14ded191 f653ee9e414a 0e2911cb8111 73968b76e2e3 8a3e4cb5e92c a5f2da803b5b 7c9ef68388ed 71ca19d0cba8 340d27a33895 9b3c4e6efb10 d2e8c22be39b 9563e31f8bfd ebac7a38036c f703a3c27874 a3e86d2ef30e da3c604755b0 4525c2f5b46f a06a5b7dea02 8ba93c796d5c e8b5ff851bb9 +``` + +Again, it assumes the current branch, but I can specify a different branch if I want. + +### 3\. gitlog.id2 + +**gitlog.id2** is the same as **gitlog.id** but without the branch line at the top. This is handy for cherry-picking all patches from one branch to the current branch: + + +``` +$ # create a new branch +$ git branch --track origin/master +$ # check out the new branch I just created +$ git checkout recovery26 +$ # cherry-pick all patches from the old branch to the new one +$ for i in `gitlog.id2 recovery25` ; do git cherry-pick $i ;done +``` + +### 4\. gitlog.grep + +**gitlog.grep** greps for a string within that collection of patches. For example, if I find a bug and want to fix the patch that has a reference to function **inode_go_sync**, I simply do: + + +``` +$ gitlog.grep inode_go_sync +\-----------------------[ recovery25 - 50 patches ]----------------------- +(snip) +11 340d27a33895 Bob Peterson     gfs2: drain the ail2 list after io errors +10 9b3c4e6efb10 Bob Peterson     gfs2: clean up iopen glock mess in gfs2_create_inode + 9 d2e8c22be39b Bob Peterson     gfs2: Do proper error checking for go_sync family of glops +152:-static void inode_go_sync(struct gfs2_glock *gl) +153:+static int inode_go_sync(struct gfs2_glock *gl) +163:@@ -296,6 +302,7 @@ static void inode_go_sync(struct gfs2_glock *gl) + 8 9563e31f8bfd Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite + 7 ebac7a38036c Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing + 6 f703a3c27874 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency + 5 a3e86d2ef30e Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite + 4 da3c604755b0 Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite + 3 4525c2f5b46f Bob Peterson     Rafael Aquini's slab instrumentation + 2 a06a5b7dea02 Bob Peterson     GFS2: Add go_get_holdtime to gl_ops + ^ 8ba93c796d5c Bob Peterson     gfs2: introduce new function remaining_hold_time and use it in dq + H e8b5ff851bb9 Bob Peterson     gfs2: Allow rgrps to have a minimum hold time +``` + +So, now I know that patch **HEAD~9** is the one that needs fixing. I use **git rebase -i HEAD~10** to edit patch 9, **git commit -a --amend**, then **git rebase --continue** to make the necessary adjustments. + +### 5\. gitbranchcmp3 + +**gitbranchcmp3** lets me compare my current branch to another branch, so I can compare older versions of patches to my newer versions and quickly see what's changed and what hasn't. It generates a compare script (that uses the KDE tool [Kompare][2], which works on GNOME3, as well) to compare the patches that aren't quite the same. If there are no differences other than line numbers, it prints **[SAME]**. If there are only comment differences, it prints **[same]** (in lower case). For example: + + +``` +$ gitbranchcmp3 recovery24 +Branch recovery24 has 47 patches +Branch recovery25 has 50 patches + +(snip) +38 87eb6901607a 340d27a33895 [same] gfs2: drain the ail2 list after io errors +39 90fefb577a26 9b3c4e6efb10 [same] gfs2: clean up iopen glock mess in gfs2_create_inode +40 ba3ae06b8b0e d2e8c22be39b [same] gfs2: Do proper error checking for go_sync family of glops +41 2ab662294329 9563e31f8bfd [SAME] gfs2: use page_offset in gfs2_page_mkwrite +42 0adc6d817b7a ebac7a38036c [SAME] gfs2: don't use buffer_heads in gfs2_allocate_page_backing +43 55ef1f8d0be8 f703a3c27874 [SAME] gfs2: Improve mmap write vs. punch_hole consistency +44 de57c2f72570 a3e86d2ef30e [SAME] gfs2: Multi-block allocations in gfs2_page_mkwrite +45 7c5305fbd68a da3c604755b0 [SAME] gfs2: Fix end-of-file handling in gfs2_page_mkwrite +46 162524005151 4525c2f5b46f [SAME] Rafael Aquini's slab instrumentation +47              a06a5b7dea02 [    ] GFS2: Add go_get_holdtime to gl_ops +48              8ba93c796d5c [    ] gfs2: introduce new function remaining_hold_time and use it in dq +49              e8b5ff851bb9 [    ] gfs2: Allow rgrps to have a minimum hold time + +Missing from recovery25: +The missing: +Compare script generated at: /tmp/compare_mismatches.sh +``` + +### 6\. gitlog.find + +Finally, I have **gitlog.find**, a script to help me identify where the upstream versions of my patches are and each patch's current status. It does this by matching the patch description. It also generates a compare script (again, using Kompare) to compare the current patch to the upstream counterpart: + + +``` +$ gitlog.find +\-----------------------[ recovery25 - 50 patches ]----------------------- +(snip) +11 340d27a33895 Bob Peterson     gfs2: drain the ail2 list after io errors +lo 5bcb9be74b2a Bob Peterson     gfs2: drain the ail2 list after io errors +10 9b3c4e6efb10 Bob Peterson     gfs2: clean up iopen glock mess in gfs2_create_inode +fn 2c47c1be51fb Bob Peterson     gfs2: clean up iopen glock mess in gfs2_create_inode + 9 d2e8c22be39b Bob Peterson     gfs2: Do proper error checking for go_sync family of glops +lo feb7ea639472 Bob Peterson     gfs2: Do proper error checking for go_sync family of glops + 8 9563e31f8bfd Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite +ms f3915f83e84c Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite + 7 ebac7a38036c Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing +ms 35af80aef99b Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing + 6 f703a3c27874 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency +fn 39c3a948ecf6 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency + 5 a3e86d2ef30e Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite +fn f53056c43063 Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite + 4 da3c604755b0 Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite +fn 184b4e60853d Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite + 3 4525c2f5b46f Bob Peterson     Rafael Aquini's slab instrumentation +   Not found upstream + 2 a06a5b7dea02 Bob Peterson     GFS2: Add go_get_holdtime to gl_ops +   Not found upstream + ^ 8ba93c796d5c Bob Peterson     gfs2: introduce new function remaining_hold_time and use it in dq +   Not found upstream + H e8b5ff851bb9 Bob Peterson     gfs2: Allow rgrps to have a minimum hold time +   Not found upstream +Compare script generated: /tmp/compare_upstream.sh +``` + +The patches are shown on two lines, the first of which is your current patch, followed by the corresponding upstream patch, and a 2-character abbreviation to indicate its upstream status: + + * **lo** means the patch is in the local upstream Git repo only (i.e., not pushed upstream yet). + * **ms** means the patch is in Linus Torvald's master branch. + * **fn** means the patch is pushed to my "for-next" development branch, intended for the next upstream merge window. + + + +Some of my scripts make assumptions based on how I normally work with Git. For example, when searching for upstream patches, it uses my well-known Git tree's location. So, you will need to adjust or improve them to suit your conditions. The **gitlog.find** script is designed to locate [GFS2][3] and [DLM][4] patches only, so unless you're a GFS2 developer, you will want to customize it to the components that interest you. + +### Source code + +Here is the source for these scripts. + +#### 1\. gitlog + + +``` +#!/bin/bash +branch=$1 + +if test "x$branch" = x; then +    branch=`git branch -a | grep "*" | cut -d ' ' -f2` +fi + +patches=0 +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` + +LIST=`git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '` +for i in $LIST; do patches=$(echo $patches + 1 | bc);done + +if [[ $branch =~ .*for-next.* ]] +then +    start=HEAD +#    start=origin/for-next +else +    start=origin/master +fi + +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` + +/usr/bin/echo "-----------------------[" $branch "]-----------------------" +patches=$(echo $patches - 1 | bc); +for i in $LIST; do +    if [ $patches -eq 1 ]; then +        cnt=" ^" +    elif [ $patches -eq 0 ]; then +        cnt=" H" +    else +        if [ $patches -lt 10 ]; then +            cnt=" $patches" +        else +            cnt="$patches" +        fi +    fi +    /usr/bin/git show --abbrev-commit -s --pretty=format:"$cnt %h %<|(32)%an %s %n" $i +    patches=$(echo $patches - 1 | bc) +done +#git log --reverse --abbrev-commit --pretty=format:"%h %<|(32)%an %s" $tracking..$branch +#git log --reverse --abbrev-commit --pretty=format:"%h %<|(32)%an %s" ^origin/master ^linux-gfs2/for-next $branch +``` + +#### 2\. gitlog.id + + +``` +#!/bin/bash +branch=$1 + +if test "x$branch" = x; then +    branch=`git branch -a | grep "*" | cut -d ' ' -f2` +fi + +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` + +/usr/bin/echo "-----------------------[" $branch "]-----------------------" +git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' ' +``` + +#### 3\. gitlog.id2 + + +``` +#!/bin/bash +branch=$1 + +if test "x$branch" = x; then +    branch=`git branch -a | grep "*" | cut -d ' ' -f2` +fi + +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` +git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' ' +``` + +#### 4\. gitlog.grep + + +``` +#!/bin/bash +param1=$1 +param2=$2 + +if test "x$param2" = x; then +    branch=`git branch -a | grep "*" | cut -d ' ' -f2` +    string=$param1 +else +    branch=$param1 +    string=$param2 +fi + +patches=0 +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` + +LIST=`git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '` +for i in $LIST; do patches=$(echo $patches + 1 | bc);done +/usr/bin/echo "-----------------------[" $branch "-" $patches "patches ]-----------------------" +patches=$(echo $patches - 1 | bc); +for i in $LIST; do +    if [ $patches -eq 1 ]; then +        cnt=" ^" +    elif [ $patches -eq 0 ]; then +        cnt=" H" +    else +        if [ $patches -lt 10 ]; then +            cnt=" $patches" +        else +            cnt="$patches" +        fi +    fi +    /usr/bin/git show --abbrev-commit -s --pretty=format:"$cnt %h %<|(32)%an %s" $i +    /usr/bin/git show --pretty=email --patch-with-stat $i | grep -n "$string" +    patches=$(echo $patches - 1 | bc) +done +``` + +#### 5\. gitbranchcmp3 + + +``` +#!/bin/bash +# +# gitbranchcmp3 <old branch> [<new_branch>] +# +oldbranch=$1 +newbranch=$2 +script=/tmp/compare_mismatches.sh + +/usr/bin/rm -f $script +echo "#!/bin/bash" > $script +/usr/bin/chmod 755 $script +echo "# Generated by gitbranchcmp3.sh" >> $script +echo "# Run this script to compare the mismatched patches" >> $script +echo " " >> $script +echo "function compare_them()" >> $script +echo "{"  >> $script +echo "    git show --pretty=email --patch-with-stat \$1 > /tmp/gronk1" >> $script +echo "    git show --pretty=email --patch-with-stat \$2 > /tmp/gronk2" >> $script +echo "    kompare /tmp/gronk1 /tmp/gronk2" >> $script +echo "}" >> $script +echo " " >> $script + +if test "x$newbranch" = x; then +    newbranch=`git branch -a | grep "*" | cut -d ' ' -f2` +fi + +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` + +declare -a oldsha1s=(`git log --reverse --abbrev-commit --pretty=oneline $tracking..$oldbranch | cut -d ' ' -f1 |paste -s -d ' '`) +declare -a newsha1s=(`git log --reverse --abbrev-commit --pretty=oneline $tracking..$newbranch | cut -d ' ' -f1 |paste -s -d ' '`) + +#echo "old: " $oldsha1s +oldcount=${#oldsha1s[@]} +echo "Branch $oldbranch has $oldcount patches" +oldcount=$(echo $oldcount - 1 | bc) +#for o in `seq 0 ${#oldsha1s[@]}`; do +#    echo -n ${oldsha1s[$o]} " " +#    desc=`git show $i | head -5 | tail -1|cut -b5-` +#done + +#echo "new: " $newsha1s +newcount=${#newsha1s[@]} +echo "Branch $newbranch has $newcount patches" +newcount=$(echo $newcount - 1 | bc) +#for o in `seq 0 ${#newsha1s[@]}`; do +#    echo -n ${newsha1s[$o]} " " +#    desc=`git show $i | head -5 | tail -1|cut -b5-` +#done +echo + +for new in `seq 0 $newcount`; do +    newsha=${newsha1s[$new]} +    newdesc=`git show $newsha | head -5 | tail -1|cut -b5-` +    oldsha="            " +    same="[    ]" +    for old in `seq 0 $oldcount`; do +        if test "${oldsha1s[$old]}" = "match"; then +            continue; +        fi +        olddesc=`git show ${oldsha1s[$old]} | head -5 | tail -1|cut -b5-` +        if test "$olddesc" = "$newdesc" ; then +            oldsha=${oldsha1s[$old]} +            #echo $oldsha +            git show $oldsha |tail -n +2 |grep -v "index.*\\.\\." |grep -v "@@" > /tmp/gronk1 +            git show $newsha |tail -n +2 |grep -v "index.*\\.\\." |grep -v "@@"  > /tmp/gronk2 +            diff /tmp/gronk1 /tmp/gronk2 &> /dev/null +            if [ $? -eq 0 ] ;then +# No differences +                same="[SAME]" +                oldsha1s[$old]="match" +                break +            fi +            git show $oldsha |sed -n '/diff/,$p' |grep -v "index.*\\.\\." |grep -v "@@" > /tmp/gronk1 +            git show $newsha |sed -n '/diff/,$p' |grep -v "index.*\\.\\." |grep -v "@@" > /tmp/gronk2 +            diff /tmp/gronk1 /tmp/gronk2 &> /dev/null +            if [ $? -eq 0 ] ;then +# Differences in comments only +                same="[same]" +                oldsha1s[$old]="match" +                break +            fi +            oldsha1s[$old]="match" +            echo "compare_them $oldsha $newsha" >> $script +        fi +    done +    echo "$new $oldsha $newsha $same $newdesc" +done + +echo +echo "Missing from $newbranch:" +the_missing="" +# Now run through the olds we haven't matched up +for old in `seq 0 $oldcount`; do +    if test ${oldsha1s[$old]} != "match"; then +        olddesc=`git show ${oldsha1s[$old]} | head -5 | tail -1|cut -b5-` +        echo "${oldsha1s[$old]} $olddesc" +        the_missing=`echo "$the_missing ${oldsha1s[$old]}"` +    fi +done + +echo "The missing: " $the_missing +echo "Compare script generated at: $script" +#git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' ' +``` + +#### 6\. gitlog.find + + +``` +#!/bin/bash +# +# Find the upstream equivalent patch +# +# gitlog.find +# +cwd=$PWD +param1=$1 +ubranch=$2 +patches=0 +script=/tmp/compare_upstream.sh +echo "#!/bin/bash" > $script +/usr/bin/chmod 755 $script +echo "# Generated by gitbranchcmp3.sh" >> $script +echo "# Run this script to compare the mismatched patches" >> $script +echo " " >> $script +echo "function compare_them()" >> $script +echo "{"  >> $script +echo "    cwd=$PWD" >> $script +echo "    git show --pretty=email --patch-with-stat \$2 > /tmp/gronk2" >> $script +echo "    cd ~/linux.git/fs/gfs2" >> $script +echo "    git show --pretty=email --patch-with-stat \$1 > /tmp/gronk1" >> $script +echo "    cd $cwd" >> $script +echo "    kompare /tmp/gronk1 /tmp/gronk2" >> $script +echo "}" >> $script +echo " " >> $script + +#echo "Gathering upstream patch info. Please wait." +branch=`git branch -a | grep "*" | cut -d ' ' -f2` +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` + +cd ~/linux.git +if test "X${ubranch}" = "X"; then +    ubranch=`git branch -a | grep "*" | cut -d ' ' -f2` +fi +utracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` +# +# gather a list of gfs2 patches from master just in case we can't find it +# +#git log --abbrev-commit --pretty=format:"   %h %<|(32)%an %s" master |grep -i -e "gfs2" -e "dlm" > /tmp/gronk +git log --reverse --abbrev-commit --pretty=format:"ms %h %<|(32)%an %s" master fs/gfs2/ > /tmp/gronk.gfs2 +# ms = in Linus's master +git log --reverse --abbrev-commit --pretty=format:"ms %h %<|(32)%an %s" master fs/dlm/ > /tmp/gronk.dlm + +cd $cwd +LIST=`git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '` +for i in $LIST; do patches=$(echo $patches + 1 | bc);done +/usr/bin/echo "-----------------------[" $branch "-" $patches "patches ]-----------------------" +patches=$(echo $patches - 1 | bc); +for i in $LIST; do +    if [ $patches -eq 1 ]; then +        cnt=" ^" +    elif [ $patches -eq 0 ]; then +        cnt=" H" +    else +        if [ $patches -lt 10 ]; then +            cnt=" $patches" +        else +            cnt="$patches" +        fi +    fi +    /usr/bin/git show --abbrev-commit -s --pretty=format:"$cnt %h %<|(32)%an %s" $i +    desc=`/usr/bin/git show --abbrev-commit -s --pretty=format:"%s" $i` +    cd ~/linux.git +    cmp=1 +    up_eq=`git log --reverse --abbrev-commit --pretty=format:"lo %h %<|(32)%an %s" $utracking..$ubranch | grep "$desc"` +# lo = in local for-next +    if test "X$up_eq" = "X"; then +        up_eq=`git log --reverse --abbrev-commit --pretty=format:"fn %h %<|(32)%an %s" master..$utracking | grep "$desc"` +# fn = in for-next for next merge window +        if test "X$up_eq" = "X"; then +            up_eq=`grep "$desc" /tmp/gronk.gfs2` +            if test "X$up_eq" = "X"; then +                up_eq=`grep "$desc" /tmp/gronk.dlm` +                if test "X$up_eq" = "X"; then +                    up_eq="   Not found upstream" +                    cmp=0 +                fi +            fi +        fi +    fi +    echo "$up_eq" +    if [ $cmp -eq 1 ] ; then +        UP_SHA1=`echo $up_eq|cut -d' ' -f2` +        echo "compare_them $UP_SHA1 $i" >> $script +    fi +    cd $cwd +    patches=$(echo $patches - 1 | bc) +done +echo "Compare script generated: $script" +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/bash-scripts-git + +作者:[Bob Peterson][a] +选题:[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/bobpeterson +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolseriesk12_rh_021x_0.png?itok=fvorN0e- (Digital hand surrounding by objects, bike, light bulb, graphs) +[2]: https://kde.org/applications/development/org.kde.kompare +[3]: https://en.wikipedia.org/wiki/GFS2 +[4]: https://en.wikipedia.org/wiki/Distributed_lock_manager From 01bbc8aefef6bfbc83d2129aee4b2860f8b18bc8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Jan 2020 00:56:08 +0800 Subject: [PATCH 373/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200116=20Google?= =?UTF-8?q?=20Cloud=20launches=20Archive=20cold=20storage=20service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200116 Google Cloud launches Archive cold storage service.md --- ...d launches Archive cold storage service.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/talk/20200116 Google Cloud launches Archive cold storage service.md diff --git a/sources/talk/20200116 Google Cloud launches Archive cold storage service.md b/sources/talk/20200116 Google Cloud launches Archive cold storage service.md new file mode 100644 index 0000000000..cd395aafb5 --- /dev/null +++ b/sources/talk/20200116 Google Cloud launches Archive cold storage service.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Google Cloud launches Archive cold storage service) +[#]: via: (https://www.networkworld.com/article/3513903/google-cloud-launches-archive-cold-storage-service.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +Google Cloud launches Archive cold storage service +====== +Archive will focus on long-term data retention and compete against AWS Glacier, Microsoft Cool Blob Storage, and IBM Cloud Storage. +Google + +Google Cloud announced the general availability of Archive, a long-term data retention service intended as an alternative to on-premises tape backup. + +Google pitches it as cold storage, meaning it is for data which is accessed less than once a year and has been stored for many years. Cold storage data is usually consigned to tape backup, which remains a [surprisingly successful][1] market despite repeated predictions of its demise. + +Of course, Google's competition has their own products. Amazon Web Services has Glacier, Microsoft has Cool Blob Storage, and IBM has Cloud Storage. Google also offers its own Coldline and Nearline cloud storage offerings; Coldline is designed for data a business expects to touch less than once a quarter, while Nearline is aimed at data that requires access less than once a month. + +[][2] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][2] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +With Archive, Google highlights a few differentiators from the competition and its own archival offerings. First, Google promises no delay on data retrieval, claiming millisecond latency. AWS can take minutes or hours. While Archive costs a little more than AWS and Azure – $1.23 per terabyte per month vs. $1 per terabyte per month for AWS and Azure – that’s due in part to the longer remit for an early deletion charge. Google offers 365 days compared with 180 days for AWS and Azure. + +"Having flexible storage options allows you to optimize your total cost of ownership while meeting your business needs," [wrote][3] Geoffrey Noer, Google Cloud storage product manager in a blog post announcing the service’s availability. "At Google Cloud, we think that you should have a range of straightforward storage options that allow you to more securely and reliably access your data when and where you need it, without performance bottlenecks or delays to your users." + +Archive is a store-and-forget service, where you keep stuff only because you have to. Tape replacement and archiving data under regulatory retention requirements are two of the most common use cases, according to Google. Other examples include long-term backups and original master copies of videos and images. + +The Archive class can also be combined with [Bucket Lock][4], Google Cloud’s data locking mechanism to prevent data from being modified, which is available to enterprises for meeting various data retention laws, according to Noer. + + * [Backup vs. archive: Why it’s important to know the difference][5] + * [How to pick an off-site data-backup method][6] + * [Tape vs. disk storage: Why isn’t tape dead yet?][7] + * [The correct levels of backup save time, bandwidth, space][8] + + + +The Archive class can be set up in dual-regions or multi-regions for geo-redundancy and offers checksum verification durability of "11 nines" – 99.999999999 percent. + +More information can be found [here][9]. + +Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3513903/google-cloud-launches-archive-cold-storage-service.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3263452/theres-still-a-lot-of-life-left-in-tape-backup.html +[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://cloud.google.com/blog/products/storage-data-transfer/archive-storage-class-for-coldest-data-now-available +[4]: https://cloud.google.com/storage/docs/bucket-lock +[5]: https://www.networkworld.com/article/3285652/storage/backup-vs-archive-why-its-important-to-know-the-difference.html +[6]: https://www.networkworld.com/article/3328488/backup-systems-and-services/how-to-pick-an-off-site-data-backup-method.html +[7]: https://www.networkworld.com/article/3315156/storage/tape-vs-disk-storage-why-isnt-tape-dead-yet.html +[8]: https://www.networkworld.com/article/3302804/storage/the-correct-levels-of-backup-save-time-bandwidth-space.html +[9]: https://cloud.google.com/blog/products/storage-data-transfer/whats-cooler-than-being-cool-ice-cold-archive-storage +[10]: https://www.facebook.com/NetworkWorld/ +[11]: https://www.linkedin.com/company/network-world From d9a88d6603185cc9d9f67ded4ba32cccce883e10 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Jan 2020 00:57:32 +0800 Subject: [PATCH 374/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200115=20Instan?= =?UTF-8?q?t,=20secure=20=E2=80=98teleportation=E2=80=99=20of=20data=20in?= =?UTF-8?q?=20the=20works?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200115 Instant, secure ‘teleportation- of data in the works.md --- ...re ‘teleportation- of data in the works.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 sources/talk/20200115 Instant, secure ‘teleportation- of data in the works.md diff --git a/sources/talk/20200115 Instant, secure ‘teleportation- of data in the works.md b/sources/talk/20200115 Instant, secure ‘teleportation- of data in the works.md new file mode 100644 index 0000000000..d314baba66 --- /dev/null +++ b/sources/talk/20200115 Instant, secure ‘teleportation- of data in the works.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Instant, secure ‘teleportation’ of data in the works) +[#]: via: (https://www.networkworld.com/article/3512037/instant-secure-teleportation-of-data-in-the-works.html) +[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/) + +Instant, secure ‘teleportation’ of data in the works +====== +Quantum teleportation, where information is sent instantaneously, will secure the Internet, researchers say. Scientists are making progress. +Thinkstock + +Sending information instantly between two computer chips using quantum teleportation has been accomplished reliably for the first time, according to scientists from the University of Bristol, in collaboration with the Technical University of Denmark (DTU). Data was exchanged without any electrical or physical connection – a transmission method that may influence the next generation of ultra-secure data networks. + +Teleportation involves the moving of information instantaneously and securely. In the “Star Trek” series, fictional people move immediately from one place to another via teleportation. In the University of Bristol experiment, data is passed instantly via a single quantum state across two chips using light particles, or photons. Importantly, each of the two chips knows the characteristics of the other, because they’re entangled through quantum physics, meaning they therefore share a single physics-based state. + +The researchers involved in these successful silicon tests said they built the photon-based silicon chips in a lab and then used them to encode the quantum information in single particles. It was “a high-quality entanglement link across two chips, where photons on either chip share a single quantum state,” said Dan Llewellyn of University of Bristol in a [press release][1]. + +[][2] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][2] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +“These chips are able to encode quantum information in light generated inside the circuits and can process the quantum information,” the school stated. It claims a successful quantum teleportation of 91%, which is considered high quality. + +### Entanglement boosts data transmission + +Entanglement links to be used in data transmission are where information is conjoined, or entangled, so that the start of a link has the same state as the end of a link. The particles, and thus data, are at the beginning of the link and at the end of the link at the same time. + +The physics principle holds promise for data transmissions, in part because intrusion is easily seen; interference by a bad actor becomes obvious if the beginning state of the link and the end state are no longer the same. In other words, any change in one element means a change in the other, and that can be over distance, too. Additionally, the technique allows leaks to be stopped: Instant key destruction can occur at the actual moment of attempted interference. + +“Particles can be in two places at the same time, and they can even be entangled with twin particles, so that they can feel everything that happens to each other,” explained Jonas Schou Neergaard-Nielsen, a senior researcher at DTU, [in a 2015 story][3] about the university’s earlier teleportation exploration. “At the sub-microscopic level, where quantum mechanics rule, you find a completely different logic to what we are used to in our macroscopic reality,” Schou Neergaard-Nielsen said back in 2015. + +[[Get regularly scheduled insights by signing up for Network World newsletters.]][4] + +### Quantum chips gain momentum + +In the bigger picture, the area of quantum-based microprocessors is gaining momentum. It is thought, for example, that quantum-embedded chips could ultimately secure the internet of things. IoT security vendor Crypto Quantique has said that quantum chips could be made unclonable. Its solution uses a quantum method of [creating totally random keys][5] from the measurement of low currents on the silicon. It’s related to how electrons can leak through transistor gates. “Unforgeable hardware trust anchors [are] generated by the device,” Crypto Quantique explains on its website. “Our technology offers true randomness.” + +A secure quantum computing environment overall could have “profound impacts on modern society,” the University of Bristol said. And with the introduction of entangled physics states across networks, a highly secured “quantum internet could ultimately protect the world’s information from malicious attacks.” + +Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3512037/instant-secure-teleportation-of-data-in-the-works.html + +作者:[Patrick Nelson][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Patrick-Nelson/ +[b]: https://github.com/lujun9972 +[1]: https://www.bristol.ac.uk/news/2019/december/quantum-teleportation.html +[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://www.dtu.dk/english/news/2015/01/dtu-physics-researchers-developing-tomorrows-teleportation?id=ece937e9-1402-437a-8f57-cc3124563bc8 +[4]: https://www.networkworld.com/newsletters/signup.html +[5]: mailto:https://www.networkworld.com/article/3333808/quantum-embedded-chips-could-secure-iot.html +[6]: https://www.facebook.com/NetworkWorld/ +[7]: https://www.linkedin.com/company/network-world From 6f6eceb0a72a8fe315e56876d8ea6c1a8373e986 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 16 Jan 2020 08:57:57 +0800 Subject: [PATCH 375/430] translated --- ...uration management of multiple machines.md | 60 ------------------- ...uration management of multiple machines.md | 58 ++++++++++++++++++ 2 files changed, 58 insertions(+), 60 deletions(-) delete mode 100644 sources/tech/20200112 Use Stow for configuration management of multiple machines.md create mode 100644 translated/tech/20200112 Use Stow for configuration management of multiple machines.md diff --git a/sources/tech/20200112 Use Stow for configuration management of multiple machines.md b/sources/tech/20200112 Use Stow for configuration management of multiple machines.md deleted file mode 100644 index 0d4a5f19d5..0000000000 --- a/sources/tech/20200112 Use Stow for configuration management of multiple machines.md +++ /dev/null @@ -1,60 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use Stow for configuration management of multiple machines) -[#]: via: (https://opensource.com/article/20/1/configuration-management-stow) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Use Stow for configuration management of multiple machines -====== -Learn how to use Stow to manage configurations across machines in the -second article in our series on 20 ways to be more productive with open -source in 2020. -![A person programming][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Manage symlinks with Stow - -Yesterday, I explained how I keep my files in sync across multiple machines with [Syncthing][2]. But that's only one of the tools I use to keep my configurations consistent. The other is a seemingly simple tool called [Stow][3]. - -![Stow help screen][4] - -Stow manages symlinks. By default, it makes symlinks from the directory it is in to the directory below it. There are also options to set a source and target directory, but I don't usually use them. - -As I mentioned in the Syncthing [article][5], I use Syncthing to keep a directory called **myconfigs** consistent across all of my machines. The **myconfigs** directory has several subdirectories underneath it. Each subdirectory contains the configuration files for one of the applications I use regularly. - -![myconfigs directory][6] - -On each machine, I change to the **myconfigs** directory and run **stow -S <directory name>** to symlink the files inside the directory to my home directory. For example, under the **vim** directory, I have my **.vimrc** and **.vim** directories. On each machine, I run **stow -S vim** to create the symlinks **~/.vimrc** and **~/.vim**. When I make a change to my Vim configuration on one machine, it applies to ALL of my machines. - -Sometimes, though, I need something machine-specific, which is why I have directories like **msmtp-personal** and **msmtp-elastic** (my employer). Since my **msmtp** SMTP client needs to know what email server to relay through, and each one has different setups and credentials, I can use Stow to swap between the two by "unstowing" one with the **-D** flag and then putting the other in place. - -![Unstow one, stow the other][7] - -Sometimes I find myself adding files to a configuration. For that, there is the "restow" option with **-R**. For example, I like to use a specific font when I use Vim as a graphical application and not a console. The **.gvimrc** file lets me set options that apply only to the graphical version, in addition to the standard **.vimrc** file. When I first set this up, I moved **~/.gvimrc** to **~/myconfigs/vim** and then ran **stow -R vim**, which unlinks and relinks everything in that directory. - -Stow lets me switch between several configurations with a simple command line and, in combination with Syncthing, I can be sure that I have the setup I like for the tools I use ready to go, no matter where I am or where I make changes. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/configuration-management-stow - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming) -[2]: https://syncthing.net/ -[3]: https://www.gnu.org/software/stow/ -[4]: https://opensource.com/sites/default/files/uploads/productivity_2-1.png (Stow help screen) -[5]: https://opensource.com/article/20/1/20-productivity-tools-syncthing -[6]: https://opensource.com/sites/default/files/uploads/productivity_2-2.png (myconfigs directory) -[7]: https://opensource.com/sites/default/files/uploads/productivity_2-3.png (Unstow one, stow the other) diff --git a/translated/tech/20200112 Use Stow for configuration management of multiple machines.md b/translated/tech/20200112 Use Stow for configuration management of multiple machines.md new file mode 100644 index 0000000000..1a31d9728a --- /dev/null +++ b/translated/tech/20200112 Use Stow for configuration management of multiple machines.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Stow for configuration management of multiple machines) +[#]: via: (https://opensource.com/article/20/1/configuration-management-stow) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用 Stow 管理多台机器配置 +====== +2020 年,在我们的 20 个使用开源提升生产力的系列文章中,让我们了解如何使用 Stow 跨机器管理配置。 +![A person programming][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 使用 Stow 管理符号链接 + +昨天,我解释了如何使用 [Syncthing][2] 在多台计算机上保持文件同步。但是,这只是我用来保持配置一致性的工具之一。还有另一个简单的工具 [Stow][3]。 + +![Stow help screen][4] + +Stow 管理符号链接。默认情况下,它会链接目录到上一级目录。还有设置源和目标目录的选项,但我通常不使用它们。 + +正如我在 Syncthing 的[文章][5] 中提到的,我使用 Syncthing 来保持 **myconfigs** 目录在我所有的计算机上一致。**myconfigs** 目录下面有多个子目录。每个子目录包含我经常使用的应用之一的配置文件。 + +![myconfigs directory][6] + +在每台计算机上,我进入 **myconfigs** 目录,并运行 **stow -S <目录名称>** 以将目录中的文件符号链接到我的家目录。例如,在**vim** 目录下,我有 **.vimrc** 和 **.vim** 目录。在每台机器上,我运行 **stow -S vim** 来创建符号链接 **~/.vimrc** 和 **~/.vim**。当我在一台计算机上更改 Vim 配置时,它会应用到我的所有机器上。 + +然而,有时候,我需要一些特定于机器的配置,这就是为什么我有如 **msmtp-personal** 和 **msmtp-elastic**(我的雇主)这样的目录。由于我的 **msmtp** SMTP 客户端需要知道要中继的电子邮件服务器,并且每个服务器都有不同的设置和凭据,我会使用 **-D** 标志来取消链接,接着链接另外一个。 + +![Unstow one, stow the other][7] + +有时我要给配置添加文件。为此,有一个 **-R** 选项来”重新链接“。例如,我喜欢在图形化 Vim 中使用一种与控制台不同的特定字体。除了标准 **.vimrc** 文件,**.gvimrc** 文件能让我设置特定于图形化版本的选项。当我第一次设置它时,我移动 **~/.gvimrc** 到 **~/myconfigs/vim** 中,然后运行 **stow -R vim**,它取消链接并重新链接该目录中的所有内容。 + +Stow 让我使用一个简单的命令行在多种配置之间切换,并且,结合 Syncthing,我可以确保无论我身在何处或在哪里进行更改,我都有我喜欢的工具的设置。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/configuration-management-stow + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_keyboard_laptop_development_code_woman.png?itok=vbYz6jjb (A person programming) +[2]: https://syncthing.net/ +[3]: https://www.gnu.org/software/stow/ +[4]: https://opensource.com/sites/default/files/uploads/productivity_2-1.png (Stow help screen) +[5]: https://opensource.com/article/20/1/20-productivity-tools-syncthing +[6]: https://opensource.com/sites/default/files/uploads/productivity_2-2.png (myconfigs directory) +[7]: https://opensource.com/sites/default/files/uploads/productivity_2-3.png (Unstow one, stow the other) From 727f9f185843c89928b73892f25d6053e7d711e3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 16 Jan 2020 09:02:46 +0800 Subject: [PATCH 376/430] translating --- sources/tech/20200114 Organize your email with Notmuch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200114 Organize your email with Notmuch.md b/sources/tech/20200114 Organize your email with Notmuch.md index f881ff5ad9..c9d5cac441 100644 --- a/sources/tech/20200114 Organize your email with Notmuch.md +++ b/sources/tech/20200114 Organize your email with Notmuch.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e2dac9f5f850122c10308733e3e8dc797b6dd861 Mon Sep 17 00:00:00 2001 From: hopefully2333 <787016457@qq.com> Date: Thu, 16 Jan 2020 09:49:36 +0800 Subject: [PATCH 377/430] translating by hopefully2333 translating by hopefully2333 --- sources/tech/20200109 What-s HTTPS for secure computing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200109 What-s HTTPS for secure computing.md b/sources/tech/20200109 What-s HTTPS for secure computing.md index 364ff39b13..8a1d1d47e3 100644 --- a/sources/tech/20200109 What-s HTTPS for secure computing.md +++ b/sources/tech/20200109 What-s HTTPS for secure computing.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (hopefully2333) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 01bf6238e63212205d88f4d66a6e0ec31fc757ab Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Jan 2020 10:58:19 +0800 Subject: [PATCH 378/430] PRF @qianmingtian --- ...Distribution openEuler is Available Now.md | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/translated/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md b/translated/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md index ea6b5d24a5..0671c83bec 100644 --- a/translated/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md +++ b/translated/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md @@ -1,61 +1,60 @@ [#]: collector: (lujun9972) [#]: translator: (qianmingtian) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Huawei’s Linux Distribution openEuler is Available Now!) [#]: via: (https://itsfoss.com/openeuler/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -华为的linux发行版 openEuler 可以使用了! +外媒:华为的 Linux 发行版 openEuler 可以使用了! ====== -华为提供了一个基于 CentOS 的企业 Linux 发行版 EulerOS 。最近,华为发布了一个名为 [openEuler][1] 的 EulerOS 社区版。 +> 华为提供了一个基于 CentOS 的企业级 Linux 发行版 EulerOS。最近,华为发布了一个名为 [openEuler][1] 的 EulerOS 社区版。 -openEuler 的源代码也被发布了。你在微软旗下的 GitHub 上找不到它——源代码可以在 [Gitee][2] 找到,这是一个中文的 [GitHub 的替代品][3] 。 +openEuler 的源代码也一同发布了。你在微软旗下的 GitHub 上找不到它——源代码可以在 [Gitee][2] 找到,这是一个中文的 [GitHub 的替代品][3]。 -它有两个独立的存储库,一个用于存储[源代码][2],另一个作为[包源][4] 存储有助于构建操作系统的软件包。 +它有两个独立的存储库,一个用于存储[源代码][2];另一个作为[软件包的源代码][4],存储有助于构建该操作系统的软件包。 -![][5] +![][5] -openuler 基础架构团队分享了他们使源代码可用的经验: +openEuler 基础架构团队分享了他们使源代码可用的经验: ->我们现在很兴奋。很难想象我们会管理成千上万的仓库。为了确保它们能被成功地编译,我们要感谢所有参与贡献的人。 +> 我们现在很兴奋。很难想象我们会管理成千上万的仓库。为了确保它们能被成功地编译,我们要感谢所有参与贡献的人。 ### openEuler 是基于 CentOS 的 Linux 发行版 与 EulerOS 一样,openEuler OS 也是基于 [CentOS][6],但华为技术有限公司为企业应用进一步开发了该操作系统。 -它是为 ARM64 架构的服务器量身定做的,同时华为声称已经做了一些改变来提高其性能。你可以在[华为发展博客][7]上了解更多。 +它是为 ARM64 架构的服务器量身定做的,同时华为声称已经做了一些改变来提高其性能。你可以在[华为开发博客][7]上了解更多。 ![][8] - 目前,根据 openEuler 的官方声明,有 50 多名贡献者为 openEuler 贡献了近 600 个提交。 -贡献者使源代码对社区可用成为可能。 +贡献者们使源代码对社区可用成为可能。 -值得注意的是,存储库还包括两个与之相关的新项目(或子项目),[iSulad][9] 和 **A-Tune**。 +值得注意的是,存储库还包括两个与之相关的新项目(或子项目),[iSulad][9] 和 A-Tune。 -A-Tune 是一个基于 AI 的操作系统调优软件, iSulad 是一个轻量级的容器运行时守护进程,如[Gitee][2]中提到的那样,它是为物联网和云基础设施设计的。 +A-Tune 是一个基于 AI 的操作系统调优软件,iSulad 是一个轻量级的容器运行时守护进程,如在 [Gitee][2] 中提到的那样,它是为物联网和云基础设施设计的。 -另外,官方的[公告][10]提到,这些系统是在华为云上通过脚本自动化构建的。这确实十分有趣。 +另外,官方的[公告][10]提到,这些系统是在华为云上通过脚本自动构建的。这确实十分有趣。 ### 下载 openEuler ![][11] -到目前为止,你找不到它的英文文档,所以你必须等待或选择通过[文档][12]帮助他们。 +到目前为止,你找不到它的英文文档,所以你必须等待或选择通过(贡献)[文档][12]来帮助他们。 你可以直接从它的[官方网站][13]下载 ISO 来测试它: -[下载 openEuler ][13] +- [下载 openEuler ][13] ### 你认为华为的 openEuler 怎么样? 据 cnTechPost 报道,华为曾宣布 EulerOS 将以新名字 openEuler 成为开源软件。 -目前还不清楚 openEuler 是否会取代 EulerOS ,或者两者会像 CentOS (社区版)和 Red Hat (商业版)一样同时存在。 +目前还不清楚 openEuler 是否会取代 EulerOS ,或者两者会像 CentOS(社区版)和 Red Hat(商业版)一样同时存在。 我还没有测试过它,所以我不能说 openEuler 是否适合英文用户。 @@ -68,7 +67,7 @@ via: https://itsfoss.com/openeuler/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[qianmingtian][c] -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 098a84e15a550d4650bd7d8a6b16f5ac05342cdb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Jan 2020 10:59:34 +0800 Subject: [PATCH 379/430] PUB @qianmingtian https://linux.cn/article-11787-1.html --- ... Huawei-s Linux Distribution openEuler is Available Now.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20200109 Huawei-s Linux Distribution openEuler is Available Now.md (98%) diff --git a/translated/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md b/published/20200109 Huawei-s Linux Distribution openEuler is Available Now.md similarity index 98% rename from translated/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md rename to published/20200109 Huawei-s Linux Distribution openEuler is Available Now.md index 0671c83bec..891902da7e 100644 --- a/translated/news/20200109 Huawei-s Linux Distribution openEuler is Available Now.md +++ b/published/20200109 Huawei-s Linux Distribution openEuler is Available Now.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (qianmingtian) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11787-1.html) [#]: subject: (Huawei’s Linux Distribution openEuler is Available Now!) [#]: via: (https://itsfoss.com/openeuler/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 85dd526232006c2ec60e99cbb4087f177b090bb0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Jan 2020 12:05:29 +0800 Subject: [PATCH 380/430] PRF @geekpi --- ...Python web API with Pyramid and Cornice.md | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/translated/tech/20200106 How to write a Python web API with Pyramid and Cornice.md b/translated/tech/20200106 How to write a Python web API with Pyramid and Cornice.md index ae3afc22af..c6fc97c88a 100644 --- a/translated/tech/20200106 How to write a Python web API with Pyramid and Cornice.md +++ b/translated/tech/20200106 How to write a Python web API with Pyramid and Cornice.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to write a Python web API with Pyramid and Cornice) @@ -9,12 +9,14 @@ 如何使用 Pyramid 和 Cornice 编写 Python Web API ====== -使用 Pyramid 和 Cornice 构建可扩展的 RESTful Web 服务。 -![Searching for code][1] -[Python][2] 是一种高级的,面向对象的编程语言,它以其简单的语法而闻名。它一直是构建 RESTful API 的顶级编程语言之一。 +> 使用 Pyramid 和 Cornice 构建和描述可扩展的 RESTful Web 服务。 -[Pyramid][3] 是一个 Python Web 框架,旨在随着应用的扩展而扩展:这对于简单的应用来说很简单,对于大型、复杂的应用也可以做到。Pyramid 为 PyPI (Python 软件包索引)提供了强大的支持。[Cornice][4] 提供了使用 Pyramid 构建 RESTful Web 服务的助手。 +![](https://img.linux.net.cn/data/attachment/album/202001/16/120352fcgeeccvfgt8sfvc.jpg) + +[Python][2] 是一种高级的、面向对象的编程语言,它以其简单的语法而闻名。它一直是构建 RESTful API 的顶级编程语言之一。 + +[Pyramid][3] 是一个 Python Web 框架,旨在随着应用的扩展而扩展:这可以让简单的应用很简单,也可以增长为大型、复杂的应用。此外,Pyramid 为 PyPI (Python 软件包索引)提供了强大的支持。[Cornice][4] 为使用 Pyramid 构建和描述 RESTful Web 服务提供了助力。 本文将使用 Web 服务的例子来获取名人名言,来展示如何使用这些工具。 @@ -22,7 +24,6 @@ 首先为你的应用创建一个虚拟环境,并创建一个文件来保存代码: - ``` $ mkdir tutorial $ cd tutorial @@ -36,7 +37,6 @@ $ source env/bin/activate 使用以下命令导入这些模块: - ``` from pyramid.config import Configurator from cornice import Service @@ -44,8 +44,7 @@ from cornice import Service ### 定义服务 -将引用服务定义为 **Service** 对象: - +将引用服务定义为 `Service` 对象: ``` QUOTES = Service(name='quotes', @@ -55,8 +54,7 @@ QUOTES = Service(name='quotes', ### 编写引用逻辑 -到目前为止,这仅支持 **GET** 获取名言。用 **QUOTES.get** 装饰函数。这是将逻辑绑定到 REST 服务的方法: - +到目前为止,这仅支持获取名言。用 `QUOTES.get` 装饰函数。这是将逻辑绑定到 REST 服务的方法: ``` @QUOTES.get() @@ -72,14 +70,13 @@ def get_quote(request):     } ``` -请注意,与其他框架不同,装饰器_不能_更改 **get_quote** 函数。如果导入此模块,你仍然可以定期调用该函数并检查结果。 +请注意,与其他框架不同,装饰器*不会*更改 `get_quote` 函数。如果导入此模块,你仍然可以定期调用该函数并检查结果。 在为 Pyramid RESTful 服务编写单元测试时,这很有用。 ### 定义应用对象 -最后,使用 **scan** 查找所有修饰的函数并将其添加到配置中: - +最后,使用 `scan` 查找所有修饰的函数并将其添加到配置中: ``` with Configurator() as config: @@ -94,14 +91,12 @@ with Configurator() as config: 我使用 Twisted 的 WSGI 服务器运行该应用,但是如果需要,你可以使用任何其他 [WSGI][5] 服务器,例如 Gunicorn 或 uWSGI。 - ``` -`(env)$ python -m twisted web --wsgi=main.application` +(env)$ python -m twisted web --wsgi=main.application ``` 默认情况下,Twisted 的 WSGI 服务器运行在端口 8080 上。你可以使用 [HTTPie][6] 测试该服务: - ``` (env) $ pip install httpie ... @@ -130,7 +125,7 @@ X-Content-Type-Options: nosniff ### 为什么要使用 Pyramid? -Pyramid 不是最受欢迎的框架,但它已在 [PyPI][7] 等一些引人注目的项目中使用。我喜欢 Pyramid,因为它是认真对待单元测试的框架之一:因为装饰器不会修改函数并且没有线程局部变量,所以可以直接从单元测试中调用函数。例如,需要访问数据库的函数将从通过 **request.config** 传递的 **request.config** 对象中获取它。这允许单元测试人员将模拟(或真实)数据库对象放入请求中,而不用仔细设置全局变量,线程局部变量或其他特定于框架的东西。 +Pyramid 并不是最受欢迎的框架,但它已在 [PyPI][7] 等一些引人注目的项目中使用。我喜欢 Pyramid,因为它是认真对待单元测试的框架之一:因为装饰器不会修改函数并且没有线程局部变量,所以可以直接从单元测试中调用函数。例如,需要访问数据库的函数将从通过 `request.config` 传递的 `request.config` 对象中获取它。这允许单元测试人员将模拟(或真实)数据库对象放入请求中,而不用仔细设置全局变量、线程局部变量或其他特定于框架的东西。 如果你正在寻找一个经过测试的库来构建你接下来的 API,请尝试使用 Pyramid。你不会失望的。 @@ -140,8 +135,8 @@ via: https://opensource.com/article/20/1/python-web-api-pyramid-cornice 作者:[Moshe Zadka][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a9d02b2f1c90e95cc4e14ade75b515681c6ec1f8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Jan 2020 12:05:49 +0800 Subject: [PATCH 381/430] PUB @geekpi https://linux.cn/article-11788-1.html --- ... How to write a Python web API with Pyramid and Cornice.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200106 How to write a Python web API with Pyramid and Cornice.md (98%) diff --git a/translated/tech/20200106 How to write a Python web API with Pyramid and Cornice.md b/published/20200106 How to write a Python web API with Pyramid and Cornice.md similarity index 98% rename from translated/tech/20200106 How to write a Python web API with Pyramid and Cornice.md rename to published/20200106 How to write a Python web API with Pyramid and Cornice.md index c6fc97c88a..1ebcc920e9 100644 --- a/translated/tech/20200106 How to write a Python web API with Pyramid and Cornice.md +++ b/published/20200106 How to write a Python web API with Pyramid and Cornice.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11788-1.html) [#]: subject: (How to write a Python web API with Pyramid and Cornice) [#]: via: (https://opensource.com/article/20/1/python-web-api-pyramid-cornice) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 0051d1ef3dc1760a68c261e92d13725cb0b86679 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Jan 2020 21:50:11 +0800 Subject: [PATCH 382/430] PRF @cycoe --- ... jumping to your Python platformer game.md | 141 +++++++++--------- 1 file changed, 67 insertions(+), 74 deletions(-) diff --git a/translated/tech/20191205 Add jumping to your Python platformer game.md b/translated/tech/20191205 Add jumping to your Python platformer game.md index 0487cc1491..06fe32cdc0 100644 --- a/translated/tech/20191205 Add jumping to your Python platformer game.md +++ b/translated/tech/20191205 Add jumping to your Python platformer game.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Add jumping to your Python platformer game) @@ -9,26 +9,25 @@ 为你的 Python 平台类游戏添加跳跃功能 ====== -在本期使用 Python Pygame 模块编写视频游戏中,学会如何使用跳跃来对抗重力。 -![游戏厅中的游戏][1] + +> 在本期使用 Python Pygame 模块编写视频游戏中,学会如何使用跳跃来对抗重力。 + +![](https://img.linux.net.cn/data/attachment/album/202001/16/214917c8mxn82fot82fx88.jpg) 在本系列的 [前一篇文章][2] 中,你已经模拟了重力。但现在,你需要赋予你的角色跳跃的能力来对抗重力。 -跳跃是对重力作用的暂时延缓。在这一小段时间里,你是向_上_跳,而不是被重力拉着向下落。但你一旦到达了跳跃的最高点,重力就会重新发挥作用,将你拉回地面。 +跳跃是对重力作用的暂时延缓。在这一小段时间里,你是向*上*跳,而不是被重力拉着向下落。但你一旦到达了跳跃的最高点,重力就会重新发挥作用,将你拉回地面。 -在代码中,跳跃被表示为变量。首先,你需要为玩家对象建立一个变量,使得 Python 能够跟踪对象是否正在跳跃中。一旦玩家对象开始跳跃,他就会再次受到重力的作用,并被拉回最近的物体。 +在代码中,这种变化被表示为变量。首先,你需要为玩家精灵建立一个变量,使得 Python 能够跟踪该精灵是否正在跳跃中。一旦玩家精灵开始跳跃,他就会再次受到重力的作用,并被拉回最近的物体。 ### 设置跳跃状态变量 -你需要为你的 Player 类添加两个新变量: +你需要为你的 `Player` 类添加两个新变量: - * 一个是为了跟踪你的角色是否正在跳跃中,可通过你的玩家对象是否站在坚实的地面来确定 + * 一个是为了跟踪你的角色是否正在跳跃中,可通过你的玩家精灵是否站在坚实的地面来确定 * 一个是为了将玩家带回地面 - - -将如下两个变量添加到你的 **Player** 类中。在下方的代码中,注释前的部分用于提示上下文,因此只需要添加最后两行: - +将如下两个变量添加到你的 `Player` 类中。在下方的代码中,注释前的部分用于提示上下文,因此只需要添加最后两行: ```                 self.movex = 0 @@ -40,16 +39,15 @@                 self.jump_delta = 6 ``` -第一个变量 **collide_delta** 被设为 0 是因为在正常状态下,玩家对象没有处在跳跃中的状态。另一个变量 **jump_delta** 被设为 6,是为了防止对象在第一次进入游戏世界时就发生反弹(实际上就是跳跃)。当你完成了本篇文章的示例,尝试把该变量设为 0 看看会发生什么。 +第一个变量 `collide_delta` 被设为 0 是因为在正常状态下,玩家精灵没有处在跳跃中的状态。另一个变量 `jump_delta` 被设为 6,是为了防止精灵在第一次进入游戏世界时就发生反弹(实际上就是跳跃)。当你完成了本篇文章的示例,尝试把该变量设为 0 看看会发生什么。 ### 跳跃中的碰撞 -如果你是跳到一个蹦床上,那你的跳跃一定非常优美。但是如果你是跳向一面墙会发生什么呢?(千万不要去尝试!)不管你的起跳多么令人印象深刻,当你撞到比你更大更硬的物体时,你都会立马停下。(译注:原理参考动量守恒定律) +如果你是跳到一个蹦床上,那你的跳跃一定非常优美。但是如果你是跳向一面墙会发生什么呢?(千万不要去尝试!)不管你的起跳多么令人印象深刻,当你撞到比你更大更硬的物体时,你都会立马停下。(LCTT 译注:原理参考动量守恒定律) -为了在你的视频游戏中模拟这一点,你需要在你的玩家对象与地面等东西发生碰撞时,将 **self.collide_delta** 变量设为 0。如果你的 **self.collide_delta** 不是 0 而是其它的什么值,那么你的玩家就会发生跳跃,并且当你的玩家与墙或者地面发生碰撞时无法跳跃。 - -在你的 **Player** 类的 **update** 方法中,将地面碰撞相关代码块修改为如下所示: +为了在你的视频游戏中模拟这一点,你需要在你的玩家精灵与地面等东西发生碰撞时,将 `self.collide_delta` 变量设为 0。如果你的 `self.collide_delta` 不是 0 而是其它的什么值,那么你的玩家就会发生跳跃,并且当你的玩家与墙或者地面发生碰撞时无法跳跃。 +在你的 `Player` 类的 `update` 方法中,将地面碰撞相关代码块修改为如下所示: ```         ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) @@ -57,42 +55,40 @@             self.movey = 0             self.rect.y = worldy-ty-ty             self.collide_delta = 0 # 停止跳跃 -            if self.rect.y > g.rect.y: -                self.health -=1 -                print(self.health) + if self.rect.y > g.rect.y: + self.health -=1 + print(self.health) ``` -这段代码块检查了地面对象和玩家对象之间发生的碰撞。当发生碰撞时,它会将玩家 Y 方向的坐标值设置为游戏窗口的高度减去一个瓷贴的高度再减去另一个瓷贴的高度。以此保证了玩家对象是站在地面**上**,而不是嵌在地面里。同时它也将 **self.collide_delta** 设为 0,使得程序能够知道玩家未处在跳跃中。除此之外,它将 **self.movey** 设为 0,使得程序能够知道玩家当前未受到重力的牵引作用(这是游戏物理引擎的奇怪之处,一旦玩家落地,也就没有必要继续将玩家拉向地面)。 +这段代码块检查了地面精灵和玩家精灵之间发生的碰撞。当发生碰撞时,它会将玩家 Y 方向的坐标值设置为游戏窗口的高度减去一个瓷砖的高度再减去另一个瓷砖的高度。以此保证了玩家精灵是站在地面*上*,而不是嵌在地面里。同时它也将 `self.collide_delta` 设为 0,使得程序能够知道玩家未处在跳跃中。除此之外,它将 `self.movey` 设为 0,使得程序能够知道玩家当前未受到重力的牵引作用(这是游戏物理引擎的奇怪之处,一旦玩家落地,也就没有必要继续将玩家拉向地面)。 -此处 **if** 语句用来检测玩家是否已经落到地面之_下_,如果是,那就扣除一点生命值作为惩罚。此处假定了你希望当你的玩家落到地图之外时失去生命值。这个设定不是必需的,它只是平台类游戏的一种惯例。更有可能的是,你希望这个事件能够触发另一些事件,或者说是一种能够让你的现实世界玩家沉迷于让对象掉到屏幕之外的东西。一种简单的恢复方式是在玩家对象掉落到地图之外时,将 **self.rect.y** 重新设置为 0,这样它就会在地图上方重新生成,并落到坚实的地面上。 +此处 `if` 语句用来检测玩家是否已经落到地面之*下*,如果是,那就扣除一点生命值作为惩罚。此处假定了你希望当你的玩家落到地图之外时失去生命值。这个设定不是必需的,它只是平台类游戏的一种惯例。更有可能的是,你希望这个事件能够触发另一些事件,或者说是一种能够让你的现实世界玩家沉迷于让精灵掉到屏幕之外的东西。一种简单的恢复方式是在玩家精灵掉落到地图之外时,将 `self.rect.y` 重新设置为 0,这样它就会在地图上方重新生成,并落到坚实的地面上。 ### 撞向地面 -模拟的重力使你玩家的 Y 坐标不断增大(译注:此处原文中为 0,但在 Pygame 中越靠下方 Y 坐标应越大)。要实现跳跃,完成如下代码使你的玩家对象离开地面,飞向空中。 - -在你的 **Player** 类的 **update** 方法中,添加如下代码来暂时延缓重力的作用: +模拟的重力使你玩家的 Y 坐标不断增大(LCTT 译注:此处原文中为 0,但在 Pygame 中越靠下方 Y 坐标应越大)。要实现跳跃,完成如下代码使你的玩家精灵离开地面,飞向空中。 +在你的 `Player` 类的 `update` 方法中,添加如下代码来暂时延缓重力的作用: ``` -        if self.collide_delta < 6 and self.jump_delta < 6: +        if self.collide_delta < 6 and self.jump_delta < 6:             self.jump_delta = 6*2             self.movey -= 33  # 跳跃的高度             self.collide_delta += 6             self.jump_delta    += 6 ``` -根据此代码所示,跳跃使玩家对象向空中移动了 33 个像素。此处是_负_ 33 是因为在 Pygame 中,越小的数代表距离屏幕顶端越近。 +根据此代码所示,跳跃使玩家精灵向空中移动了 33 个像素。此处是*负* 33 是因为在 Pygame 中,越小的数代表距离屏幕顶端越近。 -不过此事件视条件而定,只有当 **self.collide_delta** 小于 6(缺省值定义在你 **Player** 类的 **init** 方法中)并且 **self.jump_delta** 也于 6 的时候才会发生。此条件能够保证直到玩家碰到一个平台,才能触发另一次跳跃。换言之,它能够阻止空中二段跳。 +不过此事件视条件而定,只有当 `self.collide_delta` 小于 6(缺省值定义在你 `Player` 类的 `init` 方法中)并且 `self.jump_delta` 也于 6 的时候才会发生。此条件能够保证直到玩家碰到一个平台,才能触发另一次跳跃。换言之,它能够阻止空中二段跳。 在某些特殊条件下,你可能不想阻止空中二段跳,或者说你允许玩家进行空中二段跳。举个栗子,如果玩家获得了某个战利品,那么在他被敌人攻击到之前,都能够拥有空中二段跳的能力。 -当你完成本篇文章中的示例,尝试将 **self.collide_delta** 和 **self.jump_delta** 设置为 0,从而获得百分之百的几率触发空中二段跳。 +当你完成本篇文章中的示例,尝试将 `self.collide_delta` 和 `self.jump_delta` 设置为 0,从而获得百分之百的几率触发空中二段跳。 ### 在平台上着陆 -目前你已经定义了再玩家对象摔落地面时的抵抗重力条件,但此时你的游戏代码仍保持平台与地面置于不同的列表中(就像本文中做的很多其他选择一样,这个设定并不是必需的,你可以尝试将地面作为另一种平台)。为了允许玩家对象站在平台之上,你必须像检测地面碰撞一样,检测玩家对象与平台对象之间的碰撞。将如下代码放于你的 **update** 方法中: - +目前你已经定义了在玩家精灵摔落地面时的抵抗重力条件,但此时你的游戏代码仍保持平台与地面置于不同的列表中(就像本文中做的很多其他选择一样,这个设定并不是必需的,你可以尝试将地面作为另一种平台)。为了允许玩家精灵站在平台之上,你必须像检测地面碰撞一样,检测玩家精灵与平台精灵之间的碰撞。将如下代码放于你的 `update` 方法中: ```         plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) @@ -103,27 +99,26 @@ 但此处还有一点需要考虑:平台悬在空中,也就意味着玩家可以通过从上面或者从下面接触平台来与之互动。 -确定平台如何与玩家互动取决于你,阻止玩家从下方到达平台也并不稀奇。将如下代码加到上方的代码块中,使得平台表现得像天花板或者说是藤架。只有在玩家对象跳得比平台上沿更高时才能跳到平台上,但会阻止玩家从平台下方跳上来: - +确定平台如何与玩家互动取决于你,阻止玩家从下方到达平台也并不稀奇。将如下代码加到上方的代码块中,使得平台表现得像天花板或者说是藤架。只有在玩家精灵跳得比平台上沿更高时才能跳到平台上,但会阻止玩家从平台下方跳上来: ``` -            if self.rect.y > p.rect.y: +            if self.rect.y > p.rect.y:                 self.rect.y = p.rect.y+ty             else:                 self.rect.y = p.rect.y-ty ``` -此处 **if** 语句代码块的第一个子句阻止玩家对象从平台正下方跳到平台上。如果它检测到玩家对象的坐标比平台更大(在 Pygame 中,坐标更大意味着在屏幕的更下方),那么将玩家对象新的 Y 坐标设置为当前平台的 Y 坐标加上一个瓷贴的高度。实际效果就是保证玩家对象距离平台一个瓷贴的高度,防止其从下方穿过平台。 +此处 `if` 语句代码块的第一个子句阻止玩家精灵从平台正下方跳到平台上。如果它检测到玩家精灵的坐标比平台更大(在 Pygame 中,坐标更大意味着在屏幕的更下方),那么将玩家精灵新的 Y 坐标设置为当前平台的 Y 坐标加上一个瓷砖的高度。实际效果就是保证玩家精灵距离平台一个瓷砖的高度,防止其从下方穿过平台。 -**else** 子句做了相反的事情。当程序运行到此处时,如果玩家对象的 Y 坐标_不_比平台的更大,意味着玩家对象是从空中落下(不论是由于玩家刚刚从此处生成,或者是玩家执行了跳跃)。在这种情况下,玩家对象的 Y 坐标被设为平台的 Y 坐标减去一个瓷贴的高度(切记,在 Pygame 中更小的 Y 坐标代表在屏幕上的更高处)。这样就能保证玩家在平台_上_,除非他从平台上跳下来或者走下来。 +`else` 子句做了相反的事情。当程序运行到此处时,如果玩家精灵的 Y 坐标*不*比平台的更大,意味着玩家精灵是从空中落下(不论是由于玩家刚刚从此处生成,或者是玩家执行了跳跃)。在这种情况下,玩家精灵的 Y 坐标被设为平台的 Y 坐标减去一个瓷砖的高度(切记,在 Pygame 中更小的 Y 坐标代表在屏幕上的更高处)。这样就能保证玩家在平台*上*,除非他从平台上跳下来或者走下来。 -你也可以尝试其他的方式来处理玩家与平台之间的互动。举个栗子,也许玩家对象被设定为处在平台的“前面”,他能够无障碍地跳跃穿过平台并站在上面。或者你可以设计一种平台会减缓而又不完全阻止玩家的跳跃过程。甚至你可以通过将不同平台分到不同列表中来混合搭配使用。 +你也可以尝试其他的方式来处理玩家与平台之间的互动。举个栗子,也许玩家精灵被设定为处在平台的“前面”,他能够无障碍地跳跃穿过平台并站在上面。或者你可以设计一种平台会减缓而又不完全阻止玩家的跳跃过程。甚至你可以通过将不同平台分到不同列表中来混合搭配使用。 ### 触发一次跳跃 -目前为此,你的代码已经模拟了所有必需的跳跃条件,但仍缺少一个跳跃触发器。你的玩家对象的 **self.jump_delta** 初始值被设置为 6,只有当它比 6 小时才会触发更新跳跃的代码。 +目前为此,你的代码已经模拟了所有必需的跳跃条件,但仍缺少一个跳跃触发器。你的玩家精灵的 `self.jump_delta` 初始值被设置为 6,只有当它比 6 小的时候才会触发更新跳跃的代码。 -为跳跃变量设置一个新的设置方法,在你的 **Player** 类中创建一个 **jump** 方法,并将 **self.jump_delta** 设为小于 6 的值。通过使玩家对象向空中移动 33 个像素,来暂时减缓重力的作用。 +为跳跃变量设置一个新的设置方法,在你的 `Player` 类中创建一个 `jump` 方法,并将 `self.jump_delta` 设为小于 6 的值。通过使玩家精灵向空中移动 33 个像素,来暂时减缓重力的作用。 ``` @@ -131,25 +126,24 @@         self.jump_delta = 0 ``` -不管你相信与否,这就是 **jump** 方法的全部。剩余的部分在 **update** 方法中,你已经在前面实现了相关代码。 +不管你相信与否,这就是 `jump` 方法的全部。剩余的部分在 `update` 方法中,你已经在前面实现了相关代码。 要使你游戏中的跳跃功能生效,还有最后一件事情要做。如果你想不起来是什么,运行游戏并观察跳跃是如何生效的。 -问题就在于你的主循环中没有调用 **jump** 方法。先前你已经为该方法创建了一个按键占位符,现在,跳跃键所做的就是将 **jump** 打印到终端。 +问题就在于你的主循环中没有调用 `jump` 方法。先前你已经为该方法创建了一个按键占位符,现在,跳跃键所做的就是将 `jump` 打印到终端。 ### 调用 jump 方法 -在你的主循环中,将_上_方向键的效果从打印一条调试语句,改为调用 **jump** 方法。 - -注意此处,与 **update** 方法类似,**jump** 方法也需要检测碰撞,因此你需要告诉它使用哪个 **plat_list**。 +在你的主循环中,将*上*方向键的效果从打印一条调试语句,改为调用 `jump` 方法。 +注意此处,与 `update` 方法类似,`jump` 方法也需要检测碰撞,因此你需要告诉它使用哪个 `plat_list`。 ```             if event.key == pygame.K_UP or event.key == ord('w'):                 player.jump(plat_list) ``` -如果你倾向于使用空格键作为跳跃键,使用 **pygame.K_SPACE** 替代 **pygame.K_UP** 作为按键。另一种选择,你可以同时使用两种方式(使用单独的 **if** 语句),给玩家多一种选择。 +如果你倾向于使用空格键作为跳跃键,使用 `pygame.K_SPACE` 替代 `pygame.K_UP` 作为按键。另一种选择,你可以同时使用两种方式(使用单独的 `if` 语句),给玩家多一种选择。 现在来尝试你的游戏吧!在下一篇文章中,你将让你的游戏卷动起来。 @@ -157,7 +151,6 @@ 以下是目前为止的所有代码: - ``` #!/usr/bin/env python3 # draw a world @@ -220,7 +213,7 @@ class Player(pygame.sprite.Sprite):     def gravity(self):         self.movey += 3.2 # how fast player falls         -        if self.rect.y > worldy and self.movey >= 0: +        if self.rect.y > worldy and self.movey >= 0:             self.movey = 0             self.rect.y = worldy-ty         @@ -233,23 +226,23 @@ class Player(pygame.sprite.Sprite):             def update(self):         ''' -        更新对象位置 +        更新精灵位置         '''                 self.rect.x = self.rect.x + self.movex         self.rect.y = self.rect.y + self.movey         # 向左移动 -        if self.movex < 0: +        if self.movex < 0:             self.frame += 1 -            if self.frame > ani*3: +            if self.frame > ani*3:                 self.frame = 0             self.image = self.images[self.frame//ani]         # 向右移动 -        if self.movex > 0: +        if self.movex > 0:             self.frame += 1 -            if self.frame > ani*3: +            if self.frame > ani*3:                 self.frame = 0             self.image = self.images[(self.frame//ani)+4] @@ -263,7 +256,7 @@ class Player(pygame.sprite.Sprite):         for p in plat_hit_list:             self.collide_delta = 0 # stop jumping             self.movey = 0 -            if self.rect.y > p.rect.y: +            if self.rect.y > p.rect.y:                 self.rect.y = p.rect.y+ty             else:                 self.rect.y = p.rect.y-ty @@ -273,11 +266,11 @@ class Player(pygame.sprite.Sprite):             self.movey = 0             self.rect.y = worldy-ty-ty             self.collide_delta = 0 # stop jumping -            if self.rect.y > g.rect.y: +            if self.rect.y > g.rect.y:                 self.health -=1                 print(self.health)                 -        if self.collide_delta < 6 and self.jump_delta < 6: +        if self.collide_delta < 6 and self.jump_delta < 6:             self.jump_delta = 6*2             self.movey -= 33  # how high to jump             self.collide_delta += 6 @@ -308,22 +301,22 @@ class Enemy(pygame.sprite.Sprite):         self.movey += 3.2         -        if self.counter >= 0 and self.counter <= distance: +        if self.counter >= 0 and self.counter <= distance:             self.rect.x += speed -        elif self.counter >= distance and self.counter <= distance*2: +        elif self.counter >= distance and self.counter <= distance*2:             self.rect.x -= speed         else:             self.counter = 0                 self.counter += 1 -        if not self.rect.y >= worldy-ty-ty: +        if not self.rect.y >= worldy-ty-ty:             self.rect.y += self.movey         plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False)         for p in plat_hit_list:             self.movey = 0 -            if self.rect.y > p.rect.y: +            if self.rect.y > p.rect.y:                 self.rect.y = p.rect.y+ty             else:                 self.rect.y = p.rect.y-ty @@ -352,7 +345,7 @@ class Level():         ground_list = pygame.sprite.Group()         i=0         if lvl == 1: -            while i < len(gloc): +            while i < len(gloc):                 ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png')                 ground_list.add(ground)                 i=i+1 @@ -371,9 +364,9 @@ class Level():             ploc.append((300,worldy-ty-256,3))             ploc.append((500,worldy-ty-128,4)) -            while i < len(ploc): +            while i < len(ploc):                 j=0 -                while j <= ploc[i][2]: +                while j <= ploc[i][2]:                     plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png')                     plat_list.add(plat)                     j=j+1 @@ -417,11 +410,11 @@ eloc = [] eloc = [200,20] gloc = [] #gloc = [0,630,64,630,128,630,192,630,256,630,320,630,384,630] -tx = 64 # 瓷贴尺寸 -ty = 64 # 瓷贴尺寸 +tx = 64 # 瓷砖尺寸 +ty = 64 # 瓷砖尺寸 i=0 -while i <= (worldx/tx)+tx: +while i <= (worldx/tx)+tx:     gloc.append(i*tx)     i=i+1 @@ -482,9 +475,8 @@ while main == True: * [如何在你的 Python 游戏中添加一个玩家][8] * [用 Pygame 使你的游戏角色移动起来][9] * [如何向你的 Python 游戏中添加一个敌人][10] - * [在你的 Python 游戏中模拟重力][2] - - + * [在 Pygame 游戏中放置平台][11] + * [在你的 Python 游戏中模拟引力][2] -------------------------------------------------------------------------------- @@ -493,19 +485,20 @@ via: https://opensource.com/article/19/12/jumping-python-platformer-game 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[cycoe](https://github.com/cycoe) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/arcade_game_gaming.jpg?itok=84Rjk_32 (Arcade games) -[2]: https://opensource.com/article/19/11/simulate-gravity-python +[2]: https://linux.cn/article-11780-1.html [3]: https://opensource.com/sites/default/files/uploads/pygame-jump.jpg (Pygame platformer) [4]: https://www.python.org/ [5]: https://www.pygame.org/ -[6]: https://opensource.com/article/17/10/python-101 -[7]: https://opensource.com/article/17/12/game-framework-python -[8]: https://opensource.com/article/17/12/game-python-add-a-player -[9]: https://opensource.com/article/17/12/game-python-moving-player -[10]: https://opensource.com/article/18/5/pygame-enemy +[6]: https://linux.cn/article-9071-1.html +[7]: https://linux.cn/article-10850-1.html +[8]: https://linux.cn/article-10858-1.html +[9]: https://linux.cn/article-10874-1.html +[10]: https://linux.cn/article-10883-1.html +[11]: https://linux.cn/article-10902-1.html From 419615b21b0d8d8cec51990d801bb5f41537f0a0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Jan 2020 21:50:43 +0800 Subject: [PATCH 383/430] PUB @cycoe https://linux.cn/article-11790-1.html --- .../20191205 Add jumping to your Python platformer game.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191205 Add jumping to your Python platformer game.md (99%) diff --git a/translated/tech/20191205 Add jumping to your Python platformer game.md b/published/20191205 Add jumping to your Python platformer game.md similarity index 99% rename from translated/tech/20191205 Add jumping to your Python platformer game.md rename to published/20191205 Add jumping to your Python platformer game.md index 06fe32cdc0..d7195a008a 100644 --- a/translated/tech/20191205 Add jumping to your Python platformer game.md +++ b/published/20191205 Add jumping to your Python platformer game.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (cycoe) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11790-1.html) [#]: subject: (Add jumping to your Python platformer game) [#]: via: (https://opensource.com/article/19/12/jumping-python-platformer-game) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From f2e58086eb7e27ea6f2acbecb5d65b39969c688c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Jan 2020 23:00:19 +0800 Subject: [PATCH 384/430] PRF&PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chen-ni https://linux.cn/article-11791-1.html 翻译的很好! --- ... Still Using an ‘Outdated- Linux Kernel.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) rename {translated/tech => published}/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md (77%) diff --git a/translated/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md b/published/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md similarity index 77% rename from translated/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md rename to published/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md index b8af543814..4075e017a8 100644 --- a/translated/tech/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md +++ b/published/20191227 Explained- Why Your Distribution Still Using an ‘Outdated- Linux Kernel.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11791-1.html) [#]: subject: (Explained! Why Your Distribution Still Using an ‘Outdated’ Linux Kernel?) [#]: via: (https://itsfoss.com/why-distros-use-old-kernel/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) @@ -10,7 +10,9 @@ 为什么你的发行版仍然在使用“过时的”Linux 内核? ====== -[检查一下你的系统所使用的 Linux 内核版本][1],你十有八九会发现,按照 Linux 内核官网提供的信息,该内核版本已经达到使用寿命终期了。 +![](https://img.linux.net.cn/data/attachment/album/202001/16/225806jbqyacu3loolobae.png) + +[检查一下你的系统所使用的 Linux 内核版本][1],你十有八九会发现,按照 Linux 内核官网提供的信息,该内核版本已经达到使用寿命终期(EOL)了。 一个软件一旦达到了使用寿命终期,那么就意味着它再也不会得到 bug 修复和维护了。 @@ -18,11 +20,11 @@ 下面将逐一解答这些问题。 -总结 - -上游内核维护与你的发行版的内核维护是两个不同的概念。 - -例如,根据 Linux 内核官网,Linux 内核 4.15 版本可能已经达到使用寿命终期了,但是在 2023 年 4 月之前,Ubuntu 18.04 长期维护版本将会继续使用这个版本,并通过向后移植安全补丁和修复 bug 来提供维护。 +> **总结** +> +> 上游内核维护与你的发行版的内核维护是两个不同的概念。 +> +> 例如,根据 Linux 内核官网,Linux 内核 4.15 版本可能已经达到使用寿命终期了,但是在 2023 年 4 月之前,Ubuntu 18.04 长期维护版本将会继续使用这个版本,并通过向后移植安全补丁和修复 bug 来提供维护。 ### 检查 Linux 内核版本,以及是否达到使用寿命终期 @@ -35,13 +37,11 @@ uname -r 我使用的是 Ubuntu 18.04,输出的 Linux 内核版本如下: ``` -[email protected]:~$ uname -r +abhishek@itsfoss:~$ uname -r 5.0.0-37-generic ``` -接下来,可以到 Linux 内核官网上看看哪些 Linux 内核版本仍然在维护状态。在网站主页上就可以看到相关信息。 - -[Linux 内核官网][2] +接下来,可以到 [Linux 内核官网][2]上看看哪些 Linux 内核版本仍然在维护状态。在网站主页上就可以看到相关信息。 你看到的内核版本状态应该类似于下图: @@ -53,7 +53,7 @@ uname -r 不幸的是,Linux 内核的生命周期没有任何规律可循。不是说常规的内核稳定发布版可以得到 X 月的维护、长期维护版本(LTS)可以得到 Y 年的维护。没有这回事。 -根据实际需求,可能会存在内核的多个 LTS 版本,其使用寿命终期各不相同。在[这个页面][5]上可以查到这些 LTS 版本的相关信息,包括推定的使用寿命终期。 +根据实际需求,可能会存在内核的多个 LTS 版本,其使用寿命终期各不相同。在[这个页面][5]上可以查到这些 LTS 版本的相关信息,包括计划的使用寿命终期。 那么问题来了:既然 Linux 内核官网上明确表示 5.0 版本的内核已经达到了使用寿命终期,Ubuntu 为什么还在提供这个内核版本呢? @@ -63,11 +63,11 @@ uname -r 你是否想过,为什么 Ubuntu/Debian/Fedora 等发行版被称为 Linux “发行版”?这是因为,它们“发行” Linux 内核。 -这些发行版会对 Linux 内核进行不同的修改,并添加各种 GUI 元素(包括桌面环境,显示服务器等)以及软件,然后再呈现给用户。 +这些发行版会对 Linux 内核进行不同的修改,并添加各种 GUI 元素(包括桌面环境、显示服务器等)以及软件,然后再呈现给用户。 按照通常的工作流,Linux 发行版会选择一个内核,提供给其用户,然后在接下来的几个月、几年中,甚至是达到内核的使用寿命终期之后,仍然会继续使用该内核。 -这样能够保障安全吗?其实是可以的,因为 _**发行版会通过向后移植全部的重要修补来维护内核**_。 +这样能够保障安全吗?其实是可以的,因为 **发行版会通过向后移植全部的重要修补来维护内核**。 换句话说,你的 Linux 发行版会确保 Linux 内核没有漏洞和 bug,并且已经通过向后移植获得了重要的新特性。在“过时的旧版本 Linux 内核”上,其实有着数以千计的改动。 @@ -83,13 +83,13 @@ uname -r 新的 Linux 内核稳定版本每隔 2 到 3 个月发布一次,有不少用户跃跃欲试。 -实话说,除非有十分充分的理由,否则不应该使用最新版本的稳定内核。你使用的发行版并不会提供这个选项,你也不能指望通过在键盘上敲出“_sudo apt give-me-the-latest-stable-kernel_”解决问题。 +实话说,除非有十分充分的理由,否则不应该使用最新版本的稳定内核。你使用的发行版并不会提供这个选项,你也不能指望通过在键盘上敲出 `sudo apt give-me-the-latest-stable-kernel` 解决问题。 -此外,手动[安装主流 Linux 内核版本][8]本身就是一个挑战。即使安装成功,之后每次发布 bug 修复的时候,负责更新内核的就会是你了。此外,当新内核达到使用寿命终期之后,你就有责任将它升级到更新的内核版本了。和常规的[Ubuntu 更新][9]不同,内核升级无法通过 apt upgrade 完成。 +此外,手动[安装主流 Linux 内核版本][8]本身就是一个挑战。即使安装成功,之后每次发布 bug 修复的时候,负责更新内核的就会是你了。此外,当新内核达到使用寿命终期之后,你就有责任将它升级到更新的内核版本了。和常规的 [Ubuntu 更新][9]不同,内核升级无法通过 `apt upgrade` 完成。 同样需要记住的是,切换到主流内核之后,可能就无法使用你的发行版提供的一些驱动程序和补丁了。 -正如 [Greg Kroah-Hartman][10]所言,“_**你能使用的最好的内核,就是别人在维护的内核。**_”除了你的 Linux 发行版之外,又有谁更胜任这份工作呢! +正如 [Greg Kroah-Hartman][10]所言,“**你能使用的最好的内核,就是别人在维护的内核。**”除了你的 Linux 发行版之外,又有谁更胜任这份工作呢! 希望你对这个主题已经有了更好的理解。下回发现你的系统正在使用的内核版本已经达到使用寿命终期的时候,希望你不会感到惊慌失措。 @@ -102,7 +102,7 @@ via: https://itsfoss.com/why-distros-use-old-kernel/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[chen-ni](https://github.com/chen-ni) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3f6b672ec7f97aeba6e30e9a9c852b44b66fd22c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Jan 2020 00:57:09 +0800 Subject: [PATCH 385/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200117=20Insigh?= =?UTF-8?q?ts=20into=20Why=20Hyperbola=20GNU/Linux=20is=20Turning=20into?= =?UTF-8?q?=20Hyperbola=20BSD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md --- ...GNU-Linux is Turning into Hyperbola BSD.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 sources/tech/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md diff --git a/sources/tech/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md b/sources/tech/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md new file mode 100644 index 0000000000..68ede9acfa --- /dev/null +++ b/sources/tech/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md @@ -0,0 +1,174 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Insights into Why Hyperbola GNU/Linux is Turning into Hyperbola BSD) +[#]: via: (https://itsfoss.com/hyperbola-linux-bsd/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +Insights into Why Hyperbola GNU/Linux is Turning into Hyperbola BSD +====== + +In late December 2019, [Hyperbola][1] [announced][2] that they would be making major changes to their project. They have decided to drop the Linux kernel in favor of forking the OpenBSD kernel. This announcement only came months after Project Trident [announced][3] that they were going in the opposite direction (from BSD to Linux). + +Hyperbola also plans to replace all software that is not GPL v3 compliant with new versions that are. + +To get more insight into the future of their new project, I interviewed **Andre, co-founder of Hyperbola**. + +### Why Hyperbola GNU/Linux Turned into Hyperbola BSD + +![][4] + +_**It’s FOSS: In your announcement, you state that the Linux kernel is “rapidly proceeding down an unstable path”. Could you explain what you mean by that?**_ + +**Andre:** First of all, it’s including the adaption of DRM features such as [HDCP][5] (High-bandwidth Digital Content Protection). Currently there is an option to disable it at build time, however there isn’t a policy that guarantees us that it will be optional forever. + +Historically, some features began as optional ones until they reached total functionality. Then they became forced and difficult to patch out. Even if this does not happen in the case of HDCP, we remain cautious about such implementations. + +Another of the reasons is that the _**Linux kernel is no longer getting proper hardening**_. [Grsecurity][6] stopped offering public patches several years ago, and we depended on that for our system’s security. Although we could use their patches still for a very expensive subscription, the subscription would be terminated if we chose to make those patches public. + +Such restrictions goes against the FSDG principles that require us to provide full source code, deblobbed, and unrestricted, to our users. + +KSPP is a project that was intended to upstream Grsec into the kernel, but thus far it has not come close to reaching Grsec / PaX level of kernel hardening. There also has not been many recent developments, which leads us to believe it is now an inactive project for the most part. + +Lastly, the interest in [allowing Rust modules][7] into the kernel are a problem for us, due to Rust trademark restrictions which prevent us from applying patches in our distribution without express permission. We patch to remove non-free software, unlicensed files, and enhancements to user-privacy anywhere it is applicable. We also expect our users to be able to re-use our code without any additional restrictions or permission required. + +This is also in part why we use UXP, a fully free browser engine and application toolkit without Rust, for our mail and browser applications. + +Due to these restrictions, and the concern that it may at some point become a forced build-time dependency for the kernel we needed another option. + +_**It’s FOSS: You also said in the announcement that you would be forking the OpenBSD kernel. Why did you pick the OpenBSD kennel over the FreeBSD, the DragonflyBSD kernel or the MidnightBSD kernel?**_ + +**Andre:** [OpenBSD][8] was chosen as our base for hard-forking because it’s a system that has always had quality code and security in mind. + +Some of their ideas which greatly interested us were new system calls, including pledge and unveil which adds additional hardening to userspace and the removal of the systrace system policy-enforcement tool. + +They also are known for [Xenocara][9] and [LibreSSL][10], both of which we had already been using after porting them to [GNU/Linux-libre][11]. We found them to be well written and generally more stable than Xorg/OpenSSL respectively. + +None of the other BSD implementations we are aware of have that level of security. We also were aware [LibertyBSD][12] has been working on liberating the OpenBSD kernel, which allowed us to use their patches to begin the initial development. + +_**It’s FOSS: Why fork the kernel in the first place? How will you keep the new kernel up-to-date with newer hardware support?**_ + +**Andre:** The kernel is one of the most important parts of any operating system, and we felt it is critical to start on a firm foundation moving forward. + +For the first version we plan to keep in synchronization with OpenBSD where it is possible. In future versions we may adapt code from other BSDs and even the Linux kernel where needed to keep up with hardware support and features. + +We are working in coordination with [Libreware Group][13] (our representative for business activities) and have plans to open our foundation soon. + +This will help to sustain development, hire future developers and encourage new enthusiasts for newer hardware support and code. We know that deblobbing isn’t enough because it’s a mitigation, not a solution for us. So, for that reason, we need to improve our structure and go to the next stage of development for our projects. + +_**It’s FOSS: You state that you plan to replace the parts of the OpenBSD kernel and userspace that are not GPL compatible or non-free with those that are. What percentage of the code falls into the non-GPL zone?**_ + +**Andre:** It’s around 20% in the OpenBSD kernel and userspace. + +Mostly, the non-GPL compatible licensed parts are under the Original BSD license, sometimes called the “4-clause BSD license” that contains a serious flaw: the “obnoxious BSD advertising clause”. It isn’t fatal, but it does cause practical problems for us because it generates incompatibility with our code and future development under GPLv3 and LGPLv3. + +The non-free files in OpenBSD include files without an appropriate license header, or without a license in the folder containing a particular component. + +If those files don’t contain a license to give users the four essential freedoms or if it has not been explicitly added in the public domain, it isn’t free software. Some developers think that code without a license is automatically in the public domain. That isn’t true under today’s copyright law; rather, all copyrightable works are copyrighted by default. + +The non-free firmware blobs in OpenBSD include various hardware firmwares. These firmware blobs occur in Linux kernel also and have been manually removed by the Linux-libre project for years following each new kernel release. + +They are typically in the form of a hex encoded binary and are provided to kernel developers without source in order to provide support for proprietary-designed hardware. These blobs may contain vulnerabilities or backdoors in addition to violating your freedom, but no one would know since the source code is not available for them. They must be removed to respect user freedom. + +_**It’s FOSS: I was talking with someone about HyperbolaBSD and they mentioned [HardenedBSD][14]. Have you considered HardenedBSD?**_ + +**Andre:** We had looked into HardenedBSD, but it was forked from FreeBSD. FreeBSD has a much larger codebase. While HardenedBSD is likely a good project, it would require much more effort for us to deblob and verify licenses of all files. + +We decided to use OpenBSD as a base to fork from instead of FreeBSD due to their past commitment to code quality, security, and minimalism. + +_**It’s FOSS: You mentioned UXP (or [Unified XUL Platform][15]). It appears that you are using [Moonchild’s fork of the pre-Servo Mozilla codebase][16] to create a suite of applications for the web. Is that about the size of it?**_ + +**Andre:** Yes. Our decision to use UXP was for several reasons. We were already rebranding Firefox as Iceweasel for several years to remove DRM, disable telemetry, and apply preset privacy options. However, it became harder and harder for us to maintain when Mozilla kept adding anti-features, removing user customization, and rapidly breaking our rebranding and privacy patches. + +After FF52, all XUL extensions were removed in favor of WebExt and Rust became enforced at compile time. We maintain several XUL addons to enhance user-privacy/security which would no longer work in the new engine. We also were concerned that the feature limited WebExt addons were introducing additional privacy issues. E.g. each installed WebExt addon contains a UUID which can be used to uniquely and precisely identify users (see [Bugzilla 1372288][17]). + +After some research, we discovered UXP and that it was regularly keeping up with security fixes without rushing to implement new features. They had already disabled telemetry in the toolkit and remain committed to deleting all of it from the codebase. + +We knew this was well-aligned with our goals, but still needed to apply a few patches to tweak privacy settings and remove DRM. Hence, we started creating our own applications on top of the toolkit. + +This has allowed us to go far beyond basic rebranding/deblobbing as we were doing before and create our own fully customized XUL applications. We currently maintain [Iceweasel-UXP][18], [Icedove-UXP][19] and [Iceape-UXP][20] in addition to sharing toolkit improvements back to UXP. + +_**It’s FOSS: In a [forum post][21], I noticed mentions of HyperRC, HyperBLibC, and hyperman. Are these forks or rewrites of current BSD tools to be GPL compliant?**_ + +**Andre:** They are forks of existing projects. + +Hyperman is a fork of our current package manager, pacman. As pacman does not currently work on BSD, and the minimal support it had in the past was removed in recent versions, a fork was required. Hyperman already has a working implementation using LibreSSL and BSD support. + +HyperRC will be a patched version of OpenRC init. HyperBLibC will be a fork from BSD LibC. + +_**It’s FOSS: Since the beginning of time, Linux has championed the GPL license and BSD has championed the BSD license. Now, you are working to create a BSD that is GPL licensed. How would you respond to those in the BSD community who don’t agree with this move?**_ + +**Andre:** We are aware that there are disagreements between the GPL and BSD world. There are even disagreements over calling our previous distribution “GNU/Linux” rather than simply “Linux”, since the latter definition ignores that the GNU userspace was created in 1984, several years prior to the Linux kernel being created by Linus Torvalds. It was the two different software combined that make a complete system. + +Some of the primary differences from BSD, is that the GPL requires that our source code must be made public, including future versions, and that it can only be used in tandem with compatibly licensed files. BSD systems do not have to share their source code publicly, and may bundle themselves with various licenses and non-free software without restriction. + +Since we are strong supporters of the Free Software Movement and wish that our future code remain in the public space always, we chose the GPL. + +_**It’s FOSS: I know at this point you are just starting the process, but do you have any idea who you might have a usable version of HyperbolaBSD available?**_ + +**Andre:** We expect to have an alpha release ready by 2021 (Q3) for initial testing. + +_**It’s FOSS: How long will you continue to support the current Linux version of Hyperbola? Will it be easy for current users to switch over to**_? + +**Andre:** As per our announcement, we will continue to support Hyperbola GNU/Linux-libre until 2022 (Q4). We expect there to be some difficulty in migration due to ABI changes, but will prepare an announcement and information on our wiki once it is ready. + +_**It’s FOSS: If someone is interested in helping you work on HyperbolaBSD, how can they go about doing that? What kind of expertise would you be looking for?**_ + +**Andre:** Anyone who is interested and able to learn is welcome. We need C programmers and users who are interested in improving security and privacy in software. Developers need to follow the FSDG principles of free software development, as well as the YAGNI principle which means we will implement new features only as we need them. + +Users can fork our git repository and submit patches to us for inclusion. + +_**It’s FOSS: Do you have any plans to support ZFS? What filesystems will you support?**_ + +**Andre:** [ZFS][22] support is not currently planned, because it uses the Common Development and Distribution License, version 1.0 (CDDL). This license is incompatible with all versions of the GNU General Public License (GPL). + +It would be possible to write new code under GPLv3 and release it under a new name (eg. HyperZFS), however there is no official decision to include ZFS compatibility code in HyperbolaBSD at this time. + +We have plans on porting BTRFS, JFS2, NetBSD’s CHFS, DragonFlyBSD’s HAMMER/HAMMER2 and the Linux kernel’s JFFS2, all of which have licenses compatible with GPLv3. Long term, we may also support Ext4, F2FS, ReiserFS and Reiser4, but they will need to be rewritten due to being licensed exclusively under GPLv2, which does not allow use with GPLv3. All of these file systems will require development and stability testing, so they will be in later HyperbolaBSD releases and not for our initial stable version(s). + +* * * + +I would like to thank Andre for taking the time to answer my questions and for revealing more about the future of HyperbolaBSD. + +What are your thoughts on Hyperbola switching to a BSD kernel? What do you think about a BSD being released under the GPL? 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][23]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/hyperbola-linux-bsd/ + +作者:[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://www.hyperbola.info/ +[2]: https://www.hyperbola.info/news/announcing-hyperbolabsd-roadmap/ +[3]: https://itsfoss.com/bsd-project-trident-linux/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/hyperbola_linux_bsd.png?ssl=1 +[5]: https://patchwork.kernel.org/patch/10084131/ +[6]: https://grsecurity.net/ +[7]: https://lwn.net/Articles/797828/ +[8]: https://www.openbsd.org/ +[9]: https://www.xenocara.org/ +[10]: https://www.libressl.org/ +[11]: https://en.wikipedia.org/wiki/Linux-libre +[12]: https://libertybsd.net/ +[13]: https://en.libreware.info/ +[14]: https://hardenedbsd.org/ +[15]: http://thereisonlyxul.org/ +[16]: https://github.com/MoonchildProductions/UXP +[17]: https://bugzilla.mozilla.org/show_bug.cgi?id=1372288 +[18]: https://wiki.hyperbola.info/doku.php?id=en:project:iceweasel-uxp +[19]: https://wiki.hyperbola.info/doku.php?id=en:project:icedove-uxp +[20]: https://wiki.hyperbola.info/doku.php?id=en:project:iceape-uxp +[21]: https://forums.hyperbola.info/viewtopic.php?id=315 +[22]: https://itsfoss.com/what-is-zfs/ +[23]: https://reddit.com/r/linuxusersgroup From ea96b681141b1a5bc6b5d0d536bc1429f9e3eed3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Jan 2020 00:57:54 +0800 Subject: [PATCH 386/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200116=203=20op?= =?UTF-8?q?en=20source=20tools=20to=20manage=20your=20contacts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200116 3 open source tools to manage your contacts.md --- ...en source tools to manage your contacts.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20200116 3 open source tools to manage your contacts.md diff --git a/sources/tech/20200116 3 open source tools to manage your contacts.md b/sources/tech/20200116 3 open source tools to manage your contacts.md new file mode 100644 index 0000000000..eeb7877de1 --- /dev/null +++ b/sources/tech/20200116 3 open source tools to manage your contacts.md @@ -0,0 +1,145 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 open source tools to manage your contacts) +[#]: via: (https://opensource.com/article/20/1/sync-contacts-locally) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +3 open source tools to manage your contacts +====== +Access your contacts more quickly by syncing them locally. Learn how in +the sixth in our series on 20 ways to be more productive with open +source in 2020. +![Team communication, chat][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Open source tools for contact management + +In previous articles in this series, I explained how to synchronize your [mail][2] and [calendars][3] locally. Hopefully, that has sped up accessing your mail and calendar. Now I'll talk about contacts, which you can use to send mail and calendar invites. + +![abook][4] + +I have collected a lot of email addresses over the course of my, well, life so far. And managing all that data can be a bit of a pain. There are web-based services, but they aren't as fast as a local copy. + +A few days ago, I talked about [vdirsyncer][5] for managing calendars. Vdirsyncer also handles contacts using the CardDAV protocol. Vdirsyncer supports **google_contacts** and **carddav** to do contact synchronizations in addition to the **filesystem** store it uses for calendars, but the **fileext** setting will change, so you won't be trying to store contacts in calendar files. + +I added a configuration block to the config file and mirrored my contacts from Google. Extra steps are required to set it up. Once the Google setup is complete, the configuration is pretty simple: + + +``` +[pair address_sync] +a = "googlecard" +b = "localcard" +collections = ["from a", "from b"] +conflict_resolution = "a wins" + +[storage googlecard] +type = "google_contacts" +token_file = "~/.vdirsyncer/google_token" +client_id = "my_client_id" +client_secret = "my_client_secret" + +[storage localcard] +type = "filesystem" +path = "~/.calendars/Addresses/" +fileext = ".vcf" +``` + +Now when I run **vdirsyncer discover**, it finds my Google contacts, and **vdirsyncer sync** copies them to my local machine. But again, that's only half the story. Now I want to read and use the contacts. Enter [khard][6] and [abook][7]. + +![khard search][8] + +Why two applications? Each has its own use case, and in this case, more is better. Khard does for addresses what [khal][9] does for calendar entries. You'll probably want to install the latest release via pip if your distribution ships an older version. Once khard is installed, you need to create **~/.config/khard/khard.conf** because khard doesn't have a nifty configuration wizard the way khal does. Mine looks like this: + + +``` +[addressbooks] +[[addresses]] +path = ~/.calendars/Addresses/default/ + +[general] +debug = no +default_action = list +editor = vim, -i, NONE +merge_editor = vimdiff + +[contact table] +display = first_name +group_by_addressbook = no +reverse = no +show_nicknames = yes +show_uids = no +sort = last_name +localize_dates = yes + +[vcard] +preferred_version = 3.0 +search_in_source_files = yes +skip_unparsable = no +``` + +This defines the source address book (and gives it a friendly name), as well as what to display and what do use to edit contacts. Running **khard list** will list all the entries, and **khard list <[some@email.adr][10]>** will search for a specific entry. If you want to add or edit an entry, the **add** and **edit** commands launch the configured editor with the same basic template, the only difference being that the **add** template will be blank. + +![editing in khard][11] + +Abook requires you to import and export VCF files but offers some nice features for lookups. To convert your files to the abook format, first install abook and create the **~/.abook** default directory. Now tell abook to parse all the files and put them into the **~/.abook/addresses** file: + + +``` +apt install abook +ls ~/.calendars/Addresses/default/* | xargs cat | abook --convert --informat vcard --outformat abook > ~/.abook/addresses +``` + +Now run **abook**, and you'll have a very nice UI to browse, search, and edit the entries. Exporting them back to individual entries is a bit of a pain, so I do most of my edits with khard and have a cron job to import them into abook. + +Abook can also search on the command line and has a lot of documentation about integrating it with mail clients. For example, you can use abook for lookups in the [Notmuch][12] email client [alot][13] by adding some information to the **.config/alot/config** file: + + +``` +[accounts] +  [[Personal]] +     realname = Kevin Sonney +     address = [kevin@sonney.com][14] +     alias_regexp = kevin\[+.+@sonney.com][15] +     gpg_key = 7BB612C9 +     sendmail_command = msmtp --account=Personal -t +     # ~ expansion works +     sent_box = maildir://~/Maildir/Sent +     draft_box = maildir://~/Maildir/Drafts +    [[[abook]]] +        type = abook +``` + +And there you have it: fast lookup of your contacts to go with your mail and calendars! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/sync-contacts-locally + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_team_mobile_desktop.png?itok=d7sRtKfQ (Team communication, chat) +[2]: https://opensource.com/article/20/1/sync-email-offlineimap +[3]: https://opensource.com/article/20/1/open-source-calendar +[4]: https://opensource.com/sites/default/files/uploads/productivity_6-1.png (abook) +[5]: https://github.com/pimutils/vdirsyncer +[6]: https://github.com/scheibler/khard +[7]: http://abook.sourceforge.net/ +[8]: https://opensource.com/sites/default/files/uploads/productivity_6-2.png (khard search) +[9]: https://khal.readthedocs.io/en/v0.9.2/index.html +[10]: mailto:some@email.adr +[11]: https://opensource.com/sites/default/files/uploads/productivity_6-3.png (editing in khard) +[12]: https://opensource.com/article/20/1/organize-email-notmuch +[13]: https://github.com/pazz/alot +[14]: mailto:kevin@sonney.com +[15]: mailto:+.+@sonney.com From 0a8d926d5cb7f63509a8cf3327f2c1d077db55df Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Jan 2020 00:58:23 +0800 Subject: [PATCH 387/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200116=20Automa?= =?UTF-8?q?ting=20Helm=20deployments=20with=20Bash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200116 Automating Helm deployments with Bash.md --- ...6 Automating Helm deployments with Bash.md | 385 ++++++++++++++++++ 1 file changed, 385 insertions(+) create mode 100644 sources/tech/20200116 Automating Helm deployments with Bash.md diff --git a/sources/tech/20200116 Automating Helm deployments with Bash.md b/sources/tech/20200116 Automating Helm deployments with Bash.md new file mode 100644 index 0000000000..a8e8567b0b --- /dev/null +++ b/sources/tech/20200116 Automating Helm deployments with Bash.md @@ -0,0 +1,385 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Automating Helm deployments with Bash) +[#]: via: (https://opensource.com/article/20/1/automating-helm-deployments-bash) +[#]: author: (Darin London https://opensource.com/users/dmlond) + +Automating Helm deployments with Bash +====== +This Bash script enables developers to focus on their code rather than +the deployment logic in each project. +![Person using a laptop][1] + +Some of our applications are hosted in a [Kubernetes][2] cluster, and we use GitLab Continuous Integration (CI) to automate deployments and Helm 2 to deploy our applications. Helm charts enable the storage of templates of Kubernetes object YAML files with variables that can be programmatically set from command-line arguments passed when the chart is used during deployments. This allows us to store critical secrets in GitLab-protected environment variables or in Hashicorp Vault and use them within the CI deployment job. + +Our deployment job uses a [Bash script to run the deployment process][3]. This Bash script presents a number of features that are valuable for use within a CI/CD environment: + + 1. It facilitates use outside of the CI/CD environment. GitLab CI and other CI systems store job steps as lines of executable shell code in a "script" section of a CI text file (.gitlab-ci.yml, for example). While this is useful to ensure basic executable steps can be stored without external dependencies, it prevents developers from using the same code in testing or manual deployment scenarios. In addition, many advanced features of the Bash system cannot be easily used in these script sections. + 2. It facilitates unit testing of important deployment processes. None of the CI systems provide a way of testing whether deployment logic performs as expected. Carefully constructed [Bash scripts can be unit tested with BATS][4]. + 3. It facilitates reuse of individual functions within the script. The last section uses a guard clause, **if [[ "${BASH_SOURCE[0]}" == "${0}" ]]**, which prevents the **run_main** function from being called when the script is not being executed. This allows the script to be sourced, which then allows users to make use of the many useful individual functions within it. This is crucial for proper BATS testing. + 4. It uses environment variables to protect sensitive information and make the script reusable across many projects and project application environments. GitLab CI makes many of these environment variables available when run by a GitLab CI runner. These must be manually set before using the script outside GitLab CI. + + + +The script performs all tasks required to deploy a Helm chart for an application to Kubernetes and waits for the deployment to be ready using kubectl and Helm. Helm runs with a local Tiller installation instead of running Tiller in the Kubernetes cluster. The Kubernetes **HELM_USER** and **HELM_PASSWORD** are used to log into the Kubernetes **CLUSTER_SERVER** and **PROJECT_NAMESPACE**. Tiller is started, Helm is initialized in client-only mode, and its repo is updated. The template is linted with Helm to ensure that syntax errors have not been accidentally committed. The template is then deployed in declarative mode, using **helm upgrade --install**. Helm waits for the deployment to be ready using the **\--wait flag**. + +The script ensures that certain template variables are set during the deployment and allows special project-specific variables to be specified in the GitLab CI **PROJECT_SPECIFIC_DEPLOY_ARGS** environment variable. All environment variables required in the deployment are checked early in the script execution, and the script exits with a non-zero exit status if any are missing. + +This script has been used in multiple GitLab CI-hosted projects. It has helped us focus on our code rather than the deployment logic in each project. + +### The script + + +``` +#!/bin/bash + +# MIT License +# +# Copyright (c) 2019 Darin London +# +# 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. + +log_level_for() +{ +  case "${1}" in +    "error") +      echo 1 +      ;; + +    "warn") +      echo 2 +      ;; + +    "debug") +      echo 3 +      ;; + +    "info") +      echo 4 +      ;; +    *) +      echo -1 +      ;; +  esac +} + +current_log_level() +{ +  log_level_for "${LOG_LEVEL}" +} + +error() +{ +  [ $(log_level_for "error") -le $(current_log_level) ] &&  echo "${1}" >&2 +} + +warn() +{ +  [ $(log_level_for "warn") -le $(current_log_level) ] &&  echo "${1}" >&2 +} + +debug() +{ +  [ $(log_level_for "debug") -le $(current_log_level) ] &&  echo "${1}" >&2 +} + +info() +{ +  [ $(log_level_for "info") -le $(current_log_level) ] &&  echo "${1}" >&2 +} + +check_required_environment() { +  local required_env="${1}" + +  for reqvar in $required_env +  do +    if [ -z "${!reqvar}" ] +    then +      error "missing ENVIRONMENT ${reqvar}!" +      return 1 +    fi +  done +} + +check_default_environment() { +  local required_env="${1}" + +  for varpair in $required_env +  do +    local manual_environment=$(echo "${varpair}" | cut -d':' -f1) +    local default_if_not_set=$(echo "${varpair}" | cut -d':' -f2) +    if [ -z "${!manual_environment}" ] && [ -z "${!default_if_not_set}" ] +    then +      error "missing default ENVIRONMENT, set ${manual_environment} or ${default_if_not_set}!" +      return 1 +    fi +  done +} + +dry_run() { +  [ ${DRY_RUN} ] && info "skipping for dry run" && return +  return 1 +} + +init_tiller() { +  info "initializing local tiller" +  dry_run && return + +  export TILLER_NAMESPACE=$PROJECT_NAMESPACE +  export HELM_HOST=localhost:44134 +  # +  # run tiller locally instead of in the cluster +  tiller --storage=secret & +  export TILLER_PID=$! +  sleep 1 +  kill -0 ${TILLER_PID} +  if [ $? -gt 0 ] +  then +    error "tiller not running!" +    return 1 +  fi +} + +init_helm() { +  info "initializing helm" +  dry_run && return + +  helm init --client-only +  if [ $? -gt 0 ] +  then +    error "could not initialize helm" +    return 1 +  fi +} + +init_helm_with_tiller() { +  init_tiller || return 1 +  init_helm || return 1 +  info "updating helm client repository information" +  dry_run && return +  helm repo update +  if [ $? -gt 0 ] +  then +    error "could not update helm repository information" +    return 1 +  fi +} + +decommission_tiller() { +  if [ -n "${TILLER_PID}" ] +  then +    kill ${TILLER_PID} +    if [ $? -gt 0 ] +    then +     return +    fi +  fi +} + +check_required_deploy_arg_environment() { +  [ -z "${PROJECT_SPECIFIC_DEPLOY_ARGS}" ] && return +  for reqvar in ${PROJECT_SPECIFIC_DEPLOY_ARGS} +  do +    if [ -z ${!reqvar} ] +    then +      error "missing Deployment ENVIRONMENT ${reqvar} required!" +      return 1 +    fi +  done +} + +project_specific_deploy_args() { +  [ -z "${PROJECT_SPECIFIC_DEPLOY_ARGS}" ] && echo "" && return + +  extraArgs='' +  for deploy_arg_key in ${PROJECT_SPECIFIC_DEPLOY_ARGS} +  do +    extraArgs="${extraArgs} --set $(echo "${deploy_arg_key}" | sed 's/__/\\./g' | tr '[:upper:]' '[:lower:]')=${!deploy_arg_key}" +  done + +  echo "${extraArgs}" +} + +check_required_cluster_login_environment() { +  check_required_environment "HELM_TOKEN HELM_USER PROJECT_NAMESPACE CLUSTER_SERVER" || return 1 +} + +cluster_login() { +  info "authenticating ${HELM_USER} in ${PROJECT_NAMESPACE}" +  dry_run && return + +  kubectl config set-cluster ci_kube --server="${CLUSTER_SERVER}" || return 1 +  kubectl config set-credentials "${HELM_USER}" --token="${HELM_TOKEN}" || return 1 +  kubectl config set-context ${PROJECT_NAMESPACE}-deploy  --cluster=ci_kube --namespace=${PROJECT_NAMESPACE} --user=${HELM_USER} || return 1 +  kubectl config use-context ${PROJECT_NAMESPACE}-deploy || return 1 +} + +lint_template() { +  info "linting template" +  dry_run && return + +  helm lint ${CI_PROJECT_DIR}/helm-chart/${CI_PROJECT_NAME} +} + +check_required_image_pull_environment() { +  if [ "${CI_PROJECT_VISIBILITY}" == "public" ] +  then +    check_required_environment "CI_REGISTRY CI_DEPLOY_USER CI_DEPLOY_PASSWORD" || return 1 +  fi +} + +image_pull_settings() { +  if [ "${CI_PROJECT_VISIBILITY}" == "public" ] +  then +    echo "" +  else +    echo "--set registry.root=${CI_REGISTRY} --set registry.secret.username=${CI_DEPLOY_USER} --set registry.secret.password=${CI_DEPLOY_PASSWORD}" +  fi +} + +deployment_name() { +  if [ -n "${DEPLOYMENT_NAME}" ] +  then +    echo "${DEPLOYMENT_NAME}" +  else +    echo "${CI_ENVIRONMENT_SLUG}-${CI_PROJECT_NAME}" +  fi +} + +deploy_template() { +  info "deploying $(deployment_name) from template" +  if dry_run +  then +    info "helm upgrade --force --recreate-pods --debug --set image.repository=${CI_REGISTRY_IMAGE}/${CI_PROJECT_NAME} --set image.tag=${CI_COMMIT_SHORT_SHA} --set environment=${CI_ENVIRONMENT_NAME} --set-string git_commit=${CI_COMMIT_SHORT_SHA} --set git_ref=${CI_COMMIT_REF_SLUG} --set ci_job_id=${CI_JOB_ID} $(environment_url_settings) $(image_pull_settings) $(project_specific_deploy_args) --wait --install $(deployment_name) ${CI_PROJECT_DIR}/helm-chart/${CI_PROJECT_NAME}" +  else +    helm upgrade --force --recreate-pods --debug \ +    --set image.repository="${CI_REGISTRY_IMAGE}/${CI_PROJECT_NAME}" \ +    --set image.tag="${CI_COMMIT_SHORT_SHA}" \ +    --set environment="${CI_ENVIRONMENT_NAME}" \ +    --set-string git_commit="${CI_COMMIT_SHORT_SHA}" \ +    --set git_ref="${CI_COMMIT_REF_SLUG}" \ +    --set ci_job_id="${CI_JOB_ID}" \ +    $(image_pull_settings) \ +    $(project_specific_deploy_args) \ +    --wait \ +    --install $(deployment_name) ${CI_PROJECT_DIR}/helm-chart/${CI_PROJECT_NAME} +  fi +} + +get_pods() { +  kubectl get pods -l ci_job_id="${CI_JOB_ID}" +} + +watch_deployment() { +  local watch_deployment=$(deployment_name) +  if [ -n "${WATCH_DEPLOYMENT}" ] +  then +    watch_deployment="${WATCH_DEPLOYMENT}" +  fi +  info "waiting until deployment ${watch_deployment} is ready" +  dry_run && return + +  kubectl rollout status deployment/${watch_deployment} -w || return 1 +  sleep 5 +  get_pods || return 1 +  # see what has been deployed +  kubectl describe deployment -l app=${CI_PROJECT_NAME},environment=${CI_ENVIRONMENT_NAME},git_commit=${CI_COMMIT_SHORT_SHA} || return 1 +  if [ -n "${CI_ENVIRONMENT_URL}" ] +  then +    kubectl describe service -l app=${CI_PROJECT_NAME},environment=${CI_ENVIRONMENT_NAME} || return 1 +    kubectl describe route -l app=${CI_PROJECT_NAME},environment=${CI_ENVIRONMENT_NAME} || return 1 +  fi +} + +run_main() { +  check_required_environment "CI_PROJECT_NAME CI_PROJECT_DIR CI_COMMIT_REF_SLUG CI_REGISTRY_IMAGE CI_ENVIRONMENT_NAME CI_JOB_ID CI_COMMIT_SHORT_SHA" || return 1 +  check_default_environment "WATCH_DEPLOYMENT:CI_ENVIRONMENT_SLUG" || return 1 +  check_required_deploy_arg_environment || return 1 +  check_required_cluster_login_environment || return 1 +  check_required_image_pull_environment || return 1 +  cluster_login +  if [ $? -gt 0 ] +  then +    error "could not login kubectl" +    return 1 +  fi + +  init_helm_with_tiller +  if [ $? -gt 0 ] +  then +    error "could not initialize helm" +    return 1 +  fi + +  lint_template +  if [ $? -gt 0 ] +  then +    error "linting failed" +    return 1 +  fi + +  deploy_template +  if [ $? -gt 0 ] +  then +    error "could not deploy template" +    return 1 +  fi + +  watch_deployment +  if [ $? -gt 0 ] +  then +    error "could not watch deployment" +    return 1 +  fi + +  decommission_tiller +  info "ALL Complete!" +  return +} + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]] +then +  run_main +  if [ $? -gt 0 ] +  then +    exit 1 +  fi +fi +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/automating-helm-deployments-bash + +作者:[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://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/resources/what-is-kubernetes +[3]: https://gist.github.com/dmlond/016ff7c3757fee00f9d02e36e6c0c298 +[4]: https://opensource.com/article/19/2/testing-bash-bats From 733c67ae8eec11897755fc93fd841b1a60f2f816 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Jan 2020 00:59:01 +0800 Subject: [PATCH 388/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200116=204=20co?= =?UTF-8?q?re=20skills=20to=20level-up=20your=20tech=20career=20in=202020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200116 4 core skills to level-up your tech career in 2020.md --- ...ls to level-up your tech career in 2020.md | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 sources/tech/20200116 4 core skills to level-up your tech career in 2020.md diff --git a/sources/tech/20200116 4 core skills to level-up your tech career in 2020.md b/sources/tech/20200116 4 core skills to level-up your tech career in 2020.md new file mode 100644 index 0000000000..e8385910d4 --- /dev/null +++ b/sources/tech/20200116 4 core skills to level-up your tech career in 2020.md @@ -0,0 +1,160 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 core skills to level-up your tech career in 2020) +[#]: via: (https://opensource.com/article/20/1/core-skills-tech-career) +[#]: author: (Dawn Parzych https://opensource.com/users/dawnparzych) + +4 core skills to level-up your tech career in 2020 +====== +There is one category of skill you should focus on to advance your +career this year. Here's how. +![Two hands holding a resume with computer, clock, and desk chair ][1] + +We do a lot to level-up our careers. We learn new programming languages; we take on new projects at work; we work on side projects on the weekend; we contribute to open source communities. What if I were to tell you that, while these activities are helpful, there is one set of skills you should focus on if you truly want to advance your career. + +These skills go by many names, such as soft skills, non-technical skills, leadership skills, and people skills. Calling them soft or non-technical skills leads to the mistaken idea that they are easy. For some, these skills are incredibly difficult. Calling them leadership skills makes people think they don't need to put effort into developing them if they don't want to be a leader. + +I prefer to call them core or functional skills. These skills are part of the core of what makes us human, and it is hard to function without them. + +When we have these skills, we can: + + * Communicate with others + * Collaborate and work with others + * Solve problems + * Understand and share the feelings of others + * Use time effectively or productively + + + +These skills are part of what makes us human, and everything in software is about humans. Humans are reviewing your code. Humans are installing or using the application you are writing. + +If these skills are so essential, why do we often dismiss them in favor of more "technical" skills and give them a bad rap? This isn't about focusing on one versus the other. Both are important and relevant. + +### Mindset and biases + +Our biases and mindset contribute to the importance we place on functional skills. Bias isn't a bad thing. There are [175 biases][2] that exist to help our brains combat four problems: + + * We have too much information to process. + * There's not enough meaning in the information we receive. + * There's not enough time to process information. + * We can't remember everything. Our memory is finite. + + + +One bias that sneaks in when it comes to assessing our skills is the Dunning-Kruger effect. We mistakenly assess our abilities as more exceptional than they are, which comes from an inability to recognize our own faults. You may think you know what you are doing when you don't because of the Dunning-Kruger effect. You think you are managing your time effectively, but in reality, you are working nights and weekends to get caught up. Yes, the work is getting completed, but at what cost? Working non-stop can lead to burnout or a decline in health. + +Another factor is your [mindset][3]. Do you have a growth mindset or a fixed mindset when it comes to learning a new skill? People with a fixed mindset believe that abilities are innate and can't be improved. Those with a growth mindset believe there is room for improvement, and you can improve any skill with practice. + +These statements reflect a fixed mindset: + + * "I'm just not a people person." + * "They're a natural-born leader." + + + +You're not born with the ability to speak or write. You learn these skills over time. The same goes for the core and functional skills important for developers. + +### Communication + +> "Over time I've learned the biggest source of failure is often due to people and teams. A lack of communication and coordination can cause serious problems." +> — Laurie Barth, [_How architecture improved my coding skills_][4] + +Communication includes verbal, non-verbal, and written communication. Failures along any of these can cause serious problems. Communication failures in tech look like: + + * Delays in resolving incidents + * Redesigning a feature + * Scope creep + * Lack of meaningful comments on pull requests (PRs)—these can be especially impactful to junior engineers + * Unnecessary conflicts and lack of alignment + * Delivering above or below expectations + + + +Cultural norms and personal preferences impact communication. Everybody has a preferred method of communicating, whether that is via email, face-to-face, Slack messages, phone, text, etc. Think about the cultural norms regarding communication in your workplace. Do they match your preferred method of communicating? If there is a mismatch, problems may arise. + +If you're a manager, do you know your direct reports' preferred communication style, or do you just utilize your preferred method? If a direct report prefers email so they can have some time to think before responding and you prefer face-to-face communication, a quick Slack message asking them to come to your office can cause unnecessary anxiety. + +### Empathy + +> "Empathy is much harder than we think… But to build empathy we need to slow down." +> —Andrew Tenzer and Ian Murray, [_The empathy delusion_][5] + +Empathy is one of the most important skills you can learn. Empathy is our ability to understand and share the feelings of others. We feel more connected to one another because of empathy. + +There are four attributes of empathy: + + * Seeing another person's perspective + * Being non-judgmental + * Recognizing emotions in other people + * Communicating your understanding of another person's feelings + + + +Communication and empathy are closely tied. To communicate effectively, you need to listen. To listen effectively, you need empathy. Instead of listening to what a colleague is saying, we usually think about how to best respond. As the adage goes, you have two ears and one mouth for a reason; you should be listening twice as often as you speak. + +When you show empathy towards another person, you are not minimizing their thoughts, feelings, or experiences. Instead of using comments like "it could be worse" or "at least…" use phrases like "that sounds horrible," "I can't imagine how you must feel," or "I'm here for you, how can I help?" + +### Get ready to level-up + +Improving on a skill takes time, but we often give up while we are learning once [impostor syndrome][6] kicks in. It takes years of practice to perfect something, and even with years of practice, you won't be perfect. You will make mistakes. When learning a new skill or improving on an existing skill, mastery—not perfection—should be the goal. Perfection implies there is no room for improvement; mastery indicates learning a skill is an ongoing journey, and there is room to improve. + +You don't want to be a perfect communicator. You want to be a master communicator. Even the most experienced public speakers make mistakes. If you aim for perfection, you will be disappointed. + +To improve a skill, you need to schedule time to practice. But not just any type of practice; to master a skill, use deliberate practice. Deliberate practice has five main components: + + 1. Create a specific goal. + 2. Break the goal down into small steps. + 3. Get feedback from a master. + 4. Step out of your comfort zone. + 5. Stay motivated. + + + +To illustrate this process, say you have a goal of presenting at a conference, but you aren't a confident public speaker. What are some small steps you can take to practice? + + * Identify and reduce the use of filler words like "um," "ah," or "you know." + * Make eye contact when speaking with others or let people know why you don't. + * Control mannerisms like fidgeting with your hands or nodding your head while talking. + * Incorporate appropriate pauses. + + + +Feedback is a necessary part of practicing. Seek out others to provide you with feedback. A great way to step out of your comfort zone and get feedback from master public speakers is to sign up for Toastmasters. This can also help you stay motivated as you work through the speeches towards becoming a Distinguished Toastmaster. + +You can apply this same process to any skill you are looking to master. + +### Where to learn more + +If you want to learn more about empathy and communication so you can level up your career, check out these resources: + + * [Communicating with empathy][7] course by Sharon Steed + * [_Deliberate practice: Your pathway to growth and mastery_][8] by Habits at Work + * [_Want to be more empathetic? Avoid these 7 responses_][9] by Laura Click + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/core-skills-tech-career + +作者:[Dawn Parzych][a] +选题:[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/dawnparzych +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) +[2]: https://medium.com/better-humans/cognitive-bias-cheat-sheet-55a472476b18 +[3]: https://www.penguinrandomhouse.com/books/44330/mindset-by-carol-s-dweck-phd/ +[4]: https://dev.to/laurieontech/how-architecture-improved-my-coding-skills-21e +[5]: https://www.reachsolutions.co.uk/sites/default/files/2019-07/Reach%20Solutions%20The%20Empathy%20Delusion%20V2.pdf +[6]: https://en.wikipedia.org/wiki/Impostor_syndrome +[7]: https://www.lynda.com/Business-Skills-tutorials/Communicating-Empathy/534584-2.html +[8]: https://habitsatwork.com/blog/deliberate-practice +[9]: https://medium.com/@lauraclick/want-to-be-more-empathetic-avoid-these-7-responses-21bb52d5d2ad From 2b4527bfead026ac27f2deb235ba9ad3a3fd5505 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Jan 2020 01:00:03 +0800 Subject: [PATCH 389/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200116=20It?= =?UTF-8?q?=E2=80=99s=20the=20end=20for=20Windows=20Server=202008=20suppor?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20200116 It-s the end for Windows Server 2008 support.md --- ...the end for Windows Server 2008 support.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/talk/20200116 It-s the end for Windows Server 2008 support.md diff --git a/sources/talk/20200116 It-s the end for Windows Server 2008 support.md b/sources/talk/20200116 It-s the end for Windows Server 2008 support.md new file mode 100644 index 0000000000..35e25fc844 --- /dev/null +++ b/sources/talk/20200116 It-s the end for Windows Server 2008 support.md @@ -0,0 +1,71 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (It’s the end for Windows Server 2008 support) +[#]: via: (https://www.networkworld.com/article/3513980/it-s-the-end-for-windows-server-2008-support.html) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +It’s the end for Windows Server 2008 support +====== +Microsoft recommends migrating Server 2008 workloads to Azure cloud services while enterprises modernize their apps for Windows Server 2016 or 2019 deployments. +PaulFleet / Getty Images / Microsoft + +This week's Patch Tuesday marked the end of the line for both Windows 7 and Windows Server 2008 (and 2008 R2). No more fixes will be issued for the two aged operating systems, unless you purchase a pricey extended service license. + +On the Windows 7 front, Microsoft has done a good job getting Windows 10 deployed through its aggressive (perhaps too aggressive) upgrade program. According to StatCounter, Windows 10 now accounts for 65% of the [worldwide desktop Windows market share][1], and Windows 7 is down to 27%. + +**RELATED:** [What to know before upgrading to Windows Server 2019][2] + +But while Windows 7 has gotten all the attention, Server 2008 actually has a larger share of holdouts, and in some ways, its end-of-life milestone is more significant. At last July’s Inspire show, a Microsoft executive said in an interview with cloud storage provider and Microsoft partner Carbonite that [60% of its current Windows Server][3] installed base was running Server 2008, accounting for 24 million instances.  + +[][4] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][4] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +“There are a lot [of customers sticking with Server 2008],” says analyst Tim Crawford of research and advisory firm [AVOA][5]. “You could categorize them into those that either a) use functions specific to WS2008, and b) those that use a version of an application that is only compatible with WS2008. Upgrading is often easier said than done. Especially if the application is a custom app with lots of tentacles.” + +Server 2008 is based on the Windows Vista codebase, which should be reason alone to jettison it. But Windows Server 2016 and Windows Server 2019 are built on Windows 10, which means apps heavily dependent on the OS ecosystem might be hard to move since the internals are so different. + +“I do work with folks that are still running Windows Server 2008. They understand the ramifications of EOL for support. But most are in a predicament where they aren’t able to move the applications for a number of reasons, including application compatibility, location, etc.," Crawford says. + +For those apps that are challenging to move, he recommends isolating the system as much as possible to protect it, and putting in a plan to do what is needed to the applications to prepare them for movement as quickly as possible. + +Microsoft offers and recommends [Azure migration][6], so Server 2008 apps can [run in an Azure instance][7] while they are modernized for Server 2019 and then deployed on premises. + +Migration should be the paramount effort, because if you are running Server 2008 then you're using hardware that's at least eight years old and potentially 12 years old. That’s ancient in technology terms, and if nothing else, the hardware is going to fail. + +One of the headaches for admins is you cannot migrate Server 2008 directly to 2016 or 2019. You have to upgrade to Server 2012 as an intermediate step. So you are better off biting the bullet and migrating the apps to 2019 rather than spending time on two OS migrations. + +Microsoft has provided [resources][8] for Server 2008 users, including a migration guide and help moving to Azure. + +Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3513980/it-s-the-end-for-windows-server-2008-support.html + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://gs.statcounter.com/os-version-market-share/windows/desktop/worldwide#monthly-201807-201908 +[2]: https://www.networkworld.com/article/3512020/what-to-know-before-upgrading-from-windows-server-2016-to-server-2019.html +[3]: https://www.carbonite.com/blog/article/2019/07/schuster-azure-migration-and-office-365-top-partner-opportunities +[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[5]: https://avoa.com/ +[6]: https://cloudblogs.microsoft.com/windowsserver/2019/12/17/protect-workloads-still-running-on-windows-server-2008-and-2008-r2/ +[7]: https://www.networkworld.com/article/3300165/microsoft-lures-win-server-2008-users-toward-azure.html +[8]: https://www.microsoft.com/en-us/cloud-platform/windows-server-2008 +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From b35d90fb14062f4e2edd1e14f7bdd701e57ca236 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 17 Jan 2020 08:46:04 +0800 Subject: [PATCH 390/430] translated --- ...eep your email in sync with OfflineIMAP.md | 79 ------------------- ...eep your email in sync with OfflineIMAP.md | 77 ++++++++++++++++++ 2 files changed, 77 insertions(+), 79 deletions(-) delete mode 100644 sources/tech/20200113 Keep your email in sync with OfflineIMAP.md create mode 100644 translated/tech/20200113 Keep your email in sync with OfflineIMAP.md diff --git a/sources/tech/20200113 Keep your email in sync with OfflineIMAP.md b/sources/tech/20200113 Keep your email in sync with OfflineIMAP.md deleted file mode 100644 index e4e1f1ba94..0000000000 --- a/sources/tech/20200113 Keep your email in sync with OfflineIMAP.md +++ /dev/null @@ -1,79 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Keep your email in sync with OfflineIMAP) -[#]: via: (https://opensource.com/article/20/1/sync-email-offlineimap) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Keep your email in sync with OfflineIMAP -====== -Mirroring your email to a local folder is the first step in taming your -message pileup. Learn how in the third article in our series on 20 ways -to be more productive with open source in 2020. -![email or newsletters via inbox and browser][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Sync your email locally with OfflineIMAP - -I have a love/hate relationship with email. I love the way it allows me to communicate with people all over the world. But, like many of you, I get a lot of mail, much of it from lists as well as spammers, advertisers, and the like. And it builds up. - -![The OfflineIMAP "blinkenlights" UI][2] - -Almost all the tools I've tried (outside of the big mail providers) that work really well with large amounts of mail have one thing in common: they all rely on a local copy of your mail stored in [Maildir][3] format. And the most useful tool for that is [OfflineIMAP][4]. OfflineIMAP is a Python script that mirrors IMAP mailboxes to a local Maildir folder tree. I use it to create a local copy of my mail and keep it in sync. Most Linux distributions include it, and it is available via Python's pip package manager. - -The sample minimal configuration file is a good template to start with; begin by copying it to **~/.offlineimaprc**. Mine looks something like this: - - -``` -[general] -accounts = LocalSync -ui=Quiet -autorefresh=30 - -[Account LocalSync] -localrepository = LocalMail -remoterepository = MirrorIMAP - -[Repository MirrorIMAP] -type = IMAP -remotehost = my.mail.server -remoteuser = myusername -remotepass = mypassword -auth_mechanisms = LOGIN -createfolder = true -ssl = yes -sslcacertfile = OS-DEFAULT - -[Repository LocalMail] -type = Maildir -localfolders = ~/Maildir -sep = . -createfolder = true -``` - -What my configuration does is define two repositories: the remote IMAP server and the local Maildir folder. There is also the **Account** that tells OfflineIMAP what to sync when it runs. You can define multiple accounts linked to different repositories. This allows you to copy from one IMAP server to another as a backup, in addition to making a copy locally. - -The first run of OfflineIMAP will take a while if you have a lot of mail. But once it is done, future runs take a _lot_ less time. You can also run OfflineIMAP as a cron job (my preference) or as a daemon constantly syncing between repositories. The documentation covers all of this, as well as advanced configuration options for things like Gmail. - -Now that my mail is copied locally, there is a whole range of tools I can work with to speed up searching, filing, and managing mail. And I'll talk about that tomorrow. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/sync-email-offlineimap - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser) -[2]: https://opensource.com/sites/default/files/uploads/productivity_3-1.png (The OfflineIMAP "blinkenlights" UI) -[3]: https://en.wikipedia.org/wiki/Maildir -[4]: http://www.offlineimap.org/ diff --git a/translated/tech/20200113 Keep your email in sync with OfflineIMAP.md b/translated/tech/20200113 Keep your email in sync with OfflineIMAP.md new file mode 100644 index 0000000000..c5b20565ad --- /dev/null +++ b/translated/tech/20200113 Keep your email in sync with OfflineIMAP.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Keep your email in sync with OfflineIMAP) +[#]: via: (https://opensource.com/article/20/1/sync-email-offlineimap) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用 OfflineIMAP 同步邮件 +====== +将邮件镜像保存到本地是整理消息的第一步。在我们的 20 个使用开源提升生产力的系列的第三篇文章中了解该如何做。 +![email or newsletters via inbox and browser][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 使用 OfflineIMAP 在本地同步你的邮件 + +我与邮件之间存在爱恨交织的关系。我喜欢它让我与世界各地的人交流的方式。但是,像你们中的许多人一样,我收到过很多邮件,许多是来自列表中的人,但也有很多垃圾邮件、广告等。这些积累了很多。 + +![The OfflineIMAP "blinkenlights" UI][2] + +我尝试过的大多数工具(除了大型提供商外)都可以很好地处理大量邮件,它们都有一个共同点:它们都依赖于以 [Maildir][3] 格式存储的本地邮件副本。这其中最有用的是 [OfflineIMAP][4]。OfflineIMAP 是将 IMAP 邮箱镜像到本地 Maildir 文件夹树的 Python 脚本。我用它来创建邮件的本地副本并使其保持同步。大多数 Linux 发行版都包含它,并且可以通过 Python 的 pip 包管理器获得。 + +示例的最小配置文件是一个很好的模板。首先将其复制到 **~/.offlineimaprc**。我的看起来像这样: + + +``` +[general] +accounts = LocalSync +ui=Quiet +autorefresh=30 + +[Account LocalSync] +localrepository = LocalMail +remoterepository = MirrorIMAP + +[Repository MirrorIMAP] +type = IMAP +remotehost = my.mail.server +remoteuser = myusername +remotepass = mypassword +auth_mechanisms = LOGIN +createfolder = true +ssl = yes +sslcacertfile = OS-DEFAULT + +[Repository LocalMail] +type = Maildir +localfolders = ~/Maildir +sep = . +createfolder = true +``` + +我的配置要做的是定义两个仓库:远程 IMAP 服务器和本地 Maildir 文件夹。还有一个**帐户**,告诉 OfflineIMAP 运行时要同步什么。你可以定义链接到不同仓库的多个帐户。除了本地复制外,这还允许你从一台 IMAP 服务器复制到另一台作为备份。 + +如果你有很多邮件,那么首次运行 OfflineIMAP 将花费一些时间。但是完成后,下次会花_少得多_的时间。你也可以将 CoffeeIMAP 作为 cron 任务(我的偏好)或作为守护程序在仓库之间不断进行同步。文档涵盖了所有这些内容以及 Gmail 等高级配置选项。 + +现在,我的邮件已在本地复制,并有多种工具用来加快搜索、归档和管理邮件的速度。我明天再说。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/sync-email-offlineimap + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser) +[2]: https://opensource.com/sites/default/files/uploads/productivity_3-1.png (The OfflineIMAP "blinkenlights" UI) +[3]: https://en.wikipedia.org/wiki/Maildir +[4]: http://www.offlineimap.org/ From 9dfc0a080c560f1cd4bbf5d2173c69d6c356f8f8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 17 Jan 2020 09:28:45 +0800 Subject: [PATCH 391/430] translating --- ... Organize and sync your calendar with khal and vdirsyncer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md b/sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md index b78ad493af..effad6fb4e 100644 --- a/sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md +++ b/sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f04ac3c25fd61823705aac4b076cd41ee56527a7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 17 Jan 2020 10:45:51 +0800 Subject: [PATCH 392/430] Rename sources/tech/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md to sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md --- ... into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md (100%) diff --git a/sources/tech/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md b/sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md similarity index 100% rename from sources/tech/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md rename to sources/talk/20200117 Insights into Why Hyperbola GNU-Linux is Turning into Hyperbola BSD.md From c13b2636adb22867839ef49e7608fac6516f1915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 17 Jan 2020 21:24:37 +0800 Subject: [PATCH 393/430] Translated --- ...5 How to Add Border Around Text in GIMP.md | 139 ------------------ ...5 How to Add Border Around Text in GIMP.md | 139 ++++++++++++++++++ 2 files changed, 139 insertions(+), 139 deletions(-) delete mode 100644 sources/tech/20191215 How to Add Border Around Text in GIMP.md create mode 100644 translated/tech/20191215 How to Add Border Around Text in GIMP.md diff --git a/sources/tech/20191215 How to Add Border Around Text in GIMP.md b/sources/tech/20191215 How to Add Border Around Text in GIMP.md deleted file mode 100644 index 0b2e3858f2..0000000000 --- a/sources/tech/20191215 How to Add Border Around Text in GIMP.md +++ /dev/null @@ -1,139 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (robsean) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Add Border Around Text in GIMP) -[#]: via: (https://itsfoss.com/gimp-text-outline/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Add Border Around Text in GIMP -====== - -This simple tutorial explains the steps to outline text in [GIMP][1]. The text outline helps you highlight text against background of other color. - -![Outlined Text created in GIMP][2] - -Let’s see how can you add a border around your text. - -### Adding text outline in GIMP - -The entire procedure can be described in these easy steps: - - * Create your text and copy its outlined path - * Add a new transparent layer and add the outlined path to this layer - * Change the size of the outline, add a different color to it - - - -That’s all. Don’t worry, I am going to show each steps in detail with proper screenshots. By following this tutorial, you should be able to add outline to text even if you never used GIMP before. - -Just make sure that you have [GIMP installed on Linux][3] or whatever operating system you are using. - -This tutorial has been performed with GIMP 2.10 version. - -#### Step 1: Create your primary text and copy its outline - -Open GIMP and create a new file by going to the top menu->File->New. You can also use Ctrl+N keyboard shortcut. - -![Create New File][4] - -You can select the size of your canvas here. You may also choose if you want white background or a transparent background. It is under the Advanced Options->Color profile. - -I have chosen the default white background. It can be changed later. - -Now select the Text tool from the toolbox in the left sidebar. - -![Adding text in GIMP][5] - -Write the text you want. You can change the font, size and alignment of the text as per your choice. I have kept the default left alignment of the text for this article. - -I have deliberately chose a light color for the text so that it is difficult to read. I’ll add a darker outline to this light text in this tutorial. - -![Text added in GIMP][6] - -When you are done writing your text, right click the text box and select **Path from Text**. - -![Right click on the text box and select ‘Path from Text’][7] - -#### Step 2: Add a transparent layer with the text outline - -Now, go to the top menu, go to Layer and add a new layer. - -![Use Shift+Ctrl+N to add a new layer][8] - -Make sure to add the new layer as transparent. You can give it a suitable name like ‘outline for text’. Click OK to add this transparent layer. - -![Add a transparent layer][9] - -Go to the menu again and this time go to **Select** and click **From path**. You’ll see that your text has been highlighted. - -![Go to Select and choose From Path][10] - -Basically, you just created a transparent layer that has the same text (but transparent) as your original text. What you need to do now is to increase the size of the text on this layer. - -#### Step 3: Adding the text outline by increasing its size and changing its color - -To do that, go to Select in menu once again and this time choose Grow. This will allow you to grow the size of the text on the transparent layer. - -![Grow the selection on the additional layer][11] - -Grow it by 5 or 10 pixel or whatever you prefer. - -![Grow it by 5 or 10 pixel][12] - -What you need to do now is to fill this enlarged selection with a choice of your color. Since my original text is of light color, I am going to use back color for the outline here. - -**Select your main image layer** if it’s not already selected. The layers are visible at the right sidebar. Then go to the toolbox and select the bucket fill tool. Select the desired color you want for the outline. - -Now use the tool to fill black color to your selection. Mind that you fill the outer outline of the text, not the text itself. - -![Fill the outline of the text with a different color][13] - -You are pretty much done here. Use Ctrl+Shift+A to de-select your current selection. - -![Outline added to the text][14] - -So now you have successfully added outline to your text in GIMP. It is on white background and if you want a transparent background, just delete the background layer from the layer menu in the right sidebar. - -![Remove the white background layer if you want a transparent background][15] - -If you are happy with the result, save the file as PNG file (to keep transparent background) or whichever file format you prefer. - -**Did you make it work?** - -That’s it. That’s all you need to do to add a text outline in GIMP. - -I hope you find this GIMP tutorial helpful. You may want to check out another [simple tutorial about adding a watermark in GIMP][16]. - -If you have questions or suggestions, please feel free to leave a comment below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/gimp-text-outline/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://www.gimp.org/ -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/outlined_text_GIMP.png?ssl=1 -[3]: https://itsfoss.com/gimp-2-10-release/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/create_outline_text_gimp_1.jpeg?ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_2.jpg?ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp-3.jpg?ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_4.jpg?ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_5.jpg?ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_6.jpg?ssl=1 -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_7.jpg?ssl=1 -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_8.jpg?ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_9.jpg?ssl=1 -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_10.jpg?ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_11.jpg?ssl=1 -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_12.jpg?ssl=1 -[16]: https://itsfoss.com/add-watermark-gimp-linux/ diff --git a/translated/tech/20191215 How to Add Border Around Text in GIMP.md b/translated/tech/20191215 How to Add Border Around Text in GIMP.md new file mode 100644 index 0000000000..651a53fffb --- /dev/null +++ b/translated/tech/20191215 How to Add Border Around Text in GIMP.md @@ -0,0 +1,139 @@ +[#]: collector: (lujun9972) +[#]: translator: (robsean) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add Border Around Text in GIMP) +[#]: via: (https://itsfoss.com/gimp-text-outline/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +在 GIMP 中如何在文本周围添加边框 +====== + +这个简单的教程阐明了在 [GIMP][1] 中显示文本的轮廓的步骤。文本轮廓帮助你在其它颜色下高亮显示文本。 + +![Outlined Text created in GIMP][2] + +让我们看看如何在你的文本周围添加一个边框。 + +### 在 GIMP 中添加文本轮廓 + +整个过程可以用这些简单的步骤描述: + + * 创建文本,并复制它的轮廓路径 + * 添加一层新的透明层,并添加轮廓路径到透明层中 + * 更改轮廓的大小,给它添加一种不同的颜色 + + + +这就是全部的东西。不用担心,我将使用适当地截图详细的展示每个步骤。按照这个教程,你应该能够为文本添加轮廓,即使你在此之前从未使用过 GIMP 。 + +仅需要确保你已经 [在 Linux 上安装 GIMP][3] 或者你正在使用的任何操作。 + +这篇教程在 GIMP 2.10 版本下演示。 + +#### 步骤 1: 创建你的主要文本,并复制它的轮廓 + +打开 GIMP ,并通过转到 菜单 -> 文件 -> 新建 来创建一个新的文件。你应该可以使用 Ctrl+N 键盘快捷键。 + +![Create New File][4] + +你可以在这里选择画布的大小。你也可以选择要白色背景或一种透明背景。它在 高级选项 -> 颜色 配置文件下。 + +我选择默认的白色背景。它在以后能够更改。 + +现在从左边栏的工具箱中选择文本工具。 + +![Adding text in GIMP][5] + +写你想的文本。你可以根据你的选择以更改文本的字体,大小和对齐方式。我保持这篇文章的文本的默认左对齐。 + +我故意为文本选择一种浅色,以便难于阅读。在这篇教程中我将添加一个深色轮廓到这个浅色的文本。 + +![Text added in GIMP][6] + +当你写完文本后,右键文本框并选择 **文本的路径** 。 + +![Right click on the text box and select ‘Path from Text’][7] + +#### 步骤 2: 添加一个带有文本轮廓的透明层 + +现在,转到顶部菜单,转到 层 ,并添加一个新层。 + +![Use Shift+Ctrl+N to add a new layer][8] + +确保添加新层为透明的。你可以给它一个合适的名称,像 ‘文本大纲’。单击确定来添加这个透明层。 + +![Add a transparent layer][9] + +再次转到菜单,这次转到 **选择** ,并单击 **来自路径** 。你将看到你的文本应该被高亮显示。 + +![Go to Select and choose From Path][10] + +总的来说,你只创建一个透明层,它有像你的原文一样相同的文本(但是透明)。现在你需要做的是在这个层上增加文本的大小。 + +#### 步骤· 3: 通过增加它的大小和更改它的颜色来添加文本轮廓 + +为此,再次在菜单中转到 选择 ,这次选择 增加。这将允许增大透明层上的文本的大小。 + +![Grow the selection on the additional layer][11] + +以 5 或 10 像素增加,或者你喜欢的任意像素。 + +![Grow it by 5 or 10 pixel][12] + +你选择需要做是使用一种你选择的颜色来填充这个扩大的选择区。因为我的原文是浅色,在这里我将为轮廓使用背景色。 + +如果尚未选择的话,先 **选择你的主图像层** 。这些层在右侧栏中可视。然后转到工具箱并选择油漆桶工具。为你的轮廓选择想要的颜色。 + +选择使用该工具来填充黑色到你的选择区。记住。你填充文本外部的轮廓,而不是文本本身。 + +![Fill the outline of the text with a different color][13] + +在这里你完成了很多。使用 Ctrl+Shift+A 来取消你当前的选择区。 + +![Outline added to the text][14] + +如此,你现在已经在 GIMP 中成功地添加轮廓到你的文本。它是在白色背景中,如果你想要一个透明背景,只需要在右侧栏的图层菜单中删除背景层。 + +![Remove the white background layer if you want a transparent background][15] + +如果你对结果感到满意,保存文件未 PNG 文件(来保留透明背景),或你喜欢的任何文件格式。 + +**你使它工作了吗?** + +就这样。这就是你在 GIMP 中为添加一个文本轮廓而需要做的全部工作。 + +我希望你发现这个 GIMP 教程有帮助。你可能想查看另一个 [关于在 GIMP 中添加一个水印的简单教程][16]。 + +如果你有问题或建议,请在下面自由留言。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gimp-text-outline/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[robsean](https://github.com/robsean) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://www.gimp.org/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/outlined_text_GIMP.png?ssl=1 +[3]: https://itsfoss.com/gimp-2-10-release/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/create_outline_text_gimp_1.jpeg?ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_2.jpg?ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp-3.jpg?ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_4.jpg?ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_5.jpg?ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_6.jpg?ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_7.jpg?ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_8.jpg?ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_9.jpg?ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_10.jpg?ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_11.jpg?ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/outline_text_gimp_12.jpg?ssl=1 +[16]: https://itsfoss.com/add-watermark-gimp-linux/ From bb536cf07e09b0fc01e3d6b4b8f76df2aa7c06c8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Jan 2020 00:56:02 +0800 Subject: [PATCH 394/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200118=203=20Me?= =?UTF-8?q?thods=20to=20Install=20the=20Latest=20PHP=207=20Package=20on=20?= =?UTF-8?q?CentOS/RHEL=207=20and=20CentOS/RHEL=206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200118 3 Methods to Install the Latest PHP 7 Package on CentOS-RHEL 7 and CentOS-RHEL 6.md --- ...kage on CentOS-RHEL 7 and CentOS-RHEL 6.md | 227 ++++++++++++++++++ 1 file changed, 227 insertions(+) create mode 100644 sources/tech/20200118 3 Methods to Install the Latest PHP 7 Package on CentOS-RHEL 7 and CentOS-RHEL 6.md diff --git a/sources/tech/20200118 3 Methods to Install the Latest PHP 7 Package on CentOS-RHEL 7 and CentOS-RHEL 6.md b/sources/tech/20200118 3 Methods to Install the Latest PHP 7 Package on CentOS-RHEL 7 and CentOS-RHEL 6.md new file mode 100644 index 0000000000..09b2f4ca73 --- /dev/null +++ b/sources/tech/20200118 3 Methods to Install the Latest PHP 7 Package on CentOS-RHEL 7 and CentOS-RHEL 6.md @@ -0,0 +1,227 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 Methods to Install the Latest PHP 7 Package on CentOS/RHEL 7 and CentOS/RHEL 6) +[#]: via: (https://www.2daygeek.com/install-php-7-on-centos-6-centos-7-rhel-7-redhat-7/) +[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) + +3 Methods to Install the Latest PHP 7 Package on CentOS/RHEL 7 and CentOS/RHEL 6 +====== + +PHP is the most popular open-source general-purpose scripting language and is widely used for web development. + +It’s part of the LAMP stack application suite and is used to create dynamic websites. + +Popular CMS applications WordPress, Joomla and Drupal are developed in PHP language. + +These applications require PHP 7 for their installation and configuration. + +PHP 7 loads your web application faster and consumes less server resources. + +By default the CentOS/RHEL 6 operating system provides PHP 5.3 in their official repository and CentOS/RHEL 7 provides PHP 5.4. + +In this article we will show you how to install the latest version of PHP on CentOS/RHEL 7 and CentOS/RHEL 6 systems. + +This can be done by adding the necessary **[additional third-party RPM repository][1]** to the system. + +### Method-1 : How to Install PHP 7 on CentOS 6/7 Using the Software Collections Repository (SCL) + +The SCL repository is now maintained by a CentOS SIG, which rebuilds the Red Hat Software Collections and also provides some additional packages of their own. + +It contains newer versions of various programs that can be installed alongside existing older packages and invoked by using the scl command. + +Run the following **[yum command][2]** to install Software Collections Repository (SCL) on CentOS + +``` +# yum install centos-release-scl +``` + +Run the following command to verify the PHP 7 version available in the scl repository. + +``` +# yum --disablerepo="*" --enablerepo="centos-sclo-rh" list *php + +Loaded plugins: fastestmirror, langpacks +Loading mirror speeds from cached hostfile +centos-sclo-rh: centos.mirrors.estointernet.in +Available Packages +php54-php.x86_64 5.4.40-4.el7 centos-sclo-rh +php55-php.x86_64 5.5.21-5.el7 centos-sclo-rh +rh-php70-php.x86_64 7.0.27-2.el7 centos-sclo-rh +rh-php71-php.x86_64 7.1.30-2.el7 centos-sclo-rh +rh-php72-php.x86_64 7.2.24-1.el7 centos-sclo-rh +``` + +Run the command below to install the PHP 7.2 on your system from scl. + +``` +# yum --disablerepo="*" --enablerepo="centos-sclo-rh" install rh-php72-php +``` + +If you need to install additional modules for PHP 7.2, you can install them by running the command format below. For instance, you can install the **“gd”** and **“pdo”** packages by executing the command below. + +``` +# yum --disablerepo="*" --enablerepo="centos-sclo-rh" install rh-php72-php-gd rh-php72-php-pdo +``` + +### Method-1a : How to Install PHP 7 on RHEL 7 Using the Software Collections Repository (SCL) + +For Red Hat 7, enable the following repositories to install the latest PHP 7 package. + +``` +# sudo subscription-manager repos --enable rhel-7-server-extras-rpms +# sudo subscription-manager repos --enable rhel-7-server-optional-rpms +# sudo subscription-manager repos --enable rhel-server-rhscl-7-rpms +``` + +Run the command below to search the available PHP 7 version from the RHSCL repository. + +``` +# yum search rh-php* +``` + +You can easily install PHP 7.3 on the RHEL 7 machine by running the command below from the RHSCL repository. + +``` +# yum install rh-php73 +``` + +### Method-2 : How to Install PHP 7 on CentOS 6/7 Using the Remi Repository + +The **[Remi repository][3]** stores and maintains the latest version of PHP packages with a large collection of libraries, extensions and tools. Some of them are back-ported from Fedora and EPEL. + +This is a CentOS community-recognized repository and doesn’t modify or affect any underlying packages. + +As a prerequisite, this installs the **[EPEL repository][4]** if it is not already installed on your system. + +You can easily find the available version of the PHP 7 package from the Remy repository because it adds a separate repo to each version. You can view them using the **[ls command][5]**. + +``` +# ls -lh /etc/yum.repos.d/remi-php* + +-rw-r--r--. 1 root root 456 Sep 6 01:31 /etc/yum.repos.d/remi-php54.repo +-rw-r--r--. 1 root root 1.3K Sep 6 01:31 /etc/yum.repos.d/remi-php70.repo +-rw-r--r--. 1 root root 1.3K Sep 6 01:31 /etc/yum.repos.d/remi-php71.repo +-rw-r--r--. 1 root root 1.3K Sep 6 01:31 /etc/yum.repos.d/remi-php72.repo +-rw-r--r--. 1 root root 1.3K Sep 6 01:31 /etc/yum.repos.d/remi-php73.repo +-rw-r--r--. 1 root root 1.3K Sep 6 01:31 /etc/yum.repos.d/remi-php74.repo +``` + +You can easily install PHP 7.4 on the CentOS 6/7 systems by running the command below from the remi repository. + +``` +# yum --disablerepo="*" --enablerepo="remi-php74" install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo +``` + +### Method-2a : How to Install PHP 7 on RHEL 7 Using the Remi Reposiotry + +For Red Hat 7, install the following repositories to install the latest PHP 7 package. + +To install EPEL Repository on RHEL 7 + +``` +# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm +``` + +To install Remi Repository on RHEL 7 + +``` +# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm +``` + +To enable the optional RPMS repository. + +``` +# subscription-manager repos --enable=rhel-7-server-optional-rpms +``` + +You can easily install PHP 7.4 on the RHEL 7 systems by running the below command from the remi repository. + +``` +# yum --disablerepo="*" --enablerepo="remi-php74" install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo +``` + +To verify the PHP 7 installation, run the following command + +``` +# php -v + +PHP 7.4.1 (cli) (built: Dec 17 2019 16:35:58) ( NTS ) +Copyright (c) The PHP Group +Zend Engine v3.4.0, Copyright (c) Zend Technologies +``` + +### Method-3 : How to Install PHP 7 on CentOS 6/7 Using the IUS Community Repository + +IUS Community is a CentOS Community Approved third-party RPM repository which contains latest upstream versions of PHP, Python, MySQL, etc.., packages for Enterprise Linux (RHEL & CentOS) 5, 6 & 7. + +**[IUS Community Repository][6]** have dependency with EPEL Repository so we have to install EPEL repository prior to IUS repository installation. Follow the below steps to install & enable EPEL & IUS Community Repository to RPM systems and install the packages. + +EPEL package is included in the CentOS Extras repository and enabled by default so, we can install this by running below command. + +``` +# yum install epel-release +``` + +Download IUS Community Repository Shell script + +``` +# curl 'https://setup.ius.io/' -o setup-ius.sh + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed +100 1914 100 1914 0 0 6563 0 --:--:-- --:--:-- --:--:-- 133k +``` + +Install/Enable IUS Community Repository. + +``` +# sh setup-ius.sh +``` + +Run the following command to check available PHP 7 version in the IUS repository. + +``` +# yum --disablerepo="*" --enablerepo="ius" list *php7* + +Loaded plugins: fastestmirror, langpacks +Loading mirror speeds from cached hostfile +Available Packages +mod_php71u.x86_64 7.1.33-1.el7.ius ius +mod_php72u.x86_64 7.2.26-1.el7.ius ius +mod_php73.x86_64 7.3.13-1.el7.ius ius +php71u-bcmath.x86_64 7.1.33-1.el7.ius ius +php71u-cli.x86_64 7.1.33-1.el7.ius ius +php71u-common.x86_64 7.1.33-1.el7.ius ius +php71u-dba.x86_64 7.1.33-1.el7.ius ius +php71u-dbg.x86_64 7.1.33-1.el7.ius ius +php71u-devel.x86_64 7.1.33-1.el7.ius ius +php71u-embedded.x86_64 7.1.33-1.el7.ius ius +``` + +You can easily install PHP 7.3 on the CentOS 6/7 systems by running the command below from the IUS Community repository. + +``` +# yum --disablerepo="*" --enablerepo="ius" install php73-common php73-cli php73-gd php73-gd php73-mysqlnd php73-ldap php73-soap php73-mbstring +``` + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/install-php-7-on-centos-6-centos-7-rhel-7-redhat-7/ + +作者:[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/8-additional-thirdparty-yum-repositories-centos-rhel-fedora-linux/ +[2]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/ +[3]: https://www.2daygeek.com/install-enable-remi-repository-on-centos-rhel-fedora-linux/ +[4]: https://www.2daygeek.com/install-enable-epel-repository-on-rhel-centos-oracle-linux/ +[5]: https://www.2daygeek.com/linux-unix-ls-command-display-directory-contents/ +[6]: https://www.2daygeek.com/install-enable-ius-community-repository-on-rhel-centos/ From 86cf00ad6506bc9ae7f7d99dc8e0db768ac2a28d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Jan 2020 00:56:34 +0800 Subject: [PATCH 395/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200117=20Fedora?= =?UTF-8?q?=20CoreOS=20out=20of=20preview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200117 Fedora CoreOS out of preview.md --- .../20200117 Fedora CoreOS out of preview.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20200117 Fedora CoreOS out of preview.md diff --git a/sources/tech/20200117 Fedora CoreOS out of preview.md b/sources/tech/20200117 Fedora CoreOS out of preview.md new file mode 100644 index 0000000000..d7a1393cde --- /dev/null +++ b/sources/tech/20200117 Fedora CoreOS out of preview.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora CoreOS out of preview) +[#]: via: (https://fedoramagazine.org/fedora-coreos-out-of-preview/) +[#]: author: (bgilbert https://fedoramagazine.org/author/bgilbert/) + +Fedora CoreOS out of preview +====== + +![The Fedora CoreOS logo on a gray background.][1] + +The Fedora CoreOS team is pleased to announce that Fedora CoreOS is now [available for general use][2]. + +Fedora CoreOS is a new Fedora Edition built specifically for running containerized workloads securely and at scale. It’s the successor to both [Fedora Atomic Host][3] and [CoreOS Container Linux][4] and is part of our effort to explore new ways of assembling and updating an OS. Fedora CoreOS combines the provisioning tools and automatic update model of Container Linux with the packaging technology, OCI support, and SELinux security of Atomic Host.  For more on the Fedora CoreOS philosophy, goals, and design, see the [announcement of the preview release][5]. + +Some highlights of the current Fedora CoreOS release: + + * [Automatic updates][6], with staged deployments and phased rollouts + * Built from Fedora 31, featuring: + * Linux 5.4 + * systemd 243 + * Ignition 2.1 + * OCI and Docker Container support via Podman 1.7 and Moby 18.09 + * cgroups v1 enabled by default for broader compatibility; cgroups v2 available via configuration + + + +Fedora CoreOS is available on a variety of platforms: + + * Bare metal, QEMU, OpenStack, and VMware + * Images available in all public AWS regions + * Downloadable cloud images for Alibaba, AWS, Azure, and GCP + * Can run live from RAM via ISO and PXE (netboot) images + + + +Fedora CoreOS is under active development.  Planned future enhancements include: + + * Addition of the _next_ release stream for extended testing of upcoming Fedora releases. + * Support for additional cloud and virtualization platforms, and processor architectures other than _x86_64_. + * Closer integration with Kubernetes distributions, including [OKD][7]. + * [Aggregate statistics collection][8]. + * Additional [documentation][9]. + + + +### Where do I get it? + +To try out the new release, head over to the [download page][10] to get OS images or cloud image IDs.  Then use the [quick start guide][11] to get a machine running quickly. + +### How do I get involved? + +It’s easy!  You can report bugs and missing features to the [issue tracker][12]. You can also discuss Fedora CoreOS in [Fedora Discourse][13], the [development mailing list][14], in _#fedora-coreos_ on Freenode, or at our [weekly IRC meetings][15]. + +### Are there stability guarantees? + +In general, the Fedora Project does not make any guarantees around stability.  While Fedora CoreOS strives for a high level of stability, this can be challenging to achieve in the rapidly evolving Linux and container ecosystems.  We’ve found that the incremental, exploratory, forward-looking development required for Fedora CoreOS — which is also a cornerstone of the Fedora Project as a whole — is difficult to reconcile with the iron-clad stability guarantee that ideally exists when automatically updating systems. + +We’ll continue to do our best not to break existing systems over time, and to give users the tools to manage the impact of any regressions.  Nevertheless, automatic updates may produce regressions or breaking changes for some use cases. You should make your own decisions about where and how to run Fedora CoreOS based on your risk tolerance, operational needs, and experience with the OS.  We will continue to announce any major planned or unplanned breakage to the [coreos-status mailing list][16], along with recommended mitigations. + +### How do I migrate from CoreOS Container Linux? + +Container Linux machines cannot be migrated in place to Fedora CoreOS.  We recommend [writing a new Fedora CoreOS Config][11] to provision Fedora CoreOS machines.  Fedora CoreOS Configs are similar to Container Linux Configs, and must be passed through the Fedora CoreOS Config Transpiler to produce an Ignition config for provisioning a Fedora CoreOS machine. + +Whether you’re currently provisioning your Container Linux machines using a Container Linux Config, handwritten Ignition config, or cloud-config, you’ll need to adjust your configs for differences between Container Linux and Fedora CoreOS.  For example, on Fedora CoreOS network configuration is performed with [NetworkManager key files][17] instead of _systemd-networkd_, and time synchronization is performed by _chrony_ rather than _systemd-timesyncd_.  Initial migration documentation will be [available soon][9] and a skeleton list of differences between the two OSes is available in [this issue][18]. + +CoreOS Container Linux will be maintained for a few more months, and then will be declared end-of-life.  We’ll announce the exact end-of-life date later this month. + +### How do I migrate from Fedora Atomic Host? + +Fedora Atomic Host has already reached end-of-life, and you should migrate to Fedora CoreOS as soon as possible.  We do not recommend in-place migration of Atomic Host machines to Fedora CoreOS. Instead, we recommend [writing a Fedora CoreOS Config][11] and using it to provision new Fedora CoreOS machines.  As with CoreOS Container Linux, you’ll need to adjust your existing cloud-configs for differences between Fedora Atomic Host and Fedora CoreOS. + +Welcome to Fedora CoreOS.  Deploy it, launch your apps, and let us know what you think! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-coreos-out-of-preview/ + +作者:[bgilbert][a] +选题:[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/bgilbert/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/07/introducing-fedora-coreos-816x345.png +[2]: https://getfedora.org/coreos/ +[3]: https://www.projectatomic.io/ +[4]: https://coreos.com/os/docs/latest/ +[5]: https://fedoramagazine.org/introducing-fedora-coreos/ +[6]: https://docs.fedoraproject.org/en-US/fedora-coreos/auto-updates/ +[7]: https://www.okd.io/ +[8]: https://github.com/coreos/fedora-coreos-pinger/ +[9]: https://docs.fedoraproject.org/en-US/fedora-coreos/ +[10]: https://getfedora.org/coreos/download/ +[11]: https://docs.fedoraproject.org/en-US/fedora-coreos/getting-started/ +[12]: https://github.com/coreos/fedora-coreos-tracker/issues +[13]: https://discussion.fedoraproject.org/c/server/coreos +[14]: https://lists.fedoraproject.org/archives/list/coreos@lists.fedoraproject.org/ +[15]: https://github.com/coreos/fedora-coreos-tracker#meetings +[16]: https://lists.fedoraproject.org/archives/list/coreos-status@lists.fedoraproject.org/ +[17]: https://developer.gnome.org/NetworkManager/stable/nm-settings-keyfile.html +[18]: https://github.com/coreos/fedora-coreos-tracker/issues/159 From fd50af186aec8e3b1fe58a37b07c847cdad76626 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Jan 2020 00:57:15 +0800 Subject: [PATCH 396/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200118=20Zorin?= =?UTF-8?q?=20Grid=20Lets=20You=20Remotely=20Manage=20Multiple=20Zorin=20O?= =?UTF-8?q?S=20Computers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200118 Zorin Grid Lets You Remotely Manage Multiple Zorin OS Computers.md --- ...tely Manage Multiple Zorin OS Computers.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20200118 Zorin Grid Lets You Remotely Manage Multiple Zorin OS Computers.md diff --git a/sources/tech/20200118 Zorin Grid Lets You Remotely Manage Multiple Zorin OS Computers.md b/sources/tech/20200118 Zorin Grid Lets You Remotely Manage Multiple Zorin OS Computers.md new file mode 100644 index 0000000000..184b68d84e --- /dev/null +++ b/sources/tech/20200118 Zorin Grid Lets You Remotely Manage Multiple Zorin OS Computers.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Zorin Grid Lets You Remotely Manage Multiple Zorin OS Computers) +[#]: via: (https://itsfoss.com/zorin-grid/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Zorin Grid Lets You Remotely Manage Multiple Zorin OS Computers +====== + +One of the major hurdles institutes face is in managing and updating multiple Linux systems from a central point. + +Well, Zorin OS has come up with a new cloud-based tool that will help you manage multiple computers running Zorin OS from one single interface. You can update the systems, install apps and configuration all systems remotely using this tool called [Zorin Grid][1]. + +### Zorin Grid: Manage a fleet of Zorin OS computers remotely + +![][2] + +**Zorin Grid is a tool that makes it simple to set up, manage, and secure a fleet of Zorin OS-powered computers in businesses, schools, and organizations.** + +When it comes to managing Linux distributions (here, Zorin OS) on a multitude of systems for an organization – it is quite time-consuming. + +If it will be easier to manage Linux systems, more organizations will be interested to switch using Linux just like the [Italian city Vicenza replaced Windows by Zorin OS][3]. + +For the very same reason, the Zorin team decided to create ‘**Zorin Grid**‘ with the help of which every school, enterprises, organizations, and businesses will be able to easily manage their Zorin OS-powered machines. + +### Zorin Grid features + +![Zorin Grid Features][4] + +You might have guessed what it is capable of – but let me highlight the key features of Zorin Grid as per its official webpage: + + * Install and Remove Apps + * Set software update and security patch policies + * Monitor computer status + * Enforce security policies + * Keep track of software and hardware inventory + * Set desktop settings + * Organize computers into groups (for teams and departments) + * Role-based access control and audit logging + + + +In addition to these, you will be able to do a couple more things using the Zorin Grid service. But, it looks like most of the essential tasks will be covered by Zorin Grid. + +### How does Zorin Grid work? + +![][5] + +Zorin Grid is a cloud based software as a service. Zorin will be charging a monthly subscription fee for each computer managed by Zorin Grid in an organization. + +You’ll have to install the Zorin Grid client on all the systems that you want to manage. Since it is cloud-based, you can manage all the Zorin systems on your grid from a web browser by logging into you Zorin Grid account. + +You choose how to configure the computers once and the Zorin Grid applies the same configuration to all or specific computers in your organization. + +The price has not been finalized. [Artyom Zorin][6], **CEO of Zorin Group, told It’s FOSS** that schools and non-profit organizations will get Zorin Grid for a reduced pricing. + +While client-side software for Zorin Grid will be open source, the Zorin Grid server won’t be open source initially. Releasing it under an open source license is _tentatively_ on their roadmap. + +Artyom also told that they **plan to support other Linux distributions starting with Ubuntu and Ubuntu-based distros** after launching Zorin Grid for Zorin OS systems this summer. + +In case you decide to migrate from Windows to Zorin OS for your organization or business, you will find a [useful migration guide][7] by the Zorin OS team to help you switch to Linux. + +[Zorin Grid][1] + +**Wrapping Up** + +Let me summarize all the important points about Zorin Grid: + + * Zorin Grid is an upcoming cloud based service that lets you manage multiple Zorin OS systems. + * It’s a premium service that charges for each computer used. The pricing is not determined yet. + * Educational institutes and non-profit organizations can get Zorin Grid for a reduced pricing. + * Initially it can only handle Zorin OS. Other Ubuntu-based distributions are on the road-map but there is no definite timeline for that. + * The service should be available in the summer 2020. + * Zorin Grid server won’t be open source initially. + + + +Zorin Grid looks to be an impressive premium tool for organizations or businesses that want to use Linux while also being able to maintain their systems easily. + +Personally, I wouldn’t mind paying for the service if it makes deploying and using Linux easier, in general. + +Of course, it does not support every Linux distro as of yet – but it is indeed a promising service to keep an eye out for. + +What do you think about it? Do you know of a better alternative to Zorin Grid? Do share your views in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/zorin-grid/ + +作者:[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://zorinos.com/grid/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/zorin-grid-dashboard.png?ssl=1 +[3]: https://itsfoss.com/vicenza-windows-zorin/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/zorin_grid_features.jpg?ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/zorin-os-computers.jpg?ssl=1 +[6]: https://itsfoss.com/zorin-os-interview/ +[7]: https://zorinos.com/help/switch-your-organization-to-zorin-os/ From b00a27d56a436d40fadb088a4a451e02043fb09b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Jan 2020 00:58:02 +0800 Subject: [PATCH 397/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200117=20Get=20?= =?UTF-8?q?started=20with=20this=20open=20source=20to-do=20list=20manager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200117 Get started with this open source to-do list manager.md --- ...ith this open source to-do list manager.md | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 sources/tech/20200117 Get started with this open source to-do list manager.md diff --git a/sources/tech/20200117 Get started with this open source to-do list manager.md b/sources/tech/20200117 Get started with this open source to-do list manager.md new file mode 100644 index 0000000000..57c9061179 --- /dev/null +++ b/sources/tech/20200117 Get started with this open source to-do list manager.md @@ -0,0 +1,109 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Get started with this open source to-do list manager) +[#]: via: (https://opensource.com/article/20/1/open-source-to-do-list) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Get started with this open source to-do list manager +====== +Todo is a powerful way to keep track of your task list. Learn how to use +it in the seventh in our series on 20 ways to be more productive with +open source in 2020. +![Team checklist][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Track your tasks with todo + +Tasks and to-do lists are very near and dear to my heart. I'm a big fan of productivity (so much so that I do a [podcast][2] about it) and try all sorts of different applications. I've even [given presentations][3] and [written articles][4] about them. So it only makes sense that, when I talk about being productive, task and to-do list tools are certain to come up. + +![Getting fancy with Todo.txt][5] + +In all honesty, for being simple, cross-platform, and easily synchronized, you cannot go wrong with [todo.txt][6]. It is one of the two to-do list and task management apps that I keep coming back to over and over again (the other is [Org mode][7]). And what keeps me coming back is that it is simple, portable, understandable, and has many great add-ons that don't break it if one machine has them and the others don't. And since it is a Bash shell script, I have never found a system that cannot support it. + +#### Set up todo.txt + +First things first, you need to install the base shell script and copy the default configuration file to the **~/.todo** directory: + + +``` +git clone +cd todo.txt-cli +make +sudo make install +mkdir ~/.todo +cp todo.cfg ~/.todo/config +``` + +Next, set up the configuration file. I like to uncomment the color settings at this point, but the only thing that must be set up right away is the **TODO_DIR** variable: + + +``` +`export TODO_DIR="$HOME/.todo"` +``` + +#### Add to-do's + +To add your first to-do item, simply type **todo.sh add <NewTodo>**, and it will be added. This will also create three files in **$HOME/.todo/**: todo.txt, done.txt, and reports.txt. + +After adding a few items, run **todo.sh ls** to see your to-do list. + +![Basic todo.txt list][8] + +#### Manage your tasks + +You can improve it a little by prioritizing the items. To add a priority to an item, run **todo.sh pri # A**. The number is the number of the task on the list, and the letter "A" is the priority. You can set the priority as anything from A to Z since that's how it will get sorted. + +To complete a task, run **todo.sh do #** to mark the item done and move the item to done.txt. Running **todo.sh report** will write a count of done and not done items to reports.txt. + +The file format used for all three files is well documented, so you can make changes with your text editor of choice. The basic format of todo.txt is: + + +``` +`(Priority) YYYY-MM-DD Task` +``` + +The date indicates the due date of a task, if one is set. When editing the file manually, just put an "x" in front of the task to mark it as done. Running **todo.sh archive** will move these items to done.txt, and you can work in that text file and archive the done items when you have time. + +#### Set up recurring tasks + +I have a lot of recurring tasks that I need to schedule every day/week/month. + +![Recurring tasks with the ice_recur add-on][9] + +This is where todo.txt's flexibility comes in. By using [add-ons][10] in **~/.todo.actions.d/**, you can add commands and extend the functionality of the base todo.sh. The add-ons are basically scripts that implement specific commands. For recurring tasks, the plugin [ice_recur][11] should fit the bill. By following the instructions on the page, you can set up tasks to recur in a very flexible manner. + +![Todour on MacOS][12] + +There are a lot of add-ons in the directory, including syncing to some cloud services. There are also links to desktop and mobile apps, so you can keep your to-do list with you on the go. + +I've only scratched the surface of todo's functionality, so take some time to dig in and see how powerful this tool is! It really helps me keep on task every day. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-to-do-list + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://productivityalchemy.com/ +[3]: https://www.slideshare.net/AllThingsOpen/getting-to-done-on-the-command-line +[4]: https://opensource.com/article/18/2/getting-to-done-agile-linux-command-line +[5]: https://opensource.com/sites/default/files/uploads/productivity_7-1.png +[6]: http://todotxt.org/ +[7]: https://orgmode.org/ +[8]: https://opensource.com/sites/default/files/uploads/productivity_7-2.png (Basic todo.txt list) +[9]: https://opensource.com/sites/default/files/uploads/productivity_7-3.png (Recurring tasks with the ice_recur add-on) +[10]: https://github.com/todotxt/todo.txt-cli/wiki/Todo.sh-Add-on-Directory +[11]: https://github.com/rlpowell/todo-text-stuff +[12]: https://opensource.com/sites/default/files/uploads/productivity_7-4.png (Todour on MacOS) From 5d1f78aba0ab8cab11efaba9dac85b2e6c47efc8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Jan 2020 00:58:42 +0800 Subject: [PATCH 398/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200117=20Use=20?= =?UTF-8?q?this=20Python=20script=20to=20find=20bugs=20in=20your=20Overclo?= =?UTF-8?q?ud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200117 Use this Python script to find bugs in your Overcloud.md --- ...n script to find bugs in your Overcloud.md | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 sources/tech/20200117 Use this Python script to find bugs in your Overcloud.md diff --git a/sources/tech/20200117 Use this Python script to find bugs in your Overcloud.md b/sources/tech/20200117 Use this Python script to find bugs in your Overcloud.md new file mode 100644 index 0000000000..ee167e6f78 --- /dev/null +++ b/sources/tech/20200117 Use this Python script to find bugs in your Overcloud.md @@ -0,0 +1,178 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use this Python script to find bugs in your Overcloud) +[#]: via: (https://opensource.com/article/20/1/logtool-root-cause-identification) +[#]: author: (Arkady Shtempler https://opensource.com/users/ashtempl) + +Use this Python script to find bugs in your Overcloud +====== +LogTool is a set of Python scripts that helps you investigate root +causes for problems in Overcloud nodes. +![Searching for code][1] + +OpenStack stores and manages a bunch of log files on its Overcloud nodes and Undercloud host. Therefore, it's not easy to use OSP log files to investigate a problem you're having, especially when you don't even know what could have caused the problem. + +If that's your situation, [LogTool][2] makes your life much easier! It saves you the time and work it would otherwise take to investigate the root cause manually. Based on a fuzzy string matching algorithm, LogTool provides all the unique error and warning messages that have occurred in the past. You can export these messages for a particular time period, such as 10 minutes ago, an hour ago, a day ago, and so on, based on timestamp in the log. + +LogTool is a set of Python scripts, and its main module, **PyTool.py**, is executed on the Undercloud host. Some operation modes use additional scripts that are executed directly on Overcloud nodes, such as exporting  errors and warnings from Overcloud logs. + +LogTool supports Python 2 and 3, and you can change the working directory according to your needs: [LogTool_Python2][3] or [LogTool_Python3][4]. + +### Operation modes + +#### 1\. Export errors and warnings from Overcloud logs + +This mode is used to extract all unique **ERROR** and **WARNING** messages from Overcloud nodes that took place in the past. As the user, you're prompted to provide the "since time" and debug level to be used for extraction of errors or warnings. For example, if something went wrong in the last 10 minutes, you're be able to extract error and warning messages for just that time period. + +This operation mode generates a directory containing a result file for each Overcloud node. A result file is a simple text file that is compressed (***.gz**) to reduce the time needed to download it from the Overcloud node. To convert a compressed file to a regular text file, you can use [zcat][5] or a similar tool. Also, some versions of Vi and any recent version of Emacs both support reading compressed data. The result file is divided into sections and contains a table of contents at the bottom. + +There are two kinds of log files LogTool detects on the fly: _Standard_ and _Not Standard_. In _Standard_, each log line has a known and defined structure: timestamp, debug level, msg, and so on. In _Not Standard_, the log's structure is unknown; it could be a third party's logs, for example. In the table of contents, you find a "Section name --> Line number" per section, for example: + + * **Raw Data - extracted Errors/Warnings from standard OSP logs since:** This section contains all extracted Error/Warning messages as-is without any modifications or changes. These messages are the raw data LogTool uses for fuzzy matching analysis. + * **Statistics - Number of Errors/Warnings per standard OSP log since:** In this section, you find the amount of Errors and Warnings per Standard log file. This may help you understand potential components used to search for the root cause of your issue. + * **Statistics - Unique messages, per STANDARD OSP log file since:** This section addresses unique Error and Warning messages since a timestamp you provide. For more details about each unique Error or Warning, search for the same message in the Raw Data section. + * **Statistics - Unique messages per NON STANDARD log file, since any time:** This section contains the unique messages in nonstandard log files. Unfortunately, LogTool cannot handle these log files in the same manner as Standard Log files; therefore, the "since time" you provide on extraction will be ignored, and you'll see all of the unique Errors/Warnings messages ever created. So first, scroll down to the table of contents at the bottom of the result file and review its sections—use the line indexes in the table of contents to jump to the relevant sections, where numbers 3, 4, and 5 are most important. + + + +#### 2\. Download all logs from Overcloud nodes + +Logs from all Overcloud nodes are compressed and downloaded to a local directory on your Undercloud host. + +#### 3\. Grep for a string in all Overcloud logs + +This mode "greps" (searches) a string provided by the user on all Overcloud logs. For example, you might want to see all logged messages for a specific request ID, such as the request ID for a "Create VM" that has failed. + +#### 4\. Check current CPU,RAM and Disk on Overcloud + +This mode displays the current CPU, RAM, and disk info on each Overcloud node. + +#### 5\. Execute user's script + +This enables users to run their own scripts on Overcloud nodes. For instance, say an Overcloud deployment failed, so you need to execute the same procedure on each Controller node to fix that. You can implement a "work around" script and to run it on Controllers using this mode. + +#### 6\. Download relevant logs only, by given timestamp + +This mode downloads only the Overcloud logs with _"Last Modified" > "given by user timestamp."_ For example, if you got an error 10 minutes ago, old log files won't be relevant, so downloading them is unnecessary. In addition, you can't (or shouldn't)  attach large files in some bug reporting tools, so this mode might help with making bug reports. + +#### 7\. Export errors and warnings from Undercloud logs + +This is the same as mode #1 above, but for Undercloud logs. + +#### 8\. Check Unhealthy dockers on the Overcloud + +This mode is used to search for unhealthy Dockers on nodes. + +#### 9\. Download OSP logs and run LogTool locally + +This mode allows you to download OSP logs from Jenkins or Log Storage (for example, **cougar11.scl.lab.tlv.redhat.com**) and to analyze the downloaded logs locally. + +#### 10\. Analyze deployment log on the Undercloud + +This mode may help you understand what went wrong during Overcloud or Undercloud deployment. Deployment logs are generated when the **\--log** option is used, for example, inside the **overcloud_deploy.sh** script; the problem is that such logs are not "friendly," and it's hard to understand what went wrong, especially when verbosity is set to **vv** or more, as this makes the log unreadable with a bunch of data inside it. This mode provides some details about all failed tasks. + +#### 11\. Analyze Gerrit(Zuul) failed gate logs + +This mode is used to analyze Gerrit(Zuul) log files. It automatically downloads all files from a remote Gerrit gate (HTTP download) and analyzes all files locally. + +### Installation + +LogTool is available on GitHub. Clone it to your Undercloud host with: + + +``` +`git clone https://github.com/zahlabut/LogTool.git` +``` + +Some external Python modules are also used by the tool: + +#### Paramiko + +This SSH module is usually installed on Undercloud by default. Use the following command to verify whether it's installed: + + +``` +`ls -a /usr/lib/python2.7/site-packages | grep paramiko` +``` + +If you need to install the module, on your Undercloud, execute the following commands: + + +``` +sudo easy_install pip +sudo pip install paramiko==2.1.1 +``` + +#### BeautifulSoup + +This HTML parser module is used only in modes where log files are downloaded using HTTP. It's used to parse the Artifacts HTML page to get all of the links in it. To install BeautifulSoup, enter this command: + + +``` +`pip install beautifulsoup4` +``` + +You can also use the [requirements.txt][6] file to install all the required modules by executing: + + +``` +`pip install -r requirements.txt` +``` + +### Configuration + +All required parameters are set directly inside the **PyTool.py** script. The defaults are: + + +``` +overcloud_logs_dir = '/var/log/containers' +overcloud_ssh_user = 'heat-admin' +overcloud_ssh_key = '/home/stack/.ssh/id_rsa' +undercloud_logs_dir ='/var/log/containers' +source_rc_file_path='/home/stack/' +``` + +### Usage + +This tool is interactive, so to start it, just enter: + + +``` +cd LogTool +python PyTool.py +``` + +### Troubleshooting LogTool + +Two log files are created on runtime: Error.log and Runtime.log*.* Please add the contents of both in the description of the issue you'd like to open. + +### Limitations + +LogTool is hardcoded to handle files up to 500 MB. + +### LogTool_Python3 script + +Get it at [github.com/zahlabut/LogTool][2] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/logtool-root-cause-identification + +作者:[Arkady Shtempler][a] +选题:[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/ashtempl +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_python_programming.png?itok=ynSL8XRV (Searching for code) +[2]: https://github.com/zahlabut/LogTool +[3]: https://github.com/zahlabut/LogTool/tree/master/LogTool_Python2 +[4]: https://github.com/zahlabut/LogTool/tree/master/LogTool_Python3 +[5]: https://opensource.com/article/19/2/getting-started-cat-command +[6]: https://github.com/zahlabut/LogTool/blob/master/LogTool_Python3/requirements.txt From 8b97dedd6fa2bb676afe4c3cc6df2e4717afc7c6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Jan 2020 00:59:30 +0800 Subject: [PATCH 399/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200117=20C=20vs?= =?UTF-8?q?.=20Rust:=20Which=20to=20choose=20for=20programming=20hardware?= =?UTF-8?q?=20abstractions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md --- ...e for programming hardware abstractions.md | 509 ++++++++++++++++++ 1 file changed, 509 insertions(+) create mode 100644 sources/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md diff --git a/sources/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md b/sources/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md new file mode 100644 index 0000000000..acb58aaf6d --- /dev/null +++ b/sources/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md @@ -0,0 +1,509 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (C vs. Rust: Which to choose for programming hardware abstractions) +[#]: via: (https://opensource.com/article/20/1/c-vs-rust-abstractions) +[#]: author: (Dan Pittman https://opensource.com/users/dan-pittman) + +C vs. Rust: Which to choose for programming hardware abstractions +====== +Using type-level programming in Rust can make hardware abstractions +safer. +![Tools illustration][1] + +Rust is an increasingly popular programming language positioned to be the best choice for hardware interfaces. It's often compared to C for its level of abstraction. This article explains how Rust can handle bitwise operations in a number of ways and offers a solution that provides both safety and ease of use. + +Language | Origin | Official description | Overview +---|---|---|--- +C | 1972 | C is a general-purpose programming language which features economy of expression, modern control flow and data structures, and a rich set of operators. (Source: [CS Fundamentals][2]) | C is [an] imperative language and designed to compile in a relatively straightforward manner which provides low-level access to the memory. (Source: [W3schools.in][3]) +Rust | 2010 | A language empowering everyone to build reliable and efficient software (Source: [Rust website][4]) | Rust is a multi-paradigm system programming language focused on safety, especially safe concurrency. (Source: [Wikipedia][5]) + +### Bitwise operation over register values in C + +In the world of systems programming, where you may find yourself writing hardware drivers or interacting directly with memory-mapped devices, interaction is almost always done through memory-mapped registers provided by the hardware. You typically interact with these things through bitwise operations on some fixed-width numeric type. + +For instance, imagine an 8-bit register with three fields: + + +``` ++----------+------+-----------+---------+ +| (unused) | Kind | Interrupt | Enabled | ++----------+------+-----------+---------+ +   5-7       2-4        1          0 +``` + +The number below the field name prescribes the bits used by that field in the register. To enable this register, you would write the value **1**, represented in binary as **0000_0001**, to set the enabled field's bit. Often, though, you also have an existing configuration in the register that you don't want to disturb. Say you want to enable interrupts on the device but also want to be sure the device remains enabled. To do that, you must combine the Interrupt field's value with the Enabled field's value. You would do that with bitwise operations: + + +``` +`1 | (1 << 1)` +``` + +This gives you the binary value **0000_0011** by **or**-ing 1 with 2, which you get by shifting 1 left by 1. You can write this to your register, leaving it enabled but also enabling interrupts. + +This is a lot to keep in your head, especially when you're dealing with potentially hundreds of registers for a complete system. In practice, you do this with mnemonics which track a field's position in a register and how wide the field is—i.e., _what's its upper bound?_ + +Here's an example of one of these mnemonics. They are C macros that replace their occurrences with the code on the right-hand side. This is the shorthand for the register laid out above. The left-hand side of the **&** puts you in position for that field, and the right-hand side limits you to only that field's bits: + + +``` +#define REG_ENABLED_FIELD(x) (x << 0) & 1 +#define REG_INTERRUPT_FIELD(x) (x << 1) & 2 +#define REG_KIND_FIELD(x) (x << 2) & (7 << 2) +``` + +You'd then use these to abstract over the derivation of a register's value with something like: + + +``` +void set_reg_val(reg* u8, val u8); + +fn enable_reg_with_interrupt(reg* u8) { +    set_reg_val(reg, REG_ENABLED_FIELD(1) | REG_INTERRUPT_FIELD(1)); +} +``` + +This is the state of the art. In fact, this is how the bulk of drivers appear in the Linux kernel. + +Is there a better way? Consider the boon to safety and expressibility if the type system was borne out of research on modern programming languages. That is, what could you do with a richer, more expressive type system to make this process safer and more tenable? + +### Bitwise operation over register values in Rust + +Continuing with the register above as an example: + + +``` ++----------+------+-----------+---------+ +| (unused) | Kind | Interrupt | Enabled | ++----------+------+-----------+---------+ +   5-7       2-4        1          0 +``` + +How might you want to express such a thing in Rust types? + +You'll start in a similar way, by defining constants for each field's _offset_—that is, how far it is from the least significant bit—and its mask. A _mask_ is a value whose binary representation can be used to update or read the field from inside the register: + + +``` +const ENABLED_MASK: u8 = 1; +const ENABLED_OFFSET: u8 = 0; + +const INTERRUPT_MASK: u8 = 2; +const INTERRUPT_OFFSET: u8 = 1; + +const KIND_MASK: u8 = 7 << 2; +const KIND_OFFSET: u8 = 2; +``` + +Next, you'll declare a field type and do your operations to convert a given value into its position-relevant value for use inside the register: + + +``` +struct Field { +    value: u8, +} + +impl Field { +    fn new(mask: u8, offset: u8, val: u8) -> Self { +        Field { +            value: (val << offset) & mask, +        } +    } +} +``` + +Finally, you'll use a **Register** type, which wraps around a numeric type that matches the width of your register. **Register** has an **update** function that updates the register with the given field: + + +``` +struct Register(u8); + +impl Register { +    fn update(&mut self, val: Field) { +        self.0 = self.0 | field.value; +    } +} + +fn enable_register(&mut reg) { +    reg.update(Field::new(ENABLED_MASK, ENABLED_OFFSET, 1)); +} +``` + +With Rust, you can use data structures to represent fields, attach them to specific registers, and provide concise and sensible ergonomics while interacting with the hardware. This example uses the most basic facilities provided by Rust; regardless, the added structure alleviates some of the density from the C example above. Now a field is a named thing, not a number derived from shadowy bitwise operators, and registers are types with state—one extra layer of abstraction over the hardware. + +### A Rust implementation for ease of use + +The first rewrite in Rust is nice, but it's not ideal. You have to remember to bring the mask and offset, and you're calculating them ad hoc, by hand, which is error-prone. Humans aren't great at precise and repetitive tasks—we tend to get tired or lose focus, and this leads to mistakes. Transcribing the masks and offsets by hand, one register at a time, will almost certainly end badly. This is the kind of task best left to a machine. + +Second, thinking more structurally: What if there were a way to have the field's type carry the mask and offset information? What if you could catch mistakes in your implementation for how you access and interact with hardware registers at compile time instead of discovering them at runtime? Perhaps you can lean on one of the strategies commonly used to suss out issues at compile time, like types. + +You can modify the earlier example by using [**typenum**][6], a library that provides numbers and arithmetic at the type level. Here, you'll parameterize the **Field** type with its mask and offset, making it available for any instance of **Field** without having to include it at the call site: + + +``` +#[macro_use] +extern crate typenum; + +use core::marker::PhantomData; + +use typenum::*; + +// Now we'll add Mask and Offset to Field's type +struct Field<Mask: Unsigned, Offset: Unsigned> { +    value: u8, +    _mask: PhantomData<Mask>, +    _offset: PhantomData<Offset>, +} + +// We can use type aliases to give meaningful names to +// our fields (and not have to remember their offsets and masks). +type RegEnabled = Field<U1, U0>; +type RegInterrupt = Field<U2, U1>; +type RegKind = Field<op!(U7 << U2), U2>; +``` + +Now, when revisiting **Field**'s constructor, you can elide the mask and offset parameters because the type contains that information: + + +``` +impl<Mask: Unsigned, Offset: Unsigned> Field<Mask, Offset> { +    fn new(val: u8) -> Self { +        Field { +            value: (val << Offset::U8) & Mask::U8, +            _mask: PhantomData, +            _offset: PhantomData, +        } +    } +} + +// And to enable our register... +fn enable_register(&mut reg) { +    reg.update(RegEnabled::new(1)); +} +``` + +It looks pretty good, but… what happens when you make a mistake regarding whether a given value will _fit_ into a field? Consider a simple typo where you put **10** instead of **1**: + + +``` +fn enable_register(&mut reg) { +    reg.update(RegEnabled::new(10)); +} +``` + +In the code above, what is the expected outcome? Well, the code will set that enabled bit to 0 because **10 & 1 = 0**. That's unfortunate; it would be nice to know whether a value you're trying to write into a field will fit into the field before attempting a write. As a matter of fact, I'd consider lopping off the high bits of an errant field value _undefined behavior_ (gasps). + +### Using Rust with safety in mind + +How can you check that a field's value fits in its prescribed position in a general way? More type-level numbers! + +You can add a **Width** parameter to **Field** and use it to verify that a given value can fit into the field: + + +``` +struct Field<Width: Unsigned, Mask: Unsigned, Offset: Unsigned> { +    value: u8, +    _mask: PhantomData<Mask>, +    _offset: PhantomData<Offset>, +    _width: PhantomData<Width>, +} + +type RegEnabled = Field<U1,U1, U0>; +type RegInterrupt = Field<U1, U2, U1>; +type RegKind = Field<U3, op!(U7 << U2), U2>; + +impl<Width: Unsigned, Mask: Unsigned, Offset: Unsigned> Field<Width, Mask, Offset> { +    fn new(val: u8) -> Option<Self> { +        if val <= (1 << Width::U8) - 1 { +            Some(Field { +                value: (val << Offset::U8) & Mask::U8, +                _mask: PhantomData, +                _offset: PhantomData, +                _width: PhantomData, +            }) +        } else { +            None +        } +    } +} +``` + +Now you can construct a **Field** only if the given value fits! Otherwise, you have **None**, which signals that an error has occurred, rather than lopping off the high bits of the value and silently writing an unexpected value. + +Note, though, this will raise an error at runtime. However, we knew the value we wanted to write beforehand, remember? Given that, we can teach the compiler to reject entirely a program which has an invalid field value—we don’t have to wait until we run it! + +This time, you'll add a _trait bound_ (the **where** clause) to a new realization of new, called **new_checked**, that asks the incoming value to be less than or equal to the maximum possible value a field with the given **Width** can hold: + + +``` +struct Field<Width: Unsigned, Mask: Unsigned, Offset: Unsigned> { +    value: u8, +    _mask: PhantomData<Mask>, +    _offset: PhantomData<Offset>, +    _width: PhantomData<Width>, +} + +type RegEnabled = Field<U1, U1, U0>; +type RegInterrupt = Field<U1, U2, U1>; +type RegKind = Field<U3, op!(U7 << U2), U2>; + +impl<Width: Unsigned, Mask: Unsigned, Offset: Unsigned> Field<Width, Mask, Offset> { +    const fn new_checked<V: Unsigned>() -> Self +    where +        V: IsLessOrEqual<op!((U1 << Width) - U1), Output = True>, +    { +        Field { +            value: (V::U8 << Offset::U8) & Mask::U8, +            _mask: PhantomData, +            _offset: PhantomData, +            _width: PhantomData, +        } +    } +} +``` + +Only numbers for which this property holds has an implementation of this trait, so if you use a number that does not fit, it will fail to compile. Take a look! + + +``` +fn enable_register(&mut reg) { +    reg.update(RegEnabled::new_checked::<U10>()); +} +12 |     reg.update(RegEnabled::new_checked::<U10>()); +   |                           ^^^^^^^^^^^^^^^^ expected struct `typenum::B0`, found struct `typenum::B1` +   | +   = note: expected type `typenum::B0` +           found type `typenum::B1` +``` + +**new_checked** will fail to produce a program that has an errant too-high value for a field. Your typo won't blow up at runtime because you could never have gotten an artifact to run. + +You're nearing Peak Rust in terms of how safe you can make memory-mapped hardware interactions. However, what you wrote back in the first example in C was far more succinct than the type parameter salad you ended up with. Is doing such a thing even tractable when you're talking about potentially hundreds or even thousands of registers? + +### Just right with Rust: both safe and accessible + +Earlier, I called out calculating masks by hand as being problematic, but I just did that same problematic thing—albeit at the type level. While using such an approach is nice, getting to the point when you can write any code requires quite a bit of boilerplate and manual transcription (I'm talking about the type synonyms here). + +Our team wanted something like the [TockOS mmio registers][7], but one that would generate typesafe implementations with the least amount of manual transcription possible. The result we came up with is a macro that generates the necessary boilerplate to get a Tock-like API plus type-based bounds checking. To use it, write down some information about a register, its fields, their width and offsets, and optional [enum][8]-like values (should you want to give "meaning" to the possible values a field can have): + + +``` +register! { +    // The register's name +    Status, +    // The type which represents the whole register. +    u8, +    // The register's mode, ReadOnly, ReadWrite, or WriteOnly. +    RW, +    // And the fields in this register. +    Fields [ +        On    WIDTH(U1) OFFSET(U0), +        Dead  WIDTH(U1) OFFSET(U1), +        Color WIDTH(U3) OFFSET(U2) [ +            Red    = U1, +            Blue   = U2, +            Green  = U3, +            Yellow = U4 +        ] +    ] +} +``` + +From this, you can generate register and field types like the previous example where the indices—the **Width**, **Mask**, and **Offset**—are derived from the values input in the **WIDTH** and **OFFSET** sections of a field's definition. Also, notice that all of these numbers are **typenums**; they're going to go directly into your **Field** definitions! + +The generated code provides namespaces for registers and their associated fields through the name given for the register and the fields. That's a mouthful; here's what it looks like: + + +``` +mod Status { +    struct Register(u8); +    mod On { +        struct Field; // There is of course more to this definition +    } +    mod Dead { +        struct Field; +    } +    mod Color { +        struct Field; +        pub const Red: Field = Field::<U1>new(); +        // &c. +    } +} +``` + +The generated API contains the nominally expected read and write primitives to get at the raw register value, but it also has ways to get a single field's value, do collective actions, and find out if any (or all) of a collection of bits is set. You can read the documentation on the [complete generated API][9]. + +### Kicking the tires + +What does it look like to use these definitions for a real device? Will the code be littered with type parameters, obscuring any real logic from view? + +No! By using type synonyms and type inference, you effectively never have to think about the type-level part of the program at all. You get to interact with the hardware in a straightforward way and get those bounds-related assurances automatically. + +Here's an example of a [UART][10] register block. I'll skip the declaration of the registers themselves, as that would be too much to include here. Instead, it starts with a register "block" then helps the compiler know how to look up the registers from a pointer to the head of the block. We do that by implementing **Deref** and **DerefMut**: + + +``` +#[repr(C)] +pub struct UartBlock { +    rx: UartRX::Register, +    _padding1: [u32; 15], +    tx: UartTX::Register, +    _padding2: [u32; 15], +    control1: UartControl1::Register, +} + +pub struct Regs { +    addr: usize, +} + +impl Deref for Regs { +    type Target = UartBlock; + +    fn deref(&self) -> &UartBlock { +        unsafe { &*(self.addr as *const UartBlock) } +    } +} + +impl DerefMut for Regs { +    fn deref_mut(&mut self) -> &mut UartBlock { +        unsafe { &mut *(self.addr as *mut UartBlock) } +    } +} +``` + +Once this is in place, using these registers is as simple as **read()** and **modify()**: + + +``` +fn main() { +    // A pretend register block. +    let mut x = [0_u32; 33]; + +    let mut regs = Regs { +        // Some shenanigans to get at `x` as though it were a +        // pointer. Normally you'd be given some address like +        // `0xDEADBEEF` over which you'd instantiate a `Regs`. +        addr: &mut x as *mut [u32; 33] as usize, +    }; + +    assert_eq!(regs.rx.read(), 0); + +    regs.control1 +        .modify(UartControl1::Enable::Set + UartControl1::RecvReadyInterrupt::Set); + +    // The first bit and the 10th bit should be set. +    assert_eq!(regs.control1.read(), 0b_10_0000_0001); +} +``` + +When we're working with runtime values we use **Option** like we saw earlier. Here I'm using **unwrap**, but in a real program with unknown inputs, you'd probably want to check that you got a **Some** back from that new call:[1][11],[2][12] + + +``` +fn main() { +    // A pretend register block. +    let mut x = [0_u32; 33]; + +    let mut regs = Regs { +        // Some shenanigans to get at `x` as though it were a +        // pointer. Normally you'd be given some address like +        // `0xDEADBEEF` over which you'd instantiate a `Regs`. +        addr: &mut x as *mut [u32; 33] as usize, +    }; + +    let input = regs.rx.get_field(UartRX::Data::Field::Read).unwrap(); +    regs.tx.modify(UartTX::Data::Field::new(input).unwrap()); +} +``` + +### Decoding failure conditions + +Depending on your personal pain threshold, you may have noticed that the errors are nearly unintelligible. Take a look at a not-so-subtle reminder of what I'm talking about: + + +``` +error[E0271]: type mismatch resolving `<typenum::UInt<typenum::UInt<typenum::UInt<typenum::UInt<typenum::UInt<typenum::UTerm, typenum::B1>, typenum::B0>, typenum::B1>, typenum::B0>, typenum::B0> as typenum::IsLessOrEqual<typenum::UInt<typenum::UInt<typenum::UInt<typenum::UInt<typenum::UTerm, typenum::B1>, typenum::B0>, typenum::B1>, typenum::B0>>>::Output == typenum::B1` +  --> src/main.rs:12:5 +   | +12 |     less_than_ten::<U20>(); +   |     ^^^^^^^^^^^^^^^^^^^^ expected struct `typenum::B0`, found struct `typenum::B1` +   | +   = note: expected type `typenum::B0` +       found type `typenum::B1` +``` + +The **expected typenum::B0 found typenum::B1** part kind of makes sense, but what on earth is the **typenum::UInt<typenum::UInt, typenum::UInt…** nonsense? Well, **typenum** represents numbers as binary [cons][13] cells! Errors like this make it hard, especially when you have several of these type-level numbers confined to tight quarters, to know which number it's talking about. Unless, of course, it's second nature for you to translate baroque binary representations to decimal ones. + +After the **U100**th time attempting to decipher any meaning from this mess, a teammate got Mad As Hell And Wasn't Going To Take It Anymore and made a little utility, **tnfilt**, to parse the meaning out from the misery that is namespaced binary cons cells. **tnfilt** takes the cons cell-style notation and replaces it with sensible decimal numbers. We imagine that others will face similar difficulties, so we shared [**tnfilt**][14]. You can use it like this: + + +``` +`$ cargo build 2>&1 | tnfilt` +``` + +It transforms the output above into something like this: + + +``` +`error[E0271]: type mismatch resolving `>::Output == typenum::B1`` +``` + +Now _that_ makes sense! + +### In conclusion + +Memory-mapped registers are used ubiquitously when interacting with hardware from software, and there are myriad ways to portray those interactions, each of which has a different place on the spectra of ease-of-use and safety. We found that the use of type-level programming to get compile-time checking on memory-mapped register interactions gave us the necessary information to make safer software. That code is available in the **[bounded-registers][15] crate** (Rust package). + +Our team started out right at the edge of the more-safe side of that safety spectrum and then tried to figure out how to move the ease-of-use slider closer to the easy end. From those ambitions, **bounded-registers** was born, and we use it anytime we encounter memory-mapped devices in our adventures at Auxon. + +* * * + + 1. Technically, a read from a register field, by definition, will only give a value within the prescribed bounds, but none of us lives in a pure world, and you never know what's going to happen when external systems come into play. You're at the behest of the Hardware Gods here, so instead of forcing you into a "might panic" situation, it gives you the **Option** to handle a "This Should Never Happen" case. + + 2. **get_field** looks a little weird. I'm looking at the **Field::Read** part, specifically. **Field** is a type, and you need an instance of that type to pass to **get_field**. A cleaner API might be something like: + + +``` +`regs.rx.get_field::();` +``` + +But remember that **Field** is a type synonym that has fixed indices for width, offset, etc. To be able to parameterize **get_field** like this, you'd need higher-kinded types. + + + + +* * * + +_This originally appeared on the [Auxon Engineering blog][16] and is edited and republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/c-vs-rust-abstractions + +作者:[Dan Pittman][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dan-pittman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_hardware_purple.png?itok=3NdVoYhl (Tools illustration) +[2]: https://cs-fundamentals.com/c-programming/history-of-c-programming-language.php +[3]: https://www.w3schools.in/c-tutorial/history-of-c/ +[4]: https://www.rust-lang.org/ +[5]: https://en.wikipedia.org/wiki/Rust_(programming_language) +[6]: https://docs.rs/crate/typenum +[7]: https://docs.rs/tock-registers/0.3.0/tock_registers/ +[8]: https://en.wikipedia.org/wiki/Enumerated_type +[9]: https://github.com/auxoncorp/bounded-registers#the-register-api +[10]: https://en.wikipedia.org/wiki/Universal_asynchronous_receiver-transmitter +[11]: tmp.shpxgDsodx#1 +[12]: tmp.shpxgDsodx#2 +[13]: https://en.wikipedia.org/wiki/Cons +[14]: https://github.com/auxoncorp/tnfilt +[15]: https://crates.io/crates/bounded-registers +[16]: https://blog.auxon.io/2019/10/25/type-level-registers/ From 781008b82c9500bfc398c01cb4fa8c3a369a8570 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Jan 2020 01:00:57 +0800 Subject: [PATCH 400/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200117=20Lockin?= =?UTF-8?q?g=20and=20unlocking=20accounts=20on=20Linux=20systems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200117 Locking and unlocking accounts on Linux systems.md --- ...and unlocking accounts on Linux systems.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/tech/20200117 Locking and unlocking accounts on Linux systems.md diff --git a/sources/tech/20200117 Locking and unlocking accounts on Linux systems.md b/sources/tech/20200117 Locking and unlocking accounts on Linux systems.md new file mode 100644 index 0000000000..c1cb3a7be1 --- /dev/null +++ b/sources/tech/20200117 Locking and unlocking accounts on Linux systems.md @@ -0,0 +1,118 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Locking and unlocking accounts on Linux systems) +[#]: via: (https://www.networkworld.com/article/3513982/locking-and-unlocking-accounts-on-linux-systems.html) +[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/) + +Locking and unlocking accounts on Linux systems +====== +There are times when locking a Linux user account is necessary and times when you need to reverse that action. Here are commands for managing account access and what's behind them. +SQBack / Getty Images + +If you are administering a [Linux][1] system, there will likely be times that you need to lock an account. Maybe someone is changing positions and their continued need for the account is under question; maybe there’s reason to believe that access to the account has been compromised. In any event, knowing how to lock an account and how to unlock it should it be needed again is something you need to be able to do. + +One important thing to keep in mind is that there are multiple ways to lock an account, and they don't all have the same effect. If the account user is accessing an account using public/private keys instead of a password, some commands you might use to block access to an account will not be effective. + +### Locking an account using the passwd command + +One of the simplest ways to lock an account is with the **passwd -l** command. For example: + +[][2] + +BrandPost Sponsored by HPE + +[Take the Intelligent Route with Consumption-Based Storage][2] + +Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. + +``` +$ sudo passwd -l tadpole +``` + +The effect of this command is to insert an exclamation point as the first character in the encrypted password field in the /etc/shadow file. This is enough to keep the password from working. What previously looked like this (note the first character): + +``` +$6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPCnXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7::: +``` + +will look like this: + +``` +!$6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPCnXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7::: +``` + +On his next login attempt (should there be one), tadpole would probably try his password numerous times and not gain access. You, on the other hand, would be able to check the status of his account with a command like this (-S = status): + +``` +$ sudo passwd -S tadpole +tadpole L 10/15/2019 0 99999 7 -1 +``` + +The "L" in the second field tells you that the account is locked. Before the account was locked, it would have been a "P". An "NP" would mean that no password was set. + +**[ Two-Minute Linux Tips: [Learn how to master a host of Linux commands in these 2-minute video tutorials][3] ]** + +The **usermod -L** command would have the same effect (inserting the exclamation character to disable use of the password). + +One of the benefits of locking an account in this way is that it's very easy to unlock the account when and if needed. Just reverse the change by removing the added exclamation point with a text editor or, better yet, by using the **passwd -u** command. + +``` +$ sudo passwd -u tadpole +passwd: password expiry information changed. +``` + +The problem with this approach is that, if the user is accessing his or her account with public/private keys, this change will not block their use. + +### Locking accounts with the chage command + +Another way to lock a user account is to the the **chage** command that helps manage account expiration dates. + +``` +$ sudu chage -E0 tadpole +$ sudo passwd -S tadpole +tadpole P 10/15/2019 0 99999 7 -1 +``` + +The **chage** command is going to make a subtle change to the /etc/shadow file. The eighth field in that colon-separated file (shown below) will be set to zero (previously empty) and this means the account is essentially expired. The **chage** command tracks the number of days between password changes, but also provides account expiration information when this option is used. A zero in the eiighth field would mean that the account expires a day after January 1, 1970, but also simply locks it when a command like that shown above is used. + +``` +$ sudo grep tadpole /etc/shadow | fold +tadpole:$6$IC6icrWlNhndMFj6$Jj14Regv3b2EdK.8iLjSeO893fFig75f32rpWpbKPNz7g/eqeaPC +nXl3iQ7RFIN0BGC0E91sghFdX2eWTe2ET0:18184:0:99999:7::0: + ^ + | + +--- days until expiration +``` + +To reverse this change, you can simply remove the 0 that was placed in the /etc/shadow entry for the user with a command like this: + +``` +% sudo chage -E-1 tadpole +``` + +Once an account is expired in this way, even passwordless [SSH][4] will not provide access. + +Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind. + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3513982/locking-and-unlocking-accounts-on-linux-systems.html + +作者:[Sandra Henry-Stocker][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/ +[b]: https://github.com/lujun9972 +[1]: https://www.networkworld.com/article/3215226/what-is-linux-uses-featres-products-operating-systems.html +[2]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) +[3]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua +[4]: https://www.networkworld.com/article/3441777/how-the-linux-screen-tool-can-save-your-tasks-and-your-sanity-if-ssh-is-interrupted.html +[5]: https://www.facebook.com/NetworkWorld/ +[6]: https://www.linkedin.com/company/network-world From 2234eb35ff0c53a48acc2b65843d97fbe27b7493 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 12:35:15 +0800 Subject: [PATCH 401/430] PRF @geekpi --- ... across multiple devices with Syncthing.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/translated/tech/20200111 Sync files across multiple devices with Syncthing.md b/translated/tech/20200111 Sync files across multiple devices with Syncthing.md index e4bc076533..2243ad50cd 100644 --- a/translated/tech/20200111 Sync files across multiple devices with Syncthing.md +++ b/translated/tech/20200111 Sync files across multiple devices with Syncthing.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Sync files across multiple devices with Syncthing) @@ -9,14 +9,16 @@ 使用 Syncthing 在多个设备间同步文件 ====== -2020 年,在我们的 20 个使用开源提升生产力的系列文章中,首先了解如何使用 Syncthing 同步文件。 -![Files in a folder][1] + +> 2020 年,在我们的 20 个使用开源提升生产力的系列文章中,首先了解如何使用 Syncthing 同步文件。 + +![](https://img.linux.net.cn/data/attachment/album/202001/18/123416rebvs7sjwm6c889y.jpg) 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 ### 使用 Synthing 同步文件 -置新机器很麻烦。我们都有在机器之间复制的“标准设置”。多年来,我使用了很多方法来使它们在计算机之间同步。在过去(这会告诉你我年纪有多大了),曾经是软盘、然后是 Zip 磁盘、U 盘、SCP、Rsync、Dropbox、ownCloud,你想到的都试过。但这些似乎对我都不够好。 +设置新机器很麻烦。我们都有在机器之间复制的“标准设置”。多年来,我使用了很多方法来使它们在计算机之间同步。在过去(这会告诉你我年纪有多大了),曾经是软盘、然后是 Zip 磁盘、U 盘、SCP、Rsync、Dropbox、ownCloud,你想到的都试过。但这些似乎对我都不够好。 然后我偶然发现了 [Syncthing][2]。 @@ -28,19 +30,19 @@ Syncthing 可在 Linux、MacOS、Windows 和多种 BSD 中使用。还有一个 ![Installing Syncthing on Ubuntu][4] -首次启动 Syncthing 时,它将启动 Web 浏览器以配置守护程序。第一台计算机上没有太多要做,但是这是一个很好的机会来介绍一下用户界面 (UI)。最重要的是在右上方的 **Actions** 菜单下的 “System ID”。 +首次启动 Syncthing 时,它将启动 Web 浏览器以配置守护程序。第一台计算机上没有太多要做,但是这是一个很好的机会来介绍一下用户界面 (UI)。最重要的是在右上方的 “Actions” 菜单下的 “System ID”。 ![Machine ID][5] -设置第一台计算机后,请在第二台计算机上重复安装。在 UI 中,右下方将显示一个按钮,名为 **Add Remote Device**。单击按钮,你将会看到一个要求输入**设备 ID 和设备名**的框。从第一台计算机上复制并粘贴**设备 ID**,然后单击 **Save**。 +设置第一台计算机后,请在第二台计算机上重复安装。在 UI 中,右下方将显示一个按钮,名为 “Add Remote Device”。单击该按钮,你将会看到一个要求输入 “Device ID and a Name” 的框。从第一台计算机上复制并粘贴 “Device ID”,然后单击 “Save”。 -你应该会在第一台上看到一个请求添加第二台的弹出窗口。接受后,新机器将显示在第一台机器的右下角。与第二台计算机共享默认目录。单击 **Default Folder**,然后单击 **Edit** 按钮。弹出窗口的顶部有四个链接。单击 **Sharing**,然后选择第二台计算机。单击 **Save**,然后查看第二台计算机。你会看到一个接受共享目录的提示。接受后,它将开始在两台计算机之间同步文件。 +你应该会在第一台上看到一个请求添加第二台的弹出窗口。接受后,新机器将显示在第一台机器的右下角。与第二台计算机共享默认目录。单击 “Default Folder”,然后单击 “Edit” 按钮。弹出窗口的顶部有四个链接。单击 “Sharing”,然后选择第二台计算机。单击 “Save”,然后查看第二台计算机。你会看到一个接受共享目录的提示。接受后,它将开始在两台计算机之间同步文件。 ![Sharing a directory in Syncthing][6] -测试从一台计算机上复制文件到默认目录(**/your/home/Share**)。它应该很快会在另一台上出现。 +测试从一台计算机上复制文件到默认目录(“/你的家目录/Share”)。它应该很快会在另一台上出现。 -你可以根据需要添加任意数量的目录,这非常方便。如你在第一张图中所看到的,我有一个用于保存配置的 **myconfigs** 文件夹。当我买了一台新机器时,我只需安装 Syncthing,如果我在一台机器上调整了配置,我不必更新所有,它会自动更新。 +你可以根据需要添加任意数量的目录,这非常方便。如你在第一张图中所看到的,我有一个用于保存配置的 `myconfigs` 文件夹。当我买了一台新机器时,我只需安装 Syncthing,如果我在一台机器上调整了配置,我不必更新所有,它会自动更新。 -------------------------------------------------------------------------------- @@ -49,7 +51,7 @@ via: https://opensource.com/article/20/1/sync-files-syncthing 作者:[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 ef8e0ebf7a2b749fd3e47ef75bc1b5d4bb5e1be5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 12:36:06 +0800 Subject: [PATCH 402/430] PUB @geekpi https://linux.cn/article-11793-1.html --- ...00111 Sync files across multiple devices with Syncthing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200111 Sync files across multiple devices with Syncthing.md (98%) diff --git a/translated/tech/20200111 Sync files across multiple devices with Syncthing.md b/published/20200111 Sync files across multiple devices with Syncthing.md similarity index 98% rename from translated/tech/20200111 Sync files across multiple devices with Syncthing.md rename to published/20200111 Sync files across multiple devices with Syncthing.md index 2243ad50cd..65959e3d59 100644 --- a/translated/tech/20200111 Sync files across multiple devices with Syncthing.md +++ b/published/20200111 Sync files across multiple devices with Syncthing.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11793-1.html) [#]: subject: (Sync files across multiple devices with Syncthing) [#]: via: (https://opensource.com/article/20/1/sync-files-syncthing) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From 446be1c237a9e0e5ea44f880ad023d0e635c4fb9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 18 Jan 2020 12:36:58 +0800 Subject: [PATCH 403/430] Rename sources/tech/20200116 4 core skills to level-up your tech career in 2020.md to sources/talk/20200116 4 core skills to level-up your tech career in 2020.md --- ...20200116 4 core skills to level-up your tech career in 2020.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200116 4 core skills to level-up your tech career in 2020.md (100%) diff --git a/sources/tech/20200116 4 core skills to level-up your tech career in 2020.md b/sources/talk/20200116 4 core skills to level-up your tech career in 2020.md similarity index 100% rename from sources/tech/20200116 4 core skills to level-up your tech career in 2020.md rename to sources/talk/20200116 4 core skills to level-up your tech career in 2020.md From 3e3dad7524c140fa74a7f572b71412701cc35b9e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 18 Jan 2020 12:38:46 +0800 Subject: [PATCH 404/430] Rename sources/talk/20200116 It-s the end for Windows Server 2008 support.md to sources/news/20200116 It-s the end for Windows Server 2008 support.md --- .../20200116 It-s the end for Windows Server 2008 support.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{talk => news}/20200116 It-s the end for Windows Server 2008 support.md (100%) diff --git a/sources/talk/20200116 It-s the end for Windows Server 2008 support.md b/sources/news/20200116 It-s the end for Windows Server 2008 support.md similarity index 100% rename from sources/talk/20200116 It-s the end for Windows Server 2008 support.md rename to sources/news/20200116 It-s the end for Windows Server 2008 support.md From 15d6a8a8ad27a9019abeccbb61c433435576f1c4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 18 Jan 2020 13:00:32 +0800 Subject: [PATCH 405/430] Rename sources/tech/20200117 Fedora CoreOS out of preview.md to sources/news/20200117 Fedora CoreOS out of preview.md --- sources/{tech => news}/20200117 Fedora CoreOS out of preview.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200117 Fedora CoreOS out of preview.md (100%) diff --git a/sources/tech/20200117 Fedora CoreOS out of preview.md b/sources/news/20200117 Fedora CoreOS out of preview.md similarity index 100% rename from sources/tech/20200117 Fedora CoreOS out of preview.md rename to sources/news/20200117 Fedora CoreOS out of preview.md From bd087a133ae0d631f277f5074940ce5fc4e0f2a5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 13:21:23 +0800 Subject: [PATCH 406/430] PRF @wxy --- .../tech/20190406 Run a server with Git.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/translated/tech/20190406 Run a server with Git.md b/translated/tech/20190406 Run a server with Git.md index c52295591e..6757473b58 100644 --- a/translated/tech/20190406 Run a server with Git.md +++ b/translated/tech/20190406 Run a server with Git.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Run a server with Git) @@ -10,37 +10,37 @@ 使用 Git 来管理 Git 服务器 ====== -> 借助 Gitolite,你可以使用 Git 来管理 Git 服务器。在我们的系列中了解这些鲜为人知的 Git 用途。 +> 借助 Gitolite,你可以使用 Git 来管理 Git 服务器。在我们的系列文章中了解这些鲜为人知的 Git 用途。 -![computer servers processing data][1] +![](https://img.linux.net.cn/data/attachment/album/202001/18/132045yrr1pb9n497tfbiy.png) -正如我在系列文章中演示的那样,[Git][2] 除了跟踪源代码外,还可以做很多事情。信不信由你,Git 甚至可以管理你的 Git 服务器,因此你可以或多或少地使用 Git 本身运行 Git 服务器。 +正如我在系列文章中演示的那样,[Git][2] 除了跟踪源代码外,还可以做很多事情。信不信由你,Git 甚至可以管理你的 Git 服务器,因此你可以或多或少地使用 Git 本身来运行 Git 服务器。 -当然,这涉及除日常使用 Git 之外的许多组件,其中最重要的是 [Gitolite][3],该后端应用程序可以管理你使用 Git 的每个细小的配置。Gitolite 的优点在于,由于它使用 Git 作为其前端接口,因此很容易将 Git 服务器管理集成到其他基于 Git 的工作流中。Gitolite 可以精确控制谁可以访问你服务器上的特定存储库以及他们具有哪些权限。你可以使用常规的 Linux 系统工具自行管理此类事务,但是如果在六个用户中只有一个或两个以上的仓库,则需要大量的工作。 +当然,这涉及除日常使用 Git 之外的许多组件,其中最重要的是 [Gitolite][3],该后端应用程序可以管理你使用 Git 的每个细微的配置。Gitolite 的优点在于,由于它使用 Git 作为其前端接口,因此很容易将 Git 服务器管理集成到其他基于 Git 的工作流中。Gitolite 可以精确控制谁可以访问你服务器上的特定存储库以及他们具有哪些权限。你可以使用常规的 Linux 系统工具自行管理此类事务,但是如果有好几个用户和不止一两个仓库,则需要大量的工作。 Gitolite 的开发人员做了艰苦的工作,使你可以轻松地为许多用户提供对你的 Git 服务器的访问权,而又不让他们访问你的整个环境 —— 而这一切,你可以使用 Git 来完成全部工作。 -Gitolite 并`不是` 图形化的管理员和用户面板。优秀的 [Gitea][4] 项目可提供这种经验,但是本文重点介绍 Gitolite 的简单优雅和令人舒适的熟悉感。 +Gitolite 并**不是**图形化的管理员和用户面板。优秀的 [Gitea][4] 项目可提供这种体验,但是本文重点介绍 Gitolite 的简单优雅和令人舒适的熟悉感。 ### 安装 Gitolite -假设你的 Git 服务器运行 Linux,则可以使用包管理器安装 Gitolite(在 CentOS 和 RHEL 上为 `yum`,在 Debian 和 Ubuntu 上为 `apt`,在 OpenSUSE 上为 `zypper` 等)。例如,在 RHEL 上: +假设你的 Git 服务器运行在 Linux 上,则可以使用包管理器安装 Gitolite(在 CentOS 和 RHEL 上为 `yum`,在 Debian 和 Ubuntu 上为 `apt`,在 OpenSUSE 上为 `zypper` 等)。例如,在 RHEL 上: ``` $ sudo yum install gitolite3 ``` -许多发行版的存储库仍提供的是旧版本的 Gitolite,但当前版本为版本 3。 +许多发行版的存储库提供的仍是旧版本的 Gitolite,但最新版本为版本 3。 你必须具有对服务器的无密码 SSH 访问权限。如果愿意,你可以使用密码登录服务器,但是 Gitolite 依赖于 SSH 密钥,因此必须配置使用密钥登录的选项。如果你不知道如何配置服务器以进行无密码 SSH 访问,请首先学习如何进行操作(Steve Ovens 的 Ansible 文章的[设置 SSH 密钥身份验证][5]部分对此进行了很好的说明)。这是加强服务器管理的安全以及运行 Gitolite 的重要组成部分。 ### 配置 Git 用户 -如果没有 Gitolite,则如果某人请求访问你在服务器上托管的 Git 存储库,则必须向该人提供用户帐户。Git 提供了一个特殊的外壳,即 `git-shell`,这是一个仅执行 Git 任务的特别特定的 shell。这可以让你有个只能通过非常受限的 Shell 环境的过滤器来访问服务器的用户。 +如果没有 Gitolite,则如果某人请求访问你在服务器上托管的 Git 存储库时,则必须向该人提供用户帐户。Git 提供了一个特殊的外壳,即 `git-shell`,这是一个仅执行 Git 任务的特别的特定 shell。这可以让你有个只能通过非常受限的 Shell 环境来过滤访问你的服务器的用户。 -该解决方案可行,但通常意味着用户可以访问服务器上的所有存储库,除非你具有用于组权限的良好模式,并在创建新存储库时严格保持这些权限。这种方式还需要在系统级别进行大量手动配置,这通常是为特定级别的系统管理员保留的区域,而不一定是通常负责 Git 存储库的人员。 +这个解决方案是一个办法,但通常意味着用户可以访问服务器上的所有存储库,除非你具有用于组权限的良好模式,并在创建新存储库时严格遵循这些权限。这种方式还需要在系统级别进行大量手动配置,这通常是只有特定级别的系统管理员才能做的工作,而不一定是通常负责 Git 存储库的人员。 -Gitolite 通过为需要访问任何存储库的每个人指定一个用户名来完全回避此问题。 默认情况下,用户名是 `git`,并且由于 Gitolite 的文档假定使用的是它,因此在学习该工具时保留它是一个很好的默认设置。对于曾经使用过 GitLab 或 GitHub 或任何其他 Git 托管服务的人来说,这也是一个众所周知的约定。 +Gitolite 通过为需要访问任何存储库的每个人指定一个用户名来完全回避此问题。默认情况下,该用户名是 `git`,并且由于 Gitolite 的文档中假定使用的是它,因此在学习该工具时保留它是一个很好的默认设置。对于曾经使用过 GitLab 或 GitHub 或任何其他 Git 托管服务的人来说,这也是一个众所周知的约定。 Gitolite 将此用户称为**托管用户**。在服务器上创建一个帐户以充当托管用户(我习惯使用 `git`,因为这是惯例): @@ -48,7 +48,7 @@ Gitolite 将此用户称为**托管用户**。在服务器上创建一个帐户 $ sudo adduser --create-home git ``` -为了控制该 `git` 用户帐户,该帐户必须具有属于你的有效 SSH 公钥。你应该已经进行了设置,因此复制你的公钥(**不是你的私钥**)添加到 `git` 用户的家目录中: +为了控制该 `git` 用户帐户,该帐户必须具有属于你的有效 SSH 公钥。你应该已经进行了设置,因此复制你的公钥(**而不是你的私钥**)添加到 `git` 用户的家目录中: ``` $ sudo cp ~/.ssh/id_ed25519.pub /home/git/ @@ -62,11 +62,11 @@ $ sudo su - git $ gitolite setup --pubkey id_ed25519.pub ``` -安装脚本运行后,`git` 的家用户目录将有一个 `repository` 目录,该目录(目前)包含文件 `git-admin.git` 和 `testing.git`。这就是该服务器所需的全部设置,现在请登出 `git` 用户。 +安装脚本运行后,`git` 的家用户目录将有一个 `repository` 目录,该目录(目前)包含存储库 `git-admin.git` 和 `testing.git`。这就是该服务器所需的全部设置,现在请登出 `git` 用户。 ### 使用 Gitolite -管理 Gitolite 就是编辑 Git 存储库中的文本文件,尤其是 `gitolite-admin.git`。你不会通过 SSH 进入服务器来进行 Git 管理,并且 Gitolite 也建议你不要这样尝试。你和你的用户存储在 Gitolite 服务器上的存储库是个**裸**存储库,因此最好不要使用它们。 +管理 Gitolite 就是编辑 Git 存储库中的文本文件,尤其是 `gitolite-admin.git` 中的。你不会通过 SSH 进入服务器来进行 Git 管理,并且 Gitolite 也建议你不要这样尝试。在 Gitolite 服务器上存储你和你的用户的存储库是个**裸**存储库,因此最好不要使用它们。 ``` $ git clone git@example.com:gitolite-admin.git gitolite-admin.git @@ -76,7 +76,7 @@ conf keydir ``` -该存储库中的 `conf` 目录包含一个名为 `gitolite.conf` 的文件。在文本编辑器中打开它,或使用`cat`查看其内容: +该存储库中的 `conf` 目录包含一个名为 `gitolite.conf` 的文件。在文本编辑器中打开它,或使用 `cat` 查看其内容: ``` repo gitolite-admin @@ -86,15 +86,15 @@ repo testing RW+ = @all ``` -你可能对该配置文件的功能有所了解:`gitolite-admin` 代表此存储库,并且 `id_ed25519` 密钥的所有者具有读取、写入和 Git 管理权限。换句话说,不是将用户映射到普通的本地 Unix 用户(因为所有用户都使用 `git` 用户托管用户身份),而是将用户映射到 `keydir` 目录中列出的 SSH 密钥。 +你可能对该配置文件的功能有所了解:`gitolite-admin` 代表此存储库,并且 `id_ed25519` 密钥的所有者具有读取、写入和管理 Git 的权限。换句话说,不是将用户映射到普通的本地 Unix 用户(因为所有用户都使用 `git` 用户托管用户身份),而是将用户映射到 `keydir` 目录中列出的 SSH 密钥。 `testing.git` 存储库使用特殊组符号为访问服务器的每个人提供了全部权限。 #### 添加用户 -如果要向 Git 服务器添加一个名为 `alice` 的用户,Alice 必须向你发送她的 SSH 公钥。Gitolite 使用 `.pub` 扩展名左边的任何内容作为该 Git 用户的标识符。不要使用默认的密钥名称值,而是给密钥指定一个指示密钥所有者的名称。如果用户有多个密钥(例如,一个用于笔记本电脑,一个用于台式机),则可以使用子目录来避免文件名冲突。例如,Alice 在笔记本电脑上使用的密钥可能是默认的 `id_rsa.pub`,因此将其重命名为`alice.pub` 或类似名称(或让用户根据其计算机上的本地用户帐户来命名密钥),然后将其放入 `gitolite-admin.git/keydir/work/laptop/` 目录中。如果她从她的桌面发送了另一个密钥,命名为 `alice.pub`(与上一个相同),然后将其添加到 `keydir/home/desktop/` 中。另一个密钥可能放到 `keydir/home/desktop/` 中,依此类推。Gitolite 递归地在 `keydir` 中搜索与存储库“用户”匹配的 `.pub` 文件,并将所有匹配项视为相同的身份。 +如果要向 Git 服务器添加一个名为 `alice` 的用户,Alice 必须向你发送她的 SSH 公钥。Gitolite 使用文件名的 `.pub` 扩展名左边的任何内容作为该 Git 用户的标识符。不要使用默认的密钥名称值,而是给密钥指定一个指示密钥所有者的名称。如果用户有多个密钥(例如,一个用于笔记本电脑,一个用于台式机),则可以使用子目录来避免文件名冲突。例如,Alice 在笔记本电脑上使用的密钥可能是默认的 `id_rsa.pub`,因此将其重命名为`alice.pub` 或类似名称(或让用户根据其计算机上的本地用户帐户来命名密钥),然后将其放入 `gitolite-admin.git/keydir/work/laptop/` 目录中。如果她从她的桌面计算机发送了另一个密钥,命名为 `alice.pub`(与上一个相同),然后将其添加到 `keydir/home/desktop/` 中。另一个密钥可能放到 `keydir/home/desktop/` 中,依此类推。Gitolite 递归地在 `keydir` 中搜索与存储库“用户”相匹配的 `.pub` 文件,并将所有匹配项视为相同的身份。 -当你将密钥添加到 `keydir` 目录时,必须将它们提交回服务器。这是一件很容易忘记的事情,这里有一个使用自动化的 Git 应用程序(例如 [Sparkleshare] [7])的真正的理由,因此任何更改都将立即提交给你的 Gitolite 管理员。第一次忘记提交和推送,在浪费了三个小时的时间以及用户的故障排除时间之后,你会发现 Gitolite 是使用 Sparkleshare 的完美理由。 +当你将密钥添加到 `keydir` 目录时,必须将它们提交回服务器。这是一件很容易忘记的事情,这里有一个使用自动化的 Git 应用程序(例如 [Sparkleshare][7])的真正的理由,因此任何更改都将立即提交给你的 Gitolite 管理员。第一次忘记提交和推送,在浪费了三个小时的你和你的用户的故障排除时间之后,你会发现 Gitolite 是使用 Sparkleshare 的完美理由。 ``` $ git add keydir @@ -106,10 +106,10 @@ $ git push origin HEAD #### 设置权限 -与用户一样,目录权限和组也是从你可能习惯的的常规 Unix 工具中抽象出来的(或可从在线信息查找)。在`gitolite-admin.git/conf` 目录中的 `gitolite.conf` 文件中授予对项目的权限。权限分为四个级别: +与用户一样,目录权限和组也是从你可能习惯的的常规 Unix 工具中抽象出来的(或可从在线信息查找)。在 `gitolite-admin.git/conf` 目录中的 `gitolite.conf` 文件中授予对项目的权限。权限分为四个级别: * `R` 允许只读。在存储库上具有 `R` 权限的用户可以克隆它,仅此而已。 -* `RW` 允许用户执行分支的快进推送、创建新分支和创建新标签。对于大多数用户来说,这个或多或少感觉就像一个“普通”的 Git 存储库。 +* `RW` 允许用户执行分支的快进推送、创建新分支和创建新标签。对于大多数用户来说,这个基本上就像是一个“普通”的 Git 存储库。 * `RW+` 允许可能具有破坏性的 Git 动作。用户可以执行常规的快进推送、回滚推送、变基以及删除分支和标签。你可能想要或不希望将其授予项目中的所有贡献者。 * `-` 明确拒绝访问存储库。这与未在存储库的配置中列出的用户相同。 @@ -126,7 +126,7 @@ repo widgets RW+ = alice ``` -现在,Alice(也仅 Alice 一个人)就可以克隆该存储库: +现在,Alice(也仅有 Alice 一个人)可以克隆该存储库: ``` [alice]$ git clone git@example.com:widgets.git @@ -188,7 +188,7 @@ repo foo/CREATOR/[a-z]..* R = READERS ``` -第一行定义了一组用户:该组称为 `@managers`,其中包含用户 `alice` 和 `bob`。下一行设置了通配符允许创建尚不存在的存储库,放在名为 `foo` 的目录下的创建存储库的用户名的子目录中。例如: +第一行定义了一组用户:该组称为 `@managers`,其中包含用户 `alice` 和 `bob`。下一行设置了通配符允许创建尚不存在的存储库,放在名为 `foo` 的目录下的创建该存储库的用户名的子目录中。例如: ``` [alice]$ git clone git@example.com:foo/alice/cool-app.git @@ -197,11 +197,11 @@ Initialized empty Git repository in /home/git/repositories/foo/alice/cool-app.gi warning: You appear to have cloned an empty repository. ``` -野生仓库的创建者可以使用一些机制来定义谁可以读取和写入其存储库,但是他们是被限定范围的。在大多数情况下,Gitolite 假定由一组特定的用户来管理项目权限。一种解决方案是使用 Git 挂钩授予所有用户对 `gitolite-admin` 的访问权限,以要求管理者批准将更改合并到 master 分支中。 +野生仓库的创建者可以使用一些机制来定义谁可以读取和写入其存储库,但是他们是有范围限定的。在大多数情况下,Gitolite 假定由一组特定的用户来管理项目权限。一种解决方案是使用 Git 挂钩来授予所有用户对 `gitolite-admin` 的访问权限,以要求管理者批准将更改合并到 master 分支中。 ### 了解更多 -Gitolite 具有比此介绍性文章涵盖的更多功能,因此请尝试一下。其[文档][8]非常出色,一旦你通读了它,就可以自定义 Gitolite 服务器,以向用户提供你喜欢的任何级别的控制。Gitolite 是一种维护成本低、简单的系统,你可以安装、设置它,然后基本上就可以将其忘却。 +Gitolite 具有比此介绍性文章所涵盖的更多功能,因此请尝试一下。其[文档][8]非常出色,一旦你通读了它,就可以自定义 Gitolite 服务器,以向用户提供你喜欢的任何级别的控制。Gitolite 是一种维护成本低、简单的系统,你可以安装、设置它,然后基本上就可以将其忘却。 -------------------------------------------------------------------------------- @@ -210,7 +210,7 @@ via: https://opensource.com/article/19/4/server-administration-git 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a6df20006ffebc44cc5259d41b245508297ec6e3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 13:22:03 +0800 Subject: [PATCH 407/430] PUB @wxy https://linux.cn/article-11795-1.html --- .../tech => published}/20190406 Run a server with Git.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190406 Run a server with Git.md (99%) diff --git a/translated/tech/20190406 Run a server with Git.md b/published/20190406 Run a server with Git.md similarity index 99% rename from translated/tech/20190406 Run a server with Git.md rename to published/20190406 Run a server with Git.md index 6757473b58..ee4497eb51 100644 --- a/translated/tech/20190406 Run a server with Git.md +++ b/published/20190406 Run a server with Git.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11795-1.html) [#]: subject: (Run a server with Git) [#]: via: (https://opensource.com/article/19/4/server-administration-git) [#]: author: (Seth Kenlon https://opensource.com/users/seth/users/seth) From e398777b8a662598fb7ebca0fbd17ea7f44704d4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 14:13:54 +0800 Subject: [PATCH 408/430] PRF @geekpi --- ...uration management of multiple machines.md | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/translated/tech/20200112 Use Stow for configuration management of multiple machines.md b/translated/tech/20200112 Use Stow for configuration management of multiple machines.md index 1a31d9728a..b5f2787038 100644 --- a/translated/tech/20200112 Use Stow for configuration management of multiple machines.md +++ b/translated/tech/20200112 Use Stow for configuration management of multiple machines.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Use Stow for configuration management of multiple machines) @@ -9,30 +9,31 @@ 使用 Stow 管理多台机器配置 ====== -2020 年,在我们的 20 个使用开源提升生产力的系列文章中,让我们了解如何使用 Stow 跨机器管理配置。 -![A person programming][1] +> 2020 年,在我们的 20 个使用开源提升生产力的系列文章中,让我们了解如何使用 Stow 跨机器管理配置。 + +![](https://img.linux.net.cn/data/attachment/album/202001/18/141330jdcjalqzjal84a03.jpg) 去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 ### 使用 Stow 管理符号链接 -昨天,我解释了如何使用 [Syncthing][2] 在多台计算机上保持文件同步。但是,这只是我用来保持配置一致性的工具之一。还有另一个简单的工具 [Stow][3]。 +昨天,我解释了如何使用 [Syncthing][2] 在多台计算机上保持文件同步。但是,这只是我用来保持配置一致性的工具之一。还有另一个表面上看起来更简单的工具:[Stow][3]。 ![Stow help screen][4] Stow 管理符号链接。默认情况下,它会链接目录到上一级目录。还有设置源和目标目录的选项,但我通常不使用它们。 -正如我在 Syncthing 的[文章][5] 中提到的,我使用 Syncthing 来保持 **myconfigs** 目录在我所有的计算机上一致。**myconfigs** 目录下面有多个子目录。每个子目录包含我经常使用的应用之一的配置文件。 +正如我在 Syncthing 的[文章][5] 中提到的,我使用 Syncthing 来保持 `myconfigs` 目录在我所有的计算机上一致。`myconfigs` 目录下面有多个子目录。每个子目录包含我经常使用的应用之一的配置文件。 ![myconfigs directory][6] -在每台计算机上,我进入 **myconfigs** 目录,并运行 **stow -S <目录名称>** 以将目录中的文件符号链接到我的家目录。例如,在**vim** 目录下,我有 **.vimrc** 和 **.vim** 目录。在每台机器上,我运行 **stow -S vim** 来创建符号链接 **~/.vimrc** 和 **~/.vim**。当我在一台计算机上更改 Vim 配置时,它会应用到我的所有机器上。 +在每台计算机上,我进入 `myconfigs` 目录,并运行 `stow -S <目录名称>` 以将目录中的文件符号链接到我的家目录。例如,在 `vim` 目录下,我有 `.vimrc` 和 `.vim` 目录。在每台机器上,我运行 `stow -S vim` 来创建符号链接 `~/.vimrc` 和 `~/.vim`。当我在一台计算机上更改 Vim 配置时,它会应用到我的所有机器上。 -然而,有时候,我需要一些特定于机器的配置,这就是为什么我有如 **msmtp-personal** 和 **msmtp-elastic**(我的雇主)这样的目录。由于我的 **msmtp** SMTP 客户端需要知道要中继的电子邮件服务器,并且每个服务器都有不同的设置和凭据,我会使用 **-D** 标志来取消链接,接着链接另外一个。 +然而,有时候,我需要一些特定于机器的配置,这就是为什么我有如 `msmtp-personal` 和 `msmtp-elastic`(我的雇主)这样的目录。由于我的 `msmtp` SMTP 客户端需要知道要中继电子邮件服务器,并且每个服务器都有不同的设置和凭据,我会使用 `-D` 标志来取消链接,接着链接另外一个。 ![Unstow one, stow the other][7] -有时我要给配置添加文件。为此,有一个 **-R** 选项来”重新链接“。例如,我喜欢在图形化 Vim 中使用一种与控制台不同的特定字体。除了标准 **.vimrc** 文件,**.gvimrc** 文件能让我设置特定于图形化版本的选项。当我第一次设置它时,我移动 **~/.gvimrc** 到 **~/myconfigs/vim** 中,然后运行 **stow -R vim**,它取消链接并重新链接该目录中的所有内容。 +有时我要给配置添加文件。为此,有一个 `-R` 选项来“重新链接”。例如,我喜欢在图形化 Vim 中使用一种与控制台不同的特定字体。除了标准 `.vimrc` 文件,`.gvimrc` 文件能让我设置特定于图形化版本的选项。当我第一次设置它时,我移动 `~/.gvimrc` 到 `~/myconfigs/vim` 中,然后运行 `stow -R vim`,它取消链接并重新链接该目录中的所有内容。 Stow 让我使用一个简单的命令行在多种配置之间切换,并且,结合 Syncthing,我可以确保无论我身在何处或在哪里进行更改,我都有我喜欢的工具的设置。 @@ -43,7 +44,7 @@ via: https://opensource.com/article/20/1/configuration-management-stow 作者:[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/) 荣誉推出 @@ -53,6 +54,6 @@ via: https://opensource.com/article/20/1/configuration-management-stow [2]: https://syncthing.net/ [3]: https://www.gnu.org/software/stow/ [4]: https://opensource.com/sites/default/files/uploads/productivity_2-1.png (Stow help screen) -[5]: https://opensource.com/article/20/1/20-productivity-tools-syncthing +[5]: https://linux.cn/article-11793-1.html [6]: https://opensource.com/sites/default/files/uploads/productivity_2-2.png (myconfigs directory) [7]: https://opensource.com/sites/default/files/uploads/productivity_2-3.png (Unstow one, stow the other) From cb49ce7ca75d28e0d1dd0b1b05d285bef9b2be41 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 14:15:01 +0800 Subject: [PATCH 409/430] PUB @geekpi https://linux.cn/article-11796-1.html --- ... Stow for configuration management of multiple machines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200112 Use Stow for configuration management of multiple machines.md (98%) diff --git a/translated/tech/20200112 Use Stow for configuration management of multiple machines.md b/published/20200112 Use Stow for configuration management of multiple machines.md similarity index 98% rename from translated/tech/20200112 Use Stow for configuration management of multiple machines.md rename to published/20200112 Use Stow for configuration management of multiple machines.md index b5f2787038..cf673d3e6b 100644 --- a/translated/tech/20200112 Use Stow for configuration management of multiple machines.md +++ b/published/20200112 Use Stow for configuration management of multiple machines.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11796-1.html) [#]: subject: (Use Stow for configuration management of multiple machines) [#]: via: (https://opensource.com/article/20/1/configuration-management-stow) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From 4ef0a6f655251fe0cb483c119544ce53e8e21154 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 21:34:11 +0800 Subject: [PATCH 410/430] APL --- sources/tech/20200115 6 handy Bash scripts for Git.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200115 6 handy Bash scripts for Git.md b/sources/tech/20200115 6 handy Bash scripts for Git.md index 03464a840b..2e6754c875 100644 --- a/sources/tech/20200115 6 handy Bash scripts for Git.md +++ b/sources/tech/20200115 6 handy Bash scripts for Git.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8263ccb879a268addb36401e1be9fe6d4c52266c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 21:58:30 +0800 Subject: [PATCH 411/430] TSL --- .../20200115 6 handy Bash scripts for Git.md | 524 ------------------ .../20200115 6 handy Bash scripts for Git.md | 510 +++++++++++++++++ 2 files changed, 510 insertions(+), 524 deletions(-) delete mode 100644 sources/tech/20200115 6 handy Bash scripts for Git.md create mode 100644 translated/tech/20200115 6 handy Bash scripts for Git.md diff --git a/sources/tech/20200115 6 handy Bash scripts for Git.md b/sources/tech/20200115 6 handy Bash scripts for Git.md deleted file mode 100644 index 2e6754c875..0000000000 --- a/sources/tech/20200115 6 handy Bash scripts for Git.md +++ /dev/null @@ -1,524 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (6 handy Bash scripts for Git) -[#]: via: (https://opensource.com/article/20/1/bash-scripts-git) -[#]: author: (Bob Peterson https://opensource.com/users/bobpeterson) - -6 handy Bash scripts for Git -====== -These six Bash scripts will make your life easier when you're working -with Git repositories. -![Digital hand surrounding by objects, bike, light bulb, graphs][1] - -I wrote a bunch of Bash scripts that make my life easier when I'm working with Git repositories. Many of my colleagues say there's no need; that everything I need to do can be done with Git commands. While that may be true, I find the scripts infinitely more convenient than trying to figure out the appropriate Git command to do what I want. - -### 1\. gitlog - -**gitlog** prints an abbreviated list of current patches against the master version. It prints them from oldest to newest and shows the author and description, with **H** for **HEAD**, **^** for **HEAD^**, **2** for **HEAD~2,** and so forth. For example: - - -``` -$ gitlog -\-----------------------[ recovery25 ]----------------------- -(snip) -11 340d27a33895 Bob Peterson     gfs2: drain the ail2 list after io errors -10 9b3c4e6efb10 Bob Peterson     gfs2: clean up iopen glock mess in gfs2_create_inode - 9 d2e8c22be39b Bob Peterson     gfs2: Do proper error checking for go_sync family of glops - 8 9563e31f8bfd Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite - 7 ebac7a38036c Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing - 6 f703a3c27874 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency - 5 a3e86d2ef30e Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite - 4 da3c604755b0 Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite - 3 4525c2f5b46f Bob Peterson     Rafael Aquini's slab instrumentation - 2 a06a5b7dea02 Bob Peterson     GFS2: Add go_get_holdtime to gl_ops - ^ 8ba93c796d5c Bob Peterson     gfs2: introduce new function remaining_hold_time and use it in dq - H e8b5ff851bb9 Bob Peterson     gfs2: Allow rgrps to have a minimum hold time -``` - -If I want to see what patches are on a different branch, I can specify an alternate branch: - - -``` -`$ gitlog recovery24` -``` - -### 2\. gitlog.id - -**gitlog.id** just prints the patch SHA1 IDs: - - -``` -$ gitlog.id -\-----------------------[ recovery25 ]----------------------- -56908eeb6940 2ca4a6b628a1 fc64ad5d99fe 02031a00a251 f6f38da7dd18 d8546e8f0023 fc3cc1f98f6b 12c3e0cb3523 76cce178b134 6fc1dce3ab9c 1b681ab074ca 26fed8de719b 802ff51a5670 49f67a512d8c f04f20193bbb 5f6afe809d23 2030521dc70e dada79b3be94 9b19a1e08161 78a035041d3e f03da011cae2 0d2b2e068fcd 2449976aa133 57dfb5e12ccd 53abedfdcf72 6fbdda3474b3 49544a547188 187032f7a63c 6f75dae23d93 95fc2a261b00 ebfb14ded191 f653ee9e414a 0e2911cb8111 73968b76e2e3 8a3e4cb5e92c a5f2da803b5b 7c9ef68388ed 71ca19d0cba8 340d27a33895 9b3c4e6efb10 d2e8c22be39b 9563e31f8bfd ebac7a38036c f703a3c27874 a3e86d2ef30e da3c604755b0 4525c2f5b46f a06a5b7dea02 8ba93c796d5c e8b5ff851bb9 -``` - -Again, it assumes the current branch, but I can specify a different branch if I want. - -### 3\. gitlog.id2 - -**gitlog.id2** is the same as **gitlog.id** but without the branch line at the top. This is handy for cherry-picking all patches from one branch to the current branch: - - -``` -$ # create a new branch -$ git branch --track origin/master -$ # check out the new branch I just created -$ git checkout recovery26 -$ # cherry-pick all patches from the old branch to the new one -$ for i in `gitlog.id2 recovery25` ; do git cherry-pick $i ;done -``` - -### 4\. gitlog.grep - -**gitlog.grep** greps for a string within that collection of patches. For example, if I find a bug and want to fix the patch that has a reference to function **inode_go_sync**, I simply do: - - -``` -$ gitlog.grep inode_go_sync -\-----------------------[ recovery25 - 50 patches ]----------------------- -(snip) -11 340d27a33895 Bob Peterson     gfs2: drain the ail2 list after io errors -10 9b3c4e6efb10 Bob Peterson     gfs2: clean up iopen glock mess in gfs2_create_inode - 9 d2e8c22be39b Bob Peterson     gfs2: Do proper error checking for go_sync family of glops -152:-static void inode_go_sync(struct gfs2_glock *gl) -153:+static int inode_go_sync(struct gfs2_glock *gl) -163:@@ -296,6 +302,7 @@ static void inode_go_sync(struct gfs2_glock *gl) - 8 9563e31f8bfd Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite - 7 ebac7a38036c Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing - 6 f703a3c27874 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency - 5 a3e86d2ef30e Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite - 4 da3c604755b0 Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite - 3 4525c2f5b46f Bob Peterson     Rafael Aquini's slab instrumentation - 2 a06a5b7dea02 Bob Peterson     GFS2: Add go_get_holdtime to gl_ops - ^ 8ba93c796d5c Bob Peterson     gfs2: introduce new function remaining_hold_time and use it in dq - H e8b5ff851bb9 Bob Peterson     gfs2: Allow rgrps to have a minimum hold time -``` - -So, now I know that patch **HEAD~9** is the one that needs fixing. I use **git rebase -i HEAD~10** to edit patch 9, **git commit -a --amend**, then **git rebase --continue** to make the necessary adjustments. - -### 5\. gitbranchcmp3 - -**gitbranchcmp3** lets me compare my current branch to another branch, so I can compare older versions of patches to my newer versions and quickly see what's changed and what hasn't. It generates a compare script (that uses the KDE tool [Kompare][2], which works on GNOME3, as well) to compare the patches that aren't quite the same. If there are no differences other than line numbers, it prints **[SAME]**. If there are only comment differences, it prints **[same]** (in lower case). For example: - - -``` -$ gitbranchcmp3 recovery24 -Branch recovery24 has 47 patches -Branch recovery25 has 50 patches - -(snip) -38 87eb6901607a 340d27a33895 [same] gfs2: drain the ail2 list after io errors -39 90fefb577a26 9b3c4e6efb10 [same] gfs2: clean up iopen glock mess in gfs2_create_inode -40 ba3ae06b8b0e d2e8c22be39b [same] gfs2: Do proper error checking for go_sync family of glops -41 2ab662294329 9563e31f8bfd [SAME] gfs2: use page_offset in gfs2_page_mkwrite -42 0adc6d817b7a ebac7a38036c [SAME] gfs2: don't use buffer_heads in gfs2_allocate_page_backing -43 55ef1f8d0be8 f703a3c27874 [SAME] gfs2: Improve mmap write vs. punch_hole consistency -44 de57c2f72570 a3e86d2ef30e [SAME] gfs2: Multi-block allocations in gfs2_page_mkwrite -45 7c5305fbd68a da3c604755b0 [SAME] gfs2: Fix end-of-file handling in gfs2_page_mkwrite -46 162524005151 4525c2f5b46f [SAME] Rafael Aquini's slab instrumentation -47              a06a5b7dea02 [    ] GFS2: Add go_get_holdtime to gl_ops -48              8ba93c796d5c [    ] gfs2: introduce new function remaining_hold_time and use it in dq -49              e8b5ff851bb9 [    ] gfs2: Allow rgrps to have a minimum hold time - -Missing from recovery25: -The missing: -Compare script generated at: /tmp/compare_mismatches.sh -``` - -### 6\. gitlog.find - -Finally, I have **gitlog.find**, a script to help me identify where the upstream versions of my patches are and each patch's current status. It does this by matching the patch description. It also generates a compare script (again, using Kompare) to compare the current patch to the upstream counterpart: - - -``` -$ gitlog.find -\-----------------------[ recovery25 - 50 patches ]----------------------- -(snip) -11 340d27a33895 Bob Peterson     gfs2: drain the ail2 list after io errors -lo 5bcb9be74b2a Bob Peterson     gfs2: drain the ail2 list after io errors -10 9b3c4e6efb10 Bob Peterson     gfs2: clean up iopen glock mess in gfs2_create_inode -fn 2c47c1be51fb Bob Peterson     gfs2: clean up iopen glock mess in gfs2_create_inode - 9 d2e8c22be39b Bob Peterson     gfs2: Do proper error checking for go_sync family of glops -lo feb7ea639472 Bob Peterson     gfs2: Do proper error checking for go_sync family of glops - 8 9563e31f8bfd Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite -ms f3915f83e84c Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite - 7 ebac7a38036c Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing -ms 35af80aef99b Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing - 6 f703a3c27874 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency -fn 39c3a948ecf6 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency - 5 a3e86d2ef30e Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite -fn f53056c43063 Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite - 4 da3c604755b0 Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite -fn 184b4e60853d Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite - 3 4525c2f5b46f Bob Peterson     Rafael Aquini's slab instrumentation -   Not found upstream - 2 a06a5b7dea02 Bob Peterson     GFS2: Add go_get_holdtime to gl_ops -   Not found upstream - ^ 8ba93c796d5c Bob Peterson     gfs2: introduce new function remaining_hold_time and use it in dq -   Not found upstream - H e8b5ff851bb9 Bob Peterson     gfs2: Allow rgrps to have a minimum hold time -   Not found upstream -Compare script generated: /tmp/compare_upstream.sh -``` - -The patches are shown on two lines, the first of which is your current patch, followed by the corresponding upstream patch, and a 2-character abbreviation to indicate its upstream status: - - * **lo** means the patch is in the local upstream Git repo only (i.e., not pushed upstream yet). - * **ms** means the patch is in Linus Torvald's master branch. - * **fn** means the patch is pushed to my "for-next" development branch, intended for the next upstream merge window. - - - -Some of my scripts make assumptions based on how I normally work with Git. For example, when searching for upstream patches, it uses my well-known Git tree's location. So, you will need to adjust or improve them to suit your conditions. The **gitlog.find** script is designed to locate [GFS2][3] and [DLM][4] patches only, so unless you're a GFS2 developer, you will want to customize it to the components that interest you. - -### Source code - -Here is the source for these scripts. - -#### 1\. gitlog - - -``` -#!/bin/bash -branch=$1 - -if test "x$branch" = x; then -    branch=`git branch -a | grep "*" | cut -d ' ' -f2` -fi - -patches=0 -tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` - -LIST=`git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '` -for i in $LIST; do patches=$(echo $patches + 1 | bc);done - -if [[ $branch =~ .*for-next.* ]] -then -    start=HEAD -#    start=origin/for-next -else -    start=origin/master -fi - -tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` - -/usr/bin/echo "-----------------------[" $branch "]-----------------------" -patches=$(echo $patches - 1 | bc); -for i in $LIST; do -    if [ $patches -eq 1 ]; then -        cnt=" ^" -    elif [ $patches -eq 0 ]; then -        cnt=" H" -    else -        if [ $patches -lt 10 ]; then -            cnt=" $patches" -        else -            cnt="$patches" -        fi -    fi -    /usr/bin/git show --abbrev-commit -s --pretty=format:"$cnt %h %<|(32)%an %s %n" $i -    patches=$(echo $patches - 1 | bc) -done -#git log --reverse --abbrev-commit --pretty=format:"%h %<|(32)%an %s" $tracking..$branch -#git log --reverse --abbrev-commit --pretty=format:"%h %<|(32)%an %s" ^origin/master ^linux-gfs2/for-next $branch -``` - -#### 2\. gitlog.id - - -``` -#!/bin/bash -branch=$1 - -if test "x$branch" = x; then -    branch=`git branch -a | grep "*" | cut -d ' ' -f2` -fi - -tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` - -/usr/bin/echo "-----------------------[" $branch "]-----------------------" -git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' ' -``` - -#### 3\. gitlog.id2 - - -``` -#!/bin/bash -branch=$1 - -if test "x$branch" = x; then -    branch=`git branch -a | grep "*" | cut -d ' ' -f2` -fi - -tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` -git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' ' -``` - -#### 4\. gitlog.grep - - -``` -#!/bin/bash -param1=$1 -param2=$2 - -if test "x$param2" = x; then -    branch=`git branch -a | grep "*" | cut -d ' ' -f2` -    string=$param1 -else -    branch=$param1 -    string=$param2 -fi - -patches=0 -tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` - -LIST=`git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '` -for i in $LIST; do patches=$(echo $patches + 1 | bc);done -/usr/bin/echo "-----------------------[" $branch "-" $patches "patches ]-----------------------" -patches=$(echo $patches - 1 | bc); -for i in $LIST; do -    if [ $patches -eq 1 ]; then -        cnt=" ^" -    elif [ $patches -eq 0 ]; then -        cnt=" H" -    else -        if [ $patches -lt 10 ]; then -            cnt=" $patches" -        else -            cnt="$patches" -        fi -    fi -    /usr/bin/git show --abbrev-commit -s --pretty=format:"$cnt %h %<|(32)%an %s" $i -    /usr/bin/git show --pretty=email --patch-with-stat $i | grep -n "$string" -    patches=$(echo $patches - 1 | bc) -done -``` - -#### 5\. gitbranchcmp3 - - -``` -#!/bin/bash -# -# gitbranchcmp3 <old branch> [<new_branch>] -# -oldbranch=$1 -newbranch=$2 -script=/tmp/compare_mismatches.sh - -/usr/bin/rm -f $script -echo "#!/bin/bash" > $script -/usr/bin/chmod 755 $script -echo "# Generated by gitbranchcmp3.sh" >> $script -echo "# Run this script to compare the mismatched patches" >> $script -echo " " >> $script -echo "function compare_them()" >> $script -echo "{"  >> $script -echo "    git show --pretty=email --patch-with-stat \$1 > /tmp/gronk1" >> $script -echo "    git show --pretty=email --patch-with-stat \$2 > /tmp/gronk2" >> $script -echo "    kompare /tmp/gronk1 /tmp/gronk2" >> $script -echo "}" >> $script -echo " " >> $script - -if test "x$newbranch" = x; then -    newbranch=`git branch -a | grep "*" | cut -d ' ' -f2` -fi - -tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` - -declare -a oldsha1s=(`git log --reverse --abbrev-commit --pretty=oneline $tracking..$oldbranch | cut -d ' ' -f1 |paste -s -d ' '`) -declare -a newsha1s=(`git log --reverse --abbrev-commit --pretty=oneline $tracking..$newbranch | cut -d ' ' -f1 |paste -s -d ' '`) - -#echo "old: " $oldsha1s -oldcount=${#oldsha1s[@]} -echo "Branch $oldbranch has $oldcount patches" -oldcount=$(echo $oldcount - 1 | bc) -#for o in `seq 0 ${#oldsha1s[@]}`; do -#    echo -n ${oldsha1s[$o]} " " -#    desc=`git show $i | head -5 | tail -1|cut -b5-` -#done - -#echo "new: " $newsha1s -newcount=${#newsha1s[@]} -echo "Branch $newbranch has $newcount patches" -newcount=$(echo $newcount - 1 | bc) -#for o in `seq 0 ${#newsha1s[@]}`; do -#    echo -n ${newsha1s[$o]} " " -#    desc=`git show $i | head -5 | tail -1|cut -b5-` -#done -echo - -for new in `seq 0 $newcount`; do -    newsha=${newsha1s[$new]} -    newdesc=`git show $newsha | head -5 | tail -1|cut -b5-` -    oldsha="            " -    same="[    ]" -    for old in `seq 0 $oldcount`; do -        if test "${oldsha1s[$old]}" = "match"; then -            continue; -        fi -        olddesc=`git show ${oldsha1s[$old]} | head -5 | tail -1|cut -b5-` -        if test "$olddesc" = "$newdesc" ; then -            oldsha=${oldsha1s[$old]} -            #echo $oldsha -            git show $oldsha |tail -n +2 |grep -v "index.*\\.\\." |grep -v "@@" > /tmp/gronk1 -            git show $newsha |tail -n +2 |grep -v "index.*\\.\\." |grep -v "@@"  > /tmp/gronk2 -            diff /tmp/gronk1 /tmp/gronk2 &> /dev/null -            if [ $? -eq 0 ] ;then -# No differences -                same="[SAME]" -                oldsha1s[$old]="match" -                break -            fi -            git show $oldsha |sed -n '/diff/,$p' |grep -v "index.*\\.\\." |grep -v "@@" > /tmp/gronk1 -            git show $newsha |sed -n '/diff/,$p' |grep -v "index.*\\.\\." |grep -v "@@" > /tmp/gronk2 -            diff /tmp/gronk1 /tmp/gronk2 &> /dev/null -            if [ $? -eq 0 ] ;then -# Differences in comments only -                same="[same]" -                oldsha1s[$old]="match" -                break -            fi -            oldsha1s[$old]="match" -            echo "compare_them $oldsha $newsha" >> $script -        fi -    done -    echo "$new $oldsha $newsha $same $newdesc" -done - -echo -echo "Missing from $newbranch:" -the_missing="" -# Now run through the olds we haven't matched up -for old in `seq 0 $oldcount`; do -    if test ${oldsha1s[$old]} != "match"; then -        olddesc=`git show ${oldsha1s[$old]} | head -5 | tail -1|cut -b5-` -        echo "${oldsha1s[$old]} $olddesc" -        the_missing=`echo "$the_missing ${oldsha1s[$old]}"` -    fi -done - -echo "The missing: " $the_missing -echo "Compare script generated at: $script" -#git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' ' -``` - -#### 6\. gitlog.find - - -``` -#!/bin/bash -# -# Find the upstream equivalent patch -# -# gitlog.find -# -cwd=$PWD -param1=$1 -ubranch=$2 -patches=0 -script=/tmp/compare_upstream.sh -echo "#!/bin/bash" > $script -/usr/bin/chmod 755 $script -echo "# Generated by gitbranchcmp3.sh" >> $script -echo "# Run this script to compare the mismatched patches" >> $script -echo " " >> $script -echo "function compare_them()" >> $script -echo "{"  >> $script -echo "    cwd=$PWD" >> $script -echo "    git show --pretty=email --patch-with-stat \$2 > /tmp/gronk2" >> $script -echo "    cd ~/linux.git/fs/gfs2" >> $script -echo "    git show --pretty=email --patch-with-stat \$1 > /tmp/gronk1" >> $script -echo "    cd $cwd" >> $script -echo "    kompare /tmp/gronk1 /tmp/gronk2" >> $script -echo "}" >> $script -echo " " >> $script - -#echo "Gathering upstream patch info. Please wait." -branch=`git branch -a | grep "*" | cut -d ' ' -f2` -tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` - -cd ~/linux.git -if test "X${ubranch}" = "X"; then -    ubranch=`git branch -a | grep "*" | cut -d ' ' -f2` -fi -utracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` -# -# gather a list of gfs2 patches from master just in case we can't find it -# -#git log --abbrev-commit --pretty=format:"   %h %<|(32)%an %s" master |grep -i -e "gfs2" -e "dlm" > /tmp/gronk -git log --reverse --abbrev-commit --pretty=format:"ms %h %<|(32)%an %s" master fs/gfs2/ > /tmp/gronk.gfs2 -# ms = in Linus's master -git log --reverse --abbrev-commit --pretty=format:"ms %h %<|(32)%an %s" master fs/dlm/ > /tmp/gronk.dlm - -cd $cwd -LIST=`git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '` -for i in $LIST; do patches=$(echo $patches + 1 | bc);done -/usr/bin/echo "-----------------------[" $branch "-" $patches "patches ]-----------------------" -patches=$(echo $patches - 1 | bc); -for i in $LIST; do -    if [ $patches -eq 1 ]; then -        cnt=" ^" -    elif [ $patches -eq 0 ]; then -        cnt=" H" -    else -        if [ $patches -lt 10 ]; then -            cnt=" $patches" -        else -            cnt="$patches" -        fi -    fi -    /usr/bin/git show --abbrev-commit -s --pretty=format:"$cnt %h %<|(32)%an %s" $i -    desc=`/usr/bin/git show --abbrev-commit -s --pretty=format:"%s" $i` -    cd ~/linux.git -    cmp=1 -    up_eq=`git log --reverse --abbrev-commit --pretty=format:"lo %h %<|(32)%an %s" $utracking..$ubranch | grep "$desc"` -# lo = in local for-next -    if test "X$up_eq" = "X"; then -        up_eq=`git log --reverse --abbrev-commit --pretty=format:"fn %h %<|(32)%an %s" master..$utracking | grep "$desc"` -# fn = in for-next for next merge window -        if test "X$up_eq" = "X"; then -            up_eq=`grep "$desc" /tmp/gronk.gfs2` -            if test "X$up_eq" = "X"; then -                up_eq=`grep "$desc" /tmp/gronk.dlm` -                if test "X$up_eq" = "X"; then -                    up_eq="   Not found upstream" -                    cmp=0 -                fi -            fi -        fi -    fi -    echo "$up_eq" -    if [ $cmp -eq 1 ] ; then -        UP_SHA1=`echo $up_eq|cut -d' ' -f2` -        echo "compare_them $UP_SHA1 $i" >> $script -    fi -    cd $cwd -    patches=$(echo $patches - 1 | bc) -done -echo "Compare script generated: $script" -``` - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/bash-scripts-git - -作者:[Bob Peterson][a] -选题:[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/bobpeterson -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolseriesk12_rh_021x_0.png?itok=fvorN0e- (Digital hand surrounding by objects, bike, light bulb, graphs) -[2]: https://kde.org/applications/development/org.kde.kompare -[3]: https://en.wikipedia.org/wiki/GFS2 -[4]: https://en.wikipedia.org/wiki/Distributed_lock_manager diff --git a/translated/tech/20200115 6 handy Bash scripts for Git.md b/translated/tech/20200115 6 handy Bash scripts for Git.md new file mode 100644 index 0000000000..93a0d97796 --- /dev/null +++ b/translated/tech/20200115 6 handy Bash scripts for Git.md @@ -0,0 +1,510 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (6 handy Bash scripts for Git) +[#]: via: (https://opensource.com/article/20/1/bash-scripts-git) +[#]: author: (Bob Peterson https://opensource.com/users/bobpeterson) + +6 个方便的 Git 脚本 +====== + +> 当使用 Git 存储库时,这六个 Bash 脚本将使你的生活更轻松。 + +![Digital hand surrounding by objects, bike, light bulb, graphs][1] + +我编写了许多 Bash 脚本,这些脚本使我在使用 Git 存储库时工作更加轻松。我的许多同事说没有必要;我所做的一切都可以用 Git 命令完成。虽然这可能是正确的,但我发现脚本远比尝试找出适当的 Git 命令来执行我想要的操作更加方便。 + +### 1、gitlog + +`gitlog` 打印针对 master 分支的当前补丁的简短列表。它从最旧到最新打印它们,并显示作者和描述,其中 `H` 代表 `HEAD`,`^` 代表 `HEAD^`,`2` 代表 `HEAD~2`,依此类推。例如: + +``` +$ gitlog +-----------------------[ recovery25 ]----------------------- +(snip) +11 340d27a33895 Bob Peterson gfs2: drain the ail2 list after io errors +10 9b3c4e6efb10 Bob Peterson gfs2: clean up iopen glock mess in gfs2_create_inode + 9 d2e8c22be39b Bob Peterson gfs2: Do proper error checking for go_sync family of glops + 8 9563e31f8bfd Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite + 7 ebac7a38036c Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing + 6 f703a3c27874 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency + 5 a3e86d2ef30e Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite + 4 da3c604755b0 Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite + 3 4525c2f5b46f Bob Peterson Rafael Aquini's slab instrumentation + 2 a06a5b7dea02 Bob Peterson GFS2: Add go_get_holdtime to gl_ops + ^ 8ba93c796d5c Bob Peterson gfs2: introduce new function remaining_hold_time and use it in dq + H e8b5ff851bb9 Bob Peterson gfs2: Allow rgrps to have a minimum hold time +``` + +如果我想查看其他分支上有哪些补丁,可以指定一个替代分支: + +``` +$ gitlog recovery24 +``` + +### 2、gitlog.id + +`gitlog.id` 只是打印出补丁的 SHA1 ID: + +``` +$ gitlog.id +-----------------------[ recovery25 ]----------------------- +56908eeb6940 2ca4a6b628a1 fc64ad5d99fe 02031a00a251 f6f38da7dd18 d8546e8f0023 fc3cc1f98f6b 12c3e0cb3523 76cce178b134 6fc1dce3ab9c 1b681ab074ca 26fed8de719b 802ff51a5670 49f67a512d8c f04f20193bbb 5f6afe809d23 2030521dc70e dada79b3be94 9b19a1e08161 78a035041d3e f03da011cae2 0d2b2e068fcd 2449976aa133 57dfb5e12ccd 53abedfdcf72 6fbdda3474b3 49544a547188 187032f7a63c 6f75dae23d93 95fc2a261b00 ebfb14ded191 f653ee9e414a 0e2911cb8111 73968b76e2e3 8a3e4cb5e92c a5f2da803b5b 7c9ef68388ed 71ca19d0cba8 340d27a33895 9b3c4e6efb10 d2e8c22be39b 9563e31f8bfd ebac7a38036c f703a3c27874 a3e86d2ef30e da3c604755b0 4525c2f5b46f a06a5b7dea02 8ba93c796d5c e8b5ff851bb9 +``` + +同样,它假定是当前分支,但是如果需要,我可以指定其他分支。 + +### 3、gitlog.id2 + +`gitlog.id2` 与 `gitlog.id` 相同,但顶部没有显示分支的行。这对于从一个分支挑选所有补丁到当前分支很方便: + +``` +$ # 创建一个新分支 +$ git branch --track origin/master +$ # 检出刚刚创建的新分支 +$ git checkout recovery26 +$ # 从旧的分支挑选所有补丁到新分支 +$ for i in `gitlog.id2 recovery25` ; do git cherry-pick $i ;done +``` + +### 4、gitlog.grep + +`gitlog.grep` 会在该补丁集合中寻找一个字符串。例如,如果我发现一个错误并想修复引用了函数 `inode_go_sync` 的补丁,我可以简单地执行以下操作: + +``` +$ gitlog.grep inode_go_sync +-----------------------[ recovery25 - 50 patches ]----------------------- +(snip) +11 340d27a33895 Bob Peterson gfs2: drain the ail2 list after io errors +10 9b3c4e6efb10 Bob Peterson gfs2: clean up iopen glock mess in gfs2_create_inode + 9 d2e8c22be39b Bob Peterson gfs2: Do proper error checking for go_sync family of glops +152:-static void inode_go_sync(struct gfs2_glock *gl) +153:+static int inode_go_sync(struct gfs2_glock *gl) +163:@@ -296,6 +302,7 @@ static void inode_go_sync(struct gfs2_glock *gl) + 8 9563e31f8bfd Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite + 7 ebac7a38036c Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing + 6 f703a3c27874 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency + 5 a3e86d2ef30e Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite + 4 da3c604755b0 Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite + 3 4525c2f5b46f Bob Peterson Rafael Aquini's slab instrumentation + 2 a06a5b7dea02 Bob Peterson GFS2: Add go_get_holdtime to gl_ops + ^ 8ba93c796d5c Bob Peterson gfs2: introduce new function remaining_hold_time and use it in dq + H e8b5ff851bb9 Bob Peterson gfs2: Allow rgrps to have a minimum hold time +``` + +因此,现在我知道补丁 `HEAD~9` 是需要修复的补丁。我使用 `git rebase -i HEAD~10` 编辑补丁 9,`git commit -a --amend`,然后 `git rebase --continue` 以进行必要的调整。 + +### 5、gitbranchcmp3 + +`gitbranchcmp3` 使我可以将当前分支与另一个分支进行比较,因此我可以将较旧版本的补丁与我的较新版本进行比较,并快速查看已更改和未更改的内容。它生成一个比较脚本(使用了 KDE 工具 [Kompare][2],该工具也可在 GNOME3 上使用)以比较不太相同的补丁。如果除行号外没有其他差异,则打印 `[SAME]`。如果仅存在注释差异,则打印 `[same]`(小写)。例如: + +``` +$ gitbranchcmp3 recovery24 +Branch recovery24 has 47 patches +Branch recovery25 has 50 patches + +(snip) +38 87eb6901607a 340d27a33895 [same] gfs2: drain the ail2 list after io errors +39 90fefb577a26 9b3c4e6efb10 [same] gfs2: clean up iopen glock mess in gfs2_create_inode +40 ba3ae06b8b0e d2e8c22be39b [same] gfs2: Do proper error checking for go_sync family of glops +41 2ab662294329 9563e31f8bfd [SAME] gfs2: use page_offset in gfs2_page_mkwrite +42 0adc6d817b7a ebac7a38036c [SAME] gfs2: don't use buffer_heads in gfs2_allocate_page_backing +43 55ef1f8d0be8 f703a3c27874 [SAME] gfs2: Improve mmap write vs. punch_hole consistency +44 de57c2f72570 a3e86d2ef30e [SAME] gfs2: Multi-block allocations in gfs2_page_mkwrite +45 7c5305fbd68a da3c604755b0 [SAME] gfs2: Fix end-of-file handling in gfs2_page_mkwrite +46 162524005151 4525c2f5b46f [SAME] Rafael Aquini's slab instrumentation +47 a06a5b7dea02 [ ] GFS2: Add go_get_holdtime to gl_ops +48 8ba93c796d5c [ ] gfs2: introduce new function remaining_hold_time and use it in dq +49 e8b5ff851bb9 [ ] gfs2: Allow rgrps to have a minimum hold time + +Missing from recovery25: +The missing: +Compare script generated at: /tmp/compare_mismatches.sh +``` + +### 6、gitlog.find + +最后,我有一个 `gitlog.find` 脚本,可以帮助我识别补丁程序的上游版本在哪里以及每个补丁程序的当前状态。它通过匹配补丁说明来实现。它还会生成一个比较脚本(再次使用了 Kompare),以将当前补丁与上游对应补丁进行比较: + +``` +$ gitlog.find +-----------------------[ recovery25 - 50 patches ]----------------------- +(snip) +11 340d27a33895 Bob Peterson gfs2: drain the ail2 list after io errors +lo 5bcb9be74b2a Bob Peterson gfs2: drain the ail2 list after io errors +10 9b3c4e6efb10 Bob Peterson gfs2: clean up iopen glock mess in gfs2_create_inode +fn 2c47c1be51fb Bob Peterson gfs2: clean up iopen glock mess in gfs2_create_inode + 9 d2e8c22be39b Bob Peterson gfs2: Do proper error checking for go_sync family of glops +lo feb7ea639472 Bob Peterson gfs2: Do proper error checking for go_sync family of glops + 8 9563e31f8bfd Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite +ms f3915f83e84c Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite + 7 ebac7a38036c Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing +ms 35af80aef99b Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing + 6 f703a3c27874 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency +fn 39c3a948ecf6 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency + 5 a3e86d2ef30e Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite +fn f53056c43063 Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite + 4 da3c604755b0 Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite +fn 184b4e60853d Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite + 3 4525c2f5b46f Bob Peterson Rafael Aquini's slab instrumentation + Not found upstream + 2 a06a5b7dea02 Bob Peterson GFS2: Add go_get_holdtime to gl_ops + Not found upstream + ^ 8ba93c796d5c Bob Peterson gfs2: introduce new function remaining_hold_time and use it in dq + Not found upstream + H e8b5ff851bb9 Bob Peterson gfs2: Allow rgrps to have a minimum hold time + Not found upstream +Compare script generated: /tmp/compare_upstream.sh +``` + +补丁显示为两行,第一行是你当前的修补程序,然后是相应的上游补丁,以及 2 个字符的缩写,以指示其上游状态: + +* `lo` 表示补丁仅在本地(`local`)上游 Git 存储库中(即尚未推送到上游)。 +* `ms` 表示补丁位于 Linus Torvald 的主(`master`)分支中。 +* `fn` 意味着补丁被推送到我的 “for-next” 开发分支,用于下一个上游合并窗口。 +   +我的一些脚本根据我通常使用 Git 的方式做出假设。例如,当搜索上游补丁时,它使用我众所周知的 Git 树的位置。因此,你需要调整或改进它们以适合你的条件。`gitlog.find` 脚本旨在仅定位 [GFS2][3] 和 [DLM][4] 补丁,因此,除非你是 GFS2 开发人员,否则你需要针对你感兴趣的组件对其进行自定义。 + +### 源代码 + +以下是这些脚本的源代码。 + +#### 1、gitlog + +``` +#!/bin/bash +branch=$1 + +if test "x$branch" = x; then + branch=`git branch -a | grep "*" | cut -d ' ' -f2` +fi + +patches=0 +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` + +LIST=`git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '` +for i in $LIST; do patches=$(echo $patches + 1 | bc);done + +if [[ $branch =~ .*for-next.* ]] +then + start=HEAD +# start=origin/for-next +else + start=origin/master +fi + +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` + +/usr/bin/echo "-----------------------[" $branch "]-----------------------" +patches=$(echo $patches - 1 | bc); +for i in $LIST; do + if [ $patches -eq 1 ]; then + cnt=" ^" + elif [ $patches -eq 0 ]; then + cnt=" H" + else + if [ $patches -lt 10 ]; then + cnt=" $patches" + else + cnt="$patches" + fi + fi + /usr/bin/git show --abbrev-commit -s --pretty=format:"$cnt %h %<|(32)%an %s %n" $i + patches=$(echo $patches - 1 | bc) +done +#git log --reverse --abbrev-commit --pretty=format:"%h %<|(32)%an %s" $tracking..$branch +#git log --reverse --abbrev-commit --pretty=format:"%h %<|(32)%an %s" ^origin/master ^linux-gfs2/for-next $branch +``` + +#### 2、gitlog.id + +``` +#!/bin/bash +branch=$1 + +if test "x$branch" = x; then + branch=`git branch -a | grep "*" | cut -d ' ' -f2` +fi + +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` + +/usr/bin/echo "-----------------------[" $branch "]-----------------------" +git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' ' +``` + +#### 3、gitlog.id2 + +``` +#!/bin/bash +branch=$1 + +if test "x$branch" = x; then + branch=`git branch -a | grep "*" | cut -d ' ' -f2` +fi + +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` +git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' ' +``` + +#### 4、gitlog.grep + +``` +#!/bin/bash +param1=$1 +param2=$2 + +if test "x$param2" = x; then + branch=`git branch -a | grep "*" | cut -d ' ' -f2` + string=$param1 +else + branch=$param1 + string=$param2 +fi + +patches=0 +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` + +LIST=`git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '` +for i in $LIST; do patches=$(echo $patches + 1 | bc);done +/usr/bin/echo "-----------------------[" $branch "-" $patches "patches ]-----------------------" +patches=$(echo $patches - 1 | bc); +for i in $LIST; do + if [ $patches -eq 1 ]; then + cnt=" ^" + elif [ $patches -eq 0 ]; then + cnt=" H" + else + if [ $patches -lt 10 ]; then + cnt=" $patches" + else + cnt="$patches" + fi + fi + /usr/bin/git show --abbrev-commit -s --pretty=format:"$cnt %h %<|(32)%an %s" $i + /usr/bin/git show --pretty=email --patch-with-stat $i | grep -n "$string" + patches=$(echo $patches - 1 | bc) +done +``` + +#### 5、gitbranchcmp3 + +``` +#!/bin/bash +# +# gitbranchcmp3 [] +# +oldbranch=$1 +newbranch=$2 +script=/tmp/compare_mismatches.sh + +/usr/bin/rm -f $script +echo "#!/bin/bash" > $script +/usr/bin/chmod 755 $script +echo "# Generated by gitbranchcmp3.sh" >> $script +echo "# Run this script to compare the mismatched patches" >> $script +echo " " >> $script +echo "function compare_them()" >> $script +echo "{" >> $script +echo " git show --pretty=email --patch-with-stat \$1 > /tmp/gronk1" >> $script +echo " git show --pretty=email --patch-with-stat \$2 > /tmp/gronk2" >> $script +echo " kompare /tmp/gronk1 /tmp/gronk2" >> $script +echo "}" >> $script +echo " " >> $script + +if test "x$newbranch" = x; then + newbranch=`git branch -a | grep "*" | cut -d ' ' -f2` +fi + +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` + +declare -a oldsha1s=(`git log --reverse --abbrev-commit --pretty=oneline $tracking..$oldbranch | cut -d ' ' -f1 |paste -s -d ' '`) +declare -a newsha1s=(`git log --reverse --abbrev-commit --pretty=oneline $tracking..$newbranch | cut -d ' ' -f1 |paste -s -d ' '`) + +#echo "old: " $oldsha1s +oldcount=${#oldsha1s[@]} +echo "Branch $oldbranch has $oldcount patches" +oldcount=$(echo $oldcount - 1 | bc) +#for o in `seq 0 ${#oldsha1s[@]}`; do +# echo -n ${oldsha1s[$o]} " " +# desc=`git show $i | head -5 | tail -1|cut -b5-` +#done + +#echo "new: " $newsha1s +newcount=${#newsha1s[@]} +echo "Branch $newbranch has $newcount patches" +newcount=$(echo $newcount - 1 | bc) +#for o in `seq 0 ${#newsha1s[@]}`; do +# echo -n ${newsha1s[$o]} " " +# desc=`git show $i | head -5 | tail -1|cut -b5-` +#done +echo + +for new in `seq 0 $newcount`; do + newsha=${newsha1s[$new]} + newdesc=`git show $newsha | head -5 | tail -1|cut -b5-` + oldsha=" " + same="[ ]" + for old in `seq 0 $oldcount`; do + if test "${oldsha1s[$old]}" = "match"; then + continue; + fi + olddesc=`git show ${oldsha1s[$old]} | head -5 | tail -1|cut -b5-` + if test "$olddesc" = "$newdesc" ; then + oldsha=${oldsha1s[$old]} + #echo $oldsha + git show $oldsha |tail -n +2 |grep -v "index.*\.\." |grep -v "@@" > /tmp/gronk1 + git show $newsha |tail -n +2 |grep -v "index.*\.\." |grep -v "@@" > /tmp/gronk2 + diff /tmp/gronk1 /tmp/gronk2 &> /dev/null + if [ $? -eq 0 ] ;then +# No differences + same="[SAME]" + oldsha1s[$old]="match" + break + fi + git show $oldsha |sed -n '/diff/,$p' |grep -v "index.*\.\." |grep -v "@@" > /tmp/gronk1 + git show $newsha |sed -n '/diff/,$p' |grep -v "index.*\.\." |grep -v "@@" > /tmp/gronk2 + diff /tmp/gronk1 /tmp/gronk2 &> /dev/null + if [ $? -eq 0 ] ;then +# Differences in comments only + same="[same]" + oldsha1s[$old]="match" + break + fi + oldsha1s[$old]="match" + echo "compare_them $oldsha $newsha" >> $script + fi + done + echo "$new $oldsha $newsha $same $newdesc" +done + +echo +echo "Missing from $newbranch:" +the_missing="" +# Now run through the olds we haven't matched up +for old in `seq 0 $oldcount`; do + if test ${oldsha1s[$old]} != "match"; then + olddesc=`git show ${oldsha1s[$old]} | head -5 | tail -1|cut -b5-` + echo "${oldsha1s[$old]} $olddesc" + the_missing=`echo "$the_missing ${oldsha1s[$old]}"` + fi +done + +echo "The missing: " $the_missing +echo "Compare script generated at: $script" +#git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' ' +``` + +#### 6、gitlog.find + +``` +#!/bin/bash +# +# Find the upstream equivalent patch +# +# gitlog.find +# +cwd=$PWD +param1=$1 +ubranch=$2 +patches=0 +script=/tmp/compare_upstream.sh +echo "#!/bin/bash" > $script +/usr/bin/chmod 755 $script +echo "# Generated by gitbranchcmp3.sh" >> $script +echo "# Run this script to compare the mismatched patches" >> $script +echo " " >> $script +echo "function compare_them()" >> $script +echo "{" >> $script +echo " cwd=$PWD" >> $script +echo " git show --pretty=email --patch-with-stat \$2 > /tmp/gronk2" >> $script +echo " cd ~/linux.git/fs/gfs2" >> $script +echo " git show --pretty=email --patch-with-stat \$1 > /tmp/gronk1" >> $script +echo " cd $cwd" >> $script +echo " kompare /tmp/gronk1 /tmp/gronk2" >> $script +echo "}" >> $script +echo " " >> $script + +#echo "Gathering upstream patch info. Please wait." +branch=`git branch -a | grep "*" | cut -d ' ' -f2` +tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` + +cd ~/linux.git +if test "X${ubranch}" = "X"; then + ubranch=`git branch -a | grep "*" | cut -d ' ' -f2` +fi +utracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` +# +# gather a list of gfs2 patches from master just in case we can't find it +# +#git log --abbrev-commit --pretty=format:" %h %<|(32)%an %s" master |grep -i -e "gfs2" -e "dlm" > /tmp/gronk +git log --reverse --abbrev-commit --pretty=format:"ms %h %<|(32)%an %s" master fs/gfs2/ > /tmp/gronk.gfs2 +# ms = in Linus's master +git log --reverse --abbrev-commit --pretty=format:"ms %h %<|(32)%an %s" master fs/dlm/ > /tmp/gronk.dlm + +cd $cwd +LIST=`git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '` +for i in $LIST; do patches=$(echo $patches + 1 | bc);done +/usr/bin/echo "-----------------------[" $branch "-" $patches "patches ]-----------------------" +patches=$(echo $patches - 1 | bc); +for i in $LIST; do + if [ $patches -eq 1 ]; then + cnt=" ^" + elif [ $patches -eq 0 ]; then + cnt=" H" + else + if [ $patches -lt 10 ]; then + cnt=" $patches" + else + cnt="$patches" + fi + fi + /usr/bin/git show --abbrev-commit -s --pretty=format:"$cnt %h %<|(32)%an %s" $i + desc=`/usr/bin/git show --abbrev-commit -s --pretty=format:"%s" $i` + cd ~/linux.git + cmp=1 + up_eq=`git log --reverse --abbrev-commit --pretty=format:"lo %h %<|(32)%an %s" $utracking..$ubranch | grep "$desc"` +# lo = in local for-next + if test "X$up_eq" = "X"; then + up_eq=`git log --reverse --abbrev-commit --pretty=format:"fn %h %<|(32)%an %s" master..$utracking | grep "$desc"` +# fn = in for-next for next merge window + if test "X$up_eq" = "X"; then + up_eq=`grep "$desc" /tmp/gronk.gfs2` + if test "X$up_eq" = "X"; then + up_eq=`grep "$desc" /tmp/gronk.dlm` + if test "X$up_eq" = "X"; then + up_eq=" Not found upstream" + cmp=0 + fi + fi + fi + fi + echo "$up_eq" + if [ $cmp -eq 1 ] ; then + UP_SHA1=`echo $up_eq|cut -d' ' -f2` + echo "compare_them $UP_SHA1 $i" >> $script + fi + cd $cwd + patches=$(echo $patches - 1 | bc) +done +echo "Compare script generated: $script" +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/bash-scripts-git + +作者:[Bob Peterson][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bobpeterson +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolseriesk12_rh_021x_0.png?itok=fvorN0e- (Digital hand surrounding by objects, bike, light bulb, graphs) +[2]: https://kde.org/applications/development/org.kde.kompare +[3]: https://en.wikipedia.org/wiki/GFS2 +[4]: https://en.wikipedia.org/wiki/Distributed_lock_manager From f417dd688f7a2eae53239063f13f34e4e0aec9c0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 22:08:00 +0800 Subject: [PATCH 412/430] APL --- ...- A Bash function to maintain Python virtual environments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md b/sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md index 0a1192bccf..51fbc31785 100644 --- a/sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md +++ b/sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0d2a3db0f353c6d00d8ec85eb80fa75498552907 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 22:21:41 +0800 Subject: [PATCH 413/430] TSL --- ...to maintain Python virtual environments.md | 303 ------------------ ...to maintain Python virtual environments.md | 296 +++++++++++++++++ 2 files changed, 296 insertions(+), 303 deletions(-) delete mode 100644 sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md create mode 100644 translated/tech/20200113 setV- A Bash function to maintain Python virtual environments.md diff --git a/sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md b/sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md deleted file mode 100644 index 51fbc31785..0000000000 --- a/sources/tech/20200113 setV- A Bash function to maintain Python virtual environments.md +++ /dev/null @@ -1,303 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (setV: A Bash function to maintain Python virtual environments) -[#]: via: (https://opensource.com/article/20/1/setv-bash-function) -[#]: author: (Sachin Patil https://opensource.com/users/psachin) - -setV: A Bash function to maintain Python virtual environments -====== -Get to know setV, a lightweight Python virtual environment manager and -alternative to virtualenvwrapper. -![Coding on a computer][1] - -For more than a year, [setV][2] has been hidden away within my [bash_scripts][3] project, but it's time for it to become public. setV is a Bash function I use as an alternative to [virtualenvwrapper][4]. It provides basic features that enable you to do things such as: - - * Use Python 3 by default - * Create a new virtual environment - * Create a new virtual environment using a custom Python path with **-p** (or **\--python**) - * Delete an existing virtual environment - * List all existing virtual environment - * Use Tab completion (in case you don't remember the virtual environment name) - - - -### Installation - -To install setV, download the script: - - -``` -`curl https://gitlab.com/psachin/setV/raw/master/install.sh` -``` - -Review the script, and then run it: - - -``` -`sh ./install.sh` -``` - -When you install setV, the installation script asks you to source **~/.bashrc** or **~/.bash_profile**. Be sure to do that. - -### Usage - -The basic command is **setv**. - -#### Create a virtual environment: - - -``` -setv --new rango  # setv -n rango - -# Or using a custom Python binary path -setv --new --python /opt/python/python3 rango  # setv -n -p /opt/python/python3 rango -``` - -#### Activate an existing environment: - - -``` -setv VIRTUAL_ENVIRONMENT_NAME - -# For example -setv rango -``` - -#### List all virtual environments: - - -``` -setv --list -# or -setv [TAB] [TAB] -``` - -#### Delete a virtual environment: - - -``` -`setv --delete rango` -``` - -#### Switch to another virtual environment: - - -``` -# Assuming you are in 'rango', switch to 'tango' using -setv tango -``` - -#### Tab Completion - -If you don't fully remember the virtual environment's name, Bash-like Tab completion works for virtual environment names. - -### Get involved - -setV is open source under the GNU [GPLv3][5], and contributions are welcome. To learn more, visit the Contribute section of setV's [README][6] in its GitLab repository. - -### The setV script - - -``` -#!/usr/bin/env bash -# setV - A Lightweight Python virtual environment manager. -# Author: Sachin (psachin) <[iclcoolster@gmail.com][7]> -# Author's URL: -# -# License: GNU GPL v3, See LICENSE file -# -# Configure(Optional): -# Set `SETV_VIRTUAL_DIR_PATH` value to your virtual environments -# directory-path. By default it is set to '~/virtualenvs/' -# -# Usage: -# Manual install: Added below line to your .bashrc or any local rc script(): -# --- -# source /path/to/virtual.sh -# --- -# -# Now you can 'activate' the virtual environment by typing -# $ setv <YOUR VIRTUAL ENVIRONMENT NAME> -# -# For example: -# $ setv rango -# -# or type: -# setv [TAB] [TAB]  (to list all virtual envs) -# -# To list all your virtual environments: -# $ setv --list -# -# To create new virtual environment: -# $ setv --new new_virtualenv_name -# -# To delete existing virtual environment: -# $ setv --delete existing_virtualenv_name -# -# To deactivate, type: -# $ deactivate - -# Path to virtual environment directory -SETV_VIRTUAL_DIR_PATH="$HOME/virtualenvs/" -# Default python version to use. This decides whether to use `virtualenv` or `python3 -m venv` -SETV_PYTHON_VERSION=3  # Defaults to Python3 -SETV_PY_PATH=$(which python${SETV_PYTHON_VERSION}) - -function _setvcomplete_() -{ -    # Bash-autocompletion. -    # This ensures Tab-auto-completions work for virtual environment names. -    local cmd="${1##*/}" # to handle command(s). -                         # Not necessary as such. 'setv' is the only command - -    local word=${COMP_WORDS[COMP_CWORD]} # Words thats being completed -    local xpat='${word}'                 # Filter pattern. Include -                                         # only words in variable '$names' -    local names=$(ls -l "${SETV_VIRTUAL_DIR_PATH}" | egrep '^d' | awk -F " " '{print $NF}') # Virtual environment names - -    COMPREPLY=($(compgen -W "$names" -X "$xpat" -- "$word")) # compgen generates the results -} - -function _setv_help_() { -    # Echo help/usage message -    echo "Usage: setv [OPTIONS] [NAME]" -    echo Positional argument: -    echo -e "NAME                       Activate virtual env." -    echo Optional arguments: -    echo -e "-l, --list                 List all Virtual Envs." -    echo -e "-n, --new NAME             Create a new Python Virtual Env." -    echo -e "-d, --delete NAME          Delete existing Python Virtual Env." -    echo -e "-p, --python PATH          Python binary path." -} - -function _setv_custom_python_path() -{ -    if [ -f "${1}" ]; -    then -        if [ "`expr $1 : '.*python\\([2,3]\\)'`" = "3" ]; -        then -            SETV_PYTHON_VERSION=3 -        else -            SETV_PYTHON_VERSION=2 -        fi -        SETV_PY_PATH=${1} -        _setv_create $2 -    else -        echo "Error: Path ${1} does not exist!" -    fi -} - -function _setv_create() -{ -    # Creates new virtual environment if ran with -n|--new flag -    if [ -z ${1} ]; -    then -        echo "You need to pass virtual environment name" -        _setv_help_ -    else -        echo "Creating new virtual environment with the name: $1" - -        if [ ${SETV_PYTHON_VERSION} -eq 3 ]; -        then -            ${SETV_PY_PATH} -m venv ${SETV_VIRTUAL_DIR_PATH}${1} -        else -            virtualenv -p ${SETV_PY_PATH} ${SETV_VIRTUAL_DIR_PATH}${1} -        fi - -        echo "You can now activate the Python virtual environment by typing: setv ${1}" -    fi -} - -function _setv_delete() -{ -    # Deletes virtual environment if ran with -d|--delete flag -    # TODO: Refactor -    if [ -z ${1} ]; -    then -        echo "You need to pass virtual environment name" -        _setv_help_ -    else -        if [ -d ${SETV_VIRTUAL_DIR_PATH}${1} ]; -        then -            read -p "Really delete this virtual environment(Y/N)? " yes_no -            case $yes_no in -                Y|y) rm -rvf ${SETV_VIRTUAL_DIR_PATH}${1};; -                N|n) echo "Leaving the virtual environment as it is.";; -                *) echo "You need to enter either Y/y or N/n" -            esac -        else -            echo "Error: No virtual environment found by the name: ${1}" -        fi -    fi -} - -function _setv_list() -{ -    # Lists all virtual environments if ran with -l|--list flag -    echo -e "List of virtual environments you have under ${SETV_VIRTUAL_DIR_PATH}:\n" -    for virt in $(ls -l "${SETV_VIRTUAL_DIR_PATH}" | egrep '^d' | awk -F " " '{print $NF}') -    do -        echo ${virt} -    done -} - -function setv() { -    # Main function -    if [ $# -eq 0 ]; -    then -        _setv_help_ -    elif [ $# -le 3 ]; -    then -        case "${1}" in -            -n|--new) _setv_create ${2};; -            -d|--delete) _setv_delete ${2};; -            -l|--list) _setv_list;; -            *) if [ -d ${SETV_VIRTUAL_DIR_PATH}${1} ]; -               then -                   # Activate the virtual environment -                   source ${SETV_VIRTUAL_DIR_PATH}${1}/bin/activate -               else -                   # Else throw an error message -                   echo "Sorry, you don't have any virtual environment with the name: ${1}" -                   _setv_help_ -               fi -               ;; -        esac -    elif [ $# -le 5 ]; -    then -        case "${2}" in -            -p|--python) _setv_custom_python_path ${3} ${4};; -            *) _setv_help_;; -        esac -    fi -} - -# Calls bash-complete. The compgen command accepts most of the same -# options that complete does but it generates results rather than just -# storing the rules for future use. -complete  -F _setvcomplete_ setv -``` - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/setv-bash-function - -作者:[Sachin Patil][a] -选题:[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/psachin -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) -[2]: https://gitlab.com/psachin/setV -[3]: https://github.com/psachin/bash_scripts -[4]: https://virtualenvwrapper.readthedocs.org/ -[5]: https://gitlab.com/psachin/setV/blob/master/LICENSE -[6]: https://gitlab.com/psachin/setV/blob/master/ReadMe.org -[7]: mailto:iclcoolster@gmail.com diff --git a/translated/tech/20200113 setV- A Bash function to maintain Python virtual environments.md b/translated/tech/20200113 setV- A Bash function to maintain Python virtual environments.md new file mode 100644 index 0000000000..75dcec4367 --- /dev/null +++ b/translated/tech/20200113 setV- A Bash function to maintain Python virtual environments.md @@ -0,0 +1,296 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (setV: A Bash function to maintain Python virtual environments) +[#]: via: (https://opensource.com/article/20/1/setv-bash-function) +[#]: author: (Sachin Patil https://opensource.com/users/psachin) + +setV:一个管理 Python 虚拟环境的 Bash 函数 +====== + +> 了解一下 setV,它是轻量级的 Python 虚拟环境管理器,是 virtualenvwrapper 的替代产品。 + +![Coding on a computer][1] + +这一年多来,[setV] [2] 悄悄隐藏在我的 [bash_scripts][3] 项目中,但现在是时候该公开了。setV 是一个 Bash 函数,我可以用它代替 [virtualenvwrapper][4]。它提供了使你能够执行以下操作的基本功能: + +* 默认使用 Python 3 +* 创建一个新的虚拟环境 +* 使用带有 `-p`(或 `--python`)的自定义 Python 路径来创建新的虚拟环境 +* 删除现有的虚拟环境 +* 列出所有现有的虚拟环境 +* 使用制表符补全(以防你忘记虚拟环境名称) + +### 安装 + +要安装 setV,请下载该脚本: + +``` +curl https://gitlab.com/psachin/setV/raw/master/install.sh +``` + +审核一下脚本,然后运行它: + +``` +sh ./install.sh +``` + +当安装 setV 时,安装脚本会询问你要嵌入到 `~/.bashrc` 还是 `~/.bash_profile`,根据你的喜好选择一个。 + +### 用法 + +基本的命令格式是 `setv`。 + +#### 创建虚拟环境 + +``` +setv --new rango  # setv -n rango + +# 或使用定制的 Python 路径 +setv --new --python /opt/python/python3 rango  # setv -n -p /opt/python/python3 rango +``` + +#### 激活已有的虚拟环境 + +``` +setv VIRTUAL_ENVIRONMENT_NAME +``` + +``` +# 示例 +setv rango +``` + +#### 列出所有的虚拟环境 + +``` +setv --list +# 或 +setv [TAB] [TAB] +``` + +#### 删除虚拟环境 + +``` +setv --delete rango +``` + +#### 切换到另外一个虚拟环境 + +``` +# 假设你现在在 'rango',切换到 'tango' +setv tango +``` + +#### 制表符补完 + +如果你不完全记得虚拟环境的名称,则 Bash 式的制表符补全也可以适用于虚拟环境名称。 + +### 参与其中 + +setV 在 GNU [GPLv3][5]下开源,欢迎贡献。要了解更多信息,请访问它的 GitLab 存储库中的 setV 的 [README][6] 的贡献部分。 + +### setV 脚本 + +``` +#!/usr/bin/env bash +# setV - A Lightweight Python virtual environment manager. +# Author: Sachin (psachin) +# Author's URL: https://psachin.gitlab.io/about +# +# License: GNU GPL v3, See LICENSE file +# +# Configure(Optional): +# Set `SETV_VIRTUAL_DIR_PATH` value to your virtual environments +# directory-path. By default it is set to '~/virtualenvs/' +# +# Usage: +# Manual install: Added below line to your .bashrc or any local rc script(): +# --- +# source /path/to/virtual.sh +# --- +# +# Now you can 'activate' the virtual environment by typing +# $ setv +# +# For example: +# $ setv rango +# +# or type: +# setv [TAB] [TAB] (to list all virtual envs) +# +# To list all your virtual environments: +# $ setv --list +# +# To create new virtual environment: +# $ setv --new new_virtualenv_name +# +# To delete existing virtual environment: +# $ setv --delete existing_virtualenv_name +# +# To deactivate, type: +# $ deactivate + +# Path to virtual environment directory +SETV_VIRTUAL_DIR_PATH="$HOME/virtualenvs/" +# Default python version to use. This decides whether to use `virtualenv` or `python3 -m venv` +SETV_PYTHON_VERSION=3 # Defaults to Python3 +SETV_PY_PATH=$(which python${SETV_PYTHON_VERSION}) + +function _setvcomplete_() +{ + # Bash-autocompletion. + # This ensures Tab-auto-completions work for virtual environment names. + local cmd="${1##*/}" # to handle command(s). + # Not necessary as such. 'setv' is the only command + + local word=${COMP_WORDS[COMP_CWORD]} # Words thats being completed + local xpat='${word}' # Filter pattern. Include + # only words in variable '$names' + local names=$(ls -l "${SETV_VIRTUAL_DIR_PATH}" | egrep '^d' | awk -F " " '{print $NF}') # Virtual environment names + + COMPREPLY=($(compgen -W "$names" -X "$xpat" -- "$word")) # compgen generates the results +} + +function _setv_help_() { + # Echo help/usage message + echo "Usage: setv [OPTIONS] [NAME]" + echo Positional argument: + echo -e "NAME Activate virtual env." + echo Optional arguments: + echo -e "-l, --list List all Virtual Envs." + echo -e "-n, --new NAME Create a new Python Virtual Env." + echo -e "-d, --delete NAME Delete existing Python Virtual Env." + echo -e "-p, --python PATH Python binary path." +} + +function _setv_custom_python_path() +{ + if [ -f "${1}" ]; + then + if [ "`expr $1 : '.*python\([2,3]\)'`" = "3" ]; + then + SETV_PYTHON_VERSION=3 + else + SETV_PYTHON_VERSION=2 + fi + SETV_PY_PATH=${1} + _setv_create $2 + else + echo "Error: Path ${1} does not exist!" + fi +} + +function _setv_create() +{ + # Creates new virtual environment if ran with -n|--new flag + if [ -z ${1} ]; + then + echo "You need to pass virtual environment name" + _setv_help_ + else + echo "Creating new virtual environment with the name: $1" + + if [ ${SETV_PYTHON_VERSION} -eq 3 ]; + then + ${SETV_PY_PATH} -m venv ${SETV_VIRTUAL_DIR_PATH}${1} + else + virtualenv -p ${SETV_PY_PATH} ${SETV_VIRTUAL_DIR_PATH}${1} + fi + + echo "You can now activate the Python virtual environment by typing: setv ${1}" + fi +} + +function _setv_delete() +{ + # Deletes virtual environment if ran with -d|--delete flag + # TODO: Refactor + if [ -z ${1} ]; + then + echo "You need to pass virtual environment name" + _setv_help_ + else + if [ -d ${SETV_VIRTUAL_DIR_PATH}${1} ]; + then + read -p "Really delete this virtual environment(Y/N)? " yes_no + case $yes_no in + Y|y) rm -rvf ${SETV_VIRTUAL_DIR_PATH}${1};; + N|n) echo "Leaving the virtual environment as it is.";; + *) echo "You need to enter either Y/y or N/n" + esac + else + echo "Error: No virtual environment found by the name: ${1}" + fi + fi +} + +function _setv_list() +{ + # Lists all virtual environments if ran with -l|--list flag + echo -e "List of virtual environments you have under ${SETV_VIRTUAL_DIR_PATH}:\n" + for virt in $(ls -l "${SETV_VIRTUAL_DIR_PATH}" | egrep '^d' | awk -F " " '{print $NF}') + do + echo ${virt} + done +} + +function setv() { + # Main function + if [ $# -eq 0 ]; + then + _setv_help_ + elif [ $# -le 3 ]; + then + case "${1}" in + -n|--new) _setv_create ${2};; + -d|--delete) _setv_delete ${2};; + -l|--list) _setv_list;; + *) if [ -d ${SETV_VIRTUAL_DIR_PATH}${1} ]; + then + # Activate the virtual environment + source ${SETV_VIRTUAL_DIR_PATH}${1}/bin/activate + else + # Else throw an error message + echo "Sorry, you don't have any virtual environment with the name: ${1}" + _setv_help_ + fi + ;; + esac + elif [ $# -le 5 ]; + then + case "${2}" in + -p|--python) _setv_custom_python_path ${3} ${4};; + *) _setv_help_;; + esac + fi +} + +# Calls bash-complete. The compgen command accepts most of the same +# options that complete does but it generates results rather than just +# storing the rules for future use. +complete -F _setvcomplete_ setv +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/setv-bash-function + +作者:[Sachin Patil][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/psachin +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) +[2]: https://gitlab.com/psachin/setV +[3]: https://github.com/psachin/bash_scripts +[4]: https://virtualenvwrapper.readthedocs.org/ +[5]: https://gitlab.com/psachin/setV/blob/master/LICENSE +[6]: https://gitlab.com/psachin/setV/blob/master/ReadMe.org +[7]: mailto:iclcoolster@gmail.com From 8e7f65331684bf2add20ba1b17715cf4cbd5f270 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 22:46:00 +0800 Subject: [PATCH 414/430] =?UTF-8?q?=E6=B8=85=E9=99=A4=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nimal vision, and more open source news.md | 93 ---------- ...u Cinnamon Distribution is Finally Here.md | 85 --------- ...l gets better, and more industry trends.md | 65 ------- ...n fellows from Africa, and more updates.md | 75 -------- ...bernetes etcd, and more industry trends.md | 63 ------- ...ed- Here-s What-s New and How to Get it.md | 165 ------------------ ... of microbes, and more open source news.md | 76 -------- ...the end for Windows Server 2008 support.md | 71 -------- 8 files changed, 693 deletions(-) delete mode 100644 sources/news/20191207 New machine learning from Alibaba and Netflix, mimicking animal vision, and more open source news.md delete mode 100644 sources/news/20191209 First Ever Release of Ubuntu Cinnamon Distribution is Finally Here.md delete mode 100644 sources/news/20191209 KubeCon gets bigger, the kernel gets better, and more industry trends.md delete mode 100644 sources/news/20191214 Annual release cycle for Python, new Python Software Foundation fellows from Africa, and more updates.md delete mode 100644 sources/news/20191219 2020 technology must haves, a guide to Kubernetes etcd, and more industry trends.md delete mode 100644 sources/news/20191219 Linux Mint 19.3 -Tricia- Released- Here-s What-s New and How to Get it.md delete mode 100644 sources/news/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md delete mode 100644 sources/news/20200116 It-s the end for Windows Server 2008 support.md diff --git a/sources/news/20191207 New machine learning from Alibaba and Netflix, mimicking animal vision, and more open source news.md b/sources/news/20191207 New machine learning from Alibaba and Netflix, mimicking animal vision, and more open source news.md deleted file mode 100644 index 93297c4cad..0000000000 --- a/sources/news/20191207 New machine learning from Alibaba and Netflix, mimicking animal vision, and more open source news.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (New machine learning from Alibaba and Netflix, mimicking animal vision, and more open source news) -[#]: via: (https://opensource.com/article/19/12/news-december-7) -[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) - -New machine learning from Alibaba and Netflix, mimicking animal vision, and more open source news -====== -Catch up on the biggest open source headlines from the past two weeks. -![Weekly news roundup with TV][1] - -In this edition of our open source news roundup, we take a look an open source election auditing tool, new open source from Alibaba and Netflix, mimicking animal vision, and more! - -### Alibaba and Netflix share machine learning and data science software - -Two companies at the forefront of machine learning and data science have just released some of their tools under open source licenses. - -Chinese ecommerce giant Alibaba just [open sourced the algorithm libraries][2] for its Alink platform. The algorithms "are essential to support machine learning tasks such as online product recommendations and smart customer services." According to Jia Yangqing, president of Alibaba Cloud, Alink is a good fit for "developers seeking big data and machine-learning tools." You can find the source code for Alink (which is under an Apache 2.0 license) [on GitHub][3], with documentation in both Chinese and English. - -Not to be outdone, streaming service Netflix just released its [Metaflow Python library][4] under an Apache 2.0 license. Metaflow enables data scientists to "see early on whether a prototyped model would fail in production, allowing them to fix whatever the issue was". It also works with a number of Python data science libraries, like SciKit Learn, Pytorch, and Tensorflow. You can grab Metaflow's code from [its GitHub repository][5] or learn more about it at the [Metaflow website][6]. - -### Open source software to mimic animal vision - -Have you ever wondered how your dog or cat sees the world? Thanks to work by researchers at the University of Exeter in the UK and Australia's University of Queensland, you can find out. The team just released [software that allows humans to see the world as animals do][7]. - -Called micaToolbox, the software can interpret digital photos and process images of various environments by mimicking the limitations of animal vision. Anyone with a camera, a computer, or smartphone can use the software without knowing how to code. But micaToolbox isn't just a novelty. It's a serious scientific tool that can help "help biologists better understand a variety of animal behaviors, including mating systems, distance-dependent signalling and mimicry." And, according to researcher Jolyon Troscianko, the software can help identify "how an animal's camouflage works so that we can manage our land to protect certain species." - -You can [download micaBox][8] or [browse its source code][9] on GitHub. - -### New tool for post-election auditing - -More and more aspects of our lives and institutions are being automated. With that comes an increased danger of systems breaking down or malicious someones tampering with those systems. Open source gives us an opportunity to look at exactly how the automation works. - -Elections, in particular, are increasingly vulnerable. To combat election tampering, the US Cybersecurity and Infrastructure Security Agency (CISA) has joined forces with the non-profit organization VotingWorks to create a [web-based application for auditing ballots][10]. - -Called Arlo, the application is designed to ensure that "elections are secure, resilient, and transparent," said CISA's director Chris Krebs. Arlo works with a range of automated voting systems to help "officials compare audited votes to tabulated votes, and providing monitoring & reporting capabilities." Arlo was used to verify the results of recent state and local elections and is being further field-tested in the states of Georgia, Michigan, Missouri, Ohio, Pennsylvania, and Virginia. - -Arlo's source code, released under an AGPL-3.0 license, is [available on GitHub][11]. - -### Royal Navy debuts open source application development kit - -Consistency across user interfaces is key to a successful set of applications and services. The UK's Royal Navy understands the importance of this and has released the [open source NELSON standards toolkit][12] to help its developers and suppliers "save time and give users a consistent experience." - -Named after the legendary British admiral, NELSON is intended to "maintain high visual consistency and user-experience quality across the different applications developed or subcontracted by the Royal Navy." The toolkit consists of a set of components including visual styles, typographic elements, forms, elements like buttons and checkboxes, and notifications. - -NELSON has its own [GitHub repository][13], from which the Royal Navy encourages developers to make pull requests. - -#### In other news - - * [Council group plans for open source revenues and benefits platform][14] - * [Introducing Nebula, the open source global overlay network from Slack][15] - * [webOS Open Source Edition 2.0 keeps Palm's spirit alive in cars and IoT][16] - * [Duke University Introduces an Open Source Tool as an Alternative to a Monolithic LMS][17] - * [Open Source Technology Could Be a Boon to Farmers][18] - - - -_Thanks, as always, to Opensource.com staff members and moderators for their help this week._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/news-december-7 - -作者:[Scott Nesbitt][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/scottnesbitt -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i (Weekly news roundup with TV) -[2]: https://www.zdnet.com/article/alibaba-cloud-publishes-machine-learning-algorithm-on-github/ -[3]: https://github.com/alibaba/alink -[4]: https://www.zdnet.com/article/netflix-our-metaflow-python-library-for-faster-data-science-is-now-open-source/ -[5]: https://github.com/Netflix/metaflow -[6]: https://metaflow.org/ -[7]: https://www.upi.com/Science_News/2019/12/03/Novel-software-helps-scientists-see-what-animals-see/5961575389734/ -[8]: http://www.empiricalimaging.com/download/micatoolbox/ -[9]: https://github.com/troscianko/micaToolbox -[10]: https://www.zdnet.com/article/cisa-and-votingworks-release-open-source-post-election-auditing-tool/ -[11]: https://github.com/votingworks/arlo -[12]: https://joinup.ec.europa.eu/collection/open-source-observatory-osor/news/open-source-royal-navy -[13]: https://github.com/Royal-Navy/standards-toolkit -[14]: https://www.ukauthority.com/articles/council-group-plans-for-open-source-revenues-and-benefits/ -[15]: https://slack.engineering/introducing-nebula-the-open-source-global-overlay-network-from-slack-884110a5579 -[16]: https://www.slashgear.com/webos-open-source-edition-2-0-keeps-palms-spirit-alive-in-cars-and-iot-25601309/ -[17]: https://iblnews.org/duke-university-introduces-an-open-source-tool-as-an-alternative-to-a-monolithic-lms/ -[18]: https://civileats.com/2019/12/02/open-source-technology-could-be-a-boon-to-farmers/ diff --git a/sources/news/20191209 First Ever Release of Ubuntu Cinnamon Distribution is Finally Here.md b/sources/news/20191209 First Ever Release of Ubuntu Cinnamon Distribution is Finally Here.md deleted file mode 100644 index 09af65568d..0000000000 --- a/sources/news/20191209 First Ever Release of Ubuntu Cinnamon Distribution is Finally Here.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (First Ever Release of Ubuntu Cinnamon Distribution is Finally Here!) -[#]: via: (https://itsfoss.com/ubuntu-cinnamon/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -First Ever Release of Ubuntu Cinnamon Distribution is Finally Here! -====== - -_**Brief: Ubuntu Cinnamon is a new distribution that utilizes Linux Mint’s Cinnamon desktop environment on top of Ubuntu code base. It’s first stable release is based on Ubuntu 19.10 Eoan Ermine.**_ - -[Cinnamon][1] is Linux Mint’s flagship desktop environment. Like [MATE desktop][2], Cinnamon is also a product of dissatisfaction with GNOME 3. With the GNOME Classic like user interface and relatively lower hardware requirements, Cinnamon soon gathered a dedicated userbase. - -Like any other desktop environment out there, you can [install Cinnamon on Ubuntu][3] and other distributions. - -Installing multiple [desktop environments][4] (DE) is not a difficult task but it often leads to conflicts (with other DE’s elements) and may not always provide the best experience. This is why major Linux distributions separate spins/flavors with various popular desktop environments. - -[Ubuntu also has various official flavors][5] featuring [KDE][6] (Kubuntu), [LXQt][7] (Lubuntu), Xfce (Xubuntu), Budgie ([Ubuntu Budgie][8]) etc. Cinnamon was not in this list but Ubuntu Cinnamon Remix project is trying to change that. - -### Ubuntu Cinnamon distribution - -![Ubuntu Cinnamon Desktop Screenshot][9] - -[Ubuntu Cinnamon][10] (website under construction) is a new Linux distribution that brings Cinnamon desktop to Ubuntu distribution. Joshua Peisach is the lead developer for the project and he is being helped by other volunteer contributors. The ex-developer of the now discontinued Ubuntu GNOME project and some members from Ubuntu team are also advising the team to help with the development. - -![Ubuntu Cinnamon Remix Screeenshot 1][11] - -Do note that Ubuntu Cinnamon is not an official flavor of Ubuntu. They are trying to get the flavorship but I think that will take a few more releases. - -The first stable release of Ubuntu Cinnamon is based on [Ubuntu 19.10 Eoan Ermine][12]. It uses Calamares installer from Lubuntu and features Cinnamon desktop version 4.0.10. Naturally, it uses Nemo file manager and LightDM. - -It supports EFI and UEFI and only comes with 64-bit support. - -You’ll get your regular goodies like LibreOffice, Firefox and some GNOME software and games. You can of course install more applications as per your need. - -### Download and install Ubuntu Cinnamon - -Do note that this is the first ever release of Ubuntu Cinnamon and the developers are not that experienced at this moment. - -If you don’t like troubleshooting, don’t use it on your main system. I expect this release to have a few bugs and issues which will be fixed eventually as more users test it out. - -You can download Ubuntu Cinnamon ISO from Sourceforge website: - -[Download Ubuntu Cinnamon][13] - -### What next from here? - -The dev team has a few improvements planned for the 20.04 release. The changes are mostly on the cosmetics though. There will be new GRUB and Plymouth theme, layout application and welcome screen. - -I downloaded it and tried it in a live session. Here’s what this distribution looks like: - -[Subscribe to our YouTube channel for more Linux videos][14] - -Meanwhile, if you manage to try it on your own, why not share your experience in the comments? If you use Linux Mint, will you switch to Ubuntu Cinnamon in near future? What are your overall opinion about this new project? Do share it in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ubuntu-cinnamon/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://en.wikipedia.org/wiki/Cinnamon_(desktop_environment) -[2]: https://mate-desktop.org/ -[3]: https://itsfoss.com/install-cinnamon-on-ubuntu/ -[4]: https://itsfoss.com/best-linux-desktop-environments/ -[5]: https://itsfoss.com/which-ubuntu-install/ -[6]: https://kde.org/ -[7]: https://lxqt.org/ -[8]: https://itsfoss.com/ubuntu-budgie-18-review/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/ubuntu_cinnamon_distribution_screenshot.jpg?ssl=1 -[10]: https://ubuntucinnamon.org/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/ubuntu_cinnamon_remix_screeenshot_1.jpg?ssl=1 -[12]: https://itsfoss.com/ubuntu-19-10-released/ -[13]: https://sourceforge.net/projects/ubuntu-cinnamon-remix/ -[14]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 diff --git a/sources/news/20191209 KubeCon gets bigger, the kernel gets better, and more industry trends.md b/sources/news/20191209 KubeCon gets bigger, the kernel gets better, and more industry trends.md deleted file mode 100644 index 81b00a0ec9..0000000000 --- a/sources/news/20191209 KubeCon gets bigger, the kernel gets better, and more industry trends.md +++ /dev/null @@ -1,65 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (KubeCon gets bigger, the kernel gets better, and more industry trends) -[#]: via: (https://opensource.com/article/19/12/kubecon-bigger-kernel-better-more-industry-trends) -[#]: author: (Tim Hildred https://opensource.com/users/thildred) - -KubeCon gets bigger, the kernel gets better, and more industry trends -====== -A weekly look at open source community, market, and industry trends. -![Person standing in front of a giant computer screen with numbers, data][1] - -As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. - -## [KubeCon showed Kubernetes is big, but is it a Unicorn?][2] - -> It’s hard to remember now but there was a time when Kubernetes was a distant No. 3 in terms of container orchestrators being used in the market. It’s also eye opening to now realize that [the firms][3] that hatched the two platforms that [towered over][4] Kubernetes have had to completely re-jigger their business models under the Kubernetes onslaught. -> -> And full credit to the CNCF for attempting to diffuse some of that attention from Kubernetes by spending the vast majority of the KubeCon opening keynote address touting some of the nearly two dozen graduated, incubating, and sandbox projects it also hosts. But, it was really the Big K that stole the show. - -**The impact:** Open source is way more than the source code; governance is a big deal and can be the difference between longevity and irrelevance. Gathering, organizing, and maintaining humans is an entirely different skill set than doing the same for bits, but can have just as big an influence on the success of a project. - -## [Report: Kubernetes use on the rise][5] - -> At the same time, the Datadog report notes that container churn rates are approximately 10 times higher in orchestrated environments. Churn rates in container environments that lack an orchestration platform such as Kubernetes have increased in the last year as well. The average container lifespan at a typical company running infrastructure without orchestration is about two days, down from about six days in mid-2018. In 19% of those environments not running orchestration, the average container lifetime exceeded 30 days. That compares to only 3% of organizations running containers longer than 30 days in Kubernetes environments, according to the report’s findings. - -**The impact**: If your containers aren't churning, you're probably not getting the full benefit of the technology you've adopted. - -## [Upcoming Linux 5.5 kernel improves live patching, scheduling][6] - -> A new WFX Wi-Fi driver for the Silicon Labs WF200 ASIC transceiver is coming to Linux kernel 5.5. This particular wireless transceiver is geared toward low-power IoT devices and uses a 2.4 GHz 802.11b/g/n radio optimized for low power RF performance in crowded RF environments. This new driver can interface via both Serial Peripheral Interface (SPI) and Secure Digital Input Output (SDIO). - -**The impact**: The kernel's continued relevance is a direct result of the never-ending grind to keep being where people need it to be (i.e. basically everywhere). - -## [DigitalOcean Currents: December 2019][7] - -> In that spirit, this fall’s installment of our seasonal Currents report is dedicated to open source for the second year running. We surveyed more than 5800 developers around the world on the overall health and direction of the open source community. When we last checked in with the community in [2018][8], more than half of developers reported contributing to open source projects, and most felt the community was healthy and growing. - -**The impact**: While the good news outweighs the bad, there are a couple of things to keep an eye on: namely, making open source more inclusive and mitigating potential negative impact of big money. - -_I hope you enjoyed this list of what stood out to me from last week and come back next Monday for more open source community, market, and industry trends._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/kubecon-bigger-kernel-better-more-industry-trends - -作者:[Tim Hildred][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/thildred -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) -[2]: https://www.sdxcentral.com/articles/opinion-editorial/kubecon-showed-kubernetes-is-big-but-is-it-a-unicorn/2019/11/ -[3]: https://www.sdxcentral.com/articles/news/docker-unloads-enterprise-biz-to-mirantis/2019/11/ -[4]: https://www.sdxcentral.com/articles/news/mesosphere-is-now-d2iq-and-kubernetes-is-its-game/2019/08/ -[5]: https://containerjournal.com/topics/container-ecosystems/report-kubernetes-use-on-the-rise/ -[6]: https://thenewstack.io/upcoming-linux-5-5-kernel-improves-live-patching-scheduling/ -[7]: https://blog.digitalocean.com/digitalocean-currents-december-2019/ -[8]: https://www.digitalocean.com/currents/october-2018/ diff --git a/sources/news/20191214 Annual release cycle for Python, new Python Software Foundation fellows from Africa, and more updates.md b/sources/news/20191214 Annual release cycle for Python, new Python Software Foundation fellows from Africa, and more updates.md deleted file mode 100644 index 85aef63325..0000000000 --- a/sources/news/20191214 Annual release cycle for Python, new Python Software Foundation fellows from Africa, and more updates.md +++ /dev/null @@ -1,75 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Annual release cycle for Python, new Python Software Foundation fellows from Africa, and more updates) -[#]: via: (https://opensource.com/article/19/12/python-news-december) -[#]: author: (Christian Heimes https://opensource.com/users/christian-heimes) - -Annual release cycle for Python, new Python Software Foundation fellows from Africa, and more updates -====== -Find out what's going on in the Python community in December. -![Python in a coffee cup.][1] - -The Python Software Foundation (PSF) is a nonprofit organization behind the Python programming language. I am fortunate to be a PSF Fellow (honorable member for life,) a Python core developer, and the liaison between my company, Red Hat, and the PSF. Part of that liaison work is providing updates on what’s happening in the Python community. Here’s a look at what we have going on in December. - -### Upcoming events - -A significant part of the Python community is its in-person events. These events are where users and contributors intermingle and learn together. Here are the big announcements of upcoming opportunities to connect. - -#### PyCon US 2020 - -[PyCon US][2] is by far the largest annual Python event. The next PyCon is April 15-23, 2020, in Pittsburgh. The call for proposals is open to all until December 20, 2019. I’m planning to attend PyCon for the conference and its [famous post-con sprints][3]. - -#### EuroPython - -EuroPython is the largest Python conference in Europe with about 1,000 attendees in the last years. [EP20][4] will be held in Dublin, Ireland, July 20-26, 2020. As a liaison for Red Hat, I’m proud to say that Red Hat sponsored EP18 in Edinburgh and donated the sponsoring tickets to Women Who Code Scotland. - -#### PyData - -[PyData][5] is a separate nonprofit related to the Python community through a focus on data science. They host many international events throughout the year, with upcoming events in [Austin, Texas][6], and [Warsaw, Poland][7] before the end of the year. - -### New PSF fellows from Africa - -The PSF promotes a few members to fellow every quarter. Yesterday, twelve new PSF fellows were [announced][8]. - -I’d like to highlight the four new fellows from Ghana, who are also the organizers of the first pan-African [PyCon Africa][9], which took place in August 2019 in Accra, Ghana. The Python community in Africa is growing at an amazing speed. PyCon Africa 2020 will be in Accra again, and I’m planning to spend my summer vacation there. - -### Annual release cycle for Python - -Python used to release a new major version about every 18 months. This timeline will change with the Python 3.9 release. With [PEP 602,][10] a new major version of Python will be released annually in October. The new cadence means fewer changes between releases and more predictable release dates. October was chosen to align with Linux distribution releases such as Fedora. Miro Hrončok from the Python maintenance team joined the discussion and has helped to find a convenient release date for us; for more details, please see . - -### Steering council election - -The Python Steering Council governs the development of Python. It was established after [Guido van Rossum stepped down][11] as benevolent dictator for life. Python core developers elect a new steering council for every major Python release. For the upcoming term, nine candidates were nominated for five seats on the council (with Guido being nominated, but [withdrawing][12]). See for all the details. Election results are expected to be announced mid-December. - -That covers what’s new in the Python community for December. Stay tuned for more updates in the future and mark your calendars for the conferences mentioned above. - -So you have a great business idea for a wonderful IT product or service, and you want to build your... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/python-news-december - -作者:[Christian Heimes][a] -选题:[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/christian-heimes -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_python.jpg?itok=G04cSvp_ (Python in a coffee cup.) -[2]: https://us.pycon.org/2020/ -[3]: https://opensource.com/article/19/5/pycon-developer-sprints -[4]: https://www.europython-society.org/post/188741002380/europython-2020-venue-and-location-selected -[5]: https://pydata.org/ -[6]: https://pydata.org/austin2019/ -[7]: https://pydata.org/warsaw2019/ -[8]: https://pyfound.blogspot.com/2019/11/python-software-foundation-fellow.html -[9]: https://africa.pycon.org/ -[10]: https://www.python.org/dev/peps/pep-0602/ -[11]: https://opensource.com/article/19/6/command-line-heroes-python -[12]: https://discuss.python.org/t/steering-council-nomination-guido-van-rossum-2020-term/2657/11 diff --git a/sources/news/20191219 2020 technology must haves, a guide to Kubernetes etcd, and more industry trends.md b/sources/news/20191219 2020 technology must haves, a guide to Kubernetes etcd, and more industry trends.md deleted file mode 100644 index 198d4f8292..0000000000 --- a/sources/news/20191219 2020 technology must haves, a guide to Kubernetes etcd, and more industry trends.md +++ /dev/null @@ -1,63 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (2020 technology must haves, a guide to Kubernetes etcd, and more industry trends) -[#]: via: (https://opensource.com/article/19/12/gartner-ectd-and-more-industry-trends) -[#]: author: (Tim Hildred https://opensource.com/users/thildred) - -2020 technology must haves, a guide to Kubernetes etcd, and more industry trends -====== -A weekly look at open source community, market, and industry trends. -![Person standing in front of a giant computer screen with numbers, data][1] - -As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update. - -## [Gartner's top 10 infrastructure and operations trends for 2020][2] - -> “The vast majority of organisations that do not adopt a shared self-service platform approach will find that their DevOps initiatives simply do not scale,” said Winser. "Adopting a shared platform approach enables product teams to draw from an I&O digital toolbox of possibilities, while benefiting from high standards of governance and efficiency needed for scale." - -**The impact**: The breakneck change of technology development and adoption will not slow down next year, as the things you've been reading about for the last two years become things you have to figure out to deal with every day. - -## [A guide to Kubernetes etcd: All you need to know to set up etcd clusters][3] - -> Etcd is a distributed reliable key-value store which is simple, fast and secure. It acts like a backend service discovery and database, runs on different servers in Kubernetes clusters at the same time to monitor changes in clusters and to store state/configuration data that should to be accessed by a Kubernetes master or clusters. Additionally, etcd allows Kubernetes master to support discovery service so that deployed application can declare their availability for inclusion in service. - -**The impact**: This is actually way more than I needed to know about setting up etcd clusters, but now I have a mental model of what that could look like, and you can too. - -## [How the open source model could fuel the future of digital marketing][4] - -> In other words, the broad adoption of open source culture has the power to completely invert the traditional marketing funnel. In the future, prospective customers could be first introduced to “late funnel” materials and then buy into the broader narrative — a complete reversal of how traditional marketing approaches decision-makers today. - -**The impact**: The SEO on this cuts two ways: It can introduce uninitiated marketing people to open source and uninitiated technical people to the ways that technology actually gets adopted. Neat! - -## [Kubernetes integrates interoperability, storage, waits on sidecars][5] - -> In a [recent interview][6], Lachlan Evenson, and was also a lead on the Kubernetes 1.16 release, said sidecar containers was one of the features that team was a “little disappointed” it could not include in their release. -> -> Guinevere Saenger, software engineer at GitHub and lead for the 1.17 release team, explained that sidecar containers gained increased focus “about a month ago,” and that its implementation “changes the pod spec, so this is a change that affects a lot of areas and needs to be handled with care.” She noted that it did move closer to completion and “will again be prioritized for 1.18.” - -**The impact**: You can read between the lines to understand a lot more about the Kubernetes sausage-making process. It's got governance, tradeoffs, themes, and timeframes; all the stuff that is often invisible to consumers of a project. - -_I hope you enjoyed this list of what stood out to me from last week and come back next Monday for more open source community, market, and industry trends._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/gartner-ectd-and-more-industry-trends - -作者:[Tim Hildred][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/thildred -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) -[2]: https://www.information-age.com/gartner-top-10-infrastructure-and-operations-trends-2020-123486509/ -[3]: https://superuser.openstack.org/articles/a-guide-to-kubernetes-etcd-all-you-need-to-know-to-set-up-etcd-clusters/ -[4]: https://www.forbes.com/sites/forbescommunicationscouncil/2019/11/19/how-the-open-source-model-could-fuel-the-future-of-digital-marketing/#71b602fb20a5 -[5]: https://www.sdxcentral.com/articles/news/kubernetes-integrates-interoperability-storage-waits-on-sidecars/2019/12/ -[6]: https://kubernetes.io/blog/2019/12/06/when-youre-in-the-release-team-youre-family-the-kubernetes-1.16-release-interview/ diff --git a/sources/news/20191219 Linux Mint 19.3 -Tricia- Released- Here-s What-s New and How to Get it.md b/sources/news/20191219 Linux Mint 19.3 -Tricia- Released- Here-s What-s New and How to Get it.md deleted file mode 100644 index 507915626b..0000000000 --- a/sources/news/20191219 Linux Mint 19.3 -Tricia- Released- Here-s What-s New and How to Get it.md +++ /dev/null @@ -1,165 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Linux Mint 19.3 “Tricia” Released: Here’s What’s New and How to Get it) -[#]: via: (https://itsfoss.com/linux-mint-19-3/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Linux Mint 19.3 “Tricia” Released: Here’s What’s New and How to Get it -====== - -_**Linux Mint 19.3 “Tricia” has been released. See what’s new in it and learn how to upgrade to Linux Mint 19.3.**_ - -The Linux Mint team finally announced the release of Linux Mint 19.3 codenamed ‘Tricia’ with useful feature additions along with a ton of improvements under-the-hood. - -This is a point release based on the latest **Ubuntu 18.04.3** and it comes packed with the **Linux kernel 5.0**. - -I downloaded and quickly tested the edition featuring the [Cinnamon 4.4][1] desktop environment. You may also try the Xfce or MATE edition of Linux Mint 19.3. - -### Linux Mint 19.3: What’s New? - -![Linux Mint 19 3 Desktop][2] - -While being an LTS release that will be supported until 2023 – it brings in a couple of useful features and improvements. Let me highlight some of them for you. - -#### System Reports - -![][3] - -Right after installing Linux Mint 19.3 (or upgrading it), you will notice a warning icon on the right side of the panel (taskbar). - -When you click on it, you should be displayed a list of potential issues that you can take care of to ensure the best out of Linux Mint experience. - -For starters, it will suggest that you should create a root password, install a language pack, or update software packages – in the form of a warning. This is particularly useful to make sure that you perform important actions even after following the first set of steps on the welcome screen. - -#### Improved Language Settings - -Along with the ability to install/set a language, you will also get the ability to change the time format. - -So, the language settings are now more useful than ever before. - -#### HiDPI Support - -As a result of [HiDPI][4] support, the system tray icons will look crisp and overall, you should get a pleasant user experience on a high-res display. - -#### New Applications - -![Linux Mint Drawing App][5] - -With the new release, you will n longer find “**GIMP**” pre-installed. - -Even though GIMP is a powerful utility, they decided to add a simpler “**Drawing**” app to let users to easily crop/resize images while being able to tweak it a little. - -Also, **Gnote** replaces **Tomboy** as the default note-taking application on Linux Mint 19.3 - -In addition to both these replacements, Celluloid video player has also been added instead of Xplayer. In case you did not know, Celluloid happens to be one of the [best open source video players][6] for Linux. - -#### Cinnamon 4.4 Desktop - -![Cinnamon 4 4 Desktop][7] - -In my case, the new Cinnamon 4.4 desktop experience introduces a couple of new abilities like adjusting/tweaking the panel zones individually as you can see in the screenshot above. - -#### Other Improvements - -There are several other improvements including more customizability options in the file manager and so on. - -You can read more about the detailed changes in the [official release notes][8]. - -[Subscribe to our YouTube channel for more Linux videos][9] - -### Linux Mint 19 vs 19.1 vs 19.2 vs 19.3: What’s the difference? - -You probably already know that Linux Mint releases are based on Ubuntu long term support releases. Linux Mint 19 series is based on Ubuntu 18.04 LTS. - -Ubuntu LTS releases get ‘point releases’ on the interval of a few months. Point release basically consists of bug fixes and security updates that have been pushed since the last release of the LTS version. This is similar to the Service Pack concept in Windows XP if you remember it. - -If you are going to download Ubuntu 18.04 which was released in April 2018 in 2019, you’ll get Ubuntu 18.04.2. The ISO image of 18.04.2 will consist of 18.04 and the bug fixes and security updates applied till 18.04.2. Imagine if there were no point releases, then right after [installing Ubuntu 18.04][10], you’ll have to install a few gigabytes of system updates. Not very convenient, right? - -But Linux Mint has it slightly different. Linux Mint has a major release based on Ubuntu LTS release and then it has three minor releases based on Ubuntu LTS point releases. - -Mint 19 was based on Ubuntu 18.04, 19.1 was based on 18.04.1 and Mint 19.2 is based on Ubuntu 18.04.2. Similarly, Mint 19.3 is based on Ubuntu 18.04.3. It is worth noting that all Mint 19.x releases are long term support releases and will get security updates till 2023. - -Now, if you are using Ubuntu 18.04 and keep your system updated, you’ll automatically get updated to 18.04.1, 18.04.2 etc. That’s not the case in Linux Mint. - -Linux Mint minor releases also consist of _feature changes_ along with bug fixes and security updates and this is the reason why updating Linux Mint 19 won’t automatically put you on 19.1. - -Linux Mint gives you the option if you want the new features or not. For example, Mint 19.3 has Cinnamon 4.4 and several other visual changes. If you are happy with the existing features, you can stay on Mint 19.2. You’ll still get the necessary security and maintenance updates on Mint 19.2 till 2023. - -Now that you understand the concept of minor releases and want the latest minor release, let’s see how to upgrade to Mint 19.3. - -### Linux Mint 19.3: How to Upgrade? - -No matter whether you have Linux Mint 19.1 or 19, you can follow these steps to [upgrade Linux Mint version][11]. - -**Note**: _You should consider making a system snapshot (just in case) for backup. In addition, the Linux Mint team advises you to disable the screensaver and upgrade Cinnamon spices (if installed) from the System settings._ - -![][12] - - 1. Launch the Update Manager. - 2. Now, refresh it to load up the latest available updates (or you can change the mirror if you want). - 3. Once done, simply click on the Edit button to find “**Upgrade to Linux Mint 19.3 Tricia**” button similar to the image above. - 4. Finally, just follow the on-screen instructions to easily update it. - - - -Based on your internet connection, it should take anything between a couple of minutes to 30 minutes. - -### Don’t see Mint 19.3 update yet? Here’s what you can do - -If you don’t see the option to upgrade to Linux Mint 19.3 Tricia, don’t lose hope. Here are a couple of things you can do. - -#### **Step 1: Make sure to use mint-upgrade-info version 1.1.3** - -Make sure that mint-upgrade-info is updated to version 1.1.3. You can try the install command that will update it to a newer version (if there is any). - -``` -sudo apt install mint-upgrade-info -``` - -#### **Step 2: Switch to default software sources** - -Chances are that you are using a mirror closer to you to get faster software downloads. But this could cause a problem as the mirrors might not have the new upgrade info yet. - -Go to Software Source and change the sources to default. Now run the update manager again and see if Mint 19.3 upgrade is available. - -### Download Linux Mint 19.3 ‘Tricia’ - -If you want to perform a fresh install, you can easily download the latest available version from the official download page (depending on what edition you want). - -You will also find multiple mirrors available to download the ISOs – feel free to try the nearest mirror for potentially faster download. - -[Linux Mint 19.3][13] - -**Wrapping Up** - -Have you tried Linux Mint 19.3 yet? Let me know your thoughts in the comments down below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/linux-mint-19-3/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://github.com/linuxmint/cinnamon/releases/tag/4.4.0 -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/linux-mint-19-3-desktop.jpg?ssl=1 -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/linux-mint-system-report.jpg?ssl=1 -[4]: https://wiki.archlinux.org/index.php/HiDPI -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/linux-mint-drawing-app.jpg?ssl=1 -[6]: https://itsfoss.com/video-players-linux/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/cinnamon-4-4-desktop.jpg?ssl=1 -[8]: https://linuxmint.com/rel_tricia_cinnamon.php -[9]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[10]: https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/ -[11]: https://itsfoss.com/upgrade-linux-mint-version/ -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/mintupgrade.png?ssl=1 -[13]: https://linuxmint.com/download.php diff --git a/sources/news/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md b/sources/news/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md deleted file mode 100644 index 3cf9d05097..0000000000 --- a/sources/news/20191221 Eliminating gender bias in open source software development, a database of microbes, and more open source news.md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Eliminating gender bias in open source software development, a database of microbes, and more open source news) -[#]: via: (https://opensource.com/article/19/12/news-december-21) -[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt) - -Eliminating gender bias in open source software development, a database of microbes, and more open source news -====== -Catch up on the biggest open source headlines from the past two weeks. -![Weekly news roundup with TV][1] - -In this edition of our open source news roundup, we take a look at eliminating gender bias in open source software development, an open source database of microbes, an open source index for cooperatives, and more! - -### Eliminating gender bias from open source development - -It's a sad fact that certain groups, among them women, are woefully underrepresented in open source projects. It's like a bug in the open source development process. Fortunately, there are initiatives to make that under representation a thing of the past. A study out of Oregon State University (OSU) intends to resolve the issue of the lack of women in open source development by "[finding these bugs and proposing redesigns around them][2], leading to more gender-inclusive tools used by software developers." - -The study will look at tools commonly used in open source development — including Eclipse, GitHub, and Hudson — to determine if they "significantly discourage newcomers, especially women, from joining OSS projects." According to Igor Steinmacher, one of the principal investigators of the study, the study will examine "how people use tools because the 'bugs' may be embedded in how the tool was designed, which may place people with different cognitive styles at a disadvantage." - -The developers of the tools being studied will walk through their software and answer questions based on specific personas. The researchers at OSU will suggest ways to redesign the software to eliminate gender bias and will "create a list of best practices for fixing gender-bias bugs in both products and processes." - -### Canadian university compiles open source microbial database - -What do you do when you have a vast amount of data but no way to effectively search and build upon it? You turn it into a database, of course. That's what researchers at Simon Fraser University in British Columbia, along with collaborators from around the globe, did with [information about chemical compounds created by bacteria and fungi][3]. Called the Natural Products Atlas, the database "holds information on nearly 25,000 natural compounds and serves as a knowledge base and repository for the global scientific community." - -Licensed under a Creative Commons Attribution 4.0 International License, the Natural Products Atlas "holds information on nearly 25,000 natural compounds and serves as a knowledge base and repository for the global scientific community." The [website for the Natural Products Atlas][4] hosts the database also includes a number of visualization tools and is fully searchable. - -Roger Linington, an associate professor at SFU who spearheaded the creation of the database, said that having "all the available data in one place and in a standardized format means we can now index natural compounds for anyone to freely access and learn more about." - -### Open source index for cooperatives - -Europe has long been a hotbed of both open source development and open source adoption. While European governments strongly advocate open source, non profits have been following suit. One of those is Cooperatives Europe, which is developing "[open source software to allow users to index co-op information and resources in a standardised way][5]." - -The idea behind the software, called Coop Starter, reinforces the [essential freedoms of free software][6]: it's intended to provide "education, training and information. The software may be used and repurposed by the public for their own needs and on their own infrastructure." Anyone can use it "to reference existing material on co-operative entrepreneurship" and can contribute "by sharing resources and information." - -The [code for Coop Starter][7], along with a related WordPress plugin, is available from Cooperative Europe's GitLab repository. - -#### In other news - - * [Nancy recognised as France’s top digital free and collaborative public service][8] - * [Open Source and AI: Ready for primetime in government?][9] - * [Open Software Means Kinder Science][10] - * [New Open-Source CoE to be launched by Wipro and Oman’s Ministry of Tech & Communication][11] - - - -_Thanks, as always, to Opensource.com staff members and [Correspondents][12] for their help this week._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/news-december-21 - -作者:[Scott Nesbitt][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/scottnesbitt -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/weekly_news_roundup_tv.png?itok=B6PM4S1i (Weekly news roundup with TV) -[2]: https://techxplore.com/news/2019-12-professors-gender-biased-bugs-open-source-software.html -[3]: https://www.sfu.ca/sfunews/stories/2019/12/sfu-global-collaboration-creates-world-s-first-open-source-datab.html -[4]: https://www.npatlas.org/joomla/ -[5]: https://www.thenews.coop/144412/sector/regional-organisations/cooperatives-europe-builds-open-source-index-for-the-co-op-movement/ -[6]: https://www.gnu.org/philosophy/free-sw.en.html -[7]: https://git.happy-dev.fr/startinblox/applications/coop-starter -[8]: https://joinup.ec.europa.eu/collection/open-source-observatory-osor/news/territoire-numerique-libre -[9]: https://federalnewsnetwork.com/commentary/2019/12/open-source-and-ai-ready-for-primetime-in-government/ -[10]: https://blogs.scientificamerican.com/observations/open-software-means-kinder-science/ -[11]: https://www.indianweb2.com/2019/12/11/new-open-source-coe-to-be-launched-by-wipro-and-omans-ministry-of-tech-communication/ -[12]: https://opensource.com/correspondent-program diff --git a/sources/news/20200116 It-s the end for Windows Server 2008 support.md b/sources/news/20200116 It-s the end for Windows Server 2008 support.md deleted file mode 100644 index 35e25fc844..0000000000 --- a/sources/news/20200116 It-s the end for Windows Server 2008 support.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (It’s the end for Windows Server 2008 support) -[#]: via: (https://www.networkworld.com/article/3513980/it-s-the-end-for-windows-server-2008-support.html) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -It’s the end for Windows Server 2008 support -====== -Microsoft recommends migrating Server 2008 workloads to Azure cloud services while enterprises modernize their apps for Windows Server 2016 or 2019 deployments. -PaulFleet / Getty Images / Microsoft - -This week's Patch Tuesday marked the end of the line for both Windows 7 and Windows Server 2008 (and 2008 R2). No more fixes will be issued for the two aged operating systems, unless you purchase a pricey extended service license. - -On the Windows 7 front, Microsoft has done a good job getting Windows 10 deployed through its aggressive (perhaps too aggressive) upgrade program. According to StatCounter, Windows 10 now accounts for 65% of the [worldwide desktop Windows market share][1], and Windows 7 is down to 27%. - -**RELATED:** [What to know before upgrading to Windows Server 2019][2] - -But while Windows 7 has gotten all the attention, Server 2008 actually has a larger share of holdouts, and in some ways, its end-of-life milestone is more significant. At last July’s Inspire show, a Microsoft executive said in an interview with cloud storage provider and Microsoft partner Carbonite that [60% of its current Windows Server][3] installed base was running Server 2008, accounting for 24 million instances.  - -[][4] - -BrandPost Sponsored by HPE - -[Take the Intelligent Route with Consumption-Based Storage][4] - -Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency. - -“There are a lot [of customers sticking with Server 2008],” says analyst Tim Crawford of research and advisory firm [AVOA][5]. “You could categorize them into those that either a) use functions specific to WS2008, and b) those that use a version of an application that is only compatible with WS2008. Upgrading is often easier said than done. Especially if the application is a custom app with lots of tentacles.” - -Server 2008 is based on the Windows Vista codebase, which should be reason alone to jettison it. But Windows Server 2016 and Windows Server 2019 are built on Windows 10, which means apps heavily dependent on the OS ecosystem might be hard to move since the internals are so different. - -“I do work with folks that are still running Windows Server 2008. They understand the ramifications of EOL for support. But most are in a predicament where they aren’t able to move the applications for a number of reasons, including application compatibility, location, etc.," Crawford says. - -For those apps that are challenging to move, he recommends isolating the system as much as possible to protect it, and putting in a plan to do what is needed to the applications to prepare them for movement as quickly as possible. - -Microsoft offers and recommends [Azure migration][6], so Server 2008 apps can [run in an Azure instance][7] while they are modernized for Server 2019 and then deployed on premises. - -Migration should be the paramount effort, because if you are running Server 2008 then you're using hardware that's at least eight years old and potentially 12 years old. That’s ancient in technology terms, and if nothing else, the hardware is going to fail. - -One of the headaches for admins is you cannot migrate Server 2008 directly to 2016 or 2019. You have to upgrade to Server 2012 as an intermediate step. So you are better off biting the bullet and migrating the apps to 2019 rather than spending time on two OS migrations. - -Microsoft has provided [resources][8] for Server 2008 users, including a migration guide and help moving to Azure. - -Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3513980/it-s-the-end-for-windows-server-2008-support.html - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://gs.statcounter.com/os-version-market-share/windows/desktop/worldwide#monthly-201807-201908 -[2]: https://www.networkworld.com/article/3512020/what-to-know-before-upgrading-from-windows-server-2016-to-server-2019.html -[3]: https://www.carbonite.com/blog/article/2019/07/schuster-azure-migration-and-office-365-top-partner-opportunities -[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage) -[5]: https://avoa.com/ -[6]: https://cloudblogs.microsoft.com/windowsserver/2019/12/17/protect-workloads-still-running-on-windows-server-2008-and-2008-r2/ -[7]: https://www.networkworld.com/article/3300165/microsoft-lures-win-server-2008-users-toward-azure.html -[8]: https://www.microsoft.com/en-us/cloud-platform/windows-server-2008 -[9]: https://www.facebook.com/NetworkWorld/ -[10]: https://www.linkedin.com/company/network-world From 3110b8c5f73f00656dafcc0f942a27ac70908a62 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 22:58:47 +0800 Subject: [PATCH 415/430] =?UTF-8?q?=E6=B8=85=E9=99=A4=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...y Banning Linux Gamers on Battlefield V.md | 86 ------------------- 1 file changed, 86 deletions(-) delete mode 100644 sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md diff --git a/sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md b/sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md deleted file mode 100644 index b0818e5fe8..0000000000 --- a/sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (fuzheng1998) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Shocking! EA is Permanently Banning Linux Gamers on Battlefield V) -[#]: via: (https://itsfoss.com/ea-banning-linux-gamers/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Shocking! EA is Permanently Banning Linux Gamers on Battlefield V -====== - -Only when I thought that [EA][1] as a game company might be getting better after [its decision to make its games available on Steam][2] – but it looks like that isn’t the case. - -In a [Reddit thread][3], a lot of Linux players seem to complain about getting banned by FairFight (which is the server-side anti-cheat engine used for BF V) just because they chose to play Battlefield V (BF V) on [Linux using Wine][4]. - -![][5] - -### Is this a widespread issue? - -Unfortunately, it seems to be the case with a number of Linux players using Wine to play Battlefield V on Linux. - -You can also find users on [Lutris Gaming forums][6] and [Battlefield forums][7] talking about it. - -Of course, the userbase on Linux playing Battlefield V isn’t huge – but it still matters, right? - -### What’s exactly the issue here? - -It looks like EA’s anti-cheat tech considers [DXVK][8] (Vulkan-based implementation of DirectX which tries to solve compatibility issues) as cheating. - -So, basically, the compatibility layer that is being utilized to make it possible to run Battlefield V is being detected as a modified file through which you’re “**potentially**” cheating. - -![Battlefield V on Lutris][9] - -Even though this could be an innocent problem for the anti-cheat engine but EA does not seem to acknowledge that at all. - -Here’s what they respond with when one of the players wrote an email to EA in order to lift the ban: - -> After thoroughly investigating your account and concern, we found that your account was actioned correctly and will not remove this sanction from your account. - -Also, with all this going on, [Lutris Gaming][10] seems to be quite furious on EA’s behavior with the permanent bans: - -> It has come to our attention that several Battlefield 5 players have recently been banned for playing on Linux, and that EA has chosen not to revert these wrongful punishments. Due to this, we advise to refrain from playing any multiplayer games published by [@EA][11] in the future. -> -> — Lutris Gaming (@LutrisGaming) [January 2, 2020][12] - -### Not just Battlefield V, it’s the same with Destiny 2 - -As pointed by a Redditor in the same thread, Bungie also happens to consider Wine as an emulator (which is against their policy) and has banned players on Linux a while back. - -### EA needs to address the issue - -_We have reached out to EA for a comment on the issue_. _And, we’re still waiting for a response._ - -I shall update the article if we have an official response from EA. However, considering Blizzard as an example, they should actually work on fixing the issue and [reverse the bans on players using Linux][13]. - -I know that BF V does not offer native Linux support – but supporting the compatibility layer and not considering it as cheating would allow Linux users to experience the game which they rightfully own (or considering to purchase). - -What are your thoughts on this? Let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ea-banning-linux-gamers/ - -作者:[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.ea.com/ -[2]: https://thenextweb.com/gaming/2019/10/29/ea-games-are-coming-back-to-steam-but-you-still-need-origin/ -[3]: https://www.reddit.com/r/linux/comments/ej3q2p/ea_is_permanently_banning_linux_players_on/ -[4]: https://itsfoss.com/install-latest-wine/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/reddit-thread-ea.jpg?ssl=1 -[6]: https://forums.lutris.net/t/ea-banning-dxvk-on-battlefield-v/7810 -[7]: https://forums.battlefield.com/en-us/discussion/197938/ea-banning-dxvk-on-battlefield-v-play-linux -[8]: https://github.com/doitsujin/dxvk -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/battlefield-v-lutris-gaming.png?ssl=1 -[10]: https://lutris.net/ -[11]: https://twitter.com/EA?ref_src=twsrc%5Etfw -[12]: https://twitter.com/LutrisGaming/status/1212827248430059520?ref_src=twsrc%5Etfw -[13]: https://www.altchar.com/game-news/blizzard-unbans-overwatch-players-who-used-linux-os-agF9y0G2gWjn From ed7a5bf514fc73328748904a1462dea75044319a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 23:17:36 +0800 Subject: [PATCH 416/430] PRF --- .../tech/20200115 6 handy Bash scripts for Git.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/translated/tech/20200115 6 handy Bash scripts for Git.md b/translated/tech/20200115 6 handy Bash scripts for Git.md index 93a0d97796..c79d228fad 100644 --- a/translated/tech/20200115 6 handy Bash scripts for Git.md +++ b/translated/tech/20200115 6 handy Bash scripts for Git.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (6 handy Bash scripts for Git) @@ -12,9 +12,9 @@ > 当使用 Git 存储库时,这六个 Bash 脚本将使你的生活更轻松。 -![Digital hand surrounding by objects, bike, light bulb, graphs][1] +![](https://img.linux.net.cn/data/attachment/album/202001/18/231713jegbk8fyek798gxb.jpg) -我编写了许多 Bash 脚本,这些脚本使我在使用 Git 存储库时工作更加轻松。我的许多同事说没有必要;我所做的一切都可以用 Git 命令完成。虽然这可能是正确的,但我发现脚本远比尝试找出适当的 Git 命令来执行我想要的操作更加方便。 +我编写了许多 Bash 脚本,这些脚本使我在使用 Git 存储库时工作更加轻松。我的许多同事说没有必要:我所做的一切都可以用 Git 命令完成。虽然这可能是正确的,但我发现脚本远比尝试找出适当的 Git 命令来执行我想要的操作更加方便。 ### 1、gitlog @@ -126,7 +126,7 @@ Compare script generated at: /tmp/compare_mismatches.sh ### 6、gitlog.find -最后,我有一个 `gitlog.find` 脚本,可以帮助我识别补丁程序的上游版本在哪里以及每个补丁程序的当前状态。它通过匹配补丁说明来实现。它还会生成一个比较脚本(再次使用了 Kompare),以将当前补丁与上游对应补丁进行比较: +最后,我有一个 `gitlog.find` 脚本,可以帮助我识别补丁程序的上游版本在哪里以及每个补丁的当前状态。它通过匹配补丁说明来实现。它还会生成一个比较脚本(再次使用了 Kompare),以将当前补丁与上游对应补丁进行比较: ``` $ gitlog.find @@ -498,7 +498,7 @@ via: https://opensource.com/article/20/1/bash-scripts-git 作者:[Bob Peterson][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6f7dce0842a80c0bc4ecc5ad05d9cd88a1e9fec5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Jan 2020 23:18:26 +0800 Subject: [PATCH 417/430] PUB @wxy https://linux.cn/article-11797-1.html --- .../20200115 6 handy Bash scripts for Git.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200115 6 handy Bash scripts for Git.md (99%) diff --git a/translated/tech/20200115 6 handy Bash scripts for Git.md b/published/20200115 6 handy Bash scripts for Git.md similarity index 99% rename from translated/tech/20200115 6 handy Bash scripts for Git.md rename to published/20200115 6 handy Bash scripts for Git.md index c79d228fad..8a43bb3220 100644 --- a/translated/tech/20200115 6 handy Bash scripts for Git.md +++ b/published/20200115 6 handy Bash scripts for Git.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11797-1.html) [#]: subject: (6 handy Bash scripts for Git) [#]: via: (https://opensource.com/article/20/1/bash-scripts-git) [#]: author: (Bob Peterson https://opensource.com/users/bobpeterson) From 0e3c0feb1c1378f28c860c26ad6cfcf949245c25 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 19 Jan 2020 00:57:46 +0800 Subject: [PATCH 418/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200119=20How=20?= =?UTF-8?q?to=20Set=20or=20Change=20Timezone=20in=20Ubuntu=20Linux=20[Begi?= =?UTF-8?q?nner=E2=80=99s=20Tip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md --- ...imezone in Ubuntu Linux -Beginner-s Tip.md | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md diff --git a/sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md b/sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md new file mode 100644 index 0000000000..869e8b1d79 --- /dev/null +++ b/sources/tech/20200119 How to Set or Change Timezone in Ubuntu Linux -Beginner-s Tip.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Set or Change Timezone in Ubuntu Linux [Beginner’s Tip]) +[#]: via: (https://itsfoss.com/change-timezone-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Set or Change Timezone in Ubuntu Linux [Beginner’s Tip] +====== + +[When you install Ubuntu][1], it asks you to set timezone. If you chose a wrong timezone or if you have moved to some other part of the world, you can easily change it later. + +### How to change Timezone in Ubuntu and other Linux distributions + +There are two ways to change the timezone in Ubuntu. You can use the graphical settings or use the timedatectl command in the terminal. You may also change the /etc/timezone file directly but I won’t advise that. + +I’ll show you both graphical and terminal way in this beginner’s tutorial: + + * [Change timezone in Ubuntu via GUI][2] (suitable for desktop users) + * [Change timezone in Ubuntu via command line][3] (works for both desktop and servers) + + + +![][4] + +#### Method 1: Change Ubuntu timezone via terminal + +[Ubuntu][5] or any other distributions using systemd can use the timedatectl command to set timezone in Linux terminal. + +You can check the current date and timezone setting using timedatectl command without any option: + +``` +[email protected]:~$ timedatectl + Local time: Sat 2020-01-18 17:39:52 IST + Universal time: Sat 2020-01-18 12:09:52 UTC + RTC time: Sat 2020-01-18 12:09:52 + Time zone: Asia/Kolkata (IST, +0530) + System clock synchronized: yes +systemd-timesyncd.service active: yes + RTC in local TZ: no +``` + +As you can see in the output above, my system uses Asia/Kolkata. It also tells me that it is 5:30 hours ahead of GMT. + +To set a timezone in Linux, you need to know the exact timezone. You must use the correct format of the timezone (which is Continent/City). + +To get the timezone list, use the _list-timezones_ option of _timedatectl_ command: + +``` +timedatectl list-timezones +``` + +It will show you a huge list of the available time zones. + +![Timezones List][6] + +You can use the up and down arrow or PgUp and PgDown key to move between the pages. + +You may also grep the output and search for your timezone. For example, if you are looking for time zones in Europe, you may use: + +``` +timedatectl list-timezones | grep -i europe +``` + +Let’s say you want to set the timezone to Paris. The timezone value to be used here is Europe/Paris: + +``` +timedatectl set-timezone Europe/Paris +``` + +It won’t show any success message but the timezone is changed instantly. You don’t need to restart or log out. + +Keep in mind that though you don’t need to become root user and use sudo with the command but your account still need to have admin rights in order to change the timezone. + +You can verify the changed time and timezone by using the [date command][7]: + +``` +[email protected]:~$ date +Sat Jan 18 13:56:26 CET 2020 +``` + +#### Method 2: Change Ubuntu timezone via GUI + +Press the super key (Windows key) and search for Settings: + +![Applications Menu Settings][8] + +Scroll down a little and look for Details in the left sidebar: + +![Go to Settings -> Details][9] + +In Details, you’ll fine Date & Time in the left sidebar. Here, you should turn off Automatic Time Zone option (if it is enabled) and then click on the Time Zone: + +![In Details -> Date & Time, turn off the Automatic Time Zone][10] + +When you click the Time Zone, it will open an interactive map and you can click on the geographical location of your choice and close the window. + +![Select a timezone][11] + +You don’t have to do anything other than closing this map after selecting the new timezone. No need to logout or [shutdown Ubuntu][12]. + +I hope this quick tutorial helped you to change timezone in Ubuntu and other Linux distributions. If you have questions or suggestions, please let me know. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/change-timezone-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-ubuntu/ +[2]: tmp.bHvVztzy6d#change-timezone-gui +[3]: tmp.bHvVztzy6d#change-timezone-command-line +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/Ubuntu_Change-_Time_Zone.png?ssl=1 +[5]: https://ubuntu.com/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/timezones_in_ubuntu.jpg?ssl=1 +[7]: https://linuxhandbook.com/date-command/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/applications_menu_settings.jpg?ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/settings_detail_ubuntu.jpg?ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/change_timezone_in_ubuntu.jpg?ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/change_timezone_in_ubuntu_2.jpg?ssl=1 +[12]: https://itsfoss.com/schedule-shutdown-ubuntu/ From 94cca4d8c50ad967d844c8bab80319d6899aabca Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 19 Jan 2020 00:58:31 +0800 Subject: [PATCH 419/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200118=20Keep?= =?UTF-8?q?=20a=20journal=20of=20your=20activities=20with=20this=20Python?= =?UTF-8?q?=20program?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200118 Keep a journal of your activities with this Python program.md --- ...our activities with this Python program.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20200118 Keep a journal of your activities with this Python program.md diff --git a/sources/tech/20200118 Keep a journal of your activities with this Python program.md b/sources/tech/20200118 Keep a journal of your activities with this Python program.md new file mode 100644 index 0000000000..b5d3cf93a4 --- /dev/null +++ b/sources/tech/20200118 Keep a journal of your activities with this Python program.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Keep a journal of your activities with this Python program) +[#]: via: (https://opensource.com/article/20/1/python-journal) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Keep a journal of your activities with this Python program +====== +Jrnl creates a searchable, timestamped, exportable, and (if you want) +encrypted log of your daily activities. Learn more in the eighth in our +series on 20 ways to be more productive with open source in 2020. +![Writing in a notebook][1] + +Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. + +### Journaling with jrnl + +At my workplace, many of us post an "end of day" status to Slack before we leave for the day. With a lot of projects going on and a global team, it is a pretty good way to share what you got done, what isn't done, and what you need help with. But some days are so busy, so hectic that I can't remember what I did. And this is where journaling comes in. + +![jrnl][2] + +It's pretty easy to keep a text editor open and just add a line when you do something. But it can be challenging to go back and figure out when you make a particular note or pull out related lines quickly and easily. Fortunately, [jrnl][3] is here to help. + +Jrnl allows you to enter a quick entry from your command line, search past entries, and export to rich text formats like HTML and Markdown. You can have multiple journals, meaning you can keep your work entries separated from private ones. It stores entries as plain text, so even if jrnl stops working, you have your data. + +Since jrnl is a Python program, the easiest way to install it is with **pip3 install jrnl**; this will make sure you get the latest and greatest version. On its first run, it will ask some questions, and then you are good to go. + +![jrnl's first run][4] + +Now, whenever you need to make a note or log work, simply type **jrnl <some text>,** and it will be logged with a timestamp to the default file. You can search for entries on a specific date with **jrnl -on YYYY-MM-DD**, entries since a date with **jrnl -from YYYY-MM-DD**, and entries up to a specific date with **jrnl -to YYYY-MM-DD**. Search terms can be combined with the **-and** parameter, allowing for searches like **jrnl -from 2019-01-01 -and -to 2019-12-31**. + +You can also edit entries in the journal with the **\--edit** command-line flag. Before you do, set up your default editor for entries by editing the file **~/.config/jrnl/jrnl.yaml**. This is also where you can specify what files to use for journals, what special character to use for tags, and a few other options. Right now, the important thing is to set the editor. I use Vim, and jrnl's documentation has some [helpful hints][5] for using other editors like VSCode and Sublime Text. + +![Example jrnl config file][6] + +Jrnl can also encrypt journal files. By setting the global **encrypt** variable, you'll tell jrnl to encrypt all the journals you have defined. Encryption can also be set per file by adding **encrypt: true** to the definition in the configuration file. + + +``` +journals: +  default: ~/journals/journal.txt +  work: ~/journals/work.txt +  private: +    journal: ~/journals/private.txt +    encrypt: true +``` + +If a journal isn't already encrypted, you will be prompted for the password on any actions for that journal. The journal file will be stored encrypted on disk and safe from prying eyes. [The jrnl documentation][7] has a lot more information on how it works, what ciphers it uses, and so on. + +![Encrypted jrnl file][8] + +Journaling helps me remember what I did when and find it later when I need it. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/python-journal + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/notebook-writing-pen.jpg?itok=uA3dCfu_ (Writing in a notebook) +[2]: https://opensource.com/sites/default/files/uploads/productivity_8-1.png (jrnl) +[3]: https://jrnl.sh/ +[4]: https://opensource.com/sites/default/files/uploads/productivity_8-2.png (jrnl's first run) +[5]: https://jrnl.sh/recipes/#external-editors +[6]: https://opensource.com/sites/default/files/uploads/productivity_8-3.png (Example jrnl config file) +[7]: https://jrnl.sh/encryption/ +[8]: https://opensource.com/sites/default/files/uploads/productivity_8-4.png (Encrypted jrnl file) From 26cbf9dc4e88111b8126a8c313d4319938d84988 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 19 Jan 2020 00:58:58 +0800 Subject: [PATCH 420/430] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200118=207=20th?= =?UTF-8?q?ings=20I=20learned=20from=20starting=20an=20open=20source=20pro?= =?UTF-8?q?ject?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200118 7 things I learned from starting an open source project.md --- ...ed from starting an open source project.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20200118 7 things I learned from starting an open source project.md diff --git a/sources/tech/20200118 7 things I learned from starting an open source project.md b/sources/tech/20200118 7 things I learned from starting an open source project.md new file mode 100644 index 0000000000..4742064f15 --- /dev/null +++ b/sources/tech/20200118 7 things I learned from starting an open source project.md @@ -0,0 +1,97 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 things I learned from starting an open source project) +[#]: via: (https://opensource.com/article/20/1/open-source-project) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) + +7 things I learned from starting an open source project +====== +It's not really about project mechanics at all. +![Stickers from all different open source projects and communities][1] + +I'm currently involved—heavily involved—in [Enarx][2], an open source (of course!) project to support running sensitive workloads on untrusted hosts. I've had involvement in various open source projects over the years, but this is the first for which I'm one of the founders. We're at the stage now where we've got a fair amount of code, quite a lot of documentation, a logo, and (important!) stickers. The project will hopefully be included in a Linux Foundation group—the [Confidential Computing Consortium][3]—so things are going very well indeed. + +I thought it might be useful to reflect on some of the things we did to get things going. To be clear, Enarx is a particular type of project, one that we believe has commercial and enterprise applications. It's also not mature yet, and we'll have hurdles and challenges along the way. What's more, the route we've taken won't be right for all projects, but hopefully, there's enough here to give a few pointers to other projects or people considering starting one up. + +The first thing I'd say is that there's lots of help to be had out there. I'd start with Opensource.com, where you'll find [lots of guidance][4]. I'll follow up by saying that, however much of it you follow, you'll still get things wrong. That said, here's my list of things to consider when starting an open source project. + +### 1\. Aim for critical mass + +I'm very lucky to work at the amazing [Red Hat][5], where everything we do is open source and where we take open source and community very seriously. I've heard it called a "critical mass" company—in order to get something taken seriously, you need to get enough people interested in it that it's difficult to ignore. Enarx's two co-founders—Nathaniel McCallum and I—are both very enthusiastic about the project and have spent a lot of time gaining sponsors within the organisation (you know who you are, and we thank you—we also know we haven't done a good enough job with you on all occasions!) and "selling" it to engineers to get them interested enough that it was difficult to stop. + +Some projects just bobble along with one or two contributors, but if you want to attract people and attention, getting a good set of people together who can get momentum going is a must. + +### 2\. Create a demo + +If you want to get people involved, a demo is great. It doesn't necessarily need to be polished, but it does need to show that what you're doing is possible and that you know what you're doing. For early demos, you may be talking about command-line output; that's fine if what you're providing isn't a user interface (UI) product. Being able to talk about what you're doing and convey both your passion and the importance of the project is a great boon. People like to be able to _see_ or _experience_ something, and it's much easier to communicate your enthusiasm if they have something real that expresses that. + +### 3\. Choose a license + +Once you have code and it's open source, you want other people to be able to contribute. This may seem like an unimportant step, but selecting an appropriate open source licence[1][6] will allow other people to contribute on well-understood and defined terms, making it easier for them to be involved—and for the organisations for which they work to allow them to do so. + +### 4\. Get documentation + +You might think that developer documentation is the most important to get out there—otherwise, how will other people get involved in coding? I disagree, at least to start with. For a small project, you can probably scale to a few more people just by explaining what the code does, what it should do, and what's missing. However, if there's no documentation available to explain what it's for and how it's going to help people, then why would anyone bother even looking at it? + +This doesn't need to be polished marketing copy, and it doesn't need to be serious, but it does need to convey to people why they should care. It's also going to help you with the first point I mentioned, attaining critical mass, as being able to point to documentation, use cases, and the rest will help convince people that you've thought through the _point_ of your project. We've used a GitHub wiki as our main documentation hub, and we try to update it with new information as we generate it. This is an area, to be clear, where we could do better. But at least we know that. + +### 5\. Be visible + +People aren't going to find out about you unless you're visible. We were incredibly lucky in that the Confidential Computing Consortium was formed just as we were beginning to get to a level of critical mass, and we immediately had a platform to increase our exposure. We have a [Twitter account][7], I publish articles on [my blog][8], and at Opensource.com, we've been lucky enough to have the chance to publish on Red Hat's [now + Next][9] blog, I've done interviews with the press, and we speak at conferences wherever and whenever we can. + +We're very lucky to have these opportunities, and it's clear that not all these approaches are appropriate for all projects, but make use of what you can: the more that people know about you, the more people can contribute. + +### 6\. Be welcoming + +Let's assume that people have found out about you: what's next? Well, they're hopefully going to want to get involved. If they don't feel welcome, then any involvement they have will taper off quickly. Yes, you need documentation (and, after a while, technical documentation, no matter what I said above), but you also need ways for contributors to talk to you and for them to feel that they are valued. We have [Gitter channels][10], and our daily standups are open to anyone who wants to join. Recently, someone opened an issue on our [issues database][11], and during the conversation on that thread, it transpired that our daily standup time doesn't work for them (given their time zone), so we're going to ensure that at least once a week it _does_, and we've assured them that we'll accommodate them. + +### 7\. Work with people you like + +I really, really enjoy meeting and working with the members of the Enarx project team. We get on well, we joke, we laugh, and we share a common aim: to make Enarx successful. I'm a firm believer in doing things you enjoy, where possible. Particularly in the early stages of a project, you need people who are enthusiastic and enjoy working closely together—even if they're geographically separated by thousands of kilometres.[2][12] If they don't get on, there's a decent chance that your and their enthusiasm for the project will falter, that the momentum will be lost, and that the project will end up failing. You won't always get the chance to choose those with whom you work, but if you can, then choose people you like and get on with. + +### Conclusion: People + +I didn't realise it when I started writing this article, but it's not really about project mechanics at all: it's about people. If you read back, you'll find the importance of people visible in every tip, even the one about choosing a license. Open source projects aren't really about code: they're about people, how they share, how they work together, and how they interact. + +I'm certain that your experience of open source projects will vary, and I'd be very surprised if everyone agrees about the top seven things you should do for project success. Arguably, Enarx _isn't_ a success yet, and I shouldn't be giving advice at this stage of our maturity. But when I think back to all of the open source projects that I can think of that _are_ successful, people feature strongly, and I don't think that's a surprise at all. + +* * * + + 1. Or "license," if you're from the US. + 2. Or, in fact, miles. + + + +* * * + +_This article originally appeared on [Alice, Eve, and Bob – a security blog][13] and is republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-project + +作者:[Mike Bursell][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mikecamel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/stickers-osdc-lead.png?itok=2RNn132b (Stickers from all different open source projects and communities) +[2]: https://enarx.io/ +[3]: https://confidentialcomputing.io/ +[4]: https://opensource.com/article/20/1/getting-started-open-source +[5]: https://redhat.com/ +[6]: tmp.3liT27tUaE#1 +[7]: https://twitter.com/enarxproject +[8]: https://aliceevebob.com/ +[9]: https://next.redhat.com/ +[10]: https://gitter.im/enarx/ +[11]: https://github.com/enarx/enarx/issues +[12]: tmp.3liT27tUaE#2 +[13]: https://aliceevebob.com/2019/12/17/7-tips-for-kicking-off-an-open-source-project/ From e27da301f1cb0afdfa8d1ca0c484cf9d83256811 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 19 Jan 2020 07:04:39 +0800 Subject: [PATCH 421/430] Rename sources/tech/20200118 7 things I learned from starting an open source project.md to sources/talk/20200118 7 things I learned from starting an open source project.md --- ...118 7 things I learned from starting an open source project.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200118 7 things I learned from starting an open source project.md (100%) diff --git a/sources/tech/20200118 7 things I learned from starting an open source project.md b/sources/talk/20200118 7 things I learned from starting an open source project.md similarity index 100% rename from sources/tech/20200118 7 things I learned from starting an open source project.md rename to sources/talk/20200118 7 things I learned from starting an open source project.md From c52b867edbce1029d543eab3b0bf1605a8afc09d Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 19 Jan 2020 08:54:22 +0800 Subject: [PATCH 422/430] translating --- ...200114 Organize your email with Notmuch.md | 111 ------------------ ...200114 Organize your email with Notmuch.md | 109 +++++++++++++++++ 2 files changed, 109 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20200114 Organize your email with Notmuch.md create mode 100644 translated/tech/20200114 Organize your email with Notmuch.md diff --git a/sources/tech/20200114 Organize your email with Notmuch.md b/sources/tech/20200114 Organize your email with Notmuch.md deleted file mode 100644 index c9d5cac441..0000000000 --- a/sources/tech/20200114 Organize your email with Notmuch.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Organize your email with Notmuch) -[#]: via: (https://opensource.com/article/20/1/organize-email-notmuch) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Organize your email with Notmuch -====== -Notmuch indexes, tags, and sorts your email. Learn how to use it in the -fourth article in our series on 20 ways to be more productive with open -source in 2020. -![Filing cabinet for organization][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Index your email with Notmuch - -Yesterday, I talked about how I use OfflineIMAP to [sync my mail][2] to my local machine. Today, I'll talk about how I preprocess all that mail before I read it. - -![Notmuch][3] - -[Maildir][4] is probably one of the most useful mail storage formats out there. And there are a LOT of tools to help with managing your mail. The one I keep coming back to is a little program called [Notmuch][5] that indexes, tags, and searches mail messages. And there are several programs that work with Notmuch to make it even easier to handle a large amount of mail. - -Most Linux distributions include Notmuch, and you can also get it for MacOS. Windows users can access it through Windows Subsystem for Linux ([WSL][6]), but it may require some additional tweaks. - -![Notmuch's first run][7] - -On Notmuch's very first run, it will ask you some questions and create a **.notmuch-config** file in your home directory. Next, index and tag all your mail by running **notmuch new**. You can verify it with **notmuch search tag:new**; this will find all messages with the "new" tag. That's probably a lot of mail since Notmuch uses the "new" tag to indicate messages that are new to it, so you'll want to clean that up. - -Run **notmuch search tag:unread** to find any unread messages; that should result in quite a lot less mail. To remove the "new" tag from messages you've already seen, run **notmuch tag -new not tag:unread**, which will search for all messages without the "unread" tag and remove the "new" tag from them. Now when you run **notmuch search tag:new**, it should show only the unread mail messages. - -Tagging messages in bulk is probably more useful, though, since manually updating tags at every run can be really tedious. The **\--batch** command-line option tells Notmuch to read multiple lines of commands and execute them. There is also the **\--input=filename** option, which reads commands from a file and applies them. I have a file called **tagmail.notmuch** that I use to add tags to mail that is "new"; it looks something like this: - - -``` -# Manage sent, spam, and trash folders --unread -new folder:Trash --unread -new folder:Spam --unread -new folder:Sent - -# Note mail sent specifically to me (excluding bug mail) -+to-me to:kevin at sonney.com and tag:new and not tag:to-me - -# And note all mail sent from me -+sent from:kevin at sonney.com and tag:new and not tag:sent - -# Remove the new tag from messages --new tag:new -``` - -I can then run **notmuch tag --input=tagmail.notmuch** to bulk-process my mail messages after running **notmuch new**, and then I can search on those tags as well. - -Notmuch also supports running pre- and post-new hooks. These scripts, stored in **Maildir/.notmuch/hooks**, define actions to run before (pre-new) and after (post-new) to index new mail with **notmuch new**. In yesterday's article, I talked about using [OfflineIMAP][8] to sync mail from my IMAP server. It's very easy to run it from the "pre-new" hook: - - -``` -#!/bin/bash -# Remove the new tag from messages that are still tagged as new -notmuch tag -new tag:new - -# Sync mail messages -offlineimap -a LocalSync -u quiet -``` - -You can also use the Python application [afew][9], which interfaces with the Notmuch database, to tag things like _Mailing List_ and _Spam_ for you. You can run afew from the post-new hook in a similar way: - - -``` -#!/bin/bash -# tag with my custom tags -notmuch tag --input=~/tagmail.notmuch - -# Run afew to tag new mail -afew -t -n -``` - -I recommend that when using afew to tag messages, you do NOT use the **[ListMailsFilter]** since some mail handlers add obscure or downright junk List-ID headers to mail messages (I'm looking at you, Google). - -![alot email client][10] - -At this point, any mail reader that supports Notmuch or Maildir can work with my email. I'll sometimes use [alot][11], a Notmuch-specific client, to read mail at the console, but it's not as fancy as some other mail readers. - -In the coming days, I'll show you some other mail clients that will likely integrate with tools you already use. In the meantime, check out some of the other tools that work with Maildir mailboxes—you might find a hidden gem I've not tried yet. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/organize-email-notmuch - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_organize_letter.png?itok=GTtiiabr (Filing cabinet for organization) -[2]: https://opensource.com/article/20/1/sync-email-offlineimap -[3]: https://opensource.com/sites/default/files/uploads/productivity_4-1.png (Notmuch) -[4]: https://en.wikipedia.org/wiki/Maildir -[5]: https://notmuchmail.org/ -[6]: https://docs.microsoft.com/en-us/windows/wsl/install-win10 -[7]: https://opensource.com/sites/default/files/uploads/productivity_4-2.png (Notmuch's first run) -[8]: http://www.offlineimap.org/ -[9]: https://afew.readthedocs.io/en/latest/index.html -[10]: https://opensource.com/sites/default/files/uploads/productivity_4-3.png (alot email client) -[11]: https://github.com/pazz/alot diff --git a/translated/tech/20200114 Organize your email with Notmuch.md b/translated/tech/20200114 Organize your email with Notmuch.md new file mode 100644 index 0000000000..1d81905ea3 --- /dev/null +++ b/translated/tech/20200114 Organize your email with Notmuch.md @@ -0,0 +1,109 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Organize your email with Notmuch) +[#]: via: (https://opensource.com/article/20/1/organize-email-notmuch) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用 Notmuch 组织你的邮件 +====== +Notmuch 索引、标记和排序电子邮件。在我们的 20 个使用开源提升生产力的系列的第四篇文章中了解该如何使用。 +![Filing cabinet for organization][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 用 Notmuch 为你的邮件建立索引 + +昨天,我谈到了如何使用 OfflineIMAP [将我的邮件同步][2]到本地计算机。今天,我将讨论如何在阅读之前预处理所有邮件。 + +![Notmuch][3] + +[Maildir][4] 可能是最有用的邮件存储格式之一。有很多工具可以帮助你管理邮件。我经常使用一个名为 [Notmuch][5] 的小程序,它能索引、标记和搜索邮件。Notmuch 配合其他几个程序一起使用可以使处理大量邮件更加容易。 + +大多数 Linux 发行版都包含 Notmuch,你也可以在 MacOS 上获得它。Windows 用户可以通过 Linux 的 Windows 子系统([WSL][6])访问它,但可能需要进行一些其他调整。 + +![Notmuch's first run][7] + +Notmuch 首次运行时,它将询问你一些问题,并在家目录中创建 **.notmuch-config** 文件。接下来,运行 **notmuch new** 来索引并标记所有邮件。你可以使用 **notmuch search tag:new** 进行验证,它会找到所有带有 “new” 标签的消息。这可能会有很多邮件,因为 Notmuch 使用 “new” 标签来指示新邮件,因此你需要对其进行清理。 + +运行 **notmuch search tag:unread** 来查找未读消息,这会减少很多邮件。要从你已阅读的消息中删除 “new” 标签,请运行 **notmuch tag -new not tag:unread**,它将搜索所有没有 “unread” 标签的消息,并从其中删除 “new” 标签。现在,当你运行 **notmuch search tag:new**时,它将仅显示未读邮件。 + +但是,批量标记消息可能更有用,因为在每次运行时手动更新标记可能非常繁琐。**\--batch** 命令行选项告诉 Notmuch 读取多行命令并执行它们。还有一个 **\--input=filename** 选项,该选项从文件中读取命令并应用它们。我有一个名为 **tagmail.notmuch** 的文件,用于给”新“邮件添加标签;它看起来像这样: + + +``` +# Manage sent, spam, and trash folders +-unread -new folder:Trash +-unread -new folder:Spam +-unread -new folder:Sent + +# Note mail sent specifically to me (excluding bug mail) ++to-me to:kevin at sonney.com and tag:new and not tag:to-me + +# And note all mail sent from me ++sent from:kevin at sonney.com and tag:new and not tag:sent + +# Remove the new tag from messages +-new tag:new +``` + +我可以在运行 **notmuch new** 后运行 **notmuch tag --input=tagmail.notmuch** 批量处理我的邮件,之后我也可以搜索这些标签。 + +Notmuch 还支持 pre-new 和 post-new 钩子。这些脚本存放在 **Maildir/.notmuch/hooks** 中,它们定义了在使用 **notmuch new** 索引新邮件之前(pre-new)和之后(post-new)要做的操作。在昨天的文章中,我谈到了使用 [OfflineIMAP][8] 同步来自 IMAP 服务器的邮件。从 “pre-new” 钩子运行它非常容易: + + +``` +#!/bin/bash +# Remove the new tag from messages that are still tagged as new +notmuch tag -new tag:new + +# Sync mail messages +offlineimap -a LocalSync -u quiet +``` + +你还可以使用可以操作 Notmuch 数据库的 Python 应用 [afew][9],来为你标记_邮件列表_和_垃圾邮件_。你可以用类似的方法在 post-new 钩子中使用 afew: + + +``` +#!/bin/bash +# tag with my custom tags +notmuch tag --input=~/tagmail.notmuch + +# Run afew to tag new mail +afew -t -n +``` + +我建议你在使用 afew 标记邮件时,不要使用 **[ListMailsFilter]**,因为某些邮件处理程序会在邮件中添加模糊或者完全的垃圾列表中的标头(我说的是你 Google)。 + +![alot email client][10] + +此时,任何支持 Notmuch 或 Maildir 的邮件阅读器都可以读取我的邮件。有时,我会使用 [alot][11](一个 Notmuch 特定的客户端)在控制台中阅读邮件,但是它不像其他邮件阅读器那么美观。 + +在接下来的几天,我将向你展示其他一些邮件客户端,它们可能会与你在使用的工具集成在一起。同时,请查看可与 Maildir 邮箱一起使用的其他工具。你可能会发现我没发现的好东西。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/organize-email-notmuch + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_organize_letter.png?itok=GTtiiabr (Filing cabinet for organization) +[2]: https://opensource.com/article/20/1/sync-email-offlineimap +[3]: https://opensource.com/sites/default/files/uploads/productivity_4-1.png (Notmuch) +[4]: https://en.wikipedia.org/wiki/Maildir +[5]: https://notmuchmail.org/ +[6]: https://docs.microsoft.com/en-us/windows/wsl/install-win10 +[7]: https://opensource.com/sites/default/files/uploads/productivity_4-2.png (Notmuch's first run) +[8]: http://www.offlineimap.org/ +[9]: https://afew.readthedocs.io/en/latest/index.html +[10]: https://opensource.com/sites/default/files/uploads/productivity_4-3.png (alot email client) +[11]: https://github.com/pazz/alot From 9b2aa6fc5869e0d256883e7cf42a82d6d62e5674 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 19 Jan 2020 08:59:27 +0800 Subject: [PATCH 423/430] translating --- ...0117 Get started with this open source to-do list manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200117 Get started with this open source to-do list manager.md b/sources/tech/20200117 Get started with this open source to-do list manager.md index 57c9061179..210c8508c1 100644 --- a/sources/tech/20200117 Get started with this open source to-do list manager.md +++ b/sources/tech/20200117 Get started with this open source to-do list manager.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ac5b0e57ab0f259edc65b86d9e9c1da2795d1a5c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Jan 2020 15:51:25 +0800 Subject: [PATCH 424/430] APL --- ...st- Which to choose for programming hardware abstractions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md b/sources/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md index acb58aaf6d..b8a72997df 100644 --- a/sources/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md +++ b/sources/tech/20200117 C vs. Rust- Which to choose for programming hardware abstractions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9b3ab30118e7bfb61003533ac15df19a7b29e2e6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Jan 2020 23:05:38 +0800 Subject: [PATCH 425/430] PRF @robsean --- ...5 How to Add Border Around Text in GIMP.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/translated/tech/20191215 How to Add Border Around Text in GIMP.md b/translated/tech/20191215 How to Add Border Around Text in GIMP.md index 651a53fffb..6a4e57b0c5 100644 --- a/translated/tech/20191215 How to Add Border Around Text in GIMP.md +++ b/translated/tech/20191215 How to Add Border Around Text in GIMP.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Add Border Around Text in GIMP) @@ -10,7 +10,9 @@ 在 GIMP 中如何在文本周围添加边框 ====== -这个简单的教程阐明了在 [GIMP][1] 中显示文本的轮廓的步骤。文本轮廓帮助你在其它颜色下高亮显示文本。 +![](https://img.linux.net.cn/data/attachment/album/202001/19/230506fzkyktqglfcyzkuh.jpg) + +这个简单的教程介绍了在 [GIMP][1] 中显示文本的轮廓的步骤。文本轮廓可以帮助你在其它颜色下高亮显示该文本。 ![Outlined Text created in GIMP][2] @@ -20,25 +22,23 @@ 整个过程可以用这些简单的步骤描述: - * 创建文本,并复制它的轮廓路径 - * 添加一层新的透明层,并添加轮廓路径到透明层中 - * 更改轮廓的大小,给它添加一种不同的颜色 - - +* 创建文本,并复制它的轮廓路径 +* 添加一层新的透明层,并添加轮廓路径到透明层中 +* 更改轮廓的大小,给它添加一种不同的颜色 这就是全部的东西。不用担心,我将使用适当地截图详细的展示每个步骤。按照这个教程,你应该能够为文本添加轮廓,即使你在此之前从未使用过 GIMP 。 -仅需要确保你已经 [在 Linux 上安装 GIMP][3] 或者你正在使用的任何操作。 +仅需要确保你已经 [在 Linux 上安装 GIMP][3],或者也可以使用的其它任何操作系统。 这篇教程在 GIMP 2.10 版本下演示。 #### 步骤 1: 创建你的主要文本,并复制它的轮廓 -打开 GIMP ,并通过转到 菜单 -> 文件 -> 新建 来创建一个新的文件。你应该可以使用 Ctrl+N 键盘快捷键。 +打开 GIMP ,并通过转到 “菜单 -> 文件 -> 新建” 来创建一个新的文件。你应该可以使用 `Ctrl+N` 键盘快捷键。 ![Create New File][4] -你可以在这里选择画布的大小。你也可以选择要白色背景或一种透明背景。它在 高级选项 -> 颜色 配置文件下。 +你可以在这里选择画布的大小。你也可以选择要白色背景或一种透明背景。它在 “高级选项 -> 颜色” 配置文件下。 我选择默认的白色背景。它在以后能够更改。 @@ -46,35 +46,35 @@ ![Adding text in GIMP][5] -写你想的文本。你可以根据你的选择以更改文本的字体,大小和对齐方式。我保持这篇文章的文本的默认左对齐。 +写你想要的文本。你可以根据你的选择以更改文本的字体、大小和对齐方式。我保持这篇文章的文本的默认左对齐。 我故意为文本选择一种浅色,以便难于阅读。在这篇教程中我将添加一个深色轮廓到这个浅色的文本。 ![Text added in GIMP][6] -当你写完文本后,右键文本框并选择 **文本的路径** 。 +当你写完文本后,右键文本框并选择 “文本的路径” 。 ![Right click on the text box and select ‘Path from Text’][7] #### 步骤 2: 添加一个带有文本轮廓的透明层 -现在,转到顶部菜单,转到 层 ,并添加一个新层。 +现在,转到顶部菜单,转到“层”,并添加一个新层。 ![Use Shift+Ctrl+N to add a new layer][8] -确保添加新层为透明的。你可以给它一个合适的名称,像 ‘文本大纲’。单击确定来添加这个透明层。 +确保添加新层为透明的。你可以给它一个合适的名称,像“文本大纲”。单击确定来添加这个透明层。 ![Add a transparent layer][9] -再次转到菜单,这次转到 **选择** ,并单击 **来自路径** 。你将看到你的文本应该被高亮显示。 +再次转到菜单,这次转到 “选择” ,并单击 “来自路径” 。你将看到你的文本应该被高亮显示。 ![Go to Select and choose From Path][10] -总的来说,你只创建一个透明层,它有像你的原文一样相同的文本(但是透明)。现在你需要做的是在这个层上增加文本的大小。 +总的来说,你只创建了一个透明层,它有像你的原文一样相同的文本(但是透明)。现在你需要做的是在这个层上增加文本的大小。 -#### 步骤· 3: 通过增加它的大小和更改它的颜色来添加文本轮廓 +#### 步骤 3: 通过增加它的大小和更改它的颜色来添加文本轮廓 -为此,再次在菜单中转到 选择 ,这次选择 增加。这将允许增大透明层上的文本的大小。 +为此,再次在菜单中转到 “选择” ,这次选择 “增加”。这将允许增大透明层上的文本的大小。 ![Grow the selection on the additional layer][11] @@ -84,13 +84,13 @@ 你选择需要做是使用一种你选择的颜色来填充这个扩大的选择区。因为我的原文是浅色,在这里我将为轮廓使用背景色。 -如果尚未选择的话,先 **选择你的主图像层** 。这些层在右侧栏中可视。然后转到工具箱并选择油漆桶工具。为你的轮廓选择想要的颜色。 +如果尚未选择的话,先选择你的主图像层。这些层在右侧栏中可视。然后转到工具箱并选择油漆桶工具。为你的轮廓选择想要的颜色。 选择使用该工具来填充黑色到你的选择区。记住。你填充文本外部的轮廓,而不是文本本身。 ![Fill the outline of the text with a different color][13] -在这里你完成了很多。使用 Ctrl+Shift+A 来取消你当前的选择区。 +在这里你完成了很多。使用 `Ctrl+Shift+A` 来取消你当前的选择区。 ![Outline added to the text][14] @@ -100,7 +100,7 @@ 如果你对结果感到满意,保存文件未 PNG 文件(来保留透明背景),或你喜欢的任何文件格式。 -**你使它工作了吗?** +### 你使它工作了吗? 就这样。这就是你在 GIMP 中为添加一个文本轮廓而需要做的全部工作。 @@ -115,7 +115,7 @@ via: https://itsfoss.com/gimp-text-outline/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0565e2556c4f4ad7b64ccee9d334fae8911bcc82 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Jan 2020 23:06:27 +0800 Subject: [PATCH 426/430] PUB @robsean https://linux.cn/article-11799-1.html --- .../20191215 How to Add Border Around Text in GIMP.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191215 How to Add Border Around Text in GIMP.md (98%) diff --git a/translated/tech/20191215 How to Add Border Around Text in GIMP.md b/published/20191215 How to Add Border Around Text in GIMP.md similarity index 98% rename from translated/tech/20191215 How to Add Border Around Text in GIMP.md rename to published/20191215 How to Add Border Around Text in GIMP.md index 6a4e57b0c5..6a59c6ac66 100644 --- a/translated/tech/20191215 How to Add Border Around Text in GIMP.md +++ b/published/20191215 How to Add Border Around Text in GIMP.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11799-1.html) [#]: subject: (How to Add Border Around Text in GIMP) [#]: via: (https://itsfoss.com/gimp-text-outline/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From ed5fa9bcbaa64923c7b5a073d4d4d791ddd69ef2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Jan 2020 23:43:30 +0800 Subject: [PATCH 427/430] PRF @wxy --- ...nction to maintain Python virtual environments.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translated/tech/20200113 setV- A Bash function to maintain Python virtual environments.md b/translated/tech/20200113 setV- A Bash function to maintain Python virtual environments.md index 75dcec4367..38d003cfa2 100644 --- a/translated/tech/20200113 setV- A Bash function to maintain Python virtual environments.md +++ b/translated/tech/20200113 setV- A Bash function to maintain Python virtual environments.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (setV: A Bash function to maintain Python virtual environments) @@ -10,11 +10,11 @@ setV:一个管理 Python 虚拟环境的 Bash 函数 ====== -> 了解一下 setV,它是轻量级的 Python 虚拟环境管理器,是 virtualenvwrapper 的替代产品。 +> 了解一下 setV,它是一个轻量级的 Python 虚拟环境管理器,是 virtualenvwrapper 的替代产品。 -![Coding on a computer][1] +![](https://img.linux.net.cn/data/attachment/album/202001/19/234306tvvg5ffwakrzr5vv.jpg) -这一年多来,[setV] [2] 悄悄隐藏在我的 [bash_scripts][3] 项目中,但现在是时候该公开了。setV 是一个 Bash 函数,我可以用它代替 [virtualenvwrapper][4]。它提供了使你能够执行以下操作的基本功能: +这一年多来,我的 [bash_scripts][3] 项目中悄悄隐藏这 [setV][2],但现在是时候该公开了。setV 是一个 Bash 函数,我可以用它代替 [virtualenvwrapper][4]。它提供了使你能够执行以下操作的基本功能: * 默认使用 Python 3 * 创建一个新的虚拟环境 @@ -37,7 +37,7 @@ curl https://gitlab.com/psachin/setV/raw/master/install.sh sh ./install.sh ``` -当安装 setV 时,安装脚本会询问你要嵌入到 `~/.bashrc` 还是 `~/.bash_profile`,根据你的喜好选择一个。 +当安装 setV 时,安装脚本会要求你引入(`source`)一下 `~/.bashrc` 或 `~/.bash_profile` 的配置,根据你的喜好选择一个。 ### 用法 @@ -281,7 +281,7 @@ via: https://opensource.com/article/20/1/setv-bash-function 作者:[Sachin Patil][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0bacb6b8c11c1fdba116c892524924fa7ee7fc15 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Jan 2020 23:43:56 +0800 Subject: [PATCH 428/430] PUB @wxy https://linux.cn/article-11800-1.html --- ...A Bash function to maintain Python virtual environments.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200113 setV- A Bash function to maintain Python virtual environments.md (99%) diff --git a/translated/tech/20200113 setV- A Bash function to maintain Python virtual environments.md b/published/20200113 setV- A Bash function to maintain Python virtual environments.md similarity index 99% rename from translated/tech/20200113 setV- A Bash function to maintain Python virtual environments.md rename to published/20200113 setV- A Bash function to maintain Python virtual environments.md index 38d003cfa2..45e4beaf52 100644 --- a/translated/tech/20200113 setV- A Bash function to maintain Python virtual environments.md +++ b/published/20200113 setV- A Bash function to maintain Python virtual environments.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11800-1.html) [#]: subject: (setV: A Bash function to maintain Python virtual environments) [#]: via: (https://opensource.com/article/20/1/setv-bash-function) [#]: author: (Sachin Patil https://opensource.com/users/psachin) From cc2a5ebb16adcdc39f0fa544ab57d30037c51f11 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 20 Jan 2020 11:10:33 +0800 Subject: [PATCH 429/430] translated --- ... your calendar with khal and vdirsyncer.md | 108 ------------------ ... your calendar with khal and vdirsyncer.md | 105 +++++++++++++++++ 2 files changed, 105 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md create mode 100644 translated/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md diff --git a/sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md b/sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md deleted file mode 100644 index effad6fb4e..0000000000 --- a/sources/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md +++ /dev/null @@ -1,108 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Organize and sync your calendar with khal and vdirsyncer) -[#]: via: (https://opensource.com/article/20/1/open-source-calendar) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Organize and sync your calendar with khal and vdirsyncer -====== -Keeping and sharing a calendar can be a pain. Learn how to make it -easier in the fifth article in our series on 20 ways to be more -productive with open source in 2020. -![Calendar close up snapshot][1] - -Last year, I brought you 19 days of new (to you) productivity tools for 2019. This year, I'm taking a different approach: building an environment that will allow you to be more productive in the new year, using tools you may or may not already be using. - -### Keep track of your schedule with khal and vdirsyncer - -Calendars are a _pain_ to deal with, and finding good tooling is always hard. But I've made some progress since last year when I listed calendaring as [one of my "fails."][2] - -The most difficult thing about calendars today is that now they almost always need to be shared online in some way. The two most popular online calendars are Google Calendar and Microsoft Outlook/Exchange. Both are used heavily in corporate environments, which means my calendar has to support one or both options. - -![khal calendar][3] - -[Khal][4] is a console-based calendar that reads and writes VCalendar files. It's fairly easy to configure, but it does not support syncing with other applications. - -Fortunately, khal works with [vdirsyncer][5], a nifty command-line program that can synchronize online calendars (and contacts, which I'll talk about in a separate article) to your local drive. And yes, this includes uploading new events, too. - -![vdirsyncer][6] - -Vdirsyncer is a Python 3 program, and it can be installed via your package manager or pip. It can synchronize CalDAV, VCalendar/iCalendar, Google Calendar, and local files in a directory. Since I use Google Calendar, I'll use that as an example, although it is not the easiest thing to set up. - -Setting vdirsyncer up for Google is [well-documented][7], so I won't go into the nuts and bolts here. The important thing is to make sure your sync pairs are set up in a way that sets Google Calendar as the "winner" for conflict resolution. That is, if there are two updates to the same event, it needs to know which one takes precedence. Do so with something like this: - - -``` -[general] -status_path = "~/.calendars/status" - -[pair personal_sync] -a = "personal" -b = "personallocal" -collections = ["from a", "from b"] -conflict_resolution = "a wins" -metadata = ["color"] - -[storage personal] -type = "google_calendar" -token_file = "~/.vdirsyncer/google_calendar_token" -client_id = "google_client_id" -client_secret = "google_client_secret" - -[storage personallocal] -type = "filesystem" -path = "~/.calendars/Personal" -fileext = ".ics" -``` - -After the first sync of vdirsyncer, you will end up with a series of directories in the storage path. Each will contain several files, one for each entry in the calendar. The next step is to get them into khal. Start by running **khal configure** to do the initial setup. - -![Configuring khal][8] - -Now, running **khal interactive** will bring up the display shown at the beginning of this article. Typing **n** will bring up the New Event dialog. One small thing to note here: the calendars are named to match the directories that vdirsyncer creates, but you can change the khal config file to give them clearer names. Adding colors to entries based on which calendar they're on will also help you identify which is which on the list: - - -``` -[calendars] -[[personal]] -path = ~/.calendars/Personal/kevin@sonney.com/ -color = light magenta -[[holidays]] -path = ~/.calendars/Personal/cln2stbjc4hmgrrcd5i62ua0ctp6utbg5pr2sor1dhimsp31e8n6errfctm6abj3dtmg@virtual/ -color = light blue -[[birthdays]] -path = ~/.calendars/Personal/c5i68sj5edpm4rrfdchm6rreehgm6t3j81jn4rrle0n7cbj3c5m6arj4c5p2sprfdtjmop9ecdnmq@virtual/ -color = brown -``` - -Now when you run **khal interactive**, each calendar will be colored to distinguish it from the others, and when you add a new entry, it will have a more descriptive name. - -![Adding a new calendar entry][9] - -The setup is a little tricky, but once it's done, khal with vdirsyncer gives you an easy way to manage calendar events and keep them in sync with your online services. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/open-source-calendar - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calendar.jpg?itok=jEKbhvDT (Calendar close up snapshot) -[2]: https://opensource.com/article/19/1/productivity-tool-wish-list -[3]: https://opensource.com/sites/default/files/uploads/productivity_5-1.png (khal calendar) -[4]: https://khal.readthedocs.io/en/v0.9.2/index.html -[5]: https://github.com/pimutils/vdirsyncer -[6]: https://opensource.com/sites/default/files/uploads/productivity_5-2.png (vdirsyncer) -[7]: https://vdirsyncer.pimutils.org/en/stable/config.html#google -[8]: https://opensource.com/sites/default/files/uploads/productivity_5-3.png (Configuring khal) -[9]: https://opensource.com/sites/default/files/uploads/productivity_5-4.png (Adding a new calendar entry) diff --git a/translated/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md b/translated/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md new file mode 100644 index 0000000000..a84fc3c917 --- /dev/null +++ b/translated/tech/20200115 Organize and sync your calendar with khal and vdirsyncer.md @@ -0,0 +1,105 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Organize and sync your calendar with khal and vdirsyncer) +[#]: via: (https://opensource.com/article/20/1/open-source-calendar) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用 khal 和 vdirsyncer 组织和同步你的日历 +====== +保存和共享日历可能会有点麻烦。在我们的 20 个使用开源提升生产力的系列的第五篇文章中了解如何让它更简单。 +![Calendar close up snapshot][1] + +去年,我在 19 天里给你介绍了 19 个新(对你而言)的生产力工具。今年,我换了一种方式:使用你在使用或者还没使用的工具,构建一个使你可以在新一年更加高效的环境。 + +### 使用 khal 和 vdirsyncer 跟踪你的日程 + +处理日历很_麻烦_,要找到好的工具总是很困难的。但是自从我去年将日历列为[我的“失败“之一][2]以来,我已经取得了一些进步。 + +目前使用日历最困难的是一直需要以某种方式在线共享。两种最受欢迎的在线日历是 Google Calendar 和 Microsoft Outlook/Exchange。两者都在公司环境中大量使用,这意味着我的日历必须支持其中之一或者两个。 + +![khal calendar][3] + +[Khal][4] 是基于控制台的日历,可以读取和写入 VCalendar 文件。它配置相当容易,但是不支持与其他应用同步。 + +幸运的是,khal 能与 [vdirsyncer][5] 一起使用,它是一个漂亮的命令行程序,可以将在线日历(和联系人,我将在另一篇文章中讨论)同步到本地磁盘。是的,它还可以上传新事件。 + +![vdirsyncer][6] + +Vdirsyncer 是个 Python 3 程序,可以通过软件包管理器或 pip 安装。它可以同步 CalDAV、VCalendar/iCalendar、Google Calendar 和目录中的本地文件。由于我使用 Google Calendar,尽管这不是最简单的设置,我也将以它为例。 + +在 vdirsyncer 中设置 Google Calendar 是[有文档参考的][7],所以这里我不再赘述。重要的是确保同步对设置将 Google Calendar 设置为冲突解决的”赢家“。也就是说,如果同一事件有两个更新,那么需要知道哪个更新优先。类似这样做: + + +``` +[general] +status_path = "~/.calendars/status" + +[pair personal_sync] +a = "personal" +b = "personallocal" +collections = ["from a", "from b"] +conflict_resolution = "a wins" +metadata = ["color"] + +[storage personal] +type = "google_calendar" +token_file = "~/.vdirsyncer/google_calendar_token" +client_id = "google_client_id" +client_secret = "google_client_secret" + +[storage personallocal] +type = "filesystem" +path = "~/.calendars/Personal" +fileext = ".ics" +``` + +在第一次 vdirsyncer 同步之后,你将在存储路径中看到一系列目录。每个文件夹都将包含多个文件,日历中的每个事件都是一个文件。下一步是导入 khal。首先运行 **khal configure** 进行初始设置。 + +![Configuring khal][8] + +现在,运行 **khal interactive** 将显示本文开头的界面。输入 **n** 将打开“新事件”对话框。这里要注意的一件事:日历的名称与 vdirsyncer 创建的目录匹配,但是你可以更改 khal 配置文件来指定更清晰的名称。根据条目所在的日历向条目添加颜色还可以帮助你确定日历内容: + + +``` +[calendars] +[[personal]] +path = ~/.calendars/Personal/kevin@sonney.com/ +color = light magenta +[[holidays]] +path = ~/.calendars/Personal/cln2stbjc4hmgrrcd5i62ua0ctp6utbg5pr2sor1dhimsp31e8n6errfctm6abj3dtmg@virtual/ +color = light blue +[[birthdays]] +path = ~/.calendars/Personal/c5i68sj5edpm4rrfdchm6rreehgm6t3j81jn4rrle0n7cbj3c5m6arj4c5p2sprfdtjmop9ecdnmq@virtual/ +color = brown +``` + +现在,当你运行 **khal interactive** 时,每个日历将被着色以区别于其他日历,并且当你添加新条目时,它将有更具描述性的名称。 + +![Adding a new calendar entry][9] + +设置有些麻烦,但是完成后,khal 和 vdirsyncer 可以一起为你提供一种简便的方法来管理日历事件并使它们与你的在线服务保持同步。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/open-source-calendar + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/calendar.jpg?itok=jEKbhvDT (Calendar close up snapshot) +[2]: https://opensource.com/article/19/1/productivity-tool-wish-list +[3]: https://opensource.com/sites/default/files/uploads/productivity_5-1.png (khal calendar) +[4]: https://khal.readthedocs.io/en/v0.9.2/index.html +[5]: https://github.com/pimutils/vdirsyncer +[6]: https://opensource.com/sites/default/files/uploads/productivity_5-2.png (vdirsyncer) +[7]: https://vdirsyncer.pimutils.org/en/stable/config.html#google +[8]: https://opensource.com/sites/default/files/uploads/productivity_5-3.png (Configuring khal) From 56eae89c17262f6f04ec722f5a1bf65d4e03f6c7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 20 Jan 2020 11:13:53 +0800 Subject: [PATCH 430/430] translating --- ...eep a journal of your activities with this Python program.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200118 Keep a journal of your activities with this Python program.md b/sources/tech/20200118 Keep a journal of your activities with this Python program.md index b5d3cf93a4..bfa79a8893 100644 --- a/sources/tech/20200118 Keep a journal of your activities with this Python program.md +++ b/sources/tech/20200118 Keep a journal of your activities with this Python program.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( )