From 1922033821d255d3ff473ba7e23670bfe1785f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?imgradeone=20-=20=E4=B8=80=E5=B9=B4=E7=BA=A7=E4=B9=88?= =?UTF-8?q?=E4=B9=88=E5=93=92?= Date: Thu, 26 Aug 2021 13:23:32 +0800 Subject: [PATCH 001/138] Update 20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md --- ...n Review - Late Arrival but a Solid One.md | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md index baa22699f5..2442c6b6ba 100644 --- a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md +++ b/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md @@ -7,63 +7,61 @@ [#]: publisher: " " [#]: url: " " -Elementary OS 6 Odin Review – Late Arrival but a Solid One +elementary OS 6 Odin 评测 – 迟到的新版本,但也实至名归 ====== -We review the elementary OS 6 Odin and give you some glimpse on how it -went for our test drive. -For almost two years, the elementary OS fans was waiting for elementary OS 6 Odin release. Because, the earlier version elementary OS 5.1 was too old in terms of Kernel, packages in 2021. It was based on Ubuntu 18.04 LTS. So, the users was waiting to get a flavor based on Ubuntu 20.04 LTS – which is already in 2nd year, and we have another LTS coming up. +> 这篇 elementary OS 6 的评测将为您呈现该系统在旧款测试设备上的表现。 -You get the idea. Sometimes the wait was too long, probably some users jumped ship to other distributions.  +elementary OS 的粉丝们已经焦急等待 elementary OS 6 Odin 发布将近两年了。如此焦急的原因,主要在于早期版本 elementary OS 5.1 的内核和软件包在 2021 年来说实在太旧了。而且,这一旧版本基于 Ubuntu 18.04 LTS 构建。因此,用户都急切地等待着基于 Ubuntu 20.04 LTS 的全新版本 —— 最重要的是,Ubutnu 20.04 LTS 已经发布一年,接下来也将有下一个 LTS 版本发布。 -However, the release [was done in August][1], and it was a hit among the users and fanboys. +你应该也明白的,过长的等待时间,很可能导致用户跳槽到其他发行版。 -So, I ran elementary OS 6 Odin for a week on an old hardware (I know newer hardware would do just fine), and this is the review. +无论如何,新版本终于还是 [在 8 月发布了][1],它也在用户和粉丝群体中引起了很大的轰动。 -![elementary OS 6 ODIN Desktop][2] +于是,我在一周前为一台旧设备(我知道新设备的体验会更好)安装了 elementary OS 6 Odin,下面就是测评。 -### Elementary OS 6 Odin review +![elementary OS 6 Odin 的桌面][2] -Test Hardware +### elementary OS 6 Odin 测评 - * CPU – Intel Core i3 with RAM 4GB - * Disk – SSD - * Graphics – Nvidia GeForce (340) +测试设备 + * CPU – Intel Core i3,4 GB 运行内存 + * 硬盘 – SSD 固态硬盘 + * 显卡 – Nvidia GeForce(340) +#### 安装 -#### Installation +在这一版本中,elementary 团队针对 elementary 安装器做了易用性优化,而这一次的安装器也是自制安装器。新安装器减少了安装前的准备步骤,虽然它还是需要依赖 GParted 进行分区操作(当然 GParted 本身是一款不错的工具)。 -In this release, the team made some usability changes to the elementary Installer, which is a homegrown tool. It reduced the steps require to begin the installation. Although it still depends on gparted for partition (which is a great tool itself anyway). +在前述测试设备中,安装过程大约花费了 10 分钟,没有任何报错。初始化之后,GRUB 也正常更新,没有任何意外。这是一个带有 Legacy BIOS 的三系统启动器。 -The installation took around 10 minutes in above hardware and went without any error. Post installation, the Grub is updated properly and no surprises there. It was a triple boot system with Legacy Bios. + -#### First Impression +#### 初见印象 -If you are new to elementary OS or Pantheon desktop, and coming from traditional menu-driven desktops, then you might need a day or two to be familiar to the way this desktop is set up. Otherwise, if you are a long time elementary user, you feel the same with some performance benefits and looks. +如果你刚听说 elementary OS 和 Pantheon 桌面,或者从其他传统菜单型桌面环境迁移过来,你可能需要一两天时间来适应这款桌面。当然,如果你已经是 elementary OS 的老用户的话,那么你将获得一致的体验,外加性能和外观的优化。 -Couple of [new features of elementary OS 6][3] you might notice as they are visible. The accent color, native dark mode, a setup of nice wallpapers. +你应该可以察觉到一些明显可见的 [elementary OS 6 的新特性][3],像是强调色、原生暗黑模式,以及一组不错的新壁纸。 [][4] -SEE ALSO:   elementary OS 6 Odin: New Features and Release Date +#### 稳定性与性能 -#### Stability and performance +我已经使用 elementary OS 6 Odin 超过一周的时间。在日常使用后,我只能说,它很稳定,没有突然的崩溃和意外。其他额外软件(需要从 apt 独立安装)也运作正常,没有性能损耗。 -I have used elementary OS Odin for more than a week. After using it daily, I must say it is very stable. No sudden crash or surprises. Additional applications (those installed separately via apt) are working well with no loss to performance.  +在近乎闲置的情况下,CPU 使用率处在 5%-10% 之间,内存占用约为 900 MB。CPU / 内存的消耗主要分配在 Gala(Pantheon 的窗口管理器)、Wingpanel(顶栏)和应用中心。 -In almost idle state, the CPU usage is around 5% to 10% and memory is consumed around 900 MB. The CPU/Memory mostly consumed by Gala – Pantheon’s window manager, Wingpanel and AppCenter. +![elementary OS 6 的系统性能][5] -![System performance of elementary OS 6][5] +考虑到系统的视觉效果,我认为这些占用数据也十分合理。不过,当你打开更多软件,例如 LibreOffice、Chrome、Kdenlive 之后,消耗的资源肯定会更多。 -Considering the look and feel it provides, I guess the above numbers are well justified. But remember, if you open more applications such as LibreOffice, Chrome, or Kdenlive for example, it will definitely consume more resources. +#### 应用程序与应用中心 -#### Applications and AppCenter +elementary OS 的应用程序列表经过精选,几乎所有类型的软件都可以从应用中心获取,包括 Flatpak 应用。不过,elementary OS 并没有预装一些重要的应用程序,像是 Firefox、LibreOffice、Torrent 客户端、硬盘分区工具、照片编辑器之类 —— 这些重要的程序需要在安装系统后再自行安装。我认为预装软件这一块有很大的改进空间。 -The application list of elementary OS is well curated and almost all types of apps are available from AppCenter including the Flatpak apps. However, elementary doesn’t include some important applications pre-loaded in default install. For example, Firefox, LibreOffice, Torrent client, disk formatter, photo editor – some important ones you need to manually install after a fresh installation. This is one of the improvement areas for the team, I feel. +### 结束语 -### Final Notes - -I have encountered one bug multiple times in my week long test run. The Wi-Fi was disconnecting randomly sometimes. But that is totally on Ubuntu 20.04 which has weird Wi-Fi problems over the years. Apart from that, it is a very stable and good Linux distribution. I wish there is a rolling-release of elementary, that would have been awesome. That said, it’s a recommended distro for all, specially for those coming from macOS. +在这一周的测试中,我也多次遇到了一个 bug,Wi-Fi 有时会突然断开,不过这完全是 Ubuntu 20.04 上游的问题 —— 多年以来,它一直有奇怪的 Wi-Fi 问题。抛开这个问题,elementary OS 确实是一款稳定、优秀的 Linux 发行版。如果 elementary OS 有滚动更新的版本,也许会更好。因此,这是一款值得推荐的发行版,尤其适合 macOS 的迁移者。 * * * From e9c20f281cf1f23b2bf8e13e5b7af47d7325df6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?imgradeone=20-=20=E4=B8=80=E5=B9=B4=E7=BA=A7=E4=B9=88?= =?UTF-8?q?=E4=B9=88=E5=93=92?= Date: Thu, 26 Aug 2021 13:50:28 +0800 Subject: [PATCH 002/138] Update 20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md --- ...ntary OS 6 Odin Review - Late Arrival but a Solid One.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md index 2442c6b6ba..9dc75059d3 100644 --- a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md +++ b/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md @@ -11,11 +11,11 @@ elementary OS 6 Odin 评测 – 迟到的新版本,但也实至名归 ====== > 这篇 elementary OS 6 的评测将为您呈现该系统在旧款测试设备上的表现。 -elementary OS 的粉丝们已经焦急等待 elementary OS 6 Odin 发布将近两年了。如此焦急的原因,主要在于早期版本 elementary OS 5.1 的内核和软件包在 2021 年来说实在太旧了。而且,这一旧版本基于 Ubuntu 18.04 LTS 构建。因此,用户都急切地等待着基于 Ubuntu 20.04 LTS 的全新版本 —— 最重要的是,Ubutnu 20.04 LTS 已经发布一年,接下来也将有下一个 LTS 版本发布。 +elementary OS 的粉丝们焦急等待 elementary OS 6 Odin 发布已经将近两年了。如此焦急的原因,主要在于早期版本 elementary OS 5.1 的内核和软件包在 2021 年来说过于陈旧。而且,这一旧版本基于 Ubuntu 18.04 LTS 构建。因此,用户都急切地等待着基于 Ubuntu 20.04 LTS 的全新版本 —— 最重要的是,Ubutnu 20.04 LTS 已经发布一年,接下来也将有下一个 LTS 版本发布。 你应该也明白的,过长的等待时间,很可能导致用户跳槽到其他发行版。 -无论如何,新版本终于还是 [在 8 月发布了][1],它也在用户和粉丝群体中引起了很大的轰动。 +但即便如此,新版本终于还是 [在 8 月发布了][1],它也在用户和粉丝群体中引起了很大的轰动。 于是,我在一周前为一台旧设备(我知道新设备的体验会更好)安装了 elementary OS 6 Odin,下面就是测评。 @@ -31,7 +31,7 @@ elementary OS 的粉丝们已经焦急等待 elementary OS 6 Odin 发布将近 #### 安装 -在这一版本中,elementary 团队针对 elementary 安装器做了易用性优化,而这一次的安装器也是自制安装器。新安装器减少了安装前的准备步骤,虽然它还是需要依赖 GParted 进行分区操作(当然 GParted 本身是一款不错的工具)。 +在这一版本中,elementary 团队针对 elementary OS 安装器做了易用性优化,而这一次的安装器也是自制安装器。新安装器减少了安装前的准备步骤,虽然它还是需要依赖 GParted 进行分区操作(当然 GParted 本身是一款不错的工具)。 在前述测试设备中,安装过程大约花费了 10 分钟,没有任何报错。初始化之后,GRUB 也正常更新,没有任何意外。这是一个带有 Legacy BIOS 的三系统启动器。 From 41e7e8a9a70c1fb45a30634a1f7ae3a803325c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?imgradeone=20-=20=E4=B8=80=E5=B9=B4=E7=BA=A7=E4=B9=88?= =?UTF-8?q?=E4=B9=88=E5=93=92?= Date: Thu, 26 Aug 2021 15:17:20 +0800 Subject: [PATCH 003/138] move file --- ... Elementary OS 6 Odin Review - Late Arrival but a Solid One.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md (100%) diff --git a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md similarity index 100% rename from sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md rename to translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md From 944d399f796f92ee906a063001f0793ec6633696 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Aug 2021 05:03:19 +0800 Subject: [PATCH 004/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210827=20?= =?UTF-8?q?How=20to=20Easily=20Install=20Debian=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210827 How to Easily Install Debian Linux.md --- ...0827 How to Easily Install Debian Linux.md | 252 ++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 sources/tech/20210827 How to Easily Install Debian Linux.md diff --git a/sources/tech/20210827 How to Easily Install Debian Linux.md b/sources/tech/20210827 How to Easily Install Debian Linux.md new file mode 100644 index 0000000000..7940aa2845 --- /dev/null +++ b/sources/tech/20210827 How to Easily Install Debian Linux.md @@ -0,0 +1,252 @@ +[#]: subject: "How to Easily Install Debian Linux" +[#]: via: "https://itsfoss.com/install-debian-easily/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Easily Install Debian Linux +====== + +Installing Debian could be easy or complicated depending upon the ISO you choose. + +If you go with the default ISO provided by the Debian website, you’ll have a hard time installing Debian. You’ll be stuck at a screen that asks for network drivers to be installed from external removable media. + +![Installing Debian from default ISO is problematic for new users][1] + +You may, of course, troubleshoot that, but it makes things unnecessarily complicated. + +Don’t worry. Let me show the steps for installing Debian comfortably and easily. + +### The easy way of installing Debian as a desktop + +Before you see the steps, please have a look at things you need. + + * A USB key (pen drive) with at least 4 GB in size. + * A system with internet connection (could be the same system where it will be installed). + * A system where you’ll be installing Debian. It will wipe out everything on this system so please copy your important data on some other external disk. + + + +What kind of system specification you should have for Debian? It depends on the [desktop environment][2] you are going to use. For example, GNOME desktop environment could work on 4 GB RAM but it will work a lot better on an 8 GB RAM. If you have 4 GB or less, try using KDE, Cinnamon or Xfce desktops. + +Debian also has both [32-bit and 64-bit architecture][3] support. You’ll have to get the Debian ISO according to your processor architecture. + +Your system should have at least 25 GB of disk space to function. The more, the merrier. + +Warning! + +This method removes all the other operating systems along with the data present on the disk. + +You may save your personal files, documents, pictures etc on an external USB disk or cloud storage if you want to use it later. + +In this tutorial, I am going to show the steps for installing Debian 11 Bullseye with GNOME desktop environment. The steps should be the same even if you choose some other desktop environment. + +_**This tutorial is tested on a UEFI system with GPT partitioning. If you have [MBR instead of GPT][4] or [legacy BIOS instead of UEFI][5], the live USB creation step will be different.**_ + +#### Step 1: Getting the correct Debian ISO + +Half of the battle in installing Debian is choosing the correct ISO. Surprisingly, it is really difficult to navigate through its website and find that ISO which is the easiest for a new Debian user. + +If you click the Download button on the [homepage of Debian website][6], it downloads a minimal net install file which will be super complicate for a regular user. Please DO NOT use this. + +Instead, you should go for the live ISO. But here is a catch, there are separate live versions with non-free software (includes drivers for your networking hardware). + +You should download this non-free live ISO. Another problem here is that you won’t get it mentioned prominently on the website and there are various URLs for torrents or direct downloads for various architecture. + +Let me link them here. + +[Main repo for 32 and 64 bit][7] + +[Debian 11 Direct][8] + +[Debian 11 Torrent][9] + +You’ll see several files with the of desktop environment mentioned in the filename. Choose the one with desktop environment of your choice. For direct downloads, click on the links that end with .iso. + +![Downloading the Debian Live Non-free ISO][10] + +Once you have the appropriate ISO downloaded, the rest is standard procedure that you may have experienced with other Linux distributions. + +#### Step 2: Creating live USB of Debian + +Plug in the USB into your system. It will be wise to format it just for the sake of it. It will be formatted anyway. + +You can use any live USB creation tool of your choice. If you are using Windows, go with Rufus. I am going to use Etcher here because it is available for both Windows and Linux. + +Download Etcher from its website. + +[Download Etcher][11] + +I have a dedicated [tutorial on using Etcher in Linux][12] and thus I am not going to go in detail here. Just run the downloaded executable file, browse to the Debian ISO, make sure that correct USB is selected and then hit the Flash button. + +![Creating Live Debian USB with Etcher][13] + +It may take a couple of minutes to create the live USB. Once that is ready, it is time to boot from it. + +#### Step 3: Boot from the live USB + +Restart the system where you want to install Debian. When it is showing the manufacturer’s logo, press F2/F10 or F12 key to access the boot settings. You may also [access the UEFI firmware settings from Windows.][14] + +Some systems do not allow booting from live USB if secure boot is enabled. If that is the case, please [disable secure boot from the BIOS settings][15]. + +The screen may look different for different manufacturers. + +![][16] + +Once you make the change, press F10 to save and exit. Your system will boot once again. + +Again, press F2/F10 or F12 to access the boot settings when it shows the manufacturer’s logo. You should see the option to boot from the USB. Select it. + +![][17] + +It takes a little bit of time and then you should see a screen like this. Go with the first option here. + +![Debian live boot screen][18] + +#### Step 4: Start Debian installation + +When you enter the live Debian session, it may show some welcome screen with option to choose your keyboard and language if you are using GNOME desktop. Just hit next when you see those screens. + +![Debian live welcome screen][19] + +Once you are past the welcome screen, press the Windows/Super key to bring the activity area. You should see the Debian install button here. + +![Start Debian Installation][20] + +It opens the friendly [Calamares graphical installer][21]. Things are pretty straightforward from here. + +![Debian 11 Calamares graphical installer][22] + +It asks you to select your geographical location and time zone. + +![Select your location and time zone][23] + +On the next screen, you’ll be asked to select the keyboard. Please **pay attention** here. Your keyboard is automatically selected based on your location. For example, I had used India as my location and it automatically set the default Indian keyboard with Hindi language. I had to change it to English India. + +![Choosing keyboard layout][24] + +The next screen is about the disk partition and where you would like to install Debian. In this case, you are going to install Debian as the only operating system on your computer. + +The easiest option would to go with ‘Erase disk’ option. Debian will put everything under root except the mandatory ESP partition and Swap space. In fact, it shows what your disk would like after your chosen installation method. + +![Disk partitioning][25] + +If you want to take matter in your hands, you may also opt for manual partitioning and choose how much you want to allot to root, home, boot or swap. Only do that when you know what you are doing. + +On the next screen, you have to provide the username and password. It does not set root password and keeps it empty. + +![Set Username and password][26] + +This also means that you can use sudo with the newly created user. In the ‘complicated Debian install’, you could also set root password but then you’ll have to add the normal user to sudoer list manually. See, this installation method is easier for beginners, right? + +Before it goes on with the actual installation, it presents you with a summary of the choices you have made. If things look good, hit the install button. + +![Summary of your installation choices][27] + +Now it is just a matter of waiting for the installation to finish. + +![Installing Debian][28] + +It takes a few minutes to complete the installation. When the installation finishes, it asks for a restart. + +![Finished Debian installation][29] + +Restart your system and if everything goes well, you should see the grub screen with Debian. + +![Debian boot screen][30] + +### Troubleshooting tip (if your system does not boot into Debian) + +In my case, my Dell system did not recognize any operating system to boot. This was weird because I had see Debian creating an ESP partition. + +If it is the same case with you, go to BIOS settings. Check the boot sequence. If you do not see anything, click on the Add boot option. + +![Add new boot option][31] + +It should give you an option to add an EFI file. + +![Browse to EFi file][32] + +Since Debian created ESP partition during installation, there is an EFI directory created with necessary files. + +![Select EFI directory][33] + +It should show a Debian folder along with some other folders. Select Debian folder. + +![Select Debian][34] + +In this Debian folder, you’ll find files like grubx64.efi, shimx64.efi. Select shimx64.efi. + +![Select shim.efi][35] + +You may give this file an appropriate name. The final screen may look like this. + +![Adding the new boot option with efi file][36] + +Now, you should have this boot option. Since I named it Debian, it shows two Debian boot options (one of them coming from the efi file I guess). Press F10 to save and exit the BIOS settings. + +![New boot option added][37] + +When your system boots now, you should see the grub screen with Debian boot option. You can start enjoying Debian now. + +![][30] + +### Were you able to install Debian? + +I hope I made things simpler here. It is not that you cannot install Debian from the default net installer ISO. It just takes (a lot) more effort. + +Was this tutorial helpful for you in installing Debian? Are you still facing issues? Please let me know in the comment section and I’ll try to help you out. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-debian-easily/ + +作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-firmware.png?resize=800%2C600&ssl=1 +[2]: https://itsfoss.com/what-is-desktop-environment/ +[3]: https://itsfoss.com/32-bit-64-bit-ubuntu/ +[4]: https://itsfoss.com/check-mbr-or-gpt/ +[5]: https://itsfoss.com/check-uefi-or-bios/ +[6]: https://www.debian.org/ +[7]: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/11.0.0-live+nonfree/ +[8]: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/11.0.0-live+nonfree/amd64/iso-hybrid/ +[9]: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/11.0.0-live+nonfree/amd64/bt-hybrid/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/downloading-Debian-live-non-free-iso.png?resize=800%2C490&ssl=1 +[11]: https://www.balena.io/etcher/ +[12]: https://itsfoss.com/install-etcher-linux/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/creating-live-debian-usb-with-etcher-800x518.png?resize=800%2C518&ssl=1 +[14]: https://itsfoss.com/access-uefi-settings-windows-10/ +[15]: https://itsfoss.com/disable-secure-boot-windows/ +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2014/05/Disable_Secure_Boot_Windows8.jpg?resize=700%2C525&ssl=1 +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/boot-from-windows-disk-ventoy.jpg?resize=800%2C611&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-live-boot-screen.png?resize=617%2C432&ssl=1 +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-live-welcome-screen.png?resize=800%2C450&ssl=1 +[20]: https://itsfoss.com/wp-content/uploads/2021/08/start-Debian-installation-800x473.webp +[21]: https://calamares.io/ +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-1.png?resize=800%2C441&ssl=1 +[23]: https://itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-2-800x441.webp +[24]: https://itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-4-800x441.webp +[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-5.png?resize=800%2C441&ssl=1 +[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-6.png?resize=800%2C441&ssl=1 +[27]: https://itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-7-800x500.webp +[28]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-8.png?resize=800%2C500&ssl=1 +[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-9.png?resize=800%2C500&ssl=1 +[30]: https://itsfoss.com/wp-content/uploads/2021/08/debian-boot-screen.webp +[31]: https://itsfoss.com/wp-content/uploads/2021/08/add-new-boot-option.webp +[32]: https://itsfoss.com/wp-content/uploads/2021/08/add-efi-file-for-boot-option.webp +[33]: https://itsfoss.com/wp-content/uploads/2021/08/select-efi-file-boot-option.webp +[34]: https://itsfoss.com/wp-content/uploads/2021/08/select-debian-folder-for-uefi.webp +[35]: https://itsfoss.com/wp-content/uploads/2021/08/select-shim-boot.webp +[36]: https://itsfoss.com/wp-content/uploads/2021/08/new-boot-option.webp +[37]: https://itsfoss.com/wp-content/uploads/2021/08/new-boot-option-added.webp From a035cc4b88a9b85c3e3520ee9bfb16038ea638c9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Aug 2021 05:05:46 +0800 Subject: [PATCH 005/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210826=20?= =?UTF-8?q?30=20things=20you=20didn't=20know=20about=20the=20Linux=20kerne?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210826 30 things you didn-t know about the Linux kernel.md --- ... you didn-t know about the Linux kernel.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20210826 30 things you didn-t know about the Linux kernel.md diff --git a/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md b/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md new file mode 100644 index 0000000000..82a3673941 --- /dev/null +++ b/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md @@ -0,0 +1,100 @@ +[#]: subject: "30 things you didn't know about the Linux kernel" +[#]: via: "https://opensource.com/article/21/8/linux-kernel" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +30 things you didn't know about the Linux kernel +====== +The Linux kernel is turning 30 this year. +![30 years][1] + +The Linux kernel is turning 30 this year. That's three decades of pioneering open source software, enabling users to run free software, to learn from the applications they're running, and to share what they've learned with friends. It's argued that without the Linux kernel, the luxuries of [open culture][2] and free software we enjoy today may not have surfaced when they have. It's highly improbable that the parts of Apple and Microsoft and Google that are open would be open at all without Linux as the catalyst. The impact of Linux as a phenomenon for culture, software development, and user experience cannot be overstated, and yet it all started with a kernel. + +A kernel is the software that boots a computer, recognizes—and ensures communication between—all of the components attached to the computer, both inside and outside of the computer case. For code that most users never even think about, much less understand, there are a lot of surprises about the Linux kernel. In no particular order, here's one fact about the kernel for each year of its life: + + 1. Linux was the first operating system to feature USB 3.0 drivers. Sarah Sharp announced on 7 June 2009 that her driver for USB 3.0 devices was available, and her code was included in kernel version 2.6.31 + + 2. The kernel marks itself as `tainted` when some event occurs that could be useful later for troubleshooting. It’s not a problem to run a "tainted" kernel. Should something go wrong, one of the first troubleshooting steps is to try to reproduce the issue on a non-tainted kernel. + + 3. You can specify a hostname or domain name as part of the `ip=` command-line option, Linux preserves it instead of overwriting it with one proposed by DHCP or BOOTP. For instance, `ip=::::myhostname::dhcp` gets the name `myhostname`. + + 4. There's a version of a black-and-white, 16-color, and 224-color Tux logo during text bootup. + + 5. In the entertainment business, DRM is technology used to prevent access to media. However, in the Linux kernel DRM refers to Direct Rendering Manager and refers to library (libdrm) and drivers used to interface with the GPUs of video cards. + + 6. It's possible to patch the Linux kernel without rebooting. + + 7. If you compile your own kernel, you can configure your text console to have more than 80 columns. + + 8. The Linux kernel provides built-in FAT, exFAT, and NTFS (read and write) compatibility. + + 9. Drivers for Wacom tablets and many similar devices are built into the kernel. + + 10. Most kernel hackers use the `git send-email` to submit patches. + + 11. The kernel uses a documentation toolchain called [Sphinx][3], which is written in Python. + + 12. Hamlib provides shared libraries with a standardized API to control amateur radio equipment through your Linux computer. + + 13. Hardware manufacturers are encouraged to help develop the kernel in order to ensure compatibility. The hardware can thus be addressed directly without having to download a driver from the manufacturer. Drivers that are directly part of the kernel also automatically benefit from performance and security improvements in new versions of the kernel. + + 14. There are drivers included in the kernel for many Raspberry Pi modules (Pi Hats). + + 15. The band netcat released an album playable only as a [Linux kernel module.][4] + + 16. Inspired by netcat's album release, a module to [turn your kernel into a music player][5] has also been developed. + + 17. The Linux kernel features supports many CPU architectures: ARM, ARM64, IA-64, m68k, MIPS, Nios II, PA-RISC, OpenRISC, PowerPC, s390, Sparc, x86, Xtensa, and more. + + 18. In 2001, the Linux kernel became the first to [run the x86-64 CPU architecture in long mode][6]. + + 19. Linux version 3.4 introduced the x32 ABI, allowing developers to compile code to run in 64-bit mode while only using 32-bit pointers and data fields. + + 20. The kernel supports many different file systems, including Ext2, Ext3, Ext4, JFS, XFS, GFS2, GCFS2, BtrFS, NILFS2, NFS, Overlay FS, UDF, and more. + + 21. The Virtual File System is a software layer in the kernel providing the filesystem interface to applications users run. It's also an abstraction for the kernel so that different filesystem implementations can coexist. + + 22. The Linux kernel includes a driver for a physical Braille output device. + + 23. For kernel version 2.6.29, the Tux logo during boot was replaced by "Tuz" to raise awareness of an aggressive cancer that was affecting the Tasmanian Devil population in Australia at the time. + + 24. Control Groups (cgroups) are the reason containers (the foundation technology for Docker, Podman, Kubernetes, and much more) can exist. + + 25. It took extensive legal action to liberate it so it could be included, but today the CIFS module is built into the kernel to enable SMB support. This allows Linux to mount Microsoft remote and cloud-based file shares. + + 26. It's notoriously difficult (in fact impossible, so far) for a computer to produce a truly random number. The `hw_random` framework can make use of special hardware features on your CPU or motherboard in an effort to improve random number generation. + + 27. _OS jitter_ is interference experienced by an application caused by conflicts in how background processes are scheduled, and how the system handles asynchronous events (such as interrupts.) Binding tasks to sets of CPUs defined by the kernel, using cgroups, and SMP IRQ affinity are options that the kernel provides programmers for reducing OS jitter. Issues like these are discussed in detail in the kernel documentation, helping programmers targeting Linux can write smarter code. + + 28. The `make menuconfig` command allows you to use a GUI to configure a kernel before compiling. The `Kconfig` language defines kernel config options. + + 29. For essential Linux servers, a _watchdog_ system can be implemented to monitor the health of the server. Between health checks, the watchdog daemon writes data to a special watchdog kernel device, preventing a system reset. Should a watchdog fail to log success, the system is reset. Many implementations of watchdog hardware exist, and they're vital for remote mission critical computers (such as those sent to Mars.) + + 30. Although it was developed on Earth, there's a copy of the Linux kernel on the planet Mars. + + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-kernel + +作者:[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/kernel-30.png?itok=xmwX2pCQ (30 years) +[2]: https://opensource.com/article/18/1/creative-commons-real-world +[3]: https://opensource.com/article/19/11/document-python-sphinx +[4]: https://github.com/usrbinnc/netcat-cpi-kernel-module +[5]: https://github.com/FlaviaR/Netcat-Music-Kernel-Expansion +[6]: http://www.x86-64.org/pipermail/announce/2001-June/000020.html From 983cce526bd604b16cce1bfdef449c1ae14d3a83 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Aug 2021 05:07:01 +0800 Subject: [PATCH 006/138] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210826=20?= =?UTF-8?q?=E2=80=9CApps=20for=20GNOME=E2=80=9D=20is=20a=20New=20Web=20Por?= =?UTF-8?q?tal=20to=20Showcase=20Best=20Linux=20Apps=20for=20GNOME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210826 -Apps for GNOME- is a New Web Portal to Showcase Best Linux Apps for GNOME.md --- ...l to Showcase Best Linux Apps for GNOME.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/news/20210826 -Apps for GNOME- is a New Web Portal to Showcase Best Linux Apps for GNOME.md diff --git a/sources/news/20210826 -Apps for GNOME- is a New Web Portal to Showcase Best Linux Apps for GNOME.md b/sources/news/20210826 -Apps for GNOME- is a New Web Portal to Showcase Best Linux Apps for GNOME.md new file mode 100644 index 0000000000..6e24a612a3 --- /dev/null +++ b/sources/news/20210826 -Apps for GNOME- is a New Web Portal to Showcase Best Linux Apps for GNOME.md @@ -0,0 +1,81 @@ +[#]: subject: "“Apps for GNOME” is a New Web Portal to Showcase Best Linux Apps for GNOME" +[#]: via: "https://news.itsfoss.com/apps-for-gnome-portal/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +“Apps for GNOME” is a New Web Portal to Showcase Best Linux Apps for GNOME +====== + +There are several apps built for GNOME. Most of the stock (default) GNOME apps do not get enough spotlight as a separate mention. + +While Flathub as a platform helps highlight some fantastic applications for GNOME, it limits to Flatpak apps only. + +Also, it is not just dedicated to GNOME, of course. + +Hence, there is a new website to focus more on the GNOME ecosystem and highlight the best GNOME apps. + +### Apps for GNOME + +![][1] + +A [blog post][2] by Sophie Herold on Planet GNOME announced the availability of the platform. + +[apps.gnome.org][3] is where you can find all the GNOME apps, both default and third-party applications tailored primarily for the GNOME environment. + +With this portal, they aim to encourage users to participate and contribute to the development of such applications. + +When you head to explore an app on the platform, you will be presented with plenty of information that includes where to submit feedback for the app, help translate, and contribute financially. + +![][4] + +It is not something out-of-the-box, but it presents all the information related to a GNOME app in a single place. + +You get a complete picture for a GNOME app starting with the description, screenshots, latest version, information about the maintainers, and translation status. + +![][5] + +Not just limited to desktop GNOME apps, but you will also find applications marked with a mobile icon if it is supported on GNOME mobile devices. + +In addition to the key GNOME apps, it also aims to feature applications that do not offer a flatpak package but suits well for the GNOME platform. + +[Apps for GNOME][3] + +### Making Information More Accessible + +I find it much more insightful than what Flathub seems to provide. And, I think this is not just going to help highlight GNOME apps, but it should help new users get to know more about the applications they use. + +Of course, it should also encourage users to get involved, which is the primary focus. + +While KDE already had an [application portal][6], it might need an upgrade if they take Apps for GNOME as an example to improve. + +_What do you think about the Apps for GNOME initiative?_ _Feel free to share your thoughts in the comments._ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/apps-for-gnome-portal/ + +作者:[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://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://blogs.gnome.org/sophieh/2021/08/26/apps-gnome-org-is-online/ +[3]: https://apps.gnome.org +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI4MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3OSIgd2lkdGg9Ijc0NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://apps.kde.org From 492f0ce1ebbc2dd6b75eb635617fc3342bb72174 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Aug 2021 05:07:14 +0800 Subject: [PATCH 007/138] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210826=20?= =?UTF-8?q?Open=20Source=20Video=20Editor=20OpenShot=202.6=20Released=20Wi?= =?UTF-8?q?th=20AI=20Effects=20&=20Major=20Improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210826 Open Source Video Editor OpenShot 2.6 Released With AI Effects - Major Improvements.md --- ...ed With AI Effects - Major Improvements.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/news/20210826 Open Source Video Editor OpenShot 2.6 Released With AI Effects - Major Improvements.md diff --git a/sources/news/20210826 Open Source Video Editor OpenShot 2.6 Released With AI Effects - Major Improvements.md b/sources/news/20210826 Open Source Video Editor OpenShot 2.6 Released With AI Effects - Major Improvements.md new file mode 100644 index 0000000000..a69fcdee8f --- /dev/null +++ b/sources/news/20210826 Open Source Video Editor OpenShot 2.6 Released With AI Effects - Major Improvements.md @@ -0,0 +1,122 @@ +[#]: subject: "Open Source Video Editor OpenShot 2.6 Released With AI Effects & Major Improvements" +[#]: via: "https://news.itsfoss.com/openshot-2-6-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Open Source Video Editor OpenShot 2.6 Released With AI Effects & Major Improvements +====== + +OpenShot is one of the most popular [open-source video editors][1] out there. + +It is not just for Linux, but it is an impressive free video editor for Windows and Mac users as well. + +While it was already a functional, easy-to-use, feature-rich video editor, it stepped up a notch with the latest release. + +Here, we discuss some key additions in OpenShot 2.6.0 release. + +### OpenShot 2.6.0 Released: What’s New? + +![][2] + +The primary highlight of this release is the inclusion of AI and computer vision effects. But, there is more to it than meets the eye. + +Here are the highlights for OpenShot 2.6.0 changes: + + * New AI and computer vision effects + * New audio effects + * New zoom slider + * Improved transform tool + * Improved video effects + * Improved snapping + * More emoji support + * Improved performance + * Bug fixes + + + +Considering the fundamental changes, OpenShot is now a more compelling option for professional video editors. + +![Official YouTube video for OpenShot 2.6][3] + +### AI Effects + +Taking the help of an AI to process images/videos is becoming increasingly common these days. + +Hence, OpenShot adds the support for AI effects to make it easier to enhance and edit videos. + +One of the features includes eliminating any shake/motion in a video by calculating it. + +![][4] + +You can also track particular objects in a video. This is undoubtedly helpful for animation or any other creative work where you need to follow a specific element of the video. + +Like a real-time feed where the camera detects vehicles, it can also identify objects in the video. While this feature is in beta, it should be fun to experiment with it. + +### Audio Effects + +OpenShot video editor featured most of the essential audio effects. And, in this release, some more important audio effects have been added that include: + + * Compressor + * Expander + * Echo + * Delay + * Distortion + * Noise + * EQ + * Robotic voice and whispering voice effects + + + +### New & Improved Tools + +![][5] + +Vital tools in snapping and transform mode have been improved. + +The improved transform tool lets you resize, rotate, and work seamlessly to create complex animations. + +Furthermore, when trimming the clip, the snapping tool allows you better align the edges of the clips. + +A new zoom slider tool has been added to give you better control over the timeline. You can easily drag and work with a specific portion of the timeline as needed. + +### Other Improvements + +In addition to the essential changes, you can find performance improvements and numerous bug fixes. + +You can find the latest version as an AppImage file as of now. It should reflect soon in the Flathub repository and other sources as well. Consider reading [how to use AppImage files][6] if you are not aware of it. + +[Download OpenShot 2.6.0][7] + +To explore more about the release, you may refer to the [official release announcement][8]. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/openshot-2-6-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/open-source-video-editors/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://i0.wp.com/i.ytimg.com/vi/06sgvsYB378/hqdefault.jpg?w=780&ssl=1 +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM2MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://itsfoss.com/use-appimage-linux/ +[7]: https://www.openshot.org/download/ +[8]: https://www.openshot.org/blog/2021/08/25/new_openshot_release_260/ From dd2aaa94636ec3fd44782ec2122e2ebeb5d7d587 Mon Sep 17 00:00:00 2001 From: SamMa Date: Fri, 27 Aug 2021 09:09:49 +0800 Subject: [PATCH 008/138] Update 20210817 Automatically Synchronize Subtitle With Video Using SubSync.md --- ...onize Subtitle With Video Using SubSync.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md b/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md index 6359d7c616..a71236acde 100644 --- a/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md +++ b/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md @@ -3,36 +3,36 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "turbokernel" [#]: publisher: " " [#]: url: " " -使用 SubSync 自动将字幕与视频同步化 +使用 SubSync 自动同步视频字幕 ====== -让我分享一个场景。你正试图观看一部电影或视频,你需要字幕。你下载了字幕,却发现字幕没有正确同步。没有其他好的字幕可用。现在该怎么做? +让我分享一个场景:当你试图观看一部电影或视频时,你需要字幕。你下载字幕后,却发现字幕没有正确同步。没有其他好的字幕可用。现在该怎么做? -你可以[在 VLC 中按 G 或 H 键来同步字幕][1]。它为字幕增加了一个延迟。如果字幕在整个视频中以相同的时间间隔不同步,这可能会起作用。但如果不是这种情况,SubSync 在这里会有很大帮助。 +你可以[在 VLC 中按 G 或 H 键来同步字幕][1]。它为字幕增加了延迟。如果字幕在整个视频中的时间延迟相同,这可能会起作用。否则,SubSync 将提供很大帮助。 ### SubSync: 字幕语音同步器 -[SubSync][2] 是一个灵巧的开源工具,可用于 Linux、macOS 和 Windows。 +[SubSync][2] 是一款实用的开源工具,可用于 Linux、macOS 和 Windows。 -它通过收听音轨来同步字幕,这就是它的神奇之处。即使音轨和字幕使用的是不同的语言,它也能发挥作用。如果有必要,它也可以被翻译,但我没有测试这个功能。 +它通过监听音轨来同步字幕,这就是它的神奇之处。即使音轨和字幕使用的是不同的语言,它也能发挥作用。如果有必要,它也支持翻译,但我没有测试这个功能。 -我做了一个简单的测试,使用一个与我正在播放的视频不同步的字幕。令我惊讶的是,它工作得很顺利,我得到了完美的同步字幕。 +我通过播放一个视频不同步的字幕进行了一个简单的测试。令我惊讶的是,它工作得很顺利,我得到了完美的同步字幕。 使用 SubSync 很简单。你启动应用,它要求你添加字幕文件和视频文件。 -![User interface for SubSync][3] +![ SubSync 用户界面][3] -你必须在界面上指定字幕和视频的语言。它可能会根据使用的语言下载额外的资源。 +你必须在界面上选择字幕和视频的语言。它可能会根据选择的语言下载额外的资源。 -![SubSync may download additional packages for language support][4] +![SubSync 可下载附加语言支持包][4] 请记住,同步字幕需要一些时间,这取决于视频和字幕的长度。在等待过程完成时,你可以拿起你的茶/咖啡或啤酒。 -你可以看到正在进行的同步状态,甚至可以在完成之前保存它。 +你可以看到正在进行同步的状态,甚至可以在完成之前保存它。 ![SubSync synchronization in progress][5] @@ -40,27 +40,27 @@ ![Synchronization completed][6] -我不能说它在所有情况下都能工作,但在我运行的样本测试中它是有效的。 +我不能保证所有情况下都能正常工作,但在我运行的样本测试中它是正常的。 ### 安装 SubSync SubSync 是一个跨平台的应用,你可以从它的[下载页面][7]获得 Windows 和 MacOS 的安装文件。 -对于 Linux 用户,SubSync 是作为一个 Snap 包提供的。如果你的发行版已经启用了 Snap 支持,使用下面的命令来安装 SubSync: +对于 Linux 用户,SubSync 是作为一个 Snap 包提供的。如果你的发行版已经提供了 Snap 支持,使用下面的命令来安装 SubSync: ``` sudo snap install subsync ``` -请记住,下载 SubSync snap 包将需要一些时间。所以要有一个良好的网络连接或足够的耐心。 +请记住,下载 SubSync snap 包将需要一些时间。所以要有一个稳定的网络连接或足够的耐心。 ### 最后 就我个人而言,我对字幕很上瘾。即使我在 Netflix 上看英文电影,我也会把字幕打开。它有助于清楚地理解每段对话,特别是在有强烈口音的情况下。如果没有字幕,我永远无法理解[电影 Snatch 中 Mickey O'Neil(由 Brad Pitt 扮演)的一句话][8]。 -使用 SubSync 比[使用 Subtitle Editor][9] 同步字幕要容易得多。在[企鹅字幕播放器][10]之后,对于像我这样在整个互联网上搜索不同国家的稀有或推荐(神秘)电影的人来说,这是另一个很棒的工具。 +使用 SubSync 比[ Subtitle Editor][9] 同步字幕要容易得多。在[企鹅字幕播放器][10]之后,对于像我这样在整个互联网上搜索不同国家的冷门或推荐(神秘)电影的人来说,这是另一个很棒的工具。 -如果你是一个“字幕用户”,我感觉你会喜欢这个工具。如果你使用过它,请在评论区分享你的使用经验。 +如果你是一个“字幕用户”,你会喜欢这个工具。如果你使用过它,请在评论区分享你的使用经验。 -------------------------------------------------------------------------------- @@ -69,7 +69,7 @@ via: https://itsfoss.com/subsync/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 875344f1a705f39a9127db8ff3df273dbc068614 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 10:01:16 +0800 Subject: [PATCH 009/138] PUB @geekpi @turbokernel https://linux.cn/article-13722-1.html --- ...onize Subtitle With Video Using SubSync.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) rename {translated/tech => published}/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md (62%) diff --git a/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md b/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md similarity index 62% rename from translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md rename to published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md index a71236acde..8ab216c61e 100644 --- a/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md +++ b/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md @@ -4,33 +4,35 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "turbokernel" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13722-1.html" 使用 SubSync 自动同步视频字幕 ====== -让我分享一个场景:当你试图观看一部电影或视频时,你需要字幕。你下载字幕后,却发现字幕没有正确同步。没有其他好的字幕可用。现在该怎么做? +![](https://img.linux.net.cn/data/attachment/album/202108/27/100003ts3j0odw05j0ooy3.jpg) -你可以[在 VLC 中按 G 或 H 键来同步字幕][1]。它为字幕增加了延迟。如果字幕在整个视频中的时间延迟相同,这可能会起作用。否则,SubSync 将提供很大帮助。 +让我分享一个场景:当你想要观看一部电影或视频,而又需要字幕时,在你下载字幕后,却发现字幕没有正确同步,也没有其他更好的字幕可用。现在该怎么做? + +你可以 [在 VLC 中按 G 或 H 键来同步字幕][1]。它可以为字幕增加延迟。如果字幕在整个视频中的时间延迟相同,这可能会起作用。但如果不是这种情况,就需要 SubSync 出场了。 ### SubSync: 字幕语音同步器 [SubSync][2] 是一款实用的开源工具,可用于 Linux、macOS 和 Windows。 -它通过监听音轨来同步字幕,这就是它的神奇之处。即使音轨和字幕使用的是不同的语言,它也能发挥作用。如果有必要,它也支持翻译,但我没有测试这个功能。 +它通过监听音轨来同步字幕,这就是它的神奇之处。即使音轨和字幕使用的是不同的语言,它也能发挥作用。如果有必要,它也支持翻译,但我没有测试过这个功能。 -我通过播放一个视频不同步的字幕进行了一个简单的测试。令我惊讶的是,它工作得很顺利,我得到了完美的同步字幕。 +我播放一个视频不同步的字幕进行了一个简单的测试。令我惊讶的是,它工作得很顺利,我得到了完美的同步字幕。 -使用 SubSync 很简单。你启动应用,它要求你添加字幕文件和视频文件。 +使用 SubSync 很简单。启动这个应用,它会让你添加字幕文件和视频文件。 -![ SubSync 用户界面][3] +![SubSync 用户界面][3] -你必须在界面上选择字幕和视频的语言。它可能会根据选择的语言下载额外的资源。 +你需要在界面上选择字幕和视频的语言。它可能会根据选择的语言下载额外的资源。 ![SubSync 可下载附加语言支持包][4] -请记住,同步字幕需要一些时间,这取决于视频和字幕的长度。在等待过程完成时,你可以拿起你的茶/咖啡或啤酒。 +请记住,同步字幕需要一些时间,这取决于视频和字幕的长度。在等待过程完成时,你可以喝杯茶/咖啡或啤酒。 你可以看到正在进行同步的状态,甚至可以在完成之前保存它。 @@ -44,7 +46,7 @@ ### 安装 SubSync -SubSync 是一个跨平台的应用,你可以从它的[下载页面][7]获得 Windows 和 MacOS 的安装文件。 +SubSync 是一个跨平台的应用,你可以从它的 [下载页面][7] 获得 Windows 和 MacOS 的安装文件。 对于 Linux 用户,SubSync 是作为一个 Snap 包提供的。如果你的发行版已经提供了 Snap 支持,使用下面的命令来安装 SubSync: @@ -52,13 +54,13 @@ SubSync 是一个跨平台的应用,你可以从它的[下载页面][7]获得 sudo snap install subsync ``` -请记住,下载 SubSync snap 包将需要一些时间。所以要有一个稳定的网络连接或足够的耐心。 +请记住,下载 SubSync Snap 包将需要一些时间。所以要有一个稳定的网络连接或足够的耐心。 ### 最后 -就我个人而言,我对字幕很上瘾。即使我在 Netflix 上看英文电影,我也会把字幕打开。它有助于清楚地理解每段对话,特别是在有强烈口音的情况下。如果没有字幕,我永远无法理解[电影 Snatch 中 Mickey O'Neil(由 Brad Pitt 扮演)的一句话][8]。 +就我个人而言,我很依赖字幕。即使我在 Netflix 上看英文电影,我也会把字幕打开。它有助于我清楚地理解每段对话,特别是在有强烈口音的情况下。如果没有字幕,我永远无法理解 [电影 Snatch 中 Mickey O'Neil(由 Brad Pitt 扮演)的一句话][8]。 -使用 SubSync 比[ Subtitle Editor][9] 同步字幕要容易得多。在[企鹅字幕播放器][10]之后,对于像我这样在整个互联网上搜索不同国家的冷门或推荐(神秘)电影的人来说,这是另一个很棒的工具。 +使用 SubSync 比 [Subtitle Editor][9] 同步字幕要容易得多。对于像我这样在整个互联网上搜索不同国家的冷门或推荐(神秘)电影的人来说,除了 [企鹅字幕播放器][10],这是另一个很棒的工具。 如果你是一个“字幕用户”,你会喜欢这个工具。如果你使用过它,请在评论区分享你的使用经验。 From e94c0079f03ae722eea4a25b04c9f43bb94b42df Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 10:05:03 +0800 Subject: [PATCH 010/138] PRF --- ...matically Synchronize Subtitle With Video Using SubSync.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md b/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md index 8ab216c61e..367eb80668 100644 --- a/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md +++ b/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md @@ -36,11 +36,11 @@ 你可以看到正在进行同步的状态,甚至可以在完成之前保存它。 -![SubSync synchronization in progress][5] +![SubSync 同步中][5] 同步完成后,你就可以点击保存按钮,把修改的内容保存到原文件中,或者把它保存为新的字幕文件。 -![Synchronization completed][6] +![同步完成][6] 我不能保证所有情况下都能正常工作,但在我运行的样本测试中它是正常的。 From 39b7e53dc0cf791c4e94c96489b3a24590776f6a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 10:53:03 +0800 Subject: [PATCH 011/138] PRF @geekpi --- ... Build a JAR file with fastjar and gjar.md | 53 ++++++++----------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/translated/tech/20210818 Build a JAR file with fastjar and gjar.md b/translated/tech/20210818 Build a JAR file with fastjar and gjar.md index 42f4d45377..ea56ee3e10 100644 --- a/translated/tech/20210818 Build a JAR file with fastjar and gjar.md +++ b/translated/tech/20210818 Build a JAR file with fastjar and gjar.md @@ -3,24 +3,24 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 用 fastjar 和 gjar 构建一个 JAR 文件 ====== -fastjar、gjar 和 jar 等工具可以帮助你手动或以编程方式构建 JAR 文件,而其他工具链,如 Maven -和 Gradle 提供了依赖性管理的功能。 -![Someone wearing a hardhat and carrying code ][1] -JAR 文件使用户很容易下载和启动他们想尝试的应用,很容易将该应用从一台计算机转移到另一台计算机(而且 Java 是跨平台的,所以可以鼓励自由分享),而且对于新的程序员来说,很容易理解 JAR 文件的内容,以找出使 Java 应用运行的原因。 +> fastjar、gjar 和 jar 等工具可以帮助你手动或以编程方式构建 JAR 文件,而其他工具链,如 Maven 和 Gradle 提供了依赖性管理的功能。 + +![](https://img.linux.net.cn/data/attachment/album/202108/27/105207oj4f44t4vbkkv4iq.jpg) + +根据我的经验,Java 的许多优点之一是它能够以整齐方便的包(称为 JAR,或 Java 归档)来提供应用程序。JAR 文件使用户很容易下载并启动他们想尝试的应用,很容易将该应用从一台计算机转移到另一台计算机(而且 Java 是跨平台的,所以可以鼓励自由分享),而且对于新的程序员来说,查看 JAR 文件的内容,以找出使 Java 应用运行的原因是很容易理解的。 创建 JAR 文件的方法有很多,包括 Maven 和 Gradle 等工具链解决方案,以及 IDE 中的一键构建功能。然而,也有一些独立的命令,如 `jarfast`、`gjar` 和普通的 `jar`,它们对于快速和简单的构建是很有用的,并且可以演示 JAR 文件运行所需要的东西。 ### 安装 -在 Linux 上,你可能已经有了 `fastjar`、`gjar` 或 `jar` 命令,作为 OpenJDK 包或 GCJ(GCC-Java)的一部分。你可以通过输入不带参数的命令来测试这些命令是否已经安装: - +在 Linux 上,你可能已经有了 `fastjar`、`gjar` 或作为 OpenJDK 包或 GCJ(GCC-Java)的一部分的 `jar` 命令。你可以通过输入不带参数的命令来测试这些命令是否已经安装: ``` $ fastjar @@ -35,7 +35,7 @@ Try `jar --help' for more information. 我安装了所有这些命令,但你只需要一个。所有这些命令都能够构建一个 JAR。 -在 Fedora 等现代 Linux 系统上,输入一个缺失的命令会使你的操作系统提示安装。 +在 Fedora 等现代 Linux 系统上,输入一个缺失的命令你的操作系统提示安装它。 另外,你可以直接从 [AdoptOpenJDK.net][3] 为 Linux、MacOS 和 Windows [安装 Java][2]。 @@ -43,45 +43,40 @@ Try `jar --help' for more information. 首先,你需要构建一个 Java 应用。 -为了简单起见,在一个名为 hello.java 的文件中创建一个基本的 “hello world” 应用: - +为了简单起见,在一个名为 `hello.java` 的文件中创建一个基本的 “hello world” 应用: ``` class Main { -public static void main([String][4][] args) { -[System][5].out.println("Hello Java World"); +public static void main(String[] args) { + System.out.println("Hello Java World"); }} ``` 这是一个简单的应用,在某种程度上淡化了管理外部依赖关系在现实世界中的重要性。不过,这也足以让你开始了解创建 JAR 所需的基本概念了。 -接下来,创建一个清单文件。清单文件描述了 JAR 的 Java 环境。在这种情况下,最重要的信息是识别主类,这样执行 JAR 的 Java 运行时就知道在哪里可以找到应用的入口点。 - +接下来,创建一个清单文件。清单文件描述了 JAR 的 Java 环境。在这个例子里,最重要的信息是识别主类,这样执行 JAR 的 Java 运行时就知道在哪里可以找到应用的入口点。 ``` $ mdir META-INF -$ echo "Main-Class: Main" > META-INF/MANIFEST.MF +$ echo "Main-Class: Main" > META-INF/MANIFEST.MF ``` ### 编译 Java 字节码 接下来,把你的 Java 文件编译成 Java 字节码。 - ``` -`$ javac hello.java` +$ javac hello.java ``` 另外,你也可以使用 GCC 的 Java 组件来编译: - ``` -`$ gcj -C hello.java` +$ gcj -C hello.java ``` 无论哪种方式,都会产生文件 `Main.class`: - ``` $ file Main.class Main.class: compiled Java class data, version XX.Y @@ -91,32 +86,28 @@ Main.class: compiled Java class data, version XX.Y 你有了所有需要的组件,这样你就可以创建 JAR 文件了。 -我经常包含 Java 源码给好奇的用户参考,但_所有_需要的只是 `META-INF` 目录和类文件。 - -`fastjar` 命令使用类似于 [`tar` 命令][6]的语法。 +我经常包含 Java 源码给好奇的用户参考,这只需 `META-INF` 目录和类文件即可。 +`fastjar` 命令使用类似于 [tar 命令][6]的语法。 ``` -`$ fastjar cvf hello.jar META-INF Main.class` +$ fastjar cvf hello.jar META-INF Main.class ``` 另外,你也可以用 `gjar`,方法大致相同,只是 `gjar` 需要你明确指定清单文件: - ``` -`$ gjar cvf world.jar Main.class -m META-INF/MANIFEST.MF` +$ gjar cvf world.jar Main.class -m META-INF/MANIFEST.MF ``` -或者你可以使用 `jar` 命令。注意这个命令不需要 Manifest 文件,因为它会自动为你生成一个,但为了安全起见,我明确定义了主类: - +或者你可以使用 `jar` 命令。注意这个命令不需要清单文件,因为它会自动为你生成一个,但为了安全起见,我明确定义了主类: ``` -`$ jar --create --file hello.jar --main-class=Main Main.class` +$ jar --create --file hello.jar --main-class=Main Main.class ``` 测试你的应用: - ``` $ java -jar hello.jar Hello Java World @@ -135,7 +126,7 @@ via: https://opensource.com/article/21/8/fastjar 作者:[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 0ab95e81c9aca6261b2c953c83ebcce98ca5739c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 10:53:40 +0800 Subject: [PATCH 012/138] PUB @geekpi https://linux.cn/article-13723-1.html --- .../20210818 Build a JAR file with fastjar and gjar.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210818 Build a JAR file with fastjar and gjar.md (98%) diff --git a/translated/tech/20210818 Build a JAR file with fastjar and gjar.md b/published/20210818 Build a JAR file with fastjar and gjar.md similarity index 98% rename from translated/tech/20210818 Build a JAR file with fastjar and gjar.md rename to published/20210818 Build a JAR file with fastjar and gjar.md index ea56ee3e10..ce47a73776 100644 --- a/translated/tech/20210818 Build a JAR file with fastjar and gjar.md +++ b/published/20210818 Build a JAR file with fastjar and gjar.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13723-1.html" 用 fastjar 和 gjar 构建一个 JAR 文件 ====== From 599eccf640a78fa3b7ff06d4b6861a037bb41db9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 11:19:57 +0800 Subject: [PATCH 013/138] APL --- ...20210826 30 things you didn-t know about the Linux kernel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md b/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md index 82a3673941..df11664b30 100644 --- a/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md +++ b/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/linux-kernel" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From f60c86544b33fc92fd656dd13e6f17cfbac35e1d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 15:00:37 +0800 Subject: [PATCH 014/138] TSL&PRF @wxy --- ... you didn-t know about the Linux kernel.md | 100 ------------------ ... you didn-t know about the Linux kernel.md | 70 ++++++++++++ 2 files changed, 70 insertions(+), 100 deletions(-) delete mode 100644 sources/tech/20210826 30 things you didn-t know about the Linux kernel.md create mode 100644 translated/tech/20210826 30 things you didn-t know about the Linux kernel.md diff --git a/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md b/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md deleted file mode 100644 index df11664b30..0000000000 --- a/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: subject: "30 things you didn't know about the Linux kernel" -[#]: via: "https://opensource.com/article/21/8/linux-kernel" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -30 things you didn't know about the Linux kernel -====== -The Linux kernel is turning 30 this year. -![30 years][1] - -The Linux kernel is turning 30 this year. That's three decades of pioneering open source software, enabling users to run free software, to learn from the applications they're running, and to share what they've learned with friends. It's argued that without the Linux kernel, the luxuries of [open culture][2] and free software we enjoy today may not have surfaced when they have. It's highly improbable that the parts of Apple and Microsoft and Google that are open would be open at all without Linux as the catalyst. The impact of Linux as a phenomenon for culture, software development, and user experience cannot be overstated, and yet it all started with a kernel. - -A kernel is the software that boots a computer, recognizes—and ensures communication between—all of the components attached to the computer, both inside and outside of the computer case. For code that most users never even think about, much less understand, there are a lot of surprises about the Linux kernel. In no particular order, here's one fact about the kernel for each year of its life: - - 1. Linux was the first operating system to feature USB 3.0 drivers. Sarah Sharp announced on 7 June 2009 that her driver for USB 3.0 devices was available, and her code was included in kernel version 2.6.31 - - 2. The kernel marks itself as `tainted` when some event occurs that could be useful later for troubleshooting. It’s not a problem to run a "tainted" kernel. Should something go wrong, one of the first troubleshooting steps is to try to reproduce the issue on a non-tainted kernel. - - 3. You can specify a hostname or domain name as part of the `ip=` command-line option, Linux preserves it instead of overwriting it with one proposed by DHCP or BOOTP. For instance, `ip=::::myhostname::dhcp` gets the name `myhostname`. - - 4. There's a version of a black-and-white, 16-color, and 224-color Tux logo during text bootup. - - 5. In the entertainment business, DRM is technology used to prevent access to media. However, in the Linux kernel DRM refers to Direct Rendering Manager and refers to library (libdrm) and drivers used to interface with the GPUs of video cards. - - 6. It's possible to patch the Linux kernel without rebooting. - - 7. If you compile your own kernel, you can configure your text console to have more than 80 columns. - - 8. The Linux kernel provides built-in FAT, exFAT, and NTFS (read and write) compatibility. - - 9. Drivers for Wacom tablets and many similar devices are built into the kernel. - - 10. Most kernel hackers use the `git send-email` to submit patches. - - 11. The kernel uses a documentation toolchain called [Sphinx][3], which is written in Python. - - 12. Hamlib provides shared libraries with a standardized API to control amateur radio equipment through your Linux computer. - - 13. Hardware manufacturers are encouraged to help develop the kernel in order to ensure compatibility. The hardware can thus be addressed directly without having to download a driver from the manufacturer. Drivers that are directly part of the kernel also automatically benefit from performance and security improvements in new versions of the kernel. - - 14. There are drivers included in the kernel for many Raspberry Pi modules (Pi Hats). - - 15. The band netcat released an album playable only as a [Linux kernel module.][4] - - 16. Inspired by netcat's album release, a module to [turn your kernel into a music player][5] has also been developed. - - 17. The Linux kernel features supports many CPU architectures: ARM, ARM64, IA-64, m68k, MIPS, Nios II, PA-RISC, OpenRISC, PowerPC, s390, Sparc, x86, Xtensa, and more. - - 18. In 2001, the Linux kernel became the first to [run the x86-64 CPU architecture in long mode][6]. - - 19. Linux version 3.4 introduced the x32 ABI, allowing developers to compile code to run in 64-bit mode while only using 32-bit pointers and data fields. - - 20. The kernel supports many different file systems, including Ext2, Ext3, Ext4, JFS, XFS, GFS2, GCFS2, BtrFS, NILFS2, NFS, Overlay FS, UDF, and more. - - 21. The Virtual File System is a software layer in the kernel providing the filesystem interface to applications users run. It's also an abstraction for the kernel so that different filesystem implementations can coexist. - - 22. The Linux kernel includes a driver for a physical Braille output device. - - 23. For kernel version 2.6.29, the Tux logo during boot was replaced by "Tuz" to raise awareness of an aggressive cancer that was affecting the Tasmanian Devil population in Australia at the time. - - 24. Control Groups (cgroups) are the reason containers (the foundation technology for Docker, Podman, Kubernetes, and much more) can exist. - - 25. It took extensive legal action to liberate it so it could be included, but today the CIFS module is built into the kernel to enable SMB support. This allows Linux to mount Microsoft remote and cloud-based file shares. - - 26. It's notoriously difficult (in fact impossible, so far) for a computer to produce a truly random number. The `hw_random` framework can make use of special hardware features on your CPU or motherboard in an effort to improve random number generation. - - 27. _OS jitter_ is interference experienced by an application caused by conflicts in how background processes are scheduled, and how the system handles asynchronous events (such as interrupts.) Binding tasks to sets of CPUs defined by the kernel, using cgroups, and SMP IRQ affinity are options that the kernel provides programmers for reducing OS jitter. Issues like these are discussed in detail in the kernel documentation, helping programmers targeting Linux can write smarter code. - - 28. The `make menuconfig` command allows you to use a GUI to configure a kernel before compiling. The `Kconfig` language defines kernel config options. - - 29. For essential Linux servers, a _watchdog_ system can be implemented to monitor the health of the server. Between health checks, the watchdog daemon writes data to a special watchdog kernel device, preventing a system reset. Should a watchdog fail to log success, the system is reset. Many implementations of watchdog hardware exist, and they're vital for remote mission critical computers (such as those sent to Mars.) - - 30. Although it was developed on Earth, there's a copy of the Linux kernel on the planet Mars. - - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/linux-kernel - -作者:[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/kernel-30.png?itok=xmwX2pCQ (30 years) -[2]: https://opensource.com/article/18/1/creative-commons-real-world -[3]: https://opensource.com/article/19/11/document-python-sphinx -[4]: https://github.com/usrbinnc/netcat-cpi-kernel-module -[5]: https://github.com/FlaviaR/Netcat-Music-Kernel-Expansion -[6]: http://www.x86-64.org/pipermail/announce/2001-June/000020.html diff --git a/translated/tech/20210826 30 things you didn-t know about the Linux kernel.md b/translated/tech/20210826 30 things you didn-t know about the Linux kernel.md new file mode 100644 index 0000000000..92c1014b4d --- /dev/null +++ b/translated/tech/20210826 30 things you didn-t know about the Linux kernel.md @@ -0,0 +1,70 @@ +[#]: subject: "30 things you didn't know about the Linux kernel" +[#]: via: "https://opensource.com/article/21/8/linux-kernel" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +关于 Linux 内核的 30 件你不知道的事 +====== + +> Linux 内核今年 30 岁了。 + +![](https://img.linux.net.cn/data/attachment/album/202108/27/150006o152rdghq0zqr02f.jpg) + +Linux 内核今年 30 岁了。这开创性的开源软件的三个十年,让用户能够运行自由软件,让他们能从运行的应用程序中学习,让他们能与朋友分享他们所学到的知识。有人认为,如果没有 Linux 内核,我们如今所享受的 [开源文化][2] 和自由软件的累累硕果,可能就不会应时而出现。如果没有 Linux 作为催化剂,苹果、微软和谷歌所开源的那些就不可能开源。Linux 作为一种现象,对开源文化、软件开发和用户体验的影响,是怎么强调都不为过的,但所有这一切,都滥觞于一个 Linux 内核。 + +Linux 内核是启动计算机、并识别和确保计算机内外所连接的所有组件之间通信的软件。这些对于大多数用户从未想过,更不用说能理解的代码,Linux 内核有很多令人惊讶的地方。以下是 Linux 内核在其三十年生命中每一年的一件事。顺序无关。 + + 1. Linux 是第一个具有 USB 3.0 驱动的操作系统。Sarah Sharp 在 2009 年 6 月 7 日宣布她的 USB 3.0 设备的驱动程序可以使用了,她的代码被包含在内核 2.6.31 版本中。 + 2. 当某些事件发生时,内核会将自己标记为“受污染”,这在以后的故障排除中可能有用。运行一个“被污染”的内核并不是什么问题。但如果出现错误,首先要做的是在一个没有被污染的内核上重现该问题。 + 3. 你可以指定一个主机名或域名作为 `ip=` 内核命令行选项的一部分,Linux 会保留它,而不是用 DHCP 或 BOOTP 提供的主机名或域名来覆盖它。例如,`ip=::::myhostname::dhcp` 设置主机名 `myhostname`。 + 4. 在文本启动过程中,可以选择显示黑白的、16 色的或 224 色的 Tux 徽标之一。 + 5. 在娱乐业中,DRM 是一种用来防止访问媒介的技术。然而,在 Linux 内核中,DRM 指的是直接渲染管理器Direct Rendering Manager,它指的是用于与对接显卡的 GPU 的库(`libdrm`)和驱动程序。 + 6. 能够在不重启的情况下给 Linux 内核打补丁。 + 7. 如果你自己编译内核,你可以将文本控制台配置为超过 80 列宽。 + 8. Linux 内核提供了内置的 FAT、exFAT 和 NTFS(读和写)支持。 + 9. Wacom 平板电脑和许多类似设备的驱动程序都内置在内核中。 + 10. 大多数内核高手使用 `git send-email` 来提交补丁。 + 11. 内核使用一个叫做 [Sphinx][3] 的文档工具链,它是用 Python 编写的。 + 12. Hamlib 提供了具有标准化 API 的共享库,可以通过你的 Linux 电脑控制业余无线电设备。 + 13. 我们鼓励硬件制造商帮助开发 Linux 内核,以确保兼容性。这样就可以直接处理硬件,而不必从制造商那里下载驱动程序。直接成为内核一部分的驱动程序也会自动从新版本内核的性能和安全改进中受益。 + 14. 内核中包含了许多树莓派模块(Pi Hats)的驱动程序。 + 15. netcat 乐队发布了一张只能作为 [Linux 内核模块][4] 播放的专辑。 + 16. 受 netcat 发布专辑的启发,人们又开发了一个 [把你的内核变成一个音乐播放器][5] 的模块。 + 17. Linux 内核的功能支持许多 CPU 架构:ARM、ARM64、IA-64、 m68k、MIPS、Nios II、PA-RISC、OpenRISC、PowerPC、s390、 Sparc、x86、Xtensa 等等。 + 18. 2001 年,Linux 内核成为第一个 [以长模式运行的 x86-64 CPU 架构][6]。 + 19. Linux 3.4 版引入了 x32 ABI,允许开发者编译在 64 位模式下运行的代码,而同时只使用 32 位指针和数据段。 + 20. 内核支持许多不同的文件系统,包括 Ext2、Ext3、Ext4、JFS、XFS、GFS2、GCFS2、BtrFS、NILFS2、NFS、Overlay FS、UDF 等等。 + 21. 虚拟文件系统Virtual File System(VFS)是 Linux 内核中的一个软件层,为用户运行的应用程序提供文件系统接口。它也是内核的一个抽象层,以便不同的文件系统实现可以共存。 + 22. Linux 内核包括一个实体的盲文输出设备的驱动程序。 + 23. 在 2.6.29 版本的内核中,启动时的 Tux 徽标被替换为 “Tuz”,以提高人们对当时影响澳大利亚的塔斯马尼亚魔鬼Tasmanian Devil(即袋獾)种群的一种侵袭性癌症的认识。 + 24. 控制组Control Groups(cgroups)是容器(Docker、Podman、Kubernetes 等的基础技术)能够存在的原因。 + 25. 曾经花了大量的法律行动来解放 CIFS,以便将其纳入内核中,而今天,CIFS 模块已被内置于内核,以实现对 SMB 的支持。这使得 Linux 可以挂载微软的远程共享和基于云的文件共享。 + 26. 对于计算机来说,产生一个真正的随机数是出了名的困难(事实上,到目前为止是不可能的)。`hw_random` 框架可以利用你的 CPU 或主板上的特殊硬件功能,尽量改进随机数的生成。 + 27. _操作系统抖动_ 是应用程序遇到的干扰,它是由后台进程的调度方式和系统处理异步事件(如中断)的方式的冲突引起的。像这些问题在内核文档中都有详细的讨论,可以帮助面向 Linux 开发的程序员写出更聪明的代码。 + 28. `make menuconfig` 命令可以让你在编译前使用 GUI 来配置内核。`Kconfig` 语言定义了内核配置选项。 + 29. 对于基本的 Linux 服务器,可以实施一个 _看门狗_ 系统来监控服务器的健康状况。在健康检查间隔中,`watchdog` 守护进程将数据写入一个特殊的 `watchdog` 内核设备,以防止系统重置。如果看门狗不能成功记录,系统就会被重置。有许多看门狗硬件的实现,它们对远程任务关键型计算机(如发送到火星上的计算机)至关重要。 + 30. 在火星上有一个 Linux 内核的副本,虽然它是在地球上开发的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-kernel + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/kernel-30.png?itok=xmwX2pCQ (30 years) +[2]: https://opensource.com/article/18/1/creative-commons-real-world +[3]: https://opensource.com/article/19/11/document-python-sphinx +[4]: https://github.com/usrbinnc/netcat-cpi-kernel-module +[5]: https://github.com/FlaviaR/Netcat-Music-Kernel-Expansion +[6]: http://www.x86-64.org/pipermail/announce/2001-June/000020.html From 1b13c9324be21838f1c1a3ca96e3b0484a7b688c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 15:03:02 +0800 Subject: [PATCH 015/138] PUB @wxy https://linux.cn/article-13724-1.html --- ...210826 30 things you didn-t know about the Linux kernel.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210826 30 things you didn-t know about the Linux kernel.md (99%) diff --git a/translated/tech/20210826 30 things you didn-t know about the Linux kernel.md b/published/20210826 30 things you didn-t know about the Linux kernel.md similarity index 99% rename from translated/tech/20210826 30 things you didn-t know about the Linux kernel.md rename to published/20210826 30 things you didn-t know about the Linux kernel.md index 92c1014b4d..0a8360ba4b 100644 --- a/translated/tech/20210826 30 things you didn-t know about the Linux kernel.md +++ b/published/20210826 30 things you didn-t know about the Linux kernel.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13724-1.html" 关于 Linux 内核的 30 件你不知道的事 ====== From c8deba3e8c992f9a371f7b27d72575f7d614db4b Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Fri, 27 Aug 2021 16:31:11 +0800 Subject: [PATCH 016/138] Update 20210819 A guide to understanding your team-s implicit values and needs.md --- ... to understanding your team-s implicit values and needs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md index 3ac22f86fd..127f226ab7 100644 --- a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md +++ b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/open-organization/21/8/leadership-cultural-social-norms" [#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "zz-air" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -57,7 +57,7 @@ via: https://opensource.com/open-organization/21/8/leadership-cultural-social-no 作者:[Ron McFarland][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zz-air](https://github.com/zz-air) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b46cda295eaf5ee23a81aa497d53561e210c9552 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 28 Aug 2021 05:02:26 +0800 Subject: [PATCH 017/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210827=20?= =?UTF-8?q?Automatically=20Light=20Up=20a=20Sign=20When=20Your=20Webcam=20?= =?UTF-8?q?is=20in=20Use?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210827 Automatically Light Up a Sign When Your Webcam is in Use.md --- ...ht Up a Sign When Your Webcam is in Use.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20210827 Automatically Light Up a Sign When Your Webcam is in Use.md diff --git a/sources/tech/20210827 Automatically Light Up a Sign When Your Webcam is in Use.md b/sources/tech/20210827 Automatically Light Up a Sign When Your Webcam is in Use.md new file mode 100644 index 0000000000..ad4e7c8ba3 --- /dev/null +++ b/sources/tech/20210827 Automatically Light Up a Sign When Your Webcam is in Use.md @@ -0,0 +1,80 @@ +[#]: subject: "Automatically Light Up a Sign When Your Webcam is in Use" +[#]: via: "https://fedoramagazine.org/automatically-light-up-a-sign-when-your-webcam-is-in-use/" +[#]: author: "John Boero https://fedoramagazine.org/author/boeroboy/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Automatically Light Up a Sign When Your Webcam is in Use +====== + +![][1] + +Automatic WFH sign tells others when you're in a conference. + +At the beginning of COVID lockdown and multiple people working from home it was obvious there was a need to let others know when I’m in a meeting or on a live webcam. So naturally it took me one year to finally do something about it. Now I’m here to share what I learned along the way. You too can have your very own “do not disturb” sign automatically light up outside your door to tell people not to walk in half-dressed on laundry day. + +At first I was surprised Zoom doesn’t have this kind of feature built in. But then again I might use Teams, Meet, Hangouts, WebEx, Bluejeans, or any number of future video collaboration apps. Wouldn’t it make sense to just use a system-wide watch for active webcams or microphones? Like most problems in life, this one can be helped with the Linux kernel. A simple check of the _uvcvideo_ module will show if a video device is in use. Without using events all that is left is to poll it for changes. I chose to build a taskbar icon for this. I would normally do this with my trusty C++. But I decided to step out of my usual comfort zone and use Python in case someone wanted to port it to other platforms. I also wanted to renew my lesser Python-fu and face my inner white space demons. I came up with the following ~90 lines of practical and simple but insecure Python: + + + +Aside from the icon bits, a daemon thread performs the following basic check every 1s, calling scripts as changed: + +``` +def run(self): + while True: + val=subprocess.check_output(['lsmod | grep \'^uvcvideo\' | awk \'{print $3}\''], shell=True, text=True).strip() + if val != self.status: + self.status = val + if val == '0': + val=subprocess.check_output(['~/bin/webcam_deactivated.sh']) + else: + val=subprocess.check_output(['~/bin/webcam_activated.sh']) + time.sleep(1) +``` + +Rather than implement the parsing of modules, just using a hard-coded shell command got the job done. Now whatever scripts you choose to put in ~/bin/ will be used when at least one webcam activates or deactivates. I recently had a futile go at the kernel maintainers regarding a bug in usb_core triggered by uvcvideo. I would just as soon not go a step further and attempt an events patch to uvcvideo. Also, this leaves room for Mac or Windows users to port their own simple checks. + +Now that I had a happy icon that sits in my KDE system tray I could implement scripts for on and off. This is where things got complicated. At first I was going to stick a magnetic bluetooth LED badge on my door to flash “LIVE” whenvever I was in a call. These things are ubiquitous on the internet and cost about $10 for basically an embedded ARM Cortex-M0 with an LED screen, bluetooth, and battery. They are basically a full Raspberry Pi Pico kit but soldered onto the board. + +![These Bluetooth LED badges with 48Mhz ARM Cortex-M0 chips have a lot of potential, but they need custom firmware to be any use.][2] + +Unfortunately these badges use a fixed firmware that is either listening to Bluetooth transmissions or showing your message – it doesn’t do both which is silly. Many people have posted feedback that they should be so much more. Sure enough someone has already tinkered with [custom firmware][3]. Unfortunately the firmware was for older USB variants and I’m not about to de-solder or buy an ISP programmer to flash eeprom just for this. That would be a super interesting project for later and would be a great Rpi alternative but all I want right now is a remote controlled light outside my door. I looked at everything including WiFi [smart bulbs][4] to replace my recessed lighting bulbs, to [BTLE candles][5] which are an interesting option. Along the way I learned a lot about Bluetooth Low Energy including how a kernel update can waste 4 hours of weekend with bluetooth stack crashes. BTLE is really interesting and makes a lot more sense after reading up on it. Sure enough there is Python that can set the display [message on your LED badge][6] across the room, but once it is set, Bluetooth will stop listening for you to change it or shut it off. Darn. I guess I should just make do with USB, which actually has a standard command to control power to ports. Let’s see if something exists for this already. + +![A programmable Bluetooth LED sign costs £10 or for £30 you can have a single LED up to 59 inches away.][7] + +It looked like there are options out there even if they’re not ideal. Then suddenly I found it. Neon sign “ON AIR” for £15 and it’s as dumb as they come – just using 5v from USB power. Perfect. + +![Bingo – now all I needed to do was control the power to it.][8] + +The command to control USB power is _uhubctl_ which is in Fedora repos. Unfortunately most USB hubs don’t support this command. In fact very few support it [going back 20 years][9] which seems silly. Hubs will happily report that power has been disconnected even though no such disconnection has been made. I assume it’s just a few cents extra to build in this feature but I’m not a USB hub manufacturer. Therefore I needed to source a pre-owned one. In the end I found a BYTECC BT-UH340 from the US. This was all I needed to finalize it. Adding udev rules to allow the _wheel_ group to control USB power, I can now perform a simple _uhubctl -a off -l 1-1 -p 1_ to turn anything off. + +![The BYTECC BT-UH340 is one of few hubs I could actually find to support uhubctl power.][10] + +Now with a spare USB extension cable lead to my door I finally have a complete solution. There is an “ON AIR” sign on the outside of my door that lights up automatically whenever any of my webcams are in use. I would love to see a Mac port or improvements in pull requests. I’m sure it can all be better. Even further I would love to hone my IoT skills and sort out flashing those Bluetooth badges. If anybody wants to replicate this please be my guest, and suggestions are always welcome. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/automatically-light-up-a-sign-when-your-webcam-is-in-use/ + +作者:[John Boero][a] +选题:[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/boeroboy/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/onair-1890x800-1-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2021/03/IMG_20210322_164346-1024x768.jpg +[3]: https://github.com/Effix/LedBadge +[4]: https://www.amazon.co.uk/AvatarControls-Dimmable-Bluetooth-Connection-2700K-6100K/dp/B08P21MSTW/ref=sr_1_6_mod_primary_lightning_deal?dchild=1&keywords=bluetooth+bulb+spot&qid=1616345349&sbo=Tc8eqSFhUl4VwMzbE4fw%2Fw%3D%3D&smid=A2GE8P68TQ1YXI&sr=8-6 +[5]: http://nilhcem.com/iot/reverse-engineering-simple-bluetooth-devices +[6]: http://nilhcem.com/iot/reverse-engineering-bluetooth-led-name-badge +[7]: https://fedoramagazine.org/wp-content/uploads/2021/03/image-7-1024x416.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/03/IMG_20210322_163624-1024x768.jpg +[9]: https://github.com/mvp/uhubctl#compatible-usb-hubs +[10]: https://c1.neweggimages.com/ProductImage/17-145-089-02.jpg From 5f138153417aec96a7dbd496631439e07351aac4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 28 Aug 2021 05:03:08 +0800 Subject: [PATCH 018/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210827=20?= =?UTF-8?q?Calculate=20date=20and=20time=20ranges=20in=20Groovy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210827 Calculate date and time ranges in Groovy.md --- ...alculate date and time ranges in Groovy.md | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 sources/tech/20210827 Calculate date and time ranges in Groovy.md diff --git a/sources/tech/20210827 Calculate date and time ranges in Groovy.md b/sources/tech/20210827 Calculate date and time ranges in Groovy.md new file mode 100644 index 0000000000..4ae46e19a5 --- /dev/null +++ b/sources/tech/20210827 Calculate date and time ranges in Groovy.md @@ -0,0 +1,172 @@ +[#]: subject: "Calculate date and time ranges in Groovy" +[#]: via: "https://opensource.com/article/21/8/groovy-date-time" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Calculate date and time ranges in Groovy +====== +Use Groovy date and time to discover and display time increments. +![clock][1] + +Every so often, I need to do some calculations related to dates. A few days ago, a colleague asked me to set up a new project definition in our (open source, of course!) project management system. This project is to start on the 1st of August and finish on the 31st of December. The service to be provided is budgeted at 10 hours per week. + +So, yeah, I had to figure out how many weeks between 2021-08-01 and 2021-12-31 inclusive. + +This is the perfect sort of problem to solve with a tiny [Groovy][2] script. + +### Install Groovy on Linux + +Groovy is based on Java, so it requires a Java installation. Both a recent and decent version of Java and Groovy might be in your Linux distribution's repositories. Alternately, you can install Groovy by following the instructions on the [groovy-lang.org][2]. + +A nice alternative for Linux users is [SDKMan][3], which can be used to get multiple versions of Java, Groovy, and many other related tools. For this article, I'm using my distro's OpenJDK11 release and SDKMan's latest Groovy release. + +### Solving the problem with Groovy + +Since Java 8, time and date calculations have been folded into a new package called **java.time**, and Groovy provides access to that. Here’s the script: + + +``` +import java.time.* + +import java.time.temporal.* + +def start = LocalDate.parse('2021-08-01','yyyy-MM-dd') + +def end = LocalDate.parse('2022-01-01','yyyy-MM-dd') + +println "${ChronoUnit.WEEKS.between(start,end)} weeks between $start and $end" +``` + +Copy this code into a file called **wb.groovy** and run it on the command line to see the results: + + +``` +$ groovy wb.groovy +21 weeks between 2021-08-01 and 2022-01-01 +``` + +Let’s review what’s going on. + +### Date and time + +The [**java.time.LocalDate** class][4] provides many useful static methods (like **parse()** shown above, which lets us convert from a string to a **LocalDate** instance according to a pattern, in this case, **‘yyyy-MM-dd’**). The format characters are explained in quite a number of places–for example, the documentation for [**java.time.format.DateTimeFormat**][5]. Notice that **M** represents “month,” not **m**, which represents “minute.” So this pattern defines a date formatted as a four-digit year, followed by a hyphen, followed by a two-digit month number (1-12), followed by another hyphen, followed by a two-digit day-of-month number (1-31). + +Notice as well that in Java, **parse()** requires an instance of **DateTimeFormat**: + + +``` +`parse(CharSequence text, DateTimeFormatter formatter)` +``` + +As a result, parsing becomes a two-step operation, whereas Groovy provides an additional version of **parse()** that accepts the format string directly in place of the **DateTimeFormat** instance. + +The [**java.time.temporal.ChronoUnit** class][6], actually an **Enum**, provides several **Enum constants**, like **WEEKS** (or **DAYS**, or **CENTURIES**...) which in turn provide the **between()** method that allows us to calculate the interval of those units between two **LocalDates** (or other similar date or time data types). Note that I used January 1, 2022, as the value for **end**; this is because **between()** spans the time period starting on the first date given up to but not including the second date given. + +### More date arithmetic + +Every so often, I need to know how many working days are in a specific time frame (like, say, a month). This handy script will calculate that for me: + + +``` +import java.time.* + +def holidaySet = [LocalDate.parse('2021-01-01'), LocalDate.parse('2021-04-02'), +    LocalDate.parse('2021-04-03'), LocalDate.parse('2021-05-01'), +    LocalDate.parse('2021-05-15'), LocalDate.parse('2021-05-16'), +    LocalDate.parse('2021-05-21'), LocalDate.parse('2021-06-13'), +    LocalDate.parse('2021-06-21'), LocalDate.parse('2021-06-28'), +    LocalDate.parse('2021-06-16'), LocalDate.parse('2021-06-18'), +    LocalDate.parse('2021-08-15'), LocalDate.parse('2021-09-17'), +    LocalDate.parse('2021-09-18'), LocalDate.parse('2021-09-19'), +    LocalDate.parse('2021-10-11'), LocalDate.parse('2021-10-31'), +    LocalDate.parse('2021-11-01'), LocalDate.parse('2021-11-21'), +    LocalDate.parse('2021-12-08'), LocalDate.parse('2021-12-19'), +    LocalDate.parse('2021-12-25')] as [Set][7] + +def weekendDaySet = [DayOfWeek.SATURDAY,DayOfWeek.SUNDAY] as [Set][7] + +int calcWorkingDays(start, end, holidaySet, weekendDaySet) { +    (start..<end).inject(0) { subtotal, d -> +        if (!(d in holidaySet || DayOfWeek.from(d) in weekendDaySet)) +            subtotal + 1 +        else +            subtotal +    } +} + +def start = LocalDate.parse('2021-08-01') +def end = LocalDate.parse('2021-09-01') + +println "${calcWorkingDays(start,end,holidaySet,weekendDaySet)} working day(s) between $start and $end" +``` + +Copy this code into a file called **wdb.groovy** and run it from the command line to see the results: + + +``` +$ groovy wdb.groovy +22 working day(s) between 2021-08-01 and 2021-09-01 +``` + +Let’s review this. + +First, I create a set of holiday dates (these are Chile’s “días feriados” for 2021, in case you wondered) called holidaySet. Note that the default pattern for **LocalDate.parse()** is ‘**yyyy-MM-dd**’, so I’ve left the pattern out here. Note as well that I’m using the Groovy shorthand **[a,b,c]** to create a **List** and then coercing it to a **Set**. + +Next, I want to skip Saturdays and Sundays, so I create another set incorporating two **enum** values of [**java.time.DayOfWeek**][8]–**SATURDAY** and **SUNDAY**. + +Then I define a method **calcWorkingDays()** that takes as arguments the start date, the end date (which following the previous example of **between()** is the first value outside the range I want to consider), the holiday set, and the weekend day set. Line by line, this method: + + * Defines a range between **start** and **end**, open on the **end**, (that’s what **<end** means) and executes the closure argument passed to the **inject()** method (**inject()** implements the 'reduce' operation on **List** in Groovy) on the successive elements **d** in the range: + * As long as **d** is neither in the **holidaySet** nor in the **weekendDaySet**, increments the **subtotal** by 1 + * Returns the value of the result returned by **inject()** + + + +Next, I define the **start** and **end** dates between which I want to calculate working days. + +Finally, I call **println** using a Groovy [**GString**][9] to evaluate the **calcWorkingDays()** method and display the result. + +Note that I could have used the **each** closure instead of **inject**, or even a **for** loop. I could have also used Java Streams rather than Groovy ranges, lists, and closures. Lots of options. + +### But why not use groovy.Date? + +Some of you old Groovy users may be wondering why I’m not using good old [**groovy.Date**][10]. The answer is, I could use it. But Groovy Date is based on Java Date, and there are some good reasons for moving to **java.time**, even though Groovy Date added quite a few nice things to Java Date. + +For me, the main reason is that there are some not-so-great design decisions buried in the implementation of Java Date, the worst being that it is unnecessarily mutable. I spent a while tracking down a weird bug that arose from my poor understanding of the **clearTime()** method on Groovy Date. I learned it actually clears the time field of the date instance, rather than returning the date value with the time part set to ‘00:00:00’. + +Date instances also aren’t thread-safe, which can be kind of challenging for multithreaded applications. + +Finally, having both date and time wrapped up in a single field isn’t always convenient and can lead to some weird data modeling contortions. Think, for instance, of a day on which multiple events occur: Ideally, the _date_ field would be on the day, and the _time_ field would be on each event; but that’s not easy to do with Groovy Date. + +### Groovy is groovy + +Groovy is an Apache project, and it provides a simplified syntax for Java so you can use it for quick and simple scripts in addition to complex applications. You retain the power of Java, but you access it with an efficient toolset. [Try it soon][11], and see if you find your groove with Groovy. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/groovy-date-time + +作者:[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/clock_1.png?itok=lbyiCJWV (clock) +[2]: https://groovy-lang.org/ +[3]: https://sdkman.io/ +[4]: https://docs.groovy-lang.org/latest/html/groovy-jdk/java/time/LocalDate.html +[5]: https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html +[6]: https://docs.oracle.com/javase/8/docs/api/java/time/temporal/ChronoUnit.html +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+set +[8]: https://docs.oracle.com/javase/8/docs/api/java/time/DayOfWeek.html +[9]: https://docs.groovy-lang.org/latest/html/api/groovy/lang/GString.html +[10]: https://docs.groovy-lang.org/latest/html/groovy-jdk/java/util/Date.html +[11]: https://groovy.apache.org/download.html From 7a11ce663a787b5e564ba4105befa583d0803149 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 28 Aug 2021 05:03:22 +0800 Subject: [PATCH 019/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210827=20?= =?UTF-8?q?Linux=20kernel=20modules=20we=20can't=20live=20without?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210827 Linux kernel modules we can-t live without.md --- ...ux kernel modules we can-t live without.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20210827 Linux kernel modules we can-t live without.md diff --git a/sources/tech/20210827 Linux kernel modules we can-t live without.md b/sources/tech/20210827 Linux kernel modules we can-t live without.md new file mode 100644 index 0000000000..be68102762 --- /dev/null +++ b/sources/tech/20210827 Linux kernel modules we can-t live without.md @@ -0,0 +1,121 @@ +[#]: subject: "Linux kernel modules we can't live without" +[#]: via: "https://opensource.com/article/21/8/linux-kernel-module" +[#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux kernel modules we can't live without +====== +Open source enthusiasts weigh in on the Linux kernel modules they love. +![Linux keys on the keyboard for a desktop computer][1] + +The Linux kernel is turning 30 this year! If you're like us, that's a big deal and we are celebrating Linux this week with a couple of special posts. + +Today we start with a roundup of responses from around the community answering "What Linux kernel module can you not live without? And, why?" Let's hear what these 10 enthusiasts have to say. + +* * * + +I guess some kernel developers will run away screaming when they hear my answer. Still, I list here two of the most controversial modules: + + * First is NVIDIA, as I have an NVIDIA graphics card on my work laptop and my personal desktop. + * The other one probably generates less hatred—the VMNET and VMMON modules from VMware to be able to run VMware Workstation. —[Peter Czanik][2] + + + +* * * + +My favorite is the [zram][3] module. It creates a compressed block device in memory, which can then be used as a swap partition. Using a zram-based swap partition is ideal when memory is limited (for example, on virtual machines) and if you are worried about wearing out your SSD or, even worse, your flash-based storage because of frequent I/O operations. —[Stephan Avenwedde][4] + +* * * + +The most useful kernel module is definitively snd-hda-intel since it supports most integrated sound cards. I listen to music while coding an audio sequencer on the Linux desktop. —[Joël Krähemann][5] + +* * * + +My laptop would be worthless without the kmod-wl that I generate with the Broadcom file. I sometimes get messages about tainting the kernel, but what good is a laptop without wireless? —[Gregory Pittman][6] + +* * * + +I can't live without Bluetooth. Without it, my mouse, keyboard, speakers, and headset would be doorstops. —[Gary Smith][7] + +* * * + +I'm going to go out on a limb and say _all of them_. Seriously, we've gotten to the point where I grab a random piece of hardware, plug it in, and it just works. + + * USB serial adapter just works + * Video card just works (though maybe not at its best) + * Network card just works + * Sound card just works + + + +It's tough not to be utterly impressed with the broad scope of the driver work that all the modules bring to the whole. I remember the bad old days when we used to yell out xrandr magic strings to make projectors work, and now—yeah, it's a genuine rarity when stuff doesn't (mostly) just work. + +If I had to nail it down to one, though, it'd be raid6. —[John 'Warthog9' Hawley][8] + +* * * + +I'm going to go back to the late 1990s for this one. I was a Unix systems administrator (and double duty as IS manager) for a small company. Our tape backup system died, and because of "small company" limited budgets, we didn't have a rush replacement or onsite repair on it. So we had to send it in for repair. + +During those two weeks, we didn't have a way to make tape backups. No systems administrator wants to be in that position. + +But then I remembered reading the [Floppy Tape How-to][9], and we happened to have a tower PC we'd just replaced that had a floppy tape drive. + +So I reinstalled it with Linux, set up the **ftape** kernel driver module, ran a few backup/recovery tests, then ran our most important backups to QIC tapes. For those two weeks, we relied on **ftape** backups of critical data. + +So to the unsung hero out there who made floppy tape drives work on 1990s Linux, you are awesome! —[Jim Hall][10] + +* * * + +Well, that's easy. It's the kvm kernel modules. On a personal front, I cannot imagine doing my day-to-day work without VMs. I'd like to believe that's the case with most of us. The kvm modules also play a big part in making Linux central to the cloud strategy. —[Gaurav Kamathe][11] + +* * * + +For me, it's dm-crypt, which is used for LUKS. See: + + * + * + + + +It's fantastic to know others cannot see what's on your disk, for example, if you lose your notebook or it gets stolen. —[Maximilian Kolb][12] + +* * * + +For cryptography basics, it's hard to beat the crypto module and its C API, which is straightforward. + +For day-to-day life, is there anything more valuable than the plug-and-play that Bluetooth provides? —[Marty Kalin][13] + +* * * + +Share with us in the comments: What Linux kernel module can you not live without? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-kernel-module + +作者:[Jen Wike Huger][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/users/czanik +[3]: https://en.wikipedia.org/wiki/Zram +[4]: https://opensource.com/users/hansic99 +[5]: https://opensource.com/users/joel2001k +[6]: https://opensource.com/users/greg-p +[7]: https://opensource.com/users/greptile +[8]: https://opensource.com/users/warthog9 +[9]: https://tldp.org/HOWTO/Ftape-HOWTO.html +[10]: https://opensource.com/users/jim-hall +[11]: https://opensource.com/users/gkamathe +[12]: https://opensource.com/users/kolb +[13]: https://opensource.com/users/mkalindepauledu From f2448d7090866863f3522d5ecd23a53fb964eadd Mon Sep 17 00:00:00 2001 From: guevaraya Date: Sat, 28 Aug 2021 10:15:07 +0800 Subject: [PATCH 020/138] Update 20210827 How to Easily Install Debian Linux.md --- sources/tech/20210827 How to Easily Install Debian Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210827 How to Easily Install Debian Linux.md b/sources/tech/20210827 How to Easily Install Debian Linux.md index 7940aa2845..9f652f4b40 100644 --- a/sources/tech/20210827 How to Easily Install Debian Linux.md +++ b/sources/tech/20210827 How to Easily Install Debian Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-debian-easily/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "guevaraya " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From d22ce17f1e82db7cbc4861e6ab88a9de265e7439 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Aug 2021 10:54:34 +0800 Subject: [PATCH 021/138] PRF @unigeorge --- ...e to SSH for remote connection on Linux.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md b/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md index 18734ee12b..b3cdd2d663 100644 --- a/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md +++ b/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (unigeorge) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (A beginner’s guide to SSH for remote connection on Linux) @@ -9,22 +9,24 @@ Linux 远程连接之 SSH 新手指南 ====== -学会使用安全外壳协议连接远程计算机。 -![woman on laptop sitting at the window][1] -使用 Linux,你只需要在键盘上输入命令,就可以巧妙地使用计算机(甚至这台计算机可以在世界上任何地方),这正是 Linux 最吸引人的特性之一。有了 OpenSSH,[POSIX][2] 用户就可以在有权限连接的计算机上打开安全外壳协议,然后远程使用。这对于许多 Linux 用户来说可能不过是日常任务,但从没操作过的人可能就会感到很困惑。本文介绍了如何为 安全外壳协议secure shell(简称 SSH)连接配置两台计算机,以及如何在没有密码的情况下安全地从一台计算机连接到另一台计算机。 +> 学会使用安全外壳协议连接远程计算机。 + +![](https://img.linux.net.cn/data/attachment/album/202108/28/105409ztj7akfjpcluwjp3.jpg) + +使用 Linux,你只需要在键盘上输入命令,就可以巧妙地使用计算机(甚至这台计算机可以在世界上任何地方),这正是 Linux 最吸引人的特性之一。有了 OpenSSH,[POSIX][2] 用户就可以在有权限连接的计算机上打开安全外壳协议,然后远程使用。这对于许多 Linux 用户来说可能不过是日常任务,但从没操作过的人可能就会感到很困惑。本文介绍了如何配置两台计算机的 安全外壳协议secure shell(简称 SSH)连接,以及如何在没有密码的情况下安全地从一台计算机连接到另一台计算机。 ### 相关术语 在讨论多台计算机时,如何将不同计算机彼此区分开可能会让人头疼。IT 社区拥有完善的术语来描述计算机联网的过程。 - * **服务service:** + * 服务service: 服务是指在后台运行的软件,因此它不会局限于仅供安装它的计算机使用。例如,Web 服务器通常托管着 Web 共享 _服务_。该术语暗含(但非绝对)它是没有图形界面的软件。 - * **主机host:** - 主机可以是任何计算机。在 IT 中,任何计算机都可以称为 _主机_,因为从技术上讲,任何计算机都可以托管对其他计算机有用的应用程序。你可能不会把自己的笔记本电脑视为 `主机`,但其实上面可能正运行着一些对你、你的手机或其他计算机有用的服务。 - * **本地local:** + * 主机host: + 主机可以是任何计算机。在 IT 中,任何计算机都可以称为 _主机_,因为从技术上讲,任何计算机都可以托管host对其他计算机有用的应用程序。你可能不会把自己的笔记本电脑视为 **主机**,但其实上面可能正运行着一些对你、你的手机或其他计算机有用的服务。 + * 本地local: 本地计算机是指用户或某些特定软件正在使用的计算机。例如,每台计算机都会把自己称为 `localhost`。 - * **远程remote:** + * 远程remote: 远程计算机是指你既没在其面前,也没有在实际使用的计算机,是真正意义上在 _远程_ 位置的计算机。 现在术语已经明确好,我们可以开始了。 @@ -59,19 +61,17 @@ $ sudo dnf install openssh-clients openssh-server $ sudo systemctl enable --now sshd ``` -你也可以在 GNOME 上的 **系统设置** 或 macOS 上的 **系统首选项** 中启用 SSH 服务。在 GNOME 桌面上,该设置位于 **Sharing** 面板中: +你也可以在 GNOME 上的 **系统设置** 或 macOS 上的 **系统首选项** 中启用 SSH 服务。在 GNOME 桌面上,该设置位于 **共享** 面板中: ![在 GNOME 系统设置中激活 SSH][3] -(Seth Kenlon, [CC BY-SA 4.0][4]) - ### 开启安全外壳协议 现在你已经在远程计算机上安装并启用了 SSH,可以尝试使用密码登录作为测试。要访问远程计算机,你需要有用户帐户和密码。 远程用户不必与本地用户相同。只要拥有相应用户的密码,你就可以在远程机器上以任何用户的身份登录。例如,我在我的工作计算机上的用户是 `sethkenlon` ,但在我的个人计算机上是 `seth`。如果我正在使用我的个人计算机(即作为当前的本地计算机),并且想通过 SSH 连接到我的工作计算机,我可以通过将自己标识为 `sethkenlon` 并使用我的工作密码来实现连接。 -要通过 SSH 连接到远程计算机,你必须知道其 因特网协议internet protocol (简称IP) 地址或可解析的主机名。在远程计算机上使用 `ip` 命令可以查看该机器的 IP 地址: +要通过 SSH 连接到远程计算机,你必须知道其 IP 地址或可解析的主机名。在远程计算机上使用 `ip` 命令可以查看该机器的 IP 地址: ``` $ ip addr show | grep "inet " @@ -81,9 +81,9 @@ inet 10.1.1.5/27 brd 10.1.1.31 [...] 如果远程计算机没有 `ip` 命令,可以尝试使用 `ifconfig` 命令(甚至可以试试 Windows 上通用的 `ipconfig` 命令)。 -127.0.0.1 是一个特殊的地址,它实际上是 `localhost` 的地址。这是一个 `环回` 地址,系统使用它来找到自己。这在登录远程计算机时并没有什么用,因此在此示例中,远程计算机的正确 IP 地址为 10.1.1.5。在现实生活中,我的本地网络正在使用 10.1.1.0 子网,进而可得知前述正确的 IP 地址。如果远程计算机在不同的网络上,那么 IP 地址几乎可能是任何地址(但绝不会是 127.0.0.1),并且可能需要一些特殊的路由才能通过各种防火墙到达远程。如果你的远程计算机在同一个网络上,但想要访问比自己的网络更远的计算机,请阅读我之前写的关于 [在防火墙中打开端口][5] 的文章。 +`127.0.0.1` 是一个特殊的地址,它实际上是 `localhost` 的地址。这是一个环回loopback地址,系统使用它来找到自己。这在登录远程计算机时并没有什么用,因此在此示例中,远程计算机的正确 IP 地址为 `10.1.1.5`。在现实生活中,我的本地网络正在使用 `10.1.1.0` 子网,进而可得知前述正确的 IP 地址。如果远程计算机在不同的网络上,那么 IP 地址几乎可能是任何地址(但绝不会是 `127.0.0.1`),并且可能需要一些特殊的路由才能通过各种防火墙到达远程。如果你的远程计算机在同一个网络上,但想要访问比自己的网络更远的计算机,请阅读我之前写的关于 [在防火墙中打开端口][5] 的文章。 -如果你能通过 IP 地址 _或_ 主机名 ping 到远程机器,并且拥有登录帐户,那么就可以通过 SSH 接入远程机器: +如果你能通过 IP 地址 _或_ 主机名 `ping` 到远程机器,并且拥有登录帐户,那么就可以通过 SSH 接入远程机器: ``` $ ping -c1 10.1.1.5 @@ -93,7 +93,7 @@ $ ping -c1 akiton.local PING 10.1.1.5 (10.1.1.5) 56(84) bytes of data. ``` -至此就成功了一小步。再试试使用SSH登录: +至此就成功了一小步。再试试使用 SSH 登录: ``` $ whoami @@ -107,7 +107,7 @@ sethkenlon ### 创建 SSH 密钥 -要在没有密码的情况下安全地登录到另一台计算机,登陆者必须拥有 SSH 密钥。可能你的机器上已经有一个 SSH 密钥,但再多创建一个新密钥也没有什么坏处。SSH 密钥的生命周期是在本地计算机上开始的,它由两部分组成:一个是永远不会与任何人或任何东西共享的私钥,一个是可以复制到任何你想要无密码访问的远程机器上的公钥。 +要在没有密码的情况下安全地登录到另一台计算机,登录者必须拥有 SSH 密钥。可能你的机器上已经有一个 SSH 密钥,但再多创建一个新密钥也没有什么坏处。SSH 密钥的生命周期是在本地计算机上开始的,它由两部分组成:一个是永远不会与任何人或任何东西共享的私钥,一个是可以复制到任何你想要无密码访问的远程机器上的公钥。 有的人可能会创建一个 SSH 密钥,并将其用于从远程登录到 GitLab 身份验证的所有操作,但我会选择对不同的任务组使用不同的密钥。例如,我在家里使用一个密钥对本地机器进行身份验证,使用另一个密钥对我维护的 Web 服务器进行身份验证,再一个单独的密钥用于 Git 主机,以及又一个用于我托管的 Git 存储库,等等。在此示例中,我将只创建一个唯一密钥,以在局域网内的计算机上使用。 @@ -135,7 +135,7 @@ bash$ whoami sethkenlon ``` -对局域网上的所有计算机重复此过程,你就将能够无密码浏览这个局域网上的每台主机。实际上,一旦你设置了无密码认证,你就可以编辑 `/etc/ssh/sshd_config` 文件来禁止密码认证。这有助于防止其他人使用 SSH 对计算机进行身份验证,除非他们拥有你的私钥。要想达到这个效果,可以在有 `sudo` 权限的文本编辑器中打开 `/etc/ssh/sshd_config` 并搜索字符串 `PasswordAuthentication`,将默认行更改为: +对局域网上的所有计算机重复此过程,你就将能够无密码访问这个局域网上的每台主机。实际上,一旦你设置了无密码认证,你就可以编辑 `/etc/ssh/sshd_config` 文件来禁止密码认证。这有助于防止其他人使用 SSH 对计算机进行身份验证,除非他们拥有你的私钥。要想达到这个效果,可以在有 `sudo` 权限的文本编辑器中打开 `/etc/ssh/sshd_config` 并搜索字符串 `PasswordAuthentication`,将默认行更改为: ``` PasswordAuthentication no @@ -151,7 +151,7 @@ $ ### 日常使用 SSH -OpenSSH 改变了人们对操作计算机的看法,使用户不再被束缚在面前的计算机上。使用 SSH,你可以访问家中的任何计算机,或者拥有帐户的服务器,甚至是移动和物联网设备。充分利用 SSH 也意味着解锁 Linux 终端的更多用途。如果你还没有习惯使用 SSH,请试一下它吧。试着适应 SSH,创建一些适当的密钥,以此更安全地使用计算机,打破必须与计算机面对面的局限性。 +OpenSSH 改变了人们对操作计算机的看法,使用户不再被束缚在面前的计算机上。使用 SSH,你可以访问家中的任何计算机,或者拥有帐户的服务器,甚至是移动和物联网设备。充分利用 SSH 也意味着解锁 Linux 终端的更多用途。如果你还没有使用过 SSH,请试一下它吧。试着适应 SSH,创建一些适当的密钥,以此更安全地使用计算机,打破必须与计算机面对面的局限性。 -------------------------------------------------------------------------------- @@ -160,7 +160,7 @@ via: https://opensource.com/article/20/9/ssh 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9dfb95841f2e62a3afa3a0b2b66d562edf1a8770 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Aug 2021 10:55:41 +0800 Subject: [PATCH 022/138] PUB @unigeorge https://linux.cn/article-13726-1.html --- ... beginner-s guide to SSH for remote connection on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200907 A beginner-s guide to SSH for remote connection on Linux.md (99%) diff --git a/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md b/published/20200907 A beginner-s guide to SSH for remote connection on Linux.md similarity index 99% rename from translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md rename to published/20200907 A beginner-s guide to SSH for remote connection on Linux.md index b3cdd2d663..1d32280bd6 100644 --- a/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md +++ b/published/20200907 A beginner-s guide to SSH for remote connection on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (unigeorge) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13726-1.html) [#]: subject: (A beginner’s guide to SSH for remote connection on Linux) [#]: via: (https://opensource.com/article/20/9/ssh) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 35c7d6a192a09b9da7f7d02cdbe33ca6ed7253cc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Aug 2021 16:56:43 +0800 Subject: [PATCH 023/138] PRF&PUB @alim0x https://linux.cn/article-13727-1.html --- ... GPT Partitioning -on Windows and Linux.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) rename {translated/tech => published}/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md (80%) diff --git a/translated/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md b/published/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md similarity index 80% rename from translated/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md rename to published/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md index acca290088..b13f856687 100644 --- a/translated/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md +++ b/published/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md @@ -3,18 +3,20 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (alim0x) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13727-1.html) -如何在 Windows 和 Linux 上确定系统使用 MBR 还是 GPT 分区 +如何在 Windows 和 Linux 上确定系统使用的是 MBR 还是 GPT 分区 ====== +![](https://img.linux.net.cn/data/attachment/album/202108/28/165508gqjyigp3yz3gy6yy.jpg) + 在你安装 Linux 或任何其他系统的时候,了解你的磁盘的正确分区方案是非常关键的。 目前有两种流行的分区方案,老一点的 MBR 和新一些的 GPT。现在大多数的电脑使用 GPT。 -在制作 live 镜像或可启动 USB 设备时,一些工具(比如 [Rufus][1])会问你在用的磁盘分区情况。如果你在 MBR 分区的磁盘上选择 GPT 方案的话,制作出来的可启动 USB 设备可能会不起作用。 +在制作临场镜像或可启动 USB 设备时,一些工具(比如 [Rufus][1])会问你在用的磁盘分区情况。如果你在 MBR 分区的磁盘上选择 GPT 方案的话,制作出来的可启动 USB 设备可能会不起作用。 在这个教程里,我会展示若干方法,来在 Windows 和 Linux 系统上检查磁盘分区方案。 @@ -48,15 +50,15 @@ 命令行的方法应该在所有 Linux 发行版上都有效。 -打开终端并使用 sudo 运行下列命令: +打开终端并使用 `sudo` 运行下列命令: ``` sudo parted -l ``` -上述命令实际上是一个基于命令行的 [Linux 分区管理器][5]。命令参数 -l 会列出系统中的所有磁盘以及它们的详情,里面包含了分区方案信息。 +上述命令实际上是一个基于命令行的 [Linux 分区管理器][5]。命令参数 `-l` 会列出系统中的所有磁盘以及它们的详情,里面包含了分区方案信息。 -在命令输出中,寻找以 **Partition Table(分区表)**开头的行: +在命令输出中,寻找以 **Partition Table**(分区表)开头的行: ![][6] @@ -76,17 +78,17 @@ Ubuntu 和一些其它基于 GNOME 的发行版内置了叫做 Disks 的图形 如果你没办法使用 GNOME Disks 工具,别担心,还有其它工具可以使用。 -其中一款流行的工具是 Gparted。你应该可以在大多数 Linux 发行版的软件源中找到它。如果系统中没有安装的话,使用你的发行版的软件中心或[包管理器][9]来[安装 Gparted][8]。 +其中一款流行的工具是 Gparted。你应该可以在大多数 Linux 发行版的软件源中找到它。如果系统中没有安装的话,使用你的发行版的软件中心或 [包管理器][9] 来 [安装 Gparted][8]。 -在 Gparted 中,通过菜单选择 **View-Device Information(查看—设备信息)**。它会在左下区域显示磁盘信息,这些信息中包含分区方案信息。 +在 Gparted 中,通过菜单选择 **View->Device Information**(查看—>设备信息)。它会在左下区域显示磁盘信息,这些信息中包含分区方案信息。 ![][10] 看吧,也不是太复杂,对吗?现在你了解了好几种途径来确认你的系统使用的是 GPT 还是 MBR 分区方案。 -同时我还要提一下,有时候磁盘还会有[混合分区方案][11]。这不是很常见,大多数时候分区不是 MBR 就是 GPT。 +同时我还要提一下,有时候磁盘还会有 [混合分区方案][11]。这不是很常见,大多数时候分区不是 MBR 就是 GPT。 -有任何问题或建议?请在下方留下评论。 +有任何问题或建议,请在下方留下评论。 -------------------------------------------------------------------------------- @@ -95,7 +97,7 @@ via: https://itsfoss.com/check-mbr-or-gpt/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 18bedb3d9b627292ac633465b8c77bcbdb7f4084 Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Sat, 28 Aug 2021 17:49:44 +0800 Subject: [PATCH 024/138] Update 20210819 A guide to understanding your team-s implicit values and needs.md --- ...de to understanding your team-s implicit values and needs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md index 127f226ab7..37a2f15229 100644 --- a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md +++ b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md @@ -7,7 +7,7 @@ [#]: publisher: " " [#]: url: " " -A guide to understanding your team's implicit values and needs +了解团队隐含价值观和需求的指南 ====== To enhance team dynamics, open leaders can study the implicit social norms that guide members' behaviors and decisions. From fd463db40c6c7f42d530f594153f48599ea2cfb1 Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Sat, 28 Aug 2021 17:55:28 +0800 Subject: [PATCH 025/138] Update 20210819 A guide to understanding your team-s implicit values and needs.md --- ...e to understanding your team-s implicit values and needs.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md index 37a2f15229..ec8924e1f2 100644 --- a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md +++ b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md @@ -9,8 +9,7 @@ 了解团队隐含价值观和需求的指南 ====== -To enhance team dynamics, open leaders can study the implicit social -norms that guide members' behaviors and decisions. +为了增强团队动力,开放的领导可以研究指导成员行为和决策的隐性社会规范。 ![Working meetings can be effective meetings][1] Culture matters in [open organizations][2]. But "culture" seems like such a large, complicated concept to address. How can we help open organization teams better understand it? From 3cba6d87e8da7be8549801b1119334cfb110c065 Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Sat, 28 Aug 2021 20:26:12 +0800 Subject: [PATCH 026/138] Update 20210819 A guide to understanding your team-s implicit values and needs.md --- ...understanding your team-s implicit values and needs.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md index ec8924e1f2..b6fb24d3ae 100644 --- a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md +++ b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md @@ -12,13 +12,13 @@ 为了增强团队动力,开放的领导可以研究指导成员行为和决策的隐性社会规范。 ![Working meetings can be effective meetings][1] -Culture matters in [open organizations][2]. But "culture" seems like such a large, complicated concept to address. How can we help open organization teams better understand it? +文化在[开放的组织][2]很重要。 但“文化”似乎是一个如此庞大而复杂的概念。我们该如何帮助开放式的团队组织去理解它呢? -One solution might come from [Michele J. Gelfand][3], author of [_Rule Makers, Rule Breakers_][4]_: Tight and Loose Cultures and the Secret Signals That Direct Our Lives_. Gelfand organizes all countries and cultures into two very simple groups: those with "tight" cultures and those with "loose" ones. Then she explains the characteristics and social norms of both, offering their relative strengths and weaknesses. By studying both, one might overcome the divisions and conflicts that separate people in and across teams, organizations, and countries. +一个解决方案可能来自于 [_Rule Makers, Rule Breakers_][4]_的作者 [Michele J. Gelfand][3]:紧密和松散的文化以及指导我们生活的秘密信号_。Gelfand 把所有的国家和文化分成简单的两类, 一类是“严格的”文化另一类是“松散的”。然后,她解释了两者的特点和社会规范,提供了它们的相对优势和劣势。通过研究两者,我们可以克服团队、组织和国家之间的分歧和冲突。 -In this two-part review of _Rule Makers, Rule Breakers_, I'll explain Gelfand's argument and discuss the ways it's useful to people working in open organizations. +In this two-part review of _Rule Makers, Rule Breakers_, 我将解释 Gelfand 的论点,并讨论它对在开放性组织中工作的人们有用的方式。 -### Know your social norms +### 了解你的社会规范 Gelfand believes that our behavior is very strongly dependent on whether we live in a "tight" or "loose" community culture, because each of these cultures has social norms that differ from the other. These norms—and the strictness with which they are enforced—will determine our behavior in the community. They give us our identity. They help us coordinate with each other. In short, they're the glue that holds communities together. From d259dd368713e4d6c05331fd9815223608981bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Sat, 28 Aug 2021 20:27:13 +0800 Subject: [PATCH 027/138] Update 20210821 How to set up your printer on Linux.md translated --- ...821 How to set up your printer on Linux.md | 68 +++++++++---------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/sources/tech/20210821 How to set up your printer on Linux.md b/sources/tech/20210821 How to set up your printer on Linux.md index 3cf166373a..57929be7dc 100644 --- a/sources/tech/20210821 How to set up your printer on Linux.md +++ b/sources/tech/20210821 How to set up your printer on Linux.md @@ -7,85 +7,80 @@ [#]: publisher: " " [#]: url: " " -How to set up your printer on Linux +如何在 Linux 系统设置打印机 ====== -In the event that your printer isn't auto-detected, this article teaches -you how to add a printer on Linux manually. +如果系统没有自动检测到你的打印机,这篇文章教你任何在 Linux 系统手动添加打印机。 ![printing on Linux][1] -Even though it's the future now and we're all supposed to be using e-ink and AR, there are still times when a printer is useful. Printer manufacturers have yet to standardize how their peripherals communicate with computers, so there's a necessary maze of printer drivers out there, regardless of what platform you're on. The IEEE-ISTO Printer Working Group (PWG) and the OpenPrinting.org site are working tirelessly to make printing as easy as possible, though. Today, many printers are autodetected with no interaction from the user. +即使未来已来,电子墨水 (e-ink) 和 AR 技术可以现实应用,我们还是会用到打印机的。打印机制造商还不能做到让自己的专利打印机可以与各种计算机完全标准化传递信息,以至于我们需要各种打印机驱动程序,在任何操作系统上都是如此。电子电气工程师协会信息科学与技术处 (IEEE-ISTO) 下属的打印机工作组 (PWG) 和开放打印技术组织 (OpenPrinting.org) 长期合作致力于让人们可以(使用任何型号打印机)轻松打印。带来的便利就是,很多打印机可以不需要用户进行配置就可以自动被识别使用。 -In the event that your printer isn't auto-detected, this article teaches you how to add a printer on Linux manually. This article assumes you're on the GNOME desktop, but the basic workflow is the same for KDE and most other desktops. +如果系统没有自动检测到你的打印机,你可以在这篇文章中找到如何在 Linux 系统手动添加打印机。文中假定你使用的是 GNOME 图形桌面系统,其设置流程同样适用于 KDE 或其他多数桌面系统。 -### Printer drivers +### 打印机驱动程序 -Before attempting to interface with a printer from Linux, you should first verify that you have updated printer drivers. +在你尝试用打印机打印文件时,要先确认你的 Linux 系统上是不是已经安装了匹配的打印机驱动程序。 -There are three varieties of printer drivers: +可以尝试安装的打印机驱动程序有三大类: - * Open source [Gutenprint drivers][2] bundled with Linux and as an installable package - * Drivers provided by the printer manufacturer - * Drivers created by a third party + * 在你的 Linux 系统作为安装包提供的开源打印机驱动程序 [Gutenprint drivers][2] + * 打印机制造商提供的专用驱动程序 + * 第三方开发提供的打印机驱动程序 -It's worth installing the open source drivers because there are over 700 of them, so having them available increases the chance of attaching a printer and having it automatically configured for you. +开源打印机驱动程序库可以驱动 700 多种打印机,值得安装,这里面可能就有你的打印机的驱动,说不定可以自动设置好你的打印机(,你就可以使用它了)。 -### Installing open source drivers +### 安装开源驱动程序包(库) -Your Linux distribution probably already has these installed, but if not, you can install them with your package manager. For example, on Fedora, CentOS, Mageia, and similar: +有些 Linux 发行版已经预装了开源打印机驱动程序包,如果没有,你可以用包管理器来安装。比如说,在 Fedora, CentOS, Magela 等类似发行版的 Linux 系统上,执行下面命令来安装: ``` `$ sudo dnf install gutenprint` ``` -For HP printers, also install Hewlett-Packard's Linux Imaging and Printing (HPLIP) project. For example, on Debian, Linux Mint, and similar: +惠普 (HP) 系列的打印机,还需要安装惠普的 Linux 图形及打印系统软件包 (Hewlett-Packard's Linux Imaging and Printing (HPLIP) ). 类似 Debian, Linux Mint 等系列的系统,使用下面的命令: ``` `$ sudo apt install hplip` ``` -### Installing vendor drivers +### 安装制造商提供的驱动程序 -Sometimes a printer manufacturer uses non-standard protocols, so the open source drivers don't work. Other times, the open source drivers work but may lack special vendor-only features. When that happens, you must visit the manufacturer's website and search for a Linux driver for your printer model. The install process varies, so read the install instructions carefully. +很多时候因为打印机制造商使用非标准的接口协议,这种情况开源打印机驱动程序就不能驱动打印机。另外的情况就是,开源驱动程序可以驱动打印机工作,但是会缺少品牌特有的有些性能。这些情况,你需要访问制造商的网站,找到适合你的打印机型号的 Linux 平台驱动。安装过程各异,仔细阅读安装指南逐步安装。 -In the event that your printer isn't supported at all by the vendor, there are [third-party driver authors][3] that may support your printer. These drivers aren't open source, but neither are most vendor drivers. It's frustrating to have to spend an extra $45 to get support for a printer, but the alternative is to throw the printer into the rubbish, and now you know at least one brand to avoid when you purchase your next printer! +即便是厂家的驱动也不能驱动你的打印机工作,你或许也只能尝试第三方提供的该型号打印机的驱动软件 ([third-party driver authors][3]) 了。这类第三方驱动程序不是开源的,和打印机专用驱动程序一样闭源。如果你需要额外花费 45 美元(约 400 员人民币)从供应商那里获取帮助服务才能安装好驱动并使用你的打印机,那是很心疼,或者你索性把这台打印机扔掉,至少你知道下次再也不会购买这个品牌的打印机了。(译者注:国内售后服务收费没有北美那么高,有需要还是先电话咨询售后,有没有 Linux 平台的专用驱动可真是碰运气。) -### Common Unix Printing System (CUPS) +### 统一接口打印驱动系统(CUPS) -The Common Unix Printing System (CUPS) was developed in 1997 by Easy Software Products, and purchased by Apple in 2007. It's the open source basis for printing on Linux, but most modern distributions provide a customized interface for it. Thanks to CUPS, your computer can find printers attached to it by a USB cable and even a shared printer over a network. +统一接口打印驱动系统 (CUPS) 是由 Easy Software Products 公司于 1997 年开发的,2007 年被苹果公司 (Apple) 收购。这是 Linux 平台打印的开源基础软件包,很多改进的发行版本提供定制化的界面。得益于 CUPS 技术,你可以发使用通过 USB 接口连接到电脑的打印机,甚至连接在同一网络的共享打印机。 -Once you've gotten the necessary drivers installed, you can add your printer manually. First, attach your printer to your computer and power them both on. Then open the **Printers** application from the **Activities** screen or application menu. - -![printer settings][4] +一旦你安装了需要的驱动程序包,你就能手工添加你的打印机了。首先,把打印机连接到运行的电脑上,并打开打印机电源。然后从启动器 **(Activities**)或者应用列表中找到并打开打印机设置**(Printers)**。![printer settings][4] CC BY-SA Opensource.com -There's a possibility that your printer is autodetected by Linux, by way of the drivers you've installed, and that no further configuration is required. +基于你已经安装的驱动包,你的 Linux 系统有可能自动检测识别到你的打印机型号,不需要额外的设置就可以使用你的打印机了。 ![printer settings][5] CC BY-SA Opensource.com -Provided that you see your printer listed, you're all set, and you can already print from Linux! +一旦你在列表中找到你的打印机型号,设置使用这个驱动,恭喜你就可以在 Linux 系统上用它打印了。 -If you see that you need to add a printer, click the **Unlock** button in the top right corner of the **Printers** window. Enter your administrative password and the button transforms into an **Add** button. +(如果你的打印机没有被自动识别,)你需要自行添加打印机。在打印机设置界面**(Printers)**,点击右上角的解锁按钮(**Unlock**),输入管理用户密码,按钮转换成**添加打印机**按钮 (**Add**) 。 -Click the **Add** button. - -Your computer searches for attached printers (also called a _local_ printer). To have your computer look for a shared network printer, enter the IP address of the printer or its host. +然后点击这个**添加打印机**按钮 (**Add**) ,电脑会搜索已经连接的本地打印机型号并匹配相应驱动程序。如果要添加网络共享打印机,在搜索框输入打印机或者其服务器机的 IP 地址。 ![searching for a printer][6] CC BY-SA Opensource.com -Select the printer you want to add to your system and click the **Add** button. +选中你想添加的打印机型号,点击**添加**按钮 (**Add**) 把打印机驱动加入系统,就可以使用它了。 -### Print from Linux +### 在 Linux 系统上打印 -Printing from Linux is as easy as printing can be, whether you're using a local or networked printer. If you're looking for a printer to purchase, then check the [OpenPrinting.org database][7] to confirm that a printer has an open source driver before you spend your money. If you already have a printer, you now know how to use it on your Linux computer. +在 Linux 系统上打印很容易,不管你是在使用本地打印机还是网络打印机。如果你计划购买打印机,建议查看开放打印技术组织的(可支持打印机)数据库 ( [OpenPrinting.org database][7] ) ,看看你想购买的打印机是不是有相应的开源驱动程序。如果你已经拥有一台打印机,你现在也知道怎样在你的 Linux 系统上使用你的打印机了。 -------------------------------------------------------------------------------- @@ -100,10 +95,11 @@ via: https://opensource.com/article/21/8/add-printer-linux [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/happy-printer.png?itok=9J44YaDs (printing on Linux) +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/happy-printer.png?itok=9J44YaDs "printing on Linux" [2]: http://gimp-print.sourceforge.net/ [3]: https://www.turboprint.info/ -[4]: https://opensource.com/sites/default/files/system-settings-printer_0.png (printer settings) -[5]: https://opensource.com/sites/default/files/settings-printer.png (printer settings) -[6]: https://opensource.com/sites/default/files/printer-search.png (searching for a printer) +[4]: https://opensource.com/sites/default/files/system-settings-printer_0.png "printer settings" +[5]: https://opensource.com/sites/default/files/settings-printer.png "printer settings" +[6]: https://opensource.com/sites/default/files/printer-search.png "searching for a printer" [7]: http://www.openprinting.org/printers/ + From 3afc723a1bfc314897e3b64534bf424aba41d1c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Sat, 28 Aug 2021 20:31:45 +0800 Subject: [PATCH 028/138] Rename sources/tech/20210821 How to set up your printer on Linux.md to translated/tech/20210821 How to set up your printer on Linux.md translated directory allready --- .../tech/20210821 How to set up your printer on Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210821 How to set up your printer on Linux.md (100%) diff --git a/sources/tech/20210821 How to set up your printer on Linux.md b/translated/tech/20210821 How to set up your printer on Linux.md similarity index 100% rename from sources/tech/20210821 How to set up your printer on Linux.md rename to translated/tech/20210821 How to set up your printer on Linux.md From c7a43ce277c0dbdb2b9fbb2371cf699c31e5b0d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Sat, 28 Aug 2021 20:45:19 +0800 Subject: [PATCH 029/138] translating translating by fisherue --- .../20210812 A guide to the Linux terminal for beginners.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210812 A guide to the Linux terminal for beginners.md b/sources/tech/20210812 A guide to the Linux terminal for beginners.md index 7a184b585f..3be4d832de 100644 --- a/sources/tech/20210812 A guide to the Linux terminal for beginners.md +++ b/sources/tech/20210812 A guide to the Linux terminal for beginners.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/linux-terminal" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "fisherue " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -108,7 +108,7 @@ via: https://opensource.com/article/21/8/linux-terminal 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID][c] 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -127,3 +127,4 @@ via: https://opensource.com/article/21/8/linux-terminal [10]: https://opensource.com/article/21/7/terminal-basics-copying-files-linux-terminal [11]: https://opensource.com/article/21/7/terminal-basics-removing-files-and-folders-linux-terminal [12]: https://opensource.com/downloads/bash-scripting-ebook +[c]: https://github.com/fisherue From 91d5d9b18fb1ae08a0df50e0d06e7d2fbd637520 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Aug 2021 22:22:40 +0800 Subject: [PATCH 030/138] APL --- ...- Your Ultimate Browser Choice for Private Web Experience.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md b/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md index 0d1379b67a..5375f42b07 100644 --- a/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md +++ b/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/brave-vs-firefox/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4690deea004d86857d9eedd220aff40453dd23c1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Aug 2021 23:47:53 +0800 Subject: [PATCH 031/138] TSL&PRF --- ...owser Choice for Private Web Experience.md | 247 ------------------ ...owser Choice for Private Web Experience.md | 233 +++++++++++++++++ 2 files changed, 233 insertions(+), 247 deletions(-) delete mode 100644 sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md create mode 100644 translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md diff --git a/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md b/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md deleted file mode 100644 index 5375f42b07..0000000000 --- a/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md +++ /dev/null @@ -1,247 +0,0 @@ -[#]: subject: (Brave vs. Firefox: Your Ultimate Browser Choice for Private Web Experience) -[#]: via: (https://itsfoss.com/brave-vs-firefox/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Brave vs. Firefox: Your Ultimate Browser Choice for Private Web Experience -====== - -Web browsers have evolved over the years. From downloading files to accessing a full-fledged web application, we have come a long way. - -For a lot of users, the web browser is the only thing they need to get their work done these days. - -Hence, choosing the right browser becomes an important task that could help improve your workflow over the years. - -### Brave vs. Firefox Browser - -Brave and Mozilla’s Firefox are two of the most popular web browsers for privacy-conscious users and open-source enthusiasts. - -Considering that both focus heavily on privacy and security, let us look at what exactly they have to offer, to help you decide what you should go with. - -Here are the comparison pointers that I’ve used, you can directly navigate to any of them: - - * [User Interface][1] - * [Performance][2] - * [Browser Engine][3] - * [Ad & Tracking Blocking Capabilities][4] - * [Containers][5] - * [Rewards][6] - * [Cross-Platform Availability][7] - * [Synchronization][8] - * [Service Integrations][9] - * [Customizability][10] - * [Extension Support][11] - - - -### User Interface - -The user interface is what makes the biggest difference with the workflow and experience when using the browser. - -Of course, you can have your personal preferences, but the easier, snappier, and cleaner it looks, the better it is. - -![Brave browser][12] - -To start with, Brave shares a similar look and feel to Chrome and Microsoft Edge. It offers a clean experience with minimal UI elements and all the essential options accessible through the browser menu. - -It offers a black theme as well. The subtle animations make the interaction a pleasant experience. - -To customize it, you can choose to use themes available from the chrome web store. - -When it comes to Mozilla Firefox, it has had a couple of major redesigns over the years, and the latest user interface tries to offer a closer experience to Chrome. - -![Firefox browser][13] - -The Firefox design looks impressive and provides a clean user experience. It also lets you opt for a dark theme if needed and there are several theme options to download/apply as well. - -Both web browsers offer a good user experience. - -If you want a familiar experience, but with a pinch of uniqueness, Mozilla’s Firefox can be a good pick. - -But, if you want a snappier experience with a better feel for the animations, Brave gets the edge. - -### Performance - -Practically, I find Brave loading web pages faster. Also, the overall user experience feels snappy. - -Firefox is not terribly slow, but it definitely felt slower than Brave. - -To give you some perspective, I also utilized [Basemark][14] to run a benchmark to see if that is true on paper. - -You can check with other browser benchmark tools available, but Basemark performs a variety of tests, so we’ll go with that for this article. - -![Firefox benchmark score][15] - -![Brave benchmark score][16] - -Firefox managed to score **630** and Brave pulled it off better with ~**792**. - -Do note that these benchmarks were run with default browser settings without any browser extensions installed. - -Of course, synthetic scores may vary depending on what you have going on in the background and the hardware configuration of your system. - -This is what I got with **i5-7400, 16 GB RAM, and GTX 1050ti GPU** on my desktop. - -In general, Brave browser is a fast browser compared to most of the popular options available. - -Both utilize a decent chunk of system resources and that varies to a degree with the number of tabs, types of webpages accessed, and the kind of blocking extension used. - -For instance, Brave blocks aggressively by default but Firefox does not block display advertisements by default. And, this affects the system resource usage. - -### Browser Engine - -Firefox utilizes its own Gecko engine as the foundation and is using components on top of that from [servo research project][17] to improve. - -Currently, it is essentially an improved Gecko engine dubbed by a project name “Quantum” which was introduced with the release of Firefox Quantum. - -On the other hand, Brave uses Chromium’s engine. - -While both are capable enough to handle modern web experiences, Chromium-based engine is just more popular and web developers often tailor their sites for the best experience on Chrome-based browsers - -Also, some services happen to exclusively support Chrome-based browsers. - -### Ad & Tracker Blocking Capabilities - -![][18] - -As I have mentioned before, Brave is aggressive in blocking trackers and advertisements. By default, it comes with the blocking feature enabled. - -Firefox also enables the enhanced privacy protection by default but does not block display advertisements. - -You will have to opt for the “**Strict**” privacy protection mode with Firefox if you want to get rid of display advertisements. - -With that being said, Firefox enforces some unique tracking protection technology that includes Total Cookie Protection which isolates cookies for each site and prevents cross-site cookie tracking. - -![][19] - -This was introduced with [Firefox 86][20] and to use it, you need to enable a strict privacy protection mode. - -Overall, Brave might look like a better option out of the box, and Mozilla Firefox offers better privacy protection features. - -### Containers - -Firefox also offers a way to isolate site activity when you use Facebook with help of a container. In other words, it prevents Facebook from tracking your offsite activity. - -You can also use containers to organize your tabs and separate sessions when needed. - -Brave does not offer anything similar but it does block cross-site trackers and cookies out-of-the-box. - -### Rewards - -![][21] - -Unlike Firefox, Brave offers its own advertising network by blocking other advertisements on the web. - -When you opt in to display privacy-friendly ads by Brave, you get rewarded with tokens to a crypto wallet. And you can use these tokens to give back to your favorite websites. - -While this is a good business strategy to get away from mainstream advertising, for users who do not want any kind of advertisements, it may not be useful. - -So, Brave offers an alternative in the form of rewards to help websites even if you block advertisements. If it is something you appreciate, Brave will be a good pick for you. - -### Cross-Platform Availability - -You will find both Brave and Firefox available for Linux, Windows, and macOS. Mobile apps are also available for iOS and Android. - -For Linux users, Firefox comes baked in with most of the Linux distributions. And, you can also find it available in the software center. In addition to that, there is also a [Flatpak][22] package available. - -Brave is not available through default repositories and the software center. Hence, you need to follow the official instructions to add the private repository and then [get Brave installed in your Linux distro][23]. - -### Synchronization - -With Mozilla Firefox, you get to create a Firefox account to sync all your data cross-platform. - -![][24] - -Brave also lets you sync cross-platform but you need access to one of the devices in order to successfully do it. - -![][25] - -Hence, Firefox sync is more convenient. - -Also, you get access to Firefox’s VPN, data breach monitor, email relay, and password manager with the Firefox account. - -### Service Integrations - -Right off the bat, Firefox offers more service integrations that include Pocket, VPN, password manager, and also some of its new offerings like Firefox relay. - -If you want access to these services through your browser, Firefox will be the convenient option for you. - -While Brave does offer crypto wallets, it is not for everyone. - -![][26] - -Similarly, if you like using [Brave Search][27], you may have a seamless experience when using it with Brave browser because of the user experience. - -### Customizability & Security - -Firefox shines when it comes to customizability. You get more options to tweak the experience and also take control of the privacy/security of your browser. - -The ability to customize lets you make Firefox more secure than the Brave browser. - -While hardening Firefox is a separate topic which we’ll talk about. To give you an example, [Tor Browser][28] is just a customized Firefox browser. - -However, that does not make Brave less secure. It is a secure browser overall but you do get more options with Firefox. - -### Extension Support - -There’s no doubt that the Chrome web store offers way more extensions. - -So, Brave gets a clear edge over Firefox if you are someone who utilizes a lot of extensions (or constantly try new ones). - -Firefox may not have the biggest catalog of extensions, it does support most of the extensions. For common use-cases, you will rarely find an extension that is not available as an addon for Firefox. - -### What Should You Choose? - -If you want the best compatibility with the modern web experience and want access to more extensions, Brave browser seems to make more sense. - -On the other hand, Firefox is an excellent choice for everyday browsing with industry-first privacy features, and a convenient sync option for non-tech savvy users. - -You will have a few trade-offs when selecting either of them. So, your will have to prioritize what you want the most. - -Let me know about your final choice for your use case in the comments down below! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/brave-vs-firefox/ - -作者:[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]: tmp.5yJseRG2rb#ui -[2]: tmp.5yJseRG2rb#perf -[3]: tmp.5yJseRG2rb#engine -[4]: tmp.5yJseRG2rb#ad -[5]: tmp.5yJseRG2rb#container -[6]: tmp.5yJseRG2rb#reward -[7]: tmp.5yJseRG2rb#cp -[8]: tmp.5yJseRG2rb#sync -[9]: tmp.5yJseRG2rb#service -[10]: tmp.5yJseRG2rb#customise -[11]: tmp.5yJseRG2rb#extensions -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-ui-new.jpg?resize=800%2C450&ssl=1 -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-ui.jpg?resize=800%2C450&ssl=1 -[14]: https://web.basemark.com -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-basemark.png?resize=800%2C598&ssl=1 -[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/basemark-brave.png?resize=800%2C560&ssl=1 -[17]: https://servo.org -[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-blocker.png?resize=800%2C556&ssl=1 -[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-blocker.png?resize=800%2C564&ssl=1 -[20]: https://news.itsfoss.com/firefox-86-release/ -[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-rewards.png?resize=800%2C560&ssl=1 -[22]: https://itsfoss.com/what-is-flatpak/ -[23]: https://itsfoss.com/brave-web-browser/ -[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-sync.png?resize=800%2C651&ssl=1 -[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-sync.png?resize=800%2C383&ssl=1 -[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-crypto-wallet.png?resize=800%2C531&ssl=1 -[27]: https://itsfoss.com/brave-search-features/ -[28]: https://itsfoss.com/install-tar-browser-linux/ diff --git a/translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md b/translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md new file mode 100644 index 0000000000..9d2391ba56 --- /dev/null +++ b/translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md @@ -0,0 +1,233 @@ +[#]: subject: (Brave vs. Firefox: Your Ultimate Browser Choice for Private Web Experience) +[#]: via: (https://itsfoss.com/brave-vs-firefox/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +Brave vs. Firefox:你的私人网络体验的终极浏览器选择 +====== + +Web 浏览器经过多年的发展。从下载文件到访问成熟的Web 应用程序,我们已经走过了很长的路。 + +对于很多用户来说,Web 浏览器是他们如今完成工作的唯一需要。 + +因此,选择合适的浏览器就成为了一项重要的任务,它可以帮助改善你多年来的工作流程。 + +### Brave vs. Firefox + +Brave 和 Mozilla Firefox 是两个最受到关注隐私的用户和开源爱好者欢迎的 Web 浏览器。 + +考虑到两者都非常注重隐私和安全,让我们看看它们到底能提供什么,以帮助你决定应该选择哪一个。 + +以下是我所使用的比较指标: + +### 用户界面 + +用户界面是使用浏览器时的工作流程和体验的最大区别。 + +当然,你会有你的个人偏好,但它看起来越容易使用、越轻快、越干净,就越好。 + +![Brave 浏览器][12] + +首先,Brave 与 Chrome 和微软 Edge 有着相似的外观和感受。它提供了一种简洁的体验,具有精简的 UI 元素,所有的基本选项都可以通过浏览器菜单访问。 + +它也提供了一个暗色主题。恰到好处的动画使得互动成为一种愉快的体验。 + +要定制它,你可以选择使用 Chrome Web 商店中的主题。 + +说到 Mozilla Firefox,多年来它经历了几次重大的重新设计,其最新的用户界面试图提供与 Chrome 更接近的体验。 + +![Firefox 浏览器][13] + +Firefox 浏览器的设计看起来令人印象深刻,并提供了干净利落的用户体验。如果需要的话,你还可以选择一个暗色主题,此外还有几个主题可供下载使用。 + +这两个 Web 浏览器都能提供良好的用户体验。 + +如果你想要一个熟悉的体验,但又具有一丝独特之处,Mozilla Firefox 是一个不错的选择。 + +但是,如果你想获得更快捷的体验、更好的动画感受,Brave 更有优势。 + +### 性能 + +实际上,我发现 Brave 加载网页的速度更快,整体的用户体验感觉很轻快。 + +Firefox 浏览器倒不是非常慢,但它绝对感觉比 Brave 慢。 + +为了给你一些参考,我还利用 [Basemark][14] 运行了一个基准测试,看看事实上是否真的如此。 + +你可以使用其他的浏览器基准测试工具来测试一下,但我用 Basemark 进行了各种测试,所以我们在这篇文章中会用它。 + +![Firefox 基准得分][15] + +![Brave 基准得分][16] + +Firefox 浏览器成功获得了 **630** 的得分,而 Brave 以大约 **792** 的得分取得了更好的成绩。 + +请注意,这些基准测试是在没有安装任何浏览器扩展程序的情况下,以默认的浏览器设置进行的。 + +当然,你的分数可能会有所不同,这取决于你在后台进行的工作和你系统的硬件配置。 + +这是我在 **i5-7400、16GB 内存和 GTX 1050ti GPU** 配置的桌面电脑上得到的结果。 + +一般来说,与大多数流行的浏览器相比,Brave 浏览器是一个快速的浏览器。 + +这两者都占用了相当大的系统资源,而且在一定程度上随着标签数量、访问的网页类型和使用的拦截扩展的种类而变化。 + +例如,Brave 在默认情况下会主动阻止广告,但 Firefox 在默认情况下不会阻止显示广告。而且,这也影响了系统资源的使用。 + +### 浏览器引擎 + +Firefox 浏览器在自己的 Gecko 引擎基础上,使用来自 [servo 研究项目][17] 的组件来进行改进。 + +目前,它基本上是一个改进的 Gecko 引擎,其项目名称是随着 Firefox Quantum 的发布而推出的 “Quantum”。 + +另一方面,Brave 使用 Chromium 的引擎。 + +虽然两者都有足够的能力处理现代 Web 体验,但基于 Chromium 的引擎更受欢迎,Web 开发人员通常会在基于 Chrome 的浏览器上定制他们的网站以获得最佳体验。 + +另外,有些服务恰好只支持基于 Chrome 的浏览器。 + +### 广告 & 追踪器阻止功能 + +![][18] + +正如我之前提到的,Brave 在阻止跟踪器和广告方面非常积极。默认情况下,它已经启用了屏蔽功能。 + +Firefox 浏览器也默认启用了增强的隐私保护功能,但并不阻止显示广告。 + +如果你想摆脱广告,你得选择火狐浏览器的 “严格隐私保护模式”。 + +也就是说,火狐浏览器执行了一些独特的跟踪保护技术,包括“全面 Cookie 保护”,可以为每个网站隔离 Cookie 并防止跨站 Cookie 跟踪。 + +![][19] + +这是在 [Firefox 86][20] 中引入的技术,要使用它,你需要启用“严格隐私保护模式”。 + +总的来说,Brave 可能看起来是一个更好的选择,而 Mozilla Firefox 提供了更好的隐私保护功能。 + +### 容器 + +当你访问 Facebook 时,Firefox 还提供了一种借助容器来隔离网站活动的方法。换句话说,它可以防止 Facebook 跟踪你的站外活动。 + +你还可以使用容器来组织你的标签,并在需要时分离会话。 + +Brave 没有提供任何类似的功能,但它本身可以阻止跨站追踪器和 cookie。 + +### 奖励 + +![][21] + +与 Firefox 不同,Brave 通过屏蔽网络上的其他广告来提供自己的广告网络。 + +当你选择显示 Brave 的隐私友好型广告时,你会得到可以放到加密货币钱包里的通证奖励。而你可以用这些通证来回馈你喜欢的网站。 + +虽然这是摆脱主流广告的一个很好的商业策略,但对于不想要任何形式的广告的用户来说,这可能没有用。 + +因此,Brave 以奖励的形式提供了一个替代方案,即使你屏蔽了广告,也可以帮助网站。如果这是你欣赏的东西,Brave 将是你的一个好选择。 + +### 跨平台可用性 + +你会发现 Brave 和 Firefox 都有 Linux、Windows 和 macOS 版本,也有用于 iOS 和 Android 的移动应用程序。 + +对于 Linux 用户来说,Firefox 浏览器捆绑找大多数的 Linux 发行版中。而且,你也可以在软件中心里找到它。除此之外,还有一个 [Flatpak][22] 包可用。 + +Brave 不能通过默认的软件库和软件中心获得。因此,你需要按照官方的说明来添加私有仓库,然后 [把 Brave 安装在你的 Linux 发行版中][23]。 + +### 同步 + +通过 Mozilla Firefox,你可以创建一个 Firefox 账户来跨平台同步你的所有数据。 + +![][24] + +Brave 也可以让你跨平台同步,但你需要访问其中一个设备才能成功做到这一点。 + +![][25] + +因此,Firefox 的同步更方便。 + +另外,你可以通过 Firefox 的账户访问它的“虚拟专用网络”、数据泄露监控器、电子邮件中继,以及密码管理器。 + +### 服务集成 + +一开始,Firefox 就提供了更多的服务集成,包括 Pocket、“虚拟私有网络”、密码管理器,还有一些新产品,如 Firefox 中继。 + +如果你想通过你的浏览器访问这些服务,Firefox 将是你的方便选择。 + +虽然 Brave 确实提供了加密货币钱包,但它并不适合所有人。 + +![][26] + +同样,如果你喜欢使用 [Brave Search][27],在使用 Brave 浏览器时,由于用户体验的原因,你可能会有顺滑的体验。 + +### 可定制性 & 安全性 + +Firefox 浏览器在可定制性方面大放异彩。你可以通过众多选项来调整体验,也可以控制你的浏览器的隐私/安全。 + +自定义的能力使你可以让 Firefox 比 Brave 浏览器更安全。 + +而加固 Firefox 浏览器是一个我们将讨论的单独话题。略举一例,[Tor 浏览器][28] 只是一个定制的 Firefox 浏览器。 + +然而,这并不意味着 Brave 的安全性降低。总的来说,它是一个安全的浏览器,但你确实可以通过 Firefox 浏览器获得更多的选择。 + +### 扩展支持 + +毫无疑问,Chrome Web 商店提供了更多的扩展。 + +因此,如果你是一个使用大量扩展(或不断尝试新扩展)的人,Brave 明显比 Firefox 更有优势。 + +Firefox 可能扩展目录不是最大的,但它确实支持大多数的扩展。对于常见的使用情况,你很少能找到一个不能作为 Firefox 附加组件的扩展。 + +### 你应该选择那个? + +如果你希望尽量兼容现代的 Web 体验,并希望有更多的扩展,Brave 浏览器似乎更合适。 + +另一方面,Firefox 浏览器是日常浏览的绝佳选择,它具有业界首创的隐私功能,并为不懂技术的用户提供了方便的同步选项。 + +在选择它们中的任何一个时会有一些取舍。因此,你需要优先考虑你最想要的东西。 + +请在下面的评论中告诉我你对你的使用情况的最终选择! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/brave-vs-firefox/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: tmp.5yJseRG2rb#ui +[2]: tmp.5yJseRG2rb#perf +[3]: tmp.5yJseRG2rb#engine +[4]: tmp.5yJseRG2rb#ad +[5]: tmp.5yJseRG2rb#container +[6]: tmp.5yJseRG2rb#reward +[7]: tmp.5yJseRG2rb#cp +[8]: tmp.5yJseRG2rb#sync +[9]: tmp.5yJseRG2rb#service +[10]: tmp.5yJseRG2rb#customise +[11]: tmp.5yJseRG2rb#extensions +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-ui-new.jpg?resize=800%2C450&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-ui.jpg?resize=800%2C450&ssl=1 +[14]: https://web.basemark.com +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-basemark.png?resize=800%2C598&ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/basemark-brave.png?resize=800%2C560&ssl=1 +[17]: https://servo.org +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-blocker.png?resize=800%2C556&ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-blocker.png?resize=800%2C564&ssl=1 +[20]: https://news.itsfoss.com/firefox-86-release/ +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-rewards.png?resize=800%2C560&ssl=1 +[22]: https://itsfoss.com/what-is-flatpak/ +[23]: https://itsfoss.com/brave-web-browser/ +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-sync.png?resize=800%2C651&ssl=1 +[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-sync.png?resize=800%2C383&ssl=1 +[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-crypto-wallet.png?resize=800%2C531&ssl=1 +[27]: https://itsfoss.com/brave-search-features/ +[28]: https://itsfoss.com/install-tar-browser-linux/ From 5cb464ab0218fa4f2e69fb9d98b578769043413e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Aug 2021 05:05:02 +0800 Subject: [PATCH 032/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210828=20?= =?UTF-8?q?Parse=20command-line=20options=20in=20Groovy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210828 Parse command-line options in Groovy.md --- ...28 Parse command-line options in Groovy.md | 184 ++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 sources/tech/20210828 Parse command-line options in Groovy.md diff --git a/sources/tech/20210828 Parse command-line options in Groovy.md b/sources/tech/20210828 Parse command-line options in Groovy.md new file mode 100644 index 0000000000..1985825300 --- /dev/null +++ b/sources/tech/20210828 Parse command-line options in Groovy.md @@ -0,0 +1,184 @@ +[#]: subject: "Parse command-line options in Groovy" +[#]: via: "https://opensource.com/article/21/8/parsing-command-options-groovy" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Parse command-line options in Groovy +====== +Learn to add options to your Groovy applications. +![Woman sitting in front of her computer][1] + +A recent article provided an [introduction to parsing command-line options in Java][2]. Because I really like Groovy, and because Groovy is well suited for scripting, and because it's fun to compare Java and Groovy solutions, I decided to paraphrase Seth's article, but using Groovy. + +### Install Groovy + +Groovy is based on Java, so it requires a Java installation. Both a recent and decent version of Java and Groovy might be in your Linux distribution's repositories. Alternately, you can install Groovy by following the instructions on the [groovy-lang.org][3]. + +A nice alternative for Linux users is [SDKMan][4], which can be used to get multiple versions of Java, Groovy, and many other related tools. For this article, I'm using my distro's OpenJDK11 release and SDKMan's latest Groovy release. + +### Parsing command-line options in Groovy + +When we create a script—a kind of short, often informal program—to be run from the command line, we normally follow the practice of passing arguments to the script on the command line. A good example of this is the `ls` command, used to list all the files and subfolders in a given folder, perhaps showing attributes and sorted in reverse order of last modification date, as in: + + +``` +`$ ls -lt /home/me` +``` + +To show the contents of my home folder like this: + + +``` +total 252 +drwxr-xr-x 5 me me 4096 Aug 10 12:23 Downloads +drwx------ 11 me me 4096 Aug 10 08:59 Dropbox +drwxr-xr-x 27 me me 12288 Aug 9 11:58 Pictures +-rw-rw-r-- 1 me me 235 Jul 28 16:22 wb.groovy +drwxr-xr-x 2 me me 4096 Jul 20 22:04 Desktop +drwxrwxr-x 2 me me 4096 Jul 20 15:16 Fixed +drwxr-xr-x 2 me me 16384 Jul 19 08:49 Music +-rw-rw-r-- 1 me me 433 Jul 7 13:24 foo +drwxr-xr-x 6 me me 4096 Jun 29 10:25 Documents +drwxr-xr-x 2 me me 4096 Jun 14 22:15 Templates +-rw-rw-r-- 1 me me 803 Jun 14 11:33 bar +``` + +Of course, arguments to commands can be handled by inspecting them and deciding what to do in each case; but this ends up being a duplication of effort that can be avoided by using a library designed for that purpose. + +Seth's Java article introduces the [Apache Commons CLI library][5], a great API for handling command-line options. In fact, this library is so great that the good people who develop Groovy make it available by default in the Groovy installation. Therefore, once you have Groovy installed, you have access to this library through [**groovy.cli.picocli.CliBuilder**][6], which is already imported for you by default. + +Here's a Groovy script that uses this CLI builder to achieve the same results as Seth's Java program: + + +``` +1 def cli = new CliBuilder(usage: 'ho.groovy [-a] -c') +2 cli.with { +3    a longOpt: 'alpha', 'Activate feature alpha' +4    c longOpt: 'config', args:1, argName: 'config', required: true, 'Set config file' +5 } +6 def options = cli.parse(args) +7 if (!options) { +8    return +9 } +10 if (options.a) { +11    println' Alpha activated' +12 } +13 if (options.c) { +14    println "Config set to ${options.c}" +15 } +``` + +I've included line numbers here to facilitate the discussion. Save this script without the line numbers in a file called **ho.groovy**. + +On line 1, we define the variable **cli** and set it to a new instance of **CliBuilder** with a defined **usage** attribute. This is a string that will be printed if the **usage()** method is called. + +On lines 2-5, we use [the **with()** method][7] that Groovy adds to objects, together with the DSL defined by **CliBuilder**, to set up the option definitions. + +On line 3, we define the option '**a**', setting its **longOpt** field to '**alpha**' and its description to '**Activate feature alpha**'. + +Similarly, on line 4, we define the option '**c**', setting its **longOpt** field to '**config**' and specifying that this option takes one argument whose name is '**config**'. Moreover, this is a **required** option (sounds funny, I know), and its description is '**Set config file**'. + +Pausing briefly here for a bit of background, you can read all about these various options at the **CliBuilder** link above. More generally, things written in the form **longOpt: 'alpha'** are Groovy notation for key-value entries to be put in a **Map** instance, which you can read about [here][8]. Each key, in this case, corresponds to a method of the same name provided by the CliBuilder. If you're wondering what's going on with a line like: + + +``` +`a longOpt: 'alpha', 'Activate feature alpha'` +``` + +then it may be useful to mention that Groovy allows us to drop parentheses in certain circumstances; so the above is equivalent to: + + +``` +`a(longOpt: 'alpha', 'Activate feature alpha')` +``` + +i.e., it's a method call. Moreover, Groovy allows both positional and named parameters, the latter using that key: value syntax. + +Onward! On lines 6-9, we call the **parse()** method of the **CliBuilder** instance **cli**, passing the **args—**an array of **String** values created by the Groovy run-time and containing the arguments from the command line. This method returns a **Map** of the options where the keys are the short-form of the predefined options—in this case, '**a**' and '**c**'. If the parsing fails, then **parse()** emits the **usage** message, a reasonable error message, and returns a null value, so we don't have to use a try-catch block (which one doesn't see as often in Groovy). So here—line 8—we just return since all our work is done for us. + +On lines 10-12, we check to see if option '_a_' was included on the command line and if it is, print a message saying so. + +Similarly, on lines 13-15, we check to see if option '**c**' was included on the command line and if so, print a message showing the argument provided to it. + +### Running the command + +Let’s run the script a few times; first with no arguments: + + +``` +$ groovy ho.groovy +error: Missing required option: c +usage: ho.groovy [-a] -c + -a,--alpha Activate feature alpha + -c,--config <config> [Set][9] config file +$ +``` + +Notice the complaint about missing the required option '**c**'. + +Then with the '**c**' option but no argument: + + +``` +$ groovy ho.groovy -c +error: Missing argument for option: c +usage: ho.groovy [-a] -c + -a,--alpha +Activate feature alpha + -c,--config <config> [Set][9] config file +$ +``` + +Cool, the **CliBuilder** instance method **parse()** noticed no argument was provided to '**c**'. + +Finally, let's try with both options and an argument to '**c**', in their long form: + + +``` +$ groovy ho.groovy --alpha --config bar +Alpha activated +Config set to bar +$ +``` + +Looks good! + +Since the idea of the '**c**' option is to provide a config file, we could also tell the **CliBuilder** instance that the type of this argument is File, and it will return that instead of a String. But we'll leave that for another day. + +So, there you have it—command-line option parsing in Groovy. + +### Groovy resources + +The Groovy website has a lot of great documentation. Another great Groovy resource is [Mr. Haki][10], and specifically [this lovely article on CliBuilder][11]. + +Another great reason to learn Groovy is [Grails][12], a wonderfully productive full-stack web framework built on top of excellent components like Hibernate, Spring Boot, and Micronaut. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/parsing-command-options-groovy + +作者:[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_women_computing_3.png?itok=qw2A18BM (Woman sitting in front of her computer) +[2]: https://opensource.com/article/21/8/java-commons-cli +[3]: https://groovy-lang.org/ +[4]: https://sdkman.io/ +[5]: https://commons.apache.org/proper/commons-cli/ +[6]: https://docs.groovy-lang.org/latest/html/gapi/groovy/cli/picocli/CliBuilder.html +[7]: https://objectpartners.com/2014/07/09/groovys-with-and-multiple-assignment/ +[8]: https://www.baeldung.com/groovy-maps +[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+set +[10]: https://blog.mrhaki.com/ +[11]: https://blog.mrhaki.com/2009/09/groovy-goodness-parsing-commandline.html +[12]: https://grails.org/ From 50354bb9be3ac363574529793f08082082fcea37 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Aug 2021 09:59:27 +0800 Subject: [PATCH 033/138] PRF&PUB @geekpi https://linux.cn/article-13729-1.html --- ...heck free disk space in Linux with ncdu.md | 86 +++++++++---------- 1 file changed, 39 insertions(+), 47 deletions(-) rename {translated/tech => published}/20210819 Check free disk space in Linux with ncdu.md (60%) diff --git a/translated/tech/20210819 Check free disk space in Linux with ncdu.md b/published/20210819 Check free disk space in Linux with ncdu.md similarity index 60% rename from translated/tech/20210819 Check free disk space in Linux with ncdu.md rename to published/20210819 Check free disk space in Linux with ncdu.md index 2367be34a4..4d77814c02 100644 --- a/translated/tech/20210819 Check free disk space in Linux with ncdu.md +++ b/published/20210819 Check free disk space in Linux with ncdu.md @@ -3,62 +3,60 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13729-1.html" 用 ncdu 检查 Linux 中的可用磁盘空间 ====== -用 ncdu Linux 命令获得关于磁盘使用的交互式报告。 -![Check disk usage][1] -计算机用户多年来往往积累了大量的数据,无论是重要的个人项目、数码照片、视频、音乐还是代码库。虽然现在的硬盘往往相当大,但有时你必须退一步,评估一下你在硬盘上实际存储了什么。经典的 Linux 命令 [`df`][2] 和 [`du`][3] 是快速了解硬盘上的内容的方法,它们提供了一个可靠的报告,易于解析和处理。这对脚本和处理来说是很好的,但人的大脑对数百行的原始数据并不总是反应良好。认识到这一点,`ncdu` 命令旨在提供一份关于你在硬盘上使用的空间的交互式报告。 +> 用 ncdu Linux 命令获得关于磁盘使用的交互式报告。 + +![](https://img.linux.net.cn/data/attachment/album/202108/29/095819e87oz4ox6p40t6q0.jpg) + +计算机用户多年来往往积累了大量的数据,无论是重要的个人项目、数码照片、视频、音乐还是代码库。虽然现在的硬盘往往相当大,但有时你必须退一步,评估一下你在硬盘上实际存储了什么。经典的 Linux 命令 [df][2] 和 [du][3] 是快速了解硬盘上的内容的方法,它们提供了一个可靠的报告,易于解析和处理。这对脚本和处理来说是很好的,但人的大脑对数百行的原始数据并不总是反应良好。认识到这一点,`ncdu` 命令旨在提供一份关于你在硬盘上使用的空间的交互式报告。 ### 在 Linux 上安装 ncdu 在 Linux 上,你可以从你的软件仓库安装 `ncdu`。例如,在 Fedora 或 CentOS 上: - ``` -`$ sudo dnf install ncdu` +$ sudo dnf install ncdu ``` 在 BSD 上,你可以使用 [pkgsrc][4]。 在 macOS 上,你可以从 [MacPorts][5] 或 [HomeBrew][6] 安装。 -另外,你也可以[从源码编译 ncdu][7]。 +另外,你也可以 [从源码编译 ncdu][7]。 ### 使用 ncdu -ncdu 界面使用 ncurses 库,它将你的终端窗口变成一个基本的图形应用,所以你可以使用方向键来浏览菜单。 +`ncdu` 界面使用 ncurses 库,它将你的终端窗口变成一个基本的图形应用,所以你可以使用方向键来浏览菜单。 ![ncdu interface][8] -CC BY-SA Seth Kenlon - 这是 `ncdu` 的主要吸引力之一,也是它与最初的 `du` 命令不同的地方。 要获得一个目录的完整列表,启动 `ncdu`。它默认为当前目录。 - ``` $ ncdu -ncdu 1.16 ~ Use the arrow keys to navigate, press ? for help -\--- /home/tux ----------------------------------------------- - 22.1 GiB [##################] /.var - 19.0 GiB [############### ] /Iso - 10.0 GiB [######## ] /.local - 7.9 GiB [###### ] /.cache - 3.8 GiB [### ] /Downloads - 3.6 GiB [## ] /.mail - 2.9 GiB [## ] /Code - 2.8 GiB [## ] /Documents - 2.3 GiB [# ] /Videos +ncdu 1.16 ~ Use the arrow keys to navigate, press ? for help +--- /home/tux ----------------------------------------------- + 22.1 GiB [##################] /.var + 19.0 GiB [############### ] /Iso + 10.0 GiB [######## ] /.local + 7.9 GiB [###### ] /.cache + 3.8 GiB [### ] /Downloads + 3.6 GiB [## ] /.mail + 2.9 GiB [## ] /Code + 2.8 GiB [## ] /Documents + 2.3 GiB [# ] /Videos [...] ``` -这个列表首先显示了最大的目录(在这个例子中,那是 `~/.var` 目录,充满了很多的 flatpaks)。 +这个列表首先显示了最大的目录(在这个例子中,那是 `~/.var` 目录,塞满了很多的 flatpak 包)。 使用键盘上的方向键,你可以浏览列表,深入到一个目录,这样你就可以更好地了解什么东西占用了最大的空间。 @@ -66,63 +64,57 @@ ncdu 1.16 ~ Use the arrow keys to navigate, press ? for help 你可以在启动 `ncdu` 时提供任意一个文件夹的路径: - ``` -`$ ncdu ~/chromiumos` +$ ncdu ~/chromiumos ``` ### 排除目录 默认情况下,`ncdu` 包括一切可以包括的东西,包括符号链接和伪文件系统,如 procfs 和 sysfs。你可以用 `--exclude-kernfs` 来排除这些。 -你可以使用 --exclude 选项排除任意文件和目录,并在后面加上一个匹配模式。 - +你可以使用 `--exclude` 选项排除任意文件和目录,并在后面加上一个匹配模式。 ``` $ ncdu --exclude ".var" - 19.0 GiB [##################] /Iso - 10.0 GiB [######### ] /.local - 7.9 GiB [####### ] /.cache - 3.8 GiB [### ] /Downloads + 19.0 GiB [##################] /Iso + 10.0 GiB [######### ] /.local + 7.9 GiB [####### ] /.cache + 3.8 GiB [### ] /Downloads [...] ``` 另外,你可以在文件中列出要排除的文件和目录,并使用 `--exclude-from` 选项来引用该文件: ``` -$ ncdu --exclude-from myexcludes.txt /home/tux - 10.0 GiB [######### ] /.local - 7.9 GiB [####### ] /.cache - 3.8 GiB [### ] /Downloads +$ ncdu --exclude-from myexcludes.txt /home/tux + 10.0 GiB [######### ] /.local + 7.9 GiB [####### ] /.cache + 3.8 GiB [### ] /Downloads [...] ``` ### 颜色方案 -你可以用 `--color dark` 选项给 ncdu 添加一些颜色。 +你可以用 `--color dark` 选项给 `ncdu` 添加一些颜色。 ![ncdu color scheme][9] -CC BY-SA Seth Kenlon - ### 包括符号链接 `ncdu` 输出按字面意思处理符号链接,这意味着一个指向 9GB 文件的符号链接只占用 40 个字节。 - ``` $ ncdu ~/Iso - 9.3 GiB [##################] CentOS-Stream-8-x86_64-20210427-dvd1.iso -@ 0.0 B [ ] fake.iso + 9.3 GiB [##################] CentOS-Stream-8-x86_64-20210427-dvd1.iso +@ 0.0 B [ ] fake.iso ``` 你可以用 `--follow-symlinks` 选项强制 ncdu 跟踪符号链接: - ``` $ ncdu --follow-symlinks ~/Iso - 9.3 GiB [##################] fake.iso - 9.3 GiB [##################] CentOS-Stream-8-x86_64-20210427-dvd1.iso + 9.3 GiB [##################] fake.iso + 9.3 GiB [##################] CentOS-Stream-8-x86_64-20210427-dvd1.iso ``` ### 磁盘使用率 @@ -136,7 +128,7 @@ via: https://opensource.com/article/21/8/ncdu-check-free-disk-space-linux 作者:[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 ea7c37d1aaa99a432e1f877592c2efdb62ef6900 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Aug 2021 11:10:02 +0800 Subject: [PATCH 034/138] PRF&PUB @unigeorge https://linux.cn/article-13730-1.html --- ...lude options in your Bash shell scripts.md | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) rename {translated/tech => published}/20210824 How to include options in your Bash shell scripts.md (70%) diff --git a/translated/tech/20210824 How to include options in your Bash shell scripts.md b/published/20210824 How to include options in your Bash shell scripts.md similarity index 70% rename from translated/tech/20210824 How to include options in your Bash shell scripts.md rename to published/20210824 How to include options in your Bash shell scripts.md index 6cedd174a9..6aa2c9de83 100644 --- a/translated/tech/20210824 How to include options in your Bash shell scripts.md +++ b/published/20210824 How to include options in your Bash shell scripts.md @@ -3,23 +3,24 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13730-1.html" 如何在 Bash shell 脚本中解析命令行选项 ====== -把选项交给你的 shell 脚本吧。 -![Terminal commands][1] -终端命令通常具有 [选项options or switches][2] 功能,用户可以使用选项来修改命令的执行方式。关于命令行接口的 [POSIX 规范][3] 中就对选项做出了规范,这也是基于最早的 UNIX 应用程序建立的一个由来已久的约定,因此你在创建自己的命令时,最好知道如何将选项包含进 [Bash 脚本][4] 中。 +> 给你的 shell 脚本添加选项。 -与大多数语言一样,有若干种方法可以解决 Bash 中解析选项的问题。但直到今天,我最喜欢的方法仍然是我从 Patrick Volkerding 的 Slackware 构建脚本中学到的方法,当我第一次得知 Linux 并勇于探索操作系统附带的纯文本文件时,它就是我关于 shell 脚本的引路人。 +![](https://img.linux.net.cn/data/attachment/album/202108/29/110849lvhr1bjg1r43sfcx.jpg) + +终端命令通常具有 [选项或开关][2],用户可以使用它们来修改命令的执行方式。关于命令行界面的 [POSIX 规范][3] 中就对选项做出了规范,这也是最早的 UNIX 应用程序建立的一个由来已久的惯例,因此你在创建自己的命令时,最好知道如何将选项包含进 [Bash 脚本][4] 中。 + +与大多数语言一样,有若干种方法可以解决 Bash 中解析选项的问题。但直到今天,我最喜欢的方法仍然是我从 Patrick Volkerding 的 Slackware 构建脚本中学到的方法,当我第一次发现 Linux 并敢于冒险探索操作系统所附带的纯文本文件时,这些脚本就是我的 shell 脚本的引路人。 ### Bash 中的选项解析 -在 Bash 中解析选项的策略是循环遍历传递给 shell 脚本的所有参数,确定它们是否为选项,然后转移到下一个参数。重复这个过程,直到没有选项为止。 - +在 Bash 中解析选项的策略是循环遍历所有传递给 shell 脚本的参数,确定它们是否是一个选项,然后转向下一个参数。重复这个过程,直到没有选项为止。 ``` #!/bin/bash @@ -38,7 +39,7 @@ echo $ALPHA 在这段代码中,我创建了一个 `while` 循环,它会一直进行循环操作,直到处理完所有参数。`if` 语句会试着将在第一个位置(`$1`)中找到的参数与 `--alpha` 或 `-a` 匹配。(此处的待匹配项是任意选项名称,并没有特殊意义。在实际的脚本中,你可以使用 `--verbose` 和 `-v` 来触发详细输出)。 -`shift` 关键字会使所有参数向后移动一位,这样位置 2(`$2`)的参数移动到位置 1(`$1`)。处理完所有参数后会触发 else 语句,进而中断 while 循环。 +`shift` 关键字会使所有参数位移一位,这样位置 2(`$2`)的参数移动到位置 1(`$1`)。处理完所有参数后会触发 `else` 语句,进而中断 `while` 循环。 在脚本的末尾,`$ALPHA` 的值会输出到终端。 @@ -106,7 +107,7 @@ bar 有一些选项需要传入参数。比如,你可能希望允许用户设置诸如颜色或图形分辨率之类的属性,或者将应用程序指向自定义配置文件。 -要在 Bash 中实现这一点,你仍然可以像使用布尔选项一样使用 `shift` 关键字,但参数需要向后移动两位而不是一位。 +要在 Bash 中实现这一点,你仍然可以像使用布尔开关一样使用 `shift` 关键字,但参数需要位移两位而不是一位。 ``` #!/bin/bash @@ -133,7 +134,7 @@ for i in ${ARG[@]}; do done ``` -在这段代码中,我添加了一个 `elif` 子句来将每个参数与 `--config` 和 `-c` 进行比较。如果匹配,名为 `CONFIG` 的变量的值就设置为下一个参数的值(这就表示 `--config` 选项需要一个参数)。所有参数都后移两位:其中一位是跳过 `--config` 或 `-c`,另一位是跳过其参数。与上节一样,循环重复直到没有匹配的参数。 +在这段代码中,我添加了一个 `elif` 子句来将每个参数与 `--config` 和 `-c` 进行比较。如果匹配,名为 `CONFIG` 的变量的值就设置为下一个参数的值(这就表示 `--config` 选项需要一个参数)。所有参数都位移两位:其中一位是跳过 `--config` 或 `-c`,另一位是跳过其参数。与上节一样,循环重复直到没有匹配的参数。 下面是新版脚本的测试: @@ -150,7 +151,7 @@ baz ### Bash 让选项解析变得简单 -还有一些其他方法也可以解析 Bash 中的选项。你可以交替使用 `case` 语句或 `getopt` 命令。无论使用什么方法,用户选项都是应用程序的重要功能,而 Bash 让解析选项成为了一件简单的事。 +还有一些其他方法也可以解析 Bash 中的选项。你可以替换使用 `case` 语句或 `getopt` 命令。无论使用什么方法,给你的用户提供选项都是应用程序的重要功能,而 Bash 让解析选项成为了一件简单的事。 -------------------------------------------------------------------------------- @@ -159,7 +160,7 @@ via: https://opensource.com/article/21/8/option-parsing-bash 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 079dce8ec689574d2ea258c0a0a7c62a5d6bce08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Sun, 29 Aug 2021 15:30:00 +0800 Subject: [PATCH 035/138] Finish translation File name: 20210727 Analyze the Linux kernel with ftrace.md --- ...27 Analyze the Linux kernel with ftrace.md | 404 ------------------ ...27 Analyze the Linux kernel with ftrace.md | 381 +++++++++++++++++ 2 files changed, 381 insertions(+), 404 deletions(-) delete mode 100644 sources/tech/20210727 Analyze the Linux kernel with ftrace.md create mode 100644 translated/tech/20210727 Analyze the Linux kernel with ftrace.md diff --git a/sources/tech/20210727 Analyze the Linux kernel with ftrace.md b/sources/tech/20210727 Analyze the Linux kernel with ftrace.md deleted file mode 100644 index 9759f821ef..0000000000 --- a/sources/tech/20210727 Analyze the Linux kernel with ftrace.md +++ /dev/null @@ -1,404 +0,0 @@ -[#]: subject: (Analyze the Linux kernel with ftrace) -[#]: via: (https://opensource.com/article/21/7/linux-kernel-ftrace) -[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) -[#]: collector: (lujun9972) -[#]: translator: (mengxinayan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Analyze the Linux kernel with ftrace -====== -Ftrace is a great way to learn more about the internal workings of the -Linux kernel. -![Linux keys on the keyboard for a desktop computer][1] - -An operating system's kernel is one of the most elusive pieces of software out there. It's always there running in the background from the time your system gets turned on. Every user achieves their computing work with the help of the kernel, yet they never interact with it directly. The interaction with the kernel occurs by making system calls or having those calls made on behalf of the user by various libraries or applications that they use daily. - -I've covered how to trace system calls in an earlier article using `strace`. However, with `strace`, your visibility is limited. It allows you to view the system calls invoked with specific parameters and, after the work gets done, see the return value or status indicating whether they passed or failed. But you had no idea what happened inside the kernel during this time. Besides just serving system calls, there's a lot of other activity happening inside the kernel that you're oblivious to. - -### Ftrace Introduction - -This article aims to shed some light on tracing the kernel functions by using a mechanism called `ftrace`. It makes kernel tracing easily accessible to any Linux user, and with its help you can learn a lot about Linux kernel internals. - -The default output generated by the `ftrace` is often massive, given that the kernel is always busy. To save space, I've kept the output to a minimum and, in many cases truncated the output entirely. - -I am using Fedora for these examples, but they should work on any of the latest Linux distributions. - -### Enabling ftrace - -`Ftrace` is part of the Linux kernel now, and you no longer need to install anything to use it. It is likely that, if you are using a recent Linux OS, `ftrace` is already enabled. To verify that the `ftrace` facility is available, run the mount command and search for `tracefs`. If you see output similar to what is below, `ftrace` is enabled, and you can easily follow the examples in this article: - - -``` -$ sudo mount | grep tracefs -none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) -``` - -To make use of `ftrace`, you first must navigate to the special directory as specified in the mount command above, from where you'll run the rest of the commands in the article: - - -``` -`$ cd /sys/kernel/tracing` -``` - -### General work flow - -First of all, you must understand the general workflow of capturing a trace and obtaining the output. If you're using `ftrace` directly, there isn't any special `ftrace-`specific commands to run. Instead, you basically write to some files and read from some files using standard command-line Linux utilities. - -The general steps: - - 1. Write to some specific files to enable/disable tracing. - 2. Write to some specific files to set/unset filters to fine-tune tracing. - 3. Read generated trace output from files based on 1 and 2. - 4. Clear earlier output or buffer from files. - 5. Narrow down to your specific use case (kernel functions to trace) and repeat steps 1, 2, 3, 4. - - - -### Types of available tracers - -There are several different kinds of tracers available to you. As mentioned earlier, you need to be in a specific directory before running any of these commands because the files of interest are present there. I use relative paths (as opposed to absolute paths) in my examples. - -You can view the contents of the `available_tracers` file to see all the types of tracers available. You can see a few listed below. Don't worry about all of them just yet: - - -``` -$ pwd -/sys/kernel/tracing - -$ sudo cat available_tracers -hwlat blk mmiotrace function_graph wakeup_dl wakeup_rt wakeup function nop -``` - -Out of all the given tracers, I focus on three specific ones: `function` and `function_graph` to enable tracing, and `nop` to disable tracing. - -### Identify current tracer - -Usually, by default, the tracer is set to `nop`. That is, "No operation" in the special file `current_tracer`, which usually means tracing is currently off: - - -``` -$ pwd -/sys/kernel/tracing - -$ sudo cat current_tracer -nop -``` - -### View Tracing output - -Before you enable any tracing, take a look at the file where the tracing output gets stored. You can view the contents of the file named `trace` using the [cat][2] command: - - -``` -$ sudo cat trace -# tracer: nop -# -# entries-in-buffer/entries-written: 0/0   #P:8 -# -#                                _-----=> irqs-off -#                               / _----=> need-resched -#                              | / _---=> hardirq/softirq -#                              || / _--=> preempt-depth -#                              ||| /     delay -#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION -#              | |         |   ||||      |         | -``` - -### Enable function tracer - -You can enable your first tracer called `function` by writing `function` to the file `current_tracer` (its earlier content was `nop`, indicating that tracing was off.) Think of this operation as a way of enabling tracing: - - -``` -$ pwd -/sys/kernel/tracing - -$ sudo cat current_tracer -nop -$ echo function > current_tracer -$ -$ cat current_tracer -function -``` - -### View updated tracing output for function tracer - -Now that you've enabled tracing, it's time to view the output. If you view the contents of the `trace` file, you see a lot of data being written to it continuously. I've piped the output and am currently viewing only the top 20 lines to keep things manageable. If you follow the headers in the output on the left, you can see which task and Process ID are running on which CPU. Toward the right side of the output, you see the exact kernel function running, followed by its parent function. There is also time stamp information in the center: - - -``` -$ sudo cat trace | head -20 -# tracer: function -# -# entries-in-buffer/entries-written: 409936/4276216   #P:8 -# -#                                _-----=> irqs-off -#                               / _----=> need-resched -#                              | / _---=> hardirq/softirq -#                              || / _--=> preempt-depth -#                              ||| /     delay -#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION -#              | |         |   ||||      |         | -          <idle>-0       [000] d...  2088.841739: tsc_verify_tsc_adjust <-arch_cpu_idle_enter -          <idle>-0       [000] d...  2088.841739: local_touch_nmi <-do_idle -          <idle>-0       [000] d...  2088.841740: rcu_nocb_flush_deferred_wakeup <-do_idle -          <idle>-0       [000] d...  2088.841740: tick_check_broadcast_expired <-do_idle -          <idle>-0       [000] d...  2088.841740: cpuidle_get_cpu_driver <-do_idle -          <idle>-0       [000] d...  2088.841740: cpuidle_not_available <-do_idle -          <idle>-0       [000] d...  2088.841741: cpuidle_select <-do_idle -          <idle>-0       [000] d...  2088.841741: menu_select <-do_idle -          <idle>-0       [000] d...  2088.841741: cpuidle_governor_latency_req <-menu_select -``` - -Remember that tracing is on, which means the output of tracing continues to get written to the trace file until you turn tracing off. - -### Turn off tracing - -Turning off tracing is simple. All you have to do is replace `function` tracer with `nop` in the `current_tracer` file and tracing gets turned off: - - -``` -$ sudo cat current_tracer -function - -$ sudo echo nop > current_tracer - -$ sudo cat current_tracer -nop -``` - -### Enable function_graph tracer - -Now try the second tracer, called `function_graph`. You can enable this using the same steps as before: write `function_graph` to the `current_tracer` file: - - -``` -$ sudo echo function_graph > current_tracer - -$ sudo cat current_tracer -function_graph -``` - -### Tracing output of function_graph tracer - -Notice that the output format of the `trace` file has changed. Now, you can see the CPU ID and the duration of the kernel function execution. Next, you see curly braces indicating the beginning of a function and what other functions were called from inside it: - - -``` -$ sudo cat trace | head -20 -# tracer: function_graph -# -# CPU  DURATION                  FUNCTION CALLS -# |     |   |                     |   |   |   | - 6)               |              n_tty_write() { - 6)               |                down_read() { - 6)               |                  __cond_resched() { - 6)   0.341 us    |                    rcu_all_qs(); - 6)   1.057 us    |                  } - 6)   1.807 us    |                } - 6)   0.402 us    |                process_echoes(); - 6)               |                add_wait_queue() { - 6)   0.391 us    |                  _raw_spin_lock_irqsave(); - 6)   0.359 us    |                  _raw_spin_unlock_irqrestore(); - 6)   1.757 us    |                } - 6)   0.350 us    |                tty_hung_up_p(); - 6)               |                mutex_lock() { - 6)               |                  __cond_resched() { - 6)   0.404 us    |                    rcu_all_qs(); - 6)   1.067 us    |                  } -``` - -### Enable trace settings to increase the depth of tracing - -You can always tweak the tracer slightly to see more depth of the function calls using the steps below. After which, you can view the contents of the `trace` file and see that the output is slightly more detailed. For readability, the output of this example is omitted: - - -``` -$ sudo cat max_graph_depth -0 -$ sudo echo 1 > max_graph_depth -$ # or -$ sudo echo 2 > max_graph_depth - -$ sudo cat trace -``` - -### Finding functions to trace - -The steps above are sufficient to get started with tracing. However, the amount of output generated is enormous, and you can often get lost while trying to find out items of interest. Often you want the ability to trace specific functions only and ignore the rest. But how do you know which processes to trace if you don't know their exact names? There is a file that can help you with this—`available_filter_functions` provides you with a list of available functions for tracing: - - -``` -$ sudo wc -l available_filter_functions   -63165 available_filter_functions -``` - -### Search for general kernel functions - -Now try searching for a simple kernel function that you are aware of. User-space has `malloc` to allocate memory, while the kernel has its `kmalloc` function, which provides similar functionality. Below are all the `kmalloc` related functions: - - -``` -$ sudo grep kmalloc available_filter_functions -debug_kmalloc -mempool_kmalloc -kmalloc_slab -kmalloc_order -kmalloc_order_trace -kmalloc_fix_flags -kmalloc_large_node -__kmalloc -__kmalloc_track_caller -__kmalloc_node -__kmalloc_node_track_caller -[...] -``` - -### Search for kernel module or driver related functions - -From the output of `available_filter_functions`, you can see some lines ending with text in brackets, such as `[kvm_intel]` in the example below. These functions are related to the kernel module `kvm_intel`, which is currently loaded. You can run the `lsmod` command to verify: - - -``` -$ sudo grep kvm available_filter_functions | tail -__pi_post_block [kvm_intel] -vmx_vcpu_pi_load [kvm_intel] -vmx_vcpu_pi_put [kvm_intel] -pi_pre_block [kvm_intel] -pi_post_block [kvm_intel] -pi_wakeup_handler [kvm_intel] -pi_has_pending_interrupt [kvm_intel] -pi_update_irte [kvm_intel] -vmx_dump_dtsel [kvm_intel] -vmx_dump_sel [kvm_intel] - -$ lsmod  | grep -i kvm -kvm_intel             335872  0 -kvm                   987136  1 kvm_intel -irqbypass              16384  1 kvm -``` - -### Trace specific functions only - -To enable tracing of specific functions or patterns, you can make use of the `set_ftrace_filter` file to specify which functions from the above output you want to trace. -This file also accepts the `*` pattern, which expands to include additional functions with the given pattern. As an example, I am using the `ext4` filesystem on my machine. I can specify `ext4` specific kernel functions to trace using the following commands: - - -``` -$ sudo mount | grep home -/dev/mapper/fedora-home on /home type ext4 (rw,relatime,seclabel) - -$ pwd -/sys/kernel/tracing - -$ sudo cat set_ftrace_filter -#### all functions enabled #### -$ -$ echo ext4_* > set_ftrace_filter -$ -$ cat set_ftrace_filter -ext4_has_free_clusters -ext4_validate_block_bitmap -ext4_get_group_number -ext4_get_group_no_and_offset -ext4_get_group_desc -[...] -``` - -Now, when you see the tracing output, you can only see functions `ext4` related to kernel functions for which you had set a filter earlier. All the other output gets ignored: - - -``` -$ sudo cat trace |head -20 -# tracer: function -# -# entries-in-buffer/entries-written: 3871/3871   #P:8 -# -#                                _-----=> irqs-off -#                               / _----=> need-resched -#                              | / _---=> hardirq/softirq -#                              || / _--=> preempt-depth -#                              ||| /     delay -#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION -#              | |         |   ||||      |         | -           cupsd-1066    [004] ....  3308.989545: ext4_file_getattr <-vfs_fstat -           cupsd-1066    [004] ....  3308.989547: ext4_getattr <-ext4_file_getattr -           cupsd-1066    [004] ....  3308.989552: ext4_file_getattr <-vfs_fstat -           cupsd-1066    [004] ....  3308.989553: ext4_getattr <-ext4_file_getattr -           cupsd-1066    [004] ....  3308.990097: ext4_file_open <-do_dentry_open -           cupsd-1066    [004] ....  3308.990111: ext4_file_getattr <-vfs_fstat -           cupsd-1066    [004] ....  3308.990111: ext4_getattr <-ext4_file_getattr -           cupsd-1066    [004] ....  3308.990122: ext4_llseek <-ksys_lseek -           cupsd-1066    [004] ....  3308.990130: ext4_file_read_iter <-new_sync_read -``` - -### Exclude functions from being traced - -You don't always know what you want to trace but, you surely know what you don't want to trace. For that, there is this file aptly named `set_ftrace_notrace`—notice the "no" in there. You can write your desired pattern in this file and enable tracing, upon which everything except the mentioned pattern gets traced. This is often helpful to remove common functionality that clutters our output: - - -``` -$ sudo cat set_ftrace_notrace -#### no functions disabled #### -``` - -### Targetted tracing - -So far, you've been tracing everything that has happened in the kernel. But that won't help us if you wish to trace events related to a specific command. To achieve this, you can turn tracing on and off on-demand and, and in between them, run our command of choice so that you do not get extra output in your trace output. You can enable tracing by writing `1` to `tracing_on`, and `0` to turn it off: - - -``` -$ sudo cat tracing_on -0 - -$ sudo echo 1 > tracing_on -$ sudo cat tracing_on -1 - -$ # Run some specific command that we wish to trace here - -$ sudo echo 0 > tracing_on - -$ cat tracing_on -0 -``` - -### Tracing specific PID - -If you want to trace activity related to a specific process that is already running, you can write that PID to a file named `set_ftrace_pid` and then enable tracing. That way, tracing is limited to this PID only, which is very helpful in some instances: - - -``` -`$ sudo echo $PID > set_ftrace_pid` -``` - -### Conclusion - -`Ftrace` is a great way to learn more about the internal workings of the Linux kernel. With some practice, you can learn to fine-tune `ftrace` and narrow down your searches. To understand `ftrace` in more detail and its advanced usage, see these excellent articles written by the core author of `ftrace` himself—Steven Rostedt. - - * [Debugging the Linux kernel, part 1][3] - * [Debugging the Linux kernel, part 2][4] - * [Debugging the Linux kernel, part 3][5] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/linux-kernel-ftrace - -作者:[Gaurav Kamathe][a] -选题:[lujun9972][b] -译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/gkamathe -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: https://opensource.com/article/19/2/getting-started-cat-command -[3]: https://lwn.net/Articles/365835/ -[4]: https://lwn.net/Articles/366796/ -[5]: https://lwn.net/Articles/370423/ diff --git a/translated/tech/20210727 Analyze the Linux kernel with ftrace.md b/translated/tech/20210727 Analyze the Linux kernel with ftrace.md new file mode 100644 index 0000000000..2e38eac86c --- /dev/null +++ b/translated/tech/20210727 Analyze the Linux kernel with ftrace.md @@ -0,0 +1,381 @@ +[#]: subject: (Analyze the Linux kernel with ftrace) +[#]: via: (https://opensource.com/article/21/7/linux-kernel-ftrace) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) +[#]: collector: (lujun9972) +[#]: translator: (mengxinayan) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +通过 `ftrace` 来分析 Linux 内核 +====== +通过 `ftrace` 来了解 Linux 内核内部工作方式是一个好方法。 +![Linux keys on the keyboard for a desktop computer][1] + +一个操作系统的内核是最难以理解的软件之一。自从你的系统启动后,它会一直在后台运行。尽管每个用户都不与内核直接交互,但他们在内核的帮助下完成自己的计算任务。与内核的交互发生在调用系统调用或者用户日常使用的各种库或应用间接调用了系统调用。 + +在之前的文章里我介绍了如何使用 `strace` 来追踪系统调用。然而,使用 `strace` 时你的可见性是受限的。它允许你查看特定参数的系统调用。并在工作完成后,看到其返回值或状态,来表明是通过还是失败。但是你无法知道内核在这段时间内发生了什么。除了系统调用外,内核中还有很多其他活动发生时却被忽略了。 + +### `ftrace` 介绍 + +本文的目的是通过使用一个名为 `ftrace` 的机制来追踪内核函数。任何 Linux 用户可以通过使用它来轻松地追踪内核,并且了解更多关于 Linux 内核内部如何工作。 + +`ftrace` 默认产生的输出是巨大的,因为内核总是忙的。为了节省空间,很多情况下我会通过截断来给出最小输出。 + +我使用 Fedora 来演示下面的例子,但是它们应该在其他最新的 Linux 发行版上同样可以运行。 + +### 启用 `ftrace` + +`ftrace` 现在已经是内核中的一部分了,你不再需要事先安装它了。也就是说,如果你在使用最近的 Linux 系统,那么 `ftrace` 是已经启动了的。为了验证 `ftrace` 是否可用,运行 `mount` 命令并查找 `tracefs`。如果你看到类似下面的输出,表示 `ftrace` 已经启用,你可以轻松地尝试本文中下面的例子。下面的命令需要在 root 用户下使用(`sudo` 是不够的) + +``` +$ sudo mount | grep tracefs +none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) +``` + +要想使用 `ftrace`,你首先需要进入上面 `mount` 命令中找到的特定目录中,在那个目录下运行文章中的其他命令。 + +``` +`$ cd /sys/kernel/tracing` +``` + +### 一般的工作流程 + +首先,你需要理解捕捉踪迹和获取输出的一般流程。如果你直接运行 `ftrace`,没有任何特定的 `ftrace-` 命令会被运行。相反的,你基本上是通过标准 Linux 命令来写入或读取一些文件。 + +通用的步骤如下: +1. 通过写入一些特定文件来启用/结束追踪 +2. 通过写入一些特定文件来设置/取消追踪时的过滤规则 +3. 读取基于第 1 和 2 步的追踪输出 +4. 清除输出的文件或缓存 +5. 缩小到特定用例(你要追踪的内核函数),重复1,2,3,4 步 + +First of all, you must understand the general workflow of capturing a trace and obtaining the output. If you're using `ftrace` directly, there isn't any special `ftrace-`specific commands to run. Instead, you basically write to some files and read from some files using standard command-line Linux utilities. + +### 可用的追踪器类型 + +有多种不同的追踪器可供你使用。之前提到,在运行任何命令前,你需要进入一个特定的目录下,因为文件在这些目录下。我在我的例子中使用相对路径(与绝对路径相反) + +你可以查看 `available_tracers` 文件内容来查看所有可用的追踪器类型。你可以可以看下面列出了几个。不需要担心有这么多。 + +``` +$ pwd +/sys/kernel/tracing + +$ sudo cat available_tracers +hwlat blk mmiotrace function_graph wakeup_dl wakeup_rt wakeup function nop +``` + +在所有输出的追踪器中,我会聚焦于下面三个特殊的:启用追踪的 `function` 和 `function_graph`,以及停止追踪的 `nop` + +### 确认当前的追踪器 + +通常情况默认的追踪器设定为 `nop`。即在特殊文件中 `current_tracer` 中的 “无操作”,这意味着追踪目前是关闭的。 + +``` +$ pwd +/sys/kernel/tracing + +$ sudo cat current_tracer +nop +``` + +### 查看追踪输出 + +在启用任何追踪功能之前,请你看一下保存追踪输出的文件。你可以用 [cat](2) 命令查看名为 `trace` 的文件的内容。 + +``` +$ sudo cat trace +# tracer: nop +# +# entries-in-buffer/entries-written: 0/0   #P:8 +# +#                                _-----=> irqs-off +#                               / _----=> need-resched +#                              | / _---=> hardirq/softirq +#                              || / _--=> preempt-depth +#                              ||| /     delay +#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION +#              | |         |   ||||      |         | +``` + +### 启用 `function` 追踪器 + +你可以通过向 `current_tracer` 文件写入 `function` 来启用第一个追踪器 `function`(文件原本内容为 `nop`,意味着追踪是关闭的)。把这个操作看成是启用追踪的一种方式。 + +``` +$ pwd +/sys/kernel/tracing + +$ sudo cat current_tracer +nop +$ echo function > current_tracer +$ +$ cat current_tracer +function +``` + +### 查看 `function` 追踪器的更新追踪输出 + +现在你已启动追踪,是时候查看输出了。如果你查看 `trace` 文件内容,你将会看到许多被连续写入的内容。我通过管道只展示了文件内容的前 20 行。根据左边输出的标题,你可以看到在某个 CPU 上运行的任务和进程 ID。根据右边输出的内容,你可以看到具体的内核函数和其副函数。中间显示了时间信息。 + +``` +$ sudo cat trace | head -20 +# tracer: function +# +# entries-in-buffer/entries-written: 409936/4276216   #P:8 +# +#                                _-----=> irqs-off +#                               / _----=> need-resched +#                              | / _---=> hardirq/softirq +#                              || / _--=> preempt-depth +#                              ||| /     delay +#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION +#              | |         |   ||||      |         | +          <idle>-0       [000] d...  2088.841739: tsc_verify_tsc_adjust <-arch_cpu_idle_enter +          <idle>-0       [000] d...  2088.841739: local_touch_nmi <-do_idle +          <idle>-0       [000] d...  2088.841740: rcu_nocb_flush_deferred_wakeup <-do_idle +          <idle>-0       [000] d...  2088.841740: tick_check_broadcast_expired <-do_idle +          <idle>-0       [000] d...  2088.841740: cpuidle_get_cpu_driver <-do_idle +          <idle>-0       [000] d...  2088.841740: cpuidle_not_available <-do_idle +          <idle>-0       [000] d...  2088.841741: cpuidle_select <-do_idle +          <idle>-0       [000] d...  2088.841741: menu_select <-do_idle +          <idle>-0       [000] d...  2088.841741: cpuidle_governor_latency_req <-menu_select +``` + +请记住当追踪打开后,这意味着追踪结果会被一直连续写入直至你关闭追踪。 + +### 关闭追踪 + +关闭追踪是简单的。你只需要在 `current_tracer` 文件中用 `nop` 替换 `function` 追踪器即可: + +``` +$ sudo cat current_tracer +function + +$ sudo echo nop > current_tracer + +$ sudo cat current_tracer +nop +``` + +### 启用 `function_graph` 追踪器 + +现在尝试第二个名为 `function_graph` 的追踪器。你可以使用和上面相同的步骤:在 `current_tracer` 文件中写入 `function_graph`: + +``` +$ sudo echo function_graph > current_tracer + +$ sudo cat current_tracer +function_graph +``` + +### `function_tracer` 追踪器的追踪输出 + +注意到目前 `trace` 文件的输出格式已经发生变化。现在,你可以看到 CPU ID 和内核函数的执行时间。接下来,一个花括号表示一个函数的开始,以及它内部调用了哪些其他函数。 + +``` +$ sudo cat trace | head -20 +# tracer: function_graph +# +# CPU  DURATION                  FUNCTION CALLS +# |     |   |                     |   |   |   | + 6)               |              n_tty_write() { + 6)               |                down_read() { + 6)               |                  __cond_resched() { + 6)   0.341 us    |                    rcu_all_qs(); + 6)   1.057 us    |                  } + 6)   1.807 us    |                } + 6)   0.402 us    |                process_echoes(); + 6)               |                add_wait_queue() { + 6)   0.391 us    |                  _raw_spin_lock_irqsave(); + 6)   0.359 us    |                  _raw_spin_unlock_irqrestore(); + 6)   1.757 us    |                } + 6)   0.350 us    |                tty_hung_up_p(); + 6)               |                mutex_lock() { + 6)               |                  __cond_resched() { + 6)   0.404 us    |                    rcu_all_qs(); + 6)   1.067 us    |                  } +``` + +### 启用追踪的设置来增加追踪的深度 + +你可以使用下面的步骤来调整追踪器以看到更深层次的函数调用。完成之后,你可以查看 `trace` 文件的内容并发现输出变得更加详细了。为了文章的可读性,这个例子的输出被省略了: + +``` +$ sudo cat max_graph_depth +0 +$ sudo echo 1 > max_graph_depth +$ # or +$ sudo echo 2 > max_graph_depth + +$ sudo cat trace +``` + +### 查找要追踪的函数 + +上面的步骤足以让你开始追踪。但是它产生的输出内容是巨大的,当你想试图找到自己感兴趣的内容时,往往会很困难。通常你更希望能够之追踪特定的函数,而忽略其他函数。但如果你不知道它们确切的名称,你怎么知道要追踪哪些进程?有一个文件可以帮助你解决这个问题 —— `available_filter_functions` 文件提供了一个可供追踪的函数列表。 + +``` +$ sudo wc -l available_filter_functions   +63165 available_filter_functions +``` + +### 查找一般的内核函数 + +现在试着搜索一个你所知道的简单内核函数。用户空间有 `malloc` 函数用来分配内存,而内核有 `kmalloc` 函数,它提供类似的功能。下面是所有与 `kmalloc` 相关的函数。 + +``` +$ sudo grep kmalloc available_filter_functions +debug_kmalloc +mempool_kmalloc +kmalloc_slab +kmalloc_order +kmalloc_order_trace +kmalloc_fix_flags +kmalloc_large_node +__kmalloc +__kmalloc_track_caller +__kmalloc_node +__kmalloc_node_track_caller +[...] +``` + +### 查找内核模块或者驱动相关函数 + +在 `available_filter_functions` 文件的输出中,你可以看到一些以括号内文字结尾的行,例如下面的例子中的 `[kvm_intel]`。这些函数与当前加载的内核模块 `kvm_intel` 有关。你可以运行 `lsmod` 命令来验证。 + +``` +$ sudo grep kvm available_filter_functions | tail +__pi_post_block [kvm_intel] +vmx_vcpu_pi_load [kvm_intel] +vmx_vcpu_pi_put [kvm_intel] +pi_pre_block [kvm_intel] +pi_post_block [kvm_intel] +pi_wakeup_handler [kvm_intel] +pi_has_pending_interrupt [kvm_intel] +pi_update_irte [kvm_intel] +vmx_dump_dtsel [kvm_intel] +vmx_dump_sel [kvm_intel] + +$ lsmod  | grep -i kvm +kvm_intel             335872  0 +kvm                   987136  1 kvm_intel +irqbypass              16384  1 kvm +``` + +### 仅追踪特定的函数 + +为了实现对特定函数或模式的追踪,你可以利用 `set_ftrace_filter` 文件来指定你要追踪上述输出中的哪些函数。这个文件也接受 `*` 模式,它可以扩展到包括具有给定模式的其他函数。作为一个例子,我在我的机器上使用ext4文件系统。我可以用下面的命令指定ext4的特定内核函数来追踪。 + +``` +$ sudo mount | grep home +/dev/mapper/fedora-home on /home type ext4 (rw,relatime,seclabel) + +$ pwd +/sys/kernel/tracing + +$ sudo cat set_ftrace_filter +#### all functions enabled #### +$ +$ echo ext4_* > set_ftrace_filter +$ +$ cat set_ftrace_filter +ext4_has_free_clusters +ext4_validate_block_bitmap +ext4_get_group_number +ext4_get_group_no_and_offset +ext4_get_group_desc +[...] +``` + +现在当你可以看到追踪输出时,你只能看到与内核函数有关的 `ext4` 函数,而你之前已经为其设置了一个过滤器。所有其他的输出都被忽略了。 + +``` +$ sudo cat trace |head -20 +# tracer: function +# +# entries-in-buffer/entries-written: 3871/3871   #P:8 +# +#                                _-----=> irqs-off +#                               / _----=> need-resched +#                              | / _---=> hardirq/softirq +#                              || / _--=> preempt-depth +#                              ||| /     delay +#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION +#              | |         |   ||||      |         | +           cupsd-1066    [004] ....  3308.989545: ext4_file_getattr <-vfs_fstat +           cupsd-1066    [004] ....  3308.989547: ext4_getattr <-ext4_file_getattr +           cupsd-1066    [004] ....  3308.989552: ext4_file_getattr <-vfs_fstat +           cupsd-1066    [004] ....  3308.989553: ext4_getattr <-ext4_file_getattr +           cupsd-1066    [004] ....  3308.990097: ext4_file_open <-do_dentry_open +           cupsd-1066    [004] ....  3308.990111: ext4_file_getattr <-vfs_fstat +           cupsd-1066    [004] ....  3308.990111: ext4_getattr <-ext4_file_getattr +           cupsd-1066    [004] ....  3308.990122: ext4_llseek <-ksys_lseek +           cupsd-1066    [004] ....  3308.990130: ext4_file_read_iter <-new_sync_read +``` + +### 排除要被追踪的函数 + +你并不总是知道你想追踪什么,但是,你肯定知道你不想追踪什么。因此,有一个 `set_ftrace_notrace` —— 请注意其中的 "no"。你可以在这个文件中写下你想要的模式,并启用追踪。这样除了所提到的模式外,任何其他东西都会被追踪到。这通常有助于删除那些使我们的输出变得混乱的普通功能。 + +``` +$ sudo cat set_ftrace_notrace +#### no functions disabled #### +``` + +### 具有目标性的追踪 + +到目前为止,你一直在追踪内核中发生的一切。但是,他无法帮助你追踪与某个特定命令有关的事件。为了达到这个目的,你可以按需打开和关闭跟踪,并且在它们之间,运行我们选择的命令,这样你就不会在跟踪输出中得到额外的输出。你可以通过向 `tracing_on` 写入 `1` 来启用跟踪,写 `0` 来关闭跟踪。 + +``` +$ sudo cat tracing_on +0 + +$ sudo echo 1 > tracing_on +$ sudo cat tracing_on +1 + +$ # Run some specific command that we wish to trace here + +$ sudo echo 0 > tracing_on + +$ cat tracing_on +0 +``` + +### 追踪特定的 PID + +如果你想追踪与正在运行的特定进程有关的活动,你可以将该 PID 写入一个名为 `set_ftrace_pid` 的文件,然后启用追踪。这样一来,追踪就只限于这个PID,这在某些情况下是非常有帮助的。 + +``` +`$ sudo echo $PID > set_ftrace_pid` +``` + +### 总结 + +`ftrace` 是一个了解 Linux 内核内部工作的很好方式。通过一些练习,你可以学会对 `ftrace` 进行调整以缩小搜索范围。要想更详细地了解 `ftrace` 和它的高级用法,请看 `ftrace` 的核心作者 Steven Rostedt 写的这些优秀文章。 + + * [调试 Linux 内核,第一部分](3) + * [调试 Linux 内核,第二部分](4) + * [调试 Linux 内核,第三部分](5) + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/linux-kernel-ftrace + +作者:[Gaurav Kamathe][a] +选题:[lujun9972][b] +译者:[萌新阿岩](https://github.com/mengxinayan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/article/19/2/getting-started-cat-command +[3]: https://lwn.net/Articles/365835/ +[4]: https://lwn.net/Articles/366796/ +[5]: https://lwn.net/Articles/370423/ From b479f93a342f04d6932b20c98a7f91a412f239b7 Mon Sep 17 00:00:00 2001 From: Chunibyo Date: Sun, 29 Aug 2021 15:31:46 +0800 Subject: [PATCH 036/138] =?UTF-8?q?=E5=AE=8C=E7=A8=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...loy a deep learning model on Kubernetes.md | 126 +++++++++--------- 1 file changed, 64 insertions(+), 62 deletions(-) diff --git a/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md b/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md index 2fb0199735..7ba8b0b184 100644 --- a/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md +++ b/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md @@ -7,40 +7,40 @@ [#]: via: (https://opensource.com/article/20/9/deep-learning-model-kubernetes) [#]: author: (Chaimaa Zyani https://opensource.com/users/chaimaa) -Deploy a deep learning model on Kubernetes +在 Kubernetes 上部署一个深度学习模型 ====== -Learn how to deploy, scale, and manage a deep learning model that serves -up image recognition predictions with Kubermatic Kubernetes Platform. +了解如何使用 Kubermatic Kubernetes 平台部署、缩放与管理图像识别深度学习模型。 + ![Brain on a computer screen][1] -As enterprises increase their use of artificial intelligence (AI), machine learning (ML), and deep learning (DL), a critical question arises: How can they scale and industrialize ML development? These conversations often focus on the ML model; however, this is only one step along the way to a complete solution. To achieve in-production application and scale, model development must include a repeatable process that accounts for the critical activities that precede and follow development, including getting the model into a public-facing deployment. +随着企业增加了对人工智能(AI)、机器学习(ML)与深度学习(DL)的使用,出现了一个关键问题:如何将机器学习的发展进行规模化与产业化?这些讨论经常聚焦于机器学习模型本身;然而,模型仅仅只是完整解决方案的其中一环。为了达到生产环境的应用和规模,模型的开发过程必须还包括一个可以说明开发前后关键活动以及可公用部署的可重复过程。 -This article demonstrates how to deploy, scale, and manage a deep learning model that serves up image recognition predictions using [Kubermatic Kubernetes Platform][2]. +本文演示了如何使用[Kubermatic Kubernetes Platform][2]对图像识别预测的深度学习模型进行部署,缩放与管理。 -Kubermatic Kubernetes Platform is a production-grade, open source Kubernetes cluster-management tool that offers flexibility and automation to integrate with ML/DL workflows with full cluster lifecycle management. +Kubermatic Kubernetes 平台是一个可以与机器学习/深度学习工作流结合进行完整集群生命周期管理的一个自动且灵活的开源生产级 Kubernetes 集群管理工具。 -### Get started +### 开始 -This example deploys a deep learning model for image recognition. It uses the [CIFAR-10][3] dataset that consists of 60,000 32x32 color images in 10 classes with the [Gluon][4] library in [Apache MXNet][5] and NVIDIA GPUs to accelerate the workload. If you want to use a pre-trained model on the CIFAR-10 dataset, check out the [getting started guide][6]. +这个例子部署了一个图像识别的深度学习模型。它使用了包含 60,000 张分属 10 个类别的 32x32 彩色图 [CIFAR-10][3] 像数据集,同时使用了 [Apache MXNet][5] 的 [Gluon][4] 与 NVIDIA GPUs 进行加速计算。如果你希望使用 CIFAR-10 数据集的预训练模型,可以查阅 [getting started guide][6]。 -The model was trained over a span of 200 epochs, as long as the validation error kept decreasing slowly without causing the model to overfit. This plot shows the training process: +使用训练集中的样本对模型训练 200 次,只要训练误差保持缓慢减少,就可以保证模型不会过拟合。下方图展示了训练的过程: -![Deep learning model training plot][7] +![深度学习模型训练 loss 图][7] (Chaimaa Zyami, [CC BY-SA 4.0][8]) -After training, it's essential to save the model's parameters so they can be loaded later: +训练结束后,必须保存模型训练所得到的参数,以便稍后可以加载它们: -``` +```python file_name = "net.params" net.save_parameters(file_name) ``` -Once the model is ready, wrap your prediction code in a Flask server. This allows the server to accept an image as an argument to its request and return the model's prediction in the response: +一旦你的模型训练好了,就可以用 Flask 服务器来封装它。下方的程序演示了如何接收 request 中的一张图片作为参数并且在 response 中返回模型的预测结果: -``` +```python from gluoncv.model_zoo import get_model import matplotlib.pyplot as plt from mxnet import gluon, nd, image @@ -76,12 +76,12 @@ if __name__ == '__main__':    app.run(host='0.0.0.0') ``` -### Containerize the model +### 容器化模型 -Before you can deploy your model to Kubernetes, you need to install Docker and create a container image with your model. - - 1. Download, install, and start Docker: [code] +在将模型部署到 Kubernetes 前,你需要先安装 Docker 并使用你的模型创建一个镜像。 + 1. 下载、安装并启动 Docker: +```bash sudo yum install -y yum-utils device-mapper-persistent-data lvm2 sudo yum-config-manager --add-repo @@ -91,14 +91,14 @@ sudo yum install docker-ce sudo systemctl start docker ``` - 2. Create a directory where you can organize your code and dependencies: [code] - + 2. 创建一个你用来管理代码与依赖的文件夹: +```bash mkdir kubermatic-dl cd kubermatic-dl ``` - 3. Create a `requirements.txt` file to contain the packages the code needs to run: [code] - + 3. 创建 `requirements.txt` 文件管理代码运行时需要的所有依赖: +``` flask gluoncv matplotlib @@ -107,75 +107,76 @@ requests Pillow ``` - 4. Create the Dockerfile that Docker will read to build and run the model: [code] - + 4. 创建 Dockerfile,Docker 将根据这个文件创建镜像: +``` FROM python:3.6 WORKDIR /app COPY requirements.txt /app RUN pip install -r ./requirements.txt COPY app.py /app -CMD ["python", "app.py"]~ - -[/code] This Dockerfile can be broken down into three steps. First, it creates the Dockerfile and instructs Docker to download a base image of Python 3. Next, it asks Docker to use the Python package manager `pip` to install the packages in `requirements.txt`. Finally, it tells Docker to run your script via `python app.py`. - - 5. Build the Docker container: [code]`sudo docker build -t kubermatic-dl:latest .`[/code] This instructs Docker to build a container for the code in your current working directory, `kubermatic-dl`. - - 6. Check that your container is working by running it on your local machine: [code]`sudo docker run -d -p 5000:5000 kubermatic-dl` +CMD ["python", "app.py"] ``` - 7. Check the status of your container by running `sudo docker ps -a`: +这个 Dockerfile 主要可以分为三个部分。首先,Docker 会下载 Python 的基础镜像。然后,Docker 会使用 Python 的包管理工具 `pip` 安装 `requirements.txt` 记录的包。最后,Docker 会通过执行 `python app.py` 来运行你的脚本。 -![Checking the container's status][9] + + 1. 构建 Docker 容器: `sudo docker build -t kubermatic-dl:latest .` 这条命令使用 `kubermatic-dl` 镜像为你当前工作目录的代码创建了一个容器。 + + 2. 使用 `sudo docker run -d -p 5000:5000 kubermatic-dl` 命令检查你的容器可以在你的主机上正常运行。 + + 3. 使用 `sudo docker ps -a` 命令查看你本地容器的运行状态: + +![查看容器的运行状态][9] (Chaimaa Zyami, [CC BY-SA 4.0][8]) -### Upload the model to Docker Hub +### 将你的模型上传到 Docker Hub -Before you can deploy the model on Kubernetes, it must be publicly available. Do that by adding it to [Docker Hub][10]. (You will need to create a Docker Hub account if you don't have one.) +在向 Kubernetes 上部署模型前,你的镜像首先需要是公开可用的。你可以通过将你的模型上传到 [Docker Hub][10] 来将它公开。(如果你没有 Docker Hub 的账号,你需要先创建一个) - 1. Log into your Docker Hub account: [code]`sudo docker login` -``` - 2. Tag the image so you can refer to it for versioning when you upload it to Docker Hub: [code] + 1. 在终端中登录 Docker Hub 账号:`sudo docker login` + 2. 给你的镜像打上 tag ,这样你的模型上传到 Docker Hub 后也能拥有版本信息 +```bash sudo docker tag <your-image-id> <your-docker-hub-name>/<your-app-name> sudo docker push <your-docker-hub-name>/<your-app-name> ``` -![Tagging the image][11] +![给镜像打上 tag][11] (Chaimaa Zyami, [CC BY-SA 4.0][8]) - 3. Check your image ID by running `sudo docker images`. + 3. 使用 `sudo docker images` 命令检查你的镜像的 ID。 -### Deploy the model to a Kubernetes cluster +### 部署你的模型到 Kubernetes 集群 - 1. Create a project on the Kubermatic Kubernetes Platform, then create a Kubernetes cluster using the [quick start tutorial][12]. + 1. 首先在 Kubermatic Kubernetes 平台创建一个项目, 然后根据 [快速开始][12] 创建一个 Kubernetes 集群。 -![Create a Kubernetes cluster][13] +![创建一个 Kubernetes 集群][13] (Chaimaa Zyami, [CC BY-SA 4.0][8]) - 2. Download the `kubeconfig` used to configure access to your cluster, change it into the download directory, and export it into your environment: + 2. 下载用于访问你的集群的 `kubeconfig`,将它放置在下载目录中,并记得设置合适的环境变量,使得你的环境能找到它: -![Kubernetes cluster example][14] +![Kubernetes 集群示例][14] (Chaimaa Zyami, [CC BY-SA 4.0][8]) - 3. Using `kubectl`, check the cluster information, such as the services that `kube-system` starts on your cluster: [code]`kubectl cluster-info` -``` -![Checking the cluster info][15] + 3. 使用 `kubectl` 命令检查集群信息,例如,需要检查 `kube-system` 是否在你的集群正常启动了就可以使用命令 `kubectl cluster-info` + +![查看集群信息][15] (Chaimaa Zyami, [CC BY-SA 4.0][8]) - 4. To run the container in the cluster, you need to create a deployment (`deployment.yaml`) and apply it to the cluster: [code] - + 4. 为了在集群中运行容器,你需要创建一个部署用的配置文件(`deployment.yaml`),再运行 `apply` 命令将其应用于集群中: +```yaml apiVersion: apps/v1 kind: Deployment metadata: @@ -197,38 +198,39 @@ spec:        ports:        - containerPort: 8080 -[/code] [code]`kubectl apply -f deployment.yaml` +``` `kubectl apply -f deployment.yaml` ``` - 5. To expose your deployment to the outside world, you need a service object that will create an externally reachable IP for your container: [code]`kubectl expose deployment kubermatic-dl-deployment  --type=LoadBalancer --port 80 --target-port 5000` -``` -6. You're almost there! Check your services to determine the status of your deployment and get the IP address to call your image recognition API: [code]`kubectl get service` -``` + 5. 为了将你的部署开放到公网环境,你需要一个能够给你的容器创建外部可达 IP 地址的服务:`kubectl expose deployment kubermatic-dl-deployment  --type=LoadBalancer --port 80 --target-port 5000` -![Get the IP address to call your image recognition API][16] + 6. 就快大功告成了!首先检查你布署的服务的状态,然后通过 IP 请求的你图像识别 API:`kubectl get service` + + +![获取请求图像识别 API 的 IP 地址][16] (Chaimaa Zyami, [CC BY-SA 4.0][8]) - 7. Test your API with these two images using the external IP: + 7. 最后根据你的外部 IP 使用以下两张图片对你的图像识别服务进行测试: -![Horse][17] +![马][17] (Chaimaa Zyami, [CC BY-SA 4.0][8]) -![Dog][18] +![狗][18] (Chaimaa Zyami, [CC BY-SA 4.0][8]) -![Testing the API][19] +![测试 API][19] (Chaimaa Zyami, [CC BY-SA 4.0][8]) -### Summary +### 总结 -In this tutorial, you created a deep learning model to be served as a [REST API][20] using Flask. It put the application inside a Docker container, uploaded the container to Docker Hub, and deployed it with Kubernetes. Then, with just a few commands, Kubermatic Kubernetes Platform deployed the app and exposed it to the world. + +在这篇教程中,你可以创建一个深度学习模型,并且使用 Flask 提供 [REST API][20] 服务。它介绍了如何将应用放在 Docker 容器中,如何将这个镜像上传到 Docker Hub 中,以及如何使用 Kubernetes 部署你的服务。只需几个简单的命令,你就可以使用 Kubermatic Kubernetes 平台部署该应用程序,并且开放服务给别人使用。 -------------------------------------------------------------------------------- From a619ed357a74e54758279a5ac63b583208054961 Mon Sep 17 00:00:00 2001 From: Chunibyo Date: Sun, 29 Aug 2021 15:35:51 +0800 Subject: [PATCH 037/138] change position --- .../tech/20200908 Deploy a deep learning model on Kubernetes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {sources => translated}/tech/20200908 Deploy a deep learning model on Kubernetes.md (99%) diff --git a/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md b/translated/tech/20200908 Deploy a deep learning model on Kubernetes.md similarity index 99% rename from sources/tech/20200908 Deploy a deep learning model on Kubernetes.md rename to translated/tech/20200908 Deploy a deep learning model on Kubernetes.md index 7ba8b0b184..5a83fe466b 100644 --- a/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md +++ b/translated/tech/20200908 Deploy a deep learning model on Kubernetes.md @@ -238,7 +238,7 @@ via: https://opensource.com/article/20/9/deep-learning-model-kubernetes 作者:[Chaimaa Zyani][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/chunibyo-wly) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 310614d81c092e6ea5aade47b76210c9a6f36fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Sun, 29 Aug 2021 15:44:24 +0800 Subject: [PATCH 038/138] Apply translation File name: 20210728 Kernel tracing with trace-cmd.md --- sources/tech/20210728 Kernel tracing with trace-cmd.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210728 Kernel tracing with trace-cmd.md b/sources/tech/20210728 Kernel tracing with trace-cmd.md index edcd7a9564..cd5b549e40 100644 --- a/sources/tech/20210728 Kernel tracing with trace-cmd.md +++ b/sources/tech/20210728 Kernel tracing with trace-cmd.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/linux-kernel-trace-cmd) [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mengxinayan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -364,7 +364,7 @@ via: https://opensource.com/article/21/7/linux-kernel-trace-cmd 作者:[Gaurav Kamathe][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[萌新阿岩](https://github.com/mengxinayan) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d41af9615df0898c3c73c29adee0f09717bae77e Mon Sep 17 00:00:00 2001 From: New-World-2019 Date: Sun, 29 Aug 2021 18:25:38 +0800 Subject: [PATCH 039/138] translating --- ...20210820 Check file status on Linux with the stat command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210820 Check file status on Linux with the stat command.md b/sources/tech/20210820 Check file status on Linux with the stat command.md index 09c762666a..552bc004bc 100644 --- a/sources/tech/20210820 Check file status on Linux with the stat command.md +++ b/sources/tech/20210820 Check file status on Linux with the stat command.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/linux-stat-file-status" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "New-World-2019" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 16a720de9935ee95ffed2f8073b7daeaf554a9e6 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Sun, 29 Aug 2021 20:03:17 +0800 Subject: [PATCH 040/138] translated by perfiffer --- ...he Difference- Which One Should You Use.md | 182 ------------------ ...he Difference- Which One Should You Use.md | 182 ++++++++++++++++++ 2 files changed, 182 insertions(+), 182 deletions(-) delete mode 100644 sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md create mode 100644 translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md diff --git a/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md b/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md deleted file mode 100644 index fc9247ab41..0000000000 --- a/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md +++ /dev/null @@ -1,182 +0,0 @@ -[#]: subject: "Debian vs Ubuntu: What’s the Difference? Which One Should You Use?" -[#]: via: "https://itsfoss.com/debian-vs-ubuntu/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: "perfiffer" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Debian vs Ubuntu: What’s the Difference? Which One Should You Use? -====== - -You can [use apt-get commands][1] for managing applications in both Debian and Ubuntu. You can install DEB packages in both distributions as well. Many times, you’ll find common package installation instructions for both distributions. - -So, what’s the difference between the two, if they are so similar? - -Debian and Ubuntu belong to the same side of the distribution spectrum. Debian is the original distribution created by Ian Murdock in 1993. Ubuntu was created in 2004 by Mark Shuttleworth and it is based on Debian. - -### Ubuntu is based on Debian: What does it mean? - -While there are hundreds of Linux distributions, only a handful of them are independent ones, created from scratch. [Debian][2], Arch, Red Hat are some of the biggest distributions that do not derive from any other distribution. - -Ubuntu is derived from Debian. It means that Ubuntu uses the same APT packaging system as Debian and shares a huge number of packages and libraries from Debian repositories. It utilizes the Debian infrastructure as base. - -![Ubuntu uses Debian as base][3] - -That’s what most ‘derived’ distributions do. They use the same package management system and share packages as the base distribution. But they also add some packages and changes of their own. And that is how Ubuntu is different from Debian despite being derived from it. - -### Difference between Ubuntu and Debian - -So, Ubuntu is built on Debian architecture and infrastructure and uses .DEB packages same as Debian. - -Does it mean using Ubuntu is the same as using Debian? Not quite so. There are many more factors involved that distinguish one distribution from the other. - -Let me discuss these factors one by one to compare Ubuntu and Debian. Please keep in mind that some comparisons are applicable to desktop editions while some apply to the server editions. - -![][4] - -#### 1\. Release cycle - -Ubuntu has two kinds of releases: LTS and regular. [Ubuntu LTS (long term support) release][5] comes out every two years and they get support for five years. You have the option to upgrade to the next available LTS release. The LTS releases are considered more stable. - -There are also non-LTS releases, every six months. These releases are supported for nine months only, but they have newer software versions and features. You have to upgrade to the next Ubuntu versions when the current on reaches end of life. - -So basically, you have the option to choose between stability and new features based on these releases. - -On the other hand, Debian has three different releases: Stable, Testing and Unstable. Unstable is for actual testing and should be avoided. - -The testing branch is not that unstable. It is used for preparing the next stable branch. Some Debian users prefer the testing branch to get newer features. - -And then comes the stable branch. This is the main Debian release. It may not have the latest software and feature but when it comes to stability, Debian Stable is rock solid. - -There is a new stable release every two years and it is supported for a total of three years. After that, you have to upgrade to the next available stable release. - -#### 2\. Software freshness - -![][6] - -Debian’s focus on stability means that it does not always aim for the latest versions of the software. For example, the latest Debian 11 features GNOME 3.38, not the latest GNOME 3.40. - -The same goes for other software like GIMP, LibreOffice, etc. This is a compromise you have to make with Debian. This is why “Debian stable = Debian stale” joke is popular in the Linux community. - -Ubuntu LTS releases also focus on stability. But they usually have more recent versions of the popular software. - -You should note that for _some software_, installing from developer’s repository is also an option. For example, if you want the latest Docker version, you can add Docker repository in both Debian and Ubuntu. - -Overall, software in Debian Stable often have older versions when compared to Ubuntu. - -#### 3\. Software availability - -Both Debian and Ubuntu has a huge repository of software. However, [Ubuntu also has PPA][7] (Personal Package Archive). With PPA, installing newer software or getting the latest software version becomes a bit more easy. - -![][8] - -You may try using PPA in Debian but it won’t be a smooth experience. You’ll encounter issues most of the time. - -#### 4\. Supported platforms - -Ubuntu is available on 64-bit x86 and ARM platforms. It does not provide 32-bit ISO anymore. - -Debian, on the other hand, supports both 32 bit and 64 bit architecture. Apart from that Debian also supports 64-bit ARM (arm64), ARM EABI (armel), ARMv7 (EABI hard-float ABI, armhf), little-endian MIPS (mipsel), 64-bit little-endian MIPS (mips64el), 64-bit little-endian PowerPC (ppc64el) and IBM System z (s390x). - -No wonder it is called the ‘universal operating system’. - -#### 5\. Installation - -[Installing Ubuntu][9] is a lot easier than installing Debian. I am not kidding. Debian could be confusing even for intermediate Linux user. - -When you download Debian, it provides a minimal ISO by default. This ISO has no non-free (not open source) firmware. You go on to install it and realize that your network adapters and other hardware won’t be recognized. - -There is a separate non-free ISO that contains firmware but it is hidden and if you do not know that, you are in for a bad surprise. - -![Getting non-free firmware is a pain in Debian][10] - -Ubuntu is a lot more forgiving when it comes to including proprietary drivers and firmware in the default ISO. - -Also, the Debian installer looks old whereas Ubuntu installer is modern looking. Ubuntu installer also recognizes other installed operating systems on the disk and gives you the option to install Ubuntu alongside the existing ones (dual boot). I have not noticed it with Debian installer in my testing. - -![Installing Ubuntu is smoother][11] - -#### 6\. Out of the box hardware support - -As mentioned earlier, Debian focuses primarily on [FOSS][12] (free and open source software). This means that the kernel provided by Debian does not include proprietary drivers and firmware. - -It’s not that you cannot make it work but you’ll have to do add/enable additional repositories and install it manually. This could be discouraging, specially for the beginners. - -Ubuntu is not perfect but it is a lot better than Debian for providing drivers and firmware out of the box. This means less hassle and a more complete out-of-the-box experience. - -#### 7\. Desktop environment choices - -Ubuntu uses a customized GNOME desktop environment by default. You may install [other desktop environments][13] on top of it or opt for [various desktop based Ubuntu flavors][14] like Kubuntu (for KDE), Xubuntu (for Xfce) etc. - -Debian also installs GNOME by default. But its installer gives you choice to install desktop environment of your choice during the installation process. - -![][15] - -You may also get [DE specific ISO images from its website][16]. - -#### 8\. Gaming - -Gaming on Linux has improved in general thanks to Steam and its Proton project. Still, gaming depends a lot on hardware. - -And when it comes to hardware compatibility, Ubuntu is better than Debian for supporting proprietary drivers. - -Not that it cannot be done in Debian but it will require some time and effort to achieve that. - -#### 9\. Performance - -There is no clear ‘winner’ in the performance section, whether it is on the server or on the desktop. Both Debian and Ubuntu are popular as desktop as well as server operating systems. - -The performance depends on your system’s hardware and the software component you use. You can tweak and control your system in both operating systems. - -#### 10\. Community and support - -Debian is a true community project. Everything about this project is governed by its community members. - -Ubuntu is backed by [Canonical][17]. However, it is not entirely a corporate project. It does have a community but the final decision on any matter is in Canonical’s hands. - -As far the support goes, both Ubuntu and Debian have dedicated forums where users can seek help and advice. - -Canonical also offers professional support for a fee to its enterprise clients. Debian has no such features. - -### Conclusion - -Both Debian and Ubuntu are solid choices for desktop or server operating systems. The apt package manager and DEB packaging is common to both and thus giving a somewhat similar experience. - -However, Debian still needs a certain level of expertise, specially on the desktop front. If you are new to Linux, sticking with Ubuntu will be a better choice for you. In my opinion, you should gain some experience, get familiar with Linux in general and then try your hands on Debian. - -It’s not that you cannot jump onto the Debian wagon from the start, but it is more likely to be an overwhelming experience for Linux beginners. - -**Your opinion on this Debian vs Ubuntu debate is welcome.** - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/debian-vs-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/apt-get-linux-guide/ -[2]: https://www.debian.org/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-ubuntu-upstream.png?resize=800%2C400&ssl=1 -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-vs-ubuntu.png?resize=800%2C450&ssl=1 -[5]: https://itsfoss.com/long-term-support-lts/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/apt-cache-policy.png?resize=795%2C456&ssl=1 -[7]: https://itsfoss.com/ppa-guide/ -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/ffmpeg_add_ppa.jpg?resize=800%2C222&ssl=1 -[9]: https://itsfoss.com/install-ubuntu/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-firmware.png?resize=800%2C600&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/choose-something-else-installing-ubuntu.png?resize=800%2C491&ssl=1 -[12]: https://itsfoss.com/what-is-foss/ -[13]: https://itsfoss.com/best-linux-desktop-environments/ -[14]: https://itsfoss.com/which-ubuntu-install/ -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-install-desktop-environment.png?resize=640%2C479&ssl=1 -[16]: https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/ -[17]: https://canonical.com/ diff --git a/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md b/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md new file mode 100644 index 0000000000..af1de88002 --- /dev/null +++ b/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md @@ -0,0 +1,182 @@ +[#]: subject: "Debian vs Ubuntu: What’s the Difference? Which One Should You Use?" +[#]: via: "https://itsfoss.com/debian-vs-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "perfiffer" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Debian 和 Ubuntu:有什么不同?应该选择哪一个? +====== + +在 Debian 和 Ubuntu 系统中,你都可以 [使用 apt-get 命令][1] 来管理应用。你也可以在这两个发型版中安装 DEB 安装包。很多时候,你会在这两个发行版中发现同样的包安装介绍。 + +它们两者是如此的相似,那么,它们两者之间有什么区别呢? + +Debian 和 Ubuntu 属于同一系列的发行版。Debain 是由Ian Murdock 在 1993 年创建的最初的发行版。Ubuntu 是 Mark Shuttleworth 在 2004 年基于 Debian 创建的发行版。 + +### Ubuntu 基于 Debian:这意味着什么? + +Linux 发行版虽然有数百个,但其中只有少数是从零开始的独立发行版。 [Debian][2],Arch,Red Hat 是其中几个不派生于其它发行版的使用最广的发行版。 + +Ubuntu 源自 Debian。这意味着 Ubuntu 使用与 Debian 相同的 `APT` 包管理系统,并共享 Debian 库中的大量包和库。它建立在 Debian 基础架构上。 + +![Ubuntu uses Debian as base][3] + +这就是大多数“衍生”发行版所做的。它们使用相同的包管理器,并将包共享为基本发行版。但他们也做了一些改变,添加了一些自己的包。这就是 Ubuntu 和 Debian 的不同之处,尽管它是从 Debian 衍生而来的。 + +### Ubuntu 和 Debian 的不同之处 + +因此,Ubuntu 构建在 Debian 架构和基础设施上,也与 Debian 一样是用 `.DEB` 格式的软件包。 + +这意味着使用 Ubuntu 和使用 Debian 是一样的吗?并不完全如此。有很多因素可以用来区分两个不同的发行版。 + +让我逐一讨论这些因素来比较 Ubuntu 和 Debian。请记住,有些比较适用于桌面版本,而有些比较适用于服务器版本。 + +![][4] + +#### 1\. 发布周期 + +Ubuntu 有两种发布版本:LTS 和 regular。[Ubuntu LTS (长期支持) 版本][5] 每两年发布一次,并且会提供五年的支持。你可以选择升级到下一个可用的 LTS 版本。LTS 版本更稳定。 + +还有一个非 LTS 版本,每六个月发布一次。这些版本仅仅提供九个月的支持,但是它们会有一些新的软件版本和功能。当当前的版本已经不在维护了,你必须升级到下一个 Ubuntu 版本。 + +所以基本上,你可以根据这些版本在稳定性和新特性之间进行选择。 + +另一方面,Debian 有三个不同的版本:稳定版、测试版和非稳定版 。非稳定版是为了实际测试,应该避免使用。 + +测试版并不是非稳定版。它是用来为下一个稳定版做准备。有一些 Debian 用户更倾向于使用测试版来获取新的特性。 + +然后是稳定版。这是 Debian 的主要版本。Debian 稳定版可能没有最新的软件和功能,但在稳定性方面毋庸置疑。 + +每两年 Debian 会发布一个稳定版,并且会提供三年的支持。此后,你必须升级到下一个可用的稳定版。 + +#### 2\. 软件更新 + +![][6] + +Debian 更关注稳定性,这意味着它并不总是使用最新版本的软件。例如,最新的 Debian 11 用的 GNOME 版本为 3.38,并不是最新版的 GNOME 3.40。 + +对于 GIMP、LibreOffice 等其它软件也是如此。这是你必须对 Debian 做出的妥协。这就是“Debian stable = Debian stale”笑话在 Linux 社区流行的原因。 + +Ubuntu LTS 版本也关注稳定性。但是它们通常拥有较新版本的常见软件。 + +你应该注意,对于某些软件,从开发人员仓库安装也是一种选择。例如,如果你想要安装最新版的 Docker,你可以在 Debian 和 Ubuntu 中添加 Docker 仓库。 + +总体来说,相比较于 Ubuntu ,Debian 稳定版的软件版本会更旧。 + +#### 3\. 软件可用性 + +Debian 和 Ubuntu 都拥有一个巨大的软件仓库。然而,[Ubuntu 同时有PPA][7](Personal Package Archive)。通过 `PPA`,安装更新版本的软件或者获取最新版本的软件都将会变的更容易。 + +![][8] + +你可以在 Debian 中尝试使用 PPA,但是体验并不好。大多数时候你都会遇到问题。 + +#### 4\. 支持的平台 + +Ubuntu 可以在 64 位的 x86 和 ARM 平台上使用。它不再提供 32 位的镜像。 + +另一方面,Debian 支持 32 位和 64 位架构。除此之外,Debian 还支持 64 位 ARM(arm64)、ARM EABI(armel)、ARMv7(EABI hard-float ABI,armhf)、little-endian MIPS(mipsel)、64 位 little-endian MIPS(mips64el)、64 位 little-endian PowerPC(ppc64el) 和 IBM System z(s390x)。 + +所以它也被称为 “通用操作系统”。 + +#### 5\. 安装 + +[安装 Ubuntu][9] 比安装 Debian 容易得多。我并不是在骗你。即使对于中级 Linux 用户,Debian 也可能令人困惑。 + +当你下载 Debian 的时候,它默认提供的是最小化镜像。 此镜像没有非免费(非开源)固件。如果你继续安装它,你就可能会发现你的网络适配器和其它硬件将无法识别。 + +有一个单独的非免费镜像包含固件,但它是隐藏的,如果你不知道,你可能会大吃一惊。 + +![Getting non-free firmware is a pain in Debian][10] + +Ubuntu 在默认提供的镜像中包含专有驱动程序和固件时要宽容的多。 + +此外,Debian 安装程序看起来很旧,而 Ubuntu 安装程序看起来就比较现代化。Ubuntu 安装程序还可以识别磁盘上其它已安装的操作系统,并为你提供将 Ubuntu 与现有操作系统一起安装的选项(双引导)。但我在测试时并没有注意到 Debian 有此选项。 + +![Installing Ubuntu is smoother][11] + +#### 6\. 开箱即用的硬件支持 + +就像之前提到的,Debian 主要关注 [FOSS][12](自由和开源软件)。这意味着 Debian 提供的内核不包括专有驱动程序和固件。 + +这并不是说你无法使其工作,而是你必须添加/启动其它存储库并手动安装。这可能令人沮丧,特别是对于初学者来说。 + +Ubuntu 并不完美,但在提供开箱即用的驱动程序和固件方面,它比 Debian 好得多。这意味着更少的麻烦和更完整的开箱即用体验。 + +#### 7\. 桌面环境选择 + +Ubuntu 默认使用定制的 GNOME 桌面环境。你可以在其上安装其它桌面环境,或者选择各种基于桌面的 Ubuntu 风格,如 Kubuntu(使用 KDE 桌面),Xubuntu(使用 Xfce 桌面)等。 + +Debian 也默认使用的 GNOME 桌面。但是它会让你在安装的过程中选择你要安装的桌面环境。 + +![][15] + +你还可以从其网站获取[DE 特定的 ISO 镜像][16]。 + +#### 8\. 游戏性 + +由于 Stream 及其 Proton 项目,Linux 上的游戏总体上有所改善。尽管如此,游戏在很大程度上取决于硬件。 + +在硬件兼容性上,Ubuntu 比 Debian 更好的支持专有驱动程序。 + +并不是说它在 Debian 中不能完成,而是需要一些时间和精力来实现。 + +#### 9\. 性能 + +性能部分没有明显的“赢家”,无论是在服务器版本还是在桌面版本。 Debian 和 Ubuntu 作为桌面和服务器操作系统都很受欢迎。 + +性能取决于你系统的硬件和你所使用的软件组件。你可以在你的操作系统中调整和控制你的系统。 + +#### 10\. 社区和支持 + +Debian 是社区项目。此项目的一切都由其社区成员管理。 + +Ubuntu 由 [Canonical][17] 提供支持。然而,它并不是一个真正意义上的企业项目。它确实有一个社区,但任何事情的最终决定权都掌握在 Canonical 手中。 + +就支持而言,Ubuntu 和 Debian 都有专门的论坛,用户可以在其中寻求帮助和提出建议。 + +Canonical 还为其企业客户提供收费的专业支持。 Debian 没有这样的功能。 + +### 结论 + +Debian 和 Ubuntu 都是桌面或服务器操作系统的可靠选择。 apt 包管理器和 DEB 包对两者都是通用的,因此提供了一些相似的体验。 + +然而,Debian 仍然需要一定程度的专业知识,特别是在桌面方面。如果你是 Linux 新手,坚持使用 Ubuntu 将是你更好的选择。在我看来,你应该获得一些经验,熟悉 Linux,然后尝试使用 Debian。 + +并不是说你不能从一开始就使用 Debian,但对于 Linux 初学者来说,这并不是一种很好的体验。 + +**欢迎你对这场 Debian 与 Ubuntu 辩论发表意见。** + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/debian-vs-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[校对者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/apt-get-linux-guide/ +[2]: https://www.debian.org/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-ubuntu-upstream.png?resize=800%2C400&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-vs-ubuntu.png?resize=800%2C450&ssl=1 +[5]: https://itsfoss.com/long-term-support-lts/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/apt-cache-policy.png?resize=795%2C456&ssl=1 +[7]: https://itsfoss.com/ppa-guide/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/ffmpeg_add_ppa.jpg?resize=800%2C222&ssl=1 +[9]: https://itsfoss.com/install-ubuntu/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-firmware.png?resize=800%2C600&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/choose-something-else-installing-ubuntu.png?resize=800%2C491&ssl=1 +[12]: https://itsfoss.com/what-is-foss/ +[13]: https://itsfoss.com/best-linux-desktop-environments/ +[14]: https://itsfoss.com/which-ubuntu-install/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-install-desktop-environment.png?resize=640%2C479&ssl=1 +[16]: https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/ +[17]: https://canonical.com/ From 57a9451d801cadd31e61335c8ce60b23d1297df3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 30 Aug 2021 05:03:13 +0800 Subject: [PATCH 041/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210830=20?= =?UTF-8?q?Linux=20Jargon=20Buster:=20What=20is=20sudo=20rm=20-rf=3F=20Why?= =?UTF-8?q?=20is=20it=20Dangerous=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md --- ...hat is sudo rm -rf- Why is it Dangerous.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md diff --git a/sources/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md b/sources/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md new file mode 100644 index 0000000000..c12d1e5314 --- /dev/null +++ b/sources/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md @@ -0,0 +1,143 @@ +[#]: subject: "Linux Jargon Buster: What is sudo rm -rf? Why is it Dangerous?" +[#]: via: "https://itsfoss.com/sudo-rm-rf/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Jargon Buster: What is sudo rm -rf? Why is it Dangerous? +====== + +When you are new to Linux, you’ll often come across advice to never run `sudo rm -rf /`. There are so many memes in the Linux world around `sudo rm -rf`. + +![][1] + +But it seems that there are some confusions around it. In the tutorial on [cleaning Ubuntu to make free space][2], I advised running some command that involved sudo and rm -rf. An It’s FOSS reader asked me why I am advising that if sudo rm -rf is a dangerous Linux command that should not be run. + +And thus I thought of writing this chapter of Linux jargon buster and clear the misconceptions. + +### sudo rm -rf: what does it do? + +Let’s learn things in steps. + +The rm command is used for [removing files and directories in Linux command line][3]. + +``` +[email protected]:$ rm agatha +[email protected]:$ +``` + +But some files will not be removed immediate because of read only [file permissions][4]. They have to be forced delete with the option `-f`. + +``` +[email protected]:$ rm books +rm: remove write-protected regular file 'books'? y +[email protected]:$ rm -f christie +[email protected]:$ +``` + +However, rm command cannot be used to delete directories (folders) directly. You have to use the recursive option `-r` with the rm command. + +``` +[email protected]:$ rm new_dir +rm: cannot remove 'new_dir': Is a directory +``` + +And thus ultimately, rm -rf command means recursively force delete the given directory. + +``` +[email protected]:~$ rm -r new_dir +rm: remove write-protected regular file 'new_dir/books'? ^C +[email protected]:$ rm -rf new_dir +[email protected]:$ +``` + +Here’s a screenshot of all the above commands: + +![Example explaining rm command][5] + +If you add sudo to the rm -rf command, you are deleting files with root power. That means you could delete system files owned by [root user][6]. + +### So, sudo rm -rf is a dangerous Linux command? + +Well, any command that deletes something could be dangerous if you are not sure of what you are deleting. + +Consider **rm -rf command** as a knife. Is knife a dangerous thing? Possibly. If you cut vegetables with the knife, it’s good. If you cut your fingers with the knife, it is bad, of course. + +The same goes for rm -rf command. It is not dangerous in itself. It is used for deleting files after all. But if you use it to delete important files unknowingly, then it is a problem. + +Now coming to ‘sudo rm -rf /’. + +You know that with sudo, you run a command as root, which allows you to make any changes to the system. + +/ is the symbol for the root directory. /var means the var directory under root. /var/log/apt means apt directory under log, under root. + +![Linux directory hierarchy representation][7] + +As per [Linux directory hierarchy][8], everything in a Linux file system starts at root. If you delete root, you are basically removing all the files of your system. + +And this is why it is advised to not run `sudo rm -rf /` command because you’ll wipe out your entire Linux system. + +Please note that in some cases, you could be running a command like ‘sudo rm -rf /var/log/apt’ which could be fine. Again, you have to pay attention on what you are deleting, the same as you have to pay attention on what you are cutting with a knife. + +### I play with danger: what if I run sudo rm -rf / to see what happens? + +Most Linux distributions provide a failsafe protection against accidentally deleting the root directory. + +``` +[email protected]:~$ sudo rm -rf / +[sudo] password for abhishek: +rm: it is dangerous to operate recursively on '/' +rm: use --no-preserve-root to override this failsafe +``` + +I mean it is human to make typos and if you accidentally typed “/ var/log/apt” instead of “/var/log/apt” (a space between / and var meaning that you are providing / and var directories to for deletion), you’ll be deleting the root directory. + +![Pay attention when using sudo rm -rf][9] + +That’s quite good. Your Linux system takes care of such accidents. + +Now, what if you are hell-bent on destroying your system with sudo rm -rf /? You’ll have to use It will ask you to use –no-preserve-root with it. + +No, please do not do that on your own. Let me show it to you. + +So, I have elementary OS running in a virtual machine. I run `sudo rm -rf / --no-preserve-root` and you can see the lights going out literally in the video below (around 1 minute). + +[Subscribe to our YouTube channel for more Linux videos][10] + +### Clear or still confused? + +Linux has an active community where most people try to help new users. Most people because there are some evil trolls lurking to mess with the new users. They will often suggest running rm -rf / for the simplest of the problems faced by beginners. These idiots get some sort of supremacist satisfaction I think for such evil acts. I ban them immediately from the forums and groups I administer. + +I hope this article made things clearer for you. It’s possible that you still have some confusion, specially because it involves root, file permissions and other things new users might not be familiar with. If that’s the case, please let me know your doubts in the comment section and I’ll try to clear them. + +In the end, remember. Don’t drink and root. Stay safe while running your Linux system :) + +![][11] + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/sudo-rm-rf/ + +作者:[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/2016/04/sudo-rm-rf.gif?resize=400%2C225&ssl=1 +[2]: https://itsfoss.com/free-up-space-ubuntu-linux/ +[3]: https://linuxhandbook.com/remove-files-directories/ +[4]: https://linuxhandbook.com/linux-file-permissions/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/rm-rf-command-example-800x487.png?resize=800%2C487&ssl=1 +[6]: https://itsfoss.com/root-user-ubuntu/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/linux-directory-structure.png?resize=800%2C400&ssl=1 +[8]: https://linuxhandbook.com/linux-directory-structure/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/sudo-rm-rf-example.png?resize=798%2C346&ssl=1 +[10]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/dont-drink-and-root.jpg?resize=800%2C450&ssl=1 From e4d94f6c6ac48508f9f280299a33d19c4af2492a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 30 Aug 2021 05:03:34 +0800 Subject: [PATCH 042/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210829=20?= =?UTF-8?q?Position=20text=20on=20your=20screen=20in=20Linux=20with=20ncur?= =?UTF-8?q?ses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210829 Position text on your screen in Linux with ncurses.md --- ...xt on your screen in Linux with ncurses.md | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 sources/tech/20210829 Position text on your screen in Linux with ncurses.md diff --git a/sources/tech/20210829 Position text on your screen in Linux with ncurses.md b/sources/tech/20210829 Position text on your screen in Linux with ncurses.md new file mode 100644 index 0000000000..997ce16c43 --- /dev/null +++ b/sources/tech/20210829 Position text on your screen in Linux with ncurses.md @@ -0,0 +1,138 @@ +[#]: subject: "Position text on your screen in Linux with ncurses" +[#]: via: "https://opensource.com/article/21/8/ncurses-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Position text on your screen in Linux with ncurses +====== +Use ncurses in Linux to place text at specific locations on the screen +and enable more user-friendly interfaces. +![Person using a laptop][1] + +Most Linux utilities just scroll text from the bottom of the screen. But what if you wanted to position text on the screen, such as for a game or a data display? That's where **ncurses** comes in. + +**curses** is an old Unix library that supports cursor control on a text terminal screen. The name _curses_ comes from the term _cursor control_. Years later, others wrote an improved version of **curses** to add new features, called _new curses_ or **ncurses**. You can find **ncurses** in every modern Linux distribution, although the development libraries, header files, and documentation may not be installed by default. For example, on Fedora, you will need to install the **ncurses-devel** package with this command: + + +``` +`$ sudo dnf install ncurses-devel` +``` + +### Using ncurses in a program + +To directly address the screen, you'll first need to initialize the **ncurses** library. Most programs will do that with these three lines: + + * initscr(); Initialize the screen and the **ncurses** code + * cbreak(); Disable buffering and make typed input immediately available + * noecho(); Turn off echo, so user input is not displayed to the screen + + + +These functions are defined in the **curses.h** header file, which you'll need to include in your program with: + + +``` +`#include ` +``` + +After initializing the terminal, you're free to use any of the **ncurses** functions, some of which we'll explore in a sample program. + +When you're done with **ncurses** and want to go back to regular terminal mode, use **endwin();** to reset everything. This command resets any screen colors, moves the cursor to the lower-left of the screen, and makes the cursor visible. You usually do this right before exiting the program. + +### Addressing the screen + +The first thing to know about **ncurses** is that screen coordinates are _row,col_, and start in the upper-left at 0,0. **ncurses** defines two global variables to help you identify the screen size: LINES is the number of lines on the screen, and COLS is the number of columns. The bottom-right position is LINES-1,COLS-1. + +For example, if you wanted to move the cursor to line 10 and column 30, you could use the move function with those coordinates: + + +``` +`move(10, 30);` +``` + +Any text you display after that will start at that screen location. To display a single character, use the **addch(c)** function with a single character. To display a string, use **addstr(s)** with your string. For formatted output that's similar to **printf**, use **printw(fmt, …)** with the usual options. + +Moving to a screen location and displaying text is such a common thing that **ncurses** provides a shortcut to do both at once. The **mvaddch(row, col, c)** function will display a character at screen location _row,col_. And the **mvaddstr(row, col, s)** function will display a string at that location. For a more direct example, using **mvaddstr(10, 30, "Welcome to ncurses");** in a program will display the text "Welcome to ncurses" starting at row 10 and column 30. And the line **mvaddch(0, 0, '+');** will display a single plus sign in the upper-left corner at row 0 and column 0. + +Drawing text to the terminal screen can have a performance impact on certain systems, especially on older hardware terminals. So **ncurses** lets you "stack up" a bunch of text to display to the screen, then use the **refresh()** function to make all of those changes visible to the user. + +Let's look at a simple example that pulls everything together: + + +``` +#include <curses.h> + +int +main() +{ +  initscr(); +  cbreak(); +  noecho(); + +  mvaddch(0, 0, '+'); +  mvaddch(LINES - 1, 0, '-'); +  mvaddstr(10, 30, "press any key to quit"); +  refresh(); + +  getch(); + +  endwin(); +} +``` + +The program starts by initializing the terminal, then prints a plus sign in the upper-left corner, a minus in the lower-left corner, and the text "press any key to quit" at row 10 and column 30. The program gets a single character from the keyboard using the getch() function, then uses **endwin()** to reset the terminal before the program exits completely. + +**getch()** is a useful function that you could use for many things. I often use it as a way to pause before I quit the program. And as with most **ncurses** functions, there's also a version of **getch()** called **mvgetch(row, col)** to move to screen position _row,col_ before waiting for a character. + +### Compiling with ncurses + +If you tried to compile that sample program in the usual way, such as `gcc pause.c`, you'll probably get a huge list of errors from the linker. That's because the **ncurses** library is not linked automatically by the GNU C Compiler. Instead, you'll need to load it for linking using the `-l ncurses` command-line option. + + +``` +`$ gcc -o pause pause.c -lncurses` +``` + +Running the new program will print a simple "press any key to quit" message that's more or less centered on the screen: + +![centered message in a program window][2] + +Figure 1: A centered "press any key to quit" message in a program. + +### Building better programs with ncurses + +Explore the **ncurses** library functions to learn about other ways to display text to the screen. You can find a list of all **ncurses** functions in the man ncurses manual page. This gives a general overview of **ncurses** and provides a table-like list of the different **ncurses** functions, with a reference to the manual page that has full details. For example, **printw** is described in the _curs_printw(3X)_ manual page, which you can view with: + + +``` +`$ man 3x curs_printw` +``` + +or just: + + +``` +`$ man curs_printw` +``` + +With **ncurses**, you can create more interesting programs. By printing text at specific locations on the screen, you can create games and advanced utilities to run in the terminal. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/ncurses-linux + +作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/sites/default/files/press-key_0.png From a5425e93b273d24c3c000294e47fc717c7ab040c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Aug 2021 08:27:17 +0800 Subject: [PATCH 043/138] PRF&PUB @geekpi https://linux.cn/article-13733-1.html --- ... Real Time in Linux -Desktop and Server.md | 121 ++++++++++++++++ ... Real Time in Linux -Desktop and Server.md | 131 ------------------ 2 files changed, 121 insertions(+), 131 deletions(-) create mode 100644 published/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md delete mode 100644 translated/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md diff --git a/published/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md b/published/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md new file mode 100644 index 0000000000..3fd2befe24 --- /dev/null +++ b/published/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md @@ -0,0 +1,121 @@ +[#]: subject: "How to Monitor Log Files in Real Time in Linux [Desktop and Server]" +[#]: via: "https://www.debugpoint.com/2021/08/monitor-log-files-real-time/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13733-1.html" + +如何在 Linux 中实时监控日志文件 +====== + +> 本教程解释了如何实时监控 Linux 日志文件(桌面、服务器或应用),以进行诊断和故障排除。 + +![](https://img.linux.net.cn/data/attachment/album/202108/30/082607bmf6nlud6sdy49rm.jpg) + +当你在你的 Linux 桌面、服务器或任何应用中遇到问题时,你会首先查看各自的日志文件。日志文件通常是来自应用的文本和信息流,上面有一个时间戳。它可以帮助你缩小具体的实例,并帮助你找到任何问题的原因。它也可以帮助从网络上获得援助。 + +一般来说,所有的日志文件都位于 `/var/log` 中。这个目录包含以 `.log` 为扩展名的特定应用、服务的日志文件,它还包含单独的其他目录,这些目录包含其日志文件。 + +![log files in var-log][1] + +所以说,如果你想监控一堆日志文件或特定的日志文件。这里有一些你可以做到方法。 + +### 实时监控 Linux 日志文件 + +#### 使用 tail 命令 + +使用 `tail` 命令是实时跟踪日志文件的最基本方法。特别是,如果你所在的服务器只有一个终端,没有 GUI。这是很有帮助的。 + +比如: + +``` +tail /path/to/log/file +``` + +![Monitoring multiple log files via tail][2] + +使用开关 `-f` 来跟踪日志文件,它是实时更新的。例如,如果你想跟踪 `syslog`,你可以使用以下命令: + +``` +tail -f /var/log/syslog +``` + +你可以用一个命令监控多个日志文件,使用: + +``` +tail -f /var/log/syslog /var/log/dmesg +``` + +如果你想监控 http 或 sftp 或任何服务器,你也可以在这个命令中监控它们各自的日志文件。 + +记住,上述命令需要管理员权限。 + +#### 使用 lnav(日志文件浏览器) + +![lnav Running][3] + +`lnav` 是一个很好的工具,你可以用它来通过彩色编码的信息以更有条理的方式监控日志文件。在 Linux 系统中,它不是默认安装的。你可以用下面的命令来安装它: + +``` +sudo apt install lnav ### Ubuntu +sudo dnf install lnav ### Fedora +``` + +好的是,如果你不想安装它,你可以直接下载其预编译的可执行文件,然后在任何地方运行。甚至从 U 盘上也可以。它不需要设置,而且有很多功能。使用 `lnav`,你可以通过 SQL 查询日志文件,以及其他很酷的功能,你可以在它的 [官方网站][4] 上了解。 + +一旦安装,你可以简单地用管理员权限从终端运行 `lnav`,它将默认显示 `/var/log` 中的所有日志并开始实时监控。 + +#### 关于 systemd 的 journalctl 说明 + +今天所有的现代 Linux 发行版大多使用 systemd。systemd 提供了运行 Linux 操作系统的基本框架和组件。systemd 通过 `journalctl` 提供日志服务,帮助管理所有 systemd 服务的日志。你还可以通过以下命令实时监控各个 systemd 服务和日志。 + +``` +journalctl -f +``` + +下面是一些具体的 `journalctl` 命令,可以在一些情况下使用。你可以将这些命令与上面的 `-f` 开关结合起来,开始实时监控。 + + * 对紧急系统信息,使用: + ``` + journalctl -p 0 + ``` + * 显示带有解释的错误: + ``` + journalctl -xb -p 3 + ``` + * 使用时间控制来过滤输出: + ``` + journalctl --since "2020-12-04 06:00:00" + journalctl --since "2020-12-03" --until "2020-12-05 03:00:00" + journalctl --since yesterday + journalctl --since 09:00 --until "1 hour ago" + ``` + +如果你想了解更多关于 `journalctl` 的细节,我已经写了一个 [指南][6]。 + +### 结束语 + +我希望这些命令和技巧能帮助你找出桌面或服务器问题/错误的根本原因。对于更多的细节,你可以随时参考手册,摆弄各种开关。如果你对这篇文章有什么意见或看法,请在下面的评论栏告诉我。 + +加油。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/monitor-log-files-real-time/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/log-files-in-var-log-1024x312.jpeg +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Monitoring-multiple-log-files-via-tail-1024x444.jpeg +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/lnav-Running-1024x447.jpeg +[4]: https://lnav.org/features +[6]: https://www.debugpoint.com/2020/12/systemd-journalctl/ diff --git a/translated/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md b/translated/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md deleted file mode 100644 index 36b528c326..0000000000 --- a/translated/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md +++ /dev/null @@ -1,131 +0,0 @@ -[#]: subject: "How to Monitor Log Files in Real Time in Linux [Desktop and Server]" -[#]: via: "https://www.debugpoint.com/2021/08/monitor-log-files-real-time/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -如何在 Linux 中实时监控日志文件(桌面和服务器) -====== -本教程解释了如何实时监控 Linux 日志文件(桌面、服务器或应用),以进行诊断和故障排除。 - -当你在你的 Linux 桌面、服务器或任何应用中遇到问题时,你会首先查看各自的日志文件。日志文件通常是来自应用的文本和信息流,上面有一个时间戳。它可以帮助你缩小具体的实例,并帮助你找到任何问题的原因。它也可以帮助从网络上获得援助。 - -一般来说,所有的日志文件都位于 /var/log 中。这个目录包含以 .log 为扩展名的特定应用、服务的日志文件,它还包含单独的其他目录,这些目录包含其日志文件。 - -![log files in var-log][1] - -所以说,如果你想监控一堆日志文件或特定的日志文件。这里有一些你可以做到方法。 - -### 实时监控 Linux 日志文件 - -#### 使用 tail 命令 - -使用 tail 命令是实时跟踪日志文件的最基本方法。特别是,如果你所在的服务器只有一个终端,没有 GUI。这是很有帮助的。 - -比如: - -``` -tail /path/to/log/file -``` - -![Monitoring multiple log files via tail][2] - -使用开关 -f 来跟踪日志文件,它是实时更新的。例如,如果你想跟踪 syslog,你可以使用以下命令。 - -``` -tail -f /var/log/syslog -``` - -你可以用一个命令监控多个日志文件,使用: - -``` -tail -f /var/log/syslog /var/log/dmesg -``` - -如果你想监控 http 或 sftp 或任何服务器,你也可以在这个命令中监控它们各自的日志文件。 - -记住,上述命令需要管理员权限。 - -#### 使用 lnav(日志文件浏览器) - -![lnav Running][3] - -lnav 是一个很好的工具,你可以用它来用彩色编码的信息以更有条理的方式监控日志文件。在 Linux 系统中,它不是默认安装的。你可以用下面的命令来安装它: - -``` -sudo apt install lnav (Ubuntu) -sudo dnf install lnav (Fedora) -``` - -lnav 的好处是,如果你不想安装它,你可以直接下载其预编译的可执行文件,然后在任何地方运行。甚至从 U 盘上也可以。它不需要设置,而且有很多功能。使用 lnav,你可以通过 SQL 查询日志文件,以及其他很酷的功能,你可以在它的[官方网站][4]上了解。 - -Once installed, you can simply run lnav from terminal with admin privilege, and it will show all the logs from /var/log by default and start monitoring in real time. - -#### 关于 systemd 的 journalctl 说明 - -今天所有的现代 Linux 发行版大多使用 systemd。systemd 提供了运行 Linux 操作系统的基本框架和组件。systemd 通过 journalctl 提供日志服务,帮助管理所有 systemd 服务的日志。你还可以通过以下命令实时监控各个 systemd 服务和日志。 - -``` -journalctl -f -``` - -下面是一些特定的 journalctl 命令,可以在一些情况下使用。你可以将这些命令与上面的 -f 开关结合起来,开始实时监控。 - - * 对紧急系统信息,使用 - - - -``` -journalctl -p 0 -``` - - * 显示带有解释的错误 - - - -``` -journalctl -xb -p 3 -``` - - * 使用时间控制来过滤输出 - - - -``` -journalctl --since "2020-12-04 06:00:00" -journalctl --since "2020-12-03" --until "2020-12-05 03:00:00" -journalctl --since yesterday -journalctl --since 09:00 --until "1 hour ago" -``` - -如果你想了解更多关于 journalctl 的细节,我已经写了一个[指南][6]。 - -### 结束语 - -我希望这些命令和技巧能帮助你找出桌面或服务器问题/错误的根本原因。对于更多的细节,你可以随时参考手册,玩弄各种开关。如果你对这篇文章有什么意见或看法,请在下面的评论栏告诉我。 - -干杯。 - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/08/monitor-log-files-real-time/ - -作者:[Arindam][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.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/log-files-in-var-log-1024x312.jpeg -[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Monitoring-multiple-log-files-via-tail-1024x444.jpeg -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/lnav-Running-1024x447.jpeg -[4]: https://lnav.org/features -[6]: https://www.debugpoint.com/2020/12/systemd-journalctl/ From 14f0ae784adf7ce5775a921cbcccb0d5954ab891 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 30 Aug 2021 08:33:38 +0800 Subject: [PATCH 044/138] translated --- ...r Useful Application Launcher for Linux.md | 126 ------------------ ...r Useful Application Launcher for Linux.md | 126 ++++++++++++++++++ 2 files changed, 126 insertions(+), 126 deletions(-) delete mode 100644 sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md create mode 100644 translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md diff --git a/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md b/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md deleted file mode 100644 index 11df55dcf1..0000000000 --- a/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: subject: "Ulauncher: A Super Useful Application Launcher for Linux" -[#]: via: "https://itsfoss.com/ulauncher/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Ulauncher: A Super Useful Application Launcher for Linux -====== - -_**Brief:**_ _Ulauncher is a fast application launcher with extension and shortcut support to help you quickly access application and files in Linux._ - -An application launcher lets you quickly access or open an app without hovering over the application menu icons. - -By default, I found the application launcher with Pop!_OS super handy. But, not every Linux distribution offers an application launcher out-of-the-box. - -Fortunately, there is a solution with which you can add the application launcher to most of the popular distros out there. - -### Ulauncher: Open Source Application Launcher - -![][1] - -Ulauncher is a quick application launcher built using Python while utilizing GTK+. - -It gives a decent amount of customization and control options to tweak. Overall, you can adjust its behavior and experience to suit your taste. - -Let me highlight some of the features that you can expect with it. - -### Ulauncher Features - -The options that you get with Ulauncher are super accessible and easy to customize. Some key highlights include: - - * Fuzzy search algorithm, which lets you find applications even if you misspell them - * Remembers your last searched application in the same session - * Frequently used apps display (optional) - * Custom color themes - * Preset color themes that include a dark theme - * Shortcut to summon the launcher can be easily customized - * Browse files and directories - * Support for extensions to get extra functionality (emoji, weather, speed test, notes, password manager, etc.) - * Shortcuts for browsing sites like Google, Wikipedia, and Stack Overflow - - - -It provides almost every helpful ability that you may expect in an application launcher, and even better. - -### How to Use Ulauncher in Linux? - -By default, you need to press **Ctrl + Space** to get the application launcher after you open it from the application menu for the first time. - -Start typing in to search for an application. And, if you are looking for a file or directory, start typing with “**~**” or “**/**” (ignoring the quotes). - -![][2] - -There are default shortcuts like “**g XYZ**” where XYZ is the search term you want to search for in Google. - -![][3] - -Similarly, you can search for something directly taking you to Wikipedia or Stack Overflow, with “**wiki**” and “**so**” shortcuts, respectively. - -Without any extensions, you can also calculate things on the go and copy the results directly to the keyboard. - -![][4] - -This should come in handy for quick calculations without needing to launch the calculator app separately. - -You can head to its [extensions page][5] and browse for useful extensions along with screenshots that should instruct you how to use it. - -To change how it works, enable frequent applications display, and adjust the theme — click on the gear icon on the right side of the launcher. - -![][6] - -You can set it to auto-start. But, if it does not work on your Systemd enabled distro, you can refer to its GitHub page to add it to the service manager. - -The options are self-explanatory and are easy to customize, as shown in the screenshot below. - -![][7] - -### Installing Ulauncher in Linux - -Ulauncher provides a **.deb** package for Debian or Ubuntu-based distributions. You can explore [how to install Deb][8] [f][8][iles][8] if you’re new to Linux. - -In either case, you can also add its PPA and install it via terminal by following the commands below: - -``` -sudo add-apt-repository ppa:agornostal/ulauncher -sudo apt update -sudo apt install ulauncher -``` - -You can also find it available in the [AUR][9] for Arch and Fedora’s default repositories. - -For more information, you can head to its official website or the [GitHub page][10]. - -[Ulauncher][11] - -Ulauncher should be an impressive addition to any Linux distro. Especially, if you want the functionality of a quick launcher like Pop!_OS offers, this is a fantastic option to consider. - -_Have you tried Ulauncher yet? You are welcome to share your thoughts on how this might help you get things done quickly._ - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ulauncher/ - -作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher.png?resize=800%2C512&ssl=1 -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-directory.png?resize=800%2C503&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-google.png?resize=800%2C449&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-calculator.png?resize=800%2C429&ssl=1 -[5]: https://ext.ulauncher.io -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-gear-icon.png?resize=800%2C338&ssl=1 -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-settings.png?resize=800%2C492&ssl=1 -[8]: https://itsfoss.com/install-deb-files-ubuntu/ -[9]: https://itsfoss.com/aur-arch-linux/ -[10]: https://github.com/Ulauncher/Ulauncher/ -[11]: https://ulauncher.io diff --git a/translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md b/translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md new file mode 100644 index 0000000000..056a490813 --- /dev/null +++ b/translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md @@ -0,0 +1,126 @@ +[#]: subject: "Ulauncher: A Super Useful Application Launcher for Linux" +[#]: via: "https://itsfoss.com/ulauncher/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ulauncher:一个超级实用的 Linux 应用启动器 +====== + +_**简介:**_ _Ulauncher 是一个快速的应用启动器,支持扩展和快捷方式,帮助你在 Linux 中快速访问应用和文件。_ + +一个应用启动器可以让你快速访问或打开一个应用,而无需在应用菜单图标上徘徊。 + +在默认情况下,我发现 Pop!_OS 的应用启动器超级方便。但是,并不是每个 Linux 发行版都提供开箱即用的应用启动器。 + +幸运的是,有一个你可以在大多数流行的发行版中添加应用启动器的方案。 + +### Ulauncher:开源应用启动器 + +![][1] + +Ulauncher 是一个使用 Python 还有 GTK+ 构建的快速应用启动器。 + +它提供了相当数量的自定义和控制选项来进行调整。总的来说,你可以调整它的行为和体验以适应你的喜好。 + +让我来说一下你可以期待它的一些功能。 + +### Ulauncher 功能 + +Ulauncher 中的选项非常非常易于访问且易于定制。一些关键的亮点包括: + + * 模糊搜索算法,让你找到应用,即使你拼错了它们 + * 记住你在同一会话中最后搜索的应用 + * 经常使用的应用显示(可选) + * 自定义颜色主题 + * 预设颜色主题,包括一个黑暗主题 + * 召唤启动器的快捷方式可以轻松定制 + * 浏览文件和目录 + * 支持扩展,以获得额外的功能(表情符号、天气、速度测试、笔记、密码管理器等) + * 浏览谷歌、维基百科和 Stack Overflow 等网站的快捷方式 + + + +它几乎提供了你在一个应用启动器中所期望的所有有用的能力,甚至更好。 + +### 如何在 Linux 中使用 Ulauncher? + +默认情况下,首次从应用菜单打开应用启动器后,你需要按 **Ctrl + Space** 打开应用启动器。 + +开始输入以搜索一个应用。而且,如果你正在寻找一个文件或目录,开始输入 “**~**” 或者 “**/**” (忽略引号)。 + +![][2] + +有一些默认的快捷键,如 “**g XYZ**”,其中 XYZ 是你想在谷歌中搜索的搜索词。 + +![][3] + +同样,你可以通过 “**wiki**” 和 “**so**” 快捷键,直接在维基百科或 Stack Overflow 搜索。 + +在没有任何扩展的情况下,你也可以直接计算内容,并将结果直接复制到键盘上。 + +![][4] + +这在快速计算时应该很方便,不需要单独启动计算器应用。 + +你可以前往它的[扩展页面][5],浏览有用的扩展,以及指导你如何使用它的截图。 + +要改变它的工作方式,启用频繁的应用显示,并调整主题,请点击启动器右侧的齿轮图标。 + +![][6] + +你可以把它设置为自动启动。但是,如果它在你的支持 Systemd 的发行版上不工作,你可以参考它的 GitHub 页面,把它添加到服务管理器中。 + +这些选项是非常只管,且易于定制,如下图所示。 + +![][7] + +### 在 Linux 中安装 Ulauncher + +Ulauncher 为基于 Debian 或 Ubuntu 的发行版提供了一个 **.deb** 包。如果你是 Linux 新手,你可以探索[如何安装 Deb 文件][8] 。 + +在这两种情况下,你也可以添加它的 PPA,并通过终端按照下面的命令来安装它: + +``` +sudo add-apt-repository ppa:agornostal/ulauncher +sudo apt update +sudo apt install ulauncher +``` + +你也可以在 [AUR][9] 中找到它,用于 Arch 和 Fedora 的默认仓库。 + +对于更多信息,你可以前往其官方网站或 [GitHub页面][10]。 + +[Ulauncher][11] + +Ulauncher 应该是任何 Linux 发行版中一个令人印象深刻的补充。特别是,如果你想要一个像 Pop!_OS 提供的快速启动器的功能,这是一个值得考虑的奇妙选择。 + +_你试过 Ulauncher了吗?欢迎你就这如何帮助你快速完成工作分享你的想法。_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ulauncher/ + +作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher.png?resize=800%2C512&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-directory.png?resize=800%2C503&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-google.png?resize=800%2C449&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-calculator.png?resize=800%2C429&ssl=1 +[5]: https://ext.ulauncher.io +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-gear-icon.png?resize=800%2C338&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-settings.png?resize=800%2C492&ssl=1 +[8]: https://itsfoss.com/install-deb-files-ubuntu/ +[9]: https://itsfoss.com/aur-arch-linux/ +[10]: https://github.com/Ulauncher/Ulauncher/ +[11]: https://ulauncher.io From 5dfa1bab36abcded1e3c4674d8b378bb9e064040 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 30 Aug 2021 08:37:06 +0800 Subject: [PATCH 045/138] translating --- .../tech/20210827 Linux kernel modules we can-t live without.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210827 Linux kernel modules we can-t live without.md b/sources/tech/20210827 Linux kernel modules we can-t live without.md index be68102762..82d66505d7 100644 --- a/sources/tech/20210827 Linux kernel modules we can-t live without.md +++ b/sources/tech/20210827 Linux kernel modules we can-t live without.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/linux-kernel-module" [#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 13b2e04bb45845de532efd1aea173e63221db263 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Mon, 30 Aug 2021 19:58:35 +0800 Subject: [PATCH 046/138] translating --- sources/tech/20200211 Using external libraries in Java.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200211 Using external libraries in Java.md b/sources/tech/20200211 Using external libraries in Java.md index 8367b5ca20..63791df886 100644 --- a/sources/tech/20200211 Using external libraries in Java.md +++ b/sources/tech/20200211 Using external libraries in Java.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (unigeorge) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -292,7 +292,7 @@ via: https://opensource.com/article/20/2/external-libraries-java 作者:[Chris Hermansen][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[unigeorge](https://github.com/unigeorge) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8489359acf0335e86567ad41e88d53801b0556ac Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Aug 2021 22:32:41 +0800 Subject: [PATCH 047/138] PUB @wxy https://linux.cn/article-13736-1.html --- ...owser Choice for Private Web Experience.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) rename {translated/tech => published}/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md (88%) diff --git a/translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md b/published/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md similarity index 88% rename from translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md rename to published/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md index 9d2391ba56..78021917e5 100644 --- a/translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md +++ b/published/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md @@ -4,13 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13736-1.html) Brave vs. Firefox:你的私人网络体验的终极浏览器选择 ====== -Web 浏览器经过多年的发展。从下载文件到访问成熟的Web 应用程序,我们已经走过了很长的路。 +![](https://img.linux.net.cn/data/attachment/album/202108/30/223133tqzkg4pjpwwb8u4g.jpg) + +Web 浏览器经过多年的发展,从下载文件到访问成熟的 Web 应用程序,已经有了长足的发展。 对于很多用户来说,Web 浏览器是他们如今完成工作的唯一需要。 @@ -42,7 +44,7 @@ Brave 和 Mozilla Firefox 是两个最受到关注隐私的用户和开源爱好 ![Firefox 浏览器][13] -Firefox 浏览器的设计看起来令人印象深刻,并提供了干净利落的用户体验。如果需要的话,你还可以选择一个暗色主题,此外还有几个主题可供下载使用。 +Firefox 浏览器的设计看起来令人印象深刻,并提供了干净利落的用户体验。如果需要的话,你还可以选择一个暗色主题,此外还有其它几个主题可供下载使用。 这两个 Web 浏览器都能提供良好的用户体验。 @@ -104,7 +106,7 @@ Firefox 浏览器也默认启用了增强的隐私保护功能,但并不阻止 ![][19] -这是在 [Firefox 86][20] 中引入的技术,要使用它,你需要启用“严格隐私保护模式”。 +这是在 [Firefox 86][20] 中引入的技术,要使用它,你需要启用 “严格隐私保护模式”。 总的来说,Brave 可能看起来是一个更好的选择,而 Mozilla Firefox 提供了更好的隐私保护功能。 @@ -122,17 +124,17 @@ Brave 没有提供任何类似的功能,但它本身可以阻止跨站追踪 与 Firefox 不同,Brave 通过屏蔽网络上的其他广告来提供自己的广告网络。 -当你选择显示 Brave 的隐私友好型广告时,你会得到可以放到加密货币钱包里的通证奖励。而你可以用这些通证来回馈你喜欢的网站。 +当你选择显示 Brave 的隐私友好型广告时,你会得到可以放到加密货币钱包里的通证奖励,而你可以用这些通证来回馈你喜欢的网站。 虽然这是摆脱主流广告的一个很好的商业策略,但对于不想要任何形式的广告的用户来说,这可能没有用。 -因此,Brave 以奖励的形式提供了一个替代方案,即使你屏蔽了广告,也可以帮助网站。如果这是你欣赏的东西,Brave 将是你的一个好选择。 +因此,Brave 以奖励的形式提供了一个替代方案,即使你屏蔽了广告,也可以帮助网站发展。如果这是你欣赏的东西,Brave 将是你的一个好选择。 ### 跨平台可用性 你会发现 Brave 和 Firefox 都有 Linux、Windows 和 macOS 版本,也有用于 iOS 和 Android 的移动应用程序。 -对于 Linux 用户来说,Firefox 浏览器捆绑找大多数的 Linux 发行版中。而且,你也可以在软件中心里找到它。除此之外,还有一个 [Flatpak][22] 包可用。 +对于 Linux 用户来说,Firefox 浏览器捆绑在大多数的 Linux 发行版中。而且,你也可以在软件中心里找到它。除此之外,还有一个 [Flatpak][22] 包可用。 Brave 不能通过默认的软件库和软件中心获得。因此,你需要按照官方的说明来添加私有仓库,然后 [把 Brave 安装在你的 Linux 发行版中][23]。 @@ -142,7 +144,7 @@ Brave 不能通过默认的软件库和软件中心获得。因此,你需要 ![][24] -Brave 也可以让你跨平台同步,但你需要访问其中一个设备才能成功做到这一点。 +Brave 也可以让你跨平台同步,但你需要能访问其中一个设备才行。 ![][25] @@ -152,7 +154,7 @@ Brave 也可以让你跨平台同步,但你需要访问其中一个设备才 ### 服务集成 -一开始,Firefox 就提供了更多的服务集成,包括 Pocket、“虚拟私有网络”、密码管理器,还有一些新产品,如 Firefox 中继。 +从一开始 Firefox 就提供了更多的服务集成,包括 Pocket、“虚拟私有网络”、密码管理器,还有一些新产品,如 Firefox 中继。 如果你想通过你的浏览器访问这些服务,Firefox 将是你的方便选择。 @@ -160,7 +162,7 @@ Brave 也可以让你跨平台同步,但你需要访问其中一个设备才 ![][26] -同样,如果你喜欢使用 [Brave Search][27],在使用 Brave 浏览器时,由于用户体验的原因,你可能会有顺滑的体验。 +同样,如果你喜欢使用 [Brave Search][27],在使用 Brave 浏览器时,由于用户体验的原因,你可能体验会更顺滑。 ### 可定制性 & 安全性 @@ -170,7 +172,7 @@ Firefox 浏览器在可定制性方面大放异彩。你可以通过众多选项 而加固 Firefox 浏览器是一个我们将讨论的单独话题。略举一例,[Tor 浏览器][28] 只是一个定制的 Firefox 浏览器。 -然而,这并不意味着 Brave 的安全性降低。总的来说,它是一个安全的浏览器,但你确实可以通过 Firefox 浏览器获得更多的选择。 +然而,这并不意味着 Brave 的安全性更低。总的来说,它是一个安全的浏览器,但你确实可以通过 Firefox 浏览器获得更多的选择。 ### 扩展支持 @@ -178,7 +180,7 @@ Firefox 浏览器在可定制性方面大放异彩。你可以通过众多选项 因此,如果你是一个使用大量扩展(或不断尝试新扩展)的人,Brave 明显比 Firefox 更有优势。 -Firefox 可能扩展目录不是最大的,但它确实支持大多数的扩展。对于常见的使用情况,你很少能找到一个不能作为 Firefox 附加组件的扩展。 +可能 Firefox 的扩展清单不是最大的,但它确实支持大多数的扩展。对于常见的使用情况,你很少能找到一个 Firefox 中没有的扩展。 ### 你应该选择那个? @@ -188,7 +190,7 @@ Firefox 可能扩展目录不是最大的,但它确实支持大多数的扩展 在选择它们中的任何一个时会有一些取舍。因此,你需要优先考虑你最想要的东西。 -请在下面的评论中告诉我你对你的使用情况的最终选择! +请在下面的评论中告诉我你的最终选择! -------------------------------------------------------------------------------- From 80161a267d76f91516b5c03b60de95365e18ee6c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Aug 2021 05:03:16 +0800 Subject: [PATCH 048/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210830=20?= =?UTF-8?q?How=20to=20install=20only=20security=20and=20bugfixes=20updates?= =?UTF-8?q?=20with=20DNF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210830 How to install only security and bugfixes updates with DNF.md --- ... security and bugfixes updates with DNF.md | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 sources/tech/20210830 How to install only security and bugfixes updates with DNF.md diff --git a/sources/tech/20210830 How to install only security and bugfixes updates with DNF.md b/sources/tech/20210830 How to install only security and bugfixes updates with DNF.md new file mode 100644 index 0000000000..69d9b5b4e6 --- /dev/null +++ b/sources/tech/20210830 How to install only security and bugfixes updates with DNF.md @@ -0,0 +1,232 @@ +[#]: subject: "How to install only security and bugfixes updates with DNF" +[#]: via: "https://fedoramagazine.org/how-to-install-only-security-and-bugfixes-updates-with-dnf/" +[#]: author: "Mateus Rodrigues Costa https://fedoramagazine.org/author/mateusrodcosta/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to install only security and bugfixes updates with DNF +====== + +![][1] + +Photo by [Scott Webb][2] on [Unsplash][3] + +This article will explore how to filter the updates available to your Fedora Linux system by type. This way you can choose to, for example, only install security or bug fixes updates. This article will demo running the _dnf_ commands inside toolbox instead of using a real Fedora Linux install. + +You might also want to read [Use dnf updateinfo to read update changelogs][4] before reading this article. + +### Introduction + +If you have been managing system updates for Fedora Linux or any other GNU/Linux distro, you might have noticed how, when you run a system update (with _dnf update_, in the case of Fedora Workstation), you usually are not installing only security updates. + +Due to how package management in a GNU/Linux distro works, generally (with the exception of software running in a container, under Flatpak, or similar technologies) you are updating every single package regardless of whether it’s a “system” software or an “app”. + +DNF divides updates in three types: “security”, “bugfix” and “enhancement”. And, as you will see, DNF allows filtering which types you want to operate on. + +But, why would you want to update only a subset of packages? + +Well, this might depend on how you personally choose to deal with system updates. If you are not comfortable at the moment with updating everything, then restricting the current update to only security updates might be a good choice. You could also install bug fix updates as well and only install enhancements and other types of updates during a future opportunity. + +### How to filter security and bug fix updates + +Start by creating a Fedora Linux 34 toolbox: + +``` +toolbox create --distro fedora --release f34 updatefilter-demo +``` + +Then enter that toolbox: + +``` +toolbox enter updatefilter-demo +``` + +From now on commands can be run on a real Fedora Linux install. + +First, run _dnf check-update_ to see the unfiltered list of packages: + +``` +$ dnf check-update +audit-libs.x86_64 3.0.5-1.fc34 updates +avahi.x86_64 0.8-14.fc34 updates +avahi-libs.x86_64 0.8-14.fc34 updates +... +vim-minimal.x86_64 2:8.2.3318-1.fc34 updates +xkeyboard-config.noarch 2.33-1.fc34 updates +yum.noarch 4.8.0-1.fc34 updates +``` + +DNF supports passing the types of updates to operate on as parameter: _‐‐security_ for security updates, _‐‐bugfix_ for bug fix updates and _‐‐enhancement_ for enhancement updates. Those work on commands such as _dnf check-update_, _dnf update_ and _dnf updateinfo_. + +For example, this is how you filter the list of available updates by security updates only: + +``` +$ dnf check-update --security +avahi.x86_64 0.8-14.fc34 updates +avahi-libs.x86_64 0.8-14.fc34 updates +curl.x86_64 7.76.1-7.fc34 updates +... +libgcrypt.x86_64 1.9.3-3.fc34 updates +nettle.x86_64 3.7.3-1.fc34 updates +perl-Encode.x86_64 4:3.12-460.fc34 updates +``` + +And now same thing but by bug fix updates only: + +``` +$ dnf check-update --bugfix +audit-libs.x86_64 3.0.5-1.fc34 updates +ca-certificates.noarch 2021.2.50-1.0.fc34 updates +coreutils.x86_64 8.32-30.fc34 updates +... +systemd-pam.x86_64 248.7-1.fc34 updates +systemd-rpm-macros.noarch 248.7-1.fc34 updates +yum.noarch 4.8.0-1.fc34 updates +``` + +They can even be combined, so you can use two or more of them at the same time. For example, you can filter the list to show both security and bug fix updates: + +``` +$ dnf check-update --security --bugfix +audit-libs.x86_64 3.0.5-1.fc34 updates +avahi.x86_64 0.8-14.fc34 updates +avahi-libs.x86_64 0.8-14.fc34 updates +... +systemd-pam.x86_64 248.7-1.fc34 updates +systemd-rpm-macros.noarch 248.7-1.fc34 updates +yum.noarch 4.8.0-1.fc34 updates +``` + +As mentioned, _dnf updateinfo_ also works with this filtering, so you can filter _dnf updateinfo_, _dnf updateinfo list_ and _dnf updateinfo info_. For example, for the list of security updates and their IDs: + +``` +$ dnf updateinfo list --security +FEDORA-2021-74ebf2f06f Moderate/Sec. avahi-0.8-14.fc34.x86_64 +FEDORA-2021-74ebf2f06f Moderate/Sec. avahi-libs-0.8-14.fc34.x86_64 +FEDORA-2021-83fdddca0f Moderate/Sec. curl-7.76.1-7.fc34.x86_64 +FEDORA-2021-e14e86e40e Moderate/Sec. glibc-2.33-20.fc34.x86_64 +FEDORA-2021-e14e86e40e Moderate/Sec. glibc-common-2.33-20.fc34.x86_64 +FEDORA-2021-e14e86e40e Moderate/Sec. glibc-minimal-langpack-2.33-20.fc34.x86_64 +FEDORA-2021-8b25e4642f Low/Sec. krb5-libs-1.19.1-14.fc34.x86_64 +FEDORA-2021-83fdddca0f Moderate/Sec. libcurl-7.76.1-7.fc34.x86_64 +FEDORA-2021-31fdc84207 Moderate/Sec. libgcrypt-1.9.3-3.fc34.x86_64 +FEDORA-2021-d1fc0b9d32 Moderate/Sec. nettle-3.7.3-1.fc34.x86_64 +FEDORA-2021-92e07de1dd Important/Sec. perl-Encode-4:3.12-460.fc34.x86_64 +``` + +If desired, you can install only security updates: + +``` +# dnf update --security +================================================================================ + Package Arch Version Repository Size +================================================================================ +Upgrading: + avahi x86_64 0.8-14.fc34 updates 289 k + avahi-libs x86_64 0.8-14.fc34 updates 68 k + curl x86_64 7.76.1-7.fc34 updates 297 k +... + perl-Encode x86_64 4:3.12-460.fc34 updates 1.7 M +Installing weak dependencies: + glibc-langpack-en x86_64 2.33-20.fc34 updates 563 k + +Transaction Summary +================================================================================ +Install 1 Package +Upgrade 11 Packages + +Total download size: 9.7 M +Is this ok [y/N]: +``` + +Or even to install both security and bug fix updates while ignoring enhancement updates: + +``` +# dnf update --security --bugfix +================================================================================ + Package Arch Version Repo Size +================================================================================ +Upgrading: + audit-libs x86_64 3.0.5-1.fc34 updates 116 k + avahi x86_64 0.8-14.fc34 updates 289 k + avahi-libs x86_64 0.8-14.fc34 updates 68 k +... + rpm-plugin-systemd-inhibit x86_64 4.16.1.3-1.fc34 fedora 23 k + shared-mime-info x86_64 2.1-2.fc34 fedora 374 k + sqlite x86_64 3.34.1-2.fc34 fedora 755 k + +Transaction Summary +================================================================================ +Install 11 Packages +Upgrade 45 Packages + +Total download size: 32 M +Is this ok [y/N]: +``` + +### Install only specific updates + +You may also choose to only install the updates with a specific ID, such as _FEDORA-2021-74ebf2f06f_ for avahi by using _–advisory_ and specifying the ID: + +``` +# dnf update --advisory=FEDORA-2021-74ebf2f06f +================================================================================ + Package Architecture Version Repository Size +================================================================================ +Upgrading: + avahi x86_64 0.8-14.fc34 updates 289 k + avahi-libs x86_64 0.8-14.fc34 updates 68 k + +Transaction Summary +================================================================================ +Upgrade 2 Packages + +Total download size: 356 k +Is this ok [y/N]: +``` + +Or even multiple updates, with _‐‐advisories_: + +``` +# dnf update --advisories=FEDORA-2021-74ebf2f06f,FEDORA-2021-83fdddca0f +================================================================================ + Package Architecture Version Repository Size +================================================================================ +Upgrading: + avahi x86_64 0.8-14.fc34 updates 289 k + avahi-libs x86_64 0.8-14.fc34 updates 68 k + curl x86_64 7.76.1-7.fc34 updates 297 k + libcurl x86_64 7.76.1-7.fc34 updates 284 k + +Transaction Summary +================================================================================ +Upgrade 4 Packages + +Total download size: 937 k +Is this ok [y/N]: +``` + +### Conclusion + +In the end it all comes down to how you personally prefer to manage your updates. But if you need, for whichever reason, to only install security updates, then these filters will surely come in handy! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-install-only-security-and-bugfixes-updates-with-dnf/ + +作者:[Mateus Rodrigues Costa][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/mateusrodcosta/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/how-to-install-only-security-and-bugfixes-updates-with-dnf-816x345.jpg +[2]: https://unsplash.com/@scottwebb?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/security?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/use-dnf-updateinfo-to-read-update-changelogs/ From 101029fbe95ae167d1be48a8ac24315399d5144c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Aug 2021 05:03:36 +0800 Subject: [PATCH 049/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210831=20?= =?UTF-8?q?Zulip:=20An=20Interesting=20Open-Source=20Alternative=20to=20Sl?= =?UTF-8?q?ack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md --- ...esting Open-Source Alternative to Slack.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md diff --git a/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md b/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md new file mode 100644 index 0000000000..af9e6da063 --- /dev/null +++ b/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md @@ -0,0 +1,99 @@ +[#]: subject: "Zulip: An Interesting Open-Source Alternative to Slack" +[#]: via: "https://itsfoss.com/zulip/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Zulip: An Interesting Open-Source Alternative to Slack +====== + +_**Brief:** Zulip is an open-source collaboration platform that pitches itself as a better replacement to Slack. Let us take a closer look._ + +Messaging and collaboration platforms make a big difference when it comes to your work. + +While there are several options available, Slack is a popular one used by many organizations. But, what about an open-source alternative to Slack that you can self-host? + +Zulip is one such software. + +### Zulip: Open Source Collaboration Messaging App + +![][1] + +If you want to explore, I must mention that there are more [open-source alternatives to Slack][2] out there. + +Here, I focus on Zulip. + +Zulip is a free and open-source messaging application with paid hosted options and the ability to self-host. + +It aims to provide a similar experience to Slack while striving to help you improve the effectiveness of conversations using topics. + +In contrast to channels in Slack, Zulip chat adds topics (which are like tags) to quickly filter through the conversations that matter to you. + +### Features of Zulip + +![][3] + +You get most of the essential features with Zulip. To list the key highlights, you can find: + + * Markdown support + * Topics for channels + * Drag and drop file support + * Code blocks + * GitHub integration to track issues + * Email notification support + * Self-host option + * Message editing + * GIPHY integration + * Video calls with Zoom, Jitsi, or BigBlueButton + + + +In addition to the features mentioned, you should expect the basic options that you usually get with Slack and others. + +Also, you can integrate it with Matrix and IRC if you want. + +![][4] + +In my brief test usage, the user interface is good enough for effective communication. However, I failed to find any dark mode or the ability to change a theme. + +It looks more straightforward than Slack so that it can improve the user experience side of things. + +### Install Zulip in Linux + +Zulip is available as an AppImage file from its official website. You may refer to our guide on [using AppImage in Linux][5] in case you need help. + +It is also available as a snap package. So, you can utilize either of them for any Linux distro. + +You can also install it through the terminal for Ubuntu/Debian-based distros using APT. Take a look at its [official instructions][6] if you want that. + +Zulip is available for Windows, Mac, and Linux. You should also find it available for Android and iOS mobile phones. + +[Zulip][7] + +Considering that you can use Zulip on the web, desktop, and smartphones, it is a suitable replacement for Slack. + +_Have you tried it yet? What messaging platform do you use to collaborate for work? Feel free to share your thoughts in the comments._ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/zulip/ + +作者:[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/2021/08/zulip-chat-new.png?resize=800%2C551&ssl=1 +[2]: https://itsfoss.com/open-source-slack-alternative/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/zulip-chat-screenshot.png?resize=800%2C550&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/zulip-settings.png?resize=800%2C546&ssl=1 +[5]: https://itsfoss.com/use-appimage-linux/ +[6]: https://zulip.com/help/desktop-app-install-guide +[7]: https://zulip.com/ From 9d5ce11ac958005dae98de94a0ee4c60498cbf36 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Aug 2021 05:03:58 +0800 Subject: [PATCH 050/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210830=20?= =?UTF-8?q?Print=20from=20anywhere=20with=20CUPS=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210830 Print from anywhere with CUPS on Linux.md --- ... Print from anywhere with CUPS on Linux.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/tech/20210830 Print from anywhere with CUPS on Linux.md diff --git a/sources/tech/20210830 Print from anywhere with CUPS on Linux.md b/sources/tech/20210830 Print from anywhere with CUPS on Linux.md new file mode 100644 index 0000000000..025dce01e1 --- /dev/null +++ b/sources/tech/20210830 Print from anywhere with CUPS on Linux.md @@ -0,0 +1,113 @@ +[#]: subject: "Print from anywhere with CUPS on Linux" +[#]: via: "https://opensource.com/article/21/8/share-printer-cups" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Print from anywhere with CUPS on Linux +====== +Share your printer with the Common Unix Printing System (CUPS). +![Two hands holding a resume with computer, clock, and desk chair ][1] + +I have a printer in my office, but sometimes I work on my laptop in another room of the house. This isn't a problem for me for two reasons. First of all, I rarely print anything on paper and have gone months without using the printer. Secondly, though, I've set the printer to be shared over my home network, so I can send files to print from anywhere in the house. I didn't need any special equipment for this setup. It's accomplished with just my usual Linux computer and the Common Unix Printing System (CUPS). + +### Installing CUPS on Linux + +If you're running Linux, BSD, or macOS, then you probably already have CUPS installed. CUPS has been the open source solution to Unix printing since 1997. Apple relied on it so heavily for their fledgling Unix-based OS X that they ended up buying it in 2007 to ensure its continued development and maintenance. + +If your system doesn't already have CUPS installed, you can install it with your package manager. For example, on Fedora, Mageia, or CentOS: + + +``` +`$ sudo dnf install cups` +``` + +On Debian, Linux Mint, and similar: + + +``` +`$ sudo apt install cups` +``` + +### Accessing CUPS on Linux and Mac + +To access CUPS, open a web browser and navigate to `localhost:631`, which tells your computer to open whatever's on port 631 on itself (your computer always [refers to itself as localhost][2]). + +Your web browser opens a page providing you access to your system's printer settings. From here, you can add printers, modify printer defaults, monitor queued jobs, and allow printers to be shared over your local network. + +![CUPS web user interface][3] + +Figure 1: The CUPS web user interface. + +### Configuring a printer with CUPS + +You can either add a new printer or modify an existing one from within the CUPS interface. Modifying a printer involves the exact same pages as adding a new one, except that when you're adding a printer, you make new choices, and when you're modifying a printer, you confirm or change existing ones. + +First, click on the **Administration** tab, and then the **Add Printer** button. + +If you're only modifying an existing printer, click **Manage Printers** instead, and then choose the printer you want to change. Choose **Modify Printer** from the **Administration** drop-down menu. + +Regardless of whether you're modifying or adding, you must enter administrative authorization before CUPS allows you to continue. You can either log in as root, if that's available to you, or as your normal user identity, as long as you have `sudo` privileges. + +Next, you're presented with a list of printer interfaces and protocols that you can use for a printer. If your printer is plugged directly into your computer and is on, it's listed as a _Local Printer_. If the printer has networking built into it and is attached to a switch or router on your network, you can usually use the Internet Printing Protocol (ipp) to access it (you may have to look at your router to determine the IP address of the printer, but read your printer's documentation for details). If the printer is a Hewlett-Packard, you may also be able to use HPLIP to access it. + +Use whatever protocol makes sense for your physical setup. If you're unsure of what to use, you can try one, attempt to print a test page, and then try a different one in the case of failure. + +The next screen asks for human-friendly details about the printer. This is mostly for your reference. Enter a name for the printer that makes sense (I usually use the model number, but large organizations sometimes name their printers after things like fictional starships or capital cities), a description, and the location. + +You may also choose to share the printer with other computers on your network. + +![CUPS web UI to share printers][4] + +Figure 2: CUPS web user interface to share printers. + +If sharing is not currently enabled, click the checkbox to enable sharing. + +### Drivers + +On the next screen, you must set your printer driver. Open source drivers for printers can often be found on [openprinting.org][5]. There's a good chance you already have a valid driver, as long as you have the `gutenprint` package installed, or have installed drivers bundled with the printer. If the printer is a PostScript printer (many laser printers are), you may only need a PPD file from [openprinting.org][5] rather than a driver. + +Assuming you have drivers installed, you can choose your printer's make (manufacturer) for a list of available drivers. Select the appropriate driver and continue. + +### Connecting to a shared printer + +Now that you have successfully installed and configured your printer, you can connect to it from any other computer on your network. For example, suppose you have a laptop called **client** that you use around the house. You want to add your shared printer to it. + +On the GNOME and Plasma desktops, you can add a printer from the **Printer** screen of **Settings:** + + * If you have your printer connected to a computer, then you enter the IP address of the _computer_ (because the printer is accessible through its host). + * If you have your printer connected to a switch or router, then enter the IP address of the printer itself. + + + +On macOS, printer settings can be found in **System Preferences**. + +Alternately, you can keep using the CUPS interface on your client computer. The process to access CUPS is the same: Ensure CUPS is installed, open a network, and navigate to `localhost:631`. + +Once you've accessed the CUPS web interface, select the **Administration** tab. Click the **Find New Printers** button in the **Printers** section, and then add the shared printer to your network. You can also set the printer's IP address manually in CUPS by going through the normal **Add Printer** process. + +### Print from anywhere + +It's the 21st century! Put the USB thumb drive down, stop emailing yourself files to print from another computer, and make your printer available to your home network. It's surprisingly easy and supremely convenient. And best of all, you'll look like a networking wizard to all of your housemates! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/share-printer-cups + +作者:[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/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) +[2]: https://opensource.com/article/21/4/network-management +[3]: https://opensource.com/sites/default/files/cups-web-ui.jpeg +[4]: https://opensource.com/sites/default/files/cups-web-ui-share_0.jpeg +[5]: http://openprinting.org From 9aaee6185b0617bded7ae63aba4ba291f0e07842 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Aug 2021 05:04:14 +0800 Subject: [PATCH 051/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210830=20?= =?UTF-8?q?Write=20a=20guessing=20game=20in=20ncurses=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210830 Write a guessing game in ncurses on Linux.md --- ...ite a guessing game in ncurses on Linux.md | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 sources/tech/20210830 Write a guessing game in ncurses on Linux.md diff --git a/sources/tech/20210830 Write a guessing game in ncurses on Linux.md b/sources/tech/20210830 Write a guessing game in ncurses on Linux.md new file mode 100644 index 0000000000..06945c55da --- /dev/null +++ b/sources/tech/20210830 Write a guessing game in ncurses on Linux.md @@ -0,0 +1,164 @@ +[#]: subject: "Write a guessing game in ncurses on Linux" +[#]: via: "https://opensource.com/article/21/8/guess-number-game-ncurses-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Write a guessing game in ncurses on Linux +====== +Use the flexibility and power of ncurses to create a guess-the-number +game on Linux. +![question mark in chalk][1] + +In my [last article][2], I gave a brief introduction to using the **ncurses** library to write text-mode interactive applications in C. With **ncurses**, we can control where and how text gets displayed on the terminal. If you explore the **ncurses** library functions by reading the manual pages, you’ll find there are a ton of different ways to display text, including bold text, colors, blinking text, windows, borders, graphic characters, and other features to make your application stand out. + +If you’d like to explore a more advanced program that demonstrates a few of these interesting features, here’s a simple “guess the number” game, updated to use **ncurses**. The program picks a random number in a range, then asks the user to make repeated guesses until they find the secret number. As the user makes their guess, the program lets them know if the guess was too low or too high. + +Note that this program limits the possible numbers from 0 to 7. Keeping the values to a limited range of single-digit numbers makes it easier to use **getch()** to read a single number from the user. I also used the **getrandom** kernel system call to generate random bits, masked with the number 7 to pick a random number from 0 (binary 0000) to 7 (binary 0111). + + +``` +#include <curses.h> +#include <string.h>          /* for strlen */ +#include <sys/random.h>      /* for getrandom */ + +int +random0_7() +{ +   int num; +   getrandom(&num, sizeof(int), GRND_NONBLOCK); +   return (num & 7); /* from 0000 to 0111 */ +} + +int +read_guess() +{ +  int ch; + +  do { +    ch = getch(); +  } while ((ch < '0') || (ch > '7')); + +  return (ch - '0'); /* turn into a number */ +} +``` + +By using **ncurses**, we can add some visual interest. Let’s add functions to display important text at the top of the screen and a message line to display status information at the bottom of the screen. + + +``` +void +print_header(const char *text) +{ +  move(0, 0); +  clrtoeol(); + +  attron(A_BOLD); +  mvaddstr(0, (COLS / 2) - (strlen(text) / 2), text); +  attroff(A_BOLD); +  refresh(); +} + +void +print_status(const char *text) +{ +  move(LINES - 1, 0); +  clrtoeol(); +  +  attron(A_REVERSE); +  mvaddstr(LINES - 1, 0, text); +  attroff(A_REVERSE); +  refresh(); +} +``` + +With these functions, we can construct the main part of our number-guessing game. First, the program sets up the terminal for **ncurses**, then picks a random number from 0 to 7. After displaying a number scale, the program then enters a loop to ask the user for their guess. + +As the user makes their guess, the program provides visual feedback. If the guess is too low, the program prints a left square bracket under the number on the screen. If the guess is too high, the game prints a right square bracket. This helps the user to narrow their choice until they guess the correct number. + + +``` +int +main() +{ +  int number, guess; + +  initscr(); +  cbreak(); +  noecho(); + +  number = random0_7(); +  mvprintw(1, COLS - 1, "%d", number); /* debugging */ + +  print_header("Guess the number 0-7"); + +  mvaddstr(9, (COLS / 2) - 7, "0 1 2 3 4 5 6 7"); + +  print_status("Make a guess..."); + +  do { +    guess = read_guess(); + +    move(10, (COLS / 2) - 7 + (guess * 2)); + +    if (guess < number) { +      addch('['); +      print_status("Too low"); +    } + +    else if (guess > number) { +      addch(']'); +      print_status("Too high"); +    } + +    else { +      addch('^'); +    } +  } while (guess != number); + +  print_header("That's right!"); +  print_status("Press any key to quit"); +  getch(); + +  endwin(); + +  return 0; +} +``` + +Copy this program and compile it for yourself to try it out. Don’t forget that you need to tell GCC to link with the **ncurses** library: + + +``` +`$ gcc -o guess guess.c -lncurses` +``` + +I’ve left the debugging line in there, so you can see the secret number near the upper-right corner of the screen: + +![guess number game interface][3] + +Figure 1: Guess the number game. Notice the secret number in the upper right. + +### Get yourself going with ncurses + +This program uses a bunch of other features of **ncurses** that you can use as a starting point. For example, the print_header function prints a message in bold text centered at the top of the screen, and the print_status function prints a message in reverse text at the bottom-left of the screen. Use this to help you get started with **ncurses** programming. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/guess-number-game-ncurses-linux + +作者:[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/question-mark_chalkboard.jpg?itok=DaG4tje9 (question mark in chalk) +[2]: https://opensource.com/article/21/8/ncurses-linux +[3]: https://opensource.com/sites/default/files/guessnumber07.png From 659e36f6f2d92e34b09925c68d46af7ca0bb3ed6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Aug 2021 05:06:49 +0800 Subject: [PATCH 052/138] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210830=20?= =?UTF-8?q?Linux=20Kernel=205.14=20Released=20Right=20After=20the=2030th?= =?UTF-8?q?=20Anniversary=20of=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210830 Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux.md --- ...ght After the 30th Anniversary of Linux.md | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 sources/news/20210830 Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux.md diff --git a/sources/news/20210830 Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux.md b/sources/news/20210830 Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux.md new file mode 100644 index 0000000000..5f9ffc4f7a --- /dev/null +++ b/sources/news/20210830 Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux.md @@ -0,0 +1,154 @@ +[#]: subject: "Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux" +[#]: via: "https://news.itsfoss.com/kernel-5-14-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux +====== + +Back in June, I looked at [Linux Kernel 5.13][1], where we received preliminary support for the M1, RISC-V improvements, and support for new GPUs. + +Now, Linux kernel 5.14 is here! Linus Torvalds just [announced it on the kernel mailing list][2]: + +![Kernel 5.14 announcement mail][3] + +While this release is not quite as large as the aforementioned one, it still has many improvements, especially for ARM devices. + +Let us take a quick look at the key highlights of this release. + +### Linux Kernel 5.14: What’s New? + +Linux kernel 5.14 contains a wide variety of new features, especially for ARM-based systems. This is all happening despite Linus Torvalds claiming that this is a relatively small release in the initial [kernel announcement][4]. + +Fast forward to its release candidate v7 before its final release, Linus mentioned: + +> Most of the changes here are drivers (GPU and networking stand out), +> +> and the rest is pretty random stuff: arch, tracing, core networking, a +> +> couple of VM fixes.. + +Linus Torvalds, Linux kernel 5.14 RC7 announcement + +This release contains a variety of new features. Here is a list of the key new features present in Linux kernel 5.14: + + * The [Raspberry Pi 400][5] can now work completely with this kernel, thanks to the work done for the past couple of months. + * The [Rockchip RK3568 SoC][6] is now supported + * Initial support for the Sony Xperia 1/1II and 5/5II + * Various updates added for Microsoft Surface Duo + * Updates to DIY BananaPi M5 board added + * [Important updates][7] for RISC-V + * Improved support for Intel Alder Lake P and Alder Lake M graphics cards + * New hot-unplug support on AMD Radeon graphics cards + * ‘Secret’ memory areas introduced with a new system called ‘memfd_secret’ + * Improvements to [lower the latency of its USB audio driver][8]s + * Improved support for USB4 + * Initial groundwork to support Intel Alder lake processors + + + +In this article, we will be looking at what these features are, and what they mean for the end user. + +#### Raspberry Pi 400 + +Last year, the Raspberry Pi Foundation launched the [Raspberry Pi 400][5], a keyboard computer similar to those of the 1980s. Unfortunately, this computer requires a custom kernel version to function due to non-mainline drivers. + +However, with the kernel 5.14 release, this appears to have changed. After months of development, the Raspberry Pi 400 can now be booted using the Linux kernel 5.14. While it is unfortunate for support to take this long, it is much better late than never. + +#### RK35xx SoC Support + +This year has truly been a glorious year for [Rockchip][9]. They started off by launching their rk35xx series of SoCs, with many manufacturers integrating the newly-released SoCs into their products. + +One of the most notable uses of the RK35xx series is in the Quartz64, an SBC developed by [Pine64][10] (which I am currently helping mainline). And Linux 5.14 brings support for one of these SoCs, the RK3568. + +For all the upcoming boards based on this SoC, this inclusion is extremely important as it greatly simplifies distro porting. + +#### Initial Support for Sony Xperia 1/1II and 5/5II + +[Sony][11] is one of the few mobile phone manufacturers that actively support running Linux on their phones. This is demonstrated through their compatibility with operating systems such as [Sailfish OS][12] and [Ubuntu Touch][13]. + +Now, with the Sony Xperia 1/1II and 5/5II being mainlined, it should be much easier to get an even wider variety of distributions booted. However, it should be also be kept in mind that this is only initial support, much like Linux 5.13’s M1 support. + +#### RISC-V Updates + +One of the trends I have noticed over the past few kernel updates is the ever-improving support for [RISC-V][14] processors. Last update, we got some significant build system improvements, a re-arranged kernel memory map, and support for the kernel debugging module KProbes. + +This time, it appears that this trend is continuing, with the addition of a few RISC-V-specific improvements. These include: + + * Support for transparent huge pages + * An optimized copy_{to,from}_user. + * Generic PCI resources mapping support + * Support for KFENCE (Kernel Electric Fence) for memory safety error detection/validation + + + +While mostly minor, these updates should pave the way for future RISC-V based devices. + +#### Radeon Hot-Unplug + +Perhaps my favorite feature of this release, AMD Radeon cards are getting a new hot-unplug feature. Previously, ripping your GPU out while your system was running would result in a kernel panic. Now, you can remove your (Radeon) GPU at any time and your system will continue to function normally, at least in theory. + +I just hope that this feature works better on Linux than my experience with it on Windows. While I wouldn’t recommend randomly pulling your GPU out of your system mid-update, it is still a nice feature to see, and it will be interesting to see what people do with it. + +#### USB 4 Support + +As we see an increasing number of new laptops shipping with USB 4, it has become more and more important for Linux to start supporting it. Fortunately, the Linux kernel 5.14 has a wide variety of improvements for USB 4 users. + +These include: + + * More USB 4 support added to the thunderbolt core + * Build warning fixes all over the place + * USB-serial driver updates and new device support + * A wide variety of driver updates + * Lots of other tiny things + + + +While not game-changing, these improvements should help many current and future users of USB 4. + +### Wrapping Up + +Between the improved USB support, multitude of updates for ARM and RISC-V devices, and minor GPU upgrades, this release is looking pretty good. As I mentioned before, I am most excited about the Radeon hot-unplug support, as this should make GPU swapping that little bit easier. + +Similarly to last time, I’d recommend waiting for your distribution to offer official updates before upgrading to Linux kernel 5.14. Fortunately, users of distributions such as Arch and Manjaro should receive the updates very shortly. [Advanced Ubuntu users can install the latest mainline Kernel][15] with some effort though it should be avoided. + +_What do you think about the improvements in Linux Kernel 5.14? Let me know down in the comments!_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kernel-5-14-release/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/linux-kernel-5-13-release/ +[2]: https://lkml.org/lkml/2021/8/29/382 +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ1NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: http://lkml.iu.edu/hypermail/linux/kernel/2107.1/02943.html +[5]: https://www.raspberrypi.org/products/raspberry-pi-400/ +[6]: https://www.96rocks.com/blog/2020/11/28/introduce-rockchip-rk3568/ +[7]: https://lore.kernel.org/lkml/mhng-423e8bdb-977e-4b99-a1bb-b8c530664a51@palmerdabbelt-glaptop/ +[8]: http://lkml.iu.edu/hypermail/linux/kernel/2107.1/00919.html +[9]: https://www.rock-chips.com/a/en/index.html +[10]: http://pine64.org +[11]: https://electronics.sony.com/c/mobile +[12]: https://sailfishos.org/ +[13]: https://ubuntu-touch.io/ +[14]: https://riscv.org/ +[15]: https://itsfoss.com/upgrade-linux-kernel-ubuntu/ From 2185bc4e467e116f3505bd4fa4b0666f4c8f4ccd Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 31 Aug 2021 08:36:16 +0800 Subject: [PATCH 053/138] translating --- ...s for daily needs part 4- audio editors.md | 87 ------------------- 1 file changed, 87 deletions(-) delete mode 100644 sources/tech/20210823 Apps for daily needs part 4- audio editors.md diff --git a/sources/tech/20210823 Apps for daily needs part 4- audio editors.md b/sources/tech/20210823 Apps for daily needs part 4- audio editors.md deleted file mode 100644 index e3ce8c80df..0000000000 --- a/sources/tech/20210823 Apps for daily needs part 4- audio editors.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: subject: "Apps for daily needs part 4: audio editors" -[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/" -[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Apps for daily needs part 4: audio editors -====== - -![][1] - -Photo by [Brooke Cagle][2] on [Unsplash][3] - -Audio editor applications or digital audio workstations (DAW) were only used in the past by professionals, such as record producers, sound engineers, and musicians. But nowadays many people who are not professionals also need them. These tools are used for narration on presentations, video blogs, and even just as a hobby. This is especially true now since there are so many online platforms that facilitate everyone sharing audio works, such as music, songs, podcast, etc. This article will introduce some of the open source audio editors or DAW that you can use on Fedora Linux. You may need to install the software mentioned. If you are unfamiliar with how to add software packages in Fedora Linux, see my earlier article [Things to do after installing Fedora 34 Workstation][4]. Here is a list of a few apps for daily needs in the audio editors or DAW category. - -### Audacity - -I’m sure many already know Audacity. It is a popular multi-track audio editor and recorder that can be used for post-processing all types of audio. Most people use Audacity to record their voices, then do editing to make the results better. The results can be used as a podcast or a narration for a video blog. In addition, people also use Audacity to create music and songs. You can record live audio through a microphone or mixer. It also supports 32 bit sound quality. - -Audacity has a lot of features that can support your audio works. It has support for plugins, and you can even write your own plugin. Audacity provides many built-in effects, such as noise reduction, amplification, compression, reverb, echo, limiter, and many more. You can try these effects while listening to the audio directly with the real-time preview feature. The built in plugin-manager lets you manage frequently used plugins and effects. - -![][5] - -More information is available at this link: - -* * * - -### LMMS - -LMMS or Linux MultiMedia Studio is a comprehensive music creation application. You can use LMMS to produce your music from scratch with your computer. You can create melodies and beats according to your creativity, and make it better with selection of sound instruments and various effects. There are several built-in features related to musical instruments and effects, such as 16 built-in sythesizers, embedded ZynAddSubFx, drop-in VST effect plug-in support, bundled graphic and parametric equalizer, built-in analyzer, and many more. LMMS also supports MIDI keyboards and other audio peripherals. - -![][6] - -More information is available at this link: - -* * * - -### Ardour - -Ardour has capabilities similar to LMMS as a comprehensive music creation application. It says on its website that Ardour is a DAW application that is the result of collaboration between musicians, programmers, and professional recording engineers from around the world. Ardour has various functions that are needed by audio engineers, musicians, soundtrack editors, and composers. - -Ardour provides complete features for recording, editing, mixing, and exporting. It has unlimited multichannel tracks, non-linear editor with unlimited undo/redo, a full featured mixer, built-in plugins, and much more. Ardour also comes with video playback tools, so it is also very helpful in the process of creating and editing soundtracks for video projects. - -![][7] - -More information is available at this link: - -* * * - -### TuxGuitar - -TuxGuitar is a tablature and score editor. It comes with a tablature editor, score viewer, multitrack display, time signature management, and tempo management. It includes various effects, such as bend, slide, vibrato, etc. While TuxGuitar focuses on the guitar, it allows you to write scores for other instruments. It can also serve as a basic MIDI editor. You need to have an understanding of tablature and music scoring to be able to use it. - -![][8] - -More information is available at this link: - -* * * - -### Conclusion - -This article presented four audio editors as apps for your daily needs and use on Fedora Linux. Actually there are many other audio editors, or DAW, that you can use on Fedora Linux. You can also use Mixxx, Rosegarden, Kwave, Qtractor, MuseScore, musE, and many more. Hopefully this article can help you investigate and choose the right audio editor or DAW. If you have experience using these applications, please share your experiences in the comments. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/ - -作者:[Arman Arisman][a] -选题:[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/armanwu/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-4-Audio-816x345.jpg -[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ -[5]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-audacity-1024x575.png -[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-lmms-1024x575.png -[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-ardour-1024x592.png -[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-tuxguitar-1024x575.png From e3bda7f6fd69b38c0bfaff070e2b74dc6f681a01 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 31 Aug 2021 08:39:19 +0800 Subject: [PATCH 054/138] translating --- ...s for daily needs part 4- audio editors.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 translated/tech/20210823 Apps for daily needs part 4- audio editors.md diff --git a/translated/tech/20210823 Apps for daily needs part 4- audio editors.md b/translated/tech/20210823 Apps for daily needs part 4- audio editors.md new file mode 100644 index 0000000000..8207f167b1 --- /dev/null +++ b/translated/tech/20210823 Apps for daily needs part 4- audio editors.md @@ -0,0 +1,87 @@ +[#]: subject: "Apps for daily needs part 4: audio editors" +[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/" +[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +满足日常需求的应用第四部分:音频编辑器 +====== + +![][1] + +照片由 [Brooke Cagle][2] 在 [Unsplash][3] 上发布。 + +音频编辑应用或数字音频工作站(DAW)在过去只被专业人士使用,如唱片制作人、音响工程师和音乐家。但现在很多不是专业人士的人也需要它们。这些工具被用于演示文稿解说、视频博客,甚至只是作为一种爱好。现在尤其如此,因为有这么多的在线平台,方便大家分享音频作品,如音乐、歌曲、播客等。本文将介绍一些你可以在 Fedora Linux 上使用的开源音频编辑器或 DAW。你可能需要安装提到的软件。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章[安装 Fedora 34 工作站后要做的事情][4]。这里列出了音频编辑器或 DAW 类的一些日常需求的应用。 + +### Audacity + +我相信很多人已经知道 Audacity 了。它是一个流行的多轨音频编辑器和录音机,可用于对所有类型的音频进行后期处理。大多数人使用 Audacity 来记录他们的声音,然后进行编辑,使其结果更好。其结果可以作为播客或视频博客的解说词。此外,人们还用 Audacity 来创作音乐和歌曲。你可以通过麦克风或调音台录制现场音频。它还支持 32 位的声音质量。 + +Audacity 有很多功能,可以支持你的音频作品。它有对插件的支持,你甚至可以自己编写插件。Audacity 提供了许多内置效果,如降噪、放大、压缩、混响、回声、限制器等。你可以利用实时预览功能在直接聆听音频的同时尝试这些效果。内置的插件管理器可以让你管理经常使用的插件和效果。 + +![][5] + +更多信息可在此链接中找到: + +* * * + +### LMMS + +LMMS 或 Linux MultiMedia Studio 是一个全面的音乐创作应用。你可以使用 LMMS 用你的电脑从头开始制作你的音乐。你可以根据自己的创意创造旋律和节拍,并通过选择声音乐器和各种效果使其更加完美。有几个与乐器和效果有关的内置功能,如 16 个内置合成器、嵌入式 ZynAddSubFx、支持插入式 VST 效果插件、捆绑图形和参数均衡器、内置分析器等等。LMMS 还支持 MIDI 键盘和其他音频外围设备。 + +![][6] + +更多信息可在此链接中获得: + +* * * + +### Ardour + +Ardour 作为一个全面的音乐创作应用,其功能与 LMMS 相似。它在其网站上说,Ardour 是一个 DAW 应用,是来自世界各地的音乐家、程序员和专业录音工程师合作的结果。Ardour 拥有音频工程师、音乐家、配乐编辑和作曲家需要的各种功能。 + +Ardour 为录音、编辑、混音和输出提供了完整的功能。它有无限的多声道音轨、无限撤销/重做的非线性编辑器、一个全功能的混音器、内置插件等。Ardour 还带有视频播放工具,所以它在为视频项目创建和编辑配乐的过程中也很有帮助。 + +![][7] + +更多信息可在此链接中获得: + +* * * + +### TuxGuitar + +TuxGuitar 是一个指法谱和乐谱编辑器。它配备了指法编辑器、乐谱查看器、多轨显示、拍号管理和速度管理。它包括各种效果,如弯曲、滑动、颤音等。虽然 TuxGuitar 专注于吉他,但它也允许你为其他乐器写乐谱。它也可以作为一个基本的 MIDI 编辑器。你需要对指法谱和乐谱有一定的了解才能使用它。 + +![][8] + +更多的信息可以在这个链接上获得: + +* * * + +### 总结 + +这篇文章介绍了四个音频编辑器,作为你在 Fedora Linux 上的日常需要和使用的应用。实际上,还有许多其他的你可以在 Fedora Linux 上使用的音频编辑器或者 DAW。你也可以使用 Mixxx、Rosegarden、Kwave、Qtractor、MuseScore、musE 等等。希望这篇文章能帮助你调查和选择合适的音频编辑器或者 DAW。如果你有使用这些应用的经验,请在评论中分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/ + +作者:[Arman Arisman][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-4-Audio-816x345.jpg +[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ +[5]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-audacity-1024x575.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-lmms-1024x575.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-ardour-1024x592.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-tuxguitar-1024x575.png From f94acecd74c698dd14b57f94a5fc4aa843e8317f Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 31 Aug 2021 08:42:21 +0800 Subject: [PATCH 055/138] translating --- .../20210820 How to Download Audio Only Using youtube-dl.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md b/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md index 4c5ab290b6..23ebe4e425 100644 --- a/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md +++ b/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/youtube-dl-audio-only/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 37b414d28ed4d72707b808758afcd74973347c02 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Aug 2021 09:29:39 +0800 Subject: [PATCH 056/138] PRF @geekpi --- ...one on Linux with this open source tool.md | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md b/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md index e10a8683ef..2591119641 100644 --- a/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md +++ b/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md @@ -3,45 +3,45 @@ [#]: author: "Don Watkins https://opensource.com/users/don-watkins" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 用这个开源工具在 Linux 上访问你的 iPhone ====== -过使用 Libimobiledevice 从 Linux 与 iOS 设备进行通信。 -![A person looking at a phone][1] -iPhone 和 iPad 决不是开源的,但它们是流行的设备。许多拥有 iOS 备的人恰好也在使用大量的开源,包括 Linux。Windows 和 macOS 的用户可以通过使用苹果提供的软件与 iOS 设备通信,但苹果不支持 Linux 用户。开源程序员早在 2007 年(就在 iPhone 发布一年后)就以 Libimobiledevice(当时叫 libiphone)来拯救了人们,这是一个与 iOS 通信的跨平台解决方案。它可以在 Linux、Android、Arm 系统(如 Raspberry Pi)、Windows、甚至 macOS 上运行。 +> 通过使用 Libimobiledevice 从 Linux 与 iOS 设备进行通信。 -Libimobiledevice 是用 C 语言编写的,使用原生协议与 iOS 设备上运行的服务进行通信。它不需要苹果公司的任何库,所以它是完全免费和开源的。 +![](https://img.linux.net.cn/data/attachment/album/202108/31/092907bc26qep3ekc73czl.jpg) -Libimobiledevice 是一个面向对象的 API,有许多终端工具与它捆绑在一起,以方便你使用。该库支持苹果最早的 iOS 设备,一直到其最新的型号。这是多年来研究和开发的结果。该项目中的应用包括 **usbmuxd**、**ideviceinstaller**、**idevicerestore**、**ifuse**、**libusbmuxd**、**libplist**、**libirecovery**、和 **libideviceactivation**。 +iPhone 和 iPad 绝不是开源的,但它们是流行的设备。许多拥有 iOS 备的人恰好也在使用大量的开源软件,包括 Linux。Windows 和 macOS 的用户可以通过使用苹果公司提供的软件与 iOS 设备通信,但苹果公司不支持 Linux 用户。开源程序员早在 2007 年(就在 iPhone 发布一年后)就以 Libimobiledevice(当时叫 libiphone)来拯救了人们,这是一个与 iOS 通信的跨平台解决方案。它可以在 Linux、Android、Arm 系统(如树莓派)、Windows、甚至 macOS 上运行。 + +Libimobiledevice 是用 C 语言编写的,使用原生协议与 iOS 设备上运行的服务进行通信。它不需要苹果公司的任何库,所以它完全是自由而开源的。 + +Libimobiledevice 是一个面向对象的 API,它捆绑了许多便于你使用的终端工具。该库支持苹果从最早到其最新的型号的 iOS 设备。这是多年来研究和开发的结果。该项目中的应用包括 `usbmuxd`、`ideviceinstaller`、`idevicerestore`、`ifuse`、`libusbmuxd`、`libplist`、`libirecovery` 和 `libideviceactivation`。 ### 在 Linux 上安装 Libimobiledevice -在 Linux 上,你可能已经默认安装了 **libimobiledevice**。你可以通过你的软件包管理器或应用商店找到,或者通过运行项目中包含的一个命令: - +在 Linux 上,你可能已经默认安装了 `libimobiledevice`。你可以通过你的软件包管理器或应用商店找到,或者通过运行项目中包含的一个命令: ``` -`$ ifuse --help` +$ ifuse --help ``` -你可以用你的包管理器安装 **libimobiledevice**。例如,在 Fedora 或 CentOS 上: - +你可以用你的包管理器安装 `libimobiledevice`。例如,在 Fedora 或 CentOS 上: ``` -`$ sudo dnf install libimobiledevice ifuse usbmuxd` +$ sudo dnf install libimobiledevice ifuse usbmuxd ``` 在 Debian 和 Ubuntu 上: ``` -`$ sudo apt install usbmuxd libimobiledevice6 libimobiledevice-utils` +$ sudo apt install usbmuxd libimobiledevice6 libimobiledevice-utils ``` -或者,你可以从源代码[下载][2]并安装 **libimobiledevice**。 +或者,你可以从源代码 [下载][2] 并安装 `libimobiledevice`。 ### 连接你的设备 @@ -49,41 +49,39 @@ Libimobiledevice 是一个面向对象的 API,有许多终端工具与它捆 为你的 iOS 设备建立一个目录作为挂载点。 - ``` -`$ mkdir ~/iPhone` +$ mkdir ~/iPhone ``` 接下来,挂载设备: - ``` -`$ ifuse ~/iPhone` +$ ifuse ~/iPhone ``` -你的设备提示你信任你用来访问它的电脑。 +你的设备提示你,是否信任你用来访问它的电脑。 ![iphone prompts to trust the computer][3] -图 1:iPhone 提示你要信任电脑。 +*图 1:iPhone 提示你要信任该电脑。* 信任问题解决后,你会在桌面上看到新的图标。 ![iphone icons appear on desktop][4] -图 2:iPhone 的新图标出现在桌面上。 +*图 2:iPhone 的新图标出现在桌面上。* -点击 **iPhone** 图标,显示出你的 iPhone 的文件夹结构。 +点击 “iPhone” 图标,显示出你的 iPhone 的文件夹结构。 ![iphone folder structure displayed][5] -图 3:显示了 iPhone 的文件夹结构。 +*图 3:显示了 iPhone 的文件夹结构。* -我通常最常访问的文件夹是 **DCIM**,那里存放着我的 iPhone 照片。有时我在写文章时使用这些照片,有时有一些照片我想用 Gimp 等开源应用来增强。可以直接访问这些图片,而不是通过电子邮件把它们发给我自己,这是使用 Libimobiledevice 工具的好处之一。我可以把这些文件夹中的任何一个复制到我的 Linux 电脑上。我也可以在 iPhone 上创建文件夹并删除它们。 +我通常最常访问的文件夹是 `DCIM`,那里存放着我的 iPhone 照片。有时我在写文章时使用这些照片,有时有一些照片我想用 GIMP 等开源应用来增强。可以直接访问这些图片,而不是通过电子邮件把它们发给我自己,这是使用 `libimobiledevice` 工具的好处之一。我可以把这些文件夹中的任何一个复制到我的 Linux 电脑上。我也可以在 iPhone 上创建文件夹并删除它们。 ### 发现更多 -[Martin Szulecki][6] 是该项目的首席开发者。该项目正在寻找开发者加入他们的[社区][7]。Libimobiledevice 可以改变你使用外设的方式,而无论你在什么平台上。这是开源的又一次胜利,这意味着它是所有人的胜利。 +[Martin Szulecki][6] 是该项目的首席开发者。该项目正在寻找开发者加入他们的 [社区][7]。Libimobiledevice 可以改变你使用外设的方式,而无论你在什么平台上。这是开源的又一次胜利,这意味着它是所有人的胜利。 -------------------------------------------------------------------------------- @@ -92,7 +90,7 @@ via: https://opensource.com/article/21/8/libimobiledevice-iphone-linux 作者:[Don Watkins][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cbd1e35df002aed19be6291b8829ccdfdb334188 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Aug 2021 09:30:23 +0800 Subject: [PATCH 057/138] PUB @geekpi https://linux.cn/article-13737-1.html --- ... Access your iPhone on Linux with this open source tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210823 Access your iPhone on Linux with this open source tool.md (98%) diff --git a/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md b/published/20210823 Access your iPhone on Linux with this open source tool.md similarity index 98% rename from translated/tech/20210823 Access your iPhone on Linux with this open source tool.md rename to published/20210823 Access your iPhone on Linux with this open source tool.md index 2591119641..f864386b61 100644 --- a/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md +++ b/published/20210823 Access your iPhone on Linux with this open source tool.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13737-1.html" 用这个开源工具在 Linux 上访问你的 iPhone ====== From d0b49412e0c3c4d1a6f60d443a03eea7800defa4 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Tue, 31 Aug 2021 11:51:39 +0800 Subject: [PATCH 058/138] translating by perfiffer --- .../tech/20210830 Write a guessing game in ncurses on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210830 Write a guessing game in ncurses on Linux.md b/sources/tech/20210830 Write a guessing game in ncurses on Linux.md index 06945c55da..5be4fe1be9 100644 --- a/sources/tech/20210830 Write a guessing game in ncurses on Linux.md +++ b/sources/tech/20210830 Write a guessing game in ncurses on Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/guess-number-game-ncurses-linux" [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From d3881f4bc1bfb9173b2bd79688fce7c2619e49a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E4=B9=9D?= <2220238842@qq.com> Date: Tue, 31 Aug 2021 23:24:20 +0800 Subject: [PATCH 059/138] Update 20210821 10 Things to Do After Installing elementary OS 6 -Odin.md --- ... 10 Things to Do After Installing elementary OS 6 -Odin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md index b510e84de4..910bf3ad32 100644 --- a/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md +++ b/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md @@ -2,7 +2,7 @@ [#]: via: "https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "anine09" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -167,7 +167,7 @@ via: https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary 作者:[Arindam][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[anine09](https://github.com/anine09) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bc8bb3493728b1adba7ac33717f5d592b4da05e9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Sep 2021 05:03:08 +0800 Subject: [PATCH 060/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901=20?= =?UTF-8?q?Ubuntu=20Server=20vs=20Desktop:=20What=E2=80=99s=20the=20Differ?= =?UTF-8?q?ence=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210901 Ubuntu Server vs Desktop- What-s the Difference.md --- ...erver vs Desktop- What-s the Difference.md | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 sources/tech/20210901 Ubuntu Server vs Desktop- What-s the Difference.md diff --git a/sources/tech/20210901 Ubuntu Server vs Desktop- What-s the Difference.md b/sources/tech/20210901 Ubuntu Server vs Desktop- What-s the Difference.md new file mode 100644 index 0000000000..603df9ea8f --- /dev/null +++ b/sources/tech/20210901 Ubuntu Server vs Desktop- What-s the Difference.md @@ -0,0 +1,131 @@ +[#]: subject: "Ubuntu Server vs Desktop: What’s the Difference?" +[#]: via: "https://itsfoss.com/ubuntu-server-vs-desktop/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ubuntu Server vs Desktop: What’s the Difference? +====== + +When you click on the download button on the [Ubuntu website][1], it gives you a few options. Two of them are Ubuntu Desktop and Ubuntu Server. + +This could confuse new users. Why are there two (actually 4 of them)? Which one should be downloaded? Ubuntu desktop or server? Are they the same? What is the difference? + +![Ubuntu website gives you multiple options][2] + +I am going to explain the difference between the desktop and server editions of Ubuntu. I’ll also explain which variant you should be using. + +### Ubuntu desktop vs Ubuntu server + +![Ubuntu desktop and server illustartion][3] + +To understand the difference between Ubuntu desktop and server, you should understand the difference between a desktop and a server operating system. + +#### Desktop + +A desktop is referred to a personal computer. A desktop operating system comes with a graphical user interface so that the users can use their mouse and keyboard. The primary purpose of a desktop is to give you a system that can be used for web browsing, document editing, viewing/editing pictures and videos, coding and gaming. Basically, a general purpose computer for individuals, end users, or family members. + +I am using the term desktop here, but this does not mean that it cannot be used on a laptop. Desktop is the generic term for a personal computer. + +#### Server + +On the other hand, a server operating system is specifically created for hosting web services like websites, apps, media servers, databases etc. + +Usually, a server operating system does not come with a graphical interface. If it is Linux based operating system, you’ll have to use the system entirely via commands in terminal. + +The advantage here is that the server OS do not need a lot of RAM and computational power because they do not use [graphical desktop environment][4]. Apart from that, the server operating system has packages configured differently as well. + +Now that you understand the difference between server and desktop a little, let’s see the difference between Ubuntu server and desktop. + +#### The user interface + +The most visible difference between Ubuntu server and desktop is the user interface. + +Ubuntu desktop features a graphical user interface with GNOME desktop environment. This makes it easier to use with the help of mouse clicks. + +![User interface of Ubuntu GNOME edition][5] + +Ubuntu server edition runs headless. You will only see a terminal interface when you are logged in to it. You’ll often manage it remotely from other computers overs SSH. + +![Connecting to remote Ubuntu server via SSH][6] + +#### Installation + +[Installing Ubuntu as a desktop is easy][7] thanks to the graphical installer. You can create a live USB and experience the desktop version without installing. If you like it, you can install it in minutes following the on-screen instructions. + +![Installing Ubuntu desktop via graphical installer][8] + +Installing Ubuntu as a server is not as easy as the desktop edition. You are stuck with terminal interface. Even the simplest tasks like connecting to Wi-Fi could be a difficult task if you are not familiar with the procedure. + +![Ubuntu server installation][9] + +#### Applications + +The default set of applications in Ubuntu desktop is focused on regular computer users. So, you’ll find web browsers, office suite, media players, games etc. + +![Applications in Ubuntu][10] + +Ubuntu server has applications that are more tailored for running web services. And that’s not it. Some applications are also configured differently. Take SSH for example. Ubuntu server has SSH preconfigured so that you can easily connect to it from remote systems. You have to explicitly enable SSH on Ubuntu desktop. + +#### Hardware requirement + +Since the desktop edition features a graphical user interface, you need at least 4 GB of RAM to run Ubuntu desktop. Disk space should be 20 GB at least. + +This is where it gets interesting for Ubuntu server. It does not have a graphical interface. The command line interface does not consume a lot of system resources. As a result, you can easily run Ubuntu server on a machine with 512 MB and 5 GB of disk space. + +The RAM and disk space on the server is subjected to the web service you run. If a web application requires at least 2 GB of RAM, you should have that much of RAM. But in the simplest of scenario, even 512 MB or 1 GB of RAM could work. + +#### Usage + +This is the main differentiator between Ubuntu desktop and server. Ask yourself, for what purpose you want to use Ubuntu? + +If it is specifically for deploying web services, go for Ubuntu server. Keep in mind that you need to have basic Linux command line knowledge to navigate through the terminal. + +If you want to use Ubuntu as a regular computer like Windows, go with Ubuntu desktop. If you want to use it for learning Linux commands, Docker or even simple (but local) LAMP server installation for learning, stay with Ubuntu desktop. + +For a server, Ubuntu server is better than Ubuntu desktop. For regular computing usage, Ubuntu desktop is the better choice. + +#### Should you use Ubuntu desktop for server or install GUI on server? + +Here’s the thing. Both Ubuntu desktop and server are Linux. You can use Ubuntu desktop as server for hosting web services. That works. + +Similarly, [you can install GUI on Ubuntu server][11] and use it graphically. That also works. + +![GUI login on an Ubuntu server][12] + +But just because it works, doesn’t mean you should do it. It defies the entire purpose of creating different editions for server and desktop. + +You have to put extra effort in converting a server to desktop and vice versa. Why take that pain? + +If your purpose of using Ubuntu is clear, download and install the appropriate Ubuntu edition. + +_**I hope this makes things around Ubuntu desktop and server editions a bit more clear now. If you have questions or suggestions, please utilize the comment section.**_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-server-vs-desktop/ + +作者:[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://ubuntu.com/ +[2]: https://itsfoss.com/wp-content/uploads/2021/08/ubuntu-server-desktop-download-800x338.webp +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ubuntu-desktop-server.png?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/what-is-desktop-environment/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-gnome-desktop.png?resize=792%2C597&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/system-restart-required.png?resize=800%2C469&ssl=1 +[7]: https://itsfoss.com/install-ubuntu/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/installing-ubuntu.png?resize=800%2C549&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ubuntu-server-installation.png?resize=800%2C600&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/09/gnome-app-arranger.jpg?resize=799%2C450&ssl=1 +[11]: https://itsfoss.com/install-gui-ubuntu-server/ +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-gnome-desktop-greet.png?resize=798%2C600&ssl=1 From 355185734c891de0d61e3a3a42cdb1d4e5681154 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Sep 2021 05:03:31 +0800 Subject: [PATCH 061/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210831=20?= =?UTF-8?q?What=20is=20a=20container=20image=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210831 What is a container image.md --- .../20210831 What is a container image.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20210831 What is a container image.md diff --git a/sources/tech/20210831 What is a container image.md b/sources/tech/20210831 What is a container image.md new file mode 100644 index 0000000000..3d96567fc8 --- /dev/null +++ b/sources/tech/20210831 What is a container image.md @@ -0,0 +1,126 @@ +[#]: subject: "What is a container image?" +[#]: via: "https://opensource.com/article/21/8/container-image" +[#]: author: "Nived V https://opensource.com/users/nivedv" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What is a container image? +====== +A container image contains a packaged application, along with its +dependencies, and information on what processes it runs when launched. +![Shipping containers stacked][1] + +Containers are a critical part of today's IT operations. A _container image_ contains a packaged application, along with its dependencies, and information on what processes it runs when launched. + +You create container images by providing a set of specially formatted instructions, either as commits to a registry or as a Dockerfile. For example, this Dockerfile creates a container for a PHP web application: + + +``` +FROM registry.access.redhat.com/ubi8/ubi:8.1 + +RUN yum --disableplugin=subscription-manager -y module enable php:7.3 \ +  && yum --disableplugin=subscription-manager -y install httpd php \ +  && yum --disableplugin=subscription-manager clean all + +ADD index.php /var/www/html + +RUN sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf \ +  && sed -i 's/listen.acl_users = apache,nginx/listen.acl_users =/' /etc/php-fpm.d/www.conf \ +  && mkdir /run/php-fpm \ +  && chgrp -R 0 /var/log/httpd /var/run/httpd /run/php-fpm \ +  && chmod -R g=u /var/log/httpd /var/run/httpd /run/php-fpm + +EXPOSE 8080 +USER 1001 +CMD php-fpm & httpd -D FOREGROUND +``` + +Each instruction in this file adds a _layer_ to the container image. Each layer only adds the difference from the layer below it, and then, all these layers are stacked together to form a read-only container image. + +### How does that work? + +You need to know a few things about container images, and it's important to understand the concepts in this order: + + 1. Union file systems + 2. Copy-on-Write + 3. Overlay File Systems + 4. Snapshotters + + + +### Union File Systems (Aufs) + +The Union File System (UnionFS) is built into the Linux kernel, and it allows contents from one file system to be merged with the contents of another, while keeping the "physical" content separate. The result is a unified file system, even though the data is actually structured in branches. + +The idea here is that if you have multiple images with some identical data, instead of having this data copied over again, it's shared by using something called a _layer_. + +![UnionFS][2] + +Image CC BY-SA opensource.com + +Each layer is a file system that can be shared across multiple containers, e.g., The httpd base layer is the official Apache image and can be used across any number of containers. Imagine the disk space we just saved since we are using the same base layer for all our containers. + +These image layers are always read-only, but when we create a new container from this image, we add a thin writable layer on top of it. This writable layer is where you create/modify/delete or make other changes required for each container. + +### Copy-on-write + +When you start a container, it appears as if the container has an entire file system of its own. That means every container you run in the system needs its own copy of the file system. Wouldn't this take up a lot of disk space and also take a lot of time for the containers to boot? No—because every container does not need its own copy of the filesystem! + +Containers and images use a copy-on-write mechanism to achieve this. Instead of copying files, the copy-on-write strategy shares the same instance of data to multiple processes and copies only when a process needs to modify or write data. All other processes would continue to use the original data. Before any write operation is performed in a running container, a copy of the file to be modified is placed on the writeable layer of the container. This is where the _write_ takes place. Now you know why it's called _copy-on-write_. + +This strategy optimizes both image disk space usage and the performance of container start times and works in conjunction with UnionFS. + +### Overlay File System + +An overlay sits on top of an existing filesystem, combines an upper and lower directory tree, and presents them as a single directory. These directories are called _layers_. The lower layer remains unmodified. Each layer adds only the difference (the _diff_, in computing terminology) from the layer below it, and this unification process is referred to as a _union mount_. + +The lowest directory or an Image layer is called _lowerdir_, and the upper directory is called _upperdir_. The final overlayed or unified layer is called _merged._ + +![Layered file system][3] + +Image CC BY-SA opensource.com + +Common terminology consists of these layer definitions: + + * Base layer is where the files of your filesystem are located. In terms of container images, this layer would be your base image. + * Overlay layer is often called the _container layer_, as all the changes that are made to a running container, as adding, deleting, or modifying files, are written to this writable layer. All changes made to this layer are stored in the next layer, and is a _union_ view of the Base and Diff layers. + * Diff layer contains all changes made in the Overlay layer. If you write something that's already in the Base layer, then the overlay file system copies the file to the Diff layer and makes the modifications you intended to write. This is called a _copy-on-write_. + + + +# Snapshotters + +Containers can build, manage, and distribute changes as a part of their container filesystem using layers and graph drivers. But working with graph drivers is really complicated and is error-prone. SnapShotters are different from graph drivers, as they have no knowledge of images or containers. + +Snapshotters work very similar to Git, such as the concept of having trees, and tracking changes to trees for each commit. A _snapshot_ represents a filesystem state. Snapshots have parent-child relationships using a set of directories. A _diff can_ be taken between a parent and its snapshot to create a layer. + +The Snapshotter provides an API for allocating, snapshotting, and mounting abstract, layered file systems. + +### Wrap up + +You now have a good sense of what container images are and how their layered approach makes containers portable. Next up, I'll cover container runtimes and internals. + +* * * + +_This article is based on a [techbeatly][4] article and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/container-image + +作者:[Nived V][a] +选题:[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/nivedv +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers.png?itok=d_4QhZxT (Shipping containers stacked) +[2]: https://opensource.com/sites/default/files/unionfs.png (UnionFS) +[3]: https://opensource.com/sites/default/files/rect1036.png (Layered file system) +[4]: https://medium.com/techbeatly/container-part-ii-images-4f2139194775 From 610cd01cb58d50c8bedd099b0bed823c2054b9b1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Sep 2021 05:03:46 +0800 Subject: [PATCH 062/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210831=20?= =?UTF-8?q?How=20my=20team=20built=20an=20open=20source=20learning=20exper?= =?UTF-8?q?ience=20platform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210831 How my team built an open source learning experience platform.md --- ...pen source learning experience platform.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/tech/20210831 How my team built an open source learning experience platform.md diff --git a/sources/tech/20210831 How my team built an open source learning experience platform.md b/sources/tech/20210831 How my team built an open source learning experience platform.md new file mode 100644 index 0000000000..b9a8cc6dbc --- /dev/null +++ b/sources/tech/20210831 How my team built an open source learning experience platform.md @@ -0,0 +1,64 @@ +[#]: subject: "How my team built an open source learning experience platform" +[#]: via: "https://opensource.com/article/21/8/open-source-lms" +[#]: author: "Tesh Patel https://opensource.com/users/tesh" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How my team built an open source learning experience platform +====== +Open source powers innovation through community and shared experiences. +![Student desk for open education][1] + +Learning is based on the open exchange of ideas and experiences. By sharing, testing, and practicing what we've learned with others, we're able to develop in our lives and careers. It follows that openness is the ideal state for any successful learning organization.  + +I am passionate about learning, building teams, and technology. At Red Hat, we believe that open source powers innovation and results in better solutions. Five years ago, our learning management system was proprietary and closed. All of our learning platforms existed as islands with limited integration and provided a mediocre user experience. Over the past five years, our team has embraced the open source ethos. We've built and implemented new open source platforms, integrated our disparate learning platforms allowing us to freely exchange data and create a superior user experience. + +If you're a fellow member of a learning organization, I hope you might find it helpful to hear about our experience so far and perhaps even join us as we seek to influence the future of learning.  + +### Unlocking potential + +Our previous LMS served as the primary back-office system, system of record, and front-end experience for our learners. To put it plainly, it didn't serve any of those functions well. Our data was locked up in the vendor's vault. We had to live with the LMS's limited reporting capability or extract the data and manually manipulate it in spreadsheets. Perhaps worst of all, our learners faced a mediocre front-end system with a less-than-intuitive user experience. To live with our LMS, we had to create inefficient processes and workarounds. + +And so, in 2016, we began our journey to open source learning by replacing our proprietary LMS with [Totara Learn, an open source LMS][2].  + +By moving to Totara Learn, we unlocked our data and turned our attention to improving the user experience for our learners.  + +### Identifying the ecosystem + +Our learning ecosystem consists of more than just an LMS. In addition to our own content, we have access to content from third-party libraries, user-generated video content, virtual classroom tools for delivering online classes, and virtualized labs. + +We knew we needed a single interface to disguise our complex learning platforms and tools and deliver one seamless experience to the learner. Initially, we tried customizing Totara Learn for this purpose. It's a great platform, but we eventually realized it wasn't cost-effective for us to remodel it from the ground up. What we needed was a platform designed for our unique requirements. + +### Focusing on the learner + +In 2017, as my team pondered our learning ecosystem challenges, an emerging category of products called learning experience platforms (LXP) emerged. I found several LXP vendors who claimed to solve problems with the learning experience. Many described their platform's experience as the "Netflix of learning."  + +In my experience, I've found that learning isn't suited to a Netflix-like environment. The notion of randomly perusing learning, enrolling in a program, and then abandoning as it gets more challenging or less interesting—as you do with Netflix shows—is the antithesis of what our continuous learning philosophy encourages. Real learning that builds skills and capabilities requires an intentional focus and an ongoing commitment with a learn, practice, reflection, feedback loop.  + +As my team compiled the requirements for an LXP, we quickly realized we were just at the beginning of determining what we'd need to build to create the best learning experience for our users. The requirements would continue to grow and evolve, so we needed a platform that could do the same. The idea for the Open Learning Platform (OLP) was born. + +### Our open invitation + +The OLP is a learning experience platform (LXP) that provides a personalized, online learning experience for users—typically employees at large enterprises. It consolidates disparate learning resources into a single portal. These days, learning can happen anywhere and in many forms. An LXP helps employees discover learning opportunities—offering ways to enhance them and manages their education. We've spent three years developing and building the OLP to meet the learning needs of users and educators. The OLP has come a long way, but we also know we're very much still on the journey.  + +Since the inception of the OLP, we knew we wanted it to be an open source project. Why invest time and energy in open sourcing the platform we've built over several years? Simple. We want to learn from the experiences and innovation of others and form a community that will help determine what the LMS and LXP of the future should be. We want to move past a cost-per-user licensing model and the limitations in thinking when the sole focus is to monetize a product. If even one other learning organization benefits from our open source project, then it will have been worth the investment of our time. We welcome you to join the conversation at[ Open Learning Platform][3]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/open-source-lms + +作者:[Tesh Patel][a] +选题:[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/tesh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolseriesgen_rh_032x_0.png?itok=cApG9aB4 (Student desk for open education) +[2]: https://github.com/totara +[3]: https://www.openlearningplatform.org/ From 8e88814b1550b52a4fb70d16d1c854f9a19fe56d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Sep 2021 05:06:20 +0800 Subject: [PATCH 063/138] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210831=20?= =?UTF-8?q?Ransomware=20Disguised=20as=20Open-Source=20Krita=20Painting=20?= =?UTF-8?q?App=20Promo=20Video?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210831 Ransomware Disguised as Open-Source Krita Painting App Promo Video.md --- ...n-Source Krita Painting App Promo Video.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/news/20210831 Ransomware Disguised as Open-Source Krita Painting App Promo Video.md diff --git a/sources/news/20210831 Ransomware Disguised as Open-Source Krita Painting App Promo Video.md b/sources/news/20210831 Ransomware Disguised as Open-Source Krita Painting App Promo Video.md new file mode 100644 index 0000000000..80108b8fde --- /dev/null +++ b/sources/news/20210831 Ransomware Disguised as Open-Source Krita Painting App Promo Video.md @@ -0,0 +1,76 @@ +[#]: subject: "Ransomware Disguised as Open-Source Krita Painting App Promo Video" +[#]: via: "https://news.itsfoss.com/krita-email-scam/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ransomware Disguised as Open-Source Krita Painting App Promo Video +====== + +Ransomware attacks are exponentially increasing. And, the way it gets distributed evolves every day. + +One of the most effective ways is by using reputable brand names to lure users into downloading malicious files that may end up encrypting your files and demand a ransom. + +And, in this case, some scammers have started using Krita’s name to deceive users through email. + +### Spreading Malware via Email as Krita Officials + +The attackers disguise themselves as the team for Krita, one of the best [digital open-source painting app][1]. + +The email mentions that Krita wants to collaborate with your YouTube channel or your social media space to share promotional videos about their software/product. + +And, they mention that this is a paid advertising campaign, so you think you are getting a reward for promoting Krita. + +Here’s how the email looks like (as shared by [Krita on Twitter][2]): + +![][3] + +Once you show interest in promoting Krita, they send you a follow-up mail instructing you to download a press kit containing screenshots, videos, and other materials. + +The link may look similar to the official one like _krita.io, krita.net_, etc. + +In a detailed video shared by a Twitter user, you can see that the link they share is malicious and sometimes goes undetected by Google’s safe browsing feature: + +> Recently, I received the same email. Though I know this is likely a scam, I decided to proceed further just to see how far will they take us. They asked me to download some files and you can watch the full video here: [pic.twitter.com/P1K2tlHiT4][4] +> +> — Inside Electronics (@InsideElectro) [August 29, 2021][5] + +While I agree that this is not the best attempt to distribute malware, not everyone is as attentive as this user here. + +### Never Trust an Email Without Proper Verification + +It is easy for attackers to send you emails that you expect or something that may spark an interest in your work. + +Scammers do their homework to know what you like, but always stay cautious no matter what or who appears to be sending the email. + +If an email explicitly asks to enter your personal information, download an attachment, or visit a website to download a file, you need to double-check if it comes from an official source. + +Generally, officials do not ask you to download any file or personal information unless you took action first. So, it is always wise to think twice and run a background check for what you interact with via emails. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/krita-email-scam/ + +作者:[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://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/open-source-paint-apps/ +[2]: https://twitter.com/Krita_Painting/status/1432295734074880003 +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI3OSIgd2lkdGg9IjU4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://t.co/P1K2tlHiT4 +[5]: https://twitter.com/InsideElectro/status/1431938502862663680?ref_src=twsrc%5Etfw From e7e17c019315d4f1da17dfa58024eb2f131486f1 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Wed, 1 Sep 2021 08:30:06 +0800 Subject: [PATCH 064/138] translating by perfiffer --- ...210829 Position text on your screen in Linux with ncurses.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210829 Position text on your screen in Linux with ncurses.md b/sources/tech/20210829 Position text on your screen in Linux with ncurses.md index 997ce16c43..644d88a9ff 100644 --- a/sources/tech/20210829 Position text on your screen in Linux with ncurses.md +++ b/sources/tech/20210829 Position text on your screen in Linux with ncurses.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/ncurses-linux" [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 6e3511a65dc9a24697e8f0ebedcc1bb8e3449fb4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 1 Sep 2021 08:39:12 +0800 Subject: [PATCH 065/138] translated --- ...ux kernel modules we can-t live without.md | 121 ----------------- ...ux kernel modules we can-t live without.md | 122 ++++++++++++++++++ 2 files changed, 122 insertions(+), 121 deletions(-) delete mode 100644 sources/tech/20210827 Linux kernel modules we can-t live without.md create mode 100644 translated/tech/20210827 Linux kernel modules we can-t live without.md diff --git a/sources/tech/20210827 Linux kernel modules we can-t live without.md b/sources/tech/20210827 Linux kernel modules we can-t live without.md deleted file mode 100644 index 82d66505d7..0000000000 --- a/sources/tech/20210827 Linux kernel modules we can-t live without.md +++ /dev/null @@ -1,121 +0,0 @@ -[#]: subject: "Linux kernel modules we can't live without" -[#]: via: "https://opensource.com/article/21/8/linux-kernel-module" -[#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Linux kernel modules we can't live without -====== -Open source enthusiasts weigh in on the Linux kernel modules they love. -![Linux keys on the keyboard for a desktop computer][1] - -The Linux kernel is turning 30 this year! If you're like us, that's a big deal and we are celebrating Linux this week with a couple of special posts. - -Today we start with a roundup of responses from around the community answering "What Linux kernel module can you not live without? And, why?" Let's hear what these 10 enthusiasts have to say. - -* * * - -I guess some kernel developers will run away screaming when they hear my answer. Still, I list here two of the most controversial modules: - - * First is NVIDIA, as I have an NVIDIA graphics card on my work laptop and my personal desktop. - * The other one probably generates less hatred—the VMNET and VMMON modules from VMware to be able to run VMware Workstation. —[Peter Czanik][2] - - - -* * * - -My favorite is the [zram][3] module. It creates a compressed block device in memory, which can then be used as a swap partition. Using a zram-based swap partition is ideal when memory is limited (for example, on virtual machines) and if you are worried about wearing out your SSD or, even worse, your flash-based storage because of frequent I/O operations. —[Stephan Avenwedde][4] - -* * * - -The most useful kernel module is definitively snd-hda-intel since it supports most integrated sound cards. I listen to music while coding an audio sequencer on the Linux desktop. —[Joël Krähemann][5] - -* * * - -My laptop would be worthless without the kmod-wl that I generate with the Broadcom file. I sometimes get messages about tainting the kernel, but what good is a laptop without wireless? —[Gregory Pittman][6] - -* * * - -I can't live without Bluetooth. Without it, my mouse, keyboard, speakers, and headset would be doorstops. —[Gary Smith][7] - -* * * - -I'm going to go out on a limb and say _all of them_. Seriously, we've gotten to the point where I grab a random piece of hardware, plug it in, and it just works. - - * USB serial adapter just works - * Video card just works (though maybe not at its best) - * Network card just works - * Sound card just works - - - -It's tough not to be utterly impressed with the broad scope of the driver work that all the modules bring to the whole. I remember the bad old days when we used to yell out xrandr magic strings to make projectors work, and now—yeah, it's a genuine rarity when stuff doesn't (mostly) just work. - -If I had to nail it down to one, though, it'd be raid6. —[John 'Warthog9' Hawley][8] - -* * * - -I'm going to go back to the late 1990s for this one. I was a Unix systems administrator (and double duty as IS manager) for a small company. Our tape backup system died, and because of "small company" limited budgets, we didn't have a rush replacement or onsite repair on it. So we had to send it in for repair. - -During those two weeks, we didn't have a way to make tape backups. No systems administrator wants to be in that position. - -But then I remembered reading the [Floppy Tape How-to][9], and we happened to have a tower PC we'd just replaced that had a floppy tape drive. - -So I reinstalled it with Linux, set up the **ftape** kernel driver module, ran a few backup/recovery tests, then ran our most important backups to QIC tapes. For those two weeks, we relied on **ftape** backups of critical data. - -So to the unsung hero out there who made floppy tape drives work on 1990s Linux, you are awesome! —[Jim Hall][10] - -* * * - -Well, that's easy. It's the kvm kernel modules. On a personal front, I cannot imagine doing my day-to-day work without VMs. I'd like to believe that's the case with most of us. The kvm modules also play a big part in making Linux central to the cloud strategy. —[Gaurav Kamathe][11] - -* * * - -For me, it's dm-crypt, which is used for LUKS. See: - - * - * - - - -It's fantastic to know others cannot see what's on your disk, for example, if you lose your notebook or it gets stolen. —[Maximilian Kolb][12] - -* * * - -For cryptography basics, it's hard to beat the crypto module and its C API, which is straightforward. - -For day-to-day life, is there anything more valuable than the plug-and-play that Bluetooth provides? —[Marty Kalin][13] - -* * * - -Share with us in the comments: What Linux kernel module can you not live without? - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/linux-kernel-module - -作者:[Jen Wike Huger][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jen-wike -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: https://opensource.com/users/czanik -[3]: https://en.wikipedia.org/wiki/Zram -[4]: https://opensource.com/users/hansic99 -[5]: https://opensource.com/users/joel2001k -[6]: https://opensource.com/users/greg-p -[7]: https://opensource.com/users/greptile -[8]: https://opensource.com/users/warthog9 -[9]: https://tldp.org/HOWTO/Ftape-HOWTO.html -[10]: https://opensource.com/users/jim-hall -[11]: https://opensource.com/users/gkamathe -[12]: https://opensource.com/users/kolb -[13]: https://opensource.com/users/mkalindepauledu diff --git a/translated/tech/20210827 Linux kernel modules we can-t live without.md b/translated/tech/20210827 Linux kernel modules we can-t live without.md new file mode 100644 index 0000000000..88935c79b5 --- /dev/null +++ b/translated/tech/20210827 Linux kernel modules we can-t live without.md @@ -0,0 +1,122 @@ +[#]: subject: "Linux kernel modules we can't live without" +[#]: via: "https://opensource.com/article/21/8/linux-kernel-module" +[#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +我们离不开的 Linux 内核模块 +====== +开源爱好者们对他们所喜爱的 Linux 内核模块进行了评价。 +![Linux keys on the keyboard for a desktop computer][1] + +Linux 内核今年就要满 30 岁了! 如果你像我们一样,这是件大事,我们本周将用几个特别的帖子来庆祝 Linux。 + +今天,我们先来看看来自社区的回复,回答“你不能没有哪个 Linux 内核模块?为什么?”让我们听听这 10 位爱好者是怎么说的。 + +* * * + +我猜一些内核开发者听到我的回答后会尖叫着跑开。不过,我还是在这里列出了两个最具争议性的模块“ + + * 第一个是 NVIDIA,因为我的工作笔记本和个人台式机上都有 NVIDIA 显卡。 + * 另一个可能产生的仇恨较少。VMware 的 VMNET 和 VMMON 模块,以便能够运行 VMware Workstation。—[Peter Czanik][2] + + + +* * * + +我最喜欢的是 [zram][3] 模块。它在内存中创建了一个压缩块设备,然后可以作为交换分区使用。在内存有限的情况下(例如,在虚拟机上),还有如果你担心频繁的 I/O 操作会磨损你的 SSD 或者甚至更糟糕的是基于闪存的存储,那么使用基于 zram 的交换分区是非常理想的。—[Stephan Avenwedde][4] 。 + +* * * + +最有用的内核模块无疑是 snd-hda-intel,因为它支持大多数集成声卡。我一边听音乐,一边在 Linux 桌面上编码一个音频编曲器。—[Joël Krähemann][5] + +* * * + +如果没有我用 Broadcom 文件生成的 kmod-wl,我的笔记本就没有价值了。我有时会收到关于内核污染的信息,但没有无线的笔记本电脑有什么用呢?—[Gregory Pittman][6] 。 + +* * * + +我不能没有蓝牙。没有它,我的鼠标、键盘、扬声器和耳机就成了门板。—[Gary Smith][7] + +* * * + +我要冒昧地说_所有这些_都是。 说真的,我们已经到了随机拿一块硬件,插入它,它就可以工作的地步。 + + * USB 串行适配器能正常工作 + * 显卡可以使用(尽管可能不是最好的)。 + * 网卡正常工作 + * 声卡正常工作 + + + +很难不对所有模块为整体带来的广泛的驱动程序工作印象深刻。我记得在过去的坏日子里,我们曾经大喊 xrandr 魔法字符串来使投影仪工作。而现在,是的,当东西(大部分)不能正常工作时,这是一种真正的罕见。 + +如果我不得不把它归结为一个,那就是 raid6。—[John 'Warthog9' Hawley][8] + +* * * + +对于这个问题,我想回到 20 世纪 90 年代末。我是一家小公司的 Unix 系统管理员(兼任 IS 经理)。我们的磁带备份系统死了,由于“小公司”预算有限,我们没有急于更换或现场维修。所以我们不得不把它送去维修。 + +在那两个星期里,我们没有办法进行磁带备份。没有一个系统管理员愿意处于这种境地。 + +但后来我想起了读过的[如何使用软盘磁带机][9],我们刚好有一台刚换下来的塔式电脑,有一个软磁带驱动器。 + +于是我用 Linux 重新安装了它,设置了 **ftape** 内核驱动模块,进行了一些备份/恢复测试,然后将我们最重要的备份运行到 QIC 磁带上。在这两个星期里,我们依靠 **ftape** 备份重要数据。 + +所以,对于那些让软盘磁带机在 1990 年代的 Linux 上工作的无名英雄,你真是太厉害了!—[Jim Hall][10] + +* * * + +嗯,这很简单。是 kvm 内核模块。在个人方面,我无法想象在没有虚拟机的情况下做我的日常工作。我愿意相信我们大多数人都是这样。kvm 模块在使 Linux 成为云战略的核心方面也发挥了很大作用。—[Gaurav Kamathe][11] + +* * * + +对我来说,是 dm-crypt,它是用于 LUKS 的。见: + + * + * + + + +知道别人无法看到你的磁盘上的内容是非常棒的,例如,如果你的笔记本丢失或被盗时。—[Maximilian Kolb][12] + + +* * * + +对于密码学基础,很难超越 crypto 模块和它的 C API,它很简单。 + +在日常生活中,还有什么比蓝牙提供的即插即用更有价值的吗?—[Marty Kalin][13] + +* * * + +在评论中与我们分享。你的生活中不能没有什么 Linux 内核模块? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-kernel-module + +作者:[Jen Wike Huger][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/jen-wike +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/users/czanik +[3]: https://en.wikipedia.org/wiki/Zram +[4]: https://opensource.com/users/hansic99 +[5]: https://opensource.com/users/joel2001k +[6]: https://opensource.com/users/greg-p +[7]: https://opensource.com/users/greptile +[8]: https://opensource.com/users/warthog9 +[9]: https://tldp.org/HOWTO/Ftape-HOWTO.html +[10]: https://opensource.com/users/jim-hall +[11]: https://opensource.com/users/gkamathe +[12]: https://opensource.com/users/kolb +[13]: https://opensource.com/users/mkalindepauledu From b761522b35c29cfb1055e234e8aa292e9cbefa9f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 Sep 2021 08:40:02 +0800 Subject: [PATCH 066/138] Rename sources/tech/20210831 How my team built an open source learning experience platform.md to sources/talk/20210831 How my team built an open source learning experience platform.md --- ...w my team built an open source learning experience platform.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210831 How my team built an open source learning experience platform.md (100%) diff --git a/sources/tech/20210831 How my team built an open source learning experience platform.md b/sources/talk/20210831 How my team built an open source learning experience platform.md similarity index 100% rename from sources/tech/20210831 How my team built an open source learning experience platform.md rename to sources/talk/20210831 How my team built an open source learning experience platform.md From cc8dab102d67e966bc5389ac8daf6ebecdeac335 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 1 Sep 2021 08:42:45 +0800 Subject: [PATCH 067/138] translating --- ...31 Zulip- An Interesting Open-Source Alternative to Slack.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md b/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md index af9e6da063..973cf54ef5 100644 --- a/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md +++ b/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/zulip/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From e86ec514a951c1a3123c6b0f6b3a03f651d2455f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 09:52:08 +0800 Subject: [PATCH 068/138] PRF @imgradeone --- ...n Review - Late Arrival but a Solid One.md | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md index 9dc75059d3..600d8fcebd 100644 --- a/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md +++ b/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md @@ -3,19 +3,22 @@ [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lujun9972" [#]: translator: "imgradeone" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -elementary OS 6 Odin 评测 – 迟到的新版本,但也实至名归 +elementary OS 6 Odin 评测:迟到的新版本,但也实至名归 ====== -> 这篇 elementary OS 6 的评测将为您呈现该系统在旧款测试设备上的表现。 + +> 这篇 elementary OS 6 的评测将为你呈现该系统在旧款测试设备上的表现。 + +![](https://img.linux.net.cn/data/attachment/album/202109/01/095116zk73wcc4g5clnvq8.jpg) elementary OS 的粉丝们焦急等待 elementary OS 6 Odin 发布已经将近两年了。如此焦急的原因,主要在于早期版本 elementary OS 5.1 的内核和软件包在 2021 年来说过于陈旧。而且,这一旧版本基于 Ubuntu 18.04 LTS 构建。因此,用户都急切地等待着基于 Ubuntu 20.04 LTS 的全新版本 —— 最重要的是,Ubutnu 20.04 LTS 已经发布一年,接下来也将有下一个 LTS 版本发布。 你应该也明白的,过长的等待时间,很可能导致用户跳槽到其他发行版。 -但即便如此,新版本终于还是 [在 8 月发布了][1],它也在用户和粉丝群体中引起了很大的轰动。 +但即便如此,新版本终于还是 [在 8 月发布了][1],它在用户和粉丝群体很受欢迎。 于是,我在一周前为一台旧设备(我知道新设备的体验会更好)安装了 elementary OS 6 Odin,下面就是测评。 @@ -23,7 +26,7 @@ elementary OS 的粉丝们焦急等待 elementary OS 6 Odin 发布已经将近 ### elementary OS 6 Odin 测评 -测试设备 +测试设备: * CPU – Intel Core i3,4 GB 运行内存 * 硬盘 – SSD 固态硬盘 @@ -31,23 +34,19 @@ elementary OS 的粉丝们焦急等待 elementary OS 6 Odin 发布已经将近 #### 安装 -在这一版本中,elementary 团队针对 elementary OS 安装器做了易用性优化,而这一次的安装器也是自制安装器。新安装器减少了安装前的准备步骤,虽然它还是需要依赖 GParted 进行分区操作(当然 GParted 本身是一款不错的工具)。 +在这一版本中,elementary 团队针对他们自制的 elementary OS 安装器做了易用性优化。新安装器减少了安装前的准备步骤,虽然它还是需要依赖 GParted 进行分区操作(当然 GParted 本身是一款不错的工具)。 -在前述测试设备中,安装过程大约花费了 10 分钟,没有任何报错。初始化之后,GRUB 也正常更新,没有任何意外。这是一个带有 Legacy BIOS 的三系统启动器。 - - +在前述测试设备中,安装过程大约花费了 10 分钟,没有任何报错。安装完之后,GRUB 也正常更新,没有任何意外。这是一个安装在老式 BIOS 上多引导系统。 #### 初见印象 -如果你刚听说 elementary OS 和 Pantheon 桌面,或者从其他传统菜单型桌面环境迁移过来,你可能需要一两天时间来适应这款桌面。当然,如果你已经是 elementary OS 的老用户的话,那么你将获得一致的体验,外加性能和外观的优化。 +如果你刚听说 elementary OS 和 Pantheon 桌面,或者从其他传统的菜单型桌面环境迁移过来,你可能需要一两天时间来适应这款桌面。当然,如果你已经是 elementary OS 的老用户的话,那么你将获得一致的体验,外加性能和外观的优化。 你应该可以察觉到一些明显可见的 [elementary OS 6 的新特性][3],像是强调色、原生暗黑模式,以及一组不错的新壁纸。 -[][4] - #### 稳定性与性能 -我已经使用 elementary OS 6 Odin 超过一周的时间。在日常使用后,我只能说,它很稳定,没有突然的崩溃和意外。其他额外软件(需要从 apt 独立安装)也运作正常,没有性能损耗。 +我已经使用 elementary OS 6 Odin 超过一周的时间。在日常使用后,我只能说,它很稳定,没有突然的崩溃和意外。其他(通过 `apt` 单独安装的)额外软件也运作正常,性能也没有降低。 在近乎闲置的情况下,CPU 使用率处在 5%-10% 之间,内存占用约为 900 MB。CPU / 内存的消耗主要分配在 Gala(Pantheon 的窗口管理器)、Wingpanel(顶栏)和应用中心。 @@ -57,13 +56,11 @@ elementary OS 的粉丝们焦急等待 elementary OS 6 Odin 发布已经将近 #### 应用程序与应用中心 -elementary OS 的应用程序列表经过精选,几乎所有类型的软件都可以从应用中心获取,包括 Flatpak 应用。不过,elementary OS 并没有预装一些重要的应用程序,像是 Firefox、LibreOffice、Torrent 客户端、硬盘分区工具、照片编辑器之类 —— 这些重要的程序需要在安装系统后再自行安装。我认为预装软件这一块有很大的改进空间。 +elementary OS 的应用程序列表经过精选,几乎所有类型的软件都可以从应用中心获取,包括 Flatpak 应用。不过,elementary OS 默认并没有预装一些重要的应用程序,像是 Firefox、LibreOffice、Torrent 客户端、硬盘分区工具、照片编辑器之类 —— 这些重要的程序需要在安装系统后再自行安装。我认为预装软件这一块有很大的改进空间。 ### 结束语 -在这一周的测试中,我也多次遇到了一个 bug,Wi-Fi 有时会突然断开,不过这完全是 Ubuntu 20.04 上游的问题 —— 多年以来,它一直有奇怪的 Wi-Fi 问题。抛开这个问题,elementary OS 确实是一款稳定、优秀的 Linux 发行版。如果 elementary OS 有滚动更新的版本,也许会更好。因此,这是一款值得推荐的发行版,尤其适合 macOS 的迁移者。 - -* * * +在这一周的测试中,我也多次遇到了一个 bug,Wi-Fi 有时会突然断开,不过这完全是上游 Ubuntu 20.04 的问题 —— 多年以来,它一直有奇怪的 Wi-Fi 问题。抛开这个问题,elementary OS 确实是一款稳定、优秀的 Linux 发行版。如果 elementary OS 有滚动更新的版本,也许会更好。因此,这是一款值得推荐的发行版,尤其适合那些从 macOS 迁移过来的人。 -------------------------------------------------------------------------------- @@ -71,8 +68,8 @@ via: https://www.debugpoint.com/2021/08/elementary-os-6-odin-review/ 作者:[Arindam][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[imgradeone](https://github.com/imgradeone) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c2d5bdc913a65424826e29ec74908cf92c812a3e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 09:52:56 +0800 Subject: [PATCH 069/138] PUB @imgradeone https://linux.cn/article-13739-1.html --- ...mentary OS 6 Odin Review - Late Arrival but a Solid One.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md (98%) diff --git a/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/published/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md similarity index 98% rename from translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md rename to published/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md index 600d8fcebd..906a2faf90 100644 --- a/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md +++ b/published/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "imgradeone" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13739-1.html" elementary OS 6 Odin 评测:迟到的新版本,但也实至名归 ====== From ec8f8a35a9c43ab60a3b1adc6fc8496e4cca8264 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 10:46:14 +0800 Subject: [PATCH 070/138] PRF @fisherue --- ...821 How to set up your printer on Linux.md | 56 +++++++++---------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/translated/tech/20210821 How to set up your printer on Linux.md b/translated/tech/20210821 How to set up your printer on Linux.md index 57929be7dc..382dd6908e 100644 --- a/translated/tech/20210821 How to set up your printer on Linux.md +++ b/translated/tech/20210821 How to set up your printer on Linux.md @@ -2,85 +2,79 @@ [#]: via: "https://opensource.com/article/21/8/add-printer-linux" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: "fisherue " -[#]: reviewer: " " +[#]: translator: "fisherue" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 如何在 Linux 系统设置打印机 ====== -如果系统没有自动检测到你的打印机,这篇文章教你任何在 Linux 系统手动添加打印机。 -![printing on Linux][1] -即使未来已来,电子墨水 (e-ink) 和 AR 技术可以现实应用,我们还是会用到打印机的。打印机制造商还不能做到让自己的专利打印机可以与各种计算机完全标准化传递信息,以至于我们需要各种打印机驱动程序,在任何操作系统上都是如此。电子电气工程师协会信息科学与技术处 (IEEE-ISTO) 下属的打印机工作组 (PWG) 和开放打印技术组织 (OpenPrinting.org) 长期合作致力于让人们可以(使用任何型号打印机)轻松打印。带来的便利就是,很多打印机可以不需要用户进行配置就可以自动被识别使用。 +> 如果系统没有自动检测到你的打印机,这篇文章教你如何在 Linux 系统手动添加打印机。 -如果系统没有自动检测到你的打印机,你可以在这篇文章中找到如何在 Linux 系统手动添加打印机。文中假定你使用的是 GNOME 图形桌面系统,其设置流程同样适用于 KDE 或其他多数桌面系统。 +![](https://img.linux.net.cn/data/attachment/album/202109/01/104541gvvxvriei677o76v.jpg) + +即使未来已来,电子墨水e-ink和 AR 技术可以现实应用,我们还是会用到打印机的。打印机制造商还不能做到让自己的专利打印机可以与各种计算机完全标准化传递信息,以至于我们需要各种打印机驱动程序,在任何操作系统上都是如此。电子电气工程师协会信息科学与技术处(IEEE-ISTO)下属的打印机工作组(PWG)和开放打印技术组织(OpenPrinting.org)长期合作致力于让人们可以(使用任何型号打印机)轻松打印。带来的便利就是,很多打印机可以不需要用户进行配置就可以自动被识别使用。 + +如果系统没有自动检测到你的打印机,你可以在这篇文章中找到如何在 Linux 系统手动添加打印机。文中假定你使用的是 GNOME 图形桌面系统,其设置流程同样适用于 KDE 或其他大多数桌面系统。 ### 打印机驱动程序 -在你尝试用打印机打印文件时,要先确认你的 Linux 系统上是不是已经安装了匹配的打印机驱动程序。 +在你尝试用打印机打印文件时,要先确认你的 Linux 系统上是不是已经安装了更新的打印机驱动程序。 可以尝试安装的打印机驱动程序有三大类: - * 在你的 Linux 系统作为安装包提供的开源打印机驱动程序 [Gutenprint drivers][2] + * 作为安装包提供的,捆绑在你的 Linux 系统上的开源 [Gutenprint 驱动程序][2] * 打印机制造商提供的专用驱动程序 * 第三方开发提供的打印机驱动程序 - - 开源打印机驱动程序库可以驱动 700 多种打印机,值得安装,这里面可能就有你的打印机的驱动,说不定可以自动设置好你的打印机(,你就可以使用它了)。 ### 安装开源驱动程序包(库) -有些 Linux 发行版已经预装了开源打印机驱动程序包,如果没有,你可以用包管理器来安装。比如说,在 Fedora, CentOS, Magela 等类似发行版的 Linux 系统上,执行下面命令来安装: - +有些 Linux 发行版已经预装了开源打印机驱动程序包,如果没有,你可以用包管理器来安装。比如说,在 Fedora、CentOS、Magela 等类似发行版的 Linux 系统上,执行下面命令来安装: ``` -`$ sudo dnf install gutenprint` +$ sudo dnf install gutenprint ``` -惠普 (HP) 系列的打印机,还需要安装惠普的 Linux 图形及打印系统软件包 (Hewlett-Packard's Linux Imaging and Printing (HPLIP) ). 类似 Debian, Linux Mint 等系列的系统,使用下面的命令: - +惠普(HP)系列的打印机,还需要安装惠普的 Linux 图形及打印系统软件包(HPLIP)。如在 Debian、Linux Mint 等类似的系统上,可以使用下面的命令: ``` -`$ sudo apt install hplip` +$ sudo apt install hplip ``` ### 安装制造商提供的驱动程序 -很多时候因为打印机制造商使用非标准的接口协议,这种情况开源打印机驱动程序就不能驱动打印机。另外的情况就是,开源驱动程序可以驱动打印机工作,但是会缺少品牌特有的有些性能。这些情况,你需要访问制造商的网站,找到适合你的打印机型号的 Linux 平台驱动。安装过程各异,仔细阅读安装指南逐步安装。 +很多时候因为打印机制造商使用了非标准的接口协议,这种情况开源打印机驱动程序就不能驱动打印机。另外的情况就是,开源驱动程序可以驱动打印机工作,但是会缺少供应商特有的某些性能。这些情况,你需要访问制造商的网站,找到适合你的打印机型号的 Linux 平台驱动。安装过程各异,仔细阅读安装指南逐步安装。 -即便是厂家的驱动也不能驱动你的打印机工作,你或许也只能尝试第三方提供的该型号打印机的驱动软件 ([third-party driver authors][3]) 了。这类第三方驱动程序不是开源的,和打印机专用驱动程序一样闭源。如果你需要额外花费 45 美元(约 400 员人民币)从供应商那里获取帮助服务才能安装好驱动并使用你的打印机,那是很心疼,或者你索性把这台打印机扔掉,至少你知道下次再也不会购买这个品牌的打印机了。(译者注:国内售后服务收费没有北美那么高,有需要还是先电话咨询售后,有没有 Linux 平台的专用驱动可真是碰运气。) +如果你的打印机根本不被厂商支持,你或许也只能尝试第三方提供的该型号打印机的驱动软件了。这类第三方驱动程序不是开源的,但大多数打印机的专用驱动程序也不是。如果你需要额外花费从供应商那里获取帮助服务才能安装好驱动并使用你的打印机,那是很心疼,或者你索性把这台打印机扔掉,至少你知道下次再也不会购买这个品牌的打印机了。 -### 统一接口打印驱动系统(CUPS) +### 通用打印驱动系统(CUPS) -统一接口打印驱动系统 (CUPS) 是由 Easy Software Products 公司于 1997 年开发的,2007 年被苹果公司 (Apple) 收购。这是 Linux 平台打印的开源基础软件包,很多改进的发行版本提供定制化的界面。得益于 CUPS 技术,你可以发使用通过 USB 接口连接到电脑的打印机,甚至连接在同一网络的共享打印机。 +通用打印驱动系统Common Unix Printing System(CUPS)是由 Easy Software Products 公司于 1997 年开发的,2007 年被苹果公司收购。这是 Linux 平台打印的开源基础软件包,大多数现代发行版都为它提供了一个定制化的界面。得益于 CUPS 技术,你可以发现通过 USB 接口连接到电脑的打印机,甚至连接在同一网络的共享打印机。 -一旦你安装了需要的驱动程序包,你就能手工添加你的打印机了。首先,把打印机连接到运行的电脑上,并打开打印机电源。然后从启动器 **(Activities**)或者应用列表中找到并打开打印机设置**(Printers)**。![printer settings][4] +一旦你安装了需要的驱动程序包,你就能手工添加你的打印机了。首先,把打印机连接到运行的电脑上,并打开打印机电源。然后从“活动”屏幕或者应用列表中找到并打开“打印机”设置。 -CC BY-SA Opensource.com +![printer settings][4] 基于你已经安装的驱动包,你的 Linux 系统有可能自动检测识别到你的打印机型号,不需要额外的设置就可以使用你的打印机了。 ![printer settings][5] -CC BY-SA Opensource.com - 一旦你在列表中找到你的打印机型号,设置使用这个驱动,恭喜你就可以在 Linux 系统上用它打印了。 -(如果你的打印机没有被自动识别,)你需要自行添加打印机。在打印机设置界面**(Printers)**,点击右上角的解锁按钮(**Unlock**),输入管理用户密码,按钮转换成**添加打印机**按钮 (**Add**) 。 +(如果你的打印机没有被自动识别,)你需要自行添加打印机。在“打印机”设置界面,点击右上角的解锁按钮,输入管理用户密码,按钮转换成“添加打印机”按钮。 -然后点击这个**添加打印机**按钮 (**Add**) ,电脑会搜索已经连接的本地打印机型号并匹配相应驱动程序。如果要添加网络共享打印机,在搜索框输入打印机或者其服务器机的 IP 地址。 +然后点击这个“添加打印机”按钮,电脑会搜索已经连接的本地打印机型号并匹配相应驱动程序。如果要添加网络共享打印机,在搜索框输入打印机或者其服务器机的 IP 地址。 ![searching for a printer][6] -CC BY-SA Opensource.com - -选中你想添加的打印机型号,点击**添加**按钮 (**Add**) 把打印机驱动加入系统,就可以使用它了。 +选中你想添加的打印机型号,点击“添加”按钮把打印机驱动加入系统,就可以使用它了。 ### 在 Linux 系统上打印 -在 Linux 系统上打印很容易,不管你是在使用本地打印机还是网络打印机。如果你计划购买打印机,建议查看开放打印技术组织的(可支持打印机)数据库 ( [OpenPrinting.org database][7] ) ,看看你想购买的打印机是不是有相应的开源驱动程序。如果你已经拥有一台打印机,你现在也知道怎样在你的 Linux 系统上使用你的打印机了。 +在 Linux 系统上打印很容易,不管你是在使用本地打印机还是网络打印机。如果你计划购买打印机,建议查看开放打印技术组织的(可支持打印机)数据库([OpenPrinting.org][7]),看看你想购买的打印机是不是有相应的开源驱动程序。如果你已经拥有一台打印机,你现在也知道怎样在你的 Linux 系统上使用你的打印机了。 -------------------------------------------------------------------------------- @@ -89,7 +83,7 @@ via: https://opensource.com/article/21/8/add-printer-linux 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[fisherue](https://github.com/fisherue) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 57b1727316d4e95ac30d9856c4f58f7477a13609 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 10:47:13 +0800 Subject: [PATCH 071/138] PUB @fisherue https://linux.cn/article-13740-1.html --- .../20210821 How to set up your printer on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210821 How to set up your printer on Linux.md (98%) diff --git a/translated/tech/20210821 How to set up your printer on Linux.md b/published/20210821 How to set up your printer on Linux.md similarity index 98% rename from translated/tech/20210821 How to set up your printer on Linux.md rename to published/20210821 How to set up your printer on Linux.md index 382dd6908e..6e56331207 100644 --- a/translated/tech/20210821 How to set up your printer on Linux.md +++ b/published/20210821 How to set up your printer on Linux.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "fisherue" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13740-1.html" 如何在 Linux 系统设置打印机 ====== From 473246ef4cd422c0b75bf2f168f1148a1f1fd87d Mon Sep 17 00:00:00 2001 From: anine Date: Wed, 1 Sep 2021 12:02:33 +0800 Subject: [PATCH 072/138] =?UTF-8?q?=E6=9C=80=E6=96=B0=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 我重新同步了一遍 现在可以了 --- ... After Installing elementary OS 6 -Odin.md | 185 ----------------- ... After Installing elementary OS 6 -Odin.md | 187 ++++++++++++++++++ 2 files changed, 187 insertions(+), 185 deletions(-) delete mode 100644 sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md create mode 100644 translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md diff --git a/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md deleted file mode 100644 index 910bf3ad32..0000000000 --- a/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md +++ /dev/null @@ -1,185 +0,0 @@ -[#]: subject: "10 Things to Do After Installing elementary OS 6 “Odin”" -[#]: via: "https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: "anine09" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -10 Things to Do After Installing elementary OS 6 “Odin” -====== -A curated list of things to do after installing the latest elementary OS -6 code-named “Odin”._Pre-step_Applications > System Settings > Desktop -The [elementary OS 6 “Odin” released][1] a while back after more than two years in development. It brings a huge set of new features across its core modules, Pantheon desktop, native applications. This release is based on the Ubuntu 20.04 LTS. - -That said, if you already completed the installation, there are certain customization that you might want to try out to personalize your system. The options those described here are generic and may not be useful for you at certain cases, but we feel it’s worth to list down some basics and give you a path to explore more of this beautiful elementary OS. - -### Things to Do After Installing elementary OS 6 “Odin” - -Make sure you connect to the internet first. You can get the list of networks available in the notification area at the top. - -#### 1\. Change hostname - -This might not be the first thing you would like to do. However, I am not sure why an option not given changing the hostname during installation itself. For example, see below terminal prompt, the hostname is the default hardware configuration set by elementary OS. Which is not looking good at all in my opinion. - -![hostname change before][2] - -To change the hostname, open a terminal and run the below command. - -``` -hostnamectl set-hostname your-new-hostname -``` - -example: - -![changing hostname][3] - -![changed hostname][4] - -#### 2\. Update your system - -The very first thing you should do after installing any Linux distribution is to make sure the system is up-to-date with packages and security updates. - -To do that here, you can open App Center and check/install for updates. - -Or, open the Terminal and run the below commands. - -``` -sudo apt update -sudo apt upgrade -``` - -#### 3\. Install Pantheon Tweaks - -Pantheon Tweaks is a must-have application in elementary OS. It provides additional settings and configuration options that is not available via standard system settings app. To install Pantheon Tweaks, open a terminal and run the below commands. Note: The earlier tweak tool was elementary Tweaks, which is renamed with Pantheon Tweaks from Odin onwards. - -``` -sudo apt install software-properties-common -sudo add-apt-repository -y ppa:philip.scott/pantheon-tweaks -sudo apt install -y pantheon-tweaks -``` - -After installation, open System Settings and you can find Tweaks option there. - -A detailed installation guide is [available here][5] (if you need more information). - -#### 4\. Configure Dock - -Dock is the center of the desktop. And honestly, the default apps that is included in the dock are not that popular. So, you can always configure the dock items using the below steps. - - * To remove: Right click and uncheck the **Keep in Dock** option. - * To add new items: Click on Application at the top. Then right-click on the application icon which you want in dock. Select **Add to Dock**. - - - -In my opinion, you should add at least – File manager, screenshot tool, Firefox, Calculator – among other things. And remove the ones you don’t need. - -#### 5\. Change the look and feel - -The elementary OS 6 Odin revamped the overall look of the desktop with pre-loaded accent color, native dark mode for entire desktop and applications. Also, pre-loads nice wallpapers. You can customize all these via . There you will have options for Wallpaper, Appearance, Panels and Multitasking. - -![elementary OS 6 Odin settings window – Desktop][6] - -Configure the look as you wish. - -[][7] - -SEE ALSO:   elementary OS 6 Odin: New Features and Release Date - -Oh, you can also schedule the Dark and Light mode based on Sunset and Sunrise! - -#### 6\. Install Additional Applications - -The native AppCenter is great for this OS. I find it one of the best curated app store available in Linux desktop. However, sometimes It’s also better to install necessary applications (mostly the known ones) those are not pre-loaded. Here’s a quick list of applications which you can install in a fresh system. _(Seriously, why LibreOffice is not preloaded?)_ - - * firefox - * gimp - * gedit - * inkscape - * obs-studio - * libreoffice - - - -#### 7\. Some Battery Saver Tips (Laptop) - -There are many ways which you can configure your elementary OS (or Linux desktop in general) to save battery life. Remember that battery life depends on your Laptop hardware, how old the battery/Laptop is among other things. So, following some of the below tips to get the maximum out of your Laptop battery. - - * Install [tlp][8]. The tlp is a simple to use, terminal based utility to help you to save Battery Life in Linux. You need to just install it, and it will take care of the other settings by default. Installation commands: - - - -``` -sudo add-apt-repository ppa:linrunner/tlp -sudo apt update -sudo apt-get install tlp -sudo tlp start -``` - - * Turn off Bluetooth, which is turned on by default. Enable it when required. - - - * Install thermald via below command. This utility (actually a daemon) controls the P-States, T-States of your CPU for temperature and controls the heating. - - - -``` -sudo apt install thermald -``` - - * Control brightness to minimum as per your need. - - - -#### 8\. Install a Disk Utility - -More often, you can find that you need to format a USB or write something to USB. By default, there are no application installed. The best applications with easy usage are the below ones. You can install them. - -``` -gnome-disk-utility -gparted -``` - -#### 9\. Enable Minimize and Maximize Option - -Many users prefer to have the Maximize, Minimize window buttons at the left or right of the window title bar. The elementary OS only gives you close and restore options by default. Which is completely fine because of the way it’s designed. However, you can use Pantheon Tweaks to enable it via Tweaks > Appearance > Window Controls. - -![enable minimize maximize buttons elementary OS][9] - -#### 10\. Learn the new multi-touch gestures in Odin - -If you are a Laptop user, and using elementary OS Odin, then you definitely check out the super cool new gestures. A three-finger swipe up smoothly opens the Multitasking View, exposing open apps and workspaces. A three-finger swipe left or right smoothly switches between the dynamic workspaces, making it even faster to jump between tasks. - -And with two fingers you can achieve similar feature inside native applications as well. - -### Closing Notes - -I hope these 10 things to do after installing elementary OS 6 helps you and get you started with elementary OS 6 Odin. Although, these are completely user preference; hence these may or may not apply to you. But in general, these are expected tweaks that the average user prefers. - -Let me know in the comments below if there are some more tweaks you feel that should be added in the list. - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[anine09](https://github.com/anine09) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/2021/08/elementary-os-6/ -[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/hostname-change-before.jpeg -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/changing-hostname.jpeg -[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/changed-hostname.jpeg -[5]: https://www.debugpoint.com/2021/07/elementary-tweaks-install/ -[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/elementary-OS-6-Odin-settings-window-Desktop.jpeg -[7]: https://www.debugpoint.com/2020/09/elementary-os-6-odin-new-features-release-date/ -[8]: https://linrunner.de/tlp/ -[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/enable-minimize-maximize-buttons-elementary-OS-1024x501.png diff --git a/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md new file mode 100644 index 0000000000..51e3e2fe86 --- /dev/null +++ b/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md @@ -0,0 +1,187 @@ +[#]: subject: "10 Things to Do After Installing elementary OS 6 “Odin”" +[#]: via: "https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: " anine09" +[#]: reviewer: " " +[#]: publisher: " " + +[#]: url: " " + +安装elementary OS 6 “Odin”后要做的 10 件事 +====== + +一个关于安装 elementary OS 6 “Odin” 后要做的事情的列表。 + +在经过两年多的开发后 [elementary OS 6 “Odin”][1] 于不久前发布,此次版本更新在核心模块、 Pantheon 桌面、本地应用中引入了一系列变化巨大的新特性,elementary OS 6 “Odin” 基于 Ubuntu 20.04 LTS。 + +也就是说,如果你完成了安装,你可能想要尝试通过一些特定的设置来使你的系统更加的个性化。这里描述的选项是通用的,在某些情况下可能对你无效,但是我们觉得有必要列出一些基础知识,让你有合适的方式来探索这个漂亮的 elementary OS。 + +### 安装完 elementary OS 6 “Odin” 后要做的事情 + +***准备步骤*** + +首先确保你已经连上了互联网,你可以在顶部的通知区域查看可用的网络列表 + +#### 1\. 更改 hostname + +这可能不是你想做的第一件事。但是我不知道为什么在安装过程中没有给出更改 hostname 的选项。例如,见下图的终端提示, 这个 hostname 是 elementary OS 的默认硬件配置。在我看来这一点都不好。 + +![hostname 修改之前][2] + +打开终端并运行下列命令以更改 hostname + +```bash +hostnamectl set-hostname your-new-hostname +``` + +示例: + +![修改 hostname][3] + +![hostname 修改之后][4] + +#### 2\. 升级你的系统 + +在安装任何 Linux 发行版后,你应该做的第一件事就是确保系统处于最新的软件包和安全更新状态。 + +你可以通过打开应用中心来检查或者安装更新。 + +或者打开终端运行下列命令。 + +```bash +sudo apt update +sudo apt upgrade +``` + +#### 3\. 安装 Pantheon Tweaks + +Pantheon Tweaks 是 elementary OS 的必备应用。它提供了一些无法通过系统原生设置程序修改的额外的设置和配置选项,请打开终端并运行以下命令以安装 Pantheon Tweaks。注意:先前版本的 Tweak 工具叫做 elementary Tweaks,从 Odin 版本开始更名为 Pantheon Tweaks。 + +```bash +sudo apt install software-properties-common +sudo add-apt-repository -y ppa:philip.scott/pantheon-tweaks +sudo apt install -y pantheon-tweaks +``` + +安装后打开系统设置,你可以在那里找到 Tweaks 选项。 + +[这里][5] 提供了更详细的安装指南(如果你需要了解更多信息) + +### 4. 配置 Dock + +Dock 是整个桌面的中心。老实说,Dock 中默认包含的应用并不常用,因此你是可以通过以下步骤配置 Dock 中的项目的。 + + * 移除:右键单击并取消 **在 Dock 中驻留** 选项。 + * 添加新的项目:单击顶部的应用程序。然后右键单击你想要放在 Dock 的应用图标。选择 **添加到 Dock**。 + + + +在我看来,你应该至少把文件管理、截图工具、Firefox 、计算器,以及其他的一些应用添加到 Dock。然后移除 Dock 上那些你不需要的应用。 + +#### 5\. 更改外观 + +elementary OS 6 Odin 改进了桌面的整体外观,为整个桌面和应用程序提供了自带的强调色和原生的夜间模式,同时,系统自带了许多漂亮的壁纸。你可以通过 **应用 > 系统设置 > 桌面** 来定制壁纸、外观、面板和多任务视图。 + +![elementary OS 6 Odin 桌面设置界面][6] + +按照你希望的样子来配置你系统的外观 + +参见:[elementary OS 6 Odin Promises Complete Dark Style](https://www.debugpoint.com/2020/11/elementary-os-6-odin-dark-style/) + +你也可以基于日出和日落的时间来设置夜间模式。 + +#### 6\. 安装其他的应用 + +自带的应用中心非常适合这个系统,我发现它是 Linux 桌面最好的应用商店之一。然而,有时候需要安装没有预装的必要应用(大多数是知名的应用)。下面是个新系统推荐安装的软件列表。(说真的,为什么 LibreOffice 没有预装?) + + * firefox + * gimp + * gedit + * inkscape + * obs-studio + * libreoffice + + + +#### 7\. 一些针对笔记本电脑的省电贴士 + +有许多方法可以配置你的 elementary OS (或者一般的 Linux 桌面),以达到延长电池寿命的目的。记住,电池寿命取决于你的笔记本硬件,以及电池和笔记本的使用年限。所以,遵循下面的一些建议,最大限度的利用你的笔记本电池。 + + * 安装 [tlp][8]. tlp 是一个简单易用的命令行程序,用来帮你在 Linux 上延长电池寿命。你只需要安装它,默认情况下,它会处理好其他的设置。安装命令: + + + +``` +sudo add-apt-repository ppa:linrunner/tlp +sudo apt update +sudo apt-get install tlp +sudo tlp start +``` + + * 关闭蓝牙,默认情况下,蓝牙是开启状态。在需要的时候再启动它。 + + * 通过下面的命令安装 thermald。这个实用程序(实际是个守护进程)控制着你的 CPU 的 P-States 和 T-States 的温度以及 CPU 发热。 + + + +``` +sudo apt install thermald +``` + + * 根据你的需要将亮度调到最小。 + + + +#### 8\. 安装磁盘实用程序 + +在很多情况下,你发现你需要格式化 USB 或者向 USB 中写入一些东西。默认情况下,系统没有安装任何相关的应用。你可以安装以下这些易用的应用。 + +``` +gnome-disk-utility +gparted +``` + +#### 9\. 启用最大化和最小化选项 + +许多用户喜欢在窗口标题栏左边或者右边使用最大化、最小化的按钮,elementary OS 默认只提供关闭和恢复两个选项。这没什么问题,因为这就是它的设计理念。然而你可以通过使用 Pantheon Tweaks 来开启最大化和最小化按钮,具体的方式是:调整 > 外观 > 窗口控制。 + +![在 elementary OS 中启动最大化和最小化设置][9] + +#### 10\. 在 Odin 中学习新的多点触控手势 + +如果你是笔记本用户,并且使用 elementary OS Odin,那么你一定要看看这些超酷的新触控手势。三根手指向上滑动,就会平滑的打开多任务视图,打开应用程序和工作空间。用三根手指向左或向右滑动,就能在动态工作空间之间流畅的切换,使任务之间的额切换更快。 + +用两根手指也可以再本地应用中实现类似的功能。 + +### 结束语 + +我希望安装elementary OS 6 Odin 后要做的 10 件事能帮助到你,让你开始使用 elementary OS 6 Odin,尽管这些事情完全是用户的偏好,因此这些事情有可能适合你也有可能不适用于你,但总的来说,这些都是一般用户喜欢的预期调整。 + +如果你觉得有更多的东西应该添加到列表中,请在下面的评论中告诉我。 + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[anine09](https://github.com/anine09) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2021/08/elementary-os-6/ +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/hostname-change-before.jpeg +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/changing-hostname.jpeg +[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/changed-hostname.jpeg +[5]: https://www.debugpoint.com/2021/07/elementary-tweaks-install/ +[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/elementary-OS-6-Odin-settings-window-Desktop.jpeg +[7]: https://www.debugpoint.com/2020/09/elementary-os-6-odin-new-features-release-date/ +[8]: https://linrunner.de/tlp/ +[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/enable-minimize-maximize-buttons-elementary-OS-1024x501.png + From a630c3869e062644b6122680bfe10a328565c80d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Wed, 1 Sep 2021 21:30:02 +0800 Subject: [PATCH 073/138] translated by fisherue --- sources/tech/20210830 Print from anywhere with CUPS on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210830 Print from anywhere with CUPS on Linux.md b/sources/tech/20210830 Print from anywhere with CUPS on Linux.md index 025dce01e1..49853538a3 100644 --- a/sources/tech/20210830 Print from anywhere with CUPS on Linux.md +++ b/sources/tech/20210830 Print from anywhere with CUPS on Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/share-printer-cups" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "fisherue " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From f5eefb7d18383cfec4b0d2153629fc083c599151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Wed, 1 Sep 2021 21:34:39 +0800 Subject: [PATCH 074/138] Update 20210830 Print from anywhere with CUPS on Linux.md --- sources/tech/20210830 Print from anywhere with CUPS on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210830 Print from anywhere with CUPS on Linux.md b/sources/tech/20210830 Print from anywhere with CUPS on Linux.md index 49853538a3..69d7925905 100644 --- a/sources/tech/20210830 Print from anywhere with CUPS on Linux.md +++ b/sources/tech/20210830 Print from anywhere with CUPS on Linux.md @@ -99,7 +99,7 @@ via: https://opensource.com/article/21/8/share-printer-cups 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/fisherue) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fe2562eb7b0073c709542996983918a961971860 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 22:42:19 +0800 Subject: [PATCH 075/138] PRF&PUB @geekpi https://linux.cn/article-13743-1.html --- ...r Useful Application Launcher for Linux.md | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) rename {translated/tech => published}/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md (69%) diff --git a/translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md b/published/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md similarity index 69% rename from translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md rename to published/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md index 056a490813..b6fced4284 100644 --- a/translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md +++ b/published/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md @@ -3,16 +3,16 @@ [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13743-1.html" Ulauncher:一个超级实用的 Linux 应用启动器 ====== -_**简介:**_ _Ulauncher 是一个快速的应用启动器,支持扩展和快捷方式,帮助你在 Linux 中快速访问应用和文件。_ +> Ulauncher 是一个快速应用启动器,支持扩展和快捷方式,帮助你在 Linux 中快速访问应用和文件。 -一个应用启动器可以让你快速访问或打开一个应用,而无需在应用菜单图标上徘徊。 +应用启动器可以让你快速访问或打开一个应用,而无需在应用菜单图标上徘徊。 在默认情况下,我发现 Pop!_OS 的应用启动器超级方便。但是,并不是每个 Linux 发行版都提供开箱即用的应用启动器。 @@ -32,9 +32,9 @@ Ulauncher 是一个使用 Python 还有 GTK+ 构建的快速应用启动器。 Ulauncher 中的选项非常非常易于访问且易于定制。一些关键的亮点包括: - * 模糊搜索算法,让你找到应用,即使你拼错了它们 - * 记住你在同一会话中最后搜索的应用 - * 经常使用的应用显示(可选) + * 模糊搜索算法可以让你即使拼错了,也能找到应用 + * 可以记住你在同一会话中最后搜索的应用 + * 显示经常使用的应用(可选) * 自定义颜色主题 * 预设颜色主题,包括一个黑暗主题 * 召唤启动器的快捷方式可以轻松定制 @@ -42,45 +42,43 @@ Ulauncher 中的选项非常非常易于访问且易于定制。一些关键的 * 支持扩展,以获得额外的功能(表情符号、天气、速度测试、笔记、密码管理器等) * 浏览谷歌、维基百科和 Stack Overflow 等网站的快捷方式 - - 它几乎提供了你在一个应用启动器中所期望的所有有用的能力,甚至更好。 ### 如何在 Linux 中使用 Ulauncher? -默认情况下,首次从应用菜单打开应用启动器后,你需要按 **Ctrl + Space** 打开应用启动器。 +默认情况下,首次从应用菜单中打开应用启动器后,你需要按 `Ctrl + Space` 打开应用启动器。 -开始输入以搜索一个应用。而且,如果你正在寻找一个文件或目录,开始输入 “**~**” 或者 “**/**” (忽略引号)。 +输入以搜索一个应用。如果你正在寻找一个文件或目录,输入以 `~` 或者 `/` 开始。 ![][2] -有一些默认的快捷键,如 “**g XYZ**”,其中 XYZ 是你想在谷歌中搜索的搜索词。 +有一些默认的快捷键,如 `g XYZ`,其中 “XYZ” 是你想在谷歌中搜索的搜索词。 ![][3] -同样,你可以通过 “**wiki**” 和 “**so**” 快捷键,直接在维基百科或 Stack Overflow 搜索。 +同样,你可以通过 `wiki` 和 `so` 快捷键,直接在维基百科或 Stack Overflow 搜索。 -在没有任何扩展的情况下,你也可以直接计算内容,并将结果直接复制到键盘上。 +在没有任何扩展的情况下,你也可以直接计算内容,并将结果直接复制到剪贴板。 ![][4] 这在快速计算时应该很方便,不需要单独启动计算器应用。 -你可以前往它的[扩展页面][5],浏览有用的扩展,以及指导你如何使用它的截图。 +你可以前往它的 [扩展页面][5],浏览有用的扩展,以及指导你如何使用它的截图。 -要改变它的工作方式,启用频繁的应用显示,并调整主题,请点击启动器右侧的齿轮图标。 +要改变它的工作方式,启用显示经常使用的应用,并调整主题,请点击启动器右侧的齿轮图标。 ![][6] 你可以把它设置为自动启动。但是,如果它在你的支持 Systemd 的发行版上不工作,你可以参考它的 GitHub 页面,把它添加到服务管理器中。 -这些选项是非常只管,且易于定制,如下图所示。 +这些选项是非常直观,且易于定制,如下图所示。 ![][7] ### 在 Linux 中安装 Ulauncher -Ulauncher 为基于 Debian 或 Ubuntu 的发行版提供了一个 **.deb** 包。如果你是 Linux 新手,你可以探索[如何安装 Deb 文件][8] 。 +Ulauncher 为基于 Debian 或 Ubuntu 的发行版提供了一个 deb 包。如果你是 Linux 新手,你可以了解一下 [如何安装 Deb 文件][8] 。 在这两种情况下,你也可以添加它的 PPA,并通过终端按照下面的命令来安装它: @@ -92,13 +90,13 @@ sudo apt install ulauncher 你也可以在 [AUR][9] 中找到它,用于 Arch 和 Fedora 的默认仓库。 -对于更多信息,你可以前往其官方网站或 [GitHub页面][10]。 +对于更多信息,你可以前往其官方网站或 [GitHub 页面][10]。 -[Ulauncher][11] +- [Ulauncher][11] Ulauncher 应该是任何 Linux 发行版中一个令人印象深刻的补充。特别是,如果你想要一个像 Pop!_OS 提供的快速启动器的功能,这是一个值得考虑的奇妙选择。 -_你试过 Ulauncher了吗?欢迎你就这如何帮助你快速完成工作分享你的想法。_ +你试过 Ulauncher了吗?欢迎你就如何帮助你快速完成工作分享你的想法。 -------------------------------------------------------------------------------- @@ -107,7 +105,7 @@ via: https://itsfoss.com/ulauncher/ 作者:[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 f3265534be3b4242399e4555be4ab3e0f164a7cd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 23:37:32 +0800 Subject: [PATCH 076/138] PRF&PUB @chunibyo-wly https://linux.cn/article-13744-1.html --- ...loy a deep learning model on Kubernetes.md | 255 +++++++++--------- 1 file changed, 131 insertions(+), 124 deletions(-) rename {translated/tech => published}/20200908 Deploy a deep learning model on Kubernetes.md (51%) diff --git a/translated/tech/20200908 Deploy a deep learning model on Kubernetes.md b/published/20200908 Deploy a deep learning model on Kubernetes.md similarity index 51% rename from translated/tech/20200908 Deploy a deep learning model on Kubernetes.md rename to published/20200908 Deploy a deep learning model on Kubernetes.md index 5a83fe466b..850b5604c0 100644 --- a/translated/tech/20200908 Deploy a deep learning model on Kubernetes.md +++ b/published/20200908 Deploy a deep learning model on Kubernetes.md @@ -1,46 +1,43 @@ [#]: collector: (lujun9972) [#]: translator: (chunibyo-wly) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13744-1.html) [#]: subject: (Deploy a deep learning model on Kubernetes) [#]: via: (https://opensource.com/article/20/9/deep-learning-model-kubernetes) [#]: author: (Chaimaa Zyani https://opensource.com/users/chaimaa) 在 Kubernetes 上部署一个深度学习模型 ====== -了解如何使用 Kubermatic Kubernetes 平台部署、缩放与管理图像识别深度学习模型。 -![Brain on a computer screen][1] +> 了解如何使用 Kubermatic Kubernetes 平台来部署、扩展与管理图像识别预测的深度学习模型。 -随着企业增加了对人工智能(AI)、机器学习(ML)与深度学习(DL)的使用,出现了一个关键问题:如何将机器学习的发展进行规模化与产业化?这些讨论经常聚焦于机器学习模型本身;然而,模型仅仅只是完整解决方案的其中一环。为了达到生产环境的应用和规模,模型的开发过程必须还包括一个可以说明开发前后关键活动以及可公用部署的可重复过程。 +![](https://img.linux.net.cn/data/attachment/album/202109/01/233417ryy87hyza7jmgy33.jpg) -本文演示了如何使用[Kubermatic Kubernetes Platform][2]对图像识别预测的深度学习模型进行部署,缩放与管理。 +随着企业增加了对人工智能(AI)、机器学习(ML)与深度学习(DL)的使用,出现了一个关键问题:如何将机器学习的开发进行规模化与产业化?这些讨论经常聚焦于机器学习模型本身;然而,模型仅仅只是完整解决方案的其中一环。为了达到生产环境的应用和规模,模型的开发过程必须还包括一个可以说明开发前后关键活动以及可公用部署的可重复过程。 -Kubermatic Kubernetes 平台是一个可以与机器学习/深度学习工作流结合进行完整集群生命周期管理的一个自动且灵活的开源生产级 Kubernetes 集群管理工具。 +本文演示了如何使用 [Kubermatic Kubernetes 平台][2] 对图像识别预测的深度学习模型进行部署、扩展与管理。 + +Kubermatic Kubernetes 平台是一个生产级的开源 Kubernetes 集群管理工具,提供灵活性和自动化,与机器学习/深度学习工作流程整合,具有完整的集群生命周期管理。 ### 开始 -这个例子部署了一个图像识别的深度学习模型。它使用了包含 60,000 张分属 10 个类别的 32x32 彩色图 [CIFAR-10][3] 像数据集,同时使用了 [Apache MXNet][5] 的 [Gluon][4] 与 NVIDIA GPUs 进行加速计算。如果你希望使用 CIFAR-10 数据集的预训练模型,可以查阅 [getting started guide][6]。 +这个例子部署了一个用于图像识别的深度学习模型。它使用了 [CIFAR-10][3] 数据集,包含了 60,000 张分属 10 个类别的 32x32 彩色图,同时使用了 [Apache MXNet][5] 的 [Gluon][4] 与 NVIDIA GPU 进行加速计算。如果你希望使用 CIFAR-10 数据集的预训练模型,可以查阅其 [入门指南][6]。 使用训练集中的样本对模型训练 200 次,只要训练误差保持缓慢减少,就可以保证模型不会过拟合。下方图展示了训练的过程: ![深度学习模型训练 loss 图][7] -(Chaimaa Zyami, [CC BY-SA 4.0][8]) - 训练结束后,必须保存模型训练所得到的参数,以便稍后可以加载它们: - -```python +``` file_name = "net.params" net.save_parameters(file_name) ``` -一旦你的模型训练好了,就可以用 Flask 服务器来封装它。下方的程序演示了如何接收 request 中的一张图片作为参数并且在 response 中返回模型的预测结果: +一旦你的模型训练好了,就可以用 Flask 服务器来封装它。下方的程序演示了如何接收请求中的一张图片作为参数,并在响应中返回模型的预测结果: - -```python +``` from gluoncv.model_zoo import get_model import matplotlib.pyplot as plt from mxnet import gluon, nd, image @@ -80,156 +77,166 @@ if __name__ == '__main__': 在将模型部署到 Kubernetes 前,你需要先安装 Docker 并使用你的模型创建一个镜像。 - 1. 下载、安装并启动 Docker: -```bash -sudo yum install -y yum-utils device-mapper-persistent-data lvm2 +1. 下载、安装并启动 Docker: -sudo yum-config-manager --add-repo + ``` + sudo yum install -y yum-utils device-mapper-persistent-data lvm2 + sudo yum-config-manager --add-repo + sudo yum install docker-ce + sudo systemctl start docker + ``` -sudo yum install docker-ce +2. 创建一个你用来管理代码与依赖的文件夹: -sudo systemctl start docker + ``` + mkdir kubermatic-dl + cd kubermatic-dl + ``` -``` - 2. 创建一个你用来管理代码与依赖的文件夹: -```bash -mkdir kubermatic-dl -cd kubermatic-dl -``` +3. 创建 `requirements.txt` 文件管理代码运行时需要的所有依赖: - 3. 创建 `requirements.txt` 文件管理代码运行时需要的所有依赖: -``` -flask -gluoncv -matplotlib -mxnet -requests -Pillow + ``` + flask + gluoncv + matplotlib + mxnet + requests + Pillow + ``` -``` - 4. 创建 Dockerfile,Docker 将根据这个文件创建镜像: -``` -FROM python:3.6 -WORKDIR /app -COPY requirements.txt /app -RUN pip install -r ./requirements.txt -COPY app.py /app -CMD ["python", "app.py"] -``` +4. 创建 `Dockerfile`,Docker 将根据这个文件创建镜像: -这个 Dockerfile 主要可以分为三个部分。首先,Docker 会下载 Python 的基础镜像。然后,Docker 会使用 Python 的包管理工具 `pip` 安装 `requirements.txt` 记录的包。最后,Docker 会通过执行 `python app.py` 来运行你的脚本。 + ``` + FROM python:3.6 + WORKDIR /app + COPY requirements.txt /app + RUN pip install -r ./requirements.txt + COPY app.py /app + CMD ["python", "app.py"] + ``` + 这个 `Dockerfile` 主要可以分为三个部分。首先,Docker 会下载 Python 的基础镜像。然后,Docker 会使用 Python 的包管理工具 `pip` 安装 `requirements.txt` 记录的包。最后,Docker 会通过执行 `python app.py` 来运行你的脚本。 - 1. 构建 Docker 容器: `sudo docker build -t kubermatic-dl:latest .` 这条命令使用 `kubermatic-dl` 镜像为你当前工作目录的代码创建了一个容器。 - - 2. 使用 `sudo docker run -d -p 5000:5000 kubermatic-dl` 命令检查你的容器可以在你的主机上正常运行。 - - 3. 使用 `sudo docker ps -a` 命令查看你本地容器的运行状态: - -![查看容器的运行状态][9] - -(Chaimaa Zyami, [CC BY-SA 4.0][8]) +5. 构建 Docker 容器: + + ``` + sudo docker build -t kubermatic-dl:latest . + ``` + 这条命令使用 `kubermatic-dl` 镜像为你当前工作目录的代码创建了一个容器。 +6. 使用 + + ``` + sudo docker run -d -p 5000:5000 kubermatic-dl + ``` + + 命令检查你的容器可以在你的主机上正常运行。 +7. 使用 + + ``` + sudo docker ps -a + ``` + 命令查看你本地容器的运行状态: + ![查看容器的运行状态][9] ### 将你的模型上传到 Docker Hub 在向 Kubernetes 上部署模型前,你的镜像首先需要是公开可用的。你可以通过将你的模型上传到 [Docker Hub][10] 来将它公开。(如果你没有 Docker Hub 的账号,你需要先创建一个) - 1. 在终端中登录 Docker Hub 账号:`sudo docker login` +1. 在终端中登录 Docker Hub 账号: + + ``` + sudo docker login + ``` - 2. 给你的镜像打上 tag ,这样你的模型上传到 Docker Hub 后也能拥有版本信息 -```bash -sudo docker tag <your-image-id> <your-docker-hub-name>/<your-app-name> +2. 给你的镜像打上标签,这样你的模型上传到 Docker Hub 后也能拥有版本信息: -sudo docker push <your-docker-hub-name>/<your-app-name> -``` + ``` + sudo docker tag / -![给镜像打上 tag][11] - -(Chaimaa Zyami, [CC BY-SA 4.0][8]) - - 3. 使用 `sudo docker images` 命令检查你的镜像的 ID。 + sudo docker push / + ``` + ![给镜像打上 tag][11] +3. 使用 + ``` + sudo docker images + ``` + + 命令检查你的镜像的 ID。 ### 部署你的模型到 Kubernetes 集群 - 1. 首先在 Kubermatic Kubernetes 平台创建一个项目, 然后根据 [快速开始][12] 创建一个 Kubernetes 集群。 +1. 首先在 Kubermatic Kubernetes 平台创建一个项目, 然后根据 [快速开始][12] 创建一个 Kubernetes 集群。 -![创建一个 Kubernetes 集群][13] + ![创建一个 Kubernetes 集群][13] -(Chaimaa Zyami, [CC BY-SA 4.0][8]) +2. 下载用于访问你的集群的 `kubeconfig`,将它放置在下载目录中,并记得设置合适的环境变量,使得你的环境能找到它: - 2. 下载用于访问你的集群的 `kubeconfig`,将它放置在下载目录中,并记得设置合适的环境变量,使得你的环境能找到它: + ![Kubernetes 集群示例][14] -![Kubernetes 集群示例][14] +3. 使用 `kubectl` 命令检查集群信息,例如,需要检查 `kube-system` 是否在你的集群正常启动了就可以使用命令 `kubectl cluster-info` -(Chaimaa Zyami, [CC BY-SA 4.0][8]) + ![查看集群信息][15] - 3. 使用 `kubectl` 命令检查集群信息,例如,需要检查 `kube-system` 是否在你的集群正常启动了就可以使用命令 `kubectl cluster-info` +4. 为了在集群中运行容器,你需要创建一个部署用的配置文件(`deployment.yaml`),再运行 `apply` 命令将其应用于集群中: -![查看集群信息][15] + ``` + apiVersion: apps/v1 + kind: Deployment + metadata: +   name: kubermatic-dl-deployment + spec: +   selector: +     matchLabels: +       app: kubermatic-dl +   replicas: 3 +   template: +     metadata: +       labels: +         app: kubermatic-dl +     spec: +      containers: +      - name: kubermatic-dl +        image: kubermatic00/kubermatic-dl:latest +        imagePullPolicy: Always +        ports: +        - containerPort: 8080 -(Chaimaa Zyami, [CC BY-SA 4.0][8]) + ``` + + ``` + kubectl apply -f deployment.yaml` + ``` - 4. 为了在集群中运行容器,你需要创建一个部署用的配置文件(`deployment.yaml`),再运行 `apply` 命令将其应用于集群中: -```yaml -apiVersion: apps/v1 -kind: Deployment -metadata: -  name: kubermatic-dl-deployment -spec: -  selector: -    matchLabels: -      app: kubermatic-dl -  replicas: 3 -  template: -    metadata: -      labels: -        app: kubermatic-dl -    spec: -     containers: -     - name: kubermatic-dl -       image: kubermatic00/kubermatic-dl:latest -       imagePullPolicy: Always -       ports: -       - containerPort: 8080 +5. 为了将你的部署开放到公网环境,你需要一个能够给你的容器创建外部可达 IP 地址的服务: + + ``` + kubectl expose deployment kubermatic-dl-deployment  --type=LoadBalancer --port 80 --target-port 5000` + ``` -``` `kubectl apply -f deployment.yaml` -``` +6. 就快大功告成了!首先检查你布署的服务的状态,然后通过 IP 请求的你图像识别 API: + + ``` + kubectl get service + ``` - 5. 为了将你的部署开放到公网环境,你需要一个能够给你的容器创建外部可达 IP 地址的服务:`kubectl expose deployment kubermatic-dl-deployment  --type=LoadBalancer --port 80 --target-port 5000` + ![获取请求图像识别 API 的 IP 地址][16] - 6. 就快大功告成了!首先检查你布署的服务的状态,然后通过 IP 请求的你图像识别 API:`kubectl get service` - - -![获取请求图像识别 API 的 IP 地址][16] - -(Chaimaa Zyami, [CC BY-SA 4.0][8]) - - 7. 最后根据你的外部 IP 使用以下两张图片对你的图像识别服务进行测试: - -![马][17] - -(Chaimaa Zyami, [CC BY-SA 4.0][8]) - -![狗][18] - -(Chaimaa Zyami, [CC BY-SA 4.0][8]) - -![测试 API][19] - -(Chaimaa Zyami, [CC BY-SA 4.0][8]) +7. 最后根据你的外部 IP 使用以下两张图片对你的图像识别服务进行测试: + ![马][17] + ![狗][18] + ![测试 API][19] ### 总结 - 在这篇教程中,你可以创建一个深度学习模型,并且使用 Flask 提供 [REST API][20] 服务。它介绍了如何将应用放在 Docker 容器中,如何将这个镜像上传到 Docker Hub 中,以及如何使用 Kubernetes 部署你的服务。只需几个简单的命令,你就可以使用 Kubermatic Kubernetes 平台部署该应用程序,并且开放服务给别人使用。 -------------------------------------------------------------------------------- @@ -238,8 +245,8 @@ via: https://opensource.com/article/20/9/deep-learning-model-kubernetes 作者:[Chaimaa Zyani][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/chunibyo-wly) -校对:[校对者ID](https://github.com/校对者ID) +译者:[chunibyo-wly](https://github.com/chunibyo-wly) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 83c8ae1f08fb3ea6cf433fb5ff90d60322861119 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 23:46:47 +0800 Subject: [PATCH 077/138] PRF --- .../20200908 Deploy a deep learning model on Kubernetes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20200908 Deploy a deep learning model on Kubernetes.md b/published/20200908 Deploy a deep learning model on Kubernetes.md index 850b5604c0..cf034c4879 100644 --- a/published/20200908 Deploy a deep learning model on Kubernetes.md +++ b/published/20200908 Deploy a deep learning model on Kubernetes.md @@ -179,7 +179,7 @@ if __name__ == '__main__': ![Kubernetes 集群示例][14] -3. 使用 `kubectl` 命令检查集群信息,例如,需要检查 `kube-system` 是否在你的集群正常启动了就可以使用命令 `kubectl cluster-info` +3. 使用 `kubectl` 命令检查集群信息,例如,需要检查 `kube-system` 是否在你的集群正常启动了就可以使用命令 `kubectl cluster-info`: ![查看集群信息][15] From bd5cd00c9978205643e5781d607d05268546b583 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Sep 2021 05:03:16 +0800 Subject: [PATCH 078/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901=20?= =?UTF-8?q?Getting=20ready=20for=20Fedora=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210901 Getting ready for Fedora Linux.md --- ...20210901 Getting ready for Fedora Linux.md | 297 ++++++++++++++++++ 1 file changed, 297 insertions(+) create mode 100644 sources/tech/20210901 Getting ready for Fedora Linux.md diff --git a/sources/tech/20210901 Getting ready for Fedora Linux.md b/sources/tech/20210901 Getting ready for Fedora Linux.md new file mode 100644 index 0000000000..6a8d15ce08 --- /dev/null +++ b/sources/tech/20210901 Getting ready for Fedora Linux.md @@ -0,0 +1,297 @@ +[#]: subject: "Getting ready for Fedora Linux" +[#]: via: "https://fedoramagazine.org/getting-ready-for-fedora-linux/" +[#]: author: "Hanku Lee https://fedoramagazine.org/author/hankuoffroad/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Getting ready for Fedora Linux +====== + +![][1] + +Photo by [Jacques Bopp][2] on [Unsplash][3] + +### Introduction + +Why does Linux remain vastly invisible to ordinary folks who make general use of computers? This article steps through the process to move to Fedora Linux Workstation for non-Linux users. It also describes features of the GUI (Graphic User Interface) and CLI (Command Line Interface) for the newcomer. This is a quick introduction, not an in-depth course. + +### Installation and configuration are straightforward + +Supposedly, a bootable USB drive is the most baffling experience of starting Linux for a beginner. In all fairness, installation with Fedora Media Writer and Anaconda is intuitive. + +##### Step-by-step installation process + + 1. [Make a Fedora USB stick][4]: 5 to 7 minutes depending on USB speed + 2. [Understand disk partitions and Linux file systems][5] + 3. [Boot from a USB device][6] + 4. [Install][7] with the Fedora installer, Anaconda: 15 to 20 minutes + 5. Software updates: 5 minutes + + + +Following this procedure, it is easy to help family and friends install Fedora Linux. + +##### Package management and configuration + +Instead of configuring the OS manually, adding tools and applications you need, you may choose a functional bundle from [Fedora Labs][8] for a specific use case. Design Suite, Scientific, Python Classroom, and more, are available. Plus, all processes are complete without the command line. + +##### Connecting devices and services + + * [Add a USB printer][9]: Fedora Linux detects most printers in a few seconds. Some may require the drivers. + * Configure a USB keyboard: Refer to simple [work-around][10] for a mechanical keyboard. + * [Sync with Google Drive][11]: Add an account either after installation, or at any time afterward. + + + +### Desktop customization is easy + +The default [GNOME desktop][12] is decent and free from distractions. + +A shortlist to highlight desktop benefits: + + * Simplicity: Clean design, fluid and elegant application grid. + * Reduced user effort: No alerts for paid services or long list of user consent. + * Accommodating software: GNOME requires little specialist knowledge or technical ability. + * Neat layout of system _Settings_: Larger icons and a better layout. + + + +The image below shows the applications and desktops currently available. Get here by selecting “Activities” and then the “Show Applications” icon at the bottom of the screen at the far right. There you will find LibreOffice for your document, spreadsheet, and presentation creation. Also available is Firefox for your web browsing. More applications are added using the _Software_ icon (second from right at the bottom of the screen). + +![GNOME desktop][13] + +##### Enable touchpad click (tapping) + +A change for [touchpad settings][14] is required for laptop users. + + 1. Go to _Activies > Show Applications > Settings > Mouse & Touchpad > Touchpad_ + 2. Change the default behavior of touchpad settings (double click) to tap-to-click (single tap) using the built-in touchpad + 3. Select ‘Tap to Click’ + + + +##### Add user accounts using the users settings tool + +During installation, you set up your first login account. For training or demo purposes, it is common to create a new user account. + + 1. Add users: Go to _Settings > Users > Unlock > Authentication> Add user_ + 2. Click at the top of the screen at the far right and then navigate to Power Off / Log out, and Select _Switch User_ to relogin as the new user. + + + +### Fedora Linux is beginner-friendly + +Yes, Fedora Linux caters to a broader selection of users. Since that is the case, why not dip into the shallow end of the Fedora community? + + * [Fedora Docs][15]: Clarity of self-help content is outstanding. + * Ask Fedora: Get help for anything about Fedora Linux. + * Magazine: Useful tips and user story are engaging. Make a suggestion to write about. + * Nest with Fedora: Warm welcome virtually from Fedora Linux community. + * Release parties. + + + +### Command line interface is powerful + +The command line is a way of giving instructions to a computer (shell) using a terminal. To be fair, the real power behind Fedora Linux is the Bash shell that empowers users to be problem solvers. The good news is that the text-based command is universally compatible across different versions of Linux. The Bash shell comes with the Fedora Linux, so there is no need to install it. + +The following will give you a feeling for the command line. However, you can accomplish many if not all day-to-day tasks without using the command line. + +#### How to use commands? + +Access the command line by selecting “Activities” and then the “Show Applications” icon at the bottom of the screen at the far right. Select _Terminal_. + +#### Understand the shell prompt + +The standard shell prompt looks like this: + +``` +[hank@fedora_test ~]$ +``` + +The shell prompt waits for a command. + +It shows the name of the user (hank), the computer being used (fedora_test), and the current working directory within the filesystem (~, meaning the user’s home directory). The last character of the prompt, $, indicates that this is a normal user’s prompt. + +#### Enter commands + +What common tasks should a beginner try out with command lines? + + * Command line information is available from the [Fedora Magazine][16] and [other sites][17]. + * Use _ls_ and _cd_ to list and navigate your file system. + * Make new directories (folders) with _mkdir_. + * Delete files with _rm_. + * Use _lsblk_ command to display partition details. + + + +#### How to deal with the error messages + + * Be attentive to error messages in the terminal. Common errors are missing arguments, typo of file name. + * Pause to think about why that happened. + * Figure out the correct syntax using the _man_ command. For example: +_man ls_ +displays the manual page for the _ls_ command. + + + +#### Perform administration tasks using _sudo_ + +When a user executes commands for installation, removal, or change of software, [the _sudo_ command][18] allows users to gain administrative or root access. The actions that required _sudo_ command are often called ‘the administrative tasks’. Sudo stands for **SuperUser DO**. The syntax for the _sudo_ command is as follows: + +``` +sudo [COMMAND] +``` + + 1. Replace _COMMAND_ with the command to run as the root user. + 2. Enter password + + + +What are the most used _sudo_ commands to start with? + + * List privileges + + + +``` +sudo -l +``` + + * Install a package + + + +``` +sudo dnf install [package name] +``` + + * Update a package + + + +``` +sudo dnf update [package name] +``` + + * List all packages + + + +``` +sudo dnf grouplist [package name] +``` + + * Manage disk partitions + + + +``` +sudo fdisk -l +``` + +### Built-in text editor is light and efficient + +[Nano][19] is the default command-line-based text editor for Fedora Linux. [vi][20] is another one often used on Fedora Linux. Both are light and fast. Which to us is a personal choice, really. Nano and vi remain essential tools for editing config files and writing scripts. Generally, Nano is much simpler to work with than vi but vi can be more powerful when you get used to it. + +##### What does a beginner benefit from a text editor? + + * Learn fundamentals of computing + + + +Linux offers a vast range of customization options and monitoring. Shell scripts make it possible to add new functionality and the editor is used to create the scripts. + + * Build cool things for home automation + + + +Raspberry Pi is a testing ground to build awesome projects for homes. [Fedora can be installed on Raspberry Pi][21]. Schools use the tiny microcomputer for IT training and experiment. Instead of a visual editor, it is easier to use a light and simple Nano editor to write files. + + * Test proof of concept with the public cloud services + + + +Most of the public cloud suppliers offer free sandbox account to spin up a virtual machine or configure the network. Cloud servers run Linux OS, so editing configuration files require a text editor. Without installing additional software, it is easy to invoke Nano on a remote server. + +##### How to use Nano text editor + +Type _nano_ and file name after the shell prompt $ and press Enter. + +``` +[hank@fedora_test ~]$ nano [filename] +``` + +Note that many of the most used commands are displayed at the bottom of the nano screen. The symbol ^ in Nano means to press the Ctrl key. + + * Use the arrow keys on the keyboard to move up and down, left and right. + * Edit file. + * Get built-in help by pressing ^G + * Exit by entering ^X and Y to save your file and return to the shell prompt. + + + +##### Examples of file extensions used for configuration or shell scripts + + * .cfg: User-configurable files in the /etc directory. + * .yaml: A popular type of configuration file with cross-language data portability. + * .json: JSON is a lightweight & open standard format for storing and transporting data. + * .sh: A shell script used universally for Unix/Linux systems. + + + +Above all, this is not a comprehensive guide on Nano or vi. Yet, adventurous learners should be aware of text editors for their next step in becoming accomplished in Fedora Linux. + +### Conclusion + +Does Fedora Workstation simplify the user experience of a beginner with Linux? Yes, absolutely. It is entirely possible to create a desktop quickly and get the job done without installing additional software or extensions. + +Taking it to the next level, how to get more people into Fedora Linux? + + * Make Fedora Linux device available at home. A repurposed computer with the above guide is a starting point. + * Demonstrate [cool things][22] with Fedora Linux. + * Share [power user tips][23] with shell scripts. + * Get involved with Open Source Software community such as the [Fedora project][24]. + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/getting-ready-for-fedora-linux/ + +作者:[Hanku Lee][a] +选题:[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/hankuoffroad/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/ready_for_fedora-816x345.jpg +[2]: https://unsplash.com/@jacquesbopp?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/make-fedora-usb-stick/ +[5]: https://docs.fedoraproject.org/en-US/fedora/rawhide/install-guide/appendixes/Disk_Partitions/ +[6]: https://docs.fedoraproject.org/en-US/fedora/rawhide/install-guide/install/Booting_the_Installation/ +[7]: https://docs.fedoraproject.org/en-US/fedora/rawhide/install-guide/install/Installing_Using_Anaconda/ +[8]: https://labs.fedoraproject.org/ +[9]: https://docs.fedoraproject.org/en-US/Fedora/14/html/User_Guide/chap-User_Guide-Printing.html +[10]: https://venthur.de/2021-04-30-keychron-c1-on-linux.html +[11]: https://fedoramagazine.org/connect-your-google-drive-to-fedora-workstation/ +[12]: https://developer.gnome.org/hig/principles.html +[13]: https://fedoramagazine.org/wp-content/uploads/2021/08/Screenshot-from-2021-08-12-23-27-13-1024x576.png +[14]: https://help.gnome.org/users/gnome-help/stable/mouse-touchpad-click.html.en +[15]: https://docs.fedoraproject.org/en-US/docs/ +[16]: https://fedoramagazine.org/?s=command+line +[17]: https://www.redhat.com/sysadmin/essential-linux-commands +[18]: https://fedoramagazine.org/howto-use-sudo/ +[19]: https://fedoramagazine.org/gnu-nano-minimalist-console-editor/ +[20]: https://www.redhat.com/sysadmin/vim-commands +[21]: https://docs.fedoraproject.org/en-US/quick-docs/raspberry-pi/ +[22]: https://fedoramagazine.org/automatically-light-up-a-sign-when-your-webcam-is-in-use/ +[23]: https://fedoramagazine.org/?s=bash +[24]: https://docs.fedoraproject.org/en-US/project/ From b392e9f938207059fbe98a07434fd3ef83bd12ab Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Sep 2021 05:03:25 +0800 Subject: [PATCH 079/138] add done: 20210901 Getting ready for Fedora Linux.md --- sources/tech/20210902 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210902 .md diff --git a/sources/tech/20210902 .md b/sources/tech/20210902 .md new file mode 100644 index 0000000000..90bde3e2c1 --- /dev/null +++ b/sources/tech/20210902 .md @@ -0,0 +1,25 @@ +[#]: subject: "" +[#]: via: "https://www.2daygeek.com/recover-root-password-rhel-8-centos-8/" +[#]: author: " " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/recover-root-password-rhel-8-centos-8/ + +作者:[][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 From 984a309365ef55cc60cd5c8ce581ff26ad275083 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Sep 2021 05:03:43 +0800 Subject: [PATCH 080/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210902=20?= =?UTF-8?q?Best=20Web=20Browsers=20for=20Ubuntu=20and=20Other=20Linux=20Di?= =?UTF-8?q?stributions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210902 Best Web Browsers for Ubuntu and Other Linux Distributions.md --- ...or Ubuntu and Other Linux Distributions.md | 404 ++++++++++++++++++ 1 file changed, 404 insertions(+) create mode 100644 sources/tech/20210902 Best Web Browsers for Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20210902 Best Web Browsers for Ubuntu and Other Linux Distributions.md b/sources/tech/20210902 Best Web Browsers for Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..26a6d5f941 --- /dev/null +++ b/sources/tech/20210902 Best Web Browsers for Ubuntu and Other Linux Distributions.md @@ -0,0 +1,404 @@ +[#]: subject: "Best Web Browsers for Ubuntu and Other Linux Distributions" +[#]: via: "https://itsfoss.com/best-browsers-ubuntu-linux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Best Web Browsers for Ubuntu and Other Linux Distributions +====== + +There is no such thing as the perfect web browser. It all depends on what you prefer and what you use it for. + +But, what are your best options when it comes to web browsers for Linux? + +In this article, I try to highlight the best web browsers that you can pick for Ubuntu and other Linux. + +**Note:** We have tried and tested these browsers on Ubuntu. But, you should be able to install it on any Linux distribution of your choice. + +### Top Web Browsers for Linux + +![Illustration for web browser running in Ubuntu Linux][1] + +Every browser offers something unique. And, when it comes to the Linux platform, there are some interesting exclusive choices as well. + +_**Before you see this list, please note that it is not a ranking list. The browser listed at number 1 should not be considered better than the ones at 2, 3 or 10.**_ + +Non-FOSS alert! + +Some applications mentioned here are not open source. They are listed here because they are available on Linux and the article’s focus is on Linux. We have a separate [dedicated list of open source web browsers][2] as well. + +### 1\. Vivaldi + +![][3] + +**Pros** + + * Sidebar for quick web application access + * Calendar and Email integration + * Unique tab management + * Pomodoro feature + * Mobile app available + + + +**Cons** + + * Resource-heavy when using a variety of features + * Not 100% open-source + + + +Vivaldi is an impressive browser that has been getting more attention from Linux users more than ever. + +While it is not 100% open-source, you can find most of its source code (except for its UI) online. + +With [Vivaldi 4.0 release][4], they have been focusing more on improving the experience for Linux users. You can set clock timers to increase your work productivity, use the built-in translation for web pages, track your calendar, add shortcuts to web applications, and multi-task at its peak with this browser. + +Even though it is a fast web browser, I wouldn’t bet on it as the “fastest” or lightest. You need a good amount of memory (RAM) to make use of all the features while you work on stuff. + +Overall, it is a feature-rich web browser. So, if you need something with as many as features possible to multi-task, Vivaldi can be your choice. + +[Vivaldi][5] + +#### How to Install Vivaldi on Linux? + +Vivaldi offers both **.deb** and **.rpm** packages to let you directly install it in your Linux system. + +You can refer to our resources to [install Deb files][6] and [install RPM files][7] in case you are new to Linux. + +### 2\. Mozilla Firefox + +![][8] + +**Pros** + + * Privacy protection + * Not based on Chrome engine + * Open Source + * Firefox Account services + + + +**Cons** + + * User Experience changes with major updates + + + +Firefox is the default web browser for most Linux distributions. Hence, it is an obvious choice to start with. + +In addition to being open-source, it offers some of the best privacy protection features. And, with the right settings, you can turn it into one of the most secure browsers similar to Tor Browser (which is also based on Firefox). + +Not just limited to its security, but Firefox also offers useful integrated features like Pocket (to save web pages and read later), VPN, email alias, breach monitor, and more when you sign in with your Firefox account. + +[Firefox][9] + +#### How to Install Firefox on Linux? + +It should already come pre-installed in your Linux distribution. But, if it is not present, you can search for it in the software center or install it using the terminal with the following command: + +``` +sudo apt install firefox +``` + +### 3\. Chromium + +![][10] + +**Pros** + + * Open Source Chrome alternative + * Similar features to Google Chrome + + + +**Cons** + + * Lacks certain features that Google Chrome offers + + + +Chromium is the open-source alternative and the base for Google Chrome and many other chrome-based browsers. + +If you do not want to use Google Chrome, chromium’s your best bet to get the same experience on Linux. + +Even though Google controls Chromium and [has been locking down Chrome][11], it is a good option for Linux systems. + +[Chromium][12] + +#### How to Install Chromium on Linux? + +You should be able to find it easily in the software center. But, if you need help, refer to our [installation guide for Chromium][13]. + +### 4\. Google Chrome + +![][14] + +**Pros** + + * Seamless integration with Google services + + + +**Cons** + + * Not open-source + + + +Google Chrome is an excellent web browser unless you do not want to opt for a proprietary solution or products by Google. + +You get all the essential features and the ability to integrate all Google services. If you prefer using Google Chrome on Android and want to sync across multiple platforms, it is an obvious choice for desktop Linux. + +If you were looking for a simple and capable web browser while using Google services, Google Chrome can be a great pick. + +[Google Chrome][15] + +#### How to Install Google Chrome on Linux? + +Google Chrome offers both Deb and RPM packages to let you install on any Ubuntu-based or Fedora/openSUSE distribution. + +If you need help with the installation, I should point you to our guide on [installing Google Chrome on Linux][16]. + +### 5\. Brave Browser + +![][17] + +**Pros** + + * Privacy protection features + * Performance + + + +**Cons** + + * No account-based sync + + + +Brrave browser is one of the most popular Linux browsers. + +It is an open-source project and is based on chromium. It offers several useful privacy protection features and is known for its blazing fast performance. + +Unlike any other browsers, you can get rewards even if you block advertisements on websites. The rewards you collect can only be used to give back to your favorite websites. This way, you get to block ads and also support the website. + +You can expect a faster user experience with minimum resource usage.   + +We also have a detailed [comparison article on Brave vs Firefox][18], if you need to decide between the two. + +Brave + +#### How to Install Brave on Linux? + +Unlike some other web browsers, you cannot directly find a package or in the software center. You need to enter some commands in the terminal to install the browser. + +Fret not, you can follow our [instructions to install brave browser][19] to proceed. + +### 6\. Opera + +![][20] + +**Pros** + + * Free VPN in-built + * Extra features + + + +**Cons** + + * Not open source + + + +While Opera is not the most popular choice, it is definitely a useful browser for Linux users. + +It comes with a built-in VPN and adblocker. So, you should have the basic privacy protection sorted with the help of the Opera web browser. + +You can quickly access popular chat messengers right from the sidebar without needing to launch a separate app or window. This is similar to Vivaldi considering the side chat messenger web apps but the user experience is significantly different. + +Overall, it is a good pick if you want a free VPN as an added bonus to other essential browsing features. + +It is worth noting that Opera offers a unique [Opera GX][21] browser which lets you tweak/enforce limit on system resources when using a browser along with gaming activities. This was still in development for Linux at the time of writing, if it is available by the time you read it, that could be a fantastic option! + +[Opera][22] + +#### How to Install Opera? + +Opera provides Deb package for Linux. You just head to its official website to download and install it. + +### 7\. Microsoft Edge + +![][23] + +**Pros** + + * Convenient option for Windows users who also use Linux + + + +**Cons** + + * Not open-source + * Still in Beta + + + +Microsoft Edge has surpassed Mozilla Firefox in terms of its popularity. Not just because it’s the default Windows browser, but it also offers a promising web experience while based on Chrome. + +At the time of writing this article, Microsoft Edge is available as a beta release for Linux. It works fine at the moment, but lacks quite a few features normally available for Windows. + +Overall, you should find most of the essential features available. + +If you use Windows and Linux as your desktop platforms, Microsoft Edge can come in handy as the preferred web browser. + +[Microsoft Edge][24] + +#### How to install Microsoft Edge on Linux? + +It is currently available through Microsoft Insiders channel as a beta. So, this could change once the stable release is out. + +For now, you can get the Deb/RPM file through the Microsoft Edge insiders web page and install it. + +You can also have a look at our how-to article on [installing Microsoft Edge on Linux][25]. + +### Unique Web Browsers for Linux + +Most of the users prefer to stick with the mainstream options because of security updates and future upgrades, but there are some different options as well. And, some exclusive to Linux users. + +### 8\. GNOME Web or Epiphany + +![][26] + +**Pros** + + * Minimal + * Open Source + + + +**Cons** + + * Lacks many features + * No cross-platform support + + + +Epiphany browser is the default GNOME browser. elementary OS utilizes it as its default web browser. + +It is a minimal browser that offers a clean and elegant user experience. You cannot sync your bookmarks or history, so you need to manually export them if you want to back them up or transfer to another browser. + +[GNOME Web][27] + +#### How to Install GNOME Web? + +You may find it pre-installed in some Linux distros. If not, you can check out its [Flatpak package][28] to install the latest version on any Linux distro. + +### 9\. Falkon + +![][29] + +**Pros** + + * Firefox-based alternative + + + +**Cons** + + * Not a replacement to Firefox + * No cross-platform support + + + +Falkon is a Firefox-based browser with privacy in mind. It should be good enough for basic web browsing, but it may not be a solution for your daily driver. + +You can explore more about it and get the installation instructions in our dedicated [article on Falkon browser][30]. + +[Falkon][31] + +### 10\. Nyxt + +![][32] + +**Pros** + + * Highly customizable + * Keyboard use focused + + + +**Cons** + + * Suitable for certain users + * Lack of cross-platform support + + + +Nyxt is an interesting web browser built for power keyboard users. You can browse and navigate the web using keyboard shortcuts. + +To know more about it and the installation instructions, go through our detailed article on [Nyxt browser][33]. + +Nyxt + +### Wrapping Up + +When it comes to Linux, you get a variety of choices available to pick. I have deliberately skipped [command line based web browsers like Lynx][34] here. + +So, what would be your selection for the best web browser? + +Moreover, I’d be curious to know what do you look for when installing a web browser for your system? + +Feel free to share your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-browsers-ubuntu-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/web-browser-ubuntu.png?resize=800%2C450&ssl=1 +[2]: https://itsfoss.com/open-source-browsers-linux/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/vivaldi-screenshot.png?resize=800%2C502&ssl=1 +[4]: https://news.itsfoss.com/vivaldi-4-0-release/ +[5]: https://vivaldi.com +[6]: https://itsfoss.com/install-deb-files-ubuntu/ +[7]: https://itsfoss.com/install-rpm-files-fedora/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-proton.png?resize=800%2C450&ssl=1 +[9]: https://www.mozilla.org/en-US/firefox/new/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/chromium-screenshot.png?resize=800%2C558&ssl=1 +[11]: https://news.itsfoss.com/is-google-locking-down-chrome/ +[12]: https://www.chromium.org +[13]: https://itsfoss.com/install-chromium-ubuntu/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/google-chrome-screenshot.png?resize=800%2C557&ssl=1 +[15]: https://www.google.com/chrome/ +[16]: https://itsfoss.com/install-chrome-ubuntu/ +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-ui-new.jpg?resize=800%2C450&ssl=1 +[18]: https://itsfoss.com/brave-vs-firefox/ +[19]: https://itsfoss.com/brave-web-browser/ +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/opera-screenshot.png?resize=800%2C543&ssl=1 +[21]: https://www.opera.com/gx +[22]: https://www.opera.com/ +[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/microsoft-edge-on-linux.png?resize=800%2C439&ssl=1 +[24]: https://www.microsoftedgeinsider.com/en-us/ +[25]: https://itsfoss.com/microsoft-edge-linux/ +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/gnome-web.png?resize=800%2C450&ssl=1 +[27]: https://apps.gnome.org/en-GB/app/org.gnome.Epiphany/ +[28]: https://flathub.org/apps/details/org.gnome.Epiphany +[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-1.png?resize=800%2C450&ssl=1 +[30]: https://itsfoss.com/falkon-browser/ +[31]: https://www.falkon.org +[32]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/nyxt-browser-settings.png?resize=800%2C617&ssl=1 +[33]: https://itsfoss.com/nyxt-browser/ +[34]: https://itsfoss.com/terminal-web-browsers/ From 3b1be902e0d8e976ad1aba073167f80315b1ac2c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Sep 2021 05:04:05 +0800 Subject: [PATCH 081/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901=20?= =?UTF-8?q?20=20essential=20Linux=20commands=20for=20every=20user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210901 20 essential Linux commands for every user.md --- ...essential Linux commands for every user.md | 255 ++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 sources/tech/20210901 20 essential Linux commands for every user.md diff --git a/sources/tech/20210901 20 essential Linux commands for every user.md b/sources/tech/20210901 20 essential Linux commands for every user.md new file mode 100644 index 0000000000..9bfb9aac60 --- /dev/null +++ b/sources/tech/20210901 20 essential Linux commands for every user.md @@ -0,0 +1,255 @@ +[#]: subject: "20 essential Linux commands for every user" +[#]: via: "https://opensource.com/article/21/9/essential-linux-commands" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +20 essential Linux commands for every user +====== +From new user to power user, here are 20 Linux commands that will make +your life easier. +![Command line prompt][1] + +Typing commands into a darkened terminal window may seem antiquated to some, but for many computer users, it's the most efficient, most accessible, and clearest way to accomplish nearly any task a computer is capable of performing. These days, thanks to all the projects that bring open source commands to non-open platforms like macOS and Windows, terminal commands are relevant to everybody, not just Linux and BSD users. It may surprise you to learn that there are thousands of commands installed on an average [POSIX][2] computer, but of course, a good many of those aren't really intended to be used, at least not directly or regularly. Some commands are more universally useful than others, and still fewer are absolutely essential for effective terminal use. + +Here are the top 20 commands a terminal user might find themselves using: + +### cd + +Outside of a terminal, you click on icons to move from one folder to another, but in the terminal, you use `cd`. The `cd` command, which stands for _change directory_, is how you move through a Linux system. It's the fastest and most direct route from one place to another. + +For instance, on the desktop, when you want to move from your home directory (the place you keep all of your folders) to a folder called `presentations`, then you might first have to open your `Documents` folder, then open a folder called `work`, then a `projects` folder, and then the `conference` folder, and finally the `presentations` folder, which contains your exciting LibreOffice Impress slideshow. That's a lot of double-clicking. It may also be a lot of moving around on the screen, depending on where new windows appear, and a lot of waypoints for your brain to track. Many people circumvent this seemingly minor task by keeping _everything_ on their desktop. + +Terminal users avoid this issue by just typing: + + +``` +`$ cd ~/Documents/work/projects/conference/presentations` +``` + +Experienced terminal users don't even bother typing all of that. They use the **Tab** key to autocomplete the words for them. And sometimes, you don't even have to resort to autocompletion. You can use wildcards instead: + + +``` +`$ cd ~/Doc*/work/*/conf*/p*` +``` + +### pwd + +In the words of Buckaroo Banzai: "No matter where you go, there you are." + +When you need to figure out where exactly that is, you use the `pwd` command. The `pwd` stands for _print working directory,_ and that's exactly what it does. The `--physical` (or just `-P` in some implementations) shows your location with all symlinks resolved. + + +``` +$ pwd +/home/tux/presentation + +$ pwd --physical +/home/tux/Documents/work/projects/conference/presentations +``` + +### sed + +Better known as `sed`, the stream editor is a powerful bulk _find and replace_ command, but it's also a legitimate text editor. You can learn to use it by reading my [introductory article][3], and then become an expert with my [advanced tutorial and cheat sheet][4]. + +### grep + +The `grep` command is so ubiquitous that it's often used as a verb ("I'll grep through some files") and a gerund ("grepping some output"). It's a key component when parsing text in your shell, whether you're looking through log files or parsing the output of some other command. It's a way for the busy user to focus on specific information. Given just how much data there is in the computing world, there's no wonder it's a popular command. Go grok grep by reading my [introductory article][5], and then download the [cheat sheet][6]. + +### file + +Use the `file` command when you need to know what type of data a file contains: + + +``` +$ file example.foo +example.foo: RIFF (little-endian) data, Web/P image [...] + +$ file example.bar +example.bar: ELF 64-bit LSB executable, x86-64 [...] +``` + +The `file` command isn't magic, of course. It only reports based on how a file identifies itself, and files can be wrong, corrupted, or disguised. A rigorous inspection with [`hexdump`][7] provides more certainty, but for casual use, the `file` command is convenient. + +### awk + +Awk isn't just a command; it's a literal [programming language][8]. [Download our free Awk ebook][9], learn it, and you'll be writing scripts you never thought possible. + +### curl + +The `curl` command is a [non-interactive web browser][10] for your terminal. It's a [development tool][11] for web and API developers. It's a complex command for its flexibility, but it's worth learning if you want to interact with network services from your terminal smoothly. + +Download our free [`curl` cheat sheet][12], so you can internalize its many options. + +### ps + +Managing your system's resources is mostly up to the kernel, but when you prefer or require a manual approach, there's the `ps` command. Learn about `ps` in my [monitor your Linux system with procps-ng][13] article. + +### cat + +The [`cat` command][14] is short for _concatenate_, and it was very useful once for joining files that had been split (with a command intuitively called `split`) into several small files due to size limitations. Today, `cat` is mostly used as a way to dump the contents of a text file into your terminal for quick reference, unless you use `head`, `tail`, `more`, or `less` for that. + +Despite its almost deprecated original purpose, and despite that several other commands also perform its secondary function, `cat` is still a useful utility. For instance, it can be a stand-in for the copy (`cp`) command: + + +``` +`$ cat myfile.ogg > /backups/myfile.ogg` +``` + +It can reveal inconvenient invisible characters in files. The **Tab** character, which breaks [YAML][15], shows up as `^I` with the `--show-tabs` option: + + +``` +$ cat --show-tabs my.yaml + +\--- + +\- hosts: all +  tasks: +  - name: Make sure the current version of 'sysstat' is installed. +    dnf: +     name: +^I- sysstat +^I- httpd +^I- mariadb-server +     state: latest +``` + +It can show non-printing characters with `--show-nonprinting`, mark the ends of lines with `--show-ends`, provide line numbers with `--number`, and more. + +### find + +The `find` command helps you find files, but thanks to its many options, it can help you find files with a variety of filters and parameters. Learn the basics from my [introductory article][16]. + +And in case you've been wondering why the most fundamental command of all, the humble [`ls` command][17], isn't on this list, it's because of the flexibility of `find`. Not only can find list files: + + +``` +$ find . +./bar.txt +./baz.xml +./foo.txt +[...] +``` + +It can also provide long listings: + + +``` +$ find . -ls +3014803  464 -rw-rw-r--   1 tux users  473385 Jul 26 07:25 ./foo.txt +3014837  900 -rwxrwxr-x   1 tux users  918217 Nov  6  2019 ./baz.xml +3026891  452 -rw-rw-r--   1 tux users  461354 Aug 10 13:41 ./foo.txt +[...] +``` + +It's a technicality, but a neat trick to know. + +### tar + +People sometimes joke about Linux commands by citing BSD's `tar` syntax. In spite of its reputation, the `tar` command can actually be very intuitive. Read my [how to unzip a tar.gz file][18] article to learn the simple secret to rattling off a `tar` command on demand. + +### more or less or most + +Pagers are like `cat`, except they pause their output at the bottom of your screen until you scroll down for more. It's a simple application, but there's nuance to each implementation. Do you scroll with arrow keys or the spacebar? Do you have to quit manually, or does the pager exit at the end of the file it's displaying? What's your preferred search behavior? Choose your favorite pager and set it in your `.bashrc`! + +### ssh and scp + +OpenSSH not only helps secure connections to remote systems it also enables other commands. For instance, for many users, it's their `.ssh` directory that makes it possible for them to interact smoothly with Git repositories, post updates to a website, or log in to their cloud's control plane. + +### mv + +The `mv` command does double-duty: It both [moves files][19] and it [renames files][20]. It has several available safeguards, including `--interactive` and `--no-clobber` options to avoid clobbering an existing file, a `--backup` command to ensure data is preserved until it is verified at its new location, and the `--update` option to ensure that an older version doesn't replace a newer file. + +### sudo + +When you have a single user with a known user name and _all_ the privileges on a system, that user quickly becomes the target of attacks. By eliminating the need for a literal `root` user, the `sudo` command elegantly removes important information about your system from general knowledge. That's not all it does, though. With `sudo`, you can easily manage privileges down to individual commands, users, and groups. You can enable password-less execution of select commands, record user sessions, verify commands with digest validation, [and more][21]. + +### alias + +Turn long commands into easy-to-remember shortcuts by using the `alias` command: + + +``` +`$ alias ls='ls --classify --almost-all --ignore-backups --color'` +``` + +### clear + +Sometimes your terminal gets cluttered. There's nothing like a nice, fresh screen after typing `clear` (or pressing **Ctrl+L** in some shells). + +### setfacl + +Traditionally, POSIX file permissions were determined by `chown` and `chmod`. Systems have become more complex, though, so there's a command to provide a little more flexibility. The `setfacl` command lets you create an [Access Control List (ACL)][22], granting permissions to arbitrary users and setting default permissions for folders and the contents created within them. + +### netcat + +Not every user needs netcat (`nc`), but few who use it ever want to give it up. The `nc` command is an all-purpose network connection tool. + +It can connect to a port, similar to `telnet`: + + +``` +`$ nc -u 192.168.0.12 80` +``` + +It can ping a port, similar to `ping`: + + +``` +`$ nc -zvn 192.168.0.12 25` +``` + +It can probe for open ports, similar to `nmap`: + + +``` +`$ nc -zv 192.168.0.12 25-80` +``` + +And that's just a small sample. + +### you + +The Linux terminal is, in part, about creative problem-solving. When you learn commands, you're also learning building blocks you can use to create your own commands. Many of the commands in my [shell history][23] are shell scripts I've written myself. The result is that my workflow is customized to how I want to work. Essential commands in your shell can also be the ones you design for your own efficacy and comfort. Spend some time getting to know some great commands, and then build your own. And when you hit upon something really good, make it open source so you can share your ideas with others! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/essential-linux-commands + +作者:[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/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[3]: https://opensource.com/article/20/12/sed +[4]: https://opensource.com/article/21/3/sed-cheat-sheet +[5]: https://opensource.com/article/21/3/grep-cheat-sheet +[6]: https://opensource.com/downloads/grep-cheat-sheet +[7]: https://opensource.com/article/19/8/dig-binary-files-hexdump +[8]: https://opensource.com/article/21/1/learn-awk +[9]: https://opensource.com/article/20/9/awk-ebook +[10]: https://opensource.com/article/20/5/curl-cheat-sheet +[11]: https://www.redhat.com/sysadmin/use-curl-api +[12]: https://opensource.com/downloads/curl-command-cheat-sheet +[13]: https://opensource.com/article/21/8/linux-procps-ng +[14]: https://opensource.com/article/19/2/getting-started-cat-command +[15]: https://www.redhat.com/sysadmin/yaml-beginners +[16]: https://opensource.com/article/21/8/find-files-and-directories-find +[17]: https://opensource.com/article/19/7/master-ls-command +[18]: https://opensource.com/article/17/7/how-unzip-targz-file +[19]: https://opensource.com/article/21/8/move-files-linux +[20]: https://opensource.com/article/21/8/rename-file-linux-terminal +[21]: https://opensource.com/article/19/10/know-about-sudo +[22]: https://opensource.com/article/20/3/external-drives-linux +[23]: https://opensource.com/article/18/6/history-command From f9d427b042a1fe43949019cf29f8e73b24dd62f2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Sep 2021 05:04:19 +0800 Subject: [PATCH 082/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901=20?= =?UTF-8?q?Control=20your=20Raspberry=20Pi=20remotely=20with=20your=20smar?= =?UTF-8?q?tphone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210901 Control your Raspberry Pi remotely with your smartphone.md --- ...pberry Pi remotely with your smartphone.md | 212 ++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 sources/tech/20210901 Control your Raspberry Pi remotely with your smartphone.md diff --git a/sources/tech/20210901 Control your Raspberry Pi remotely with your smartphone.md b/sources/tech/20210901 Control your Raspberry Pi remotely with your smartphone.md new file mode 100644 index 0000000000..529b3c7f70 --- /dev/null +++ b/sources/tech/20210901 Control your Raspberry Pi remotely with your smartphone.md @@ -0,0 +1,212 @@ +[#]: subject: "Control your Raspberry Pi remotely with your smartphone" +[#]: via: "https://opensource.com/article/21/9/raspberry-pi-remote-control" +[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Control your Raspberry Pi remotely with your smartphone +====== +Control the GPIOs of your Raspberry Pi remotely with your smartphone. +![A person looking at a phone][1] + +Wouldn't it be nice to control the general-purpose input/outputs (GPIOs) of the Raspberry Pi remotely with your smartphone? If you can answer the question in the affirmative, I would like to introduce you to a simple way to implement this. Writing this article, I have no specific application in mind, but I can think of combining it with lawn irrigation, any illumination, or a garage door opener. + +Anyway, all you need to get started is a Raspberry Pi and a smartphone. The actual logic is already available on GitHub, so even without programming skills, you will be able to follow the steps described in this article. + +### Architecture + +We do the major work with [Pythonic][2]—a graphical Python programming framework I develop in my leisure. Pythonic brings a [Telegram][3] bot programming element with it, which acts as our smartphone interface. A significant advantage of this setup is that it is scalable regarding the number of clients: You can decide whether you want to control the GPIOs only by yourself, share them with your relatives or friends, or share the control capabilities with the public. Of course, a prerequisite is permanent internet access to communicate between the Telegram server and the client. To establish internet access, you could use either the Ethernet interface or the WiFi functionality of the Raspberry Pi. + +### Install Pythonic + +To get started, you have to install Pythonic on your Raspberry Pi. The easiest way of doing that is to flash the SD card with the preconfigured Pythonic image available on [sourceforge.net][4]. + +Download and unzip the image and flash it to the SD card of the Raspberry Pi. On Windows, you can use [balenaEtcha][5] for it. On Linux, you can do it with the onboard tools. + + 1. Plugin the SD card and check under which device it is showing up by typing `lsblk -p`. + +![Using lsblk -p to check under which device your SD card shows ][6] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + + 2. In the screenshot above, the SD card device is `/dev/sdc`, and my systems automatically mounted two partitions that were found on it. If this is the case, unmount it by typing `umount /dev/sdc1 && umount /dev/sdc2`. + + 3. Flash the SD card with the following command: `dd if=~/Downloads/Pythonic-1.7.img of=/dev/sdc bs=32M, conv=fsync`.  +**Attention***: *This will delete all previous files on the SD card. + + 4. The flashing process will take a while. +Once the process is finished, put the SD card back in your Raspberry Pi and boot it up. + + + + +### Establishing a connection + +The Pythonic image has no pre-installed desktop. The whole configuration is web-based, so you must establish a TCP/IP connection. It is straightforward to connect using an ordinary internet router. If you don't have access to such a router, you can also establish a connection over the onboard universal asynchronous receiver/transmitter ****(UART) device to configure the Ethernet or WiFi interface. + +#### Locale DNS + +By default, the Pythonic image is configured to acquire an IP address by DHCP. Your internet router at home usually runs a DHCP server that distributes IP addresses to connected devices. Make a connection between a free Ethernet port of your internet router and the Ethernet port on your Raspberry Pi and boot it up. + +You can now try to access the web-based GUI from a device within your local network. If the DNS in your local network works properly, open a browser and navigate to http ://PythonicRPI:7000/ to open the programming GUI. + +#### Locale IP + +I assume your router also offers a graphical configuration GUI. The configuration GUI provides information about the devices in your local network. You can find the IP address of your local router by typing `ip route`. + +In my case, the route is available under 192.168.188.1. Now login to your router's configuration page and check which IP was the Raspberry Pi given. + +![Viewing active connections][8] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +In my network, the Raspberry Pi is available under 192.168.188.63, so I can access the GUI at http ://192.168.188.63:7000/. + +#### UART + +Put the SD card back into the card reader and mount the _boot_ partition. Open the _config.txt_ on the _boot_ partition and add the following line to the end: + + +``` +`enable_uart=1` +``` + +Put the SD card back in the Raspberry Pi and boot it up. You can now establish a console connection with a UART-USB converter to set up a static IP address or configure a WiFi connection. + +![Establishing a UART connection][9] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +The default connection parameters are: + + * TxD: GPIO14 + * RxD: GPIO15 + * Ground: Pin 6 or 14 + * Baud rate: 115200 + * Data bits: 8 + * Parity bit: None + * Stop bits: 1 + + + +You can find more information on [elinux.org][10]. + +### Uploading the configuration + +To proceed with the upcoming steps, download the example files from [github][11] to your local hard drive. + +![GitHub example files repository ][12] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +The example consists of several files of two elementary types: + + * `*.py-files`—Contains the actual implementation of specific functionality. + * `current_config.json`—This file describes the configured elements, the links between the elements, and the variable configuration of the elements. + + + +This example is a slightly modified version of the already available reference implementation. You can access it by dragging and dropping the files from the left sidebar to the working area. + +Now upload the configuration to your target: + +![Pythonic GUI overview][13] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +With the blue-marked button, you upload the `current_config.json` to the target. You can upload only valid configuration files. After uploading, you can find the file on the target under `/home/pythonic/Pythonic/current_config.json`. + +With the green-marked button, you upload each `*.py-files`. Afterward, the `*.py-files` can be found under `/home/pythonic/Pythonic/executables`. + +It is possible to upload any kind of file to the `executables` folder because I plan to support binary executables in the future. + +However, so that the configuration works, the actual implementation must be available for each element described in `current_config.json`. + +### Setup a Telegram Bot + +The configuration should now look like this: + +![Pythonic GPIO remote configuration][14] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +Well done! But this setup won't work yet. Try to start this configuration by clicking **Play** on the _ManualScheduler - 0x5f8125f5_ element. The connected Telegram element will start but then immediately quit. This is because the Telegram element needs some additional configuration: Right-click on the Telegram element. You should now see pop-up windows like this: + +![Pop-up for Phythonic GPIO remote Telegram][15] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +You have to provide a Telegram bot token to communicate with the server. The process of creating a bot token is described on [core.telegram.org][16]. + +In a nutshell: Start a chat with the [BotFather][17] and create a bot with the `/newbot` command. At the end of the process, the BotFather will provide you a token that you can copy and paste to the Telegram element. + +That's it. Now you should be able to start the Telegram element by clicking on the play button on the _ManualScheduler - 0x5f8125f5_ element. The Telegram element should now be active, which can be seen from the green frame. + +![ Active RPI Telegram element][18] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +The spinning bar on the bottom info line indicates a working connection with the backend. + +Start a chat with your newly created bot by typing _@<name-of-your-bot>_ in the search field of Telegram. Click **Start** to get the initial state of the GPIOs. I named my bot _RPIremoteIO_: + +![Start RPI Telegram][19] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +### Debugging and Modification + +Open a new tab in your browser and navigate to http ://PythonicRPI:8000/. This will open the pre-installed [code-server][20] IDE. On the left pane, click on the files button and open `telegram_2ca7cd73.py` : + +![RPI code server IDE][21] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +You should now be able to start debugging and follow the path of execution like in the following screen recording: + + + +The Telegram element uses an [inline keyboard][22] which shows the target state of GPIO4 and GPIO5. This way, several users could control the state of GPIOs without disturbing each other because the new target state for the GPIOs is always provided to all subscribers. + +### Conclusion + +With this example, you should get a feeling of how everything connects. You can adapt the example as you like: Change or add additional GPIOs, use the analog features or get the input state on demand. If you connect a suitable relay, you could also drive higher loads with the Raspberry Pi. I am sure you will do something great with it! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/raspberry-pi-remote-control + +作者:[Stephan Avenwedde][a] +选题:[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/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_mobile_phone.png?itok=RqVtvxkd (A person looking at a phone) +[2]: https://github.com/hANSIc99/Pythonic +[3]: https://telegram.org/ +[4]: https://sourceforge.net/projects/pythonicrpi/ +[5]: https://www.balena.io/etcher/ +[6]: https://opensource.com/sites/default/files/uploads/pi_gen_lsblk_mounted_1.png (Using lsblk -p to check under which device your SD card shows ) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/active_connections.png (Viewing active connections) +[9]: https://opensource.com/sites/default/files/uploads/pythonic_rpi_uart.jpg (Establishing a UART connection) +[10]: https://elinux.org/RPi_Serial_Connection +[11]: https://github.com/hANSIc99/Pythonic/tree/master/examples/rpi_telegram_remote_io +[12]: https://opensource.com/sites/default/files/uploads/github_example_remote_gpio.png (GitHub example files repository ) +[13]: https://opensource.com/sites/default/files/uploads/pythonic_gui_overview.png (Pythonic GUI overview) +[14]: https://opensource.com/sites/default/files/uploads/pythonic_gpio_remote_config.png (Pythonic GPIO remote configuration) +[15]: https://opensource.com/sites/default/files/uploads/pythonic_gpio_remote_telegram.png (Pop-up for Phythonic GPIO remote Telegram) +[16]: https://core.telegram.org/bots#6-botfather +[17]: https://t.me/botfather +[18]: https://opensource.com/sites/default/files/uploads/rpi_telegram_active.png (Active RPI Telegram element) +[19]: https://opensource.com/sites/default/files/uploads/rpi_start_telegram.png (Start RPI Telegram) +[20]: https://github.com/cdr/code-server +[21]: https://opensource.com/sites/default/files/uploads/rpi_code-server_ide.png (RPI code server IDE) +[22]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating From 1739676bd01b702a90d2b45c012199906bce5a14 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Sep 2021 05:04:32 +0800 Subject: [PATCH 083/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901=20?= =?UTF-8?q?What=20are=20container=20runtimes=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210901 What are container runtimes.md --- .../20210901 What are container runtimes.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20210901 What are container runtimes.md diff --git a/sources/tech/20210901 What are container runtimes.md b/sources/tech/20210901 What are container runtimes.md new file mode 100644 index 0000000000..eaba30fae8 --- /dev/null +++ b/sources/tech/20210901 What are container runtimes.md @@ -0,0 +1,97 @@ +[#]: subject: "What are container runtimes?" +[#]: via: "https://opensource.com/article/21/9/container-runtimes" +[#]: author: "Nived V https://opensource.com/users/nivedv" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What are container runtimes? +====== +Take a deep dive into container runtimes so you can understand how +container environments are built. +![Ships at sea on the web][1] + +In my examination of [container images][2], I discussed container fundamentals, but now it's time to delve deeper into container runtimes so you can understand how container environments are built. The information in this article is in part extracted from the [official documentation][3] of the Open Container Initiative (OCI), the open standard for containers, so this information is relevant regardless of your container engine. + +### Container runtimes + +So what really happens in the backend when you run a command like `podman run` or `docker run` command? Here is a step-by-step overview for you: + + 1. The image is pulled from an image registry if it not available locally + 2. The image is extracted onto a copy-on-write filesystem, and all the container layers overlay each other to create a merged filesystem + 3. A container mount point is prepared + 4. Metadata is set from the container image, including settings like overriding CMD, ENTRYPOINT from user inputs, setting up SECCOMP rules, etc., to ensure container runs as expected + 5. The kernel is alerted to assign some sort of isolation, such as process, networking, and filesystem, to this container (namespaces) + 6. The kernel is also alerted to assign some resource limits like CPU or memory limits to this container (cgroups) + 7. A system call (syscall) is passed to the kernel to start the container + 8. SELinux/AppArmor is set up + + + +Container runtimes take care of all of the above. When we think about container runtimes, the things that come to mind are probably runc, lxc, containerd, rkt, cri-o, and so on. Well, you are not wrong. These are container engines and container runtimes, and each is built for different situations. + +_Container runtimes_ focus more on running containers, setting up namespace and cgroups for containers, and are also called lower-level container runtimes. Higher-level container runtimes or container engines focus on formats, unpacking, management, and image-sharing. They also provide APIs for developers. + +### Open Container Initiative (OCI) + +The Open Container Initiative (OCI) is a Linux Foundation project. Its purpose is to design certain open standards or a structure around how to work with container runtimes and container image formats. It was established in June 2015 by Docker, rkt, CoreOS, and other industry leaders. + +It does this using two specifications: + +#### 1\. Image Specification (image-spec) + +The goal of this specification is to enable the creation of interoperable tools for building, transporting, and preparing a container image to run. + +The high-level components of the spec include: + + * [Image Manifest][4] — a document describing the elements that make up a container image + * [Image Index][5] — an annotated index of image manifests + * [Image Layout][6] — a filesystem layout representing the contents of an image + * [Filesystem Layer][7] — a changeset that describes a container’s filesystem + * [Image Configuration][8] — a document determining layer ordering and configuration of the image suitable for translation into a [runtime bundle][9] + * [Conversion][10] — a document explaining how this translation should occur + * [Descriptor][11] — a reference that describes the type, metadata, and content address of referenced content + + + +#### 2\. Runtime specification (runtime-spec) + +This specification aims to define the configuration, execution environment, and lifecycle of a container. The config.json file provides the container configuration for all supported platforms and details the field that enables the creation of a container. The execution environment is detailed along with the common actions defined for a container’s lifecycle to ensure that applications running inside a container have a consistent environment between runtimes. + +The Linux container specification uses various kernel features, including namespaces, cgroups, capabilities, LSM, and filesystem jails to fulfill the spec. + +### Now you know + +Container runtimes are managed by the OCI specifications to provide consistency and interoperability. Many people use containers without the need to understand how they work, but understanding containers is a valuable advantage when you need to troubleshoot or optimize how you use them. + +* * * + +_This article is based on a [techbeatly][12] article and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/container-runtimes + +作者:[Nived V][a] +选题:[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/nivedv +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes_containers_ship_lead.png?itok=9EUnSwci (Ships at sea on the web) +[2]: https://opensource.com/article/21/8/container-fundamentals-2 +[3]: https://github.com/opencontainers +[4]: https://github.com/opencontainers/image-spec/blob/master/manifest.md +[5]: https://github.com/opencontainers/image-spec/blob/master/image-index.md +[6]: https://github.com/opencontainers/image-spec/blob/master/image-layout.md +[7]: https://github.com/opencontainers/image-spec/blob/master/layer.md +[8]: https://github.com/opencontainers/image-spec/blob/master/config.md +[9]: https://github.com/opencontainers/runtime-spec +[10]: https://github.com/opencontainers/image-spec/blob/master/conversion.md +[11]: https://github.com/opencontainers/image-spec/blob/master/descriptor.md +[12]: https://medium.com/techbeatly/container-runtimes-deep-dive-77eb0e511939 From dfc0fd50fa4b2bf60dbb4542bc8e7e44944436f9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 2 Sep 2021 08:36:37 +0800 Subject: [PATCH 084/138] translated --- ...to Download Audio Only Using youtube-dl.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) rename {sources => translated}/tech/20210820 How to Download Audio Only Using youtube-dl.md (55%) diff --git a/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md b/translated/tech/20210820 How to Download Audio Only Using youtube-dl.md similarity index 55% rename from sources/tech/20210820 How to Download Audio Only Using youtube-dl.md rename to translated/tech/20210820 How to Download Audio Only Using youtube-dl.md index 23ebe4e425..7fae01b4e2 100644 --- a/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md +++ b/translated/tech/20210820 How to Download Audio Only Using youtube-dl.md @@ -7,34 +7,34 @@ [#]: publisher: " " [#]: url: " " -How to Download Audio Only Using youtube-dl +如何使用 youtube-dl 只下载音频 ====== -[youtube-dl][1] is a versatile command line tool for downloading videos from YouTube and many other websites. I use it for making back up of my own YouTube videos. +[youtube-dl][1] 是一个多功能的命令行工具,用于从 YouTube 和许多其他网站下载视频。我用它来做我自己的 YouTube 视频的备份。 -By default, you [use youtube-dl for downloading videos][2]. How about extracting only the audio with youtubde-dl? That’s very simple actually. Let me show you the steps. +默认情况下,你[使用 youtube-dl 下载视频][2]。用 youtube-dl 只提取音频怎么样? 其实很简单。让我告诉你步骤。 -Attention +注意 -Downloading videos from websites could be against their policies. It’s up to you if you choose to download videos or audio. +从网站下载视频可能违反他们的政策。这取决于你是否选择下载视频或音频。 -### Download only audio with youtube-dl +### 使用 youtube-dl 只下载音频 -Please make sure that you have installed youtube-dl on your Linux distribution first. +请确保你已经在你的 Linux 发行版上安装了 youtube-dl。 ``` sudo snap install youtube-dl ``` -If you only want to download audio from a YouTube video, you can use the -x option with youtube-dl. This extract-audio option converts the video files to audio-only files. +如果你只想从 YouTube 视频中下载音频,你可以使用 youtube-dl 的 -x 选项。这个提取音频的选项将视频文件转换为纯音频文件。 ``` youtube-dl -x video_URL ``` -The file is saved in the same directory from where you ran the youtube-dl command. +该文件被保存在你运行 youtube-dl 命令的同一目录下。 -Here’s an example where I downloaded the voice-over of our Zorin OS 16 review video. +这是我下载 Zorin OS 16 评论视频的画外音的示例。 ``` youtube-dl -x https://www.youtube.com/watch?v=m_PmLG7HqbQ @@ -45,15 +45,15 @@ youtube-dl -x https://www.youtube.com/watch?v=m_PmLG7HqbQ [ffmpeg] Post-process file Zorin OS 16 Review - It's a Visual Masterpiece-m_PmLG7HqbQ.m4a exists, skipping ``` -Did you notice the audio format? It is in .m4a format. You may specify the audio format to something of your choice. +你注意到音频格式了吗?它是 .m4a 格式。你可以把音频格式指定为你所选择的格式。 -Say you want to extract the audio in MP3 format. You can use it like this: +比如你想提取 MP3 格式的音频。你可以像这样使用它: ``` youtube-dl -x --audio-format mp3 video_URL ``` -Here’s the same example I showed previously. You can see that it [uses ffmpeg to convert][3] the m4a file into mp3. +下面是我之前展示的同一个例子。你可以看到它[使用 ffmpeg 转换][3] m4a 文件为 mp3: ``` youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=m_PmLG7HqbQ @@ -65,33 +65,33 @@ youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=m_PmLG7HqbQ Deleting original file Zorin OS 16 Review - It's a Visual Masterpiece-m_PmLG7HqbQ.m4a (pass -k to keep) ``` -### Download entire YouTube playlist in MP3 format +### 以 MP3 格式下载整个 YouTube 播放列表 -Yes, you can totally do that. The main thing is to get the URL of the playlist here. It is typically in the following format: +是的,你完全可以这样做。最主要的是要在这里得到播放列表的 URL。它通常是以下格式: ``` https://www.youtube.com/playlist?list=XXXXXXXXXXXXXXXXXXX ``` -To get the URL of a playlist, click on its name when the playlist is being displayed in the right sidebar. +要获得一个播放列表的 URL,当播放列表显示在右边栏时,点击其名称。 ![Click on the playlist title][4] -It will take you to the playlist page and you can copy the URL here. +它将带你到播放列表页面,你可以在这里复制 URL。 ![Grab the playlist URL][5] -Now that you have the playlist URL, you can use it to download the audio files in MP3 format in the following fashion: +现在你有了播放列表的 URL,你可以用它来下载 MP3 格式的音频文件,方法如下: ``` youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" playlist_URL ``` -That scary looking `-o "%(title)s.%(ext)s"` specifies the output file (with option -o) and instructs it to use the title of the video and the extension (mp3 in this case) for naming the audio files. +那个看起来很可怕的 `-o "%(title)s.%(ext)s"` 指定了输出文件(带选项 -o),并指示它使用视频的标题和扩展名(本例为 mp3)来命名音频文件。 ![][6] -I hope you find this quick tip helpful. Enjoy the audio files :) +我希望你觉得这个技巧对你有帮助。享受音频文件吧 :) -------------------------------------------------------------------------------- @@ -99,7 +99,7 @@ via: https://itsfoss.com/youtube-dl-audio-only/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ac0b718005cb257acb1201ecaf4474145dbf185f Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 2 Sep 2021 08:44:57 +0800 Subject: [PATCH 085/138] translating --- sources/tech/20210831 What is a container image.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210831 What is a container image.md b/sources/tech/20210831 What is a container image.md index 3d96567fc8..deefbe18d6 100644 --- a/sources/tech/20210831 What is a container image.md +++ b/sources/tech/20210831 What is a container image.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/container-image" [#]: author: "Nived V https://opensource.com/users/nivedv" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From c1d5123b6b43321735768accb3b440798cb5ee68 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 2 Sep 2021 14:36:49 +0800 Subject: [PATCH 086/138] Delete 20210902 .md --- sources/tech/20210902 .md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 sources/tech/20210902 .md diff --git a/sources/tech/20210902 .md b/sources/tech/20210902 .md deleted file mode 100644 index 90bde3e2c1..0000000000 --- a/sources/tech/20210902 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.2daygeek.com/recover-root-password-rhel-8-centos-8/" -[#]: author: " " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/recover-root-password-rhel-8-centos-8/ - -作者:[][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: -[b]: https://github.com/lujun9972 From 9a664a2d60348bd5ee7e81286ea921a7e763b45b Mon Sep 17 00:00:00 2001 From: YungeGuo Date: Thu, 2 Sep 2021 16:43:04 +0800 Subject: [PATCH 087/138] translating --- .../tech/20201029 Managing resources with cgroups in systemd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20201029 Managing resources with cgroups in systemd.md b/sources/tech/20201029 Managing resources with cgroups in systemd.md index 5cb7f5c8c8..f9c03cd94c 100644 --- a/sources/tech/20201029 Managing resources with cgroups in systemd.md +++ b/sources/tech/20201029 Managing resources with cgroups in systemd.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (YungeG) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6db36780d99dd52691e3a64302758a002a2cf89c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Sep 2021 23:07:39 +0800 Subject: [PATCH 088/138] PRF @perfiffer --- ...he Difference- Which One Should You Use.md | 84 ++++++++++--------- 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md b/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md index af1de88002..950edcdf82 100644 --- a/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md +++ b/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md @@ -3,32 +3,34 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "perfiffer" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " Debian 和 Ubuntu:有什么不同?应该选择哪一个? ====== -在 Debian 和 Ubuntu 系统中,你都可以 [使用 apt-get 命令][1] 来管理应用。你也可以在这两个发型版中安装 DEB 安装包。很多时候,你会在这两个发行版中发现同样的包安装介绍。 +![](https://img.linux.net.cn/data/attachment/album/202109/02/230706mpahrwpwjjm2jkpu.jpg) + +在 Debian 和 Ubuntu 系统中,你都可以 [使用 apt-get 命令][1] 来管理应用。你也可以在这两个发行版中安装 DEB 安装包。很多时候,你会在这两个发行版中发现同样的包安装命令。 它们两者是如此的相似,那么,它们两者之间有什么区别呢? -Debian 和 Ubuntu 属于同一系列的发行版。Debain 是由Ian Murdock 在 1993 年创建的最初的发行版。Ubuntu 是 Mark Shuttleworth 在 2004 年基于 Debian 创建的发行版。 +Debian 和 Ubuntu 属于同一系列的发行版。Debian 是由 Ian Murdock 在 1993 年创建的最初的发行版。Ubuntu 是 Mark Shuttleworth 在 2004 年基于 Debian 创建的发行版。 ### Ubuntu 基于 Debian:这意味着什么? -Linux 发行版虽然有数百个,但其中只有少数是从零开始的独立发行版。 [Debian][2],Arch,Red Hat 是其中几个不派生于其它发行版的使用最广的发行版。 +Linux 发行版虽然有数百个,但其中只有少数是从零开始的独立发行版。 [Debian][2]、Arch、Red Hat 是其中几个不派生于其它发行版的使用最广的发行版。 -Ubuntu 源自 Debian。这意味着 Ubuntu 使用与 Debian 相同的 `APT` 包管理系统,并共享 Debian 库中的大量包和库。它建立在 Debian 基础架构上。 +Ubuntu 源自 Debian。这意味着 Ubuntu 使用与 Debian 相同的 APT 包管理系统,并共享来自 Debian 库中的大量包和库。它建立在 Debian 基础架构上。 ![Ubuntu uses Debian as base][3] -这就是大多数“衍生”发行版所做的。它们使用相同的包管理器,并将包共享为基本发行版。但他们也做了一些改变,添加了一些自己的包。这就是 Ubuntu 和 Debian 的不同之处,尽管它是从 Debian 衍生而来的。 +这就是大多数“衍生”发行版所做的。它们使用相同的包管理器,并与基础发行版共享包。但它们也做了一些改变,添加了一些自己的包。这就是 Ubuntu 和 Debian 的不同之处,尽管它是从 Debian 衍生而来的。 ### Ubuntu 和 Debian 的不同之处 -因此,Ubuntu 构建在 Debian 架构和基础设施上,也与 Debian 一样是用 `.DEB` 格式的软件包。 +因此,Ubuntu 构建在 Debian 架构和基础设施上,也与 Debian 一样是用 .DEB 格式的软件包。 这意味着使用 Ubuntu 和使用 Debian 是一样的吗?并不完全如此。有很多因素可以用来区分两个不同的发行版。 @@ -36,23 +38,23 @@ Ubuntu 源自 Debian。这意味着 Ubuntu 使用与 Debian 相同的 `APT` 包 ![][4] -#### 1\. 发布周期 +#### 1、发布周期 -Ubuntu 有两种发布版本:LTS 和 regular。[Ubuntu LTS (长期支持) 版本][5] 每两年发布一次,并且会提供五年的支持。你可以选择升级到下一个可用的 LTS 版本。LTS 版本更稳定。 +Ubuntu 有两种发布版本:LTS(长期支持)和常规版本。[Ubuntu LTS 版本][5] 每两年发布一次,并且会提供五年的支持。你可以选择升级到下一个可用的 LTS 版本。LTS 版本被认为更稳定。 -还有一个非 LTS 版本,每六个月发布一次。这些版本仅仅提供九个月的支持,但是它们会有一些新的软件版本和功能。当当前的版本已经不在维护了,你必须升级到下一个 Ubuntu 版本。 +还有一个非 LTS 版本,每六个月发布一次。这些版本仅仅提供九个月的支持,但是它们会有一些新的软件版本和功能。在当前的版本到达维护年限时,你应当升级到下一个 Ubuntu 版本。 所以基本上,你可以根据这些版本在稳定性和新特性之间进行选择。 -另一方面,Debian 有三个不同的版本:稳定版、测试版和非稳定版 。非稳定版是为了实际测试,应该避免使用。 +另一方面,Debian 有三个不同的版本:稳定版、测试版和非稳定版。非稳定版是为了实际测试,应该避免使用。 -测试版并不是非稳定版。它是用来为下一个稳定版做准备。有一些 Debian 用户更倾向于使用测试版来获取新的特性。 +测试版不是那么不稳定。它是用来为下一个稳定版做准备。有一些 Debian 用户更倾向于使用测试版来获取新的特性。 然后是稳定版。这是 Debian 的主要版本。Debian 稳定版可能没有最新的软件和功能,但在稳定性方面毋庸置疑。 -每两年 Debian 会发布一个稳定版,并且会提供三年的支持。此后,你必须升级到下一个可用的稳定版。 +每两年 Debian 会发布一个稳定版,并且会提供三年的支持。此后,你应当升级到下一个可用的稳定版。 -#### 2\. 软件更新 +#### 2、软件更新 ![][6] @@ -62,33 +64,33 @@ Debian 更关注稳定性,这意味着它并不总是使用最新版本的软 Ubuntu LTS 版本也关注稳定性。但是它们通常拥有较新版本的常见软件。 -你应该注意,对于某些软件,从开发人员仓库安装也是一种选择。例如,如果你想要安装最新版的 Docker,你可以在 Debian 和 Ubuntu 中添加 Docker 仓库。 +你应该注意,对于某些软件,从开发者的仓库安装也是一种选择。例如,如果你想要安装最新版的 Docker,你可以在 Debian 和 Ubuntu 中添加 Docker 仓库。 总体来说,相比较于 Ubuntu ,Debian 稳定版的软件版本会更旧。 -#### 3\. 软件可用性 +#### 3、软件可用性 -Debian 和 Ubuntu 都拥有一个巨大的软件仓库。然而,[Ubuntu 同时有PPA][7](Personal Package Archive)。通过 `PPA`,安装更新版本的软件或者获取最新版本的软件都将会变的更容易。 +Debian 和 Ubuntu 都拥有一个巨大的软件仓库。然而,[Ubuntu 还有 PPA][7](个人软件包存档Personal Package Archive)。通过 PPA,安装更新版本的软件或者获取最新版本的软件都将会变的更容易。 ![][8] 你可以在 Debian 中尝试使用 PPA,但是体验并不好。大多数时候你都会遇到问题。 -#### 4\. 支持的平台 +#### 4、支持的平台 Ubuntu 可以在 64 位的 x86 和 ARM 平台上使用。它不再提供 32 位的镜像。 -另一方面,Debian 支持 32 位和 64 位架构。除此之外,Debian 还支持 64 位 ARM(arm64)、ARM EABI(armel)、ARMv7(EABI hard-float ABI,armhf)、little-endian MIPS(mipsel)、64 位 little-endian MIPS(mips64el)、64 位 little-endian PowerPC(ppc64el) 和 IBM System z(s390x)。 +另一方面,Debian 支持 32 位和 64 位架构。除此之外,Debian 还支持 64 位 ARM(arm64)、ARM EABI(armel)、ARMv7(EABI hard-float ABI,armhf)、小端 MIPS(mipsel)、64 位小端 MIPS(mips64el)、64 位小端 PowerPC(ppc64el) 和 IBM System z(s390x)。 -所以它也被称为 “通用操作系统”。 +所以它也被称为 “通用操作系统universal operating system”。 -#### 5\. 安装 +#### 5、安装 -[安装 Ubuntu][9] 比安装 Debian 容易得多。我并不是在骗你。即使对于中级 Linux 用户,Debian 也可能令人困惑。 +[安装 Ubuntu][9] 比安装 Debian 容易得多。我并不是在开玩笑。即使对于有经验的 Linux 用户,Debian 也可能令人困惑。 -当你下载 Debian 的时候,它默认提供的是最小化镜像。 此镜像没有非免费(非开源)固件。如果你继续安装它,你就可能会发现你的网络适配器和其它硬件将无法识别。 +当你下载 Debian 的时候,它默认提供的是最小化镜像。此镜像没有非自由(非开源)的固件。如果你继续安装它,你就可能会发现你的网络适配器和其它硬件将无法识别。 -有一个单独的非免费镜像包含固件,但它是隐藏的,如果你不知道,你可能会大吃一惊。 +有一个单独的包含固件的非自由镜像,但它是隐藏的,如果你不知道,你可能会大吃一惊。 ![Getting non-free firmware is a pain in Debian][10] @@ -98,57 +100,57 @@ Ubuntu 在默认提供的镜像中包含专有驱动程序和固件时要宽容 ![Installing Ubuntu is smoother][11] -#### 6\. 开箱即用的硬件支持 +#### 6、开箱即用的硬件支持 就像之前提到的,Debian 主要关注 [FOSS][12](自由和开源软件)。这意味着 Debian 提供的内核不包括专有驱动程序和固件。 -这并不是说你无法使其工作,而是你必须添加/启动其它存储库并手动安装。这可能令人沮丧,特别是对于初学者来说。 +这并不是说你无法使其工作,而是你必须添加/启动额外的存储库并手动安装。这可能令人沮丧,特别是对于初学者来说。 Ubuntu 并不完美,但在提供开箱即用的驱动程序和固件方面,它比 Debian 好得多。这意味着更少的麻烦和更完整的开箱即用体验。 -#### 7\. 桌面环境选择 +#### 7、桌面环境选择 -Ubuntu 默认使用定制的 GNOME 桌面环境。你可以在其上安装其它桌面环境,或者选择各种基于桌面的 Ubuntu 风格,如 Kubuntu(使用 KDE 桌面),Xubuntu(使用 Xfce 桌面)等。 +Ubuntu 默认使用定制的 GNOME 桌面环境。你可以在其上安装 [其它桌面环境][13],或者选择 [各种不同桌面风格的 Ubuntu][14],如 Kubuntu(使用 KDE 桌面)、Xubuntu(使用 Xfce 桌面)等。 -Debian 也默认使用的 GNOME 桌面。但是它会让你在安装的过程中选择你要安装的桌面环境。 +Debian 也默认安装了 GNOME 桌面。但是它会让你在安装的过程中选择你要安装的桌面环境。 ![][15] -你还可以从其网站获取[DE 特定的 ISO 镜像][16]。 +你还可以从其网站获取 [特定桌面环境的 ISO 镜像][16]。 -#### 8\. 游戏性 +#### 8、游戏性 由于 Stream 及其 Proton 项目,Linux 上的游戏总体上有所改善。尽管如此,游戏在很大程度上取决于硬件。 -在硬件兼容性上,Ubuntu 比 Debian 更好的支持专有驱动程序。 +在硬件兼容性上,Ubuntu 比 Debian 在支持专有驱动程序方面要好。 -并不是说它在 Debian 中不能完成,而是需要一些时间和精力来实现。 +并不是说在 Debian 中不能做到这一点,而是需要一些时间和精力来实现。 -#### 9\. 性能 +#### 9、性能 性能部分没有明显的“赢家”,无论是在服务器版本还是在桌面版本。 Debian 和 Ubuntu 作为桌面和服务器操作系统都很受欢迎。 性能取决于你系统的硬件和你所使用的软件组件。你可以在你的操作系统中调整和控制你的系统。 -#### 10\. 社区和支持 +#### 10、社区和支持 -Debian 是社区项目。此项目的一切都由其社区成员管理。 +Debian 是一个真正的社区项目。此项目的一切都由其社区成员管理。 Ubuntu 由 [Canonical][17] 提供支持。然而,它并不是一个真正意义上的企业项目。它确实有一个社区,但任何事情的最终决定权都掌握在 Canonical 手中。 就支持而言,Ubuntu 和 Debian 都有专门的论坛,用户可以在其中寻求帮助和提出建议。 -Canonical 还为其企业客户提供收费的专业支持。 Debian 没有这样的功能。 +Canonical 还为其企业客户提供收费的专业支持。Debian 则没有这样的功能。 ### 结论 -Debian 和 Ubuntu 都是桌面或服务器操作系统的可靠选择。 apt 包管理器和 DEB 包对两者都是通用的,因此提供了一些相似的体验。 +Debian 和 Ubuntu 都是桌面或服务器操作系统的可靠选择。 APT 包管理器和 DEB 包对两者都是通用的,因此提供了一些相似的体验。 -然而,Debian 仍然需要一定程度的专业知识,特别是在桌面方面。如果你是 Linux 新手,坚持使用 Ubuntu 将是你更好的选择。在我看来,你应该获得一些经验,熟悉 Linux,然后尝试使用 Debian。 +然而,Debian 仍然需要一定程度的专业知识,特别是在桌面方面。如果你是 Linux 新手,坚持使用 Ubuntu 将是你更好的选择。在我看来,你应该积累一些经验,熟悉了一般的 Linux,然后再尝试使用 Debian。 并不是说你不能从一开始就使用 Debian,但对于 Linux 初学者来说,这并不是一种很好的体验。 -**欢迎你对这场 Debian 与 Ubuntu 辩论发表意见。** +欢迎你对这场 Debian 与 Ubuntu 辩论发表意见。 -------------------------------------------------------------------------------- @@ -157,7 +159,7 @@ via: https://itsfoss.com/debian-vs-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[perfiffer](https://github.com/perfiffer) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a53e9089a85b677c3b3add760863de43a213cd75 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Sep 2021 23:11:42 +0800 Subject: [PATCH 089/138] PRF&PUB @perfiffer https://linux.cn/article-13746-1.html --- ...Ubuntu- What-s the Difference- Which One Should You Use.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md (99%) diff --git a/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md b/published/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md similarity index 99% rename from translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md rename to published/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md index 950edcdf82..3468fcc4c2 100644 --- a/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md +++ b/published/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "perfiffer" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13746-1.html" Debian 和 Ubuntu:有什么不同?应该选择哪一个? ====== From f4db49de04f1d1bd9a0167066e7616dd46f0fe5f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Sep 2021 23:19:23 +0800 Subject: [PATCH 090/138] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202108?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => 202108}/20200107 5 ways to improve your Bash scripts.md | 0 ...Managing your attached hardware on Linux with systemd-udevd.md | 0 .../20200504 Understanding systemd at startup on Linux.md | 0 ...07 A beginner-s guide to SSH for remote connection on Linux.md | 0 .../{ => 202108}/20210308 How the ARPANET Protocols Worked.md | 0 .../20210414 3 essential Linux cheat sheets for productivity.md | 0 .../20210525 Pen testing with Linux security tools.md | 0 .../{ => 202108}/20210608 Tune your MySQL queries like a pro.md | 0 ... Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md | 0 .../20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md | 0 ...r System Uses MBR or GPT Partitioning -on Windows and Linux.md | 0 .../20210712 Reading and writing files with Python.md | 0 .../{ => 202108}/20210713 Use VS Code to develop in containers.md | 0 .../20210720 How to Upgrade to Debian 11 from Debian 10.md | 0 .../20210720 Install Shutter in Fedora 34 and Above.md | 0 .../20210723 5 useful ways to manage Kubernetes with kubectl.md | 0 .../20210725 Top 7 Linux Laptops You Can Buy in 2021.md | 0 .../20210726 Command line quick tips- wc, sort, sed and tr.md | 0 .../20210726 How to Install elementary Tweaks Tool.md | 0 published/{ => 202108}/20210726 How to use cron on Linux.md | 0 .../20210727 Check used disk space on Linux with du.md | 0 ... to Change Lock and Login Screen Wallpaper in elementary OS.md | 0 .../20210729 Use df to check free disk space on Linux.md | 0 .../20210730 4 cool new projects to try in Copr from July 2021.md | 0 ...ox- Your Ultimate Browser Choice for Private Web Experience.md | 0 ...e the Linux terminal to see what files are on your computer.md | 0 .../{ => 202108}/20210802 Use OpenCV on Fedora Linux - part 1.md | 0 ... Web Canary is Now Available to Test Bleeding Edge Features.md | 0 ...3 How to Install Google Chrome on Linux Mint -Beginners Tip.md | 0 ...3 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md | 0 .../{ => 202108}/20210803 Set up a VPN server on your Linux PC.md | 0 ...Use the Linux terminal to navigate throughout your computer.md | 0 ...x Lost Almost 50 million Users- Here-s Why It is Concerning.md | 0 .../20210804 How to Find and Remove Duplicate Photos in Linux.md | 0 .../{ => 202108}/20210804 Install OpenVPN on your Linux PC.md | 0 .../{ => 202108}/20210804 Move files in the Linux terminal.md | 0 .../20210805 Configure your OpenVPN server on Linux.md | 0 .../20210806 Access OpenVPN from a client computer.md | 0 ... Change your Linux Desktop Wallpaper Every Hour -Here-s How.md | 0 .../{ => 202108}/20210807 How to Install Java on Fedora Linux.md | 0 ...s Time for Ubuntu to Opt for a Hybrid Rolling Release Model.md | 0 .../20210807 Remove files and folders in the Linux terminal.md | 0 ...1 Monitor your Linux system in your terminal with procps-ng.md | 0 ...lementary OS 6 ‘Odin- is Finally Here With Exciting Changes.md | 0 ...210811 Top 11 New Features in elementary OS 6 Linux Release.md | 0 .../{ => 202108}/20210812 A Java developer-s guide to Quarkus.md | 0 published/{ => 202108}/20210813 Install Linux with LVM.md | 0 .../20210813 Parse command options in Java with commons-cli.md | 0 ... Important You Need to Know About This -Gaming Distribution.md | 0 ...res in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md | 0 .../20210815 Schedule a task with the Linux at command.md | 0 .../{ => 202108}/20210817 4 alternatives to cron in Linux.md | 0 ...Automatically Synchronize Subtitle With Video Using SubSync.md | 0 .../20210818 Build a JAR file with fastjar and gjar.md | 0 .../20210819 Check free disk space in Linux with ncdu.md | 0 ... OS 16 Released with Stunning New Look and Array of Updates.md | 0 ...Monitor Log Files in Real Time in Linux -Desktop and Server.md | 0 .../{ => 202108}/20210822 Linux Phones- Here are Your Options.md | 0 ...0823 Access your iPhone on Linux with this open source tool.md | 0 .../20210823 KDE Plasma 5.23 - New Features and Release Dates.md | 0 .../20210824 How to include options in your Bash shell scripts.md | 0 .../20210826 30 things you didn-t know about the Linux kernel.md | 0 62 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 202108}/20200107 5 ways to improve your Bash scripts.md (100%) rename published/{ => 202108}/20200204 Managing your attached hardware on Linux with systemd-udevd.md (100%) rename published/{ => 202108}/20200504 Understanding systemd at startup on Linux.md (100%) rename published/{ => 202108}/20200907 A beginner-s guide to SSH for remote connection on Linux.md (100%) rename published/{ => 202108}/20210308 How the ARPANET Protocols Worked.md (100%) rename published/{ => 202108}/20210414 3 essential Linux cheat sheets for productivity.md (100%) rename published/{ => 202108}/20210525 Pen testing with Linux security tools.md (100%) rename published/{ => 202108}/20210608 Tune your MySQL queries like a pro.md (100%) rename published/{ => 202108}/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md (100%) rename published/{ => 202108}/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md (100%) rename published/{ => 202108}/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md (100%) rename published/{ => 202108}/20210712 Reading and writing files with Python.md (100%) rename published/{ => 202108}/20210713 Use VS Code to develop in containers.md (100%) rename published/{ => 202108}/20210720 How to Upgrade to Debian 11 from Debian 10.md (100%) rename published/{ => 202108}/20210720 Install Shutter in Fedora 34 and Above.md (100%) rename published/{ => 202108}/20210723 5 useful ways to manage Kubernetes with kubectl.md (100%) rename published/{ => 202108}/20210725 Top 7 Linux Laptops You Can Buy in 2021.md (100%) rename published/{ => 202108}/20210726 Command line quick tips- wc, sort, sed and tr.md (100%) rename published/{ => 202108}/20210726 How to Install elementary Tweaks Tool.md (100%) rename published/{ => 202108}/20210726 How to use cron on Linux.md (100%) rename published/{ => 202108}/20210727 Check used disk space on Linux with du.md (100%) rename published/{ => 202108}/20210727 How to Change Lock and Login Screen Wallpaper in elementary OS.md (100%) rename published/{ => 202108}/20210729 Use df to check free disk space on Linux.md (100%) rename published/{ => 202108}/20210730 4 cool new projects to try in Copr from July 2021.md (100%) rename published/{ => 202108}/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md (100%) rename published/{ => 202108}/20210801 Use the Linux terminal to see what files are on your computer.md (100%) rename published/{ => 202108}/20210802 Use OpenCV on Fedora Linux - part 1.md (100%) rename published/{ => 202108}/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md (100%) rename published/{ => 202108}/20210803 How to Install Google Chrome on Linux Mint -Beginners Tip.md (100%) rename published/{ => 202108}/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md (100%) rename published/{ => 202108}/20210803 Set up a VPN server on your Linux PC.md (100%) rename published/{ => 202108}/20210803 Use the Linux terminal to navigate throughout your computer.md (100%) rename published/{ => 202108}/20210804 Firefox Lost Almost 50 million Users- Here-s Why It is Concerning.md (100%) rename published/{ => 202108}/20210804 How to Find and Remove Duplicate Photos in Linux.md (100%) rename published/{ => 202108}/20210804 Install OpenVPN on your Linux PC.md (100%) rename published/{ => 202108}/20210804 Move files in the Linux terminal.md (100%) rename published/{ => 202108}/20210805 Configure your OpenVPN server on Linux.md (100%) rename published/{ => 202108}/20210806 Access OpenVPN from a client computer.md (100%) rename published/{ => 202108}/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md (100%) rename published/{ => 202108}/20210807 How to Install Java on Fedora Linux.md (100%) rename published/{ => 202108}/20210807 It-s Time for Ubuntu to Opt for a Hybrid Rolling Release Model.md (100%) rename published/{ => 202108}/20210807 Remove files and folders in the Linux terminal.md (100%) rename published/{ => 202108}/20210811 Monitor your Linux system in your terminal with procps-ng.md (100%) rename published/{ => 202108}/20210811 The Wait is Over- elementary OS 6 ‘Odin- is Finally Here With Exciting Changes.md (100%) rename published/{ => 202108}/20210811 Top 11 New Features in elementary OS 6 Linux Release.md (100%) rename published/{ => 202108}/20210812 A Java developer-s guide to Quarkus.md (100%) rename published/{ => 202108}/20210813 Install Linux with LVM.md (100%) rename published/{ => 202108}/20210813 Parse command options in Java with commons-cli.md (100%) rename published/{ => 202108}/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md (100%) rename published/{ => 202108}/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md (100%) rename published/{ => 202108}/20210815 Schedule a task with the Linux at command.md (100%) rename published/{ => 202108}/20210817 4 alternatives to cron in Linux.md (100%) rename published/{ => 202108}/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md (100%) rename published/{ => 202108}/20210818 Build a JAR file with fastjar and gjar.md (100%) rename published/{ => 202108}/20210819 Check free disk space in Linux with ncdu.md (100%) rename published/{ => 202108}/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md (100%) rename published/{ => 202108}/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md (100%) rename published/{ => 202108}/20210822 Linux Phones- Here are Your Options.md (100%) rename published/{ => 202108}/20210823 Access your iPhone on Linux with this open source tool.md (100%) rename published/{ => 202108}/20210823 KDE Plasma 5.23 - New Features and Release Dates.md (100%) rename published/{ => 202108}/20210824 How to include options in your Bash shell scripts.md (100%) rename published/{ => 202108}/20210826 30 things you didn-t know about the Linux kernel.md (100%) diff --git a/published/20200107 5 ways to improve your Bash scripts.md b/published/202108/20200107 5 ways to improve your Bash scripts.md similarity index 100% rename from published/20200107 5 ways to improve your Bash scripts.md rename to published/202108/20200107 5 ways to improve your Bash scripts.md diff --git a/published/20200204 Managing your attached hardware on Linux with systemd-udevd.md b/published/202108/20200204 Managing your attached hardware on Linux with systemd-udevd.md similarity index 100% rename from published/20200204 Managing your attached hardware on Linux with systemd-udevd.md rename to published/202108/20200204 Managing your attached hardware on Linux with systemd-udevd.md diff --git a/published/20200504 Understanding systemd at startup on Linux.md b/published/202108/20200504 Understanding systemd at startup on Linux.md similarity index 100% rename from published/20200504 Understanding systemd at startup on Linux.md rename to published/202108/20200504 Understanding systemd at startup on Linux.md diff --git a/published/20200907 A beginner-s guide to SSH for remote connection on Linux.md b/published/202108/20200907 A beginner-s guide to SSH for remote connection on Linux.md similarity index 100% rename from published/20200907 A beginner-s guide to SSH for remote connection on Linux.md rename to published/202108/20200907 A beginner-s guide to SSH for remote connection on Linux.md diff --git a/published/20210308 How the ARPANET Protocols Worked.md b/published/202108/20210308 How the ARPANET Protocols Worked.md similarity index 100% rename from published/20210308 How the ARPANET Protocols Worked.md rename to published/202108/20210308 How the ARPANET Protocols Worked.md diff --git a/published/20210414 3 essential Linux cheat sheets for productivity.md b/published/202108/20210414 3 essential Linux cheat sheets for productivity.md similarity index 100% rename from published/20210414 3 essential Linux cheat sheets for productivity.md rename to published/202108/20210414 3 essential Linux cheat sheets for productivity.md diff --git a/published/20210525 Pen testing with Linux security tools.md b/published/202108/20210525 Pen testing with Linux security tools.md similarity index 100% rename from published/20210525 Pen testing with Linux security tools.md rename to published/202108/20210525 Pen testing with Linux security tools.md diff --git a/published/20210608 Tune your MySQL queries like a pro.md b/published/202108/20210608 Tune your MySQL queries like a pro.md similarity index 100% rename from published/20210608 Tune your MySQL queries like a pro.md rename to published/202108/20210608 Tune your MySQL queries like a pro.md diff --git a/published/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md b/published/202108/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md similarity index 100% rename from published/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md rename to published/202108/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md diff --git a/published/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md b/published/202108/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md similarity index 100% rename from published/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md rename to published/202108/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md diff --git a/published/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md b/published/202108/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md similarity index 100% rename from published/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md rename to published/202108/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md diff --git a/published/20210712 Reading and writing files with Python.md b/published/202108/20210712 Reading and writing files with Python.md similarity index 100% rename from published/20210712 Reading and writing files with Python.md rename to published/202108/20210712 Reading and writing files with Python.md diff --git a/published/20210713 Use VS Code to develop in containers.md b/published/202108/20210713 Use VS Code to develop in containers.md similarity index 100% rename from published/20210713 Use VS Code to develop in containers.md rename to published/202108/20210713 Use VS Code to develop in containers.md diff --git a/published/20210720 How to Upgrade to Debian 11 from Debian 10.md b/published/202108/20210720 How to Upgrade to Debian 11 from Debian 10.md similarity index 100% rename from published/20210720 How to Upgrade to Debian 11 from Debian 10.md rename to published/202108/20210720 How to Upgrade to Debian 11 from Debian 10.md diff --git a/published/20210720 Install Shutter in Fedora 34 and Above.md b/published/202108/20210720 Install Shutter in Fedora 34 and Above.md similarity index 100% rename from published/20210720 Install Shutter in Fedora 34 and Above.md rename to published/202108/20210720 Install Shutter in Fedora 34 and Above.md diff --git a/published/20210723 5 useful ways to manage Kubernetes with kubectl.md b/published/202108/20210723 5 useful ways to manage Kubernetes with kubectl.md similarity index 100% rename from published/20210723 5 useful ways to manage Kubernetes with kubectl.md rename to published/202108/20210723 5 useful ways to manage Kubernetes with kubectl.md diff --git a/published/20210725 Top 7 Linux Laptops You Can Buy in 2021.md b/published/202108/20210725 Top 7 Linux Laptops You Can Buy in 2021.md similarity index 100% rename from published/20210725 Top 7 Linux Laptops You Can Buy in 2021.md rename to published/202108/20210725 Top 7 Linux Laptops You Can Buy in 2021.md diff --git a/published/20210726 Command line quick tips- wc, sort, sed and tr.md b/published/202108/20210726 Command line quick tips- wc, sort, sed and tr.md similarity index 100% rename from published/20210726 Command line quick tips- wc, sort, sed and tr.md rename to published/202108/20210726 Command line quick tips- wc, sort, sed and tr.md diff --git a/published/20210726 How to Install elementary Tweaks Tool.md b/published/202108/20210726 How to Install elementary Tweaks Tool.md similarity index 100% rename from published/20210726 How to Install elementary Tweaks Tool.md rename to published/202108/20210726 How to Install elementary Tweaks Tool.md diff --git a/published/20210726 How to use cron on Linux.md b/published/202108/20210726 How to use cron on Linux.md similarity index 100% rename from published/20210726 How to use cron on Linux.md rename to published/202108/20210726 How to use cron on Linux.md diff --git a/published/20210727 Check used disk space on Linux with du.md b/published/202108/20210727 Check used disk space on Linux with du.md similarity index 100% rename from published/20210727 Check used disk space on Linux with du.md rename to published/202108/20210727 Check used disk space on Linux with du.md diff --git a/published/20210727 How to Change Lock and Login Screen Wallpaper in elementary OS.md b/published/202108/20210727 How to Change Lock and Login Screen Wallpaper in elementary OS.md similarity index 100% rename from published/20210727 How to Change Lock and Login Screen Wallpaper in elementary OS.md rename to published/202108/20210727 How to Change Lock and Login Screen Wallpaper in elementary OS.md diff --git a/published/20210729 Use df to check free disk space on Linux.md b/published/202108/20210729 Use df to check free disk space on Linux.md similarity index 100% rename from published/20210729 Use df to check free disk space on Linux.md rename to published/202108/20210729 Use df to check free disk space on Linux.md diff --git a/published/20210730 4 cool new projects to try in Copr from July 2021.md b/published/202108/20210730 4 cool new projects to try in Copr from July 2021.md similarity index 100% rename from published/20210730 4 cool new projects to try in Copr from July 2021.md rename to published/202108/20210730 4 cool new projects to try in Copr from July 2021.md diff --git a/published/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md b/published/202108/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md similarity index 100% rename from published/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md rename to published/202108/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md diff --git a/published/20210801 Use the Linux terminal to see what files are on your computer.md b/published/202108/20210801 Use the Linux terminal to see what files are on your computer.md similarity index 100% rename from published/20210801 Use the Linux terminal to see what files are on your computer.md rename to published/202108/20210801 Use the Linux terminal to see what files are on your computer.md diff --git a/published/20210802 Use OpenCV on Fedora Linux - part 1.md b/published/202108/20210802 Use OpenCV on Fedora Linux - part 1.md similarity index 100% rename from published/20210802 Use OpenCV on Fedora Linux - part 1.md rename to published/202108/20210802 Use OpenCV on Fedora Linux - part 1.md diff --git a/published/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md b/published/202108/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md similarity index 100% rename from published/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md rename to published/202108/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md diff --git a/published/20210803 How to Install Google Chrome on Linux Mint -Beginners Tip.md b/published/202108/20210803 How to Install Google Chrome on Linux Mint -Beginners Tip.md similarity index 100% rename from published/20210803 How to Install Google Chrome on Linux Mint -Beginners Tip.md rename to published/202108/20210803 How to Install Google Chrome on Linux Mint -Beginners Tip.md diff --git a/published/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md b/published/202108/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md similarity index 100% rename from published/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md rename to published/202108/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md diff --git a/published/20210803 Set up a VPN server on your Linux PC.md b/published/202108/20210803 Set up a VPN server on your Linux PC.md similarity index 100% rename from published/20210803 Set up a VPN server on your Linux PC.md rename to published/202108/20210803 Set up a VPN server on your Linux PC.md diff --git a/published/20210803 Use the Linux terminal to navigate throughout your computer.md b/published/202108/20210803 Use the Linux terminal to navigate throughout your computer.md similarity index 100% rename from published/20210803 Use the Linux terminal to navigate throughout your computer.md rename to published/202108/20210803 Use the Linux terminal to navigate throughout your computer.md diff --git a/published/20210804 Firefox Lost Almost 50 million Users- Here-s Why It is Concerning.md b/published/202108/20210804 Firefox Lost Almost 50 million Users- Here-s Why It is Concerning.md similarity index 100% rename from published/20210804 Firefox Lost Almost 50 million Users- Here-s Why It is Concerning.md rename to published/202108/20210804 Firefox Lost Almost 50 million Users- Here-s Why It is Concerning.md diff --git a/published/20210804 How to Find and Remove Duplicate Photos in Linux.md b/published/202108/20210804 How to Find and Remove Duplicate Photos in Linux.md similarity index 100% rename from published/20210804 How to Find and Remove Duplicate Photos in Linux.md rename to published/202108/20210804 How to Find and Remove Duplicate Photos in Linux.md diff --git a/published/20210804 Install OpenVPN on your Linux PC.md b/published/202108/20210804 Install OpenVPN on your Linux PC.md similarity index 100% rename from published/20210804 Install OpenVPN on your Linux PC.md rename to published/202108/20210804 Install OpenVPN on your Linux PC.md diff --git a/published/20210804 Move files in the Linux terminal.md b/published/202108/20210804 Move files in the Linux terminal.md similarity index 100% rename from published/20210804 Move files in the Linux terminal.md rename to published/202108/20210804 Move files in the Linux terminal.md diff --git a/published/20210805 Configure your OpenVPN server on Linux.md b/published/202108/20210805 Configure your OpenVPN server on Linux.md similarity index 100% rename from published/20210805 Configure your OpenVPN server on Linux.md rename to published/202108/20210805 Configure your OpenVPN server on Linux.md diff --git a/published/20210806 Access OpenVPN from a client computer.md b/published/202108/20210806 Access OpenVPN from a client computer.md similarity index 100% rename from published/20210806 Access OpenVPN from a client computer.md rename to published/202108/20210806 Access OpenVPN from a client computer.md diff --git a/published/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md b/published/202108/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md similarity index 100% rename from published/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md rename to published/202108/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md diff --git a/published/20210807 How to Install Java on Fedora Linux.md b/published/202108/20210807 How to Install Java on Fedora Linux.md similarity index 100% rename from published/20210807 How to Install Java on Fedora Linux.md rename to published/202108/20210807 How to Install Java on Fedora Linux.md diff --git a/published/20210807 It-s Time for Ubuntu to Opt for a Hybrid Rolling Release Model.md b/published/202108/20210807 It-s Time for Ubuntu to Opt for a Hybrid Rolling Release Model.md similarity index 100% rename from published/20210807 It-s Time for Ubuntu to Opt for a Hybrid Rolling Release Model.md rename to published/202108/20210807 It-s Time for Ubuntu to Opt for a Hybrid Rolling Release Model.md diff --git a/published/20210807 Remove files and folders in the Linux terminal.md b/published/202108/20210807 Remove files and folders in the Linux terminal.md similarity index 100% rename from published/20210807 Remove files and folders in the Linux terminal.md rename to published/202108/20210807 Remove files and folders in the Linux terminal.md diff --git a/published/20210811 Monitor your Linux system in your terminal with procps-ng.md b/published/202108/20210811 Monitor your Linux system in your terminal with procps-ng.md similarity index 100% rename from published/20210811 Monitor your Linux system in your terminal with procps-ng.md rename to published/202108/20210811 Monitor your Linux system in your terminal with procps-ng.md diff --git a/published/20210811 The Wait is Over- elementary OS 6 ‘Odin- is Finally Here With Exciting Changes.md b/published/202108/20210811 The Wait is Over- elementary OS 6 ‘Odin- is Finally Here With Exciting Changes.md similarity index 100% rename from published/20210811 The Wait is Over- elementary OS 6 ‘Odin- is Finally Here With Exciting Changes.md rename to published/202108/20210811 The Wait is Over- elementary OS 6 ‘Odin- is Finally Here With Exciting Changes.md diff --git a/published/20210811 Top 11 New Features in elementary OS 6 Linux Release.md b/published/202108/20210811 Top 11 New Features in elementary OS 6 Linux Release.md similarity index 100% rename from published/20210811 Top 11 New Features in elementary OS 6 Linux Release.md rename to published/202108/20210811 Top 11 New Features in elementary OS 6 Linux Release.md diff --git a/published/20210812 A Java developer-s guide to Quarkus.md b/published/202108/20210812 A Java developer-s guide to Quarkus.md similarity index 100% rename from published/20210812 A Java developer-s guide to Quarkus.md rename to published/202108/20210812 A Java developer-s guide to Quarkus.md diff --git a/published/20210813 Install Linux with LVM.md b/published/202108/20210813 Install Linux with LVM.md similarity index 100% rename from published/20210813 Install Linux with LVM.md rename to published/202108/20210813 Install Linux with LVM.md diff --git a/published/20210813 Parse command options in Java with commons-cli.md b/published/202108/20210813 Parse command options in Java with commons-cli.md similarity index 100% rename from published/20210813 Parse command options in Java with commons-cli.md rename to published/202108/20210813 Parse command options in Java with commons-cli.md diff --git a/published/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md b/published/202108/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md similarity index 100% rename from published/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md rename to published/202108/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md diff --git a/published/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md b/published/202108/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md similarity index 100% rename from published/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md rename to published/202108/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md diff --git a/published/20210815 Schedule a task with the Linux at command.md b/published/202108/20210815 Schedule a task with the Linux at command.md similarity index 100% rename from published/20210815 Schedule a task with the Linux at command.md rename to published/202108/20210815 Schedule a task with the Linux at command.md diff --git a/published/20210817 4 alternatives to cron in Linux.md b/published/202108/20210817 4 alternatives to cron in Linux.md similarity index 100% rename from published/20210817 4 alternatives to cron in Linux.md rename to published/202108/20210817 4 alternatives to cron in Linux.md diff --git a/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md b/published/202108/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md similarity index 100% rename from published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md rename to published/202108/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md diff --git a/published/20210818 Build a JAR file with fastjar and gjar.md b/published/202108/20210818 Build a JAR file with fastjar and gjar.md similarity index 100% rename from published/20210818 Build a JAR file with fastjar and gjar.md rename to published/202108/20210818 Build a JAR file with fastjar and gjar.md diff --git a/published/20210819 Check free disk space in Linux with ncdu.md b/published/202108/20210819 Check free disk space in Linux with ncdu.md similarity index 100% rename from published/20210819 Check free disk space in Linux with ncdu.md rename to published/202108/20210819 Check free disk space in Linux with ncdu.md diff --git a/published/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/published/202108/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md similarity index 100% rename from published/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md rename to published/202108/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md diff --git a/published/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md b/published/202108/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md similarity index 100% rename from published/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md rename to published/202108/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md diff --git a/published/20210822 Linux Phones- Here are Your Options.md b/published/202108/20210822 Linux Phones- Here are Your Options.md similarity index 100% rename from published/20210822 Linux Phones- Here are Your Options.md rename to published/202108/20210822 Linux Phones- Here are Your Options.md diff --git a/published/20210823 Access your iPhone on Linux with this open source tool.md b/published/202108/20210823 Access your iPhone on Linux with this open source tool.md similarity index 100% rename from published/20210823 Access your iPhone on Linux with this open source tool.md rename to published/202108/20210823 Access your iPhone on Linux with this open source tool.md diff --git a/published/20210823 KDE Plasma 5.23 - New Features and Release Dates.md b/published/202108/20210823 KDE Plasma 5.23 - New Features and Release Dates.md similarity index 100% rename from published/20210823 KDE Plasma 5.23 - New Features and Release Dates.md rename to published/202108/20210823 KDE Plasma 5.23 - New Features and Release Dates.md diff --git a/published/20210824 How to include options in your Bash shell scripts.md b/published/202108/20210824 How to include options in your Bash shell scripts.md similarity index 100% rename from published/20210824 How to include options in your Bash shell scripts.md rename to published/202108/20210824 How to include options in your Bash shell scripts.md diff --git a/published/20210826 30 things you didn-t know about the Linux kernel.md b/published/202108/20210826 30 things you didn-t know about the Linux kernel.md similarity index 100% rename from published/20210826 30 things you didn-t know about the Linux kernel.md rename to published/202108/20210826 30 things you didn-t know about the Linux kernel.md From 4ffb9640aef0ef963f31283402b3d81d9405b009 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 3 Sep 2021 05:03:44 +0800 Subject: [PATCH 091/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210903=20?= =?UTF-8?q?How=20to=20Completely=20Uninstall=20Google=20Chrome=20From=20Ub?= =?UTF-8?q?untu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md --- ...ely Uninstall Google Chrome From Ubuntu.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md diff --git a/sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md b/sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md new file mode 100644 index 0000000000..0abd1eea46 --- /dev/null +++ b/sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md @@ -0,0 +1,97 @@ +[#]: subject: "How to Completely Uninstall Google Chrome From Ubuntu" +[#]: via: "https://itsfoss.com/uninstall-chrome-from-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Completely Uninstall Google Chrome From Ubuntu +====== + +So, you managed to [install Google Chrome on Ubuntu][1]. It is the most popular web browser in the world, after all. + +But perhaps you dislike Google products for the heavy tracking and data mining they employ on its users. You decided to opt for [other web browsers on Ubuntu][2], perhaps a [non-Chromium browser][3]. + +Now that you are no longer using it, it would be wise to remove [Google Chrome][4] from Ubuntu. + +How to do that? Let me show you the steps. + +### Remove Google Chrome completely from Ubuntu + +![Illustration for removing Google Chrome from Ubuntu][5] + +You probably installed Google Chrome graphically. Unfortunately, you’ll have to resort to command line for removing it, unless you opt to [use Synaptic Package Manager][6]. + +It is not too difficult. Press the [Ctrl+Alt+T keyboard shortcut in Ubuntu to open a terminal][7]. + +Type the following command in the terminal: + +``` +sudo apt purge google-chrome-stable +``` + +It asks for a password. It is your user account’s password, the one which you use to log in to your Ubuntu system. + +When you type the password, nothing is displayed on the screen. This is normal behavior in Linux. Just type the password blindly and press enter. + +It will ask you to confirm the removal of Google Chrome by entering Y or simply pressing the enter key. + +![Removing Google Chrome for Ubuntu][8] + +This will remove Google Chrome from your Ubuntu Linux system along with most of the system files. + +However, the personal setting files remain in your home directory. This includes things like cookie sessions, bookmarks and other Chrome related settings for your user account. If you install Google Chrome again, the same files could be used by Chrome again. + +![Google Chrome leftover settings in Ubuntu][9] + +If you want to completely uninstall Google Chrome, you may want to remove these files as well. Here’s what you should do. + +Change to the .config directory. _**Mind the dot before config**_. That’s the [way to hide files and folders in Linux][10]. + +``` +cd ~/.config +``` + +And now remove the google-chrome directory: + +``` +rm -rf google-chrome +``` + +![Removing the leftover Google Chrome settings from Ubuntu][11] + +You could have also used rm -rf ~/.config/google-chrome to delete it in one single command. Since this tutorial is focused on absolute beginners, I made it in two steps to reduce the error margin because of a typo. + +Tip + +Want to make your terminal look beautiful like the ones in the screenshot? Use these [terminal customization tips][12]. + +I hope this quick beginner tip helped you to get rid of Google Chrome from Ubuntu Linux. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/uninstall-chrome-from-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-chrome-ubuntu/ +[2]: https://itsfoss.com/best-browsers-ubuntu-linux/ +[3]: https://itsfoss.com/open-source-browsers-linux/ +[4]: https://www.google.com/chrome/index.html +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/removing-google-chrome-ubuntu.png?resize=800%2C450&ssl=1 +[6]: https://itsfoss.com/synaptic-package-manager/ +[7]: https://itsfoss.com/open-terminal-ubuntu/ +[8]: https://itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-ubuntu.webp +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/google-chrome-ubuntu-leftover-settings.png?resize=800%2C518&ssl=1 +[10]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-leftover-settings-from-Ubuntu.png?resize=800%2C277&ssl=1 +[12]: https://itsfoss.com/customize-linux-terminal/ From d8b0d87738fb6e278fd87d34cea73e2e11ae0045 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 3 Sep 2021 05:04:07 +0800 Subject: [PATCH 092/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210902=20?= =?UTF-8?q?4=20Linux=20technologies=20fundamental=20to=20containers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210902 4 Linux technologies fundamental to containers.md --- ... technologies fundamental to containers.md | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 sources/tech/20210902 4 Linux technologies fundamental to containers.md diff --git a/sources/tech/20210902 4 Linux technologies fundamental to containers.md b/sources/tech/20210902 4 Linux technologies fundamental to containers.md new file mode 100644 index 0000000000..8875b5bf95 --- /dev/null +++ b/sources/tech/20210902 4 Linux technologies fundamental to containers.md @@ -0,0 +1,152 @@ +[#]: subject: "4 Linux technologies fundamental to containers" +[#]: via: "https://opensource.com/article/21/8/container-linux-technology" +[#]: author: "Nived V https://opensource.com/users/nivedv" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +4 Linux technologies fundamental to containers +====== +Namespaces, cgroups, seccomp, and SELinux are the Linux technologies +that make up the foundations of building and running a container process +on your system. +![Penguin driving a car with a yellow background][1] + +In previous articles, I have written about [container images][2] and [runtimes][3]. In this article, I look at how containers are made possible by a foundation of some special Linux technologies, including namespaces and control groups. + +![layers of linux technologies][4] + +Figure 1: Linux technologies that contribute to containers +(Nived Velayudhan, [CC BY-SA 4.0][5]) + +Linux technologies make up the foundations of building and running a container process on your system. Technologies include: + + 1. Namespaces + 2. Control groups (cgroups) + 3. Seccomp + 4. SELinux + + + +### Namespaces + +_Namespaces_ provide a layer of isolation for the containers by giving the container a view of what appears to be its own Linux filesystem. This limits what a process can see and therefore restricts the resources available to it. + +There are several namespaces in the Linux kernel that are used by Docker or Podman and others while creating a container: +  + + +``` +$ docker container run alpine ping 8.8.8.8 +$ sudo lsns -p 29413 +        NS TYPE   NPROCS PID USER COMMAND +4026531835 cgroup   299   1  root /usr/lib/systemd/systemd -- +switched... +4026533105 mnt 1 29413 root ping 8.8.8.8 +4026533106 uts 1 29413 root ping 8.8.8.8 +4026533105 ipc 1 29413 root ping 8.8.8.8 +[...] +``` + +#### **User** + +The user namespace isolates users and groups within a container. This is done by allowing containers to have a different view of UID and GID ranges compared to the host system. The user namespace enables the software to run inside the container as the root user. If an intruder attacks the container and then escapes to the host machine, they're confined to only a non-root identity. + +#### **Mnt** + +The mnt namespace allows the containers to have their own view of the system's file system hierarchy. You can find the mount points for each container process in the _/proc/<PID>/mounts_ location in your Linux system. + +#### **UTS** + +The Unix Timesharing System (UTS) namespace allows containers to have a unique hostname and domain name. When you run a container, a random ID is used as the hostname even when using the `— name` tag. You can use the [`unshare` command][6] to get an idea of how this works. + + +``` +$ docker container run -it --name nived alpine sh +/ # hostname +9c9a5edabdd6 +/ # +$ sudo unshare -u sh +# hostname isolated.hostname +# hostname +# exit +$ hostname +homelab.redhat.com +``` + +#### **IPC** + +The Inter-Process Communication (IPC) namespace allows different container processes to communicate by accessing a shared range of memory or using a shared message queue. +  + + +``` +# ipcmk -M 10M +Shared memory id: 0 +# ipcmk -M 20M +Shared memory id: 1 +# ipcs +\---- Message Queues ---- +key  msqid  owner  perms  used-bytes  messages + +\---- Shared Memory Segments +key        shmid owner perms bytes    nattch status +0xd1df416a 0     root  644   10485760 0 +0xbd487a9d 1     root  644   20971520 0 +[...] +``` + +#### **PID** + +The Process ID (PID) namespace ensures that the processes running inside a container are isolated from the external world. When you run a `ps` command inside a container, you only see the processes running inside the container and not on the host machine because of this namespace. + +#### **Net** + +The network namespace allows the container to have its own view of network interface, IP addresses, routing tables, port numbers, and so on. How does a container able to communicate to the external world? All containers you create get attached to a special virtual network interface for communication. + +### Control groups (cgroups) + +Cgroups are fundamental blocks of making a container. A cgroup allocates and limits resources such as CPU, memory, network I/O that are used by containers. The container engine automatically creates a cgroup filesystem of each type, and sets values for each container when the container is run. + +### SECCOMP + +Seccomp basically stands for _secure computing_. It is a Linux feature used to restrict the set of system calls that an application is allowed to make. The default seccomp profile for Docker, for example, disables around 44 syscalls (over 300 are available). + +The idea here is to provide containers access to only those resources which the container might need. For example, if you don't need the container to change the clock time on your host machine, you probably have no use for the _clock_adjtime_ and _clock_settime_ syscalls, and it makes sense to block them out. Similarly, you don't want the containers to change the kernel modules, so there is no need for them to make _create_module, delete_module_ syscalls. + +### SELinux + +SELinux stands for _security-enhanced Linux_. If you are running a Red Hat distribution on your hosts, then SELinux is enabled by default. SELinux lets you limit an application to have access only to its own files and prevent any other processes from accessing them. So, if an application is compromised, it would limit the number of files that it can affect or control. It does this by setting up contexts for files and processes and by defining policies that would enforce what a process can see and make changes to. + +SELinux policies for containers are defined by the `container-selinux` package. By default, containers are run with the **container_t** label and are allowed to read (r) and execute (x) under the _/usr_ directory and read most content from the _/etc_ directory. The label **container_var_lib_t** is common for files relating to containers. + +### Wrap up + +Containers are a critical part of today's IT infrastructure and a pretty interesting technology, too. Even if your role doesn't involve containerization directly, understanding a few fundamental container concepts and approaches gives you an appreciation for how they can help your organization. The fact that containers are built on open source Linux technologies makes them even better! + +* * * + +_This article is based on a [techbeatly][7] article and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/container-linux-technology + +作者:[Nived V][a] +选题:[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/nivedv +[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/21/8/container-fundamentals-2 +[3]: https://opensource.com/article/21/8/deep-dive-container-runtimes +[4]: https://opensource.com/sites/default/files/1linuxtechs.png (layers of linux technologies) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/article/19/10/namespaces-and-containers-linux +[7]: https://nivedv.medium.com/container-internals-deep-dive-5cc424957413 From 9a68606d74221f0940c852b851e19fe1188c5250 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 3 Sep 2021 05:04:25 +0800 Subject: [PATCH 093/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210902=20?= =?UTF-8?q?Get=20started=20programming=20with=20DOS=20conio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210902 Get started programming with DOS conio.md --- ... Get started programming with DOS conio.md | 341 ++++++++++++++++++ 1 file changed, 341 insertions(+) create mode 100644 sources/tech/20210902 Get started programming with DOS conio.md diff --git a/sources/tech/20210902 Get started programming with DOS conio.md b/sources/tech/20210902 Get started programming with DOS conio.md new file mode 100644 index 0000000000..33e8819bd6 --- /dev/null +++ b/sources/tech/20210902 Get started programming with DOS conio.md @@ -0,0 +1,341 @@ +[#]: subject: "Get started programming with DOS conio" +[#]: via: "https://opensource.com/article/21/9/programming-dos-conio" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Get started programming with DOS conio +====== +Create various practical and exciting applications by programming with +conio. +![Person using a laptop][1] + +One of the reasons so many DOS applications sported a text user interface (or TUI) is because it was so easy to do. The standard way to control **con**sole **i**nput and **o**utput (**conio**) was with the `conio` library for many C programmers. This is a de-facto standard library on DOS, which gained popularity as implemented by Borland's proprietary C compiler as `conio.h`. You can also find a similar `conio` implementation in TK Chia's IA-16 DOS port of the GNU C Compiler in the `libi86` library of non-standard routines. The library includes implementations of `conio.h` functions that mimic Borland Turbo C++ to set video modes, display colored text, move the cursor, and so on. + +For years, FreeDOS included the OpenWatcom C Compiler in the standard distributions. OpenWatcom supports its own version of `conio`, implemented in `conio.h` for particular console input and output functions, and in `graph.h` to set colors and perform other manipulation. Because the OpenWatcom C Compiler has been used for a long time by many developers, this `conio` implementation is also quite popular. Let's get started with the OpenWatcom `conio` functions. + +### Setting the video mode + +Everything you do is immediately displayed on-screen via hardware. This is different from the `ncurses` library on Linux, where everything is displayed through terminal emulation. On DOS, everything is running on hardware. And that means DOS `conio` programs can easily access video modes and leverage screen regions in ways that are difficult using Linux `ncurses`. + +To start, you need to set the _video mode_. On OpenWatcom, you do this with the `_setvideomode` function. This function takes one of several possible values, but for most programs that run in color mode in a standard 80x25 screen, use `_TEXTC80` as the mode. + + +``` +#include <conio.h> +#include <graph.h> + +int +main() +{ +  _setvideomode(_TEXTC80); +  …  +``` + +When you're done with your program and ready to exit back to DOS, you should reset the video mode back to whatever values it had before. For that, you can use `_DEFAULTMODE` as the mode. + + +``` + _setvideomode(_DEFAULTMODE); +  return 0; +} +``` + +### Setting the colors + +Every PC built after 1981's Color/Graphics Adapter supports [16 text colors and 8 background colors][2]. Background colors are addressed with color indices 0 through 7, and text colors can be any value from 0 to 15: + +| | | | | | | --------- | | ----------------- | | | 0 Black | | 8 Bright Black | | | 1 Blue | | 9 Bright Blue | | | 2 Green | | 10 Bright Green | | | 3 Cyan | | 11 Bright Cyan | | | 4 Red | | 12 Bright Red | | | 5 Magenta | | 13 Bright Magenta | | | 6 Brown | | 14 Yellow | | | 7 White | | 15 Bright White | + +You can set both the text color and the color behind it. Use the `_settextcolor` function to set the text "foreground" color and `_setbkcolor` to set the text "background" color. For example, to set the colors to yellow text on a red background, you would use this pair of functions: + + +``` + _settextcolor(14); + _setbkcolor(4); +``` + +### Positioning text + +In `conio`, screen coordinates are always _row_,_col_ and start with 1,1 in the upper-left corner. For a standard 80-column display with 25 lines, the bottom-right corner is 25,80. + +Use the `_settextposition` function to move the cursor to a specific screen coordinate, then use `_outtext` to print the text you want to display. If you've set the colors, your text will use the colors you last defined, regardless of what's already on the screen. + +For example, to print the text "FreeDOS" at line 12 and column 36 (which is more or less centered on the screen) use these two functions: + + +``` +  _settextposition(12, 36); +  _outtext("FreeDOS"); +``` + +Here's a small example program: + + +``` +#include <conio.h> +#include <graph.h> + +int +main() +{ +    _setvideomode(_TEXTC80); + +    _settextcolor(14); +    _setbkcolor(4); + +    _settextposition(12, 36); +    _outtext("FreeDOS"); + +    [getch][3](); + +    _setvideomode(_DEFAULTMODE); + +    return 0; +} +``` + +Compile and run the program to see this output: + +![Print to the screen with conio][4] + +(Jim Hall, [CC BY-SA 4.0][5]) + +### Text windows + +The trick to unleashing the power of `conio` is to leverage a feature of the PC video display where a program can control the video hardware by region. These are called text windows and are a really cool feature of `conio`. + +A text window is just an area of the screen, defined as a rectangle starting at a particular _row_,_col_ and ending at a different _row_,_col_. These regions can take up the whole screen or be as small as a single line. Once you define a window, you can clear it with a background color and position text in it. + +To define a text window starting at row 5 and column 10, and extending to row 15 and column 70, you use the `_settextwindow` function like this: + + +``` +`  _settextwindow(5, 10, 15, 70);` +``` + +Now that you've defined the window, any text you draw in it uses 1,1 as the upper-left corner of the text window. Placing text at 1,1 will actually position that text at row 5 and column 10, where the window starts on the screen. + +You can also clear the window with a background color. The `_clearscreen` function does double duty to clear either the full screen or just the window that's currently defined. To clear the entire screen, give the value `_GCLEARSCREEN` to the function. To clear just the window, use `_GWINDOW`. With either usage, you'll fill that region with whatever background color you last set. For example, to clear the whole screen with cyan (color 3) and a smaller text window with blue (color 1) you could use this code: + + +``` +  _clearscreen(_GCLEARSCREEN); +  _setbkcolor(3); +  _settextwindow(5, 10, 15, 70); +  _setbkcolor(1); +  _clearscreen(_GWINDOW); +``` + +This makes it really easy to fill in certain areas of the screen. In fact, defining a window and filling it with color is such a common thing to do that I often create a function to do both at once. Many of my `conio` programs include some variation of these two functions to clear the screen or window: + + +``` +#include <conio.h> +#include <graph.h> + +void +clear_color(int fg, int bg) +{ +  _settextcolor(fg); +  _setbkcolor(bg); +  _clearscreen(_GCLEARSCREEN); +} + +void +textwindow_color(int top, int left, int bottom, int right, int fg, int bg) +{ +  _settextwindow(top, left, bottom, right); +  _settextcolor(fg); +  _setbkcolor(bg); +  _clearscreen(_GWINDOW); +} +``` + +A text window can be any size, even a single line. This is handy to define a title bar at the top of the screen or a status line at the bottom of the screen. Again, I find this to be such a useful addition to my programs that I'll frequently write functions to do it for me: + + +``` +#include <conio.h> +#include <graph.h> + +#include <string.h>                    /* for strlen */ + +void +clear_color(int fg, int bg) +{ +  …  +} + +void +textwindow_color(int top, int left, int bottom, int right, int fg, int bg) +{ +  …  +} + +void +print_header(int fg, int bg, const char *text) +{ +  textwindow_color(1, 1, 1, 80, fg, bg); + +  _settextposition(1, 40 - (strlen(text) / 2)); +  _outtext(text); +} + +void +print_status(int fg, int bg, const char *text) +{ +  textwindow_color(25, 1, 25, 80, fg, bg); + +  _settextposition(1, 1); +  _outtext(text); +} +``` + +### Putting it all together + +With this introduction to `conio`, and with the set of functions we've defined above, you can create the outlines of almost any program. Let's write a quick example that demonstrates how text windows work with `conio`. We'll clear the screen with a color, then print some sample text on the second line. That leaves room to put a title line at the top of the screen. We'll also print a status line at the bottom of the screen. + +This is the basics of many kinds of applications. Placing a text window towards the right of the screen could be useful if you were writing a "monitor" program, such as part of a control system, like this: + + +``` +#include <conio.h> +#include <graph.h> + +int +main() +{ +  _setvideomode(_TEXTC80); + +  clear_color(7, 1);                   /* white on blue */ +  _settextposition(2, 1); +  _outtext("test"); + +  print_header(0, 7, "MONITOR");       /* black on white */ + +  textwindow_color(3, 60, 23, 79, 15, 3);       /* br white on cyan */ +  _settextposition(3, 2); +  _outtext("hi mom"); + +  print_status(0, 7, "press any key to quit...");       /* black on white */ +  getch(); + +  _setvideomode(_DEFAULTMODE); + +  return 0; +} +``` + +Having already written our own window functions to do most of the repetitive work, this program becomes very straightforward: clear the screen with a blue background, then print "test" on the second line. There's a header line and a status line, but the interesting part is in the middle where the program defines a text window near the right edge of the screen and prints some sample text. The `getch()` function waits for the user to press a key on the keyboard, useful when you need to wait until the user is ready: + +![Conio mon][6] + +(Jim Hall, [CC BY-SA 4.0][5]) + +We can change only a few values to completely change the look and function of this program. By setting the background to green and red text on a white window, we have the start of a solitaire card game: + + +``` +#include <conio.h> +#include <graph.h> + +int +main() +{ +  _setvideomode(_TEXTC80); + +  clear_color(7, 2);                   /* white on green */ +  _settextposition(2, 1); +  _outtext("test"); + +  print_header(14, 4, "SOLITAIRE");    /* br yellow on red */ + +  textwindow_color(10, 10, 17, 22, 4, 7);       /* red on white */ +  _settextposition(3, 2); +  _outtext("hi mom"); + +  print_status(7, 6, "press any key to quit...");       /* white on brown */ +  getch(); + +  _setvideomode(_DEFAULTMODE); + +  return 0; +} +``` + +You could add other code to this sample program to print card values and suits, place cards on top of other cards, and other functionality to create a complete game. But for this demo, we'll just draw a single "card" displaying some text: + +![Conio solitaire][7] + +(Jim Hall, [CC BY-SA 4.0][5]) + +You can create other effects using text windows. For example, before drawing a message window, you could first draw a black window that's offset by one row and one column. The text window will appear to create a shadow over that area of the screen to the user. And we can do it all by changing only a few values in our sample program: + + +``` +#include <conio.h> +#include <graph.h> + +int +main() +{ +  _setvideomode(_TEXTC80); + +  clear_color(7, 1);                   /* white on blue */ +  _settextposition(2, 1); +  _outtext("test"); + +  print_header(15, 3, "PROGRAMMING IN CONIO");  /* br white on cyan */ + +  textwindow_color(11, 36, 16, 46, 7, 0);       /* shadow */ +  textwindow_color(10, 35, 15, 45, 7, 4);       /* white on red */ +  _settextposition(3, 2); +  _outtext("hi mom"); + +  print_status(0, 7, "press any key to quit...");       /* black on white */ +  getch(); + +  _setvideomode(_DEFAULTMODE); + +  return 0; +} +``` + +You often see this "shadow" effect used in DOS programs as a way to add some visual flair: + +![Conio Window with shadow][8] + +(Jim Hall, [CC BY-SA 4.0][5]) + +The DOS `conio` functions can do much more than I've shown here, but with this introduction to `conio` programming, you can create various practical and exciting applications. Direct screen access means your programs can be more interactive than a simple command-line utility that scrolls text from the bottom of the screen. Leverage the flexibility of `conio` programming and make your next DOS program a great one. + +### Download the conio cheat sheet + +As you explore programming with `conio`, it's helpful to have a list of common functions close at hand. I've created a double-sided cheat sheet with all the basics of `conio`, so **[download it][9]** and use it on your next `conio` project. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/programming-dos-conio + +作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/article/21/6/freedos-sixteen-colors +[3]: http://www.opengroup.org/onlinepubs/009695399/functions/getch.html +[4]: https://opensource.com/sites/default/files/conio-hello.png (Print to the screen with conio) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/uploads/conio-mon.png (Conio mon) +[7]: https://opensource.com/sites/default/files/uploads/conio-sol.png (Conio solitaire) +[8]: https://opensource.com/sites/default/files/uploads/conio-win.png (Conio Window with shadow) +[9]: https://opensource.com/downloads/dos-conio-cheat-sheet From c87ea94ec8809346ee9f3523384c4397d3ed4cbe Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 3 Sep 2021 05:04:53 +0800 Subject: [PATCH 094/138] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210902=20?= =?UTF-8?q?Linux=20Lite=20Moves=20to=20Pay=20What=20You=20Want=20Model=20W?= =?UTF-8?q?ith=20Version=205.6=20Release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md --- ...You Want Model With Version 5.6 Release.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md diff --git a/sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md b/sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md new file mode 100644 index 0000000000..e0e534f26f --- /dev/null +++ b/sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md @@ -0,0 +1,77 @@ +[#]: subject: "Linux Lite Moves to Pay What You Want Model With Version 5.6 Release" +[#]: via: "https://news.itsfoss.com/linux-lite-5-6-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Lite Moves to Pay What You Want Model With Version 5.6 Release +====== + +[Linux Lite][1] has just announced Linux lite 5.6, the fourth installment in their 5.x series of releases. This release brings some major changes, especially in the download process. Other, more subtle tweaks are also shown throughout the OS. + +Here, we will be looking at what is new, what has changed, and how these changes may affect the future of Linux Lite. + +### What Has Changed in Linux Lite 5.6? + +![][2] + +Alongside the new download model, there a few key changes. These include: + + * New features in the Lite Tweaks app + * Updated icon theme + * New wallpapers + + + +While this list is relatively short, there are a couple of meaningful changes. + +### Pay Want You Want Download Model + +Definitely the most impactful change, Linux Lite has moved to a “Pay what you want” download model. For those not familiar with the term, it is a system where the user is encouraged to pay to obtain a download link. Users can still enter $0 to get the download link for free, but it is not immediately clear and does not support the distro. + +This move follows the footsteps of other popular distros, including ElementryOS. While I can see many users being annoyed at this change, it has also been made clear that Linux Lite would die without this change. + +> “This is a road I’d never thought I’d go down, but we have no choice. Either we stagnate and accept the big G’s ever-changing algorithms, or we boldly go where others have dared.” + +Jerry Bezencon + +In hindsight, this change was inevitable, as there is almost no other way for distributions to reasonably sustain themselves (aside from donations). Now we need to see how this change pays off for the developers of Linux Lite. + +### Updated Lite Tweaks App + +With this update, the Lite Tweaks app gets a few improvements. One of these is the ability to completely clear the cache of the Brave web browser. It also has a new option to set Brave as the default web browser. + +The second update within the Lite Tweaks app is a fix for GRUB. This tweak changes the grub entry from “Ubuntu” to “Linux Lite”. However, it should be noted that this option is only available when GRUB is controlled by Linux Lite. + +### Wrapping Up + +If you want to try Linux Lite for yourself, you can [download it from its website][3]. If you are already running Linux Lite, you can update to version 5.6 using the instructions found on the [release announcement][4]. + +While minor, this release does have a few improvements scattered around the OS. Most importantly, however, is the fact that Linux Lite can now be self-sustaining, meaning that we will continue to see more features added with every release. I think this is much better that the distro dying, don’t you? + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-lite-5-6-release/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://www.linuxliteos.com/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ0MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://www.linuxliteos.com/download.php +[4]: https://www.linuxliteos.com/forums/release-announcements/linux-lite-5-6-final-released/ From 3cd08edea8b9e19c6cf9ed599e094d66da009e66 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Sep 2021 06:57:21 +0800 Subject: [PATCH 095/138] PRF @geekpi --- ...ux kernel modules we can-t live without.md | 91 +++++++++++-------- 1 file changed, 52 insertions(+), 39 deletions(-) diff --git a/translated/tech/20210827 Linux kernel modules we can-t live without.md b/translated/tech/20210827 Linux kernel modules we can-t live without.md index 88935c79b5..8788ac1828 100644 --- a/translated/tech/20210827 Linux kernel modules we can-t live without.md +++ b/translated/tech/20210827 Linux kernel modules we can-t live without.md @@ -3,94 +3,107 @@ [#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 我们离不开的 Linux 内核模块 ====== -开源爱好者们对他们所喜爱的 Linux 内核模块进行了评价。 -![Linux keys on the keyboard for a desktop computer][1] -Linux 内核今年就要满 30 岁了! 如果你像我们一样,这是件大事,我们本周将用几个特别的帖子来庆祝 Linux。 +> 开源爱好者们对他们所喜爱的 Linux 内核模块进行了评价。 -今天,我们先来看看来自社区的回复,回答“你不能没有哪个 Linux 内核模块?为什么?”让我们听听这 10 位爱好者是怎么说的。 +![](https://img.linux.net.cn/data/attachment/album/202109/03/065649hik5hjiiy3htj589.jpg) -* * * +Linux 内核今年就要满 30 岁了! 如果你像我们一样对此特别重视,那么让我们本周用几个特别的文章来庆祝 Linux。 -我猜一些内核开发者听到我的回答后会尖叫着跑开。不过,我还是在这里列出了两个最具争议性的模块“ +今天,我们先来看看来自社区对“**你不能没有哪个 Linux 内核模块?为什么?**”的回答,让我们听听这 10 位爱好者是怎么说的。 + +### #1 + +我猜一些内核开发者听到我的回答后会尖叫着跑开。不过,我还是在这里列出了两个最具争议性的模块: * 第一个是 NVIDIA,因为我的工作笔记本和个人台式机上都有 NVIDIA 显卡。 - * 另一个可能产生的仇恨较少。VMware 的 VMNET 和 VMMON 模块,以便能够运行 VMware Workstation。—[Peter Czanik][2] + * 另一个可能产生的仇恨较少。VMware 的 VMNET 和 VMMON 模块,以便能够运行 VMware Workstation。 +— [Peter Czanik][2] +### #2 -* * * +我最喜欢的是 [zram][3] 模块。它在内存中创建了一个压缩块设备,然后它可以作为交换分区使用。在内存有限的情况下(例如,在虚拟机上),还有如果你担心频繁的 I/O 操作会磨损你的 SSD 或者甚至更糟糕的基于闪存的存储,那么使用基于 zram 的交换分区是非常理想的。 -我最喜欢的是 [zram][3] 模块。它在内存中创建了一个压缩块设备,然后可以作为交换分区使用。在内存有限的情况下(例如,在虚拟机上),还有如果你担心频繁的 I/O 操作会磨损你的 SSD 或者甚至更糟糕的是基于闪存的存储,那么使用基于 zram 的交换分区是非常理想的。—[Stephan Avenwedde][4] 。 +— [Stephan Avenwedde][4] -* * * +### #3 -最有用的内核模块无疑是 snd-hda-intel,因为它支持大多数集成声卡。我一边听音乐,一边在 Linux 桌面上编码一个音频编曲器。—[Joël Krähemann][5] +最有用的内核模块无疑是 snd-hda-intel,因为它支持大多数集成声卡。我可以一边听音乐,一边在 Linux 桌面上编码一个音频编曲器。 -* * * +— [Joël Krähemann][5] -如果没有我用 Broadcom 文件生成的 kmod-wl,我的笔记本就没有价值了。我有时会收到关于内核污染的信息,但没有无线的笔记本电脑有什么用呢?—[Gregory Pittman][6] 。 +### #4 -* * * +如果没有我用 Broadcom 文件生成的 kmod-wl,我的笔记本就没有价值了。我有时会收到关于内核污染的信息,但没有无线网络的笔记本电脑有什么用呢? -我不能没有蓝牙。没有它,我的鼠标、键盘、扬声器和耳机就成了门板。—[Gary Smith][7] +— [Gregory Pittman][6] -* * * +### #5 -我要冒昧地说_所有这些_都是。 说真的,我们已经到了随机拿一块硬件,插入它,它就可以工作的地步。 +我不能没有蓝牙。没有它,我的鼠标、键盘、扬声器和耳机除了用来挡住门板还有啥用? + +— [Gary Smith][7] + +### #6 + +我要冒昧地说 _全_ 都是。 说真的,我们已经到了随机拿一块硬件,插入它,它就可以工作的地步。 * USB 串行适配器能正常工作 - * 显卡可以使用(尽管可能不是最好的)。 + * 显卡可以使用(尽管可能不是最好的) * 网卡正常工作 * 声卡正常工作 +所有这些模块整体带来大量可以工作的驱动程序,令人印象深刻。我记得在过去那些糟糕的日子里,我们曾经大喊 xrandr 魔法字符串才能来使投影仪工作。而现在,是的,当设备基本不能正常工作时,才真的罕见。 +如果我不得不把它归结为一个,那就是 raid6。 -很难不对所有模块为整体带来的广泛的驱动程序工作印象深刻。我记得在过去的坏日子里,我们曾经大喊 xrandr 魔法字符串来使投影仪工作。而现在,是的,当东西(大部分)不能正常工作时,这是一种真正的罕见。 +— [John 'Warthog9' Hawley][8] -如果我不得不把它归结为一个,那就是 raid6。—[John 'Warthog9' Hawley][8] +### #7 -* * * - -对于这个问题,我想回到 20 世纪 90 年代末。我是一家小公司的 Unix 系统管理员(兼任 IS 经理)。我们的磁带备份系统死了,由于“小公司”预算有限,我们没有急于更换或现场维修。所以我们不得不把它送去维修。 +对于这个问题,我想回到 20 世纪 90 年代末。我是一家小公司的 Unix 系统管理员(兼任 IS 经理)。我们的磁带备份系统死了,由于“小公司”预算有限,我们没有急于更换或现场维修。所以我们必须得把它送去维修。 在那两个星期里,我们没有办法进行磁带备份。没有一个系统管理员愿意处于这种境地。 -但后来我想起了读过的[如何使用软盘磁带机][9],我们刚好有一台刚换下来的塔式电脑,有一个软磁带驱动器。 +但后来我想起了读过的 [如何使用软盘磁带机][9],我们刚好有一台刚换下来的塔式电脑,它有一个软盘磁带机。 -于是我用 Linux 重新安装了它,设置了 **ftape** 内核驱动模块,进行了一些备份/恢复测试,然后将我们最重要的备份运行到 QIC 磁带上。在这两个星期里,我们依靠 **ftape** 备份重要数据。 +于是我用 Linux 重新安装了它,设置了 ftape 内核驱动模块,进行了一些备份/恢复测试,然后将我们最重要的备份运行到 QIC 磁带上。在这两个星期里,我们依靠 ftape 备份重要数据。 -所以,对于那些让软盘磁带机在 1990 年代的 Linux 上工作的无名英雄,你真是太厉害了!—[Jim Hall][10] +所以,对于那些让软盘磁带机在 1990 年代的 Linux 上工作的无名英雄,你真是太厉害了! -* * * +— [Jim Hall][10] -嗯,这很简单。是 kvm 内核模块。在个人方面,我无法想象在没有虚拟机的情况下做我的日常工作。我愿意相信我们大多数人都是这样。kvm 模块在使 Linux 成为云战略的核心方面也发挥了很大作用。—[Gaurav Kamathe][11] +### #8 -* * * +嗯,这很简单。是 kvm 内核模块。就个人而言,我无法想象在没有虚拟机的情况下完成日常工作。我愿意相信我们大多数人都是这样。kvm 模块在使 Linux 成为云战略的核心方面也发挥了很大作用。 -对我来说,是 dm-crypt,它是用于 LUKS 的。见: +— [Gaurav Kamathe][11] + +### #9 + +对我来说,是 dm-crypt,它是用于 LUKS 的。参见: * * +知道别人无法看到你的磁盘上的内容是非常棒的,例如,如果你的笔记本丢失或被盗时。 +— [Maximilian Kolb][12] -知道别人无法看到你的磁盘上的内容是非常棒的,例如,如果你的笔记本丢失或被盗时。—[Maximilian Kolb][12] +### #10 +对于密码学基础,很难超越 crypto 模块和它的 C API,它是如此简洁明了。 -* * * +在日常生活中,还有什么比蓝牙提供的即插即用更有价值的吗? -对于密码学基础,很难超越 crypto 模块和它的 C API,它很简单。 - -在日常生活中,还有什么比蓝牙提供的即插即用更有价值的吗?—[Marty Kalin][13] - -* * * +— [Marty Kalin][13] 在评论中与我们分享。你的生活中不能没有什么 Linux 内核模块? @@ -101,7 +114,7 @@ via: https://opensource.com/article/21/8/linux-kernel-module 作者:[Jen Wike Huger][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 a04df20b0f601d95475fe6df5df409d0b9917efc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Sep 2021 06:58:07 +0800 Subject: [PATCH 096/138] PUB @geekpi https://linux.cn/article-13747-1.html --- .../20210827 Linux kernel modules we can-t live without.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210827 Linux kernel modules we can-t live without.md (98%) diff --git a/translated/tech/20210827 Linux kernel modules we can-t live without.md b/published/20210827 Linux kernel modules we can-t live without.md similarity index 98% rename from translated/tech/20210827 Linux kernel modules we can-t live without.md rename to published/20210827 Linux kernel modules we can-t live without.md index 8788ac1828..ddcdd82d5c 100644 --- a/translated/tech/20210827 Linux kernel modules we can-t live without.md +++ b/published/20210827 Linux kernel modules we can-t live without.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13747-1.html" 我们离不开的 Linux 内核模块 ====== From 8b60cbeb5bb36d4a287b490ca5b6cc7cba854a34 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Fri, 3 Sep 2021 08:09:04 +0800 Subject: [PATCH 097/138] translated by perfiffer --- ...xt on your screen in Linux with ncurses.md | 138 ------------------ ...xt on your screen in Linux with ncurses.md | 130 +++++++++++++++++ 2 files changed, 130 insertions(+), 138 deletions(-) delete mode 100644 sources/tech/20210829 Position text on your screen in Linux with ncurses.md create mode 100644 translated/tech/20210829 Position text on your screen in Linux with ncurses.md diff --git a/sources/tech/20210829 Position text on your screen in Linux with ncurses.md b/sources/tech/20210829 Position text on your screen in Linux with ncurses.md deleted file mode 100644 index 644d88a9ff..0000000000 --- a/sources/tech/20210829 Position text on your screen in Linux with ncurses.md +++ /dev/null @@ -1,138 +0,0 @@ -[#]: subject: "Position text on your screen in Linux with ncurses" -[#]: via: "https://opensource.com/article/21/8/ncurses-linux" -[#]: author: "Jim Hall https://opensource.com/users/jim-hall" -[#]: collector: "lujun9972" -[#]: translator: "perfiffer" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Position text on your screen in Linux with ncurses -====== -Use ncurses in Linux to place text at specific locations on the screen -and enable more user-friendly interfaces. -![Person using a laptop][1] - -Most Linux utilities just scroll text from the bottom of the screen. But what if you wanted to position text on the screen, such as for a game or a data display? That's where **ncurses** comes in. - -**curses** is an old Unix library that supports cursor control on a text terminal screen. The name _curses_ comes from the term _cursor control_. Years later, others wrote an improved version of **curses** to add new features, called _new curses_ or **ncurses**. You can find **ncurses** in every modern Linux distribution, although the development libraries, header files, and documentation may not be installed by default. For example, on Fedora, you will need to install the **ncurses-devel** package with this command: - - -``` -`$ sudo dnf install ncurses-devel` -``` - -### Using ncurses in a program - -To directly address the screen, you'll first need to initialize the **ncurses** library. Most programs will do that with these three lines: - - * initscr(); Initialize the screen and the **ncurses** code - * cbreak(); Disable buffering and make typed input immediately available - * noecho(); Turn off echo, so user input is not displayed to the screen - - - -These functions are defined in the **curses.h** header file, which you'll need to include in your program with: - - -``` -`#include ` -``` - -After initializing the terminal, you're free to use any of the **ncurses** functions, some of which we'll explore in a sample program. - -When you're done with **ncurses** and want to go back to regular terminal mode, use **endwin();** to reset everything. This command resets any screen colors, moves the cursor to the lower-left of the screen, and makes the cursor visible. You usually do this right before exiting the program. - -### Addressing the screen - -The first thing to know about **ncurses** is that screen coordinates are _row,col_, and start in the upper-left at 0,0. **ncurses** defines two global variables to help you identify the screen size: LINES is the number of lines on the screen, and COLS is the number of columns. The bottom-right position is LINES-1,COLS-1. - -For example, if you wanted to move the cursor to line 10 and column 30, you could use the move function with those coordinates: - - -``` -`move(10, 30);` -``` - -Any text you display after that will start at that screen location. To display a single character, use the **addch(c)** function with a single character. To display a string, use **addstr(s)** with your string. For formatted output that's similar to **printf**, use **printw(fmt, …)** with the usual options. - -Moving to a screen location and displaying text is such a common thing that **ncurses** provides a shortcut to do both at once. The **mvaddch(row, col, c)** function will display a character at screen location _row,col_. And the **mvaddstr(row, col, s)** function will display a string at that location. For a more direct example, using **mvaddstr(10, 30, "Welcome to ncurses");** in a program will display the text "Welcome to ncurses" starting at row 10 and column 30. And the line **mvaddch(0, 0, '+');** will display a single plus sign in the upper-left corner at row 0 and column 0. - -Drawing text to the terminal screen can have a performance impact on certain systems, especially on older hardware terminals. So **ncurses** lets you "stack up" a bunch of text to display to the screen, then use the **refresh()** function to make all of those changes visible to the user. - -Let's look at a simple example that pulls everything together: - - -``` -#include <curses.h> - -int -main() -{ -  initscr(); -  cbreak(); -  noecho(); - -  mvaddch(0, 0, '+'); -  mvaddch(LINES - 1, 0, '-'); -  mvaddstr(10, 30, "press any key to quit"); -  refresh(); - -  getch(); - -  endwin(); -} -``` - -The program starts by initializing the terminal, then prints a plus sign in the upper-left corner, a minus in the lower-left corner, and the text "press any key to quit" at row 10 and column 30. The program gets a single character from the keyboard using the getch() function, then uses **endwin()** to reset the terminal before the program exits completely. - -**getch()** is a useful function that you could use for many things. I often use it as a way to pause before I quit the program. And as with most **ncurses** functions, there's also a version of **getch()** called **mvgetch(row, col)** to move to screen position _row,col_ before waiting for a character. - -### Compiling with ncurses - -If you tried to compile that sample program in the usual way, such as `gcc pause.c`, you'll probably get a huge list of errors from the linker. That's because the **ncurses** library is not linked automatically by the GNU C Compiler. Instead, you'll need to load it for linking using the `-l ncurses` command-line option. - - -``` -`$ gcc -o pause pause.c -lncurses` -``` - -Running the new program will print a simple "press any key to quit" message that's more or less centered on the screen: - -![centered message in a program window][2] - -Figure 1: A centered "press any key to quit" message in a program. - -### Building better programs with ncurses - -Explore the **ncurses** library functions to learn about other ways to display text to the screen. You can find a list of all **ncurses** functions in the man ncurses manual page. This gives a general overview of **ncurses** and provides a table-like list of the different **ncurses** functions, with a reference to the manual page that has full details. For example, **printw** is described in the _curs_printw(3X)_ manual page, which you can view with: - - -``` -`$ man 3x curs_printw` -``` - -or just: - - -``` -`$ man curs_printw` -``` - -With **ncurses**, you can create more interesting programs. By printing text at specific locations on the screen, you can create games and advanced utilities to run in the terminal. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/ncurses-linux - -作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) -[2]: https://opensource.com/sites/default/files/press-key_0.png diff --git a/translated/tech/20210829 Position text on your screen in Linux with ncurses.md b/translated/tech/20210829 Position text on your screen in Linux with ncurses.md new file mode 100644 index 0000000000..acaf808c82 --- /dev/null +++ b/translated/tech/20210829 Position text on your screen in Linux with ncurses.md @@ -0,0 +1,130 @@ +[#]: sub·ject: "Position text on your screen in Linux with ncurses" +[#]: via: "https://opensource.com/article/21/8/ncurses-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: "perfiffer" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用 ncurses 在你的 Linux 屏幕上定位文本 +====== +使用 ncurses 在 Linux 屏幕上的特定位置放置文本,可以带来更友好的用户界面体验。 +![Person using a laptop][1] + +大多数的 Linux 实用程序仅仅只在屏幕的底部滚动文本。如果你想在屏幕中放置你的文本,例如一个游戏或者一个数据展示,你可以试试 **ncurses**。 + +**curses** 是一个旧的 Unix 库,它可以在文本终端界面控制光标。curses 的名称就来自于术语 cursor control。多年以后,其他人编写了新的 **curses** 版本用来添加新的功能,新版本被叫做 new curses 或者 **ncurses**。你可以在每个流行的 Linux 发行版中找到 ncurses。尽管默认情况下可能未安装开发库、头文件和文档。例如,在 Fedora 上,你需要使用以下命令安装 **ncurses-devel** 包: + + +``` +$ sudo dnf install ncurses-devel +``` + +### 在程序中使用 ncurses + +要在屏幕上直接寻址,你首先需要初始化 **ncurses** 库。大部分程序会通过以下三行来做到这一点: + + * initscr(); 初始化窗口对象和 ncurses 代码,返回代表整个屏幕的窗口对象 + * cbreak(); 禁用缓冲并使键入的输入立即可用 + * noecho(); 关闭回显,因此用户输入不会显示在屏幕上 + + +这些函数定义在 **curses.h** 头文件中,你需要在你的程序中通过以下方式将其包含进来: + +``` +#include +``` + +初始化终端后,你可以自由使用任何 **ncurses** 函数,我们将在示例程序中探讨其中的一些函数。 + +当你使用完 **ncurses** 并想返回到常规终端模式下时,使用 **endwin();** 重置一切。此命令可以重置任何屏幕颜色,将光标移动到屏幕的左下角,并使光标可见。通常在退出程序之前执行此操作。 + +### 在屏幕上寻址 + +关于 **ncurses** 首先需要知道的是屏幕的坐标分为行和列,左上角的是 0,0 点。**ncurses** 定义了两个全局变量来帮助你识别屏幕:LINES 是屏幕的行数,COLS 是屏幕的列数。屏幕右下角的位置是 LINES-1,COLS-1。 +例如,如果你想要移动光标到第 10 行和第 30 列,你可以使用移动函数,移动到此坐标: + +``` +move(10, 30); +``` + +之后显示的任何文本都将从屏幕的该位置开始。要显示单个字符,请对单个字符使用 **addch(c)** 函数。要显示字符串,将对字符串使用 **addstr(s)** 函数。对于类似于 **printf** 的格式化输出,请使用带有常用选项的 **printw(fmt, …)**。 + +移动到屏幕指定位置和显示文本是一件很常见的事情,**ncurses** 提供了同时执行这两项操作的快捷方式。**mvaddch(row, col, c)** 函数将在屏幕第 row 行,第 col 列的位置显示一个字符。而 **mvaddstr(row, col, s)** 函数将在屏幕第 row 行,第 col 列的位置显示一个字符串。更直接的例子,在程序中使用 **mvaddstr(10, 30, "Welcome to ncurses");** 函数将从屏幕的第 10 行和第 30 列开始显示文本 "Welcome to ncurses"。使用 **mvaddch(0, 0, '+');** 函数将在屏幕的左上角第 0 行和第 0 列处显示一个加号。 + +在终端屏幕上绘制文本会对某些系统产生性能影响,尤其是在较旧的硬件终端上。因此 **ncurses** 允许你“堆叠”一堆文本以显示在屏幕上,然后使用 **refresh()** 函数使所有这些更改对用户可见。 + +让我们来看一个将以上所有内容整合在一起的简单示例: + +``` +#include + +int +main() +{ +  initscr(); +  cbreak(); +  noecho(); + +  mvaddch(0, 0, '+'); +  mvaddch(LINES - 1, 0, '-'); +  mvaddstr(10, 30, "press any key to quit"); +  refresh(); + +  getch(); + +  endwin(); +} +``` + +程序的开始初始化了一个终端窗口,然后在屏幕的左上角打印了一个加号,在左下角打印了一个减号,在第 10 行和第 30 列打印了 “press any key to quit” 文本。程序通过使用 getch() 函数接收了键盘输入的单个字符,接着,使用 **endwin()** 函数在程序完全退出前重置了终端。 + +**getch()** 是一个很有用的函数,你可以使用它来做很多事情。我经常使用它在我退出程序前用来暂停。与大多数 **ncurses** 函数一样,还有一个名为 **mvgetch(row, col)** 的 **getch()** 版本,用于在等待字符输入之前移动到屏幕位置的第 row 行,第 col 列。 + +### 使用 ncurses 编译 + +如果你尝试以通常的方式编译该示例程序,例如 `gcc pause.c`,你可能会从链接器中获得大量错误列表。那是因为 GNU C 编译器不会自动链接 **ncurses** 库。相反,你需要使用 `-l ncurses` 命令行选项加载它以进行链接。 + +``` +$ gcc -o pause pause.c -lncurses +``` + +运行新程序将打印一条简单的 “press any key to quit” 消息,该消息差不多位于屏幕中央: + +![centered message in a program window][2] + +图 1:程序中居中的 “press any key to quit” 消息。 + +### 使用 ncurses 构建更好的程序 + +探索 **ncurses** 库函数以了解在屏幕上显示文本的其它方法。你可以在 ncurses 的 man 手册页中找到所有 **ncurses** 函数的列表。这给出了 **ncurses** 的一般概述,并提供了不同 **ncurses** 函数的类似表格的列表,并参考了包含完整详细信息的手册页。例如,在 curs_printw(3X) 手册页中描述了 **printw**,您可以通过以下方式查看: + +``` +$ man 3x curs_printw +``` + +更简单点: + + +``` +$ man curs_printw +``` + +使用 **ncurses**,你可以创建更多有趣的程序。通过在屏幕上的特定位置打印文本,你可以创建在终端中运行的游戏和高级实用程序。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/ncurses-linux + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[校对者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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/sites/default/files/press-key_0.png From 16ed72bf609398570dacc2dee08e4731a29890c0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 3 Sep 2021 08:54:39 +0800 Subject: [PATCH 098/138] translated --- ...esting Open-Source Alternative to Slack.md | 99 ------------------- ...esting Open-Source Alternative to Slack.md | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md create mode 100644 translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md diff --git a/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md b/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md deleted file mode 100644 index 973cf54ef5..0000000000 --- a/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: subject: "Zulip: An Interesting Open-Source Alternative to Slack" -[#]: via: "https://itsfoss.com/zulip/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Zulip: An Interesting Open-Source Alternative to Slack -====== - -_**Brief:** Zulip is an open-source collaboration platform that pitches itself as a better replacement to Slack. Let us take a closer look._ - -Messaging and collaboration platforms make a big difference when it comes to your work. - -While there are several options available, Slack is a popular one used by many organizations. But, what about an open-source alternative to Slack that you can self-host? - -Zulip is one such software. - -### Zulip: Open Source Collaboration Messaging App - -![][1] - -If you want to explore, I must mention that there are more [open-source alternatives to Slack][2] out there. - -Here, I focus on Zulip. - -Zulip is a free and open-source messaging application with paid hosted options and the ability to self-host. - -It aims to provide a similar experience to Slack while striving to help you improve the effectiveness of conversations using topics. - -In contrast to channels in Slack, Zulip chat adds topics (which are like tags) to quickly filter through the conversations that matter to you. - -### Features of Zulip - -![][3] - -You get most of the essential features with Zulip. To list the key highlights, you can find: - - * Markdown support - * Topics for channels - * Drag and drop file support - * Code blocks - * GitHub integration to track issues - * Email notification support - * Self-host option - * Message editing - * GIPHY integration - * Video calls with Zoom, Jitsi, or BigBlueButton - - - -In addition to the features mentioned, you should expect the basic options that you usually get with Slack and others. - -Also, you can integrate it with Matrix and IRC if you want. - -![][4] - -In my brief test usage, the user interface is good enough for effective communication. However, I failed to find any dark mode or the ability to change a theme. - -It looks more straightforward than Slack so that it can improve the user experience side of things. - -### Install Zulip in Linux - -Zulip is available as an AppImage file from its official website. You may refer to our guide on [using AppImage in Linux][5] in case you need help. - -It is also available as a snap package. So, you can utilize either of them for any Linux distro. - -You can also install it through the terminal for Ubuntu/Debian-based distros using APT. Take a look at its [official instructions][6] if you want that. - -Zulip is available for Windows, Mac, and Linux. You should also find it available for Android and iOS mobile phones. - -[Zulip][7] - -Considering that you can use Zulip on the web, desktop, and smartphones, it is a suitable replacement for Slack. - -_Have you tried it yet? What messaging platform do you use to collaborate for work? Feel free to share your thoughts in the comments._ - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/zulip/ - -作者:[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/2021/08/zulip-chat-new.png?resize=800%2C551&ssl=1 -[2]: https://itsfoss.com/open-source-slack-alternative/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/zulip-chat-screenshot.png?resize=800%2C550&ssl=1 -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/zulip-settings.png?resize=800%2C546&ssl=1 -[5]: https://itsfoss.com/use-appimage-linux/ -[6]: https://zulip.com/help/desktop-app-install-guide -[7]: https://zulip.com/ diff --git a/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md b/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md new file mode 100644 index 0000000000..780348c7c7 --- /dev/null +++ b/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md @@ -0,0 +1,99 @@ +[#]: subject: "Zulip: An Interesting Open-Source Alternative to Slack" +[#]: via: "https://itsfoss.com/zulip/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Zulip:一个有趣的开源的 Slack 替代品 +====== + +_**简介:** Zulip 是一个开源的协作平台,它把自己定位为 Slack 的一个更好的替代品。让我们仔细看看。_ + +当涉及到你的工作时,消息和协作平台有很大的不同。 + +虽然有几个选择,但 Slack 是许多组织使用的一个流行选择。但是,你可以自托管的 Slack 的开源替代方案如何呢? + +Zulip 就是这样一个软件。 + +### Zulip:开源的协作消息应用 + +![][1] + +如果你想探索,我必须提到还有更多的 [Slack 开源替代品][2]。 + +在这里,我重点介绍 Zulip。 + +Zulip 是一个免费开源的消息应用,有付费托管选项和自我托管的能力。 + +它旨在提供与 Slack 类似的体验,同时努力帮助你利用话题提高对话的有效性。 + +与 Slack 中的频道相比,Zulip 聊天添加了话题(类似标签),以快速过滤与你有关的对话。 + +### Zulip 的特点 + +![][3] + +你可以通过 Zulip 获得大部分的基本功能。这里列出主要的亮点,你可以发现: + + * 支持 Markdown + * 频道的主题 + * 支持拖放文件 + * 代码块 + * 集成 GitHub 来跟踪问题 + * 支持电子邮件通知 + * 自我托管选项 + * 信息编辑 + * GIPHY 集成 + * 用 Zoom、Jitsi 或 BigBlueButton 进行视频通话 + + + +除了上述功能外,你应该期待你通常在 Slack 和其他方面得到的基本选项。 + +此外,如果你愿意,你还可以将它与 Matrix 和 IRC 整合。 + +![][4] + +在我简短的测试使用中,用户界面对于有效的沟通来说是足够好的。然而,我没能找到任何黑暗模式或改变主题的能力。 + +它看起来比 Slack 更直接,这样可以改善用户体验方面的问题。 + +### 在 Linux 中安装 Zulip + +Zulip 在其官方网站上以 AppImage 文件的形式提供。如果你需要帮助,可以参考我们关于[在 Linux 中使用 AppImage][5] 的指南。 + +它也有一个 snap 包。所以,你可以在任何一个 Linux 发行版上使用它们中的任何一个。 + +你也可以使用 APT 通过终端为基于 Ubuntu/Debian 的发行版安装它。如果你想这样做,请看它的[官方说明][6]。 + +Zulip 可用于 Windows、Mac 和 Linux。你也应该发现它可用于 Android 和 iOS 手机。 + +[Zulip][7] + +考虑到你可以在网络、桌面和智能手机上使用 Zulip,它是 Slack 的合适替代品。 + +_你试过了吗?你用什么消息平台来进行工作协作?欢迎在评论中分享你的想法。_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/zulip/ + +作者:[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/2021/08/zulip-chat-new.png?resize=800%2C551&ssl=1 +[2]: https://itsfoss.com/open-source-slack-alternative/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/zulip-chat-screenshot.png?resize=800%2C550&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/zulip-settings.png?resize=800%2C546&ssl=1 +[5]: https://itsfoss.com/use-appimage-linux/ +[6]: https://zulip.com/help/desktop-app-install-guide +[7]: https://zulip.com/ From 938f951d78a4830b1af48e9352544f38344cbf09 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 3 Sep 2021 08:58:16 +0800 Subject: [PATCH 099/138] translating --- sources/tech/20210901 What are container runtimes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210901 What are container runtimes.md b/sources/tech/20210901 What are container runtimes.md index eaba30fae8..56f3b32fe8 100644 --- a/sources/tech/20210901 What are container runtimes.md +++ b/sources/tech/20210901 What are container runtimes.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/container-runtimes" [#]: author: "Nived V https://opensource.com/users/nivedv" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From d8aecbd176e59d49783267806355267ef1c2488c Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Fri, 3 Sep 2021 17:22:18 +0800 Subject: [PATCH 100/138] translated --- ...200211 Using external libraries in Java.md | 99 +++++++++---------- 1 file changed, 44 insertions(+), 55 deletions(-) rename {sources => translated}/tech/20200211 Using external libraries in Java.md (57%) diff --git a/sources/tech/20200211 Using external libraries in Java.md b/translated/tech/20200211 Using external libraries in Java.md similarity index 57% rename from sources/tech/20200211 Using external libraries in Java.md rename to translated/tech/20200211 Using external libraries in Java.md index 63791df886..f852e55ce6 100644 --- a/sources/tech/20200211 Using external libraries in Java.md +++ b/translated/tech/20200211 Using external libraries in Java.md @@ -7,63 +7,58 @@ [#]: via: (https://opensource.com/article/20/2/external-libraries-java) [#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) -Using external libraries in Java +在 Java 中使用外部库 ====== -External libraries fill gaps in the Java core libraries. +外部库填补了 Java 核心库中的一些功能空白。 ![books in a library, stacks][1] -Java comes with a core set of libraries, including those that define commonly used data types and related behavior, like **String** or **Date**; utilities to interact with the host operating system, such as **System** or **File**; and useful subsystems to manage security, deal with network communications, and create or parse XML. Given the richness of this core set of libraries, it's often easy to find the necessary bits and pieces to reduce the amount of code a programmer must write to solve a problem. +Java 自带有一组核心库,其中包含了定义常用数据类型和相关行为的库(例如 **String** 和 **Date**)、与主机操作系统交互的实用程序(例如 **System** 和 **File**),以及一些用来管理安全性、处理网络通信、创建或解析 XML的有用的子系统。鉴于核心库的丰富性,程序员通常很容易在其中找到有用的组件,以减少需要编写的代码量。 -Even so, there are a lot of interesting Java libraries created by people who find gaps in the core libraries. For example, [Apache Commons][2] "is an Apache project focused on all aspects of reusable Java components" and provides a collection of some 43 open source libraries (as of this writing) covering a range of capabilities either outside the Java core (such as [geometry][3] or [statistics][4]) or that enhance or replace capabilities in the Java core (such as [math][5] or [numbers][6]). +即便如此,核心库仍有一些功能上的不足,因此发现这些不足的程序员们还额外创建了很多有趣的 Java 库。例如,[Apache Commons][2] 是一个专注于可重用 Java 组件所有方面的 Apache 项目,提供了大约 43 个开源库的集合(截至撰写本文时),涵盖了 Java 核心库之外的一系列功能 (例如 [geometry][3] 或 [statistics][4]),并增强或替换了 Java 核心库中的原有功能(例如 [math][5] 或 [numbers][6])。 -Another common type of Java library is an interface to a system component—for example, to a database system. This article looks at using such an interface to connect to a [PostgreSQL][7] database and get some interesting information. But first, I'll review the important bits and pieces of a library. +另一种常见的 Java 库类型是系统组件的接口(例如数据库系统接口),本文会着眼于使用此类接口连接到 [PostgreSQL][7] 数据库,并得到一些有趣的信息。首先,我们来回顾一下库的重要部分。 -### What is a library? +### 什么是库? -A library, of course, must contain some useful code. But to be useful, that code needs to be organized in such a way that the Java programmer can access the components to solve the problem at hand. +库里自然包含的是一些有用的代码。但为了发挥用处,代码需要以特定方式进行组织,特定的方式使 Java 程序员可以访问其中组件来解决手头问题。 -I'll boldly claim that the most important part of a library is its application programming interface (API) documentation. This kind of documentation is familiar to many and is most often produced by [Javadoc][8], which reads structured comments in the code and produces HTML output that displays the API's packages in the panel in the top-left corner of the page; its classes in the bottom-left corner; and the detailed documentation at the library, package, or class level (depending on what is selected in the main panel) on the right. For example, the [top level of API documentation for Apache Commons Math][9] looks like: +可以说,一个库最重要的部分是它的应用程序编程接口 (API) 文档。这种文档很多人都熟悉,通常是由 [Javadoc][8] 生成的。Javadoc 读取代码中的结构化注释并以 HTML 格式输出文档,通常 API 的 (pacage) 在页面左上角的面板中显示,(class) 在左下角显示,同时右侧会有库、包或类级别的详细文档(具体取决于在主面板中选择的内容)。例如,[Apache Commons Math 的顶级 API 文档][9] 如下所示: ![API documentation for Apache Commons Math][10] -Clicking on a package in the main panel shows the Java classes and interfaces defined in that package. For example, **[org.apache.commons.math4.analysis.solvers][11]** shows classes like **BisectionSolver** for finding zeros of univariate real functions using the bisection algorithm. And clicking on the [BisectionSolver][12] link lists all the methods of the class **BisectionSolver**. +单击主面板中的包会显示该包中定义的 Java 类和接口。例如,**[org.apache.commons.math4.analysis.solvers][11]** 显示了诸如 **BisectionSolver** 这样的类,该类用于使用二分算法查找单变量实函数的零点。单击 [BisectionSolver][12] 链接会列出 **BisectionSolver** 类的所有方法。 -This type of documentation is useful as reference information; it's not intended as a tutorial for learning how to use the library. For example, if you know what a univariate real function is and look at the package **org.apache.commons.math4.analysis.function**, you can imagine using that package to compose a function definition and then using the **org.apache.commons.math4.analysis.solvers** package to look for zeros of the just-created function. But really, you probably need more learning-oriented documentation to bridge to the reference documentation. Maybe even an example! +这类文档可用作参考文档,不适合作为学习如何使用库的教程。比如,如果你知道什么是单变量实函数并查看包 **org.apache.commons.math4.analysis.function**,就可以试着使用该包来组合函数定义,然后使用 **org.apache.commons.math4.analysis.solvers** 包来查找刚刚创建的函数的零点。但如果你不知道,就可能需要更多学习向的文档,也许甚至是一个实际例子,来读懂参考文档。 -This documentation structure also helps clarify the meaning of _package_—a collection of related Java class and interface definitions—and shows what packages are bundled in a particular library. +这种文档结构还有助于阐明 _package_(相关 Java 类和接口定义的集合)的含义,并显示特定库中捆绑了哪些包。 -The code for such a library is most commonly found in a [**.jar** file][13], which is basically a .zip file created by the Java **jar** command that contains some other useful information. **.jar** files are typically created as the endpoint of a build process that compiles all the **.java** files in the various packages defined. +这种库的代码通常是在 [**.jar** 文件][13] 中,它基本上是由 Java 的 **jar** 命令创建的 .zip 文件,其中还包含一些其他有用的信息。**.jar** 文件通常被创建为构建过程的端点,该构建过程编译了所定义包中的所有 **.java** 文件。 -There are two main steps to accessing the functionality provided by an external library: +要访问外部库提供的功能,有两个主要步骤: - 1. Make sure the library is available to the Java compilation step—[**javac**][14]—and the execution step—**java**—via the classpath (either the **-cp** argument on the command line or the **CLASSPATH** environment variable). - 2. Use the appropriate **import** statements to access the package and class in the program source code. + 1. 确保通过类路径(或者命令行中的 **-cp** 参数或者 **CLASSPATH** 环境变量),库可用于 Java 编译步骤([**javac**][14])和执行步骤(**java**)。 + 2. 使用恰当的 **import** 语句访问程序源代码中的包和类。 +其余的步骤就与使用 **String** 等 Java核心类相同,使用库提供的类和接口定义来编写代码。很简单对吧?不过也没那么简单。首先,你需要了解库组件的预期使用模式,然后才能编写代码。 +### 示例:连接 PostgreSQL 数据库 -The rest is just like coding with Java core classes, such as **String**—write the code using the class and interface definitions provided by the library. Easy, eh? Well, maybe not quite that easy; first, you need to understand the intended use pattern for the library components, and then you can write code. +在数据库系统中访问数据的典型使用步骤是: -### An example: Connect to a PostgreSQL database + 1. 访问正在使用的特定数据库软件代码。 + 2. 连接到数据库服务器。 + 3. 构建查询字符串。 + 4. 执行查询字符串。 + 5. 针对返回的结果,做需要的处理。 + 6. 断开与数据库服务器的连接。 -The typical use pattern for accessing data in a database system is: +所有这些面向程序员的部分由接口包 **[java.sql][15]** 提供,它独立于数据库,定义了核心客户端 Java 数据库连接 (JDBC) API。**java.sql** 包是 Java 核心库的一部分,因此无需提供 **.jar** 文件即可编译。但每个数据库提供者都会创建自己的 **java.sql** 接口实现(例如 **Connection** 接口),并且必须在运行步骤中提供这些实现。 - 1. Gain access to the code specific to the database software being used. - 2. Connect to the database server. - 3. Build a query string. - 4. Execute the query string. - 5. Do something with the results returned. - 6. Disconnect from the database server. +接下来我们使用 PostgreSQL,看看这一过程是如何进行的。 +#### 访问特定数据库的代码 - -The programmer-facing part of all of this is provided by a database-independent interface package, **[java.sql][15]**, which defines the core client-side Java Database Connectivity (JDBC) API. The **java.sql** package is part of the core Java libraries, so there is no need to supply a **.jar** file to the compile step. However, each database provider creates its own implementation of the **java.sql** interfaces—for example, the **Connection** interface—and those implementations must be provided on the run step. - -Let's see how this works, using PostgreSQL. - -#### Gain access to the database-specific code - -The following code uses the [Java class loader][16] (the **Class.forName()** call) to bring the PostgreSQL driver code into the executing virtual machine: - +以下代码使用 [Java 类加载器][16](**Class.forName()** 调用)将 PostgreSQL 驱动程序代码加载到正在执行的虚拟机中: ``` import java.sql.*; @@ -90,10 +85,9 @@ public class Test1 { } ``` -Because the class loader can fail, and therefore can throw an exception when failing, surround the call to **Class.forName()** in a try-catch block. - -If you compile the above code with **javac** and run it with Java: +因为类加载器可能失败,失败时会抛出异常,所以将对 **Class.forName()** 的调用放在 try-catch 代码块中。 +如果你使用 **javac** 编译上面的代码,然后用 Java 运行,会报异常: ``` me@mymachine:~/Test$ javac Test1.java @@ -103,8 +97,7 @@ java.lang.ClassNotFoundException: org.postgresql.Driver me@mymachine:~/Test$ ``` -The class loader needs the **.jar** file containing the PostgreSQL JDBC driver implementation to be on the classpath: - +类加载器要求类路径中有包含 PostgreSQL JDBC 驱动程序实现的 **.jar** 文件: ``` me@mymachine:~/Test$ java -cp ~/src/postgresql-42.2.5.jar:. Test1 @@ -113,10 +106,9 @@ done. me@mymachine:~/Test$ ``` -#### Connect to the database server - -The following code loads the JDBC driver and creates a connection to the PostgreSQL database: +#### 连接到数据库服务器 +以下代码实现了加载 JDBC 驱动程序和创建到 PostgreSQL 数据库的连接: ``` import java.sql.*; @@ -161,8 +153,7 @@ public class Test2 { } ``` -Compile and run it: - +编译并运行上述代码: ``` me@mymachine:~/Test$ javac Test2.java @@ -174,19 +165,18 @@ done. me@mymachine:~/Test$ ``` -Some notes on the above: +关于上述的一些注意事项: - * The code following comment [2] uses system properties to set up connection parameters—in this case, the PostgreSQL username and password. This allows for grabbing those parameters from the Java command line and passing all the parameters in as an argument bundle. There are other **Driver.getConnection()** options for passing in the parameters individually. - * JDBC requires a URL for defining the database, which is declared above as **String database** and passed into the **Driver.getConnection()** method along with the connection parameters. - * The code uses try-with-resources, which auto-closes the connection upon completion of the code in the try-catch block. There is a lengthy discussion of this approach on [Stack Overflow][23]. - * The try-with-resources provides access to the **Connection** instance and can execute SQL statements there; any errors will be caught by the same **catch** statement. + * 注释 [2] 后面的代码使用系统属性来设置连接参数(在本例中参数为 PostgreSQL 用户名和密码)。代码也可以从 Java 命令行获取这些参数并将所有参数作为参数包传递,同时还有一些其他 **Driver.getConnection()** 选项可用于单独传递参数。 + * JDBC 需要一个用于定义数据库的 URL,它在上述代码中被声明为 **String database** 并与连接参数一起传递给 **Driver.getConnection()** 方法。 + * 代码使用 try-with-resources 语句,它会在 try-catch 块中的代码完成后自动关闭连接。[Stack Overflow][23] 上对这种方法进行了长期的讨论。 + * try-with-resources 语句提供对 **Connection** 实例的访问,并可以在其中执行 SQL 语句;所有错误都会被同一个 **catch** 语句捕获。 - - -#### Do something fun with the database connection +#### 用数据库的连接处理一些有趣的事情 In my day job, I often need to know what users have been defined for a given database server instance, and I use this [handy piece of SQL][24] for grabbing a list of all users: +日常工作中,我经常需要知道为给定的数据库服务器实例定义了哪些用户,这里我使用这个 [简便的 SQL][24] 来获取所有用户的列表: ``` import java.sql.*; @@ -264,10 +254,9 @@ public class Test3 { } ``` -In the above, once it has the **Connection** instance, it defines a query string (comment [4] above), creates a **Statement** instance and uses it to execute the query string, then puts its results in a **ResultSet** instance, which it can iterate through to analyze the results returned, and ends by closing both the **ResultSet** and **Statement** instances (comment [5] above). - -Compiling and executing the program produces the following output: +在上述代码中,一旦有了 **Connection** 实例,它就会定义一个查询字符串(上面的注释 [4]),创建一个 **Statement** 实例并用其来执行查询字符串,然后将其结果放入一个 **ResultSet** 实例。程序可以遍历该 **ResultSet** 实例来分析返回的结果,并以关闭 **ResultSet** 和 **Statement** 实例结束(上面的注释 [5])。 +编译和执行程序会产生以下输出: ``` me@mymachine:~/Test$ javac Test3.java @@ -284,7 +273,7 @@ done. me@mymachine:~/Test$ ``` -This is a (very simple) example of using the PostgreSQL JDBC library in a simple Java application. It's worth emphasizing that it didn't need to use a Java import statement like **import org.postgresql.jdbc.*;** in the code because of the way the **java.sql** library is designed. Because of that, there's no need to specify the classpath at compile time. Instead, it uses the Java class loader to bring in the PostgreSQL code at run time. +这是在一个简单的 Java 应用程序中使用 PostgreSQL JDBC 库的(非常简单的)示例。要注意的是,由于 **java.sql** 库的设计方式,它不需要在代码中使用像 **import org.postgresql.jdbc.*;** 这样的 Java 导入语句,而是使用 Java 类加载器在运行时引入 PostgreSQL 代码的方式,也正因此无需在代码编译时指定类路径。 -------------------------------------------------------------------------------- From 7a61fcb0b8c37bcabb468f14cbc5d4e74f33b57f Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Fri, 3 Sep 2021 22:17:42 +0800 Subject: [PATCH 101/138] Update 20210819 A guide to understanding your team-s implicit values and needs.md --- ...g your team-s implicit values and needs.md | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md index b6fb24d3ae..39d7e1cbf2 100644 --- a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md +++ b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md @@ -14,41 +14,38 @@ 文化在[开放的组织][2]很重要。 但“文化”似乎是一个如此庞大而复杂的概念。我们该如何帮助开放式的团队组织去理解它呢? -一个解决方案可能来自于 [_Rule Makers, Rule Breakers_][4]_的作者 [Michele J. Gelfand][3]:紧密和松散的文化以及指导我们生活的秘密信号_。Gelfand 把所有的国家和文化分成简单的两类, 一类是“严格的”文化另一类是“松散的”。然后,她解释了两者的特点和社会规范,提供了它们的相对优势和劣势。通过研究两者,我们可以克服团队、组织和国家之间的分歧和冲突。 +一个解决方案可能来自于 [_Rule Makers, Rule Breakers_][4]_的作者 [Michele J. Gelfand][3]:紧密和松散的文化以及指导我们生活的秘密信号_。Gelfand 把所有的国家和文化分成简单的两类, 一类是“紧密的”文化另一类是“松散的”。然后,她解释了两者的特点和社会规范,提供了它们的相对优势和劣势。通过研究两者,我们可以克服团队、组织和国家之间的分歧和冲突。 In this two-part review of _Rule Makers, Rule Breakers_, 我将解释 Gelfand 的论点,并讨论它对在开放性组织中工作的人们有用的方式。 ### 了解你的社会规范 -Gelfand believes that our behavior is very strongly dependent on whether we live in a "tight" or "loose" community culture, because each of these cultures has social norms that differ from the other. These norms—and the strictness with which they are enforced—will determine our behavior in the community. They give us our identity. They help us coordinate with each other. In short, they're the glue that holds communities together. +Gelfand 认为,我们的行为很大程度上取决于我们是生活在 "紧密的" 还是 "松散的" 社区文化中,因为这些文化有不同于其他文化的社会规范。这些规范————以及强制执行的严格程度————将决定我们在社会中的行为。 它们给了我们身份。它们帮助我们彼此协调,简而言之,这些价值使社区团结在一起。 -They also impact our worldviews, the ways we build our environments, and even the processing in our brains. "Countless studies have shown that social norms are critical for uniting communities into cooperative, well-coordinated groups that can accomplish great feats," Gelfand writes. Throughout history, communities have put their citizens through the seemingly craziest of rituals for no other reason than to maintain group cohesion and cooperation. The rituals result in greater bonding, which has kept people alive (particularly in times of hunting, foraging, and warfare). +它们也会影响我们的世界观,影响我们构造环境的方式,甚至影响我们大脑的处理过程。 Gelfand 写道:“无数研究表明,社会规范对于将社区团结成合作、协调良好的团体,从而实现伟大成就至关重要。” 纵观历史,社区让其公民参加看似最疯狂的仪式,除了维持群体凝聚力和合作外,别无其他原因。 这些仪式产生了更紧密的联系,使人们得以生存(特别是在狩猎、觅食和战争时期)。 -Social norms include rules we all tend to follow automatically, what Gelfand calls a kind of "normative autopilot." These are things we do without thinking about them—for example, being quiet in libraries, cinemas, elevators, or airplanes. We do these things automatically. "From the outside," Gelfand says, "our social norms often seem bizarre, but from the inside, we take them for granted." She explains that social norms can be codified into regulations and laws ("obey stop signs" and "don't steal"). Others are largely unspoken ("don't stare at people on the train" or "cover your mouth when you sneeze"). And, of course, they vary by context. +社会规范包括我们所有人都会自动遵守的规则, Gelfand 称之为一种 “规范性自动驾驶仪。” 这些是我们不需要思考就能做的事情————例如,在图书馆、电影院、电梯或飞机上保持安静。 我们会自动的做这些事。 “从外面看,” Gelfand 说, “我们的社会规范通常看起来很奇怪。但在内心深处,我们认为这是理所当然的。” 她解释到,社会规范可以被编入法规和法律(“遵守停车标志”和“不要偷窃”)。还有一些基本上是默不作声的(“不要盯着火车上的人看”或“打喷嚏时捂住嘴”)。当然,它们因环境而异。 -The challenge is that most social norms are invisible, and we don't know how much these social norms control us. +挑战在于大多数社会规范都是无形的,我们不知道这些社会规范在多大程度上控制着我们。在不知不觉中,我们常常只是跟随周围的人群。这被称为“群体思维”,在这种思维中,人们会跟随他们认同的群体,即使这个群体是错误的。他们不想站出来。 -The challenge is that most social norms are invisible, and we don't know how much these social norms control us. Without knowing it, we often just follow the groups in our surroundings. This is called "groupthink," in which people will follow along with their identifying group, even if the group is wrong. They don't want to stand out. +### 组织,有松有紧 -### Organizations, tight and loose +Gelfand 将社会规范组织成不同的群体。她认为,一些规范具有“紧密”文化的特征,而另一些规范则具有“松散”文化的特征。为此, Gelfand 对来自五大洲 30 多个国家的约 7000 人进行了研究和抽样,他们的职业、性别、年龄、宗教、教派,以及社会阶层,以了解这些社区将自己定位在何处(以及他们的社会规范在官方和社区/社区总体上的执行力度)。 紧密和松散文化之间的差异在国家之间、国家内部(如美国及其各个地区)、组织内部、社会阶层内部甚至家庭内部都有所不同。 -Gelfand organizes social norms into various groupings. She argues that some norms are characteristic of "tight" cultures, while others are characteristic of "loose" cultures. To do this, Gelfand researched and sampled approximately seven thousand people from more than 30 countries across five continents and with a wide range of occupations, genders, ages, religions, sects, and social classes in order to learn where those communities positioned themselves (and how strongly their social norms were enforced officially and by the communities/neighborhoods in general). Differences between tight and loose cultures vary between nations, within countries (like within the United States and its various regions), within organizations, within social classes and even within households. +因为组织有文化,它们也有自己的社会规范(毕竟,如果一个组织无法协调其成员并影响其行为,它将无法生存)。 因此,组织也可以反映和灌输 Gelfand 所描述的轻松”或“松散”的文化特征。 并且如果我们有很强的能力识别这些差异,我们就能更成功地预测和解决冲突。然后,在对这些社会规范有了更高认识的情况下,我们可以将开放式组织原则付诸实践。 -Because organizations have cultures, they too have their own social norms (after all, if an organization is unable to coordinate its members and influence their behavior, it won't be able to survive). So organizations can also reflect and instill the "light" or "loose" cultural characteristics Gelfand describes. And if we have a strong ability to identify these differences, we can predict and address conflict more successfully. Then, armed with greater awareness of those social norms, we can put open organization principles to work. +Gelfand 这样描述紧密和松散文化的区别: -Gelfand describes the difference between tight and loose cultures this way: +> 从广义上讲,松散的文化倾向于开放,但它们也更加无序。另一方面,紧密的文化有令人欣慰的秩序和可预测性,但它们的容忍度较低。这就是紧-松的权衡:一个领域的优势与另一个领域的劣势并存。 -> Broadly speaking, loose cultures tend to be open, but they're also much more disorderly. On the flip side, tight cultures have a comforting order and predictability, but they're less tolerant. This is the tight-loose trade-off: advantages in one realm coexist with drawbacks in another. - -Tight societies, she concludes, maintain strict social order, synchrony and self-regulation; loose societies take pride in being highly tolerant, creative and open to change. - -Although not true in every case, tight and loose cultures generally exhibit some trade-offs; each has its own strengths and weaknesses. See Figure 1 below. +她总结说,紧密的社会保持着严格的社会秩序、同步性和自律性;宽松的社会以高度宽容、富有创造力和对变化持开放态度而自豪。 +虽然并非所有情况都是如此,但紧密和松散的文化通常会表现出一些权衡;每个人都有自己的长处和短处。参见下面的图 1 。 ![][5] -The work of successfully applying the five open organization principles in these two environments can vary greatly. To be successful, community commitment is vital, and if the social norms are different, the reasons for commitment would be different as well. Organizational leaders must know what the community's values are. Only then can that person adequately inspire others. +在这两种环境中成功应用五项开放式组织原则的工作可能会有很大的不同。要取得成功,社区承诺至关重要,如果社会规范不同,承诺的原因也会不同。组织领导者必须知道社区的价值观是什么。只有这样,这个人才能充分激励他人。 -In the next part of this review, I'll explain more thoroughly the characteristics of tight and loose cultures, so leaders can get a better sense of how they can put open organization principles to work on their teams. +在本综述的下一部分中,我将更彻底地解释紧密文化和松散文化的特征,以便领导者能够更好地了解如何将开放式组织原则运用到团队中。 -------------------------------------------------------------------------------- From 53aea13e4f2da9cf4b2dc2b177321550a2c2dd94 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Sep 2021 05:03:10 +0800 Subject: [PATCH 102/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210903=20?= =?UTF-8?q?Install=20ONLYOFFICE=20Docs=20on=20Fedora=20Linux=20with=20Podm?= =?UTF-8?q?an=20and=20connect=20it=20with=20Nextcloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210903 Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud.md --- ...th Podman and connect it with Nextcloud.md | 211 ++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 sources/tech/20210903 Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud.md diff --git a/sources/tech/20210903 Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud.md b/sources/tech/20210903 Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud.md new file mode 100644 index 0000000000..10d78e60bd --- /dev/null +++ b/sources/tech/20210903 Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud.md @@ -0,0 +1,211 @@ +[#]: subject: "Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud" +[#]: via: "https://fedoramagazine.org/instal-onlyoffice-docs-on-fedora-linux-with-podman/" +[#]: author: "kseniya_fedoruk https://fedoramagazine.org/author/kseniya_fedoruk/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud +====== + +![][1] + +Photo by [Chris Leggat][2] on [Unsplash][3] + +If you need a reliable office suite for online editing and collaboration within your sync & share platform, you can try ONLYOFFICE Docs. In this tutorial, we learn how to install it on your Fedora Linux with Podman and discover the ONLYOFFICE-Nextcloud integration. + +### What is ONLYOFFICE Docs + +[ONLYOFFICE Docs][4] (Document Server) is an open-source office suite distributed under GNU AGPL v3.0. It is comprised of web-based viewers and collaborative editors for text documents, spreadsheets, and presentations. The suite is highly compatible with OOXML formats (docx, xlsx, pptx). + +A brief features overview includes: + + * Full set of editing and styling tools, operations with fonts and styles, paragraph and text formatting. + * Inserting and customizing all kinds of objects: shapes, charts, text art, text boxes, etc. + * Academic formatting and navigation: endnotes, footnotes, table of contents, bookmarks. + * Content Controls for creating digital forms and templates. + * Extending functionality with plugins, building your own plugins using API. + * Collaborative features: real-time and paragraph-locking co-editing modes, review and track changes, comments and mentions, integrated chat, version history. + * Flexible access permissions: edit, view, comment, fill forms, review, restriction on copying, downloading, and printing, custom filter for spreadsheets. + + + +![][5] + +You can integrate ONLYOFFICE Docs with various cloud services such as Nextcloud, ownCloud, Seafile, Alfresco, Plone, etc. What’s more, developers can embed the editors into their own solutions.  + +You can also use the suite together with [ONLYOFFICE Groups][6], a free open-source collaboration platform distributed under Apache 2.0. The complete solution is available as [ONLYOFFICE Workspace.][7] + +### What is Podman + +Podman is a daemonless container engine for developing, managing, and running OCI containers on your Linux system. Users can run containers either as root or in rootless mode.  + +It is available by default on Fedora Workstation. If it’s not the case, install podman with the command: + +``` +sudo dnf install podman +``` + +### What you need for ONLYOFFICE Docs installation + + * CPU: single core 2 GHz or better + * RAM: 2 GB or more + * HDD: at least 40 GB of free space + * At least 4 GB of swap + + + +### Install and run ONLYOFFICE Docs + +Start with the following commands for the root-privileged deployment. This creates directories for mounting from the container to the host system: + +``` +$ sudo mkdir -p /app/onlyoffice/DocumentServer/logs \ + /app/onlyoffice/DocumentServer/data \ + /app/onlyoffice/DocumentServer/lib \ + /app/onlyoffice/DocumentServer/db +``` + +Now mount these directories via podman. When prompted, select the image from docker.io): + +``` +$ sudo podman run -i -t -d -p 80:80 -p 443:443 --restart=always \ + -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice:Z \ + -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data:Z \ + -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice:Z \ + -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql:Z \ + -u root onlyoffice/documentserver:latest +``` + +Please note that rootless deployment is NOT recommended for ONLYOFFICE Docs. + +To check that ONLYOFFICE is working correctly, run: + +``` +$ sudo podman exec $(sudo podman ps -q) sudo supervisorctl start ds:example +``` + +Then, open  and click the word “here” in the line _Once started the example will be available here_. Or look for the orange “button” that says “GO TO TEST EXAMPLE”. This opensthe test example where you can create a document. + +Alternatively, to install ONLYOFFICE Docs, you can build an image in podman: + +``` +$ git clone https://github.com/ONLYOFFICE/Docker-DocumentServer.git +$ cd Docker-DocumentServer/ +$ sudo podman build --tag oods6.2.0:my -f ./Dockerfile +``` + +Or build an image from the Docker file in buildah (you need root access): + +``` +$ buildah bud --tag oods6.2.0buildah:mybuildah -f ./Dockerfile +``` + +### Activate HTTPS + +To secure the application via SSL basically two things are needed: + + * Private key (.key) + * SSL certificate (.crt) + + + +So you need to create and install the following files: + +``` +/app/onlyoffice/DocumentServer/data/certs/onlyoffice.key +/app/onlyoffice/DocumentServer/data/certs/onlyoffice.crt +``` + +You can get certificates in several ways depending on your requirements: buy from certification centers, request from [Let’s Encrypt,][8] or create a [self-signed certificate][9] through OpenSSL (note that self-signed certificates are not recommended for production use). + +Secure ONLYOFFICE Docs switching to the HTTPS protocol: + +``` +$ sudo mkdir /app/onlyoffice/DocumentServer/data/certs +$ sudo cp onlyoffice.crt /app/onlyoffice/DocumentServer/data/certs/ +$ sudo cp onlyoffice.key /app/onlyoffice/DocumentServer/data/certs/ +$ sudo chown -R 100108:100111 /app/onlyoffice/DocumentServer/data/certs/ +# find the podman container id +$ sudo podman ps -a +# restart the container to use the new certificate +$ sudo podman restart {container_id} +``` + +Now you can integrate ONLYOFFICE Docs with the platform you already use and start working with your documents. + +### ONLYOFFICE-Nextcloud integration example + +To connect ONLYOFFICE Docs and Nextcloud (or any other DMS), you need a connector. This is an integration app that functions like a bridge between two services.   + +In case you’re new to Nextcloud, you can install it with Podman following [this tutorial][10].    + +If you already have Nextcloud installed, you just need to install and activate the connector. Do this with the following steps: + + 1. launch your Nextcloud as an admin, + 2. click your user icon in the upper right corner, + 3. switch to + Apps, + 4. find ONLYOFFICE in the list of available applications in the section “Office & text”, + 5. click the Download and enable button.  + + + +ONLYOFFICE now appears in the Active apps section and you can go ahead with the configuration.  + +Select your user icon again in the upper right corner -> Settings -> Administration -> ONLYOFFICE. On the settings page, you can configure: + + * The address of the machine with ONLYOFFICE installed + * Secret key (JWT that protects docs from unauthorized access) + * ONLYOFFICE and Nextcloud addresses for internal requests + + + +![][11] + +You can also adjust additional settings which are not mandatory but will make your user experience more comfortable: + + * Restrict access to the editors to user groups + * Enable/disable the Open file in the same tab option + * Select file formats that will be opened by default with ONLYOFFICE + * Customize editor interface + * Enable watermarking + + + +![][12] + +### Conclusion + +Installing ONLYOFFICE Docs on Fedora Linux with Podman is quite easy. It will give you a powerful office suite for integration into any Document Managemet System. +``` + +``` + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/instal-onlyoffice-docs-on-fedora-linux-with-podman/ + +作者:[kseniya_fedoruk][a] +选题:[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/kseniya_fedoruk/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/onlyoffice-podman-nextcloud-816x345.jpg +[2]: https://unsplash.com/@chris_legs?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/sharing-writing?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://www.onlyoffice.com/office-suite.aspx +[5]: https://fedoramagazine.org/wp-content/uploads/2021/07/ONLYOFFICE-Docs-dark-theme-1024x585.png +[6]: https://www.onlyoffice.com/collaboration-platform.aspx +[7]: https://www.onlyoffice.com/workspace.aspx +[8]: https://letsencrypt.org/ +[9]: https://www.server-world.info/en/note?os=Fedora_31&p=ssl&f=1 +[10]: https://fedoramagazine.org/nextcloud-20-on-fedora-linux-with-podman/ +[11]: https://fedoramagazine.org/wp-content/uploads/2021/07/1-server-settings-1024x611.png +[12]: https://fedoramagazine.org/wp-content/uploads/2021/07/nc-settings-1-1024x574.png From 5878db0a6e5bd9b2da00dc8bf3e0b0a4a6876f68 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Sep 2021 05:03:30 +0800 Subject: [PATCH 103/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210904=20?= =?UTF-8?q?How=20to=20Install=20Dropbox=20on=20Ubuntu=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md --- ... How to Install Dropbox on Ubuntu Linux.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md diff --git a/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md b/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md new file mode 100644 index 0000000000..4b1d7195ad --- /dev/null +++ b/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md @@ -0,0 +1,116 @@ +[#]: subject: "How to Install Dropbox on Ubuntu Linux" +[#]: via: "https://itsfoss.com/install-dropbox-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install Dropbox on Ubuntu Linux +====== + +Dropbox is one of the [most popular cloud storage services available for Linux][1] and other operating systems. + +In fact, Dropbox is one of the earliest services to provide a native Linux application. It still [supports 32-bit Linux systems][2] that is also a commendable job. + +In this beginner’s tutorial, I’ll show the steps for installing Dropbox on Ubuntu. The steps are really simple but some websites make it unnecessarily complicated. + +### Install Dropbox on Ubuntu desktop + +Let’s see the installation procedure, step by step. + +#### Step 1: Get Dropbox installer for Ubuntu + +Dropbox offers DEB files for its installer. Go to the download section of its website: + +[Dropbox Download][3] + +And download the appropriate DEB file. Considering that you are using 64 bit Ubuntu, get the deb file for 64-bit version. + +![Download the Dropbox installer][4] + +#### Step 2: Install Dropbox installer + +The deb file you downloaded is just an installer for Dropbox. Actual Dropbox installation starts later, similar to [installing Steam on Ubuntu][5]. + +To [install the downloaded deb file][6], either double click on it or right click and select open with Software Install. + +![Installing the downloaded Dropbox deb file][7] + +It will open the software center and you can click the install button. + +![Installing Dropbox deb file][8] + +Wait for the installation to finish. + +#### Step 3: Start Dropbox installation + +Dropbox installer is now installed. Press the Windows key (also known as super key) and search for Dropbox and click on it. + +![Start Dropbox for installation][9] + +On the first launch, it shows two popups. One about restarting Nautilus (the file explorer in Ubuntu) and the other about Dropbox installation. + +![Starting Dropbox installation][10] + +Clicking either Restart Nautilus/Close (on the Nautilus popup) or OK (on the installation popup) starts the actual Dropbox client download and installation. If the ‘Nautilus Restart’ does not close on clicking Close button, click the x button. + +Wait for the Dropbox installation to finish. + +![Installing Dropbox][11] + +Oh! Nautilus restart is required because Dropbox adds some extra features like showing the synchronization status in the file explorer. + +Once Dropbox is installed, it should either take you to the Dropbox login page automatically or you can hit the Dropbox icon at the top and select sign in option. + +![Sign in to Dropbox after installation][12] + +In fact, this is how you would be accessing Dropbox settings in the future. + +#### Step 4: Start using Dropbox on Ubuntu + +![Sign in into Dropbox][13] + +**Note**: Dropbox won’t work until you successfully sign in. Here’s a catch. The free version of Dropbox limits the number of devices you can link to your account. **If you already have 3 linked devices, you should remove some of the older ones that you do not use.** + +Once you are successfully signed in, you should see a Dropbox folder created in your home directory and your files from the cloud starts appearing here. + +![Dropbox folder is created under home directory][14] + +If you want to save disk space or bandwidth, you can go to the Preferences and choose the Selective Sync option. The selective sync option allows you only sync selected folders from Dropbox cloud on your local system. + +![Using selective sync in Dropbox][15] + +Dropbox automatically starts at each boot. This is the behavior you should expect from any cloud service, I believe. + +That’s all you need to get started with Dropbox on Ubuntu. I hope you find this tutorial helpful. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-dropbox-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/cloud-services-linux/ +[2]: https://itsfoss.com/32-bit-linux-distributions/ +[3]: https://www.dropbox.com/install-linux +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/get-dropbox-for-ubuntu.png?resize=800%2C294&ssl=1 +[5]: https://itsfoss.com/install-steam-ubuntu-linux/ +[6]: https://itsfoss.com/install-deb-files-ubuntu/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/dropbox-installer-ubuntu.png?resize=797%2C476&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-dropbox-deb-file.png?resize=800%2C346&ssl=1 +[9]: https://itsfoss.com/wp-content/uploads/2021/09/start-drobox-ubuntu.webp +[10]: https://itsfoss.com/wp-content/uploads/2021/09/starting-dropbox-installation-800x599.webp +[11]: https://itsfoss.com/wp-content/uploads/2021/09/installing-dropbox.webp +[12]: https://itsfoss.com/wp-content/uploads/2021/09/sign-in-to-dropbox-after-first-installation.webp +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/sign-in-dropbox.png?resize=800%2C409&ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/dropbox-folder-ubuntu.png?resize=800%2C491&ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Dropbox-selective-sync.png?resize=800%2C399&ssl=1 From 59ccf6a854709ec0429217abe8e707d18e7edc8d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Sep 2021 05:03:52 +0800 Subject: [PATCH 104/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210903=20?= =?UTF-8?q?Monitor=20your=20Linux=20server=20with=20Checkmk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210903 Monitor your Linux server with Checkmk.md --- ... Monitor your Linux server with Checkmk.md | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 sources/tech/20210903 Monitor your Linux server with Checkmk.md diff --git a/sources/tech/20210903 Monitor your Linux server with Checkmk.md b/sources/tech/20210903 Monitor your Linux server with Checkmk.md new file mode 100644 index 0000000000..d35d7e7611 --- /dev/null +++ b/sources/tech/20210903 Monitor your Linux server with Checkmk.md @@ -0,0 +1,191 @@ +[#]: subject: "Monitor your Linux server with Checkmk" +[#]: via: "https://opensource.com/article/21/8/monitor-linux-server-checkmk" +[#]: author: "Ferdinand https://opensource.com/users/ferdinand-kunz" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Monitor your Linux server with Checkmk +====== +Install Checkmk, the monitoring tool from tribe29, to monitor servers +and network devices +![People work on a computer server with devices][1] + +Monitoring IT assets is an essential task for any IT department. Still, due to the growing number of devices in corporate networks, it is getting more and more challenging to find an approach that is flexible enough to monitor the wide range of available systems properly. It's essential to have a monitoring tool that is flexible, scalable, and easy to use. + +In this article, I demonstrate how to install [Checkmk][2], the monitoring tool from [tribe29][3], and how to monitor servers and network devices with it. + +### Install Checkmk on Linux + +For this article, I use the [Checkmk Raw Edition,][4] the community GPLv2 edition (the enterprise edition has extra features and paid support), and installing it on a Linux server. Checkmk runs on Linux, including RHEL, CentOS, Debian, and others, as well as in a container, or as a virtual appliance. You can download the latest Checkmk version for all platforms from the official [Checkmk website][2].  + +### Getting started + +It doesn't take long to get started because Checkmk already supports most monitoring use cases thanks to its almost 2,000 plug-ins. Checkmk also provides preconfigured thresholds for alerts and warnings, so you don't have to waste time configuring these yourself, and of course, you can customize these as required.  + +Besides these official integrations, you can also use monitoring expansions created and shared by other users on the [Checkmk Exchange][5]. If you want to know more about the Checkmk tool or contribute to it, you can check out the [GitHub repository][6]. + +This tutorial does not require any monitoring experience. If you do want to follow this procedure, though, you must have root access to the server you're using as the host.  + +#### Select and download the Checkmk Raw Edition + + 1. [Download][7] either the Checkmk Raw Edition (it's free and open source) or the Checkmk Free Edition* *of the Enterprise Edition. + + 2. Next, send the installer file to the server you want to host Checkmk on. I use the scp command. In this tutorial, the IP address for my host is 10.0.2.15. [code]`$ scp check-mk-raw-X.Y.Zp8_0.focal_amd64.deb tux@10.0.2.15:/tmp` +``` +All further actions in this tutorial are performed on the host server.  + + 3. Log in to your host using `ssh`. [code]`​$ ssh tux@10.0.2.15` +``` + + + + +#### Install the Checkmk package  + + 1. Now you must install the package including all of its dependencies. This can be done with your distribution's package manager, such as `apt` or `dnf`: [code]`​$ sudo apt install /tmp/check-mk-raw-X.Y.Zp8_0.focal_amd64.deb` +``` +2. Once the installation is complete, you can perform a test using the `omd` command. [code]`​$ omd version` +``` + + + +The `omd` command for [Open Monitoring Distribution][8] is an open source project created by Mathias Kettner, the founder of Checkmk. It helps you install a monitoring solution assembled from various open source components.  + +#### Create a Checkmk monitoring site + + 1. The next step is to start an initial monitoring site (a "site" is an _instance_). Use `omd create` to create a new Checkmk site and name it as you wish. In this example, I use `checkmk_demo`. [code]`$ sudo omd create checkmk_demo` +``` +2. As a response, you're provided with helpful information about how to start and access your Checkmk site. You could follow the steps to change your admin password right now, but I prefer to do that in the Checkmk user interface. So, for now, copy the randomly generated password (you need it in the next step) and start your monitoring site. [code]`$ sudo omd start checkmk_demo` +``` + + + +Should you want to drill deeper into Checkmk later on, it is important to understand what has just taken place. + + * You created a new user, known as the _site user_, and a group with the site's name on your server. + * A directory for the site has been created under `/omd/sites`, (for example, `/omd/sites/checkmk_demo`). +Checkmk also copied its default configuration into the new directory. + * A user with the name _cmkadmin_ was created for the Checkmk web interface.  + + + +#### Start monitoring with Checkmk + +It's time to switch to the Checkmk user interface in your web browser. Every Checkmk site has its own URL, composed of the IP address or hostname of your monitoring server and the name of the Checkmk site. In this example, my Checkmk install is located at _monitoring-host-server/checkmk_demo/_. + + 1. Open the link to your Checkmk site in your browser. You can open the link shown on your terminal. + 2. Log in as the _cmkadmin_ user, using the password you copied from the terminal. +Once you're logged in, you see an empty dashboard. + 3. Click on the **User** category in the sidebar on the left, and then click on **Change password** under **Profile**. Here, you can change your password. + + + +### Monitoring setup + +Checkmk supports several ways of monitoring servers, and the best method for server monitoring is usually by using the Checkmk agents. Before adding a server, you need to install the agent.  + + 1. In the sidebar on the left, click **Setup** (the button with a gearwheel). +This is the control panel where you perform all of the configurations and find monitoring agents. There are some UI differences between the Raw Edition and the Enterprise Edition, but all screenshots in this article are from the open source Raw Edition. + + 2. Click on **Agents** and select the appropriate package for your operating system. +The packaged agents for Linux are provided in both RPM and DEB file formats. + +![Select an agent][9] + +(Ferdinand Kunz, [CC-BY SA 4.0][10]) + + 3. Download and install the agent on your monitoring host. + + + + +You can test whether the agent works correctly by executing the `check_mk_agent` command in the terminal on your server. + +### Adding a host + +Once the agent has been installed, return to the **Setup** screen and select **Hosts**.  + + 1. Click on **Add host**.  + + 2. Add the name of your server under **Hostname***. * +If you have DNS set up in your network, Checkmk resolves the IP address for your hostname automatically. Otherwise, add the IP address by clicking the checkbox next to** IPv4 Address**. If you add an IP address, you can choose any hostname you like. Leave the other areas unchanged. +  + +![Add host][11] + +(Ferdinand Kunz, [CC-BY SA 4.0][10]) + + 3. Click on **Save & go to service configuration**. Checkmk now automatically discovers any relevant monitoring services on that host and lists them as _Undecided services_. Also, as you can see in the screenshot, Checkmk automatically adds labels depending on the type of device. + + 4. Click on **Fix all*** _to monitor all of these. This adds all detected services and host labels to your monitoring dashboard and removes services that have vanished. Of course, you can manage the services manually, but the_* Fix all **function makes it a lot easier.  + +![Host monitoring fix all][12] + +(Ferdinand Kunz, [CC-BY SA 4.0][10]) + + 5. Next, activate your changes by clicking on the highlighted field with the yellow exclamation point (**!)** at the top right corner. Click on **Activate on selected sites**, and you've successfully added the first server to your monitor. + + + + +Requiring explicit activation for changes is a safety mechanism. All changes made are listed first under **Pending changes** so you can review any changes before they affect your monitoring. Checkmk differentiates between _Setup_ as a configuration environment, in which you manage the hosts, services, and settings, and the area called _Monitor_, in which the actual operational monitoring takes place. New hosts and other changes in the configuration initially do not affect the monitoring. You must activate these before they go into production.  + +### SNMP monitoring + +Besides server monitoring, another essential monitoring task is network monitoring. As an example, I would like to show you how to monitor a switch over SNMP. All you need to do is make sure the SNMP agent on the device you aim to monitor is activated and that your Checkmk server can reach this device. + + 1. Go to _**Setup > Hosts**_ and click on **Add host**. + + 2. Type in the hostname and the IP address (as needed). +By default, Checkmk assumes you use a Checkmk agent, so you need to edit that under **Monitoring agents**.  + + 3. Activate the check box next to _SNMP_ and switch the box to your SNMP version (very likely ʻSNMP v2 or v3ʼ). +Checkmk also assumes by default that your SNMP Community is _public_ because it is also the default on most SNMP devices. If that is the case, you can leave the box _SNMP credentials_ unchecked (like I have). Otherwise, you have to check this box and add your SNMP credentials here.  + +![Add SNMP host][13] + +(Ferdinand Kunz, [CC-BY SA 4.0][10]) + + 4. As before, click on **Save & go to service configuration**, and Checkmk discovers all of the currently online interfaces, the uptime, and the SNMP Info check. +If a monitoring plug-in for a particular type of device exists, Checkmk detects more monitoring services automatically.  + + 5. Click on **Fix all** and accept the changes. + + + + +### Happy monitoring + +Now you will have your Checkmk site up and running and have added two hosts. This tutorial ends here, but your real monitoring experience has only just started. You may have noticed that Checkmk provides agents for almost all operating systems so that you can add more hosts. The procedure is similar to other systems. Checkmk also supports SNMP, IPMI, HTML, and many other standards, so you always have an efficient method available for monitoring a particular system. Have a look at the [Checkmk][14] [handbook][14], as well as in the [official Checkmk forum][15]. Happy monitoring! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/monitor-linux-server-checkmk + +作者:[Ferdinand][a] +选题:[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/ferdinand-kunz +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices) +[2]: https://checkmk.com/ +[3]: https://tribe29.com/ +[4]: https://checkmk.com/product/raw-edition +[5]: https://exchange.checkmk.com/ +[6]: https://github.com/tribe29/checkmk +[7]: https://checkmk.com/download?edition=cre&version=stable&dist=ubuntu&os=focal +[8]: https://checkmk.com/guides/open-monitoring-distribution +[9]: https://opensource.com/sites/default/files/uploads/checkmk_agent.png (Select an agent) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[11]: https://opensource.com/sites/default/files/uploads/checkmk_hosts.png (Add host) +[12]: https://opensource.com/sites/default/files/uploads/checkmk_fix-all.png (Host monitoring fix all) +[13]: https://opensource.com/sites/default/files/uploads/checkmk_add-host-snmp.png (Add SNMP host) +[14]: https://docs.checkmk.com/latest/en/ +[15]: https://forum.checkmk.com/ From d1358ae8f27bca92714ca06fcc9b41498e50c677 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Sep 2021 05:04:09 +0800 Subject: [PATCH 105/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210903=20?= =?UTF-8?q?Print=20files=20from=20your=20Linux=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210903 Print files from your Linux terminal.md --- ...03 Print files from your Linux terminal.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20210903 Print files from your Linux terminal.md diff --git a/sources/tech/20210903 Print files from your Linux terminal.md b/sources/tech/20210903 Print files from your Linux terminal.md new file mode 100644 index 0000000000..e105539732 --- /dev/null +++ b/sources/tech/20210903 Print files from your Linux terminal.md @@ -0,0 +1,161 @@ +[#]: subject: "Print files from your Linux terminal" +[#]: via: "https://opensource.com/article/21/9/print-files-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Print files from your Linux terminal +====== +To print a file from your terminal, use the lpr command. +![Typewriter with hands][1] + +[Printing on Linux is easy][2], but sometimes it feels like a lot of work to launch an application, open a file, find the **Print** selection in the menu, click a confirmation button, and so on. When you're a Linux terminal user, you often want to perform complex actions with simple triggers. Printing is complex, and there's little as simple as the `lpr` command. + +### Print using the lpr command + +To print a file from your terminal, use the `lpr` command: + + +``` +`$ lpr myfile.odt` +``` + +Should that fail, you need to set a default printer or specify a printer manually. + +### Setting a default printer + +According to my well-worn copy of a Berkeley 4.2 manual printed in 1984, the `lpr` command paginated and sent a file to a printer spool, which streamed data to something called a _line printer_. + +![book page displaying lpr command information][3] + +The lpr command. + +These days, the actual `lpr` command is insufficient because modern computers are likely to have access to several printers, and certainly to printers a lot more complex than a dot-matrix line printer. Now there's a subsystem, called the Common Unix Printing System (CUPS), to keep track of all the printers that you want your computer to access, which driver your computer should use to communicate with each printer, which printer to use by default, and so on. The `lpr.cups` or `lpr-cups` commands, bundled with CUPS and usually symlinked to `lpr`, allow you to print from a terminal by referencing your Common Unix Printing System (CUPS) configuration first. + +To print a file with `lpr`, you should first set a default printer. You can set a default printer in your system's printer settings: + +![dialog box to set default printer][4] + +Set a default printer. + +Alternately, you can mark a printer as the default with the `lpadmin` command: + + +``` +$ sudo lpadmin -d HP_LaserJet_P2015_Series +$ lpstat -v +device for HP_LaserJet_P2015_Series: ipp://10.0.1.222:631/printers/HP_LaserJet_P2015_Series +``` + +### Setting a default destination with environment variables + +You aren't permitted to set your own default printer on systems you don't have an admin account on because changing print destinations is considered a privileged task. Before `lpr` references CUPS for a destination, it queries your system for the **PRINTER** [environment variable][5]. + +In this example, `HP_LaserJet_P2015_Series` is the human-readable name given to the printer. Set **PRINTER** to that value: + + +``` +$ PRINTER=HP_LaserJet_P2015_Series +$ export PRINTER +``` + +Once the **PRINTER** variable has been set, you can print: + + +``` +`$ lpr myfile.pdf` +``` + +### Get a list of attached printers + +You can see all the printers that are accepting print jobs and that are attached to your system with the `lpstat` command: + + +``` +$ lpstat -a +HP_LaserJet_P2015_Series accepting requests since Sun 1 Aug 2021 10:11:02 PM NZST +r1060 accepting requests since Wed 18 Aug 2021 04:43:57 PM NZST +``` + +### Printing to an arbitrary printer + +Once you have added printers to your system, and now that you know how to identify them, you can print to any one of them, whether you have a default destination set or not: + + +``` +`$ lpr -P HP_LaserJet_P2015_Series myfile.txt` +``` + +### How printers are defined + +CUPS has a user-friendly front-end accessible through a web browser such as Firefox. Even though it uses a web browser as its user interface, it's actually a service running locally on your computer (a location called **localhost**) on port 631. CUPS manages printers attached to your computer, and it stores its configuration in `/etc/cups/printers.conf`. + +The `printers.conf` file consists of definitions detailing the printing devices your computer can access. You're not meant to edit it directly, but if you do, then you must stop the `cupsd` daemon first. + +A typical entry looks something like this: + + +``` +<Printer r1060> +  Info Ricoh 1060 +  Location Downstairs +  MakeModel Ricoh Aficio 1060 - CUPS+Gutenprint v5.2.6 +  DeviceURI lpd://192.168.4.8 +  State Idle +  StateTime 1316011347 +  Type 12308 +  Filter application/vnd.cups-raw 0 - +  Filter application/vnd.cups-raster 100 rastertogutenprint.5.2 +  Accepting Yes +  Shared No +  JobSheets none none +  QuotaPeriod 0 +  PageLimit 0 +  KLimit 0 +  OpPolicy default +  ErrorPolicy stop-printer +</Printer> +``` + +In this example, the printer's name is `r1060`, a human-readable identifier for a Ricoh Aficio 1060. + +The _MakeModel_ attribute is pulled from the `lpinfo` command, which lists all available printer drivers on your system. Assuming you know that you have a Ricoh Aficio 1060 that you want to print to, then you would issue this command: + + +``` +$ lpinfo -m | grep 1060 +gutenprint.5.2://brother-hl-1060/expert Brother HL-1060 - CUPS+Gutenprint v5.2.11 +gutenprint.5.2://ricoh-afc_1060/expert Ricoh Aficio 1060 - CUPS+Gutenprint v5.2.11 +``` + +This command lists the relevant drivers you have installed. + +The _MakeModel_ is the last half of the result. In this example, that's `Ricoh Aficio 1060 - CUPS+Gutenprint v5.2.11`. + +The _DeviceURI_ attribute identifies where the printer is found on the network (or physical location, such as the USB port). In this example, the _DeviceURI_ is `lpd://192.168.4.8` because I'm using the `lpd` (line printer daemon) protocol to send data to a networked printer. On a different system, I have an HP LaserJet attached by a USB cable, so the _DeviceURI_ is DeviceURI `hp:/usb/HP_LaserJet_P2015_Series?serial=00CNCJM26429`. + +### Printing from the terminal + +Sending a job to a printer is an easy process, as long as you understand the devices attached to your system and how to identify them. Printing from the terminal is fast, efficient, and easily scripted or done as a batch job. Try it out! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/print-files-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/typewriter-hands.jpg?itok=oPugBzgv (Typewriter with hands) +[2]: https://opensource.com/article/21/8/setup-your-printer-linux +[3]: https://opensource.com/sites/default/files/berkeley-1984-lpr.jpeg +[4]: https://opensource.com/sites/default/files/printer-default.jpeg +[5]: https://opensource.com/article/19/8/what-are-environment-variables From ca0a7dc617f27602b34bcf30a3da14089b2ae2bf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Sep 2021 08:15:18 +0800 Subject: [PATCH 106/138] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @anine09 感谢您,完成了第一篇翻译贡献! --- ... After Installing elementary OS 6 -Odin.md | 119 ++++++++---------- 1 file changed, 52 insertions(+), 67 deletions(-) diff --git a/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md index 51e3e2fe86..bb431076f8 100644 --- a/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md +++ b/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md @@ -2,36 +2,37 @@ [#]: via: "https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lujun9972" -[#]: translator: " anine09" -[#]: reviewer: " " +[#]: translator: "anine09" +[#]: reviewer: "wxy" [#]: publisher: " " - [#]: url: " " -安装elementary OS 6 “Odin”后要做的 10 件事 +安装 elementary OS 6 “Odin” 后要做的 10 件事 ====== -一个关于安装 elementary OS 6 “Odin” 后要做的事情的列表。 +> 一个精心准备的在安装 elementary OS 6 “Odin” 后要做的事情的列表。 -在经过两年多的开发后 [elementary OS 6 “Odin”][1] 于不久前发布,此次版本更新在核心模块、 Pantheon 桌面、本地应用中引入了一系列变化巨大的新特性,elementary OS 6 “Odin” 基于 Ubuntu 20.04 LTS。 +![](https://img.linux.net.cn/data/attachment/album/202109/04/081345bf9co7ot40szdytg.jpg) -也就是说,如果你完成了安装,你可能想要尝试通过一些特定的设置来使你的系统更加的个性化。这里描述的选项是通用的,在某些情况下可能对你无效,但是我们觉得有必要列出一些基础知识,让你有合适的方式来探索这个漂亮的 elementary OS。 +在经过两年多的开发后 [elementary OS 6 “Odin”][1] 于不久前发布,此次版本更新在核心模块、 Pantheon 桌面、原生应用方面带来了一大批新特性。elementary OS 6 “Odin” 是基于 Ubuntu 20.04 LTS 的。 + +如果你完成了安装,你可能想要尝试通过一些特定的设置来使你的系统更加的个性化。这里描述的选项是通用的,在某些情况下可能对你没有用,但是我们觉得有必要列出一些基本的东西,让你有合适的方式来探索这个漂亮的 elementary OS。 ### 安装完 elementary OS 6 “Odin” 后要做的事情 -***准备步骤*** +准备步骤: 首先确保你已经连上了互联网,你可以在顶部的通知区域查看可用的网络列表 -#### 1\. 更改 hostname +#### 1、更改主机名 -这可能不是你想做的第一件事。但是我不知道为什么在安装过程中没有给出更改 hostname 的选项。例如,见下图的终端提示, 这个 hostname 是 elementary OS 的默认硬件配置。在我看来这一点都不好。 +这可能不是你想做的第一件事。但是我不知道为什么在安装过程中没有给出更改主机名的选项。例如,见下图的终端提示, 这个主机名是 elementary OS 的默认硬件配置。在我看来这一点都不好。 -![hostname 修改之前][2] +![主机名修改之前][2] -打开终端并运行下列命令以更改 hostname +打开终端并运行下列命令以更改主机名: -```bash +``` hostnamectl set-hostname your-new-hostname ``` @@ -41,57 +42,53 @@ hostnamectl set-hostname your-new-hostname ![hostname 修改之后][4] -#### 2\. 升级你的系统 +#### 2、升级你的系统 在安装任何 Linux 发行版后,你应该做的第一件事就是确保系统处于最新的软件包和安全更新状态。 你可以通过打开应用中心来检查或者安装更新。 -或者打开终端运行下列命令。 +或者打开终端运行下列命令: -```bash +``` sudo apt update sudo apt upgrade ``` -#### 3\. 安装 Pantheon Tweaks +#### 3、安装 Pantheon Tweaks Pantheon Tweaks 是 elementary OS 的必备应用。它提供了一些无法通过系统原生设置程序修改的额外的设置和配置选项,请打开终端并运行以下命令以安装 Pantheon Tweaks。注意:先前版本的 Tweak 工具叫做 elementary Tweaks,从 Odin 版本开始更名为 Pantheon Tweaks。 -```bash +``` sudo apt install software-properties-common sudo add-apt-repository -y ppa:philip.scott/pantheon-tweaks sudo apt install -y pantheon-tweaks ``` -安装后打开系统设置,你可以在那里找到 Tweaks 选项。 +安装后打开系统设置,你可以在那里找到 “调整Tweaks” 选项。 -[这里][5] 提供了更详细的安装指南(如果你需要了解更多信息) +[这里][5] 提供了更详细的安装指南(如果你需要了解更多信息)。 -### 4. 配置 Dock - -Dock 是整个桌面的中心。老实说,Dock 中默认包含的应用并不常用,因此你是可以通过以下步骤配置 Dock 中的项目的。 - - * 移除:右键单击并取消 **在 Dock 中驻留** 选项。 - * 添加新的项目:单击顶部的应用程序。然后右键单击你想要放在 Dock 的应用图标。选择 **添加到 Dock**。 +### 4、配置 Dock +Dock 是整个桌面的中心。老实说,Dock 中默认包含的应用并不常用,因此你可以通过以下步骤配置 Dock 中的项目。 + * 移除:右键单击并取消 “在 Dock 中驻留Keep in Dock” 选项。 + * 添加新的项目:单击顶部的应用程序。然后右键单击你想要放在 Dock 的应用图标。选择 “添加到 DockAdd to Dock”。 在我看来,你应该至少把文件管理、截图工具、Firefox 、计算器,以及其他的一些应用添加到 Dock。然后移除 Dock 上那些你不需要的应用。 -#### 5\. 更改外观 +#### 5、更改外观 -elementary OS 6 Odin 改进了桌面的整体外观,为整个桌面和应用程序提供了自带的强调色和原生的夜间模式,同时,系统自带了许多漂亮的壁纸。你可以通过 **应用 > 系统设置 > 桌面** 来定制壁纸、外观、面板和多任务视图。 +elementary OS 6 Odin 改进了桌面的整体外观,为整个桌面和应用程序提供了自带的强调色和原生的夜间模式,同时,系统自带了许多漂亮的壁纸。你可以通过 “应用 > 系统设置 > 桌面” 来定制壁纸、外观、面板和多任务视图。 ![elementary OS 6 Odin 桌面设置界面][6] -按照你希望的样子来配置你系统的外观 - -参见:[elementary OS 6 Odin Promises Complete Dark Style](https://www.debugpoint.com/2020/11/elementary-os-6-odin-dark-style/) +按照你希望的样子来配置你系统的外观。 你也可以基于日出和日落的时间来设置夜间模式。 -#### 6\. 安装其他的应用 +#### 6、安装其他的应用 自带的应用中心非常适合这个系统,我发现它是 Linux 桌面最好的应用商店之一。然而,有时候需要安装没有预装的必要应用(大多数是知名的应用)。下面是个新系统推荐安装的软件列表。(说真的,为什么 LibreOffice 没有预装?) @@ -102,66 +99,54 @@ elementary OS 6 Odin 改进了桌面的整体外观,为整个桌面和应用 * obs-studio * libreoffice +#### 7、一些针对笔记本电脑的省电贴士 +有许多方法可以配置你的 elementary OS(或者一般的 Linux 桌面),以达到延长电池寿命的目的。记住,电池寿命取决于你的笔记本硬件,以及电池和笔记本的使用年限。所以,遵循下面的一些建议,最大限度的利用你的笔记本电池。 -#### 7\. 一些针对笔记本电脑的省电贴士 + * 安装 [tlp][8]。`tlp` 是一个简单易用的命令行程序,用来帮你在 Linux 上延长电池寿命。你只需要安装它,默认情况下,它会处理好其他的设置。安装命令: -有许多方法可以配置你的 elementary OS (或者一般的 Linux 桌面),以达到延长电池寿命的目的。记住,电池寿命取决于你的笔记本硬件,以及电池和笔记本的使用年限。所以,遵循下面的一些建议,最大限度的利用你的笔记本电池。 - - * 安装 [tlp][8]. tlp 是一个简单易用的命令行程序,用来帮你在 Linux 上延长电池寿命。你只需要安装它,默认情况下,它会处理好其他的设置。安装命令: - - - -``` -sudo add-apt-repository ppa:linrunner/tlp -sudo apt update -sudo apt-get install tlp -sudo tlp start -``` + ``` + sudo add-apt-repository ppa:linrunner/tlp + sudo apt update + sudo apt-get install tlp + sudo tlp start + ``` * 关闭蓝牙,默认情况下,蓝牙是开启状态。在需要的时候再启动它。 - * 通过下面的命令安装 thermald。这个实用程序(实际是个守护进程)控制着你的 CPU 的 P-States 和 T-States 的温度以及 CPU 发热。 + * 通过下面的命令安装 `thermald`。这个实用程序(实际是个守护进程)控制着你的 CPU 的 P-States 和 T-States 的温度以及 CPU 发热。 - - -``` -sudo apt install thermald -``` + ``` + sudo apt install thermald + ``` * 根据你的需要将亮度调到最小。 - - -#### 8\. 安装磁盘实用程序 +#### 8、安装磁盘实用程序 在很多情况下,你发现你需要格式化 USB 或者向 USB 中写入一些东西。默认情况下,系统没有安装任何相关的应用。你可以安装以下这些易用的应用。 -``` -gnome-disk-utility -gparted -``` + * gnome-disk-utility + * gparted -#### 9\. 启用最大化和最小化选项 +#### 9、启用最大化和最小化选项 -许多用户喜欢在窗口标题栏左边或者右边使用最大化、最小化的按钮,elementary OS 默认只提供关闭和恢复两个选项。这没什么问题,因为这就是它的设计理念。然而你可以通过使用 Pantheon Tweaks 来开启最大化和最小化按钮,具体的方式是:调整 > 外观 > 窗口控制。 +许多用户喜欢在窗口标题栏左边或者右边使用最大化、最小化的按钮,elementary OS 默认只提供关闭和恢复两个选项。这没什么问题,因为这就是它的设计理念。然而你可以通过使用 Pantheon Tweaks 来开启最大化和最小化按钮,具体的方式是:“调整 > 外观 > 窗口控制”。 ![在 elementary OS 中启动最大化和最小化设置][9] -#### 10\. 在 Odin 中学习新的多点触控手势 +#### 10、在 Odin 中学习新的多点触控手势 -如果你是笔记本用户,并且使用 elementary OS Odin,那么你一定要看看这些超酷的新触控手势。三根手指向上滑动,就会平滑的打开多任务视图,打开应用程序和工作空间。用三根手指向左或向右滑动,就能在动态工作空间之间流畅的切换,使任务之间的额切换更快。 +如果你是笔记本用户,并且使用 elementary OS “Odin”,那么你一定要看看这些超酷的新触控手势。三根手指向上滑动,就会平滑的打开多任务视图,展示打开的应用程序和工作空间。用三根手指向左或向右滑动,就能在动态工作空间之间流畅的切换,使任务之间的切换更快。 -用两根手指也可以再本地应用中实现类似的功能。 +用两根手指也可以在原生应用中实现类似的功能。 ### 结束语 -我希望安装elementary OS 6 Odin 后要做的 10 件事能帮助到你,让你开始使用 elementary OS 6 Odin,尽管这些事情完全是用户的偏好,因此这些事情有可能适合你也有可能不适用于你,但总的来说,这些都是一般用户喜欢的预期调整。 +我希望这篇安装 elementary OS 6 “Odin” 后要做的 10 件事能帮助到你,让你可以上手使用 elementary OS 6 “Odin”,尽管这些事情完全是用户的偏好,因此这些事情有可能适合你也有可能不适用于你,但总的来说,这些都是一般用户喜欢的预期调整。 如果你觉得有更多的东西应该添加到列表中,请在下面的评论中告诉我。 -* * * - -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/ @@ -169,7 +154,7 @@ via: https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary 作者:[Arindam][a] 选题:[lujun9972][b] 译者:[anine09](https://github.com/anine09) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 32acd8522040f24b2dc6d9cbe04f6344beaeb94f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Sep 2021 08:16:23 +0800 Subject: [PATCH 107/138] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @anine09 本文首发:https://linux.cn/article-13749-1.html 您的 LCTT 专页:https://linux.cn/lctt/anine09 --- ... 10 Things to Do After Installing elementary OS 6 -Odin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md (99%) diff --git a/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md similarity index 99% rename from translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md rename to published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md index bb431076f8..bb881f9bc2 100644 --- a/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md +++ b/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "anine09" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13749-1.html" 安装 elementary OS 6 “Odin” 后要做的 10 件事 ====== From a29bb37cc3b61919328e498c3dcaad9bb764b491 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Sep 2021 08:20:15 +0800 Subject: [PATCH 108/138] PRF --- ... 10 Things to Do After Installing elementary OS 6 -Odin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md index bb881f9bc2..b713a04e1a 100644 --- a/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md +++ b/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md @@ -38,9 +38,9 @@ hostnamectl set-hostname your-new-hostname 示例: -![修改 hostname][3] +![修改主机名][3] -![hostname 修改之后][4] +![主机名修改之后][4] #### 2、升级你的系统 From 8608f1ef16eb54161b2dac585a80d60a16c991fa Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Sat, 4 Sep 2021 08:22:34 +0800 Subject: [PATCH 109/138] translating --- .../20210901 20 essential Linux commands for every user.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210901 20 essential Linux commands for every user.md b/sources/tech/20210901 20 essential Linux commands for every user.md index 9bfb9aac60..842dd7aded 100644 --- a/sources/tech/20210901 20 essential Linux commands for every user.md +++ b/sources/tech/20210901 20 essential Linux commands for every user.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/essential-linux-commands" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "unigeorge" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -223,7 +223,7 @@ via: https://opensource.com/article/21/9/essential-linux-commands 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[unigeorge](https://github.com/unigeorge) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2e0a05a9155f36fcf5352e5fbecf343f0025721b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Sep 2021 08:38:10 +0800 Subject: [PATCH 110/138] PRF @geekpi --- ...esting Open-Source Alternative to Slack.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md b/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md index 780348c7c7..185da537b8 100644 --- a/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md +++ b/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md @@ -3,18 +3,20 @@ [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -Zulip:一个有趣的开源的 Slack 替代品 +Zulip:一个不错的开源的 Slack 替代品 ====== -_**简介:** Zulip 是一个开源的协作平台,它把自己定位为 Slack 的一个更好的替代品。让我们仔细看看。_ +> Zulip 是一个开源的协作平台,它把自己定位为一个更好的 Slack 替代品。让我们来了解一下。 + +![](https://img.linux.net.cn/data/attachment/album/202109/04/083746lbheeynx13jmn3xn.jpg) 当涉及到你的工作时,消息和协作平台有很大的不同。 -虽然有几个选择,但 Slack 是许多组织使用的一个流行选择。但是,你可以自托管的 Slack 的开源替代方案如何呢? +虽然有几个选择,但 Slack 是许多组织使用的一个流行选择。但是,可以自托管的 Slack 的开源替代方案如何呢? Zulip 就是这样一个软件。 @@ -22,11 +24,11 @@ Zulip 就是这样一个软件。 ![][1] -如果你想探索,我必须提到还有更多的 [Slack 开源替代品][2]。 +如果你想多了解,我必须提到还有更多的 [Slack 开源替代品][2]。 -在这里,我重点介绍 Zulip。 +但在这里,我重点介绍 Zulip。 -Zulip 是一个免费开源的消息应用,有付费托管选项和自我托管的能力。 +Zulip 是一个自由而开源的消息应用,有付费托管选项和自托管的能力。 它旨在提供与 Slack 类似的体验,同时努力帮助你利用话题提高对话的有效性。 @@ -44,38 +46,36 @@ Zulip 是一个免费开源的消息应用,有付费托管选项和自我托 * 代码块 * 集成 GitHub 来跟踪问题 * 支持电子邮件通知 - * 自我托管选项 + * 自托管选项 * 信息编辑 - * GIPHY 集成 + * 集成 GIPHY * 用 Zoom、Jitsi 或 BigBlueButton 进行视频通话 - - -除了上述功能外,你应该期待你通常在 Slack 和其他方面得到的基本选项。 +除了上述功能外,你可以预期得到你通常在 Slack 和其他方面得到的基本选项。 此外,如果你愿意,你还可以将它与 Matrix 和 IRC 整合。 ![][4] -在我简短的测试使用中,用户界面对于有效的沟通来说是足够好的。然而,我没能找到任何黑暗模式或改变主题的能力。 +在我简短的测试使用中,其用户界面对于有效的沟通来说是足够好的。然而,我没能找到任何黑暗模式或改变主题的能力。 -它看起来比 Slack 更直接,这样可以改善用户体验方面的问题。 +它看起来比 Slack 更简单直白,这样可以改善用户体验方面的问题。 ### 在 Linux 中安装 Zulip -Zulip 在其官方网站上以 AppImage 文件的形式提供。如果你需要帮助,可以参考我们关于[在 Linux 中使用 AppImage][5] 的指南。 +Zulip 在其官方网站上以 AppImage 文件的形式提供。如果你需要帮助,可以参考我们关于 [在 Linux 中使用 AppImage][5] 的指南。 -它也有一个 snap 包。所以,你可以在任何一个 Linux 发行版上使用它们中的任何一个。 +它也有一个 Snap 包。所以,你可以在任何一个 Linux 发行版上使用它们中的任何一个。 -你也可以使用 APT 通过终端为基于 Ubuntu/Debian 的发行版安装它。如果你想这样做,请看它的[官方说明][6]。 +你也可以使用 APT 通过终端为基于 Ubuntu/Debian 的发行版安装它。如果你想这样做,请看它的 [官方说明][6]。 Zulip 可用于 Windows、Mac 和 Linux。你也应该发现它可用于 Android 和 iOS 手机。 -[Zulip][7] +- [Zulip][7] -考虑到你可以在网络、桌面和智能手机上使用 Zulip,它是 Slack 的合适替代品。 +你可以在网络、桌面和智能手机上使用 Zulip,所以可以把它当做 Slack 的合适替代品。 -_你试过了吗?你用什么消息平台来进行工作协作?欢迎在评论中分享你的想法。_ +你试过了吗?你用什么消息平台来进行工作协作?欢迎在评论中分享你的想法。 -------------------------------------------------------------------------------- @@ -84,7 +84,7 @@ via: https://itsfoss.com/zulip/ 作者:[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 fdbebf9cfae985580730d6051504e5f3bd9fdd86 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Sep 2021 08:39:06 +0800 Subject: [PATCH 111/138] PRF&PUB @geekpi https://linux.cn/article-13750-1.html --- ... Zulip- An Interesting Open-Source Alternative to Slack.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md (98%) diff --git a/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md b/published/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md similarity index 98% rename from translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md rename to published/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md index 185da537b8..edbf0cdbbe 100644 --- a/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md +++ b/published/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13750-1.html" Zulip:一个不错的开源的 Slack 替代品 ====== From 2ec4ae9b8db5d6e661e674450fb25b5e48e1964e Mon Sep 17 00:00:00 2001 From: New-World-2019 Date: Sat, 4 Sep 2021 10:37:55 +0800 Subject: [PATCH 112/138] translated --- ...e status on Linux with the stat command.md | 119 ------------------ ...e status on Linux with the stat command.md | 118 +++++++++++++++++ 2 files changed, 118 insertions(+), 119 deletions(-) delete mode 100644 sources/tech/20210820 Check file status on Linux with the stat command.md create mode 100644 translated/tech/20210820 Check file status on Linux with the stat command.md diff --git a/sources/tech/20210820 Check file status on Linux with the stat command.md b/sources/tech/20210820 Check file status on Linux with the stat command.md deleted file mode 100644 index 552bc004bc..0000000000 --- a/sources/tech/20210820 Check file status on Linux with the stat command.md +++ /dev/null @@ -1,119 +0,0 @@ -[#]: subject: "Check file status on Linux with the stat command" -[#]: via: "https://opensource.com/article/21/8/linux-stat-file-status" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "New-World-2019" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Check file status on Linux with the stat command -====== -All the information you need about any file or file system is just one -Linux command away. -![Hand putting a Linux file folder into a drawer][1] - -The `stat` command, included in the GNU `coreutils` package, provides a variety of metadata, including file size, inode location, access permissions and SELinux context, and creation and modification times, about files and filesystems. It's a convenient way to gather information that you usually need several different commands to acquire. - -### Installing stat on Linux - -On Linux, you probably already have the `stat` command installed because it's part of a core utility package that's generally bundled with Linux distributions by default. - -In the event that you don't have `stat` installed, you can install `coreutils` with your package manager. - -Alternately, you can [compile coreutils from source code][2]. - -### Getting the status of a file - -Running `stat` provides easy to read output about a specific file or directory. - - -``` -$ stat planets.xml -  File: planets.xml -  Size: 325      Blocks: 8     IO Block: 4096   regular file -Device: fd03h/64771d    Inode: 140217      Links: 1 -Access: (0664/-rw-rw-r--)  Uid: (1000/tux)   Gid: (100/users) -Context: unconfined_u:object_r:user_home_t:s0 -Access: 2021-08-17 18:26:57.281330711 +1200 -Modify: 2021-08-17 18:26:58.738332799 +1200 -Change: 2021-08-17 18:26:58.738332799 +1200 - Birth: 2021-08-17 18:26:57.281330711 +1200 -``` - -It may be easy to read, but it's still a lot of information. Here's what `stat` is covering: - - * **File**: the file name - * **Size**: the file size in bytes - * **Blocks**: the number of blocks on the hard drive reserved for this file - * **IO Block**: the size of a block of the filesystem - * **regular file**: the type of file (regular file, directory, filesystem) - * **Device**: the device where the file is located - * **Inode**: the inode number where the file is located - * **Links**: the number of links to the file - * **Access, UID, GID**: file permissions, user, and group owner - * **Context**: SELinux context - * **Access, Modify, Change, Birth**: the timestamp of when the file was accessed, modified, changed status, and created - - - -### Terse output - -For people who know the output well, or want to parse the output with other utilities like [awk][3], there's the `--terse` (`-t` for short) option, which formats the output without headings or line breaks. - - -``` -$ stat --terse planets.xml -planets.xml 325 8 81b4 100977 100 fd03 140217 1 0 0 1629181617 1629181618 1629181618 1629181617 4096 unconfined_u:object_r:user_home_t:s0 -``` - -### Choosing your own format - -You can define your own format for output using the `--printf` option and a syntax similar to [printf][4]. Each attribute reported by `stat` has a format sequence (`%C` for SELinux context, `%n` for file name, and so on), so you can choose what you want to see in a report. - - -``` -$ stat --printf="%n\n%C\n" planets.xml -planets.xml -unconfined_u:object_r:user_home_t:s0 -$ $ stat --printf="Name: %n\nModified: %y\n" planets.xml -Name: planets.xml -Modified: 2021-08-17 18:26:58.738332799 +1200 -``` - -Here are some common format sequences: - - * **%a** access rights - * **%F** file type - * **%n** file name - * **%U** user name - * **%u** user ID - * **%g** group ID - * **%w** time of birth - * **%y** modification time - - - -A full listing of format sequences is available in the `stat` man page and the `coreutils` info pages. - -### File information - -If you've ever tried to parse the output of `ls -l`, then you'll appreciate the flexibility of the `stat` command. You don't always need every bit of the default information that `stat` provides, but the command is invaluable when you do need some or all of it. Whether you read its output in its default format, or you create your own queries, the `stat` command gives you easy access to the data about your data. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/linux-stat-file-status - -作者:[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/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) -[2]: https://www.gnu.org/software/coreutils/ -[3]: https://opensource.com/article/20/9/awk-ebook -[4]: https://opensource.com/article/20/8/printf diff --git a/translated/tech/20210820 Check file status on Linux with the stat command.md b/translated/tech/20210820 Check file status on Linux with the stat command.md new file mode 100644 index 0000000000..c89b1c0883 --- /dev/null +++ b/translated/tech/20210820 Check file status on Linux with the stat command.md @@ -0,0 +1,118 @@ +[#]: subject: "Check file status on Linux with the stat command" +[#]: via: "https://opensource.com/article/21/8/linux-stat-file-status" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "New-World-2019" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +在 Linux 上使用 stat 命令查看文件状态 +====== +只需要一个 Linux 命令,你就可以获取到任何文件或文件系统的所有信息。 +![Hand putting a Linux file folder into a drawer][1] + +命令 `stat` 被包含在 GNU `coreutils` 软件包里,它提供了关于文件和文件系统的各种元数据,包括文件大小、结点位置、访问权限和 SELinux 上下文以及创建和修改时间。通常情况下,你需要多个不同命令获取的信息,这一个命令就可以实现。 + +### 在 Linux 上安装 stat 命令 + +在 Linux 系统中,可能早已安装了 `state` 命令,因为它是核心功能软件包的一部分,默认情况下,通常包含在 Linux 发行版里。 + +如果系统中没有安装 `stat` 命令,你可以使用包管理器安装 `coreutils` 软件包。 + +另外,你可以 [ 使用源码编译 coreutils 包 ][2]。 + +### 获取文件状态 + +运行 `stat` 命令可以获取指定文件或目录易于理解的输出。 + + +``` +$ stat planets.xml + File: planets.xml + Size: 325 Blocks: 8 IO Block: 4096 regular file +Device: fd03h/64771d Inode: 140217 Links: 1 +Access: (0664/-rw-rw-r--) Uid: (1000/tux) Gid: (100/users) +Context: unconfined_u:object_r:user_home_t:s0 +Access: 2021-08-17 18:26:57.281330711 +1200 +Modify: 2021-08-17 18:26:58.738332799 +1200 +Change: 2021-08-17 18:26:58.738332799 +1200 + Birth: 2021-08-17 18:26:57.281330711 +1200 +``` + +输出的信息很容易理解,但是包含了很多的信息,这里是 `stat` 所包含的项: + + * **File**: 文件名 + * **Size**: 文件大小,以字节表示 + * **Blocks**: 在硬盘驱动器上为文件保留的数据块的数量 + * **IO Block**: 文件系统块大小 + * **regular file**: 文件类型(普通文件,目录,文件系统) + * **Device**: 文件所在的设备 + * **Inode**: 文件所在的 Inode 号 + * **Links**: 文件的链接数 + * **Access, UID, GID**: 文件权限,用户和组的所有者 + * **Context**: SELinux 上下文 + * **Access, Modify, Change, Birth**: 文件被访问、修改、更改状态以及创建时的时间戳 + + + +### 精简输出 + +对于非常了解输出或者想要使用其它工具(例如:[awk][3])解析输出的人,这里可以使用 `--terse`(短参数为 `-t`) 参数,实现没有标题或换行符的格式化输出。 + + +``` +$ stat --terse planets.xml +planets.xml 325 8 81b4 100977 100 fd03 140217 1 0 0 1629181617 1629181618 1629181618 1629181617 4096 unconfined_u:object_r:user_home_t:s0 +``` + +### 选择自己的格式 + +你可以使用 `--printf` 参数以及与 [printf][4] 类似的语法定义自己的输出格式。`stat` 的每一个属性都有一个格式序列(`%C` 表示 SELinux 上下文,`%n` 表示文件名等等),所以,你可以选择你想要的输出格式。 + + +``` +$ stat --printf="%n\n%C\n" planets.xml +planets.xml +unconfined_u:object_r:user_home_t:s0 +$ $ stat --printf="Name: %n\nModified: %y\n" planets.xml +Name: planets.xml +Modified: 2021-08-17 18:26:58.738332799 +1200 +``` + +下面是一些常见的格式序列: + + * **%a** 访问权限 + * **%F** 文件类型 + * **%n** 文件名 + * **%U** 用户名 + * **%u** 用户 ID + * **%g** 组 ID + * **%w** 创建时间 + * **%y** 修改时间 + + + +在 `stat` 手册和 `coreutils` 信息页中都有完整的格式化序列列表。 + +### 文件信息 + +如果你曾经尝试解析过 `ls -l` 的输出,那么,你会很喜欢 `stat` 命令的灵活性。你并不是每次都需要 `stat` 提供的所有信息,但是,当你需要其中一些或全部的时候它是非常有用的。不管你是读取默认输出,还是你自己创建的查询输出,`stat` 命令都可以让你访问想要的数据。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-stat-file-status + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[New-World-2019](https://github.com/New-World-2019) +校对:[校对者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/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: https://www.gnu.org/software/coreutils/ +[3]: https://opensource.com/article/20/9/awk-ebook +[4]: https://opensource.com/article/20/8/printf \ No newline at end of file From de53fa737ea370f9d81dc7b9e90dfc609fe70cef Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Sat, 4 Sep 2021 16:32:12 +0800 Subject: [PATCH 113/138] Rename sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md to translated/talk/20210819 A guide to understanding your team-s implicit values and needs.md --- ...uide to understanding your team-s implicit values and needs.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20210819 A guide to understanding your team-s implicit values and needs.md (100%) diff --git a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md b/translated/talk/20210819 A guide to understanding your team-s implicit values and needs.md similarity index 100% rename from sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md rename to translated/talk/20210819 A guide to understanding your team-s implicit values and needs.md From 0327d0cd211fe8b26e7da693bc3674c8e6a10412 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 5 Sep 2021 05:02:19 +0800 Subject: [PATCH 114/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210905=20?= =?UTF-8?q?Neither=20Windows,=20nor=20Linux!=20Shrine=20is=20=E2=80=98God?= =?UTF-8?q?=E2=80=99s=20Operating=20System=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md --- ...inux- Shrine is ‘God-s Operating System.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md diff --git a/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md b/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md new file mode 100644 index 0000000000..07676c2130 --- /dev/null +++ b/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md @@ -0,0 +1,80 @@ +[#]: subject: "Neither Windows, nor Linux! Shrine is ‘God’s Operating System’" +[#]: via: "https://itsfoss.com/shrine-os/" +[#]: author: "John Paul https://itsfoss.com/author/john/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Neither Windows, nor Linux! Shrine is ‘God’s Operating System’ +====== + +We’ve all used multiple operating systems in our lives. Some were good and some were bad. But can you say that you’ve ever used an operating system designed by God? Today, I’d like to introduce you to Shrine. + +### What is Shrine? + +![Shrine interface][1] + +From that introduction, you’re probably wondering what the heck is going on. Well, it all started with a guy named Terry Davis. Before we go any further, I’d better warn you that Terry suffered from schizophrenia during his life and often didn’t take his medication. Because of this, he said or did things during his life that were not quite socially acceptable. + +Anyway, back to the story line. In the early 2000s, Terry released a simple operating system. Over the years, it went through several names, including J Operating System, LoseThos, and SparrowOS. He finally settled on the name [TempleOS][2]. He chose that name because this operating system would be God’s temple. As such. God gave Terry the following [specifications][3] for the operating system: + + * It would have 640×480 16 color graphics + * It would use “a single-voice 8-bit signed MIDI-like sample for sound”. + * It would follow the Commodore 64, i.e. “a non-networked, simple machine where programming was the goal, not just a means to an end”. + * It would only support one file system (named “Red Sea”). + * It would be limited to 100,000 lines of code to make it “easy to learn the whole thing”. + * “Ring-0-only. Everything runs in kernel mode, including user applications” + * The font would be limited to “one 8×8 fixed-width font”. + * The use would have “full access to everything. All memory, I/O ports, instructions, and similar things must never be off limits. All functions, variables and class members will be accessible.” + * It would only support one platform, 64-bit PCs. + + + +Terry wrote this operating system using in a programming language that he called HolyC. TechRepublic called it a “modified version of C++ (“more than C, less than C++”)”. If you are interested in getting a flavor of HolyC, I would recommend, [this article][4] and the HolyC entry on [RosettaCode][5]. + +In 2013, Terry announced on his website that TempleOS was complete. Tragically, Terry died a few years later in August of 2018 when he was hit by a train. He was homeless at the time. Over the years, many people followed Terry through his work on the operating system. Most were impressed at his ability to write an operating system in such a small package. + +Now, you are probably wondering what all this talk of TempleOS has to do with Shrine. Well, as the [GitHub page][6] for Shrine states, it is “A TempleOS distro for heretics”. GitHub user [minexew][7] created Shrine to add features to TempleOS that Terry had neglected. These features include: + + * 99% compatibility with TempleOS programs + * Ships with Lambda Shell, which feels a bit like a classic Unix command interpreter + * TCP/IP stack & internet access out of the box + * Includes a package downloader + + + +minexew is planning to add more features in the future, but hasn’t announced what exactly will be included. He has plans to make a full TempleOS environment for Linux. + +### Experience + +It’s fairly easy to get Shrine virtualized. All you need to do is install your virtualizing software of choice. (Mine is VirtualBox.) When you create a virtual machine for Shrine, make sure that it is 64-bit and has at least 512 MB of RAM. + +Once you boot into Shrine, you will be asked if you want to install to your (virtual) hard drive. Once that is finished (or not, if you choose), you will be offered a tour of the operating system. From there you can explore. + +### Final Thoughts + +Temple OS and (Shrine) is obviously not intended to be a replacement for Windows or Linux. Even though Terry referred to it as “God’s temple”, I’m sure in his more lucid moments, he would have acknowledged that it was more of a hobby operating system. With that in mind, the finished product is fairly [impressive][8]. Over a twelve-year period, Terry created an operating system in a little over 100,000 lines of code, using a language that he had created himself. He also wrote his own compiler, graphics library and several games. All this while fighting his own personal demons. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/shrine-os/ + +作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/shrine.jpg?resize=800%2C600&ssl=1 +[2]: https://templeos.org/ +[3]: https://web.archive.org/web/20170508181026/http://www.templeos.org:80/Wb/Doc/Charter.html +[4]: https://harrisontotty.github.io/p/a-lang-design-analysis-of-holyc +[5]: https://rosettacode.org/wiki/Category:HolyC +[6]: https://github.com/minexew/Shrine +[7]: https://github.com/minexew +[8]: http://www.codersnotes.com/notes/a-constructive-look-at-templeos/ From 6c6f681b78649dd0a33b763d352251cd63ea2127 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 5 Sep 2021 05:02:42 +0800 Subject: [PATCH 115/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210904=20?= =?UTF-8?q?Essential=20open=20source=20tools=20for=20an=20academic=20organ?= =?UTF-8?q?ization?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210904 Essential open source tools for an academic organization.md --- ...urce tools for an academic organization.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/tech/20210904 Essential open source tools for an academic organization.md diff --git a/sources/tech/20210904 Essential open source tools for an academic organization.md b/sources/tech/20210904 Essential open source tools for an academic organization.md new file mode 100644 index 0000000000..805718836b --- /dev/null +++ b/sources/tech/20210904 Essential open source tools for an academic organization.md @@ -0,0 +1,64 @@ +[#]: subject: "Essential open source tools for an academic organization" +[#]: via: "https://opensource.com/article/21/9/open-source-tools-ospo" +[#]: author: "Quinn Foster https://opensource.com/users/quinn-foster" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Essential open source tools for an academic organization +====== +A look into the digital infrastructure of an academic open source +programs office (OSPO). +![Wratchet set tools][1] + +As an academic open source programs office (OSPO), [Open @RIT][2]'s mission is to assist faculty, staff, and students at the Rochester Institute of Technology in creating and maintaining communities for their open projects. We accomplish this by offering consultation and documents that teach our clients the best ways to operate their communities and projects. None of this would be feasible, however, if not for the systems of digital infrastructure we have created and adopted to facilitate these interactions. + +Whether you're starting your own academic OSPO or an open source project, finding the right tools and methods for managing your unique community can be challenging if you don't know where to look. Therefore, in the spirit of openness, the Open @RIT team is happy to share the experiences and strategies used to build our digital infrastructure right here. + +To begin, much of what we have built is thanks to our collaboration with the open source experts at the Institute of Electrical and Electronics Engineers ([IEEE][3]). Founded back in the 19th century during the advent of widespread electricity use, IEEE remains the largest technical professional organization globally and strives to advance technology for the benefit of humanity. The utilization of open source is an integral part of this goal. [IEEE SA OPEN][4], the IEEE sub-group which has created a dedicated open source collaboration platform, aims to create a unified infrastructure stack for open source communities. + +As a participant in IEEE SA OPEN's open technical advisory group, Open @RIT has worked with the group by advising in selecting and approving a variety of software tools they are considering supporting in their standards. + +> "We're trying to learn about how they operate within the academic sector, and then because they're open source, we can really easily contribute back and contribute these findings," +> +> Mike Nolan, assistant director of Open @RIT. + +The tools IEEE SA OPEN and Open @RIT select help develop Open @RIT's digital infrastructure and assist its clients in an academic environment. In turn, Open @RIT provides feedback and even technical contributions to IEEE SA OPEN to extend their infrastructure effectively. Each tool, all of which are open source, carries out a key role: + + * [Mattermost][5] is a collaboration platform built with project developers in mind. We've been using Mattermost to communicate and share work, and we highly recommend it for anybody developing an open source project. + * [Gitlab][6] allows you to store files of code and develop them collaboratively with your team. + * [Nextcloud][7] is a cloud-based file hosting service where you can create and share documents with your team and manage projects and deadlines. Adapting Nextcloud into the standards is still in process and not yet approved, but it holds tremendous potential for IEEE SA OPEN. + + + +A crucial benefit we've experienced using these tools alongside IEEE SA OPEN is finding ways to interact with each other. For example, Mattermost's ChatOps function allows you to install a Gitlab plugin into your Mattermost servers, allowing notifications of issues, merge requests, direct mentions, and other changes made in Gitlab to appear in your message boards. This, among potential future additions, demonstrates how these tools can become a cohesive standard in building open infrastructure. + +In addition to working with IEEE SA OPEN, we have also made inroads with CHAOSS Software and utilized their community analysis software, [GrimoireLab.][8] Their tool is a community health analytics software that calculates and reports metrics of open source project communities. This includes things like the time it takes to resolve reported issues, contributor affiliations, code management, and more. + +Open @RIT uses GrimoireLab and provides feedback and contributions to the CHAOSS community based upon our unique position of monitoring community health in academia. One of our more significant contributions is Mystic, a digital portal and dashboard of our design. Anyone at RIT can submit their open source projects and receive generated community health statistics. Mystic leverages GrimoireLab to take these projects and reports the community metrics and analytics back to the user. Using GrimoireLab in this way helps build the open source community at RIT while contributing back to CHAOSS to make their tools more applicable to academic institutions. + +We hope the information shared here has provided you with the tips and tricks to kickstart your open source project. Whether it's academic in nature or not, these tools can be great additions to the digital infrastructure holding your project community together. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/open-source-tools-ospo + +作者:[Quinn Foster][a] +选题:[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/quinn-foster +[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://www.rit.edu/research/open +[3]: https://www.ieee.org/ +[4]: https://saopen.ieee.org/ +[5]: https://mattermost.com/ +[6]: https://about.gitlab.com/ +[7]: https://opensource.com/tags/nextcloud +[8]: https://chaoss.github.io/grimoirelab/ From b0f78ba7cde09a47d842f0e8e85d6bcfa9db7cca Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 15:20:46 +0800 Subject: [PATCH 116/138] PRF @mengxinayan --- ...27 Analyze the Linux kernel with ftrace.md | 260 +++++++++--------- 1 file changed, 134 insertions(+), 126 deletions(-) diff --git a/translated/tech/20210727 Analyze the Linux kernel with ftrace.md b/translated/tech/20210727 Analyze the Linux kernel with ftrace.md index 2e38eac86c..f9a1ee0806 100644 --- a/translated/tech/20210727 Analyze the Linux kernel with ftrace.md +++ b/translated/tech/20210727 Analyze the Linux kernel with ftrace.md @@ -3,60 +3,61 @@ [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) [#]: collector: (lujun9972) [#]: translator: (mengxinayan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -通过 `ftrace` 来分析 Linux 内核 +通过 ftrace 来分析 Linux 内核 ====== -通过 `ftrace` 来了解 Linux 内核内部工作方式是一个好方法。 -![Linux keys on the keyboard for a desktop computer][1] -一个操作系统的内核是最难以理解的软件之一。自从你的系统启动后,它会一直在后台运行。尽管每个用户都不与内核直接交互,但他们在内核的帮助下完成自己的计算任务。与内核的交互发生在调用系统调用或者用户日常使用的各种库或应用间接调用了系统调用。 +> 通过 `ftrace` 来了解 Linux 内核内部工作方式是一个好方法。 -在之前的文章里我介绍了如何使用 `strace` 来追踪系统调用。然而,使用 `strace` 时你的可见性是受限的。它允许你查看特定参数的系统调用。并在工作完成后,看到其返回值或状态,来表明是通过还是失败。但是你无法知道内核在这段时间内发生了什么。除了系统调用外,内核中还有很多其他活动发生时却被忽略了。 +![](https://img.linux.net.cn/data/attachment/album/202109/05/151954cb5z5rg7zqa9lbzu.jpg) -### `ftrace` 介绍 +操作系统的内核是最难以理解的软件之一。自从你的系统启动后,它会一直在后台运行。尽管每个用户都不与内核直接交互,但他们在内核的帮助下完成自己的计算任务。与内核的交互发生在调用系统调用或者用户日常使用的各种库或应用间接调用了系统调用。 -本文的目的是通过使用一个名为 `ftrace` 的机制来追踪内核函数。任何 Linux 用户可以通过使用它来轻松地追踪内核,并且了解更多关于 Linux 内核内部如何工作。 +在之前的文章里我介绍了如何使用 [strace][6] 来追踪系统调用。然而,使用 `strace` 时你的视野是有限的。它允许你查看特定参数的系统调用。并在工作完成后,看到其返回值或状态,以表明是成功还是失败。但是你无法知道内核在这段时间内发生了什么。除了系统调用外,还有很多其他活动内核中发生,而你却视而不见。 -`ftrace` 默认产生的输出是巨大的,因为内核总是忙的。为了节省空间,很多情况下我会通过截断来给出最小输出。 +### ftrace 介绍 + +本文的旨在通过使用一个名为 `ftrace` 的机制来阐明追踪内核函数的一些情况。它使得任何 Linux 用户可以轻松地追踪内核,并且了解更多关于 Linux 内核内部如何工作。 + +`ftrace` 默认产生的输出往往是巨大的,因为内核总是忙碌的。为了节省空间,很多情况下我会通过截断来给出尽量小的输出。 我使用 Fedora 来演示下面的例子,但是它们应该在其他最新的 Linux 发行版上同样可以运行。 -### 启用 `ftrace` +### 启用 ftrace -`ftrace` 现在已经是内核中的一部分了,你不再需要事先安装它了。也就是说,如果你在使用最近的 Linux 系统,那么 `ftrace` 是已经启动了的。为了验证 `ftrace` 是否可用,运行 `mount` 命令并查找 `tracefs`。如果你看到类似下面的输出,表示 `ftrace` 已经启用,你可以轻松地尝试本文中下面的例子。下面的命令需要在 root 用户下使用(`sudo` 是不够的) +`ftrace` 现在已经是内核中的一部分了,你不再需要事先安装它了。也就是说,如果你在使用最近的 Linux 系统,那么 `ftrace` 是已经启用了的。为了验证 `ftrace` 是否可用,运行 `mount` 命令并查找 `tracefs`。如果你看到类似下面的输出,表示 `ftrace` 已经启用,你可以轻松地尝试本文中下面的例子。下面有些命令需要在 root 用户下使用(用 `sudo` 执行是不够的)。 ``` -$ sudo mount | grep tracefs +# mount | grep tracefs none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) ``` 要想使用 `ftrace`,你首先需要进入上面 `mount` 命令中找到的特定目录中,在那个目录下运行文章中的其他命令。 ``` -`$ cd /sys/kernel/tracing` +# cd /sys/kernel/tracing ``` ### 一般的工作流程 -首先,你需要理解捕捉踪迹和获取输出的一般流程。如果你直接运行 `ftrace`,没有任何特定的 `ftrace-` 命令会被运行。相反的,你基本上是通过标准 Linux 命令来写入或读取一些文件。 +首先,你需要理解捕捉踪迹和获取输出的一般流程。如果你直接运行 `ftrace`,不会运行任何特定的 `ftrace` 命令。相反的,基本操作是通过标准 Linux 命令来写入或读取一些文件。 + +一般的步骤如下: -通用的步骤如下: 1. 通过写入一些特定文件来启用/结束追踪 2. 通过写入一些特定文件来设置/取消追踪时的过滤规则 -3. 读取基于第 1 和 2 步的追踪输出 -4. 清除输出的文件或缓存 -5. 缩小到特定用例(你要追踪的内核函数),重复1,2,3,4 步 - -First of all, you must understand the general workflow of capturing a trace and obtaining the output. If you're using `ftrace` directly, there isn't any special `ftrace-`specific commands to run. Instead, you basically write to some files and read from some files using standard command-line Linux utilities. +3. 从文件中读取基于第 1 和 2 步的追踪输出 +4. 从文件中清除早期输出或缓冲区 +5. 缩小到你的特定用例(你要追踪的内核函数),重复 1、2、3、4 步 ### 可用的追踪器类型 -有多种不同的追踪器可供你使用。之前提到,在运行任何命令前,你需要进入一个特定的目录下,因为文件在这些目录下。我在我的例子中使用相对路径(与绝对路径相反) +有多种不同的追踪器可供使用。之前提到,在运行任何命令前,你需要进入一个特定的目录下,因为需要的文件在这些目录下。我在我的例子中使用了相对路径(而不是绝对路径)。 -你可以查看 `available_tracers` 文件内容来查看所有可用的追踪器类型。你可以可以看下面列出了几个。不需要担心有这么多。 +你可以查看 `available_tracers` 文件内容来查看所有可用的追踪器类型。你可以看下面列出了几个。不需要担心这些: ``` $ pwd @@ -66,11 +67,11 @@ $ sudo cat available_tracers hwlat blk mmiotrace function_graph wakeup_dl wakeup_rt wakeup function nop ``` -在所有输出的追踪器中,我会聚焦于下面三个特殊的:启用追踪的 `function` 和 `function_graph`,以及停止追踪的 `nop` +在所有输出的追踪器中,我会聚焦于下面三个特殊的:启用追踪的 `function` 和 `function_graph`,以及停止追踪的 `nop`。 ### 确认当前的追踪器 -通常情况默认的追踪器设定为 `nop`。即在特殊文件中 `current_tracer` 中的 “无操作”,这意味着追踪目前是关闭的。 +通常情况默认的追踪器设定为 `nop`。即在特殊文件中 `current_tracer` 中的 “无操作”,这意味着追踪目前是关闭的: ``` $ pwd @@ -82,26 +83,27 @@ nop ### 查看追踪输出 -在启用任何追踪功能之前,请你看一下保存追踪输出的文件。你可以用 [cat](2) 命令查看名为 `trace` 的文件的内容。 +在启用任何追踪功能之前,请你看一下保存追踪输出的文件。你可以用 [cat][2] 命令查看名为 `trace` 的文件的内容: ``` -$ sudo cat trace +# cat trace + # tracer: nop # -# entries-in-buffer/entries-written: 0/0   #P:8 +# entries-in-buffer/entries-written: 0/0 #P:8 # -#                                _-----=> irqs-off -#                               / _----=> need-resched -#                              | / _---=> hardirq/softirq -#                              || / _--=> preempt-depth -#                              ||| /     delay -#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION -#              | |         |   ||||      |         | +# _-----=> irqs-off +# / _----=> need-resched +# | / _---=> hardirq/softirq +# || / _--=> preempt-depth +# ||| / delay +# TASK-PID CPU# |||| TIMESTAMP FUNCTION +# | | | |||| | | ``` -### 启用 `function` 追踪器 +### 启用 function 追踪器 -你可以通过向 `current_tracer` 文件写入 `function` 来启用第一个追踪器 `function`(文件原本内容为 `nop`,意味着追踪是关闭的)。把这个操作看成是启用追踪的一种方式。 +你可以通过向 `current_tracer` 文件写入 `function` 来启用第一个追踪器 `function`(文件原本内容为 `nop`,意味着追踪是关闭的)。把这个操作看成是启用追踪的一种方式: ``` $ pwd @@ -109,38 +111,39 @@ $ pwd $ sudo cat current_tracer nop -$ echo function > current_tracer +$ echo function > current_tracer $ $ cat current_tracer function ``` -### 查看 `function` 追踪器的更新追踪输出 +### 查看 function 追踪器的更新追踪输出 -现在你已启动追踪,是时候查看输出了。如果你查看 `trace` 文件内容,你将会看到许多被连续写入的内容。我通过管道只展示了文件内容的前 20 行。根据左边输出的标题,你可以看到在某个 CPU 上运行的任务和进程 ID。根据右边输出的内容,你可以看到具体的内核函数和其副函数。中间显示了时间信息。 +现在你已启用追踪,是时候查看输出了。如果你查看 `trace` 文件内容,你将会看到许多被连续写入的内容。我通过管道只展示了文件内容的前 20 行。根据左边输出的标题,你可以看到在某个 CPU 上运行的任务和进程 ID。根据右边输出的内容,你可以看到具体的内核函数和其父函数。中间显示了时间戳信息: ``` -$ sudo cat trace | head -20 +# sudo cat trace | head -20 + # tracer: function # -# entries-in-buffer/entries-written: 409936/4276216   #P:8 +# entries-in-buffer/entries-written: 409936/4276216 #P:8 # -#                                _-----=> irqs-off -#                               / _----=> need-resched -#                              | / _---=> hardirq/softirq -#                              || / _--=> preempt-depth -#                              ||| /     delay -#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION -#              | |         |   ||||      |         | -          <idle>-0       [000] d...  2088.841739: tsc_verify_tsc_adjust <-arch_cpu_idle_enter -          <idle>-0       [000] d...  2088.841739: local_touch_nmi <-do_idle -          <idle>-0       [000] d...  2088.841740: rcu_nocb_flush_deferred_wakeup <-do_idle -          <idle>-0       [000] d...  2088.841740: tick_check_broadcast_expired <-do_idle -          <idle>-0       [000] d...  2088.841740: cpuidle_get_cpu_driver <-do_idle -          <idle>-0       [000] d...  2088.841740: cpuidle_not_available <-do_idle -          <idle>-0       [000] d...  2088.841741: cpuidle_select <-do_idle -          <idle>-0       [000] d...  2088.841741: menu_select <-do_idle -          <idle>-0       [000] d...  2088.841741: cpuidle_governor_latency_req <-menu_select +# _-----=> irqs-off +# / _----=> need-resched +# | / _---=> hardirq/softirq +# || / _--=> preempt-depth +# ||| / delay +# TASK-PID CPU# |||| TIMESTAMP FUNCTION +# | | | |||| | | + -0 [000] d... 2088.841739: tsc_verify_tsc_adjust <-arch_cpu_idle_enter + -0 [000] d... 2088.841739: local_touch_nmi <-do_idle + -0 [000] d... 2088.841740: rcu_nocb_flush_deferred_wakeup <-do_idle + -0 [000] d... 2088.841740: tick_check_broadcast_expired <-do_idle + -0 [000] d... 2088.841740: cpuidle_get_cpu_driver <-do_idle + -0 [000] d... 2088.841740: cpuidle_not_available <-do_idle + -0 [000] d... 2088.841741: cpuidle_select <-do_idle + -0 [000] d... 2088.841741: menu_select <-do_idle + -0 [000] d... 2088.841741: cpuidle_governor_latency_req <-menu_select ``` 请记住当追踪打开后,这意味着追踪结果会被一直连续写入直至你关闭追踪。 @@ -159,7 +162,7 @@ $ sudo cat current_tracer nop ``` -### 启用 `function_graph` 追踪器 +### 启用 function_graph 追踪器 现在尝试第二个名为 `function_graph` 的追踪器。你可以使用和上面相同的步骤:在 `current_tracer` 文件中写入 `function_graph`: @@ -170,32 +173,33 @@ $ sudo cat current_tracer function_graph ``` -### `function_tracer` 追踪器的追踪输出 +### function_tracer 追踪器的追踪输出 -注意到目前 `trace` 文件的输出格式已经发生变化。现在,你可以看到 CPU ID 和内核函数的执行时间。接下来,一个花括号表示一个函数的开始,以及它内部调用了哪些其他函数。 +注意到目前 `trace` 文件的输出格式已经发生变化。现在,你可以看到 CPU ID 和内核函数的执行时长。接下来,一个花括号表示一个函数的开始,以及它内部调用了哪些其他函数: ``` -$ sudo cat trace | head -20 +# cat trace | head -20 + # tracer: function_graph # -# CPU  DURATION                  FUNCTION CALLS -# |     |   |                     |   |   |   | - 6)               |              n_tty_write() { - 6)               |                down_read() { - 6)               |                  __cond_resched() { - 6)   0.341 us    |                    rcu_all_qs(); - 6)   1.057 us    |                  } - 6)   1.807 us    |                } - 6)   0.402 us    |                process_echoes(); - 6)               |                add_wait_queue() { - 6)   0.391 us    |                  _raw_spin_lock_irqsave(); - 6)   0.359 us    |                  _raw_spin_unlock_irqrestore(); - 6)   1.757 us    |                } - 6)   0.350 us    |                tty_hung_up_p(); - 6)               |                mutex_lock() { - 6)               |                  __cond_resched() { - 6)   0.404 us    |                    rcu_all_qs(); - 6)   1.067 us    |                  } +# CPU DURATION FUNCTION CALLS +# | | | | | | | + 6) | n_tty_write() { + 6) | down_read() { + 6) | __cond_resched() { + 6) 0.341 us | rcu_all_qs(); + 6) 1.057 us | } + 6) 1.807 us | } + 6) 0.402 us | process_echoes(); + 6) | add_wait_queue() { + 6) 0.391 us | _raw_spin_lock_irqsave(); + 6) 0.359 us | _raw_spin_unlock_irqrestore(); + 6) 1.757 us | } + 6) 0.350 us | tty_hung_up_p(); + 6) | mutex_lock() { + 6) | __cond_resched() { + 6) 0.404 us | rcu_all_qs(); + 6) 1.067 us | } ``` ### 启用追踪的设置来增加追踪的深度 @@ -203,18 +207,18 @@ $ sudo cat trace | head -20 你可以使用下面的步骤来调整追踪器以看到更深层次的函数调用。完成之后,你可以查看 `trace` 文件的内容并发现输出变得更加详细了。为了文章的可读性,这个例子的输出被省略了: ``` -$ sudo cat max_graph_depth +# cat max_graph_depth 0 -$ sudo echo 1 > max_graph_depth -$ # or -$ sudo echo 2 > max_graph_depth -$ sudo cat trace +# echo 1 > max_graph_depth ## or: +# echo 2 > max_graph_depth + +# sudo cat trace ``` ### 查找要追踪的函数 -上面的步骤足以让你开始追踪。但是它产生的输出内容是巨大的,当你想试图找到自己感兴趣的内容时,往往会很困难。通常你更希望能够之追踪特定的函数,而忽略其他函数。但如果你不知道它们确切的名称,你怎么知道要追踪哪些进程?有一个文件可以帮助你解决这个问题 —— `available_filter_functions` 文件提供了一个可供追踪的函数列表。 +上面的步骤足以让你开始追踪。但是它产生的输出内容是巨大的,当你想试图找到自己感兴趣的内容时,往往会很困难。通常你更希望能够只追踪特定的函数,而忽略其他函数。但如果你不知道它们确切的名称,你怎么知道要追踪哪些进程?有一个文件可以帮助你解决这个问题 —— `available_filter_functions` 文件提供了一个可供追踪的函数列表: ``` $ sudo wc -l available_filter_functions   @@ -223,7 +227,7 @@ $ sudo wc -l available_filter_functions   ### 查找一般的内核函数 -现在试着搜索一个你所知道的简单内核函数。用户空间有 `malloc` 函数用来分配内存,而内核有 `kmalloc` 函数,它提供类似的功能。下面是所有与 `kmalloc` 相关的函数。 +现在试着搜索一个你所知道的简单内核函数。用户空间由 `malloc` 函数用来分配内存,而内核由 `kmalloc` 函数,它提供类似的功能。下面是所有与 `kmalloc` 相关的函数: ``` $ sudo grep kmalloc available_filter_functions @@ -243,7 +247,7 @@ __kmalloc_node_track_caller ### 查找内核模块或者驱动相关函数 -在 `available_filter_functions` 文件的输出中,你可以看到一些以括号内文字结尾的行,例如下面的例子中的 `[kvm_intel]`。这些函数与当前加载的内核模块 `kvm_intel` 有关。你可以运行 `lsmod` 命令来验证。 +在 `available_filter_functions` 文件的输出中,你可以看到一些以括号内文字结尾的行,例如下面的例子中的 `[kvm_intel]`。这些函数与当前加载的内核模块 `kvm_intel` 有关。你可以运行 `lsmod` 命令来验证: ``` $ sudo grep kvm available_filter_functions | tail @@ -266,19 +270,20 @@ irqbypass              16384  1 kvm ### 仅追踪特定的函数 -为了实现对特定函数或模式的追踪,你可以利用 `set_ftrace_filter` 文件来指定你要追踪上述输出中的哪些函数。这个文件也接受 `*` 模式,它可以扩展到包括具有给定模式的其他函数。作为一个例子,我在我的机器上使用ext4文件系统。我可以用下面的命令指定ext4的特定内核函数来追踪。 +为了实现对特定函数或模式的追踪,你可以利用 `set_ftrace_filter` 文件来指定你要追踪上述输出中的哪些函数。这个文件也接受 `*` 模式,它可以扩展到包括具有给定模式的其他函数。作为一个例子,我在我的机器上使用 ext4 文件系统。我可以用下面的命令指定 ext4 的特定内核函数来追踪: ``` -$ sudo mount | grep home +# mount | grep home /dev/mapper/fedora-home on /home type ext4 (rw,relatime,seclabel) -$ pwd +# pwd /sys/kernel/tracing -$ sudo cat set_ftrace_filter +# cat set_ftrace_filter + #### all functions enabled #### $ -$ echo ext4_* > set_ftrace_filter +$ echo ext4_* > set_ftrace_filter $ $ cat set_ftrace_filter ext4_has_free_clusters @@ -289,35 +294,36 @@ ext4_get_group_desc [...] ``` -现在当你可以看到追踪输出时,你只能看到与内核函数有关的 `ext4` 函数,而你之前已经为其设置了一个过滤器。所有其他的输出都被忽略了。 +现在当你可以看到追踪输出时,你只能看到与内核函数有关的 `ext4` 函数,而你之前已经为其设置了一个过滤器。所有其他的输出都被忽略了: ``` -$ sudo cat trace |head -20 -# tracer: function +# cat trace |head -20 + +## tracer: function # -# entries-in-buffer/entries-written: 3871/3871   #P:8 +# entries-in-buffer/entries-written: 3871/3871 #P:8 # -#                                _-----=> irqs-off -#                               / _----=> need-resched -#                              | / _---=> hardirq/softirq -#                              || / _--=> preempt-depth -#                              ||| /     delay -#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION -#              | |         |   ||||      |         | -           cupsd-1066    [004] ....  3308.989545: ext4_file_getattr <-vfs_fstat -           cupsd-1066    [004] ....  3308.989547: ext4_getattr <-ext4_file_getattr -           cupsd-1066    [004] ....  3308.989552: ext4_file_getattr <-vfs_fstat -           cupsd-1066    [004] ....  3308.989553: ext4_getattr <-ext4_file_getattr -           cupsd-1066    [004] ....  3308.990097: ext4_file_open <-do_dentry_open -           cupsd-1066    [004] ....  3308.990111: ext4_file_getattr <-vfs_fstat -           cupsd-1066    [004] ....  3308.990111: ext4_getattr <-ext4_file_getattr -           cupsd-1066    [004] ....  3308.990122: ext4_llseek <-ksys_lseek -           cupsd-1066    [004] ....  3308.990130: ext4_file_read_iter <-new_sync_read +# _-----=> irqs-off +# / _----=> need-resched +# | / _---=> hardirq/softirq +# || / _--=> preempt-depth +# ||| / delay +# TASK-PID CPU# |||| TIMESTAMP FUNCTION +# | | | |||| | | + cupsd-1066 [004] .... 3308.989545: ext4_file_getattr <-vfs_fstat + cupsd-1066 [004] .... 3308.989547: ext4_getattr <-ext4_file_getattr + cupsd-1066 [004] .... 3308.989552: ext4_file_getattr <-vfs_fstat + cupsd-1066 [004] .... 3308.989553: ext4_getattr <-ext4_file_getattr + cupsd-1066 [004] .... 3308.990097: ext4_file_open <-do_dentry_open + cupsd-1066 [004] .... 3308.990111: ext4_file_getattr <-vfs_fstat + cupsd-1066 [004] .... 3308.990111: ext4_getattr <-ext4_file_getattr + cupsd-1066 [004] .... 3308.990122: ext4_llseek <-ksys_lseek + cupsd-1066 [004] .... 3308.990130: ext4_file_read_iter <-new_sync_read ``` ### 排除要被追踪的函数 -你并不总是知道你想追踪什么,但是,你肯定知道你不想追踪什么。因此,有一个 `set_ftrace_notrace` —— 请注意其中的 "no"。你可以在这个文件中写下你想要的模式,并启用追踪。这样除了所提到的模式外,任何其他东西都会被追踪到。这通常有助于删除那些使我们的输出变得混乱的普通功能。 +你并不总是知道你想追踪什么,但是,你肯定知道你不想追踪什么。因此,有一个 `set_ftrace_notrace` —— 请注意其中的 “no”。你可以在这个文件中写下你想要的模式,并启用追踪。这样除了所提到的模式外,任何其他东西都会被追踪到。这通常有助于删除那些使我们的输出变得混乱的普通功能: ``` $ sudo cat set_ftrace_notrace @@ -326,39 +332,40 @@ $ sudo cat set_ftrace_notrace ### 具有目标性的追踪 -到目前为止,你一直在追踪内核中发生的一切。但是,他无法帮助你追踪与某个特定命令有关的事件。为了达到这个目的,你可以按需打开和关闭跟踪,并且在它们之间,运行我们选择的命令,这样你就不会在跟踪输出中得到额外的输出。你可以通过向 `tracing_on` 写入 `1` 来启用跟踪,写 `0` 来关闭跟踪。 +到目前为止,你一直在追踪内核中发生的一切。但是,它无法帮助你追踪与某个特定命令有关的事件。为了达到这个目的,你可以按需打开和关闭跟踪,并且在它们之间,运行我们选择的命令,这样你就不会在跟踪输出中得到额外的输出。你可以通过向 `tracing_on` 写入 `1` 来启用跟踪,写 `0` 来关闭跟踪。 ``` -$ sudo cat tracing_on +# cat tracing_on 0 -$ sudo echo 1 > tracing_on -$ sudo cat tracing_on +# echo 1 > tracing_on + +# cat tracing_on 1 -$ # Run some specific command that we wish to trace here +### Run some specific command that we wish to trace here ### -$ sudo echo 0 > tracing_on +# echo 0 > tracing_on -$ cat tracing_on +# cat tracing_on 0 ``` ### 追踪特定的 PID -如果你想追踪与正在运行的特定进程有关的活动,你可以将该 PID 写入一个名为 `set_ftrace_pid` 的文件,然后启用追踪。这样一来,追踪就只限于这个PID,这在某些情况下是非常有帮助的。 +如果你想追踪与正在运行的特定进程有关的活动,你可以将该 PID 写入一个名为 `set_ftrace_pid` 的文件,然后启用追踪。这样一来,追踪就只限于这个 PID,这在某些情况下是非常有帮助的。 ``` -`$ sudo echo $PID > set_ftrace_pid` +$ sudo echo $PID > set_ftrace_pid ``` ### 总结 `ftrace` 是一个了解 Linux 内核内部工作的很好方式。通过一些练习,你可以学会对 `ftrace` 进行调整以缩小搜索范围。要想更详细地了解 `ftrace` 和它的高级用法,请看 `ftrace` 的核心作者 Steven Rostedt 写的这些优秀文章。 - * [调试 Linux 内核,第一部分](3) - * [调试 Linux 内核,第二部分](4) - * [调试 Linux 内核,第三部分](5) + * [调试 Linux 内核,第一部分][3] + * [调试 Linux 内核,第二部分][4] + * [调试 Linux 内核,第三部分][5] -------------------------------------------------------------------------------- @@ -368,7 +375,7 @@ via: https://opensource.com/article/21/7/linux-kernel-ftrace 作者:[Gaurav Kamathe][a] 选题:[lujun9972][b] 译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -379,3 +386,4 @@ via: https://opensource.com/article/21/7/linux-kernel-ftrace [3]: https://lwn.net/Articles/365835/ [4]: https://lwn.net/Articles/366796/ [5]: https://lwn.net/Articles/370423/ +[6]: https://linux.cn/article-11545-1.html \ No newline at end of file From df1f9be0893f957e39b33343d8ae0731b01967bb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 15:21:17 +0800 Subject: [PATCH 117/138] PUB @mengxinayan https://linux.cn/article-13752-1.html --- .../20210727 Analyze the Linux kernel with ftrace.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210727 Analyze the Linux kernel with ftrace.md (99%) diff --git a/translated/tech/20210727 Analyze the Linux kernel with ftrace.md b/published/20210727 Analyze the Linux kernel with ftrace.md similarity index 99% rename from translated/tech/20210727 Analyze the Linux kernel with ftrace.md rename to published/20210727 Analyze the Linux kernel with ftrace.md index f9a1ee0806..41e8595022 100644 --- a/translated/tech/20210727 Analyze the Linux kernel with ftrace.md +++ b/published/20210727 Analyze the Linux kernel with ftrace.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13752-1.html) 通过 ftrace 来分析 Linux 内核 ====== From 9e908307ce865a775ab8be1b3714da503726e981 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 15:33:23 +0800 Subject: [PATCH 118/138] PRF&PUB @geekpi https://linux.cn/article-13753-1.html --- ...to Download Audio Only Using youtube-dl.md | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) rename {translated/tech => published}/20210820 How to Download Audio Only Using youtube-dl.md (77%) diff --git a/translated/tech/20210820 How to Download Audio Only Using youtube-dl.md b/published/20210820 How to Download Audio Only Using youtube-dl.md similarity index 77% rename from translated/tech/20210820 How to Download Audio Only Using youtube-dl.md rename to published/20210820 How to Download Audio Only Using youtube-dl.md index 7fae01b4e2..fd70c1524c 100644 --- a/translated/tech/20210820 How to Download Audio Only Using youtube-dl.md +++ b/published/20210820 How to Download Audio Only Using youtube-dl.md @@ -3,38 +3,40 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13753-1.html" 如何使用 youtube-dl 只下载音频 ====== +![](https://img.linux.net.cn/data/attachment/album/202109/05/153110dkamc1kv0173ggc3.jpg) + [youtube-dl][1] 是一个多功能的命令行工具,用于从 YouTube 和许多其他网站下载视频。我用它来做我自己的 YouTube 视频的备份。 -默认情况下,你[使用 youtube-dl 下载视频][2]。用 youtube-dl 只提取音频怎么样? 其实很简单。让我告诉你步骤。 +默认情况下,你会 [使用 youtube-dl 下载视频][2]。用 youtube-dl 只提取音频怎么样? 其实很简单。让我告诉你步骤。 -注意 - -从网站下载视频可能违反他们的政策。这取决于你是否选择下载视频或音频。 +> **注意** +> +> 从网站下载视频可能违反他们的政策。这取决于你是否选择下载视频或音频。 ### 使用 youtube-dl 只下载音频 -请确保你已经在你的 Linux 发行版上安装了 youtube-dl。 +请确保你已经在你的 Linux 发行版上安装了 `youtube-dl`。 ``` sudo snap install youtube-dl ``` -如果你只想从 YouTube 视频中下载音频,你可以使用 youtube-dl 的 -x 选项。这个提取音频的选项将视频文件转换为纯音频文件。 +如果你只想从 YouTube 视频中下载音频,你可以使用 `youtube-dl` 的 `-x` 选项。这个提取音频的选项将视频文件转换为纯音频文件。 ``` youtube-dl -x video_URL ``` -该文件被保存在你运行 youtube-dl 命令的同一目录下。 +该文件被保存在你运行 `youtube-dl` 命令的同一目录下。 -这是我下载 Zorin OS 16 评论视频的画外音的示例。 +这是我下载 Zorin OS 16 评论视频的画外音的示例: ``` youtube-dl -x https://www.youtube.com/watch?v=m_PmLG7HqbQ @@ -53,7 +55,7 @@ youtube-dl -x https://www.youtube.com/watch?v=m_PmLG7HqbQ youtube-dl -x --audio-format mp3 video_URL ``` -下面是我之前展示的同一个例子。你可以看到它[使用 ffmpeg 转换][3] m4a 文件为 mp3: +下面是我之前展示的同一个例子。你可以看到它 [使用 ffmpeg 转换][3] m4a 文件为 mp3: ``` youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=m_PmLG7HqbQ @@ -87,11 +89,11 @@ https://www.youtube.com/playlist?list=XXXXXXXXXXXXXXXXXXX youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" playlist_URL ``` -那个看起来很可怕的 `-o "%(title)s.%(ext)s"` 指定了输出文件(带选项 -o),并指示它使用视频的标题和扩展名(本例为 mp3)来命名音频文件。 +那个看起来很可怕的 `-o "%(title)s.%(ext)s"` 指定了输出文件(选项 `-o`),并指示它使用视频的标题和扩展名(本例为 mp3)来命名音频文件。 ![][6] -我希望你觉得这个技巧对你有帮助。享受音频文件吧 :) +我希望你觉得这个技巧对你有帮助。享受音频文件吧。 -------------------------------------------------------------------------------- @@ -100,7 +102,7 @@ via: https://itsfoss.com/youtube-dl-audio-only/ 作者:[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 d3e3d25b8dcdbe5dca5dc214d1a8ffff100213b4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 15:39:22 +0800 Subject: [PATCH 119/138] PRF --- published/20210727 Analyze the Linux kernel with ftrace.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20210727 Analyze the Linux kernel with ftrace.md b/published/20210727 Analyze the Linux kernel with ftrace.md index 41e8595022..673661c1b3 100644 --- a/published/20210727 Analyze the Linux kernel with ftrace.md +++ b/published/20210727 Analyze the Linux kernel with ftrace.md @@ -156,7 +156,7 @@ function $ sudo cat current_tracer function -$ sudo echo nop > current_tracer +$ sudo echo nop > current_tracer $ sudo cat current_tracer nop @@ -167,7 +167,7 @@ nop 现在尝试第二个名为 `function_graph` 的追踪器。你可以使用和上面相同的步骤:在 `current_tracer` 文件中写入 `function_graph`: ``` -$ sudo echo function_graph > current_tracer +$ sudo echo function_graph > current_tracer $ sudo cat current_tracer function_graph From d3791cd6b65ff7fbd2725b708eb0e1ad129a0cba Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Sun, 5 Sep 2021 19:12:28 +0800 Subject: [PATCH 120/138] translated --- ...essential Linux commands for every user.md | 255 ------------------ ...essential Linux commands for every user.md | 242 +++++++++++++++++ 2 files changed, 242 insertions(+), 255 deletions(-) delete mode 100644 sources/tech/20210901 20 essential Linux commands for every user.md create mode 100644 translated/tech/20210901 20 essential Linux commands for every user.md diff --git a/sources/tech/20210901 20 essential Linux commands for every user.md b/sources/tech/20210901 20 essential Linux commands for every user.md deleted file mode 100644 index 842dd7aded..0000000000 --- a/sources/tech/20210901 20 essential Linux commands for every user.md +++ /dev/null @@ -1,255 +0,0 @@ -[#]: subject: "20 essential Linux commands for every user" -[#]: via: "https://opensource.com/article/21/9/essential-linux-commands" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "unigeorge" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -20 essential Linux commands for every user -====== -From new user to power user, here are 20 Linux commands that will make -your life easier. -![Command line prompt][1] - -Typing commands into a darkened terminal window may seem antiquated to some, but for many computer users, it's the most efficient, most accessible, and clearest way to accomplish nearly any task a computer is capable of performing. These days, thanks to all the projects that bring open source commands to non-open platforms like macOS and Windows, terminal commands are relevant to everybody, not just Linux and BSD users. It may surprise you to learn that there are thousands of commands installed on an average [POSIX][2] computer, but of course, a good many of those aren't really intended to be used, at least not directly or regularly. Some commands are more universally useful than others, and still fewer are absolutely essential for effective terminal use. - -Here are the top 20 commands a terminal user might find themselves using: - -### cd - -Outside of a terminal, you click on icons to move from one folder to another, but in the terminal, you use `cd`. The `cd` command, which stands for _change directory_, is how you move through a Linux system. It's the fastest and most direct route from one place to another. - -For instance, on the desktop, when you want to move from your home directory (the place you keep all of your folders) to a folder called `presentations`, then you might first have to open your `Documents` folder, then open a folder called `work`, then a `projects` folder, and then the `conference` folder, and finally the `presentations` folder, which contains your exciting LibreOffice Impress slideshow. That's a lot of double-clicking. It may also be a lot of moving around on the screen, depending on where new windows appear, and a lot of waypoints for your brain to track. Many people circumvent this seemingly minor task by keeping _everything_ on their desktop. - -Terminal users avoid this issue by just typing: - - -``` -`$ cd ~/Documents/work/projects/conference/presentations` -``` - -Experienced terminal users don't even bother typing all of that. They use the **Tab** key to autocomplete the words for them. And sometimes, you don't even have to resort to autocompletion. You can use wildcards instead: - - -``` -`$ cd ~/Doc*/work/*/conf*/p*` -``` - -### pwd - -In the words of Buckaroo Banzai: "No matter where you go, there you are." - -When you need to figure out where exactly that is, you use the `pwd` command. The `pwd` stands for _print working directory,_ and that's exactly what it does. The `--physical` (or just `-P` in some implementations) shows your location with all symlinks resolved. - - -``` -$ pwd -/home/tux/presentation - -$ pwd --physical -/home/tux/Documents/work/projects/conference/presentations -``` - -### sed - -Better known as `sed`, the stream editor is a powerful bulk _find and replace_ command, but it's also a legitimate text editor. You can learn to use it by reading my [introductory article][3], and then become an expert with my [advanced tutorial and cheat sheet][4]. - -### grep - -The `grep` command is so ubiquitous that it's often used as a verb ("I'll grep through some files") and a gerund ("grepping some output"). It's a key component when parsing text in your shell, whether you're looking through log files or parsing the output of some other command. It's a way for the busy user to focus on specific information. Given just how much data there is in the computing world, there's no wonder it's a popular command. Go grok grep by reading my [introductory article][5], and then download the [cheat sheet][6]. - -### file - -Use the `file` command when you need to know what type of data a file contains: - - -``` -$ file example.foo -example.foo: RIFF (little-endian) data, Web/P image [...] - -$ file example.bar -example.bar: ELF 64-bit LSB executable, x86-64 [...] -``` - -The `file` command isn't magic, of course. It only reports based on how a file identifies itself, and files can be wrong, corrupted, or disguised. A rigorous inspection with [`hexdump`][7] provides more certainty, but for casual use, the `file` command is convenient. - -### awk - -Awk isn't just a command; it's a literal [programming language][8]. [Download our free Awk ebook][9], learn it, and you'll be writing scripts you never thought possible. - -### curl - -The `curl` command is a [non-interactive web browser][10] for your terminal. It's a [development tool][11] for web and API developers. It's a complex command for its flexibility, but it's worth learning if you want to interact with network services from your terminal smoothly. - -Download our free [`curl` cheat sheet][12], so you can internalize its many options. - -### ps - -Managing your system's resources is mostly up to the kernel, but when you prefer or require a manual approach, there's the `ps` command. Learn about `ps` in my [monitor your Linux system with procps-ng][13] article. - -### cat - -The [`cat` command][14] is short for _concatenate_, and it was very useful once for joining files that had been split (with a command intuitively called `split`) into several small files due to size limitations. Today, `cat` is mostly used as a way to dump the contents of a text file into your terminal for quick reference, unless you use `head`, `tail`, `more`, or `less` for that. - -Despite its almost deprecated original purpose, and despite that several other commands also perform its secondary function, `cat` is still a useful utility. For instance, it can be a stand-in for the copy (`cp`) command: - - -``` -`$ cat myfile.ogg > /backups/myfile.ogg` -``` - -It can reveal inconvenient invisible characters in files. The **Tab** character, which breaks [YAML][15], shows up as `^I` with the `--show-tabs` option: - - -``` -$ cat --show-tabs my.yaml - -\--- - -\- hosts: all -  tasks: -  - name: Make sure the current version of 'sysstat' is installed. -    dnf: -     name: -^I- sysstat -^I- httpd -^I- mariadb-server -     state: latest -``` - -It can show non-printing characters with `--show-nonprinting`, mark the ends of lines with `--show-ends`, provide line numbers with `--number`, and more. - -### find - -The `find` command helps you find files, but thanks to its many options, it can help you find files with a variety of filters and parameters. Learn the basics from my [introductory article][16]. - -And in case you've been wondering why the most fundamental command of all, the humble [`ls` command][17], isn't on this list, it's because of the flexibility of `find`. Not only can find list files: - - -``` -$ find . -./bar.txt -./baz.xml -./foo.txt -[...] -``` - -It can also provide long listings: - - -``` -$ find . -ls -3014803  464 -rw-rw-r--   1 tux users  473385 Jul 26 07:25 ./foo.txt -3014837  900 -rwxrwxr-x   1 tux users  918217 Nov  6  2019 ./baz.xml -3026891  452 -rw-rw-r--   1 tux users  461354 Aug 10 13:41 ./foo.txt -[...] -``` - -It's a technicality, but a neat trick to know. - -### tar - -People sometimes joke about Linux commands by citing BSD's `tar` syntax. In spite of its reputation, the `tar` command can actually be very intuitive. Read my [how to unzip a tar.gz file][18] article to learn the simple secret to rattling off a `tar` command on demand. - -### more or less or most - -Pagers are like `cat`, except they pause their output at the bottom of your screen until you scroll down for more. It's a simple application, but there's nuance to each implementation. Do you scroll with arrow keys or the spacebar? Do you have to quit manually, or does the pager exit at the end of the file it's displaying? What's your preferred search behavior? Choose your favorite pager and set it in your `.bashrc`! - -### ssh and scp - -OpenSSH not only helps secure connections to remote systems it also enables other commands. For instance, for many users, it's their `.ssh` directory that makes it possible for them to interact smoothly with Git repositories, post updates to a website, or log in to their cloud's control plane. - -### mv - -The `mv` command does double-duty: It both [moves files][19] and it [renames files][20]. It has several available safeguards, including `--interactive` and `--no-clobber` options to avoid clobbering an existing file, a `--backup` command to ensure data is preserved until it is verified at its new location, and the `--update` option to ensure that an older version doesn't replace a newer file. - -### sudo - -When you have a single user with a known user name and _all_ the privileges on a system, that user quickly becomes the target of attacks. By eliminating the need for a literal `root` user, the `sudo` command elegantly removes important information about your system from general knowledge. That's not all it does, though. With `sudo`, you can easily manage privileges down to individual commands, users, and groups. You can enable password-less execution of select commands, record user sessions, verify commands with digest validation, [and more][21]. - -### alias - -Turn long commands into easy-to-remember shortcuts by using the `alias` command: - - -``` -`$ alias ls='ls --classify --almost-all --ignore-backups --color'` -``` - -### clear - -Sometimes your terminal gets cluttered. There's nothing like a nice, fresh screen after typing `clear` (or pressing **Ctrl+L** in some shells). - -### setfacl - -Traditionally, POSIX file permissions were determined by `chown` and `chmod`. Systems have become more complex, though, so there's a command to provide a little more flexibility. The `setfacl` command lets you create an [Access Control List (ACL)][22], granting permissions to arbitrary users and setting default permissions for folders and the contents created within them. - -### netcat - -Not every user needs netcat (`nc`), but few who use it ever want to give it up. The `nc` command is an all-purpose network connection tool. - -It can connect to a port, similar to `telnet`: - - -``` -`$ nc -u 192.168.0.12 80` -``` - -It can ping a port, similar to `ping`: - - -``` -`$ nc -zvn 192.168.0.12 25` -``` - -It can probe for open ports, similar to `nmap`: - - -``` -`$ nc -zv 192.168.0.12 25-80` -``` - -And that's just a small sample. - -### you - -The Linux terminal is, in part, about creative problem-solving. When you learn commands, you're also learning building blocks you can use to create your own commands. Many of the commands in my [shell history][23] are shell scripts I've written myself. The result is that my workflow is customized to how I want to work. Essential commands in your shell can also be the ones you design for your own efficacy and comfort. Spend some time getting to know some great commands, and then build your own. And when you hit upon something really good, make it open source so you can share your ideas with others! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/essential-linux-commands - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者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/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) -[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[3]: https://opensource.com/article/20/12/sed -[4]: https://opensource.com/article/21/3/sed-cheat-sheet -[5]: https://opensource.com/article/21/3/grep-cheat-sheet -[6]: https://opensource.com/downloads/grep-cheat-sheet -[7]: https://opensource.com/article/19/8/dig-binary-files-hexdump -[8]: https://opensource.com/article/21/1/learn-awk -[9]: https://opensource.com/article/20/9/awk-ebook -[10]: https://opensource.com/article/20/5/curl-cheat-sheet -[11]: https://www.redhat.com/sysadmin/use-curl-api -[12]: https://opensource.com/downloads/curl-command-cheat-sheet -[13]: https://opensource.com/article/21/8/linux-procps-ng -[14]: https://opensource.com/article/19/2/getting-started-cat-command -[15]: https://www.redhat.com/sysadmin/yaml-beginners -[16]: https://opensource.com/article/21/8/find-files-and-directories-find -[17]: https://opensource.com/article/19/7/master-ls-command -[18]: https://opensource.com/article/17/7/how-unzip-targz-file -[19]: https://opensource.com/article/21/8/move-files-linux -[20]: https://opensource.com/article/21/8/rename-file-linux-terminal -[21]: https://opensource.com/article/19/10/know-about-sudo -[22]: https://opensource.com/article/20/3/external-drives-linux -[23]: https://opensource.com/article/18/6/history-command diff --git a/translated/tech/20210901 20 essential Linux commands for every user.md b/translated/tech/20210901 20 essential Linux commands for every user.md new file mode 100644 index 0000000000..65eb1115a2 --- /dev/null +++ b/translated/tech/20210901 20 essential Linux commands for every user.md @@ -0,0 +1,242 @@ +[#]: subject: "20 essential Linux commands for every user" +[#]: via: "https://opensource.com/article/21/9/essential-linux-commands" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "unigeorge" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用户必会的 20 个 Linux 命令 +====== +无论新手老手,这 20 个 Linux 命令都能让你的操作更轻松。 +![Command line prompt][1] + +在黝黑的终端窗口中输入命令,这样的方式对某些人群来说可能好像过时了,但对许多专业计算机用户来说,这几乎是计算机完成能够执行的所有任务的最有效、最简便和最清晰的方式。如今,一些项目将开源命令引入了 macOS 和 Windows 等非开放平台,因此终端命令不仅仅是针对 Linux 和 BSD 用户,更是与每个人都息息相关。你可能会惊讶地发现,在一台普通的 [POSIX][2] 计算机上安装了数千个命令,当然,其中很多命令并不是真的有用,至少不是直接或定期性被使用。而其中的一部分命令虽然不是有效终端必须使用的命令,但相比其他命令而言使用频率较高,值得大家学习一下。 + +以下是终端用户最可能会使用的前 20 个命令: + +### cd + +在终端外,你可以单击图标从一个文件夹移动到另一个文件夹,但在终端中,你需要使用 `cd`。`cd` 命令代表 _change directory_(变更目录),是用户在 Linux 系统中移动的方式。这是 Linux 中从一个地方到另一个地方最快、最直接的路线。 + +例如,在桌面上,当你想从你的主目录(你保存所有文件夹的地方)移动到一个名为 `presentations` 的文件夹时,你首先要打开你的 `Documents` 文件夹,然后打开一个名叫 `work` 的文件夹,然后是 `projects` 文件夹,然后是`conference` 文件夹,最后是 `presentations` 文件夹,里面存放的是 LibreOffice Impress 幻灯片。这个过程包含了很多次的双击操作。同时屏幕上还需要许多移动动作,这取决于新窗口出现的位置,以及大脑需要跟踪的许多路径点。许多人通过将 _所有文件_ 都放在桌面上来避免这个看似微不足道的任务。 + +而终端用户只需键入以下内容即可避免此问题: + +``` +$ cd ~/Documents/work/projects/conference/presentations +``` + +一些有经验的终端用户甚至都懒得输入所有这些,而是使用 **Tab** 键自动完成单词填充。更甚者,有时你都不必依赖自动完成,而是改用通配符: + +``` +$ cd ~/Doc*/work/*/conf*/p* +``` + +### pwd + +用 Buckaroo Banzai 的话来说:“无论你走到哪里,你就在那里。” + +当你想弄清楚确切位置时,就可以使用 `pwd` 命令。`pwd` 代表 _print working directory_(打印工作目录),这正是它的作用。`--physical`(在某些情况时缩写为 `-P`)显示解析所有符号链接后的确切位置。 + +``` +$ pwd +/home/tux/presentation + +$ pwd --physical +/home/tux/Documents/work/projects/conference/presentations +``` + +### sed + +流编辑器 `sed` 更广为人知的是一个强大的批量 _查找和替换_ 命令,但它同时也是一个合法的文本编辑器。你可以通过阅读我的 [介绍性文章][3] 来学习使用它,然后通过我的 [高级教程和备忘录][4] 成为老手。 + +### grep + +`grep` 命令使用很普遍,以至于经常被用作动词(例如“我会通过一些文件 grep”)和动名词(例如“grep 一些输出”)。无论是查看日志文件还是解析其他命令的输出,它都是在 shell 中解析文本时的关键组件。这是忙碌的用户专注于特定信息的一种方式。考虑一下计算世界中的数据量,grep 命令的流行就见怪不怪了。你可以通过阅读我的 [介绍性文章][5] 了解 grep,然后下载 [备忘录][6] 学习。 + +### file + +当你需要知道文件包含什么类型的数据时,请使用 `file` 命令: + +``` +$ file example.foo +example.foo: RIFF (little-endian) data, Web/P image [...] + +$ file example.bar +example.bar: ELF 64-bit LSB executable, x86-64 [...] +``` + +当然,`file` 命令并不神奇。它不过是根据文件如何识别自身进行输出,并且文件可能是错误的、损坏的或伪装的。使用 [`hexdump`][7] 进行严格检查的方式确定性更强,但对于日常使用而言,`file` 命令非常方便。 + +### awk + +awk 不仅仅是一个命令,它还是一种文字 [编程语言][8]。[点此下载我们的免费 Awk 电子书][9] 进行学习,你可能会写出远超你想象的脚本。 + +### curl + +`curl` 命令是用于终端的 [非交互式 Web 浏览器][10]。它是面向 Web 和 API 开发人员的 [开发工具][11]。因为灵活性,它是一个复杂的命令,但如果你想从你的终端顺利地与网络服务交互,该命令是很值得学习的。 + +下载我们免费的 [`curl` 备忘录][12],你可以从中学会 `curl` 的许多选项。 + +### ps + +管理系统资源主要由内核负责,当你更喜欢或更需要手动管理时,可以使用 `ps` 命令。读者可以在我的 [使用 procps-ng 监控 Linux 系统][13] 文章中了解 `ps`。 + +### cat + +[`cat` 命令][14] 是 _concatenate_(连接)的缩写,它曾因为能将由于大小限制而被(使用 `split` 命令)拆分成的若干小文件合并而非常有用。如今,`cat` 主要是用来将文本文件的内容转储到终端中以供快速阅读,除非你为此专门去使用 `head`、`tail`、`more` 或 `less` 等命令。 + +尽管它的原始用途几乎已被弃用,并且其他几个命令也主要是执行其次要功能,但 `cat` 仍然是一个有用的工具。例如,它可以是复制 (`cp`) 命令的替代品: + +``` +$ cat myfile.ogg > /backups/myfile.ogg +``` + +它可以显示文件中不便观察的隐形字符。例如,使用 `--show-tabs` 选项,分割 [YAML][15] 的 **Tab** 字符就会显示为 `^I`: + +``` +$ cat --show-tabs my.yaml + +\--- + +\- hosts: all +  tasks: +  - name: Make sure the current version of 'sysstat' is installed. +    dnf: +     name: +^I- sysstat +^I- httpd +^I- mariadb-server +     state: latest +``` + +它还可以用 `--show-nonprinting` 显示非打印字符,用 `--show-ends` 标记行尾,用 `--number` 提供行号,等等。 + +### find + +`find` 命令可以用来查找文件,但它还有许多选项,这些选项可以帮助你查找具有各种过滤器和参数的文件。读者可以从我的 [介绍性文章][16] 中学习该命令的基础知识。 + +如果你一直想知道为什么最基本的,不起眼的 [`ls` 命令][17],不在本文列表中,那是因为 `find` 的灵活性。它不仅可以找到列表文件: + +``` +$ find . +./bar.txt +./baz.xml +./foo.txt +[...] +``` + +它还可以提供包含详细信息的长列表功能: + +``` +$ find . -ls +3014803  464 -rw-rw-r--   1 tux users  473385 Jul 26 07:25 ./foo.txt +3014837  900 -rwxrwxr-x   1 tux users  918217 Nov  6  2019 ./baz.xml +3026891  452 -rw-rw-r--   1 tux users  461354 Aug 10 13:41 ./foo.txt +[...] +``` + +这是一个技术问题,但也是很一个巧妙的技巧。 + +### tar + +人们有时会引用 BSD 的 `tar` 语法来拿 Linux 命令开玩笑。尽管广为人赞,但 `tar` 命令实际上非常直观。读者可以阅读我的 [如何解压缩 tar.gz 文件][18] 文章,了解按需使用 `tar` 命令的简单知识。 + +### more or less or most + +这些统称为 pager 命令。pager 命令与 `cat` 类似,但前者会在屏幕底部暂停输出,直到你向下滚动查看更多内容。这些命令比较简单,但每个之间都有细微差别。用户是用箭头键还是空格键滚动?是必须手动退出,还是在显示的文件末尾自动退出?用户的首选搜索行为是什么样的?选择你最喜欢的 pager 命令并将其设置在 `.bashrc` 中吧! + +### ssh and scp + +OpenSSH 不仅有助于保护与远程系统的连接安全,还可以用于启用其他命令。例如,对于许多用户来说,有了 `.ssh` 目录,他们才能与 Git 存储库顺利交互、将更新发布到网站、登录云控制平面。 + +### mv + +`mv` 命令有双重作用:它既 [移动文件][19] 又 [重命名文件][20]。它有几个可用的保护措施,例如 `--interactive` 和 `--no-clobber` 选项避免破坏现有文件,`--backup` 命令确保数据在新位置验证之前被保留,以及 `--update` 选项确保旧版本不会替换新版本文件。 + +### sudo + +当某个用户账户的用户名已知,且具有 _全部_ 系统权限时,该用户很快就会成为黑客攻击的目标。`sudo` 命令消除了对字面上 `root` 用户的需求,从而优雅地移除了有关系统的重要信息。不过这还不是全部,使用 `sudo` 你还可以轻松地将权限管理到单个命令、用户和组。你可以启用选择命令的无密码执行、记录用户会话、使用摘要验证验证命令,[以及更多操作][21]。 + +### alias + +使用 `alias` 命令将长命令变成易于记忆的快捷方式: + +``` +`$ alias ls='ls --classify --almost-all --ignore-backups --color'` +``` + +### clear + +有时终端会显得很混乱,输入 `clear`(或在某些 shell 中按 **Ctrl+L**)后,你就能得到漂亮、全新的屏幕了。 + +### setfacl + +传统上,POSIX 文件权限由 `chown` 和 `chmod` 决定。然而,如今系统变得更加复杂,因此有一个灵活性更高的命令。`setfacl` 命令允许创建一个 [访问控制列表 (ACL)][22],可以配置任意用户所需权限,并可以为文件夹及其中创建的内容设置默认权限。 + +### netcat + +可能需要使用 netcat (`nc`) 的人不多,但这些使用人对它的依赖度会很高。`nc` 命令是一个通用的网络连接工具。 + +它可以连接到一个端口,类似于 `telnet` 命令: + +``` +$ nc -u 192.168.0.12 80 +``` + +它可以 ping 一个端口,类似于 `ping` 命令: + +``` +$ nc -zvn 192.168.0.12 25 +``` + +它可以探测开放端口,类似于 `nmap` 命令: + +``` +$ nc -zv 192.168.0.12 25-80 +``` + +以上仅是该命令的一小部分用途。 + +### 你自己构建的命令 + +在某种程度上,Linux 终端是关于创造性解决问题的平台。当你学习命令时,你也在学习可用于创建自己的命令的构造块。我的 [shell history][23] 中的许多命令都是自己编写的 shell 脚本,从而我实现了根据自己想要的工作方式定制工作流程。你为自己的效率和舒适度而设计的命令也可以作为 shell 中的基本命令。花些时间了解一些很棒的命令,然后试着构建自己的命令吧。当你构建出的命令非常好用时,把它开源,这样就可以与他人分享你的想法啦! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/essential-linux-commands + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[unigeorge](https://github.com/unigeorge) +校对:[校对者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/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[3]: https://opensource.com/article/20/12/sed +[4]: https://opensource.com/article/21/3/sed-cheat-sheet +[5]: https://opensource.com/article/21/3/grep-cheat-sheet +[6]: https://opensource.com/downloads/grep-cheat-sheet +[7]: https://opensource.com/article/19/8/dig-binary-files-hexdump +[8]: https://opensource.com/article/21/1/learn-awk +[9]: https://opensource.com/article/20/9/awk-ebook +[10]: https://opensource.com/article/20/5/curl-cheat-sheet +[11]: https://www.redhat.com/sysadmin/use-curl-api +[12]: https://opensource.com/downloads/curl-command-cheat-sheet +[13]: https://opensource.com/article/21/8/linux-procps-ng +[14]: https://opensource.com/article/19/2/getting-started-cat-command +[15]: https://www.redhat.com/sysadmin/yaml-beginners +[16]: https://opensource.com/article/21/8/find-files-and-directories-find +[17]: https://opensource.com/article/19/7/master-ls-command +[18]: https://opensource.com/article/17/7/how-unzip-targz-file +[19]: https://opensource.com/article/21/8/move-files-linux +[20]: https://opensource.com/article/21/8/rename-file-linux-terminal +[21]: https://opensource.com/article/19/10/know-about-sudo +[22]: https://opensource.com/article/20/3/external-drives-linux +[23]: https://opensource.com/article/18/6/history-command From 2636436f5f9ee26a38b6931c4ad99c89b10e2205 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 22:39:35 +0800 Subject: [PATCH 121/138] APL --- .../tech/20210719 Apps for daily needs part 2- office suites.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210719 Apps for daily needs part 2- office suites.md b/sources/tech/20210719 Apps for daily needs part 2- office suites.md index d5a84fe848..015760bf74 100644 --- a/sources/tech/20210719 Apps for daily needs part 2- office suites.md +++ b/sources/tech/20210719 Apps for daily needs part 2- office suites.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/) [#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0e88919fc4a649a7637454193b29d737ff5fcc94 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 23:19:01 +0800 Subject: [PATCH 122/138] TSL&PRF --- ...s for daily needs part 2- office suites.md | 124 ------------------ ...s for daily needs part 2- office suites.md | 116 ++++++++++++++++ 2 files changed, 116 insertions(+), 124 deletions(-) delete mode 100644 sources/tech/20210719 Apps for daily needs part 2- office suites.md create mode 100644 translated/tech/20210719 Apps for daily needs part 2- office suites.md diff --git a/sources/tech/20210719 Apps for daily needs part 2- office suites.md b/sources/tech/20210719 Apps for daily needs part 2- office suites.md deleted file mode 100644 index 015760bf74..0000000000 --- a/sources/tech/20210719 Apps for daily needs part 2- office suites.md +++ /dev/null @@ -1,124 +0,0 @@ -[#]: subject: (Apps for daily needs part 2: office suites) -[#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/) -[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Apps for daily needs part 2: office suites -====== - -![][1] - -Photo by [Brooke Cagle][2] on [Unsplash][3] - -Today, almost every family has a desktop computer or laptop. That’s because the computer has become a very important requirement. Moreover, many people have to create documents and presentations in digital format for work or study. Therefore, the office suites are must-have application on almost all computers. This article will introduce some of the open source office suites that you can use on Fedora Linux. You may need to install the software mentioned. If you are unfamiliar with how to add software packages in Fedora Linux, see my earlier article [Things to do after installing Fedora 34 Workstation][4]. Here is the list of apps for daily needs in the office suites category. - -### LibreOffice - -LibreOffice is the most popular office suite among GNU/Linux users. It has a user interface and user experience similar to Microsoft Office. This makes LibreOffice easy to learn for those who have just migrated from Microsoft Office. LibreOffice has complete features to meet your needs working on documents and presentations. It consists of six applications: Writer, Calc, Impress, Draw, Math, and Base. - -The first application is Writer that is used to create various kinds of documents, such as letters, faxes, agendas, minutes, etc. It is a full-featured word processing and desktop publishing tool. The second application is Calc which is a spreadsheet program that is perfect for presenting data and documenting it in tabular format. Calc can create simple tables or do professional data analysis. The third application is Impress which is an easy-to-use presentation application. You can easily choose what you features want in your presentation slides, such as text, images, tables, diagrams, etc. - -![LibreOffice Writer][5] - -![LibreOffice Calc][6] - -![LibreOffice Impress][7] - -The three LibreOffice applications mentioned earlier are the most commonly used applications in creating documents and presentations. However, LibreOffice provides three other applications that are also very useful. The first is Draw which can be used to create drawings and diagrams, ranging from simple to complex. The next application is Math which can help us make perfectly formatted mathematical and scientific formulas. The last is Base which is an application for processing databases. - -![LibreOffice Draw][8] - -![LibreOffice Math][9] - -![LibreOffice Base][10] - -More information is available at this link: - -* * * - -### ONLYOFFICE - -ONLYOFFICE is an office suite application that is highly compatible with Microsoft Office. Therefore we do not have to worry about collaborating with colleagues who use Microsoft Office because it can read various file formats such as docx, xlsx, and pptx. - -ONLYOFFICE provides three applications with a clean and modern look. We can easily find the features and tools that we need. Although the features are not as complete as LibreOffice, they are very sufficient to help us create good documents and presentations. - -The first application is Documents Editor which has the same function as Writer from LibreOffice. It has all the basic features needed in a word processor, such as managing fonts and styles, formatting text, adjusting line and paragraph spacing, inserting headers and footers, customizing page layout, and setting margins. The second application is Spreadsheet Editor which is an application for processing data and creating it as a document in tabular format. It is an application with the same functionality as Calc. The last one is Presentations Editor which is a presentation application with functions similar to Impress. - -Unfortunately ONLYOFFICE is not available in the official Fedora Linux repositories. But you can still install it on Fedora Linux using Flatpak or Appimages. - -![ONLYOFFICE Documents Editor][11] - -![ONLYOFFICE Spreadsheets Editor][12] - -![ONLYOFFICE Presentations Editor][13] - -More information is available at this link: - -* * * - -### Calligra - -Calligra is an office suite created by KDE. Therefore, this application is actually more suitable for users of the KDE Plasma desktop environment. But it can still run well on other desktop environments, such as Fedora Workstation using GNOME. - -Calligra provides several applications with a slightly different look from LibreOffice or ONLYOFFICE. It may take some adjustment for those who are used to mainstream office suite applications. However, Calligra is still a reliable office suite to support our daily needs. - -The first application is Words which is an intuitive word processor with desktop publishing features. It has a full range of features to help us in document creation. The second application is Sheets which has the same functionality as Calc and Spreadsheet Editors as a fully-featured spreadsheet application. The third application is Stage which can help us in making presentation slides. - -![Calligra Words][14] - -![Calligra Sheets][15] - -![Calligra Stage][16] - -The three Calligra applications are the most commonly used applications for creating documents and presentations. There are three other applications that are also very useful. The first is Karbon which can be used to create drawings and diagrams, ranging from simple to complex. The next application is Plan which is project management application that can help in managing moderately large projects with multiple resources. The last is KEXI which is a visual database application creator. - -![Calligra Karbon][17] - -![Calligra Plan][18] - -![Calligra Kexi][19] - -More information is available at this link: - -* * * - -### Conclusion - -This article presented 3 office suites for your daily needs that you can use on Fedora Linux. If you want a complete set of features in your office suite, then LibreOffice may be the right choice. For good compatibility with Microsoft Office, then you may choose ONLYOFFICE. However, if you want a different user interface and experience in creating documents and presentations, you can try Calligra. Hopefully this article can help you to choose the right office suite. If you have experience in using these applications, please share your experience in the comments. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/ - -作者:[Arman Arisman][a] -选题:[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/armanwu/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-2-Office-816x345.jpg -[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ -[5]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-writer-1-1024x575.png -[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-calc-1-1024x575.png -[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-impress-1-1024x575.png -[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-draw-1-1024x575.png -[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-math-1-1024x575.png -[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-base-1-1024x575.png -[11]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-doc-1024x575.png -[12]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-sheet-1024x575.png -[13]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-presentation-1024x575.png -[14]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-words-1024x575.png -[15]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-sheets-1024x575.png -[16]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-stage-1024x575.png -[17]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-karbon-1-1024x575.png -[18]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-plan-1024x575.png -[19]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-kexi-1024x575.png diff --git a/translated/tech/20210719 Apps for daily needs part 2- office suites.md b/translated/tech/20210719 Apps for daily needs part 2- office suites.md new file mode 100644 index 0000000000..d1d3378ab3 --- /dev/null +++ b/translated/tech/20210719 Apps for daily needs part 2- office suites.md @@ -0,0 +1,116 @@ +[#]: subject: (Apps for daily needs part 2: office suites) +[#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/) +[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +满足日常需求的应用(二):办公套件 +====== + +![][1] + +今天,几乎每个家庭都有一台台式电脑或笔记本电脑。这是因为计算机已经成为一个非常重要的要求。此外,不管是为了工作还是学习,许多人需要创建电子版的文档和演示文稿。因此,办公套件是几乎所有计算机上的必备应用程序。本文将介绍一些你可以在 Fedora Linux 上使用的开源办公套件。这些软件你可能需要安装。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章 [安装 Fedora 34 工作站后要做的事情][4]。下面是满足日常需求的办公套件类的应用程序列表。 + +### LibreOffice + +LibreOffice 是 GNU/Linux 用户中最流行的办公套件。它的用户界面和用户体验类似于微软 Office。这使得 LibreOffice 对于那些刚刚从微软 Office 迁移过来的人来说很容易学习。LibreOffice 有完整的功能,可以满足你在文档和演示方面的工作需要。它由六个应用程序组成:Writer、Calc、Impress、Draw、Math 和 Base。 + +第一个应用程序是 Writer,用于创建各种类型的文档,如信件、传真、议程、会议记录等。它是一个全功能的文字处理和桌面出版工具。第二个应用程序是 Calc,它是一个电子表格程序,非常适合以表格形式呈现数据和记录数据。Calc 可以创建简单的表格或进行专业的数据分析。第三个应用程序是 Impress,它是一个易于使用的演示应用程序。你可以很容易地选择你在演示幻灯片中想要的功能,如文本、图像、表格、图表等。 + +![LibreOffice Writer][5] + +![LibreOffice Calc][6] + +![LibreOffice Impress][7] + +前面提到的三个 LibreOffice 应用程序是创建文档和演示文稿中最常用的应用程序。然而,LibreOffice 提供的其他三个应用程序也非常有用。第一个是 Draw,它可以用来创建从简单到复杂的图纸和图表。下一个应用程序是 Math,它可以帮助我们做出完美格式的数学和科学公式。最后一个是 Base,这是一个用于处理数据库的应用程序。 + +![LibreOffice Draw][8] + +![LibreOffice Math][9] + +![LibreOffice Base][10] + +更多信息请见此链接: + +### ONLYOFFICE + +ONLYOFFICE 是一款与微软 Office 高度兼容的办公套件应用程序。因此,我们与使用微软 Office 的同事协作时就不必担心了,因为它可以读取各种文件格式,如 docx、xlsx 和 pptx。 + +ONLYOFFICE 提供了三种具有简洁和现代外观的应用程序。我们可以很容易地找到我们需要的功能和工具。虽然功能没有 LibreOffice 那么齐全,但也足以帮助我们创建良好的文档和演示文稿。 + +第一个应用程序是文档编辑器,它的功能与 LibreOffice 的 Writer 相同。它具有文字处理器所需的所有基本功能,如管理字体和样式、格式化文本、调整行距和段距、插入页眉和页脚、自定义页面布局和设置页边距。第二个应用程序是电子表格编辑器,它是一个用于处理数据并将其创建为表格格式的文件的应用程序。它是一个具有与 Calc 相同功能的应用程序。最后一个是演示文稿编辑器,它是一个演示文稿应用程序,其功能类似于 Impress。 + +不幸的是,ONLYOFFICE 在官方的 Fedora Linux 软件库中并没有提供。但是你仍然可以使用 Flatpak 或 Appimages 在 Fedora Linux 上安装它。 + +![ONLYOFFICE Documents Editor][11] + +![ONLYOFFICE Spreadsheets Editor][12] + +![ONLYOFFICE Presentations Editor][13] + +更多信息请见此链接: + +### Calligra + +Calligra 是一个由 KDE 创建的办公套件。因此,这个应用程序实际上更适合于 KDE Plasma 桌面环境的用户。但它仍然可以在其他桌面环境中良好运行,例如使用 GNOME 的 Fedora 工作站。 + +Calligra 提供的几个应用程序的外观与 LibreOffice 或 ONLYOFFICE 略有不同。对于那些习惯于主流办公套件应用程序的人来说,可能需要一些适应。然而,Calligra 仍然是一个可靠的办公套件,足以支持我们的日常需求。 + +第一个应用程序是 Words,它是一个具有桌面出版功能的直观的文字处理器。它具有帮助我们进行文档创作的全面功能。第二个应用程序是 Sheets,它具有与 Calc 和电子表格编辑器相同的功能,是一个功能齐全的电子表格应用程序。第三个应用程序是 Stage,它可以帮助我们制作演示幻灯片。 + +![Calligra Words][14] + +![Calligra Sheets][15] + +![Calligra Stage][16] + +这三个 Calligra 应用程序是创建文档和演示文稿最常用的应用程序。另外还有三个应用程序也非常有用。第一个是 Karbon,它可以用来创建从简单到复杂的图纸和图表。下一个应用程序是 Plan,这是一个项目管理应用程序,可以帮助管理具有多种资源的中等规模的项目。最后一个是 KEXI,它是一个可视化数据库应用程序的创建器。 + +![Calligra Karbon][17] + +![Calligra Plan][18] + +![Calligra Kexi][19] + +更多信息请见此链接: + +### 总结 + +这篇文章介绍了 3 个可以在 Fedora Linux 上使用的办公套件,以满足你的日常需要。如果你想拥有具有一套完整功能的办公套件,那么 LibreOffice 可能是正确的选择。如果想与微软 Office 有良好的兼容性,那么你可以选择 ONLYOFFICE。然而,如果你想要一个不同的用户界面和创建文档和演示文稿的体验,你可以试试 Calligra。希望这篇文章能帮助你选择合适的办公套件。如果你有使用这些应用程序的经验,请在评论中分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/ + +作者:[Arman Arisman][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-2-Office-816x345.jpg +[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ +[5]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-writer-1-1024x575.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-calc-1-1024x575.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-impress-1-1024x575.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-draw-1-1024x575.png +[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-math-1-1024x575.png +[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-base-1-1024x575.png +[11]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-doc-1024x575.png +[12]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-sheet-1024x575.png +[13]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-presentation-1024x575.png +[14]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-words-1024x575.png +[15]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-sheets-1024x575.png +[16]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-stage-1024x575.png +[17]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-karbon-1-1024x575.png +[18]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-plan-1024x575.png +[19]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-kexi-1024x575.png From a9050b78720219623c02f9ef4f1732b1f1e40650 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 23:22:09 +0800 Subject: [PATCH 123/138] PUB @wxy https://linux.cn/article-13755-1.html --- .../20210719 Apps for daily needs part 2- office suites.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210719 Apps for daily needs part 2- office suites.md (99%) diff --git a/translated/tech/20210719 Apps for daily needs part 2- office suites.md b/published/20210719 Apps for daily needs part 2- office suites.md similarity index 99% rename from translated/tech/20210719 Apps for daily needs part 2- office suites.md rename to published/20210719 Apps for daily needs part 2- office suites.md index d1d3378ab3..eb2f6ecbcf 100644 --- a/translated/tech/20210719 Apps for daily needs part 2- office suites.md +++ b/published/20210719 Apps for daily needs part 2- office suites.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13755-1.html) 满足日常需求的应用(二):办公套件 ====== From d114231cb5ec1b5a46f746200d8a6be21ac6be87 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 6 Sep 2021 05:02:35 +0800 Subject: [PATCH 124/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210906=20?= =?UTF-8?q?Getting=20the=20Top=20Indicator=20Panel=20Back=20in=20GNOME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md --- ...g the Top Indicator Panel Back in GNOME.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md diff --git a/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md b/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md new file mode 100644 index 0000000000..efeb2a3dad --- /dev/null +++ b/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md @@ -0,0 +1,82 @@ +[#]: subject: "Getting the Top Indicator Panel Back in GNOME" +[#]: via: "https://itsfoss.com/enable-applet-indicator-gnome/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Getting the Top Indicator Panel Back in GNOME +====== + +GNOME is the popular desktop environment that thrives to give Linux a modern desktop experience. + +While it works for the most part, some of their decisions has left the user fuming and questioning. + +You cannot have icons and files on the desktop, [new document option has been removed][1] from the right click context menu. In addition to that, GNOME has also removed the applet indicator functionality. + +You know what indicator applets are, don’t you? Those little icons that let you access additional features of the given application. I have plenty of them in my Ubuntu system. + +![Indicator applets][2] + +And this creates a problem, specially for applications that rely completely on these applet indicators to function. Take [Dropbox][3] for example. The only way to access Dropbox settings is through the app-indicator and you won’t find it in GNOME. + +That’s a problem, but thankfully, there is a workaround for that. + +### Enabling applet indicator in GNOME via extension + +If you are using GNOME, you probably already know what GNOME Extension is. These are basically small add-ons developed by enthusiastic, independent developers. + +If not done already, [enable GNOME extensions][4]. It’s actually quite simple. Go to any GNOME extension’s page using Firefox or Chrome and it will suggest downloading a browser extension. Install it and you are good to go. + +![Enabling GNOME Extension browser add-on][5] + +Now, there are several GNOME extensions available that allow adding applet indicators in the top panel. At the time of writing this tutorial, [AppIndicator and KStatusNotifierItem Support][6] extension is well developed and supported for the recent GNOME versions. + +Go to its webpage: + +[AppIndicator Extension][6] + +On the page, you should see a toggle button. Click it to install it. + +![][7] + +There will be a pop-up. Hit install when you see it. + +![Install the extension][8] + +The results won’t be seen immediately. You’ll have to restart GNOME. On Xorg, you could just use Alt+F2 and enter r but that does not work in Wayland. + +Log out of the system and log back in. Applet indicator should be activated now. If you have any applications installed that provides an indicator applet, you should see it on the top panel. + +In my case, I had Dropbox already installed and hence it started showing the icon in the top panel. + +![Dropbox indicator working in GNOME][9] + +I hope this little tip help you gain access to the app indicators in the top panel of GNOME again. + +I do not know why the GNOME developers though that dropping this essential feature was a good idea. Anyway, if one door closes, another opens (usually). Enjoy GNOME to your liking. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/enable-applet-indicator-gnome/ + +作者:[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/add-new-document-option/ +[2]: https://itsfoss.com/wp-content/uploads/2021/09/indicator-applet-linux.webp +[3]: https://www.dropbox.com +[4]: https://itsfoss.com/gnome-shell-extensions/ +[5]: https://itsfoss.com/wp-content/uploads/2021/09/installing-gnome-extension-add-on-800x355.webp +[6]: https://extensions.gnome.org/extension/615/appindicator-support/ +[7]: https://itsfoss.com/wp-content/uploads/2021/09/appindicator-extension-800x329.webp +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-appindicator-extension.png?resize=800%2C269&ssl=1 +[9]: https://itsfoss.com/wp-content/uploads/2021/09/gnome-dropbox-indicator-800x561.webp From 55ba06686d72063d0fa323c715fa5ffecc9f3e07 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 6 Sep 2021 05:02:58 +0800 Subject: [PATCH 125/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210905=20?= =?UTF-8?q?Create=20a=20photo=20collage=20from=20the=20Linux=20command=20l?= =?UTF-8?q?ine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210905 Create a photo collage from the Linux command line.md --- ...oto collage from the Linux command line.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20210905 Create a photo collage from the Linux command line.md diff --git a/sources/tech/20210905 Create a photo collage from the Linux command line.md b/sources/tech/20210905 Create a photo collage from the Linux command line.md new file mode 100644 index 0000000000..02b48cb3c0 --- /dev/null +++ b/sources/tech/20210905 Create a photo collage from the Linux command line.md @@ -0,0 +1,91 @@ +[#]: subject: "Create a photo collage from the Linux command line" +[#]: via: "https://opensource.com/article/21/9/photo-montage-imagemagick" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Create a photo collage from the Linux command line +====== +Here's how I use ImageMagick to make photo grids for my social media +posts. +![Polaroids and palm trees][1] + +ImageMagick is the "Swiss Army knife" of manipulating images on the command line. While you could use a desktop graphics program like GIMP or GLIMPSE to adjust or combine photos and graphics, sometimes it's just easier to use one of the almost dozen tools from ImageMagick. + +For example, I frequently find myself creating image montages to share on social media. Let's say I wanted to share a montage or "image grid" of several screenshots. To do that, I use the ImageMagick `montage` command.  + +ImageMagick is a full suite of tools, and the one I use here is the `montage` command. The general syntax of the `montage` command looks like this: + + +``` +`montage {input} {actions} {output}` +``` + +In my case, my screenshots are already the same size: 320x240 pixels.  To create a montage of six of these images, in a grid that's two screenshots wide by three tall, I can use this command: + + +``` +$ montage acronia.png \ +ascii-table.png \ +music.png \ +programming-chess.png \ +petra.png \ +amb.png \ +-tile 2x3 -geometry +1+1 \  +screenshot-montage.png +``` + +This creates an image that's composed of the six screenshots, with a 1-pixel border around each. Doing the math, that's 644 pixels wide and 726 pixels high. + +Note the order of the images: ImageMagick montage arranges the images from left-to-right and top-to-bottom. + +![Screenshot montage][2] + +(Jim Hall, [CC BY-SA 4.0][3]) + +In my example, the first row of images shows the open source 2D shooter Acronia and an ASCII programming example, the middle row is an open source music player and a chess programming example, and the third row shows the open source game Post Apocalyptic Petra and the FreeDOS AMB Help reader. + +### Install ImageMagick on Linux + +On Linux, you can install ImageMagick using your package manager. For instance, on Fedora or similar: + + +``` +`$ sudo dnf install imagemagick` +``` + +On Debian and similar: + + +``` +`$ sudo apt install imagemagick` +``` + +On macOS, use [MacPorts][4] or [Homebrew][5]. + +On Windows, use [Chocolatey][6]. + +These open source photo libraries help you stay organized while making your pictures look great. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/photo-montage-imagemagick + +作者:[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/design_photo_art_polaroids.png?itok=SqPLgWxJ (Polaroids and palm trees) +[2]: https://opensource.com/sites/default/files/uploads/screenshot-montage_0.png (Screenshot montage) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/article/20/11/macports +[5]: https://opensource.com/article/20/6/homebrew-mac +[6]: https://opensource.com/article/20/3/chocolatey From b458be012622923785e6005108195efb4d37024d Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 6 Sep 2021 08:46:29 +0800 Subject: [PATCH 126/138] translated --- .../20210831 What is a container image.md | 126 ------------------ .../20210831 What is a container image.md | 126 ++++++++++++++++++ 2 files changed, 126 insertions(+), 126 deletions(-) delete mode 100644 sources/tech/20210831 What is a container image.md create mode 100644 translated/tech/20210831 What is a container image.md diff --git a/sources/tech/20210831 What is a container image.md b/sources/tech/20210831 What is a container image.md deleted file mode 100644 index deefbe18d6..0000000000 --- a/sources/tech/20210831 What is a container image.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: subject: "What is a container image?" -[#]: via: "https://opensource.com/article/21/8/container-image" -[#]: author: "Nived V https://opensource.com/users/nivedv" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -What is a container image? -====== -A container image contains a packaged application, along with its -dependencies, and information on what processes it runs when launched. -![Shipping containers stacked][1] - -Containers are a critical part of today's IT operations. A _container image_ contains a packaged application, along with its dependencies, and information on what processes it runs when launched. - -You create container images by providing a set of specially formatted instructions, either as commits to a registry or as a Dockerfile. For example, this Dockerfile creates a container for a PHP web application: - - -``` -FROM registry.access.redhat.com/ubi8/ubi:8.1 - -RUN yum --disableplugin=subscription-manager -y module enable php:7.3 \ -  && yum --disableplugin=subscription-manager -y install httpd php \ -  && yum --disableplugin=subscription-manager clean all - -ADD index.php /var/www/html - -RUN sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf \ -  && sed -i 's/listen.acl_users = apache,nginx/listen.acl_users =/' /etc/php-fpm.d/www.conf \ -  && mkdir /run/php-fpm \ -  && chgrp -R 0 /var/log/httpd /var/run/httpd /run/php-fpm \ -  && chmod -R g=u /var/log/httpd /var/run/httpd /run/php-fpm - -EXPOSE 8080 -USER 1001 -CMD php-fpm & httpd -D FOREGROUND -``` - -Each instruction in this file adds a _layer_ to the container image. Each layer only adds the difference from the layer below it, and then, all these layers are stacked together to form a read-only container image. - -### How does that work? - -You need to know a few things about container images, and it's important to understand the concepts in this order: - - 1. Union file systems - 2. Copy-on-Write - 3. Overlay File Systems - 4. Snapshotters - - - -### Union File Systems (Aufs) - -The Union File System (UnionFS) is built into the Linux kernel, and it allows contents from one file system to be merged with the contents of another, while keeping the "physical" content separate. The result is a unified file system, even though the data is actually structured in branches. - -The idea here is that if you have multiple images with some identical data, instead of having this data copied over again, it's shared by using something called a _layer_. - -![UnionFS][2] - -Image CC BY-SA opensource.com - -Each layer is a file system that can be shared across multiple containers, e.g., The httpd base layer is the official Apache image and can be used across any number of containers. Imagine the disk space we just saved since we are using the same base layer for all our containers. - -These image layers are always read-only, but when we create a new container from this image, we add a thin writable layer on top of it. This writable layer is where you create/modify/delete or make other changes required for each container. - -### Copy-on-write - -When you start a container, it appears as if the container has an entire file system of its own. That means every container you run in the system needs its own copy of the file system. Wouldn't this take up a lot of disk space and also take a lot of time for the containers to boot? No—because every container does not need its own copy of the filesystem! - -Containers and images use a copy-on-write mechanism to achieve this. Instead of copying files, the copy-on-write strategy shares the same instance of data to multiple processes and copies only when a process needs to modify or write data. All other processes would continue to use the original data. Before any write operation is performed in a running container, a copy of the file to be modified is placed on the writeable layer of the container. This is where the _write_ takes place. Now you know why it's called _copy-on-write_. - -This strategy optimizes both image disk space usage and the performance of container start times and works in conjunction with UnionFS. - -### Overlay File System - -An overlay sits on top of an existing filesystem, combines an upper and lower directory tree, and presents them as a single directory. These directories are called _layers_. The lower layer remains unmodified. Each layer adds only the difference (the _diff_, in computing terminology) from the layer below it, and this unification process is referred to as a _union mount_. - -The lowest directory or an Image layer is called _lowerdir_, and the upper directory is called _upperdir_. The final overlayed or unified layer is called _merged._ - -![Layered file system][3] - -Image CC BY-SA opensource.com - -Common terminology consists of these layer definitions: - - * Base layer is where the files of your filesystem are located. In terms of container images, this layer would be your base image. - * Overlay layer is often called the _container layer_, as all the changes that are made to a running container, as adding, deleting, or modifying files, are written to this writable layer. All changes made to this layer are stored in the next layer, and is a _union_ view of the Base and Diff layers. - * Diff layer contains all changes made in the Overlay layer. If you write something that's already in the Base layer, then the overlay file system copies the file to the Diff layer and makes the modifications you intended to write. This is called a _copy-on-write_. - - - -# Snapshotters - -Containers can build, manage, and distribute changes as a part of their container filesystem using layers and graph drivers. But working with graph drivers is really complicated and is error-prone. SnapShotters are different from graph drivers, as they have no knowledge of images or containers. - -Snapshotters work very similar to Git, such as the concept of having trees, and tracking changes to trees for each commit. A _snapshot_ represents a filesystem state. Snapshots have parent-child relationships using a set of directories. A _diff can_ be taken between a parent and its snapshot to create a layer. - -The Snapshotter provides an API for allocating, snapshotting, and mounting abstract, layered file systems. - -### Wrap up - -You now have a good sense of what container images are and how their layered approach makes containers portable. Next up, I'll cover container runtimes and internals. - -* * * - -_This article is based on a [techbeatly][4] article and has been adapted with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/container-image - -作者:[Nived V][a] -选题:[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/nivedv -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers.png?itok=d_4QhZxT (Shipping containers stacked) -[2]: https://opensource.com/sites/default/files/unionfs.png (UnionFS) -[3]: https://opensource.com/sites/default/files/rect1036.png (Layered file system) -[4]: https://medium.com/techbeatly/container-part-ii-images-4f2139194775 diff --git a/translated/tech/20210831 What is a container image.md b/translated/tech/20210831 What is a container image.md new file mode 100644 index 0000000000..596520f951 --- /dev/null +++ b/translated/tech/20210831 What is a container image.md @@ -0,0 +1,126 @@ +[#]: subject: "What is a container image?" +[#]: via: "https://opensource.com/article/21/8/container-image" +[#]: author: "Nived V https://opensource.com/users/nivedv" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +什么是容器镜像? +====== +容器镜像包含一个打包的应用,以及它的依赖关系,还有它在启动时运行的进程信息。 + +![Shipping containers stacked][1] + +容器是当今 IT 运维的一个关键部分。一个_容器镜像_包含了一个打包的应用,以及它的依赖关系,还有它在启动时运行的进程信息。 + +你通过提供一组特殊格式的指令来创建容器镜像,可以是提交给 Registry,或者是 Dockerfile。 例如,这个 Dockerfile 为 PHP Web 应用创建了一个容器: + + +``` +FROM registry.access.redhat.com/ubi8/ubi:8.1 + +RUN yum --disableplugin=subscription-manager -y module enable php:7.3 \ + && yum --disableplugin=subscription-manager -y install httpd php \ + && yum --disableplugin=subscription-manager clean all + +ADD index.php /var/www/html + +RUN sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf \ + && sed -i 's/listen.acl_users = apache,nginx/listen.acl_users =/' /etc/php-fpm.d/www.conf \ + && mkdir /run/php-fpm \ + && chgrp -R 0 /var/log/httpd /var/run/httpd /run/php-fpm \ + && chmod -R g=u /var/log/httpd /var/run/httpd /run/php-fpm + +EXPOSE 8080 +USER 1001 +CMD php-fpm & httpd -D FOREGROUND +``` + +这个文件中的每条指令都会在容器镜像中增加一个_层_。每一层只增加与下面一层的区别,然后,所有这些层叠在一起,形成一个只读的容器镜像。 + +### 这是怎么做到的? + +你需要知道一些关于容器镜像的事情,按照这个顺序理解这些概念很重要: + + 1. Union 文件系统 + 2. 写入时复制 + 3. Overlay 文件系统 + 4. SnapShotters + + + +### Union 文件系统(Aufs) + +Union 文件系统(UnionFS)内置于 Linux 内核中,它允许将一个文件系统的内容与另一个文件系统的内容合并,同时保持“物理”内容的分离。其结果是一个统一的文件系统,即使数据实际上是以分支形式组织。 + +这里的想法是,如果你有多个镜像有一些相同的数据,不是让这些数据再次复制过来,而是通过使用一个叫做_层_的东西来共享。 + +![UnionFS][2] + +图片 CC BY-SA opensource.com + +每一层都是一个可以在多个容器中共享的文件系统,例如,httpd 基础层是 Apache 的官方镜像,可以在任何数量的容器中使用。想象一下,由于我们在所有的容器中使用相同的基础层,我们节省了多少磁盘空间。 + +这些镜像层总是只读的,但是当我们用这个镜像创建一个新的容器时,我们会在它上面添加一个薄的可写层。这个可写层是你创建/修改/删除或进行每个容器所需的其他修改的地方。 + +### 写时复制 + +当你启动一个容器时,看起来好像这个容器有自己的整个文件系统。这意味着你在系统中运行的每个容器都需要自己的文件系统副本。这岂不是要占用大量的磁盘空间,而且还要花费大量的时间让容器启动?不是的,因为每个容器都不需要它自己的文件系统副本! + +容器和镜像使用写时复制机制来实现这一点。写时复制策略不是复制文件,而是将同一个数据实例分享给多个进程,并且只在一个进程需要修改或写入数据时进行复制。所有其他进程将继续使用原始数据。在运行中的容器中执行任何写操作之前,要修改的文件的副本被放在容器的可写层上。这就是发生_写_的地方。现在你知道为什么它被称为“写时复制”了么。 + +这种策略既优化了镜像磁盘空间的使用,也优化了容器启动时间的性能,并与 UnionFS 一起工作。 + +### Overlay 文件系统 + +Overlay 文件系统位于现有文件系统的顶部,结合了上层和下层的目录树,并将它们作为一个单一的目录来呈现。这些目录被称为_层_。下层保持不被修改。每一层只增加与下一层的差异(计算术语为 _diff_),这种统一的过程被称为 _union 挂载_。 + +最低的目录或镜像层被称为 _lowerdir_,上面的目录被称为 _upperdir_。最后的覆盖层或统一层被称为 _merged_。 + +![Layered file system][3] + +图片 CC BY-SA opensource.com + +常见的术语包括这些层的定义: + + * 基础层是你的文件系统的文件所在的地方。就容器镜像而言,这个层就是你的基础镜像。 + * Overlay 层通常被称为_容器层_,因为对运行中的容器所做的所有改变,如添加、删除或修改文件,都会写到这个可写层。对这一层所做的所有修改都存储在下一层,是基础层和 Diff 层的 _union_ 视图。 + * Diff 层包含了在 Overlay 层所作的所有修改。如果你写的东西已经在基础层了,那么 Overlay 文件系统就会把文件复制到 Diff层,并做出你想写的修改。这被称为_写时复制_。 + + + +# SnapShotters + +容器可以使用层和图形驱动程序构建、管理和分发更改作为其容器文件系统的一部分。。但是使用图形驱动的工作真的很复杂,而且容易出错。SnapShotters 与图形驱动不同,因为它们不了解镜像或容器。 + +Snapshotters 的工作方式与 Git 非常相似,比如有树的概念,并跟踪每次提交对树的改变。一个_快照_代表一个文件系统状态。快照有父子关系,使用一组目录。可以在父级和其快照之间进行 _diff_,以创建一个层。 + +Snapshotter 提供了一个用于分配、快照和挂载抽象的分层文件系统的 API。 + +### 总结 + +你现在对什么是容器镜像以及它们的分层方法如何使容器可移植有了很好的认识。接下来,我将介绍容器的运行机制和内部结构。 + +* * * + +_本文基于 [techbeatly][4] 的文章,经许可后改编。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/container-image + +作者:[Nived V][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/nivedv +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers.png?itok=d_4QhZxT (Shipping containers stacked) +[2]: https://opensource.com/sites/default/files/unionfs.png (UnionFS) +[3]: https://opensource.com/sites/default/files/rect1036.png (Layered file system) +[4]: https://medium.com/techbeatly/container-part-ii-images-4f2139194775 From 184cb1f62062b2e4ee97678031d5215e515b7811 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 6 Sep 2021 08:51:22 +0800 Subject: [PATCH 127/138] translated --- sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md b/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md index 4b1d7195ad..5426cce22e 100644 --- a/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md +++ b/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-dropbox-ubuntu/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 118f11c15a25e580eaf2146bce0f99ed31e15800 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 6 Sep 2021 08:59:46 +0800 Subject: [PATCH 128/138] PRF @perfiffer --- ...xt on your screen in Linux with ncurses.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210829 Position text on your screen in Linux with ncurses.md b/translated/tech/20210829 Position text on your screen in Linux with ncurses.md index acaf808c82..5fb564e1e0 100644 --- a/translated/tech/20210829 Position text on your screen in Linux with ncurses.md +++ b/translated/tech/20210829 Position text on your screen in Linux with ncurses.md @@ -3,19 +3,20 @@ [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" [#]: translator: "perfiffer" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 使用 ncurses 在你的 Linux 屏幕上定位文本 ====== -使用 ncurses 在 Linux 屏幕上的特定位置放置文本,可以带来更友好的用户界面体验。 -![Person using a laptop][1] -大多数的 Linux 实用程序仅仅只在屏幕的底部滚动文本。如果你想在屏幕中放置你的文本,例如一个游戏或者一个数据展示,你可以试试 **ncurses**。 +> 使用 ncurses 在 Linux 屏幕上的特定位置放置文本,可以带来更友好的用户界面体验。 -**curses** 是一个旧的 Unix 库,它可以在文本终端界面控制光标。curses 的名称就来自于术语 cursor control。多年以后,其他人编写了新的 **curses** 版本用来添加新的功能,新版本被叫做 new curses 或者 **ncurses**。你可以在每个流行的 Linux 发行版中找到 ncurses。尽管默认情况下可能未安装开发库、头文件和文档。例如,在 Fedora 上,你需要使用以下命令安装 **ncurses-devel** 包: +![](https://img.linux.net.cn/data/attachment/album/202109/06/085908qrdrrv5dru6pcucr.jpg) +大多数的 Linux 实用程序仅仅只在屏幕的底部滚动文本。如果你想在屏幕中放置你的文本,例如一个游戏或者一个数据展示,你可以试试 ncurses。 + +curses 是一个旧的 Unix 库,它可以在文本终端界面控制光标。curses 的名称就来自于术语 “光标控制cursor control”。多年以后,其他人编写了新的 curses 版本用来添加新的功能,新版本被叫做 “new curses” 或者 “ncurses”。你可以在每个流行的 Linux 发行版中找到 ncurses。尽管默认情况下可能未安装开发库、头文件和文档。例如,在 Fedora 上,你需要使用以下命令安装 `ncurses-devel` 包: ``` $ sudo dnf install ncurses-devel @@ -23,37 +24,37 @@ $ sudo dnf install ncurses-devel ### 在程序中使用 ncurses -要在屏幕上直接寻址,你首先需要初始化 **ncurses** 库。大部分程序会通过以下三行来做到这一点: +要在屏幕上直接寻址,你首先需要初始化 `ncurses` 库。大部分程序会通过以下三行来做到这一点: - * initscr(); 初始化窗口对象和 ncurses 代码,返回代表整个屏幕的窗口对象 - * cbreak(); 禁用缓冲并使键入的输入立即可用 - * noecho(); 关闭回显,因此用户输入不会显示在屏幕上 + * `initscr()`:初始化窗口对象和 ncurses 代码,返回代表整个屏幕的窗口对象 + * `cbreak()`:禁用缓冲并使键入的输入立即可用 + * `noecho()`:关闭回显,因此用户输入不会显示在屏幕上 - -这些函数定义在 **curses.h** 头文件中,你需要在你的程序中通过以下方式将其包含进来: +这些函数定义在 `curses.h` 头文件中,你需要在你的程序中通过以下方式将其包含进来: ``` #include ``` -初始化终端后,你可以自由使用任何 **ncurses** 函数,我们将在示例程序中探讨其中的一些函数。 +初始化终端后,你可以自由使用任何 ncurses 函数,我们将在示例程序中探讨其中的一些函数。 -当你使用完 **ncurses** 并想返回到常规终端模式下时,使用 **endwin();** 重置一切。此命令可以重置任何屏幕颜色,将光标移动到屏幕的左下角,并使光标可见。通常在退出程序之前执行此操作。 +当你使用完 ncurses 并想返回到常规终端模式下时,使用 `endwin()` 重置一切。此命令可以重置任何屏幕颜色,将光标移动到屏幕的左下角,并使光标可见。通常在退出程序之前执行此操作。 ### 在屏幕上寻址 -关于 **ncurses** 首先需要知道的是屏幕的坐标分为行和列,左上角的是 0,0 点。**ncurses** 定义了两个全局变量来帮助你识别屏幕:LINES 是屏幕的行数,COLS 是屏幕的列数。屏幕右下角的位置是 LINES-1,COLS-1。 -例如,如果你想要移动光标到第 10 行和第 30 列,你可以使用移动函数,移动到此坐标: +关于 ncurses 首先需要知道的是屏幕的坐标分为行和列,左上角的是 `0,0` 点。ncurses 定义了两个全局变量来帮助你识别屏幕:`LINES` 是屏幕的行数,`COLS` 是屏幕的列数。屏幕右下角的位置是 `LINES-1,COLS-1`。 + +例如,如果你想要移动光标到第 10 行和第 30 列,你可以使用 `move()` 函数,移动到此坐标: ``` move(10, 30); ``` -之后显示的任何文本都将从屏幕的该位置开始。要显示单个字符,请对单个字符使用 **addch(c)** 函数。要显示字符串,将对字符串使用 **addstr(s)** 函数。对于类似于 **printf** 的格式化输出,请使用带有常用选项的 **printw(fmt, …)**。 +之后显示的任何文本都将从屏幕的该位置开始。要显示单个字符,请对单个字符使用 `addch(c)` 函数。要显示字符串,将对字符串使用 `addstr(s)` 函数。对于类似于 `printf` 的格式化输出,请使用带有常用选项的 `printw(fmt, ...)`。 -移动到屏幕指定位置和显示文本是一件很常见的事情,**ncurses** 提供了同时执行这两项操作的快捷方式。**mvaddch(row, col, c)** 函数将在屏幕第 row 行,第 col 列的位置显示一个字符。而 **mvaddstr(row, col, s)** 函数将在屏幕第 row 行,第 col 列的位置显示一个字符串。更直接的例子,在程序中使用 **mvaddstr(10, 30, "Welcome to ncurses");** 函数将从屏幕的第 10 行和第 30 列开始显示文本 "Welcome to ncurses"。使用 **mvaddch(0, 0, '+');** 函数将在屏幕的左上角第 0 行和第 0 列处显示一个加号。 +移动到屏幕指定位置和显示文本是一件很常见的事情,ncurses 提供了同时执行这两项操作的快捷方式。`mvaddch(row, col, c)` 函数将在屏幕第 `row` 行,第 `col` 列的位置显示一个字符。而 `mvaddstr(row, col, s)` 函数将在屏幕第 `row` 行,第 `col` 列的位置显示一个字符串。举个更直接的例子,在程序中使用 `mvaddstr(10, 30, "Welcome to ncurses");` 函数将从屏幕的第 `10` 行和第 `30` 列开始显示文本 `Welcome to ncurses`。使用 `mvaddch(0, 0, '+')` 函数将在屏幕的左上角第 `0` 行和第 `0` 列处显示一个加号(`+`)。 -在终端屏幕上绘制文本会对某些系统产生性能影响,尤其是在较旧的硬件终端上。因此 **ncurses** 允许你“堆叠”一堆文本以显示在屏幕上,然后使用 **refresh()** 函数使所有这些更改对用户可见。 +在终端屏幕上绘制文本会对某些系统产生性能影响,尤其是在较旧的硬件终端上。因此 ncurses 允许你“堆叠”一堆文本以显示在屏幕上,然后使用 `refresh()` 函数使所有这些更改对用户可见。 让我们来看一个将以上所有内容整合在一起的简单示例: @@ -78,27 +79,27 @@ main() } ``` -程序的开始初始化了一个终端窗口,然后在屏幕的左上角打印了一个加号,在左下角打印了一个减号,在第 10 行和第 30 列打印了 “press any key to quit” 文本。程序通过使用 getch() 函数接收了键盘输入的单个字符,接着,使用 **endwin()** 函数在程序完全退出前重置了终端。 +程序的开始初始化了一个终端窗口,然后在屏幕的左上角打印了一个加号,在左下角打印了一个减号,在第 `10` 行和第 `30` 列打印了 `press any key to quit` 文本。程序通过使用 `getch()` 函数接收了键盘输入的单个字符,接着,使用 `endwin()` 函数在程序完全退出前重置了终端。 -**getch()** 是一个很有用的函数,你可以使用它来做很多事情。我经常使用它在我退出程序前用来暂停。与大多数 **ncurses** 函数一样,还有一个名为 **mvgetch(row, col)** 的 **getch()** 版本,用于在等待字符输入之前移动到屏幕位置的第 row 行,第 col 列。 +`getch()` 是一个很有用的函数,你可以使用它来做很多事情。我经常使用它在我退出程序前用来暂停。与大多数 ncurses 函数一样,还有一个名为 `mvgetch(row, col)` 的 `getch()` 版本,用于在等待字符输入之前移动到屏幕位置的第 `row` 行,第 `col` 列。 ### 使用 ncurses 编译 -如果你尝试以通常的方式编译该示例程序,例如 `gcc pause.c`,你可能会从链接器中获得大量错误列表。那是因为 GNU C 编译器不会自动链接 **ncurses** 库。相反,你需要使用 `-l ncurses` 命令行选项加载它以进行链接。 +如果你尝试以通常的方式编译该示例程序,例如 `gcc pause.c`,你可能会从链接器中获得大量错误列表。那是因为 GNU C 编译器不会自动链接 `ncurses` 库。相反,你需要使用 `-l ncurses` 命令行选项加载它以进行链接。 ``` $ gcc -o pause pause.c -lncurses ``` -运行新程序将打印一条简单的 “press any key to quit” 消息,该消息差不多位于屏幕中央: +运行新程序将打印一条简单的 `press any key to quit`消息,该消息差不多位于屏幕中央: ![centered message in a program window][2] -图 1:程序中居中的 “press any key to quit” 消息。 +*图 1:程序中居中的 “press any key to quit” 消息。* ### 使用 ncurses 构建更好的程序 -探索 **ncurses** 库函数以了解在屏幕上显示文本的其它方法。你可以在 ncurses 的 man 手册页中找到所有 **ncurses** 函数的列表。这给出了 **ncurses** 的一般概述,并提供了不同 **ncurses** 函数的类似表格的列表,并参考了包含完整详细信息的手册页。例如,在 curs_printw(3X) 手册页中描述了 **printw**,您可以通过以下方式查看: +探索 `ncurses` 库函数以了解在屏幕上显示文本的其它方法。你可以在 `ncurses` 的手册页中找到所有 `ncurses` 函数的列表。这给出了 ncurses 的一般概述,并提供了不同 `ncurses` 函数的类似表格的列表,并参考了包含完整详细信息的手册页。例如,在 `curs_printw(3X)` 手册页中描述了 `printw`,可以通过以下方式查看: ``` $ man 3x curs_printw @@ -106,12 +107,11 @@ $ man 3x curs_printw 更简单点: - ``` $ man curs_printw ``` -使用 **ncurses**,你可以创建更多有趣的程序。通过在屏幕上的特定位置打印文本,你可以创建在终端中运行的游戏和高级实用程序。 +使用 ncurses,你可以创建更多有趣的程序。通过在屏幕上的特定位置打印文本,你可以创建在终端中运行的游戏和高级实用程序。 -------------------------------------------------------------------------------- @@ -120,7 +120,7 @@ via: https://opensource.com/article/21/8/ncurses-linux 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[perfiffer](https://github.com/perfiffer) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c05741da04b54a008d05d74432785534e331e032 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 6 Sep 2021 09:00:23 +0800 Subject: [PATCH 129/138] PUB @perfiffer https://linux.cn/article-13756-1.html --- ...0829 Position text on your screen in Linux with ncurses.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210829 Position text on your screen in Linux with ncurses.md (98%) diff --git a/translated/tech/20210829 Position text on your screen in Linux with ncurses.md b/published/20210829 Position text on your screen in Linux with ncurses.md similarity index 98% rename from translated/tech/20210829 Position text on your screen in Linux with ncurses.md rename to published/20210829 Position text on your screen in Linux with ncurses.md index 5fb564e1e0..7e1d61b25f 100644 --- a/translated/tech/20210829 Position text on your screen in Linux with ncurses.md +++ b/published/20210829 Position text on your screen in Linux with ncurses.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "perfiffer" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13756-1.html" 使用 ncurses 在你的 Linux 屏幕上定位文本 ====== From ac7622da423ae247ffeb335a64f20632b7f84b59 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Mon, 6 Sep 2021 18:41:48 +0800 Subject: [PATCH 130/138] translated by perfiffer --- ...ite a guessing game in ncurses on Linux.md | 164 ------------------ ...ite a guessing game in ncurses on Linux.md | 158 +++++++++++++++++ 2 files changed, 158 insertions(+), 164 deletions(-) delete mode 100644 sources/tech/20210830 Write a guessing game in ncurses on Linux.md create mode 100644 translated/tech/20210830 Write a guessing game in ncurses on Linux.md diff --git a/sources/tech/20210830 Write a guessing game in ncurses on Linux.md b/sources/tech/20210830 Write a guessing game in ncurses on Linux.md deleted file mode 100644 index 5be4fe1be9..0000000000 --- a/sources/tech/20210830 Write a guessing game in ncurses on Linux.md +++ /dev/null @@ -1,164 +0,0 @@ -[#]: subject: "Write a guessing game in ncurses on Linux" -[#]: via: "https://opensource.com/article/21/8/guess-number-game-ncurses-linux" -[#]: author: "Jim Hall https://opensource.com/users/jim-hall" -[#]: collector: "lujun9972" -[#]: translator: "perfiffer" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Write a guessing game in ncurses on Linux -====== -Use the flexibility and power of ncurses to create a guess-the-number -game on Linux. -![question mark in chalk][1] - -In my [last article][2], I gave a brief introduction to using the **ncurses** library to write text-mode interactive applications in C. With **ncurses**, we can control where and how text gets displayed on the terminal. If you explore the **ncurses** library functions by reading the manual pages, you’ll find there are a ton of different ways to display text, including bold text, colors, blinking text, windows, borders, graphic characters, and other features to make your application stand out. - -If you’d like to explore a more advanced program that demonstrates a few of these interesting features, here’s a simple “guess the number” game, updated to use **ncurses**. The program picks a random number in a range, then asks the user to make repeated guesses until they find the secret number. As the user makes their guess, the program lets them know if the guess was too low or too high. - -Note that this program limits the possible numbers from 0 to 7. Keeping the values to a limited range of single-digit numbers makes it easier to use **getch()** to read a single number from the user. I also used the **getrandom** kernel system call to generate random bits, masked with the number 7 to pick a random number from 0 (binary 0000) to 7 (binary 0111). - - -``` -#include <curses.h> -#include <string.h>          /* for strlen */ -#include <sys/random.h>      /* for getrandom */ - -int -random0_7() -{ -   int num; -   getrandom(&num, sizeof(int), GRND_NONBLOCK); -   return (num & 7); /* from 0000 to 0111 */ -} - -int -read_guess() -{ -  int ch; - -  do { -    ch = getch(); -  } while ((ch < '0') || (ch > '7')); - -  return (ch - '0'); /* turn into a number */ -} -``` - -By using **ncurses**, we can add some visual interest. Let’s add functions to display important text at the top of the screen and a message line to display status information at the bottom of the screen. - - -``` -void -print_header(const char *text) -{ -  move(0, 0); -  clrtoeol(); - -  attron(A_BOLD); -  mvaddstr(0, (COLS / 2) - (strlen(text) / 2), text); -  attroff(A_BOLD); -  refresh(); -} - -void -print_status(const char *text) -{ -  move(LINES - 1, 0); -  clrtoeol(); -  -  attron(A_REVERSE); -  mvaddstr(LINES - 1, 0, text); -  attroff(A_REVERSE); -  refresh(); -} -``` - -With these functions, we can construct the main part of our number-guessing game. First, the program sets up the terminal for **ncurses**, then picks a random number from 0 to 7. After displaying a number scale, the program then enters a loop to ask the user for their guess. - -As the user makes their guess, the program provides visual feedback. If the guess is too low, the program prints a left square bracket under the number on the screen. If the guess is too high, the game prints a right square bracket. This helps the user to narrow their choice until they guess the correct number. - - -``` -int -main() -{ -  int number, guess; - -  initscr(); -  cbreak(); -  noecho(); - -  number = random0_7(); -  mvprintw(1, COLS - 1, "%d", number); /* debugging */ - -  print_header("Guess the number 0-7"); - -  mvaddstr(9, (COLS / 2) - 7, "0 1 2 3 4 5 6 7"); - -  print_status("Make a guess..."); - -  do { -    guess = read_guess(); - -    move(10, (COLS / 2) - 7 + (guess * 2)); - -    if (guess < number) { -      addch('['); -      print_status("Too low"); -    } - -    else if (guess > number) { -      addch(']'); -      print_status("Too high"); -    } - -    else { -      addch('^'); -    } -  } while (guess != number); - -  print_header("That's right!"); -  print_status("Press any key to quit"); -  getch(); - -  endwin(); - -  return 0; -} -``` - -Copy this program and compile it for yourself to try it out. Don’t forget that you need to tell GCC to link with the **ncurses** library: - - -``` -`$ gcc -o guess guess.c -lncurses` -``` - -I’ve left the debugging line in there, so you can see the secret number near the upper-right corner of the screen: - -![guess number game interface][3] - -Figure 1: Guess the number game. Notice the secret number in the upper right. - -### Get yourself going with ncurses - -This program uses a bunch of other features of **ncurses** that you can use as a starting point. For example, the print_header function prints a message in bold text centered at the top of the screen, and the print_status function prints a message in reverse text at the bottom-left of the screen. Use this to help you get started with **ncurses** programming. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/guess-number-game-ncurses-linux - -作者:[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/question-mark_chalkboard.jpg?itok=DaG4tje9 (question mark in chalk) -[2]: https://opensource.com/article/21/8/ncurses-linux -[3]: https://opensource.com/sites/default/files/guessnumber07.png diff --git a/translated/tech/20210830 Write a guessing game in ncurses on Linux.md b/translated/tech/20210830 Write a guessing game in ncurses on Linux.md new file mode 100644 index 0000000000..978348b8ac --- /dev/null +++ b/translated/tech/20210830 Write a guessing game in ncurses on Linux.md @@ -0,0 +1,158 @@ +[#]: subject: "Write a guessing game in ncurses on Linux" +[#]: via: "https://opensource.com/article/21/8/guess-number-game-ncurses-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: "perfiffer" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +通过 ncurses 在 Linux 上写一个猜谜游戏 +====== +使用 ncurses 的灵活性和强大功能在 Linux 上创建一个猜数字游戏。 +![question mark in chalk][1] + +在我的[上一篇文章][2],我简要介绍了使用 ncurses 库通过 C 语言编写文本模式交互式应用程序。使用 `ncurses`,我们可以控制文本在终端上的显示位置和方式。如果你通过阅读手册页探索 `ncurses` 库函数,你会发现有很多不同的方式来显示文本,包括粗体文本、颜色、闪烁文本、窗口、边框、图形字符和其它功能,这些都可以使你的应用脱颖而出。 + +如果你想探索一个更高级的程序来演示其中一些有趣的功能,这里有一个简单的“猜数字”游戏,已更新为使用 `ncurses`。该程序在一个范围内选择一个随机数,然后要求用户进行重复猜测,直到他们猜到秘密数字。当用户进行猜测时,程序会告知他们猜测的数字是太低还是太高。 + +请注意,程序限定可能的数字范围是 0 到 7。将值保持在有限的个位数数字范围内,可以更轻松的使用 `getch()` 函数从用户读取单个数字。我还使用了 `getrandom` 内核系统调用来生成随机数,设定数字最大值为 7,以从 0 (二进制 0000)到 7 (二进制0111)中选择一个随机数。 + +``` +#include ; +#include ;          /* for strlen */ +#include ;      /* for getrandom */ + +int +random0_7() +{ +   int num; +   getrandom(&num, sizeof(int), GRND_NONBLOCK); +   return (num & 7); /* from 0000 to 0111 */ +} + +int +read_guess() +{ +  int ch; + +  do { +    ch = getch(); +  } while ((ch < '0') || (ch > '7')); + +  return (ch - '0'); /* turn into a number */ +} +``` + +通过使用 `ncurses`,我们可以增加一些有趣的视觉体验。通过添加函数,我们可以在屏幕顶部显示重要的文本信息,在屏幕底部显示状态消息行。 + +``` +void +print_header(const char *text) +{ +  move(0, 0); +  clrtoeol(); + +  attron(A_BOLD); +  mvaddstr(0, (COLS / 2) - (strlen(text) / 2), text); +  attroff(A_BOLD); +  refresh(); +} + +void +print_status(const char *text) +{ +  move(LINES - 1, 0); +  clrtoeol(); +  +  attron(A_REVERSE); +  mvaddstr(LINES - 1, 0, text); +  attroff(A_REVERSE); +  refresh(); +} +``` + +通过这些函数,我们就可以构建猜数字游戏的主要部分。首先,程序为 `ncurses` 设置终端,然后从 0 到 7 中选择一个随机数。显示数字刻度后,程序启动一个循环,询问用户的猜测。 + +当用户进行猜测时,程序会在屏幕上提供反馈。如果猜测太低,程序会在屏幕上的数字下方打印一个左方括号。如果猜测太高,程序会在屏幕上的数字下方打印一个右方括号。这有助于用户缩小他们的选择范围,直到他们猜出正确的数字。 + +``` +int +main() +{ +  int number, guess; + +  initscr(); +  cbreak(); +  noecho(); + +  number = random0_7(); +  mvprintw(1, COLS - 1, "%d", number); /* debugging */ + +  print_header("Guess the number 0-7"); + +  mvaddstr(9, (COLS / 2) - 7, "0 1 2 3 4 5 6 7"); + +  print_status("Make a guess..."); + +  do { +    guess = read_guess(); + +    move(10, (COLS / 2) - 7 + (guess * 2)); + +    if (guess < number) { +      addch('['); +      print_status("Too low"); +    } + +    else if (guess > number) { +      addch(']'); +      print_status("Too high"); +    } + +    else { +      addch('^'); +    } +  } while (guess != number); + +  print_header("That's right!"); +  print_status("Press any key to quit"); +  getch(); + +  endwin(); + +  return 0; +} +``` + +复制这个程序,自己尝试编译它。不要忘记你需要告诉 GCC 编译器链接到 `ncurses` 库: + +``` +$ gcc -o guess guess.c -lncurses +``` +我留下了一个调试行,所以你可以看到屏幕右上角附近的秘密数字: + +![guess number game interface][3] + +图1:猜数字游戏。注意右上角的秘密数字。 + +### 开始使用 ncurses + +该程序使用了 `ncurses` 的许多其它功能,你可以从这些功能开始。例如,`print_header` 函数在屏幕顶部居中以粗体文本打印消息,`print_status` 函数在屏幕左下角以反向文本打印消息。使用它来帮助你开始使用 `ncurses` 编程。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/guess-number-game-ncurses-linux + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[校对者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/question-mark_chalkboard.jpg?itok=DaG4tje9 (question mark in chalk) +[2]: https://linux.cn/article-13756-1.html +[3]: https://opensource.com/sites/default/files/guessnumber07.png From 5aa8c30040fd607e78fc011a8d0a6bfbdfd7b8bf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Sep 2021 05:03:08 +0800 Subject: [PATCH 131/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210907=20?= =?UTF-8?q?Run=20Web=20Applications=20in=20Linux=20Using=20Tangram=20Brows?= =?UTF-8?q?er?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md --- ...ications in Linux Using Tangram Browser.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md diff --git a/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md b/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md new file mode 100644 index 0000000000..36e7b67827 --- /dev/null +++ b/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md @@ -0,0 +1,93 @@ +[#]: subject: "Run Web Applications in Linux Using Tangram Browser" +[#]: via: "https://itsfoss.com/tangram/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Run Web Applications in Linux Using Tangram Browser +====== + +_**Brief:** Tangram is a browser that aims to help you run and manage web applications in Linux_. _Let’s take a look at how it works._ + +Even if we have native Linux applications available for several tools, many end up using web applications. + +Maybe in the form of an electron app or directly through a web browser, native experiences are becoming an old-school thing. + +Of course, running web applications, no matter the platform, needs more system resources. And, considering every service is going for a web-based approach instead of a native experience, we need solutions to manage the web apps efficiently. + +An open-source Linux app, Tangram, could be the solution. + +### Tangram: A Browser Tailored to Run Web Applications + +![][1] + +You can choose to use some of the [best Linux web browsers][2] to run web applications. But, if you want something that entirely focuses on web application experience, Tangram is an exciting option. + +The developer took inspiration from GNOME Web, [Franz][3], and [Rambox][4]. + +You do not get any fancy features but just the ability to change the user agent and manage the web applications you have logged in to. + +It can be used to access multiple social media platforms, chat messengers, work collaboration applications, and more. + +### Features of Tangram + +![][5] + +Considering it is a minimal browser based on WebKitGTK, not much you can do here. To list some of the essentials, here’s what you can do: + + * Re-order tabs in the sidebar + * Easily add any web service as a web app + * Ability to tweak the user agent (Desktop/mobile) + * Keyboard shortcuts + * Change position of the sidebar (tab bar) + + + +All you need to do is load up a web service, log in, and click on “**Done**” to add it as a web application. + +![][6] + +### Installing Tangram in Linux + +Tangram is available as a Flatpak for every Linux distribution, and you can also find it in [AUR][7]. + +If you want to install it via the terminal, type in the following command: + +``` +flatpak install flathub re.sonny.Tangram +``` + +You may refer to our [Flatpak guide][8] if you do not have it enabled on your system. + +To explore more about it, you can check out its [GitHub page][9]. + +[Tangram Browser][10] + +Have you tried this yet? Do you prefer web applications or native applications? Feel free to share your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/tangram/ + +作者:[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://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-web-app-browser.png?resize=800%2C611&ssl=1 +[2]: https://itsfoss.com/best-browsers-ubuntu-linux/ +[3]: https://itsfoss.com/franz-messaging-app/ +[4]: https://itsfoss.com/rambox/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-settings.png?resize=530%2C290&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-web-app-whatsapp.png?resize=800%2C431&ssl=1 +[7]: https://itsfoss.com/aur-arch-linux/ +[8]: https://itsfoss.com/flatpak-guide/ +[9]: https://github.com/sonnyp/Tangram +[10]: https://flathub.org/apps/details/re.sonny.Tangram From 889dbd148d07c14aaaee017487f305fc46ddccd8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Sep 2021 05:03:25 +0800 Subject: [PATCH 132/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210907=20?= =?UTF-8?q?How=20to=20Stop=20a=20Program=20in=20Linux=20Terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210907 How to Stop a Program in Linux Terminal.md --- ...How to Stop a Program in Linux Terminal.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20210907 How to Stop a Program in Linux Terminal.md diff --git a/sources/tech/20210907 How to Stop a Program in Linux Terminal.md b/sources/tech/20210907 How to Stop a Program in Linux Terminal.md new file mode 100644 index 0000000000..0db2f82279 --- /dev/null +++ b/sources/tech/20210907 How to Stop a Program in Linux Terminal.md @@ -0,0 +1,97 @@ +[#]: subject: "How to Stop a Program in Linux Terminal" +[#]: via: "https://itsfoss.com/stop-program-linux-terminal/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Stop a Program in Linux Terminal +====== + +It’s amusing how the simplest of the things could be complicated when you are new to something. + +The other day, I found my friend could not figure out how to exit the top command. Instead of stopping the command, he closed the entire terminal application. + +That’s not only unnecessary, it is a not good thing to do. + +### Stopping programs in Linux + +In Linux, you can use the Ctrl+C keys to stop a running program in the terminal. This works for Ubuntu as well as any other Linux distribution. + +Take the ping command for example. If you do not stop it, it will keep on displaying the result. + +Hold the Ctrl button and press the C key at the same time. It sends the [SIGKILL signal][1] to the running program to force quit the command. + +![Stopping a program in the Linux terminal][2] + +Do you see the ^C? The caret (^) means Ctrl. So basically, the terminal shows the Ctrl+C keystrokes as ^C. + +The Ctrl+C works very well for the commands that are designed to keep on running until interrupted. You feel like you have to cancel the command, use Ctrl+C. + +In a more complicated method, you can [find the process ID and kill a running process][3]. That’s more advanced stuff and used only when the process is running in the background or by another user or in another terminal window. + +Apart from that, there are some other commands and command line tools that have their own exit commands. Let me briefly mention some of them here. + +#### How to exit Vim editor + +[Existing Vim editor][4] has made so many jokes in the Linux world. It is difficult to figure out when you are new to this powerful command line based text editor. Among several ways of quitting vim, the most common is to press the Esc key and then type a colon (:) and then type `q!` for force quit without save or `wq` for save and quit. + +![][5] + +#### How to exit Nano editor + +Quitting the [Nano editor][6] is a bit simpler than exiting Vim. Why? Because Nano mentions the shortcut at the bottom. You may not understand it if you are new to it but at least you’ll be able to figure it out the next time. + +To exit Nano, press Ctrl+X. It will ask if you want to save the changes made to the file or not. You can enter your choice. + +![][7] + +#### How to exit less command + +The less is a wonderful command that lets you view without cluttering your terminal screen like the cat command. If you are inside the less command view, use the key `q` to exit less. + +#### How to exit the terminal + +To exit the terminal itself, instead of closing the terminal, either use Ctrl+D keyboard shortcut or type the exit command: + +``` +exit +``` + +This actually exists you from the current shell. When you [open a terminal in Ubuntu][8] or any other Linux distribution, it runs the default shell. When you exit from this shell, terminal ends as well. Ctrl+D is the shortcut to do the same and quit the terminal. + +I hope you find this quick tutorial helpful. I highly recommend learning these [Linux command tips][9]. + +**Recommended Read:** + +![][10] + +#### [21 Super Handy Linux Command Tips and Tricks That Will Save you a lot of Time and Increase Your Productivity][9] + +Questions or suggestions? Please leave a comment below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/stop-program-linux-terminal/ + +作者:[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://linuxhandbook.com/sigterm-vs-sigkill/#what-is-sigkill +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/stop-a-program-linux-terminal.png?resize=800%2C373&ssl=1 +[3]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ +[4]: https://itsfoss.com/how-to-exit-vim/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/05/how-to-exit-vim.png?resize=737%2C422&ssl=1 +[6]: https://itsfoss.com/nano-editor-guide/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-save-and-exit.png?resize=799%2C503&ssl=1 +[8]: https://itsfoss.com/open-terminal-ubuntu/ +[9]: https://itsfoss.com/linux-command-tricks/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/linux-command-tips.png?fit=800%2C450&ssl=1 From df523ed538630a8c8ccf5e2b56d1cb593a8a5946 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Sep 2021 05:03:44 +0800 Subject: [PATCH 133/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210906=20?= =?UTF-8?q?Learn=20everything=20about=20computers=20with=20this=20Raspberr?= =?UTF-8?q?y=20Pi=20kit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md --- ...ut computers with this Raspberry Pi kit.md | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md diff --git a/sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md b/sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md new file mode 100644 index 0000000000..21f2f6e1f0 --- /dev/null +++ b/sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md @@ -0,0 +1,148 @@ +[#]: subject: "Learn everything about computers with this Raspberry Pi kit" +[#]: via: "https://opensource.com/article/21/9/raspberry-pi-crowpi2" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Learn everything about computers with this Raspberry Pi kit +====== +The CrowPi is an amazing Raspberry Pi project system housed in a +laptop-like body. +![Teacher or learner?][1] + +I like history, and I like computers, so I enjoy hearing stories about computing before computers were an everyday household appliance, much less a personal accessory. [One tale I hear often][2] is about how the computers of long ago (in computer years, anyway) were pleasantly basic. They were so basic, in fact, that it was relatively trivial for a curious user to figure out how to program one. Looking at modern computers, with object-oriented programming languages, complex GUI frameworks, network APIs, containers, and more, there's genuine concern that the tools of the computing trade have become essentially inaccessible to anyone without specialized training. + +From the day the Raspberry Pi was released in 2012, it has always been intended as an educational platform. Several third-party vendors support the Pi with add-ons and training kits to help learners of all ages explore programming, physical computing, and open source. However, until recently, it's largely been up to the user to figure out how all the pieces on the market fit together. And then I got a CrowPi. + +![CrowPi more than a laptop][3] + +The CrowPi is not a laptop. +(Seth Kenlon, [CC BY-SA 4.0][4]) + +### Introducing the CrowPi2 + +Crows are surprisingly intelligent birds. They recognize and remember faces, mimic sounds they've heard, solve complex puzzles, and even use tools to accomplish a task. It's fitting that the CrowPi uses the crow as its logo and namesake because this device is packed with opportunities for exploration, experimentation, education, and, best of all, fun. + +The design itself is clever: It looks like a laptop, but it's much more than that. When you lift the Bluetooth keyboard from the case, it reveals a hidden electronics workshop, complete with an LCD screen, 16 buttons, dials, RFID sensor, proximity sensor, breadboard, speakers, GPIO connections, a LED array, and much more. _And it's all programmable._ + +As its name implies, the unit itself is powered entirely by a Raspberry Pi, securely fastened within the underside of the case. + +![crowpi pi board][5] + +The CrowPi Pi board. +(Seth Kenlon, [CC BY-SA 4.0][4]) + +By default, you're meant to power the unit with a power adapter, and it ships with a wall adapter that you can plug into the case rather than powering the Pi directly. You can also use a battery supply plugged into an external micro-USB port. There's even a drawer built into the case so you can store your battery pack. When you do this, there's a USB cable popping out of the battery drawer and into the case power port, so there's no illusion that this is a "normal" laptop. However, with a device like this, that's pretty much the desired aesthetic! + +### First boot + +The CrowPi2 ships with Raspbian installed on a microSD card labeled **System**, although it includes a second microSD card loaded with [RetroPie][6], too. Being a responsible adult, I booted RetroPie first, naturally. + +RetroPie is always fun, and the CrowPi2 ships with two SNES-style game controllers to ensure you have the optimal retro gaming experience. + +Booting to the actual system is, amazingly, just as fun and arguably more so. The login manager is a custom project hub with quick links to sample coding projects, the Python and Arduino IDEs, Scratch, sample Python games, Minecraft, and more. You can also choose to exit the project hub and just use the desktop. + +![CrowPi hub][7] + +The CrowPi Hub. +(Seth Kenlon, [CC BY-SA 4.0][4]) + +The desktop is familiar to anyone used to the Raspberry Pi or Linux in general, but it's basic enough that it's easy to learn, too. There's an application menu in the top left, shortcut icons on the desktop, a system tray for network selection and volume control in the top right, and so on. + +![CrowPi Desktop][8] + +The CrowPi Desktop. +(Seth Kenlon, [CC BY-SA 4.0][4]) + +There's so much available on the CrowPi that it might be difficult to decide where to start. For me, there were four broad categories: Programming, physical electronics, Linux, and gaming. + +There's an instruction manual in the box, so you know what you need to connect (for instance, the keyboard is battery-powered, so it does need charging sometimes, and it and the mouse always require a USB dongle). It's a quick read, though, and just one of the many examples of how seriously the CrowPi team takes documentation. + +![CrowPi Docs][9] + +The CrowPi Docs. +(Seth Kenlon, [CC BY-SA 4.0][4]) + +### Programming + +If you're keen to learn how to code, there are many paths to success on the CrowPi. You should take the path that you find the most satisfying. + +#### 1\. Scratch + +[Scratch][10] is a simple visual coding application that lets you make games and interactive stories using code blocks that fit together like [Lego pieces][11]. It's the easiest way to begin coding, and I've seen kids as young as eight spend hours puzzling over the optimal algorithm for a game of their own design. Of course, it's not only great for kids! Adults can have a lot of fun with it, too. Not sure where to start? There's a 99-page booklet (printed on actual paper) in the box with Scratch lessons and projects for you to try. + +#### 2\. Java and Minecraft + +Minecraft is not open source (although there are [several open source projects][12] that reimplement it), but there's enough source available that it's often used to teach programming. Minecraft was written in Java, and the CrowPi ships with both [Minecraft Pi Edition][13] and the [BlueJ Java IDE][14] to make learning Java easier and more fun than ever. + +#### 3\. Python and PyGame + +There are several really fun games on the CrowPi that were written in Python and the [PyGame game engine][15]. You can play the games and then look at the source code to find out how the game works. The Geany, Thonny, and [Mu][16] editors are included on the CrowPi, so you can start programming in Python right away. As with Scratch, there's a booklet in the box with lessons so you can learn Python basics. + +### Electronics + +The physical electronics workshop concealed under the keyboard is essentially an array of Pi Hats. The whole thing is mapped out on a fold-out diagram in both English and Chinese so that you can identify all the components. There are plenty of sample projects to get you started. Here's a small list: + + * **Hello** prints "hello" on the LCD screen when you speak to the CrowPi. + * **Intrusion alarm** sounds an alarm using the proximity sensor. + * **Remote controller** enables you to use a remote control (yes, this too is included in the box) to trigger events on the CrowPi. + * **RGB Tetris** lets you play a game of Tetris on an LED display. + * **Voice recognition** demonstrates natural language processing. + * **Ultrasonic music** creates a rudimentary Theramin using distance sensors and a speaker. + + + +Those projects are just the beginning because you can build upon what exists. There's more to explore, of course. Patch cables, resistors, LEDs, and all sorts of components are included in the box so that you can learn all about the Pi's GPIO capabilities at your leisure. + +One problem: The location of the sample projects is a little difficult to find. It's easy to find the demos (they're on the CrowPi hub screen), but the location of the source code isn't immediately obvious. It turns out that most of the sample projects are in `/usr/share/code`, which you can reach either through the file manager or a terminal. + +![CrowPi Peripherals][17] + +The CrowPi Peripherals +(Seth Kenlon, [CC BY-SA 4.0][4]) + +### Linux + +The Raspberry Pi runs Linux. If you've been meaning to learn more about Linux, the CrowPi is a great platform for that, too. You can explore the desktop, the terminal, and nearly any Linux or open source application you can find. If you've been reading about open source for years and are ready to dive into an open source OS, this could be a platform for that (and much more, obviously). + +### Gaming + +The **RetroPie** SD card included in the box means you can reboot into a retro game console and play any number of old-school arcade games. It's not exactly a Steam Deck, but it's a fun and inspiring little gaming platform. Because it comes with not one but two game controllers, it's ideal for couch co-op. And best of all, you not only can play games on the CrowPi, but you can make your own games, too. + +### Screwdriver included + +I got to sit down with the CrowPi2 for about two weeks, and I've barely been able to get through all of the projects. There have been many nights when I've had to force myself to step away from it because even after I've tired of one project, I inevitably find something else to explore. To sum it up, I found one component in particular in the box, and I immediately knew that the CrowPi and I were well suited to one another: It was a small, humble screwdriver. There's no voiding of warranty stickers here. The CrowPi wants you to tinker, to take things apart, explore, and learn. This isn't a laptop or even just a Pi; this is a portable, low-powered, diverse, and open source learner's toolkit. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/raspberry-pi-crowpi2 + +作者:[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-lead-teacher-learner.png?itok=rMJqBN5G (Teacher or learner?) +[2]: https://opensource.com/article/21/8/my-first-programming-language +[3]: https://opensource.com/sites/default/files/crowpi-not-laptop.jpeg (CrowPi more than a laptop) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/crowpi-pi.jpeg (crowpi pi board) +[6]: https://opensource.com/article/19/1/retropie +[7]: https://opensource.com/sites/default/files/crowpi-hub.png (CrowPi hub) +[8]: https://opensource.com/sites/default/files/crowpi-desktop.png (CrowPi desktop) +[9]: https://opensource.com/sites/default/files/crowpi-docs.jpeg (CrowPi docs) +[10]: https://opensource.com/article/20/9/scratch +[11]: https://opensource.com/article/20/6/open-source-virtual-lego +[12]: https://opensource.com/alternatives/minecraft +[13]: https://www.minecraft.net/en-us/edition/pi +[14]: https://opensource.com/article/20/7/ide-java#bluej +[15]: https://opensource.com/downloads/python-gaming-ebook +[16]: https://opensource.com/article/18/8/getting-started-mu-python-editor-beginners +[17]: https://opensource.com/sites/default/files/crowpi-peripherals.jpeg (CrowPi peripherals) From 12518ef11e447768e9a5380d49c707be64f51b67 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Sep 2021 05:03:59 +0800 Subject: [PATCH 134/138] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210906=20?= =?UTF-8?q?Resize=20an=20image=20from=20the=20Linux=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210906 Resize an image from the Linux terminal.md --- ...Resize an image from the Linux terminal.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/tech/20210906 Resize an image from the Linux terminal.md diff --git a/sources/tech/20210906 Resize an image from the Linux terminal.md b/sources/tech/20210906 Resize an image from the Linux terminal.md new file mode 100644 index 0000000000..a5d0764687 --- /dev/null +++ b/sources/tech/20210906 Resize an image from the Linux terminal.md @@ -0,0 +1,81 @@ +[#]: subject: "Resize an image from the Linux terminal" +[#]: via: "https://opensource.com/article/21/9/resize-image-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Resize an image from the Linux terminal +====== +Shrink an image from your terminal with the ImageMagick convert command. +![Old camera blue][1] + +ImageMagick is a handy multipurpose command-line tool for all your image needs. ImageMagick supports a variety of image types, including JPG photos and PNG graphics. + +### Resizing images + +I often use ImageMagick on my webserver to resize images. For example, let's say I want to include a photo of my cats on my personal website. The photo from my phone is very large, about 4000x3000 pixels, at 3.3MB. That's much too large for a web page. I use the ImageMagick convert tool to change the size of my photo so that I can include it on my web page. ImageMagick is a full suite of tools, one of the most common is the `convert` command. + +The ImageMagick `convert` command uses this general syntax: + + +``` +`convert {input} {actions} {output}` +``` + +To resize a photo called `PXL_20210413_015045733.jpg` to a more manageable 500-pixel width, type this: + + +``` +`$ convert PXL_20210413_015045733.jpg -resize 500x sleeping-cats.jpg` +``` + +The new image is now only 65KB in size.  + +![Sleeping cats][2] + +Jim Hall, [CC BY-SA 4.0][3] + +You can provide both width and height dimensions with the `-resize` option. But, by providing only the width, ImageMagic does the math for you and automatically retains the aspect ratio by resizing the output image with a proportional height. + +### Install ImageMagick on Linux + +On Linux, you can install ImageMagick using your package manager. For instance, on Fedora or similar: + + +``` +`$ sudo dnf install imagemagick` +``` + +On Debian and similar: + + +``` +`$ sudo apt install imagemagick` +``` + +On macOS, use [MacPorts][4] or [Homebrew][5]. + +On Windows, use [Chocolatey][6]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/resize-image-linux + +作者:[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/osdc-photo-camera-blue.png?itok=AsIMZ9ga (Old camera blue) +[2]: https://opensource.com/sites/default/files/sleeping-cats.jpg (Sleeping cats) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/article/20/11/macports +[5]: https://opensource.com/article/20/6/homebrew-mac +[6]: https://opensource.com/article/20/3/chocolatey From dcd0f4d4086f4b09a1fe36de323aef462fdf5ffd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Sep 2021 08:25:58 +0800 Subject: [PATCH 135/138] PRF @unigeorge --- ...essential Linux commands for every user.md | 72 ++++++++++--------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/translated/tech/20210901 20 essential Linux commands for every user.md b/translated/tech/20210901 20 essential Linux commands for every user.md index 65eb1115a2..619ae0b1a7 100644 --- a/translated/tech/20210901 20 essential Linux commands for every user.md +++ b/translated/tech/20210901 20 essential Linux commands for every user.md @@ -3,24 +3,26 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -用户必会的 20 个 Linux 命令 +用户必会的 20 个 Linux 基础命令 ====== -无论新手老手,这 20 个 Linux 命令都能让你的操作更轻松。 -![Command line prompt][1] -在黝黑的终端窗口中输入命令,这样的方式对某些人群来说可能好像过时了,但对许多专业计算机用户来说,这几乎是计算机完成能够执行的所有任务的最有效、最简便和最清晰的方式。如今,一些项目将开源命令引入了 macOS 和 Windows 等非开放平台,因此终端命令不仅仅是针对 Linux 和 BSD 用户,更是与每个人都息息相关。你可能会惊讶地发现,在一台普通的 [POSIX][2] 计算机上安装了数千个命令,当然,其中很多命令并不是真的有用,至少不是直接或定期性被使用。而其中的一部分命令虽然不是有效终端必须使用的命令,但相比其他命令而言使用频率较高,值得大家学习一下。 +> 无论新手老手,这 20 个 Linux 命令都能让你的操作更轻松。 + +![](https://img.linux.net.cn/data/attachment/album/202109/07/082525n7amf7gejo16zaxx.jpg) + +在黝黑的终端窗口中输入命令,这样的方式对某些人群来说可能好像过时了,但对许多专业计算机人员来说,这几乎是计算机完成能够执行的所有任务的最有效、最简便和最清晰的方式。如今,一些项目将开源命令引入了 macOS 和 Windows 等非开放平台,因此终端命令不仅仅是针对 Linux 和 BSD 用户,更是与每个人都息息相关。你可能会惊讶地发现,在一台普通的 [POSIX][2] 计算机上安装了数千个命令,当然,其中很多命令并不是真的有用,至少不是直接或经常性被使用。而其中的一部分命令虽然不是有效终端必须使用的命令,但相比其他命令而言使用频率较高,值得大家学习一下。 以下是终端用户最可能会使用的前 20 个命令: ### cd -在终端外,你可以单击图标从一个文件夹移动到另一个文件夹,但在终端中,你需要使用 `cd`。`cd` 命令代表 _change directory_(变更目录),是用户在 Linux 系统中移动的方式。这是 Linux 中从一个地方到另一个地方最快、最直接的路线。 +在终端外,你可以单击图标从一个文件夹移动到另一个文件夹,但在终端中,你需要使用 `cd`。`cd` 命令代表变更目录change directory,是用户在 Linux 系统中移动的方式。这是 Linux 中从一个地方到另一个地方最快、最直接的路线。 -例如,在桌面上,当你想从你的主目录(你保存所有文件夹的地方)移动到一个名为 `presentations` 的文件夹时,你首先要打开你的 `Documents` 文件夹,然后打开一个名叫 `work` 的文件夹,然后是 `projects` 文件夹,然后是`conference` 文件夹,最后是 `presentations` 文件夹,里面存放的是 LibreOffice Impress 幻灯片。这个过程包含了很多次的双击操作。同时屏幕上还需要许多移动动作,这取决于新窗口出现的位置,以及大脑需要跟踪的许多路径点。许多人通过将 _所有文件_ 都放在桌面上来避免这个看似微不足道的任务。 +例如,在桌面上,当你想从你的主目录(你保存所有文件夹的地方)移动到一个名为 `presentations` 的文件夹时,你首先要打开你的 `Documents` 文件夹,然后打开一个名叫 `work` 的文件夹,然后是 `projects` 文件夹,然后是 `conference` 文件夹,最后是 `presentations` 文件夹,里面存放的是 LibreOffice Impress 幻灯片。这个过程包含了很多次的双击操作。同时屏幕上还需要许多鼠标移动动作,这取决于新窗口出现的位置,以及大脑需要跟踪的许多路径点。许多人通过将 _所有文件_ 都放在桌面上来避免这个看似微不足道的任务。 而终端用户只需键入以下内容即可避免此问题: @@ -28,7 +30,7 @@ $ cd ~/Documents/work/projects/conference/presentations ``` -一些有经验的终端用户甚至都懒得输入所有这些,而是使用 **Tab** 键自动完成单词填充。更甚者,有时你都不必依赖自动完成,而是改用通配符: +一些有经验的终端用户甚至都懒得输入所有这些,而是使用 `Tab` 键自动完成单词填充。更甚者,有时你都不必依赖自动完成,而是改用通配符: ``` $ cd ~/Doc*/work/*/conf*/p* @@ -38,7 +40,7 @@ $ cd ~/Doc*/work/*/conf*/p* 用 Buckaroo Banzai 的话来说:“无论你走到哪里,你就在那里。” -当你想弄清楚确切位置时,就可以使用 `pwd` 命令。`pwd` 代表 _print working directory_(打印工作目录),这正是它的作用。`--physical`(在某些情况时缩写为 `-P`)显示解析所有符号链接后的确切位置。 +当你想弄清楚确切位置时,就可以使用 `pwd` 命令。`pwd` 代表打印工作目录print working directory,这正是它的作用。`--physical`(在某些情况时缩写为 `-P`)显示解析所有符号链接后的确切位置。 ``` $ pwd @@ -50,11 +52,11 @@ $ pwd --physical ### sed -流编辑器 `sed` 更广为人知的是一个强大的批量 _查找和替换_ 命令,但它同时也是一个合法的文本编辑器。你可以通过阅读我的 [介绍性文章][3] 来学习使用它,然后通过我的 [高级教程和备忘录][4] 成为老手。 +流编辑器 `sed` 更广为人知的是一个强大的批量 _查找和替换_ 命令,但它同时也是一个正当合理的文本编辑器。你可以通过阅读我的 [介绍性文章][3] 来学习使用它,然后通过我的 [高级教程和备忘录][4] 成为老手。 ### grep -`grep` 命令使用很普遍,以至于经常被用作动词(例如“我会通过一些文件 grep”)和动名词(例如“grep 一些输出”)。无论是查看日志文件还是解析其他命令的输出,它都是在 shell 中解析文本时的关键组件。这是忙碌的用户专注于特定信息的一种方式。考虑一下计算世界中的数据量,grep 命令的流行就见怪不怪了。你可以通过阅读我的 [介绍性文章][5] 了解 grep,然后下载 [备忘录][6] 学习。 +`grep` 命令使用很普遍,以至于经常被用作动词(例如 “我会对一些文件进行 grep”)和动名词(例如 “grep 一些输出”)。无论是查看日志文件还是解析其他命令的输出,它都是在 shell 中解析文本时的关键组件。这是忙碌的用户专注于特定信息的一种方式。考虑一下计算世界中的数据量,`grep` 命令的流行就见怪不怪了。你可以通过阅读我的 [介绍性文章][5] 了解 `grep`,然后下载 [备忘录][6] 学习。 ### file @@ -68,17 +70,17 @@ $ file example.bar example.bar: ELF 64-bit LSB executable, x86-64 [...] ``` -当然,`file` 命令并不神奇。它不过是根据文件如何识别自身进行输出,并且文件可能是错误的、损坏的或伪装的。使用 [`hexdump`][7] 进行严格检查的方式确定性更强,但对于日常使用而言,`file` 命令非常方便。 +当然,`file` 命令并不神奇。它只不过是根据文件如何标识自身而进行输出的,并且文件可能是错误的、损坏的或伪装的。使用 [hexdump][7] 进行严格检查的方式确定性更强,但对于日常使用而言,`file` 命令非常方便。 ### awk -awk 不仅仅是一个命令,它还是一种文字 [编程语言][8]。[点此下载我们的免费 Awk 电子书][9] 进行学习,你可能会写出远超你想象的脚本。 +`awk` 不仅仅是一个命令,它还是一种字面意义上的 [编程语言][8]。[点此下载我们的免费 Awk 电子书][9] 进行学习,你可能会写出远超你想象的脚本。 ### curl -`curl` 命令是用于终端的 [非交互式 Web 浏览器][10]。它是面向 Web 和 API 开发人员的 [开发工具][11]。因为灵活性,它是一个复杂的命令,但如果你想从你的终端顺利地与网络服务交互,该命令是很值得学习的。 +`curl` 命令是用于终端的 [非交互式 Web 浏览器][10]。它是面向 Web 和 API 开发人员的 [开发工具][11]。它是一个复杂灵活的命令,但如果你想从你的终端顺利地与 Web 服务交互,该命令是很值得学习的。 -下载我们免费的 [`curl` 备忘录][12],你可以从中学会 `curl` 的许多选项。 +下载我们免费的 [curl 备忘录][12],你可以从中学会 `curl` 的许多选项。 ### ps @@ -86,22 +88,22 @@ awk 不仅仅是一个命令,它还是一种文字 [编程语言][8]。[点此 ### cat -[`cat` 命令][14] 是 _concatenate_(连接)的缩写,它曾因为能将由于大小限制而被(使用 `split` 命令)拆分成的若干小文件合并而非常有用。如今,`cat` 主要是用来将文本文件的内容转储到终端中以供快速阅读,除非你为此专门去使用 `head`、`tail`、`more` 或 `less` 等命令。 +[cat 命令][14] 是连接concatenate的缩写,它曾因为能将若干小文件合并而显得非常有用,这些小文件可能是由于大小限制而(使用 `split` 命令)拆分的。如今,`cat` 主要是用来将文本文件的内容转储到终端中以供快速阅读,除非你为此专门去使用 `head`、`tail`、`more` 或 `less` 等命令。 -尽管它的原始用途几乎已被弃用,并且其他几个命令也主要是执行其次要功能,但 `cat` 仍然是一个有用的工具。例如,它可以是复制 (`cp`) 命令的替代品: +尽管它的原始用途几乎已被弃用,并且其他几个命令也主要提供了其次要功能,但 `cat` 仍然是一个有用的工具。例如,它可以是复制(`cp`)命令的替代品: ``` $ cat myfile.ogg > /backups/myfile.ogg ``` -它可以显示文件中不便观察的隐形字符。例如,使用 `--show-tabs` 选项,分割 [YAML][15] 的 **Tab** 字符就会显示为 `^I`: +它可以显示文件中不便观察的隐形字符。例如,使用 `--show-tabs` 选项,分割 [YAML][15] 的 `Tab` 字符就会显示为 `^I`: ``` $ cat --show-tabs my.yaml -\--- +--- -\- hosts: all +- hosts: all   tasks:   - name: Make sure the current version of 'sysstat' is installed.     dnf: @@ -116,9 +118,9 @@ $ cat --show-tabs my.yaml ### find -`find` 命令可以用来查找文件,但它还有许多选项,这些选项可以帮助你查找具有各种过滤器和参数的文件。读者可以从我的 [介绍性文章][16] 中学习该命令的基础知识。 +`find` 命令可以用来查找文件,但它还有许多选项,这些选项可以帮助你通过各种过滤器和参数查找文件。读者可以从我的 [介绍性文章][16] 中学习该命令的基础知识。 -如果你一直想知道为什么最基本的,不起眼的 [`ls` 命令][17],不在本文列表中,那是因为 `find` 的灵活性。它不仅可以找到列表文件: +如果你一直想知道为什么最基本的、不起眼的 [ls 命令][17],不在本文列表中,那是因为 `find` 的灵活性。它不仅可以列表文件: ``` $ find . @@ -142,43 +144,43 @@ $ find . -ls ### tar -人们有时会引用 BSD 的 `tar` 语法来拿 Linux 命令开玩笑。尽管广为人赞,但 `tar` 命令实际上非常直观。读者可以阅读我的 [如何解压缩 tar.gz 文件][18] 文章,了解按需使用 `tar` 命令的简单知识。 +人们有时会引用 BSD 的 `tar` 语法来拿 Linux 命令开玩笑。尽管有这样的名声,但 `tar` 命令实际上非常直观。读者可以阅读我的 [如何解压缩 tar.gz 文件][18] 文章,了解在需要时使用 `tar` 命令的简单知识。 -### more or less or most +### more、less 和 most -这些统称为 pager 命令。pager 命令与 `cat` 类似,但前者会在屏幕底部暂停输出,直到你向下滚动查看更多内容。这些命令比较简单,但每个之间都有细微差别。用户是用箭头键还是空格键滚动?是必须手动退出,还是在显示的文件末尾自动退出?用户的首选搜索行为是什么样的?选择你最喜欢的 pager 命令并将其设置在 `.bashrc` 中吧! +这些统称为分页命令。分页命令与 `cat` 类似,但前者会在屏幕底部暂停输出,直到你向下滚动查看更多内容。这些命令比较简单,但每个之间都有细微差别。用户是用箭头键还是空格键滚动?是必须手动退出,还是在显示的文件末尾自动退出?用户的首选搜索行为是什么样的?选择你最喜欢的分页命令并将其设置在 `.bashrc` 中吧! -### ssh and scp +### ssh 和 scp -OpenSSH 不仅有助于保护与远程系统的连接安全,还可以用于启用其他命令。例如,对于许多用户来说,有了 `.ssh` 目录,他们才能与 Git 存储库顺利交互、将更新发布到网站、登录云控制平面。 +OpenSSH 不仅有助于保护与远程系统的连接安全,还可以用于启用其他命令。例如,对于许多用户来说,有了 `.ssh` 目录,他们才能与 Git 存储库顺利交互、将更新发布到网站、登录云控制平台。 ### mv -`mv` 命令有双重作用:它既 [移动文件][19] 又 [重命名文件][20]。它有几个可用的保护措施,例如 `--interactive` 和 `--no-clobber` 选项避免破坏现有文件,`--backup` 命令确保数据在新位置验证之前被保留,以及 `--update` 选项确保旧版本不会替换新版本文件。 +`mv` 命令有双重作用:它既可以 [移动文件][19] 又可以 [重命名文件][20]。它有几个可用的保护措施,例如 `--interactive` 和 `--no-clobber` 选项避免破坏现有文件,`--backup` 命令确保数据在新位置验证之前被保留,以及 `--update` 选项确保旧版本不会替换新版本文件。 ### sudo -当某个用户账户的用户名已知,且具有 _全部_ 系统权限时,该用户很快就会成为黑客攻击的目标。`sudo` 命令消除了对字面上 `root` 用户的需求,从而优雅地移除了有关系统的重要信息。不过这还不是全部,使用 `sudo` 你还可以轻松地将权限管理到单个命令、用户和组。你可以启用选择命令的无密码执行、记录用户会话、使用摘要验证验证命令,[以及更多操作][21]。 +当某个用户账户的用户名已知,且具有 _全部_ 系统权限时,该用户很快就会成为黑客攻击的目标。`sudo` 命令消除了对字面上 `root` 用户的需求,从而优雅地移除了有关系统的重要信息。不过这还不是全部,使用 `sudo` 你还可以轻松地管理单个命令、用户和组的权限。你可以在选定的命令上启用无密码执行、记录用户会话、使用摘要验证来验证命令,[等等][21]。 ### alias 使用 `alias` 命令将长命令变成易于记忆的快捷方式: ``` -`$ alias ls='ls --classify --almost-all --ignore-backups --color'` +$ alias ls='ls --classify --almost-all --ignore-backups --color' ``` ### clear -有时终端会显得很混乱,输入 `clear`(或在某些 shell 中按 **Ctrl+L**)后,你就能得到漂亮、全新的屏幕了。 +有时终端会显得很混乱,输入 `clear`(或在某些 shell 中按 `Ctrl+L`)后,你就能得到漂亮、刷新的屏幕了。 ### setfacl -传统上,POSIX 文件权限由 `chown` 和 `chmod` 决定。然而,如今系统变得更加复杂,因此有一个灵活性更高的命令。`setfacl` 命令允许创建一个 [访问控制列表 (ACL)][22],可以配置任意用户所需权限,并可以为文件夹及其中创建的内容设置默认权限。 +传统上,POSIX 文件权限由 `chown` 和 `chmod` 决定。然而,如今系统变得更加复杂,因此有一个灵活性更高的命令。`setfacl` 命令允许创建一个 [访问控制列表(ACL)][22],可以配置任意用户所需权限,并可以为文件夹及其中创建的内容设置默认权限。 ### netcat -可能需要使用 netcat (`nc`) 的人不多,但这些使用人对它的依赖度会很高。`nc` 命令是一个通用的网络连接工具。 +可能需要使用 `netcat`(`nc`)的人不多,但这些使用它的人确离不开它。`nc` 命令是一个通用的网络连接工具。 它可以连接到一个端口,类似于 `telnet` 命令: @@ -202,7 +204,7 @@ $ nc -zv 192.168.0.12 25-80 ### 你自己构建的命令 -在某种程度上,Linux 终端是关于创造性解决问题的平台。当你学习命令时,你也在学习可用于创建自己的命令的构造块。我的 [shell history][23] 中的许多命令都是自己编写的 shell 脚本,从而我实现了根据自己想要的工作方式定制工作流程。你为自己的效率和舒适度而设计的命令也可以作为 shell 中的基本命令。花些时间了解一些很棒的命令,然后试着构建自己的命令吧。当你构建出的命令非常好用时,把它开源,这样就可以与他人分享你的想法啦! +在某种程度上,Linux 终端是一个创造性解决问题的平台。当你学习命令时,你也在学习可用于创建自己的命令的组块。我的 [shell 历史][23] 中的许多命令都是自己编写的 shell 脚本,从而实现了根据自己想要的工作方式定制工作流程。你为自己的效率和舒适度而设计的命令也可以作为 shell 中的基本命令。花些时间了解一些很棒的命令,然后试着构建自己的命令吧。当你构建出的命令非常好用时,把它开源,这样就可以与他人分享你的想法啦! -------------------------------------------------------------------------------- @@ -211,7 +213,7 @@ via: https://opensource.com/article/21/9/essential-linux-commands 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 645917ce915e6bda3e654ec4ab310d56f35b564e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Sep 2021 08:26:42 +0800 Subject: [PATCH 136/138] PUB @unigeorge https://linux.cn/article-13759-1.html --- .../20210901 20 essential Linux commands for every user.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210901 20 essential Linux commands for every user.md (99%) diff --git a/translated/tech/20210901 20 essential Linux commands for every user.md b/published/20210901 20 essential Linux commands for every user.md similarity index 99% rename from translated/tech/20210901 20 essential Linux commands for every user.md rename to published/20210901 20 essential Linux commands for every user.md index 619ae0b1a7..61ef6c4baf 100644 --- a/translated/tech/20210901 20 essential Linux commands for every user.md +++ b/published/20210901 20 essential Linux commands for every user.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "unigeorge" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13759-1.html" 用户必会的 20 个 Linux 基础命令 ====== From ac1623ec9eae55be8add19337e460c5f7e8481c5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 7 Sep 2021 08:41:36 +0800 Subject: [PATCH 137/138] translated --- .../20210901 What are container runtimes.md | 97 ------------------- .../20210901 What are container runtimes.md | 96 ++++++++++++++++++ 2 files changed, 96 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20210901 What are container runtimes.md create mode 100644 translated/tech/20210901 What are container runtimes.md diff --git a/sources/tech/20210901 What are container runtimes.md b/sources/tech/20210901 What are container runtimes.md deleted file mode 100644 index 56f3b32fe8..0000000000 --- a/sources/tech/20210901 What are container runtimes.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: subject: "What are container runtimes?" -[#]: via: "https://opensource.com/article/21/9/container-runtimes" -[#]: author: "Nived V https://opensource.com/users/nivedv" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -What are container runtimes? -====== -Take a deep dive into container runtimes so you can understand how -container environments are built. -![Ships at sea on the web][1] - -In my examination of [container images][2], I discussed container fundamentals, but now it's time to delve deeper into container runtimes so you can understand how container environments are built. The information in this article is in part extracted from the [official documentation][3] of the Open Container Initiative (OCI), the open standard for containers, so this information is relevant regardless of your container engine. - -### Container runtimes - -So what really happens in the backend when you run a command like `podman run` or `docker run` command? Here is a step-by-step overview for you: - - 1. The image is pulled from an image registry if it not available locally - 2. The image is extracted onto a copy-on-write filesystem, and all the container layers overlay each other to create a merged filesystem - 3. A container mount point is prepared - 4. Metadata is set from the container image, including settings like overriding CMD, ENTRYPOINT from user inputs, setting up SECCOMP rules, etc., to ensure container runs as expected - 5. The kernel is alerted to assign some sort of isolation, such as process, networking, and filesystem, to this container (namespaces) - 6. The kernel is also alerted to assign some resource limits like CPU or memory limits to this container (cgroups) - 7. A system call (syscall) is passed to the kernel to start the container - 8. SELinux/AppArmor is set up - - - -Container runtimes take care of all of the above. When we think about container runtimes, the things that come to mind are probably runc, lxc, containerd, rkt, cri-o, and so on. Well, you are not wrong. These are container engines and container runtimes, and each is built for different situations. - -_Container runtimes_ focus more on running containers, setting up namespace and cgroups for containers, and are also called lower-level container runtimes. Higher-level container runtimes or container engines focus on formats, unpacking, management, and image-sharing. They also provide APIs for developers. - -### Open Container Initiative (OCI) - -The Open Container Initiative (OCI) is a Linux Foundation project. Its purpose is to design certain open standards or a structure around how to work with container runtimes and container image formats. It was established in June 2015 by Docker, rkt, CoreOS, and other industry leaders. - -It does this using two specifications: - -#### 1\. Image Specification (image-spec) - -The goal of this specification is to enable the creation of interoperable tools for building, transporting, and preparing a container image to run. - -The high-level components of the spec include: - - * [Image Manifest][4] — a document describing the elements that make up a container image - * [Image Index][5] — an annotated index of image manifests - * [Image Layout][6] — a filesystem layout representing the contents of an image - * [Filesystem Layer][7] — a changeset that describes a container’s filesystem - * [Image Configuration][8] — a document determining layer ordering and configuration of the image suitable for translation into a [runtime bundle][9] - * [Conversion][10] — a document explaining how this translation should occur - * [Descriptor][11] — a reference that describes the type, metadata, and content address of referenced content - - - -#### 2\. Runtime specification (runtime-spec) - -This specification aims to define the configuration, execution environment, and lifecycle of a container. The config.json file provides the container configuration for all supported platforms and details the field that enables the creation of a container. The execution environment is detailed along with the common actions defined for a container’s lifecycle to ensure that applications running inside a container have a consistent environment between runtimes. - -The Linux container specification uses various kernel features, including namespaces, cgroups, capabilities, LSM, and filesystem jails to fulfill the spec. - -### Now you know - -Container runtimes are managed by the OCI specifications to provide consistency and interoperability. Many people use containers without the need to understand how they work, but understanding containers is a valuable advantage when you need to troubleshoot or optimize how you use them. - -* * * - -_This article is based on a [techbeatly][12] article and has been adapted with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/container-runtimes - -作者:[Nived V][a] -选题:[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/nivedv -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes_containers_ship_lead.png?itok=9EUnSwci (Ships at sea on the web) -[2]: https://opensource.com/article/21/8/container-fundamentals-2 -[3]: https://github.com/opencontainers -[4]: https://github.com/opencontainers/image-spec/blob/master/manifest.md -[5]: https://github.com/opencontainers/image-spec/blob/master/image-index.md -[6]: https://github.com/opencontainers/image-spec/blob/master/image-layout.md -[7]: https://github.com/opencontainers/image-spec/blob/master/layer.md -[8]: https://github.com/opencontainers/image-spec/blob/master/config.md -[9]: https://github.com/opencontainers/runtime-spec -[10]: https://github.com/opencontainers/image-spec/blob/master/conversion.md -[11]: https://github.com/opencontainers/image-spec/blob/master/descriptor.md -[12]: https://medium.com/techbeatly/container-runtimes-deep-dive-77eb0e511939 diff --git a/translated/tech/20210901 What are container runtimes.md b/translated/tech/20210901 What are container runtimes.md new file mode 100644 index 0000000000..be42d2f766 --- /dev/null +++ b/translated/tech/20210901 What are container runtimes.md @@ -0,0 +1,96 @@ +[#]: subject: "What are container runtimes?" +[#]: via: "https://opensource.com/article/21/9/container-runtimes" +[#]: author: "Nived V https://opensource.com/users/nivedv" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +什么是容器运行时? +====== +深入了解容器运行时,你就可以理解容器环境是如何建立的。 +![Ships at sea on the web][1] + +在对[容器镜像][2]的检查中,我讨论了容器的基本原理,但现在是时候深入研究容器运行时了,这样你就可以了解容器环境是如何构建的。本文的部分信息摘自 Open Container Initiative (OCI)(容器的开放标准)的[官方文档][3],所以无论你的容器引擎如何,这些信息都是相关的。 + +### 容器运行机制 + +那么,当你运行 `podman run` 或 `docker run` 命令时,在后台到底发生了什么?这里为你提供一个逐步的概述: + + 1. 如果本地没有镜像,则从镜像注册处拉取镜像 + 2. 镜像被提取到一个写时拷贝的文件系统上,所有的容器层相互叠加以创建一个合并的文件系统 + 3. 准备一个容器挂载点 + 4. 从容器镜像中设置元数据,包括诸如覆盖 CMD、来自用户输入的 ENTRYPOINT、设置 SECCOMP 规则等设置,以确保容器按预期运行 + 5. 提醒内核为该容器分配某种隔离,如进程、网络和文件系统(命名空间) + 6. 内核还被提醒为这个容器分配一些资源限制,如 CPU 或内存限制(cgroups) + 7. 一个系统调用(syscall)被传递给内核以启动容器 + 8. 设置 SELinux/AppArmor + + + +容器运行时负责上述所有的工作。当我们想到容器运行时,想到的可能是 runc、lxc、containerd、rkt、cri-o 等等。嗯,你没有错。这些都是容器引擎和容器运行时,每一种都是为不同的情况建立的。 + +_容器运行时_更侧重于运行容器,为容器设置命名空间和 cgroups,也被称为底层容器运行时。高层的容器运行时或容器引擎专注于格式、解包、管理和镜像共享。它们还为开发者提供 API。 + +### Open Container Initiative (OCI) + +Open Container Initiative(OCI)是一个 Linux 基金会项目。其目的是设计某些开放标准或围绕如何与容器运行时和容器镜像格式工作的结构。它是由 Docker、rkt、CoreOS 和其他行业领导者于 2015 年 6 月建立的。 + +它使用两个规范来做这件事: + +#### 1\. 镜像规范(image-spec) + +该规范的目标是创建可互操作的工具,用于构建、传输和准备运行的容器镜像。 + +该规范的高层组件包括: + + * [Image Manifest][4] — 一个描述构成容器镜像的元素的文件 + * [Image Index][5] — 镜像清单的注释索引 + * [Image Layout][6] — 一个代表镜像内容的文件系统布局 + * [Filesystem Layer][7] — 一个描述容器文件系统的变化集 + * [Image Configuration][8] — 确定镜像层排序和配置的文件,适合转换成[运行时包][9]。 + * [Conversion][10] — 解释应该如何进行转换的文件 + * [Descriptor][11] — 一个描述被引用内容的类型、元数据和内容地址的参考资料 + + + +#### 2\. 运行时规范(runtime-spec) + +该规范旨在定义容器的配置、执行环境和生命周期。config.json 文件为所有支持的平台提供了容器配置,并详细说明了能够创建容器的地方。执行环境与为容器的生命周期定义的通用操作一起被详细说明,以确保在容器内运行的应用在不同的运行时之间有一个一致的环境。 + +Linux 容器规范使用了各种内核功能,包括命名空间、cgroups、capabilities、LSM 和文件系统监牢来实现该规范。 + +### 现在你知道了 + +容器运行时是由 OCI 规范管理的,以提供一致性和互操作性。许多人在使用容器时不需要了解它们是如何工作的,但当你需要排除故障或优化使用方法时,了解容器是一个宝贵的优势。 + +* * * + +_本文基于 [techbeatly][12] 的文章,并经授权改编。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/container-runtimes + +作者:[Nived V][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/nivedv +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes_containers_ship_lead.png?itok=9EUnSwci (Ships at sea on the web) +[2]: https://opensource.com/article/21/8/container-fundamentals-2 +[3]: https://github.com/opencontainers +[4]: https://github.com/opencontainers/image-spec/blob/master/manifest.md +[5]: https://github.com/opencontainers/image-spec/blob/master/image-index.md +[6]: https://github.com/opencontainers/image-spec/blob/master/image-layout.md +[7]: https://github.com/opencontainers/image-spec/blob/master/layer.md +[8]: https://github.com/opencontainers/image-spec/blob/master/config.md +[9]: https://github.com/opencontainers/runtime-spec +[10]: https://github.com/opencontainers/image-spec/blob/master/conversion.md +[11]: https://github.com/opencontainers/image-spec/blob/master/descriptor.md +[12]: https://medium.com/techbeatly/container-runtimes-deep-dive-77eb0e511939 From e3aeba76dd829e53839753a79b7be88b160dd10b Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 7 Sep 2021 08:45:58 +0800 Subject: [PATCH 138/138] translating --- .../tech/20210906 Resize an image from the Linux terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210906 Resize an image from the Linux terminal.md b/sources/tech/20210906 Resize an image from the Linux terminal.md index a5d0764687..ed603fbb16 100644 --- a/sources/tech/20210906 Resize an image from the Linux terminal.md +++ b/sources/tech/20210906 Resize an image from the Linux terminal.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/resize-image-linux" [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " "