From 07995bf7c0e3648da2fb24eb9c66cbfa4336f629 Mon Sep 17 00:00:00 2001 From: Shiboi77 <87035635+Shiboi77@users.noreply.github.com> Date: Tue, 20 Jul 2021 18:20:33 +0800 Subject: [PATCH 01/40] Update and rename sources/talk/20210529 My family-s Linux story.md to transtlated/talk/20210529 My family-s Linux story.md --- .../talk/20210529 My family-s Linux story.md | 38 ------------------- .../talk/20210529 My family-s Linux story.md | 38 +++++++++++++++++++ 2 files changed, 38 insertions(+), 38 deletions(-) delete mode 100644 sources/talk/20210529 My family-s Linux story.md create mode 100644 transtlated/talk/20210529 My family-s Linux story.md diff --git a/sources/talk/20210529 My family-s Linux story.md b/sources/talk/20210529 My family-s Linux story.md deleted file mode 100644 index 32febedaca..0000000000 --- a/sources/talk/20210529 My family-s Linux story.md +++ /dev/null @@ -1,38 +0,0 @@ -[#]: subject: (My family's Linux story) -[#]: via: (https://opensource.com/article/21/5/my-linux-story) -[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) -[#]: collector: (lujun9972) -[#]: translator: (Shiboi77) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -My family's Linux story -====== -Our first attempt at Linux was just an apt-get away. -![Terminal command prompt on orange background][1] - -My first attempt at Linux was one of those "maybe I should give this a try" kinds of situations. - -Back in the late 1990s, I found some kind of packaged Red Hat distro on quite a few floppies, bought a second hard drive for the family laptop, and set about installing it. It was an interesting experiment, but as I recall the family wasn't quite ready to share the computer to that extent. Fast forward to 2005, I finally broke down and bought a lovely Toshiba laptop that ran Window XP. At work, I had an aging Sun SPARCStation 5, and I didn't really like the direction the whole Solaris thing was going at that point (Motif-based desktop). I really wanted GIMP for some project or the other, but the convoluted journey to installing GNOME 1.x (was it 1.4? maybe) on Solaris was challenging. So, I was actually contemplating jumping ship to Windows XP. But after living with it on my home machine for a few months, I found myself liking that even less than trying to run GNOME on Solaris, so I installed Ubuntu Hoary Hedgehog 5.04 and then Breezy Badger 5.10 on my laptop. It was wonderful. That machine with its 3.2GHz Pentium, 2GB of memory, and 100GB hard drive ran rings around my SPARCStation 5. - -All of a sudden, instead of fooling around with cobbled-together Solaris packages to try to get stuff running, things were just an apt-get away. The timing was good, too. My family and I lived in Grenoble, France from August 2006 to July 2007, while my wife was on sabbatical. Because of the Linux Toshiba, I was able to take my work with me. At the time I was doing a lot of GIS data processing on a couple of big projects; I found I could do the same thing in PostGIS / PostgreSQL much more rapidly than with the incredibly expensive commercial GIS software we used back home in Canada. Everyone was happy, especially me.  - -The funny thing that happened along the way was that we took two other computers to France - my wife's similar Toshiba (running XP, which worked fine for her) and our kids' recently acquired new Toshiba laptop, also running XP. Just after Christmas, they had some friends over who inadvertently installed a nasty and impossible to remove virus on their computer. After several hours over a few days, one of my kids asked "Dad, can't we just install the same thing as on your computer"?  And poof, three new Linux users were created. My son, at 29 years old, is still a happy Linux user, and I'm guessing on his fourth or fifth Linux laptop, the last few all supplied by System76. One of my daughters was forced to convert to Windows when she started law school three years ago as her school had a mandatory testing framework that only would run on Windows and would allegedly detect things like VMs and whatnot (please don't get me started). And, my other daughter was seduced by a Macbook Air that her company bought for her. - -Oh well, can't win them all! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/my-linux-story - -作者:[Chris Hermansen][a] -选题:[lujun9972][b] -译者:[Shiboi77](https://github.com/Shiboi77) -校对:[校对者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/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) diff --git a/transtlated/talk/20210529 My family-s Linux story.md b/transtlated/talk/20210529 My family-s Linux story.md new file mode 100644 index 0000000000..8245ab86be --- /dev/null +++ b/transtlated/talk/20210529 My family-s Linux story.md @@ -0,0 +1,38 @@ +[#]: subject: (My family's Linux story) +[#]: via: (https://opensource.com/article/21/5/my-linux-story) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: collector: (lujun9972) +[#]: translator: (shiboi77 ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +我的家庭 Linux 故事 +====== +我们在Linux的第一次尝试只是一个简单的方法。 +![在橙色背景的终端命令提示][1] + +我在linux的第一次尝试是“或许我应该试一试”的这种情况。 + +回到1990年,我在相当多的软盘上找到了一些打包的红帽发行版,我为家庭笔记本买了第二个硬盘,然后设置安装了它。 这是一件有趣的实验,但是我记起家中并没有准备在这程度上分享电脑。快进到2005年,我最终崩溃了,买了一台运行windows xp的可爱的东芝笔记本电脑。在工作中,我有一个老化的SUN SPARCStation 5,并且我不太喜欢整个solaris的发展方向(基于Motif的桌面)。我真的想要用GIMP来完成一些项目或其他项目,但是安装GNOME1.x的是复杂的(也许它是1.4?)在Solaris是具有挑战性的。所以,我实际上是在考虑跳槽到Windows xp。 但是在我的家用机器上用了几个月之后,我发现自己喜欢它的程度甚至低于在Solaris上运行GNOME,所以我安装了Ubuntu Hoary Hedgehog 5.04然后在我的笔记本电脑上安装了Breezy Badger 5.10。这太棒了。那台拥有3.2GHz奔腾处理器,2GB内存和100GB的硬盘的机器在我的SPARCStation 5周围运行。 + +突然之间,不再是用拼凑起来的Solaris安装包试图去让东西运行,这些事情仅仅是一个轻松地方式。并且时机也很好。我家庭和我从2006年8月到2007年7月居住在法国格勒诺布尔,而我的妻子在休假。因为有了linux东芝,我才能随身带着我的工作。那个时候我在几大项目上做了大量的GIS数据处理,我发现我可以在PostGIS / PostgreSQL上做同样的事情,比我们在加拿大使用的昂贵得多的商业GIS软件要快得多。大家都很开心,尤其是我。 + +一路上发生的有趣的事情是,我们把另外两台电脑逮到了法国——我妻子的类似的东芝电脑(运行xp,对她来说很好用)和我们孩子最近新买的东芝牌笔记本电脑,也运行xp。仅仅就在圣诞节过后,他们有一些朋友在无意中安装了一个讨厌的并且无法清除的病毒在他们的电脑上。经过几个小时甚至几天后,我的一个孩子问我:“爸爸,我们就不能安装和你电脑上一样的东西吗?”然后,创建了三个新的Linux用户。我的儿子在29岁依然是一个快乐的Linux用户,我猜他第四或第五台Linux笔记本电脑的系统全部由最近的系统76支持。我的一个女儿三年前开始读法学院,因为他所在的学校有一个强制性的测试框架,只能在Windows上运行,而且据称会检测VM之类的东西(请不要让我开始)。而且我的另一个女儿被她的公司为她买的Macbook Air诱惑了。 + +哦,好吧,不能赢得他们所有! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/my-linux-story + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[shiboi77](https://github.com/shiboi77) +校对:[校对者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/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) From d711668b73a00c28aa3ec692fd6c2545fca67015 Mon Sep 17 00:00:00 2001 From: Shiboi77 <87035635+Shiboi77@users.noreply.github.com> Date: Tue, 20 Jul 2021 18:22:12 +0800 Subject: [PATCH 02/40] Rename transtlated/talk/20210529 My family-s Linux story.md to translated/talk/20210529 My family-s Linux story.md --- .../talk/20210529 My family-s Linux story.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {transtlated => translated}/talk/20210529 My family-s Linux story.md (100%) diff --git a/transtlated/talk/20210529 My family-s Linux story.md b/translated/talk/20210529 My family-s Linux story.md similarity index 100% rename from transtlated/talk/20210529 My family-s Linux story.md rename to translated/talk/20210529 My family-s Linux story.md From bc898094ab8002bd48b94e9b3a5f80407ae2507c Mon Sep 17 00:00:00 2001 From: Piaoshi Date: Wed, 21 Jul 2021 00:07:19 +0800 Subject: [PATCH 03/40] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91-tech?= =?UTF-8?q?-20210529=20Configuring=20Vim=20as=20a=20Writing=20Tool.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20210529 Configuring Vim as a Writing Tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210529 Configuring Vim as a Writing Tool.md b/sources/tech/20210529 Configuring Vim as a Writing Tool.md index ca6a93e8f7..b7afb5e863 100644 --- a/sources/tech/20210529 Configuring Vim as a Writing Tool.md +++ b/sources/tech/20210529 Configuring Vim as a Writing Tool.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/configuring-vim-writing/) [#]: author: (Theena https://news.itsfoss.com/author/theena/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (piaoshi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fc0e9d6c5efdc7e7a1c409544e4ad921ce9dc3d9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Jul 2021 05:03:38 +0800 Subject: [PATCH 04/40] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210720=20Ac?= =?UTF-8?q?cess=20cloud=20files=20on=20Windows=20with=20ownCloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210720 Access cloud files on Windows with ownCloud.md --- ...ss cloud files on Windows with ownCloud.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20210720 Access cloud files on Windows with ownCloud.md diff --git a/sources/tech/20210720 Access cloud files on Windows with ownCloud.md b/sources/tech/20210720 Access cloud files on Windows with ownCloud.md new file mode 100644 index 0000000000..a517fd3a4c --- /dev/null +++ b/sources/tech/20210720 Access cloud files on Windows with ownCloud.md @@ -0,0 +1,117 @@ +[#]: subject: (Access cloud files on Windows with ownCloud) +[#]: via: (https://opensource.com/article/21/7/owncloud-windows-files) +[#]: author: (Martin Loschwitz https://opensource.com/users/martinloschwitzorg) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Access cloud files on Windows with ownCloud +====== +ownCloud VFS leverages Microsoft's cloud files API to make opening, +modifying, and saving online files seamless. +![Scissors cutting open access to files][1] + +Most computer users nowadays rely on online file storage. Thanks to the rise of cloud computing, the idea of storing files remotely and downloading them when needed has gained a lot of fresh air in recent years. Yet, the principle's technical roots are anything but new, with implementations reaching back decades. While the protocols used and features expected for accessing data on online storage have changed massively, the basic idea hasn't altered much since the days of FTP and similar protocols. + +There's an easy explanation for why online (or "cloud") storage has so many fans. Cloud storage usually resides on highly redundant infrastructure, often distributed across physical sites. Ordinary people would have a tough time setting up anything similar with the tools generally available to them. Cloud storage also allows users to extend their storage space easily without having to fiddle with their device hardware. It also enables people to share files with relatives, friends, or colleagues in just a few simple steps. + +Smartphones are an excellent example of cloud storage's advantages; clients including Dropbox, Google Drive, and iCloud are deeply integrated into mobile operating systems and can be used in apps just like local storage. + +Classical desktop and laptop computers don't integrate online storage as well as smartphones do. Rather, accessing iCloud, ownCloud, or other storage solutions from a computer is a tedious task for several reasons. + +### A matter of protocol + +Many of the reasons boil down to the protocol. The methods and protocols for accessing online storage have changed often, and no single protocol has established itself as a de-facto standard. Online storage services such as Dropbox, S3, and iCloud use proprietary protocols (partially based on open protocols such as WebDAV), which cannot be implemented easily on desktop operating systems. As a result, desktop users often face tedious user interfaces (UIs), reduced comfort, and poor user experience (UX) with online file storage. + +It helps to look a bit deeper to understand the problem and come up with possible solutions. To start, all modern operating systems—notably Windows, macOS, and Linux (along with its numerous derivatives)—assume they are exclusively in charge of a user's files. This comes from the old-fashioned assumption that a user's files will be hosted on a single device. If all a user's files are stored on the same device, it is easy to put them in a tree-like structure (as desktop operating systems have been doing for ages) and present a unique view to the user. + +With cloud-based storage, things are not so easy. Because these files are not available locally, a computer's operating system cannot manage or display them the same way it displays local files. To edit an Excel sheet stored in the cloud, you must download the file from the cloud, store it locally, modify it, and upload it again. Not only does this break your UI and UX; it also creates chaos. + +Some online storage providers try to work around the issue with clients that synchronize contents between the cloud and the local machine. This is an ugly workaround. For instance, you might not want the dozens of gigabytes of data stored in your cloud to also reside on your small local device. To mitigate this challenge, some tools allow you to select a subset of data to synchronize between the client and the online service; this shifts the problem to the side a bit but certainly does not solve it. + +### How WebDAV failed the industry + +Many IT professionals are likely shaking their heads fiercely, knowing there's a protocol for these types of tasks that could be used. And they are not completely wrong. [WebDAV][2] was specified as early as June 2007 by the IETF to extend the HTTP protocol for Web Distributed Authoring and Versioning (WebDAV for short). WebDAV's sole purpose was to provide an interface that allows files in a remote location, such as online cloud storage, to be accessed and edited the same way local files can be. WebDAV has gained traction since then: Private cloud solutions such as ownCloud and NextCloud support and can be accessed through it. + +Yet to call WebDAV a ringing success would be unrealistic, as neither the server nor the client side has achieved widespread use. Matters are especially bad on the server side: many online storage services, including Dropbox, Google Drive, and Microsoft OneDrive, do not support the WebDAV extension to HTTP. Some put proxy services in place. Dropbox, for instance, can be used with DAVbox to achieve WebDAV access. Other services provide tools to mitigate the lack of a working WebDAV server. Generally speaking, though, WebDAV support is not widespread throughout the industry, and that will probably not change anytime soon. + +### Poor operating system support for WebDAV + +This leads right into the second aspect of WebDAV's disastrous history: the client side. At this time, only one operating system has somewhat complete client support throughout the relevant tools of its userland, and that is Linux. Standard desktop environments such as KDE, GNOME, and Xfce can connect to WebDAV drives from the desktop. They also integrate WebDAV drives as if they were normal local disks, effectively allowing users to move data back and forth between the remote site and the local machine. Last but not least, they can download files from WebDAV devices on demand instead of keeping files continuously in sync between a remote site and the local drive. In Linux, life with WebDAV is mostly good—mostly because WebDAV doesn't feature inherent caching. + +Matters change a bit when looking at macOS. Apple equipped macOS with a WebDAV client a while ago, and it mostly works fine. However, it is tedious for less experienced users to set up. And macOS's WebDAV client tends to misbehave when the connection between the client and the server is brittle—like it would be for users in Germany behind LTE connectivity. In such setups, users have to clean up their WebDAV directories regularly to be able to use them. + +The most widespread operating system, Windows, also offers the most dramatic failure in terms of WebDAV integration. To even set up a WebDAV-based storage drive, you would have to edit the Windows Registry—a task that easily exceeds the average computer user's knowledge. If that were not bad enough, even after modifying the Registry, the Windows client for the WebDAV protocol looks more like a stub than a usable feature. You will soon experience problems like those found with the macOS WebDAV implementation, and the experience of using the protocol will be terrible. + +### ownCloud's VFS alternative + +[ownCloud][3] is a private cloud solution that allows users to store, sync, and share data on their own terms, including on a Raspberry Pi, a private cloud, or in a hybrid setup. ownCloud offers a client for the world's most common operating system. But for many years, it relied upon workarounds, like requiring users to explicitly choose which files to synchronize. + +ownCloud has come up with a solution to the problem—and it's a rather sophisticated one. Windows offers an interface to connect to cloud-based online storage, and ownCloud leverages that interface with its [virtual file system][4] (VFS).  + +### How VFS works + +ownCloud's VFS functionality for Windows heavily relies on a Microsoft feature named [cloud files API][5]. It was officially introduced in Windows 10, version 1809 in 2017. Microsoft designed it for file synchronization with OneDrive, but other services are free to use the API, which is now part of the Windows 10 core. The cloud files API is kind of a demarcation line for synchronizing data from the cloud to a local machine and vice versa. It's split into two parts: + + * The **API** provides functions on the API level to perform tasks such as opening, saving, and uploading files to the remote host after the user commits changes. The cloud files API handles a lot of things invisible to the user; for instance, a client using the API will display all remote files as "present" in the local view without downloading them. The cloud files API will download a file only after the user explicitly requests to open it from the remote drive. + * The **Windows.Storage.Provider** namespace allows applications in the userland to configure a client to access a remote service through the cloud files API. + + + +### What the user sees + +The revolutionary way that cloud files API deals with files in remote storage under Windows becomes clear when you see ownCloud VFS in action. + +First, set up a connection to your ownCloud drives from within the ownCloud Client for Windows. Make sure _virtual file support_ is enabled; this makes the directories in your ownCloud drive immediately visible and selectable in Windows tools, such as the Explorer. You won't be able to tell them apart from the files on your local storage devices, and when you open a file stored in ownCloud, it will appear like it is locally present. For files not synchronized to the local host, the cloud files API generates a placeholder that is replaced with the actual file when you open it. This allows a seamless user experience while preserving bandwidth on the client's and the server's internet links. + +Setting up a VFS drive in Windows does not require administrator privileges, as editing the Windows Registry for WebDAV connectivity requires. This means ownCloud VFS might be usable on devices such as business laptops, where the administrator account is usually not available to the user. Compliance policies may still forbid using ownCloud if the instance is not run by the company under its compliance regime, however. + +### Major differences from WebDAV + +Not only does VFS work considerably better on Windows 10 operating systems, it also offers a few features not available in protocols like WebDAV. One of these is implicit caching. During normal operations, VFS will synchronize files when they are opened until a locally defined cache is full; if the user requests additional files, VFS will remove the oldest files from the cache. + +Furthermore, VFS allows you to specify "favorite" files that will always be synchronized automatically from the remote drive whether or not you are trying to access them. This shortens the initial time to access frequently used files, especially if the files are large. + +### Storage Sense makes sense + +Another helpful feature in the Windows cloud files API is the "Storage Sense" feature added in Windows 1809. While primarily aimed at OneDrive users, Storage Sense can be used in the background with an ownCloud online storage drive due to its cloud files API support. Storage Sense regularly scans the Windows C: drive for files that have not been used for a long time. It synchronizes these files to the remote cloud storage and deletes them from the local device, freeing up space for data used more often. + +The user can determine Storage Sense's intervals and when Windows will trigger scans. The latter factor is not very important anymore because searching an SSD or NVMe device is very fast compared to the old days of searching spinning disk drives. Storage Sense aims to increase available disk space on systems, and ownCloud drives can be targets for offloading unused files. + +### VFS on other operating systems + +By creating a virtual file system based on the cloud files API, ownCloud improves the experience of using ownCloud online storage as a web drive in Microsoft Windows 10. ownCloud is one of the few free, libre, and open source software projects using this API at all—even other vendors' commercial support for it is rather weak. Apple's iCloud client for Windows uses the cloud files API, but the list is short. + +How does ownCloud use VFS on other operating systems? It's not as easy as porting the Windows functionality to other operating systems because the cloud files API is not present on non-Windows machines. + +ownCloud still implements comparable functionality—sort of. The macOS and Linux ownCloud clients behave as though the cloud files API were available even on non-Windows systems. Certain Windows functions have been replaced in the background with stubs for the corresponding system. There are a few notable differences between the Windows client and the view in Linux or macOS. For instance, Windows shows the correct file size even for remote files represented locally by a placeholder. On Linux and macOS, all files are displayed with a size of 1 byte and a local extension of .owncloud. This makes it clear that the files do not exist locally—at least until the user asks to open them and ownCloud initiates the download. + +It's true, though, that the VFS experience on macOS and Linux is not quite as smooth as it is on Windows 10. + +### Summary + +ownCloud's VFS dramatically improves the integration of ownCloud cloud storage drives into Windows 10. In contrast to WebDAV and related protocols, the cloud files API is a native API in Windows, integrated seamlessly with the operating system. This eliminates the ugly hacking required to enable WebDAV access in Windows 10, let alone the contortions needed to use it effectively. Older Windows clients do not benefit from the API, and its advantages might create an incentive to update old Windows versions in environments where ownCloud is heavily used. + +macOS and Linux users do not benefit as much from ownCloud's VFS support. On Linux, hobby projects like [elokab-files-manager][6] provide better support for ownCloud VFS. But this is certainly not something you would want to bet on as your daily driver. The situation on macOS is even worse: While Apple has long promised to add similar API functionality to macOS, only Big Sur seems to have the required feature set. As of this writing, ownCloud's developers have not yet adapted the ownCloud client for macOS to the new features in Big Sur. Consequently, Linux and macOS users can use VFS on their platforms with minor limitations. Windows 10 users, however, get the biggest bang for their buck. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/owncloud-windows-files + +作者:[Martin Loschwitz][a] +选题:[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/martinloschwitzorg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 (Scissors cutting open access to files) +[2]: https://en.wikipedia.org/wiki/WebDAV +[3]: https://owncloud.com/ +[4]: https://owncloud.com/features/virtual-files/ +[5]: https://docs.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine +[6]: https://github.com/dragotin/elokab-files-manager From 71cff81a127aaa8328090e4972d3e695949f9b4f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Jul 2021 05:03:59 +0800 Subject: [PATCH 05/40] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210720=20Ru?= =?UTF-8?q?n=20a=20Linux=20virtual=20machine=20in=20Podman?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210720 Run a Linux virtual machine in Podman.md --- ...0 Run a Linux virtual machine in Podman.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20210720 Run a Linux virtual machine in Podman.md diff --git a/sources/tech/20210720 Run a Linux virtual machine in Podman.md b/sources/tech/20210720 Run a Linux virtual machine in Podman.md new file mode 100644 index 0000000000..72df55d22a --- /dev/null +++ b/sources/tech/20210720 Run a Linux virtual machine in Podman.md @@ -0,0 +1,119 @@ +[#]: subject: (Run a Linux virtual machine in Podman) +[#]: via: (https://opensource.com/article/21/7/linux-podman) +[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Run a Linux virtual machine in Podman +====== +Use Podman Machine to create a basic Fedora CoreOS VM to use with +containers and containerized workloads. +![woman on laptop sitting at the window][1] + +Fedora CoreOS is an automatically updating, minimal [rpm-ostree][2]-based operating system for running containerized workloads securely and at scale. + +[Podman][3] "is a tool for managing containers and images, volumes mounted into those containers, and pods made from groups of containers. Podman is based on libpod, a library for container lifecycle management." + +Magical things happen when you use [Podman Machine][4], a feature that helps you create a basic Fedora CoreOS virtual machine (VM) to use with containers and containerized workloads. + +### Getting started with Podman Machine + +The first step is to install Podman. If you already have the latest version of Podman installed, you can skip the step. On my Fedora 34 machine, I installed Podman with: + + +``` +`$ sudo dnf install podman` +``` + +I'm using podman-3.2.2-1.fc34.x86_64. + +### Initializing a Fedora CoreOS + +Once Podman is installed, initialize it with: + + +``` +❯ podman machine init vm2 +Downloading VM image: fedora-coreos-34.20210626.1.0-qemu.x86_64.qcow2.xz: done   +Extracting compressed file +``` + +This command creates `vm2` and downloads Fedora CoreOS's qcow2 file in .xz format and extracts it. + +### Listing your VMs + +It's always important to know your VMs and their status, and the `list` command helps with that. The following example shows the names of all my VMs, the date they were created, and the last time they were up: + + +``` +❯ podman machine list   +NAME                    VM TYPE         CREATED         LAST UP +podman-machine-default*  qemu           6 days ago      Currently running +vm2                     qemu            11 minutes ago  11 minutes ago +``` + +### Starting a VM + +To start a VM, run: + + +``` +❯ podman machine start +Waiting for VM … +``` + +### SSHing into the VM + +You can use secure shell (SSH) to access your VM and use it to run workloads without any setup hassles: + + +``` +❯ podman machine ssh   +Connecting to vm podman-machine-default. To close connection, use `~.` or `exit` +Fedora CoreOS 34.20210611.1.0 +Tracker: +Discuss: +  +Last login: Wed Jun 23 13:23:36 2021 from 10.0.2.2 +[core@localhost ~]$ uname -a +Linux localhost 5.12.9-300.fc34.x86_64 #1 SMP Thu Jun 3 13:51:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux +[core@localhost ~]$ +``` + +Currently, Podman only supports running one VM at a time. + +### Stopping your VM + +To stop a running VM, use the `stop` command: + + +``` +❯ podman machine stop + +[core@localhost ~]$ Connection to localhost closed by remote host. +Connection to localhost closed. +Error: exit status 255 +``` + +I hope this helps you get started with Podman Machine. Give it a try, and let us know what you think in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/linux-podman + +作者:[Sumantro Mukherjee][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sumantro +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: http://coreos.github.io/rpm-ostree/ +[3]: https://github.com/containers/podman +[4]: http://docs.podman.io/en/latest/markdown/podman-machine.1.html From 670f84228ea6c29a392ffbd6e32cac329f411cef Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 21 Jul 2021 08:38:27 +0800 Subject: [PATCH 06/40] translated --- ...ps for daily needs part 1- web browsers.md | 112 ------------------ ...ps for daily needs part 1- web browsers.md | 112 ++++++++++++++++++ 2 files changed, 112 insertions(+), 112 deletions(-) delete mode 100644 sources/tech/20210716 Apps for daily needs part 1- web browsers.md create mode 100644 translated/tech/20210716 Apps for daily needs part 1- web browsers.md diff --git a/sources/tech/20210716 Apps for daily needs part 1- web browsers.md b/sources/tech/20210716 Apps for daily needs part 1- web browsers.md deleted file mode 100644 index c03f7cea9c..0000000000 --- a/sources/tech/20210716 Apps for daily needs part 1- web browsers.md +++ /dev/null @@ -1,112 +0,0 @@ -[#]: subject: (Apps for daily needs part 1: web browsers) -[#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/) -[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Apps for daily needs part 1: web browsers -====== - -![][1] - -Photo by [Brooke Cagle][2] on [Unsplash][3] - -One of the important apps for daily needs is a web browser. That’s because surfing the internet is an activity most people do in front of the computer. This article will introduce some of the open source web browsers that you can use on Fedora Linux. You need to install the software mentioned. All the browsers mentioned in this article are already available in the official Fedora repository. 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]. - -### Firefox - -Firefox is a fast and privacy-focused browser that works across many devices. It was created by [Mozilla][5] and is a browser with complete features offering many extensions. You can add many powerful functions and useful features to your Firefox browser. It uses just enough memory to create a smooth experience so your computer stays responsive to other tasks. You can create an account that will allow you to share configurations on multiple devices, so you don’t need to set up Firefox on each device. - -![][6] - -Firefox offers the following features: - - * Private Browsing mode - * Ad tracker blocking - * Password manager - * Sync between devices - * Picture-in-Picture - - - -More information about Firefox browser is available at this link: [https://www.mozilla.org/en-US/firefox][7] - -### GNOME Web - -GNOME Web is a browser for GNOME desktop which is the default desktop environment for Fedora Workstation. It may be very appropriate as your main browser if you use Fedora Workstation with GNOME as the default desktop environment. This browser has a simple, clean, and beautiful look. GNOME Web has fewer features than Firefox, but it is sufficient for common uses. - -![][8] - -GNOME Web offers the following features: - - * Incognito mode - * GNOME desktop integration - * built-in adblocker - * Intelligent tracking prevention - - - -More information about GNOME Web is available at this link: - -### Chromium - -Chromium is an open-source web browser from the Chromium Project and has a minimalist user interface. It has a similar appearance to Chrome, because it actually serves as the base for Chrome and several other browsers. Many people use Chromium because they are used to Chrome. - -![][9] - -Chromium offers the following features: - - * Incognito mode - * Extensions - * Autofill for passwords - - - -More information about Chromium browser is available at this link: - -### qutebrowser - -This browser is a little bit different than the browsers mentioned above. qutebrowser is a keyboard-focused browser with a minimal GUI. Therefore, you won’t find the buttons normally found in other browsers, like back, home, reload, etc. Instead, you can type commands with the keyboard to run functions in the qutebrowser. It uses Vim-style key bindings, so it’s suitable for Vim users. You should try this browser if you are interested in getting a different experience in surfing the internet. - -![][10] - -qutebrowser offers the following features: - - * Adblock - * Private browsing mode - * Quickmarks - - - -More information about qutebrowser browser is available at this link: - -### Conclusion - -Everyone has different needs in using the internet, especially for browsing. Each browser mentioned in this article has different features. So choose a browser that suits your daily needs and preferences. If you use the browsers mentioned in this article, share your story in the comments. And if you use a browser other than the one mentioned in this article, please mention it. Hopefully this article can help you in choosing the browser that you will use for your daily needs on Fedora. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/ - -作者:[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-1-Browsers-2-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://www.mozilla.org/en-US/ -[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Firefox-1-1024x707.png -[7]: https://www.mozilla.org/en-US/firefox/ -[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Web-1024x658.png -[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Chromium-1-1024x690.png -[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-qb-1024x687.png diff --git a/translated/tech/20210716 Apps for daily needs part 1- web browsers.md b/translated/tech/20210716 Apps for daily needs part 1- web browsers.md new file mode 100644 index 0000000000..e6d0c5b07d --- /dev/null +++ b/translated/tech/20210716 Apps for daily needs part 1- web browsers.md @@ -0,0 +1,112 @@ +[#]: subject: (Apps for daily needs part 1: web browsers) +[#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/) +[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +满足日常需求的应用第一部分:网络浏览器 +====== + +![][1] + +照片由 [Brooke Cagle][2] 发布在 [Unsplash][3]。 + +满足日常需求的重要应用之一是网络浏览器。这是因为上网是大多数人在电脑前进行的一项活动。本文将介绍一些你可以在 Fedora Linux 上使用的开源网络浏览器。你需要安装上述软件。本文提到的所有浏览器都已经在官方的 Fedora 软件库中提供。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章[安装 Fedora 34 工作站后要做的事情][4]。 + +### Firefox + +火狐是一个快速且注重隐私的浏览器,可以在许多设备上使用。它是由 [Mozilla][5] 创建的,是一个具有完整功能的浏览器,提供许多扩展。你可以为你的火狐浏览器添加许多强大的功能和有用的特性。它只使用适量的内存来创造一个流畅的体验,使你的电脑保持对其他任务的响应。你可以创建一个账户,让你在多个设备上共享配置,所以你不需要在每个设备上设置火狐浏览器。 + +![][6] + +火狐浏览器提供以下功能: + + * 隐私浏览模式 + * 阻止广告跟踪器 + * 密码管理器 + * 设备之间的同步 + * 画中画 + + + +关于火狐浏览器的更多信息可在此链接中找到:[https://www.mozilla.org/en-US/firefox][7] + +### GNOME Web + +GNOME Web 是 GNOME 桌面的一个浏览器,它是 Fedora 工作站的默认桌面环境。如果你使用 GNOME 作为默认桌面环境的 Fedora Workstation,它可能非常适合作为你的主浏览器。这个浏览器有一个简单、干净、漂亮的外观。GNOME Web 的功能比 Firefox 少,但对于普通用途来说已经足够了。 + +![][8] + +GNOME Web 提供了以下功能: + + * 隐身模式 + * GNOME 桌面集成 + * 内置广告拦截器 + * 智能跟踪预防 + + + +关于 GNOME Web 的更多信息可以在这个链接中找到: + +### Chromium + +Chromium 是一个来自 Chromium 项目的开源网络浏览器,它有一个极简的用户界面。它的外观与 Chrome 相似,因为它实际上是作为 Chrome 和其他几个浏览器的基础。许多人使用 Chromium 是因为他们已经习惯了 Chrome。 + +![][9] + +Chromium 提供以下功能: + + * 隐身模式 + * 扩展程序 + * 密码的自动填写 + + + +关于 Chromium 浏览器的更多信息可在此链接中找到: + +### qutebrowser + +这个浏览与上面提到的稍有不同,qutebrowser 是一个以键盘为中心的浏览器,具有最小的 GUI。因此,你不会发现通常在其他浏览器中的按钮,如返回、主页、重新加载等。相反,你可以用键盘输入命令来运行 qutebrowser 中的功能。它使用 Vim 风格的键绑定,所以它适合 Vim 用户。如果你有兴趣在上网时获得不同的体验,你应该试试这个浏览器。 + +![][10] + +qutebrowser 提供以下功能: + + * 广告屏蔽 + * 隐私浏览模式 + * 快速书签 + + + +关于 qutebrowser 浏览器的更多信息可在此链接中找到: + +### 总结 + +每个人在使用互联网时都有不同的需求,特别是在浏览方面。本文中提到的每个浏览器都有不同的功能。因此,请选择适合你日常需求和喜好的浏览器。如果你使用的是本文中提到的浏览器,请在评论中分享你的故事。如果你使用的是其他的浏览器,请说一下。希望这篇文章能帮助你选择在 Fedora 上满足你日常需求的浏览器。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/ + +作者:[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-1-Browsers-2-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://www.mozilla.org/en-US/ +[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Firefox-1-1024x707.png +[7]: https://www.mozilla.org/en-US/firefox/ +[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Web-1024x658.png +[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Chromium-1-1024x690.png +[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-qb-1024x687.png From a32c18286f2797ecabdae287f7424850699defa5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 21 Jul 2021 08:41:20 +0800 Subject: [PATCH 07/40] translated --- .../20210719 Run Python applications in virtual environments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210719 Run Python applications in virtual environments.md b/sources/tech/20210719 Run Python applications in virtual environments.md index c86d1849ae..38673cf029 100644 --- a/sources/tech/20210719 Run Python applications in virtual environments.md +++ b/sources/tech/20210719 Run Python applications in virtual environments.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/python-pipx) [#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 8114d968c138ea5c3d7aea1a1ce758a869a29a5b Mon Sep 17 00:00:00 2001 From: Wlzzzz-del <1174547806@qq.com> Date: Wed, 21 Jul 2021 09:34:37 +0800 Subject: [PATCH 08/40] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rence between a fork and a distribution.md | 82 ------------------- 1 file changed, 82 deletions(-) delete mode 100644 sources/talk/20180713 What-s the difference between a fork and a distribution.md diff --git a/sources/talk/20180713 What-s the difference between a fork and a distribution.md b/sources/talk/20180713 What-s the difference between a fork and a distribution.md deleted file mode 100644 index 57b08ffcf6..0000000000 --- a/sources/talk/20180713 What-s the difference between a fork and a distribution.md +++ /dev/null @@ -1,82 +0,0 @@ -Wlzzzz-del is translating. -What's the difference between a fork and a distribution? -====== - -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/spoons_forks_520x292_jh.png?itok=DzEzZBuG) - -If you've been around open source software for any length of time, you'll hear the terms fork and distribution thrown around casually in conversation. For many people, the distinction between the two isn't clear, so here I'll try to clear up the confusion. - -### First, some definitions - -Before explaining the nuances of a fork vs. a distribution and the pitfalls thereof, let's define key concepts. - -**[Open source software][1]** is software that: - - * Is freely available to distribute under certain [license][2] restraints - * Permits its source code to be viewable and modified under certain license restraints - - - -Open source software can be **consumed** in the following ways: - - * Downloaded in binary or source code format, often at no charge (e.g., the [Eclipse developer environment][3]) - * As a distribution (product) by a vendor, sometimes at a cost to the user (e.g., [Red Hat products][4]) - * Embedded into proprietary software solutions (e.g., some smartphones and browsers display fonts using the open source [freetype software][5]) - - - -**Free and open source (FOSS)** is not necessarily "free" as in "zero cost." Free and open source simply means the software is free to distribute, modify, study, and use, subject to the software's licensing. The software distributor may attach a purchase price to it. For example, Linux is available at no cost as Fedora, CentOS, Gentoo, etc. or as a paid distribution as Red Hat Enterprise Linux, SUSE, etc. - -**Community** refers to the organizations and individuals that collaboratively work on an open source project. Any individual or organization can contribute to the project by writing or reviewing code, documentation, test suites, managing meetings, updating websites, etc., provided they abide by the license. For example, at [Openhub.net][6], we see government, nonprofit, commercial, and education organizations [contributing to some open source projects][7]. - -**project** is the result of this collaborative development, documentation, and testing. Most projects have a central repository where code, documentation, testing, and so forth are developed. - -An open sourceis the result of this collaborative development, documentation, and testing. Most projects have a central repository where code, documentation, testing, and so forth are developed. - -A **distribution** is a copy, in binary or source code format, of an open source project. For example, CentOS, Fedora, Red Hat Enterprise Linux, SUSE, Ubuntu, and others are distributions of the Linux project. Tectonic, Google Kubernetes Engine, Amazon Container Service, and Red Hat OpenShift are distributions of the Kubernetes project. - -Vendor distributions of open source projects are often called **products** , thus Red Hat OpenStack Platform is the Red Hat OpenStack product that is a distribution of the OpenStack upstream project—and it is still 100% open source. - -The **trunk** is the main workstream in the community where the open source project is developed. - -An open source **fork** is a version of the open source project that is developed along a separate workstream from the main trunk. - -Thus, **a distribution is not the same as a fork**. A distribution is a packaging of the upstream project that is made available by vendors, often as products. However, the core code and documentation in the distribution adhere to the version in the upstream project. A fork—and any distribution based on the fork—results in a version of the code and documentation that are different from the upstream project. Users who have forked upstream open source code have to maintain it on their own, meaning they lose the benefit of the collaboration that takes place in the upstream community. - -To further explain a software fork, let's use the analogy of migrating animals. Whales and sea lions migrate from the Arctic to California and Mexico; Monarch butterflies migrate from Alaska to Mexico; and (in the Northern Hemisphere) swallows and many other birds fly south for the winter. The key to a successful migration is that all animals in the group stick together, follow the leaders, find food and shelter, and don't get lost. - -### Risks of going it on your own - -A bird, butterfly, or whale that strays from the group loses the benefit of remaining with the group and knowing where to find food, shelter, and the desired destination. - -Similarly, users or organizations that fork and modify an upstream project and maintain it on their own run the following risks: - - 1. **They cannot update their code based on the upstream because their code differs.** This is known as technical debt; the more changes made to forked code, the more it costs in time and money to rebase the fork to the upstream project. - 2. **They potentially run less secure code.** If a vulnerability is found in open source code and fixed by the community in the upstream, a forked version of the code may not benefit from this fix because it is different from the upstream. - 3. **They might not benefit from new features.** The upstream community, using input from many organizations and individuals, creates new features for the benefit of all users of the upstream project. If an organization forks the upstream, they potentially cannot incorporate the new features because their code differs. - 4. **They might not integrate with other software packages.** Open source projects are rarely developed as single entities; rather they often are packaged together with other projects to create a solution. Forked code may not be able to be integrated with other projects because the developers of the forked code are not collaborating in the upstream with other participants. - 5. **They might not certify on hardware platforms.** Software packages are often certified to run on hardware platforms so, if problems arise, the hardware and software vendors can collaborate to find the root cause or problem. - - - -In summary, an open source distribution is simply a packaging of an upstream, multi-organizational, collaborative open source project sold and supported by a vendor. A fork is a separate development workstream of an open source project and risks not being able to benefit from the collaborative efforts of the upstream community. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/18/7/forks-vs-distributions - -作者:[Jonathan Gershater][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://opensource.com/users/jgershat -[1]:https://opensource.com/resources/what-open-source -[2]:https://opensource.com/tags/licensing -[3]:https://www.eclipse.org/che/getting-started/download/ -[4]:https://access.redhat.com/downloads -[5]:https://www.freetype.org/ -[6]:http://openhub.net -[7]:https://www.openhub.net/explore/orgs From 8b8b2664241e8de22bdbe0c60c391ca106591b40 Mon Sep 17 00:00:00 2001 From: Wlzzzz-del <1174547806@qq.com> Date: Wed, 21 Jul 2021 09:39:19 +0800 Subject: [PATCH 09/40] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rence between a fork and a distribution.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 translated/talk/20180713 What-s the difference between a fork and a distribution.md diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/translated/talk/20180713 What-s the difference between a fork and a distribution.md new file mode 100644 index 0000000000..40a5541a95 --- /dev/null +++ b/translated/talk/20180713 What-s the difference between a fork and a distribution.md @@ -0,0 +1,74 @@ +What's the difference between a fork and a distribution? +分支与发行版有什么不同? +====== + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/spoons_forks_520x292_jh.png?itok=DzEzZBuG) + +如果你们对开源软件有过一段时间地了解,一定曾在许多相关的途径中听说过分支(fork)和发行版(distribution)两个词。许多人对这两个词的区别不太清楚,因此我将试着通过这篇文章为大家解答这一疑惑。 + +### 首先地,关于定义 + +在解释分支与发行版两者的细微区别与相似之处之前,让我们先给一些相关的重要概念下定义。 + +**[开源软件][1]** 是指具有以下特点的软件: + + * 在特定的 [协议][2] 限制下,软件供所有人免费传播与使用 + * 在特定的协议限制下,软件源代码供所有人使用与修改 + +开源软件有以下几种 **消费** 方式: + + * 以二进制或者源代码的方式下载,通常是不收费的。(例如, [Eclipse开发者环境][3] ) + ### * 作为一个商业公司的产品,有时向用户提供一些服务并以此收费。(例如,[红帽产品][4]) + * 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的[Freetype软件][5]) + +将 **自由且开源(FOSS)** 中的”自由“理解成“零成本”是不准确的。自由且开源仅仅意味着这个软件在遵守软件协议的前提下是可以免费传播、修改、学习和使用的。软件传播者也可能为该软件定价。例如,免费使用的Linux发行版有Fedora、Centos等。另外,收费的发行版有红帽企业版Linux、SUSE等。 + +**社区(community)** 指的是为一个开源项目协同工作和贡献的团体或个人。任何人或者团体都可以在遵守协议的前提下通过例如编写或者审查代码、撰写使用文档、测试软件、管理会议、更新网站等方式为开源项目作出贡献。例如,在[Openhub.net][6]网站,我们可以看见政府、非营利性机构、商业公司和教育团队等组织都在[为一些开源项目作出贡献][7]。 + +**项目(project)** 是集合作开发、文档和测试的结果。绝大多数项目都搭建了主要仓库用来存储代码、文档、测试文件和目前正在开发的文件。 + +**发行版(distribution)** 是指开源项目的一份的副本,通常以二进制或源代码为样式。例如,Centos、Fedora、红帽企业版Linux、SUSE、Ubuntu等都是Linux这一项目的发行版。Tectonic、谷歌的Kubernetes引擎、亚马逊的容器服务和红帽的OpenShift都是Kubernetes项目的发行版。 + +开源项目的商业发行版经常被称作 **产品(products)** ,类似地红帽OpenStack平台是红帽OpenStack产品系列旗下的一个基于OpenStack上游项目搭建并且百分百开源的发行版。 + +**主干(trunk)** 是该开源项目发展的主要社区工作流。 + +**分支(fork)** 是开源项目主干的一个版本,他是分离自主干的独立工作流。 + +因此, **一个发行版并不等同于一个分支** 。发行版是上游项目的包裹,具有可用性,经常作为产品进行销售。然而,发行版的核心代码和文档需要遵守上游项目的版本规则。从上游版本中获取开源代码的分支用户必须依靠他们自身来维护分支项目,这意味着他们失去了上游社区协同工作带来的好处。 + +为了对软件分支进行进一步的解释,让我来用动物迁徙作比喻。鲸鱼和海狮从北极迁徙到加利福尼亚和墨西哥;帝王蝶从阿拉斯加迁徙到墨西哥;并且北半球的燕子和许多其他鸟类飞翔南方去过冬。成功迁徙的关键因素在于,团队中的所有动物团结一致,紧跟领导者,找到食物和庇护所,并且不会迷路。 + +### 独立前行带来的风险 + +一只鸟、帝王蝶或者鲸鱼一旦掉队就失去了许多优势,例如团队带来的保护以及知道哪儿有食物、庇护所和目的地。 + +相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险: + + 1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 + 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 + 3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 + 4.**他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 + 5.**他们可能不能够在硬件平台上验证分支代码可行性。** 软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 + +总之,开源发行版只是一个由上游组织协同开发、并且提供商业服务与支持的包裹。分支是开源项目的独立发展工作流,并且不能从上游社区协同工作开发的结果中收益。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/18/7/forks-vs-distributions + +作者:[Jonathan Gershater][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[Wlzzzz-del](https://github.com/Wlzzzz-del) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://opensource.com/users/jgershat +[1]:https://opensource.com/resources/what-open-source +[2]:https://opensource.com/tags/licensing +[3]:https://www.eclipse.org/che/getting-started/download/ +[4]:https://access.redhat.com/downloads +[5]:https://www.freetype.org/ +[6]:http://openhub.net +[7]:https://www.openhub.net/explore/orgs From 408220232629cda129ca826e68cae9ec140d1743 Mon Sep 17 00:00:00 2001 From: Wlzzzz-del <1174547806@qq.com> Date: Wed, 21 Jul 2021 09:45:48 +0800 Subject: [PATCH 10/40] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rence between a fork and a distribution.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/translated/talk/20180713 What-s the difference between a fork and a distribution.md index 40a5541a95..523fa71c33 100644 --- a/translated/talk/20180713 What-s the difference between a fork and a distribution.md +++ b/translated/talk/20180713 What-s the difference between a fork and a distribution.md @@ -12,14 +12,14 @@ What's the difference between a fork and a distribution? **[开源软件][1]** 是指具有以下特点的软件: - * 在特定的 [协议][2] 限制下,软件供所有人免费传播与使用 - * 在特定的协议限制下,软件源代码供所有人使用与修改 + * 在特定的 [协议][2] 限制下,软件供所有人免费传播与使用 + * 在特定的协议限制下,软件源代码供所有人使用与修改 开源软件有以下几种 **消费** 方式: - * 以二进制或者源代码的方式下载,通常是不收费的。(例如, [Eclipse开发者环境][3] ) - ### * 作为一个商业公司的产品,有时向用户提供一些服务并以此收费。(例如,[红帽产品][4]) - * 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的[Freetype软件][5]) + * 以二进制或者源代码的方式下载,通常是不收费的。(例如,[Eclipse开发者环境][3]) + * 作为一个商业公司的产品,有时向用户提供一些服务并以此收费。(例如,[红帽产品][4]) + * 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的[Freetype软件][5]) 将 **自由且开源(FOSS)** 中的”自由“理解成“零成本”是不准确的。自由且开源仅仅意味着这个软件在遵守软件协议的前提下是可以免费传播、修改、学习和使用的。软件传播者也可能为该软件定价。例如,免费使用的Linux发行版有Fedora、Centos等。另外,收费的发行版有红帽企业版Linux、SUSE等。 @@ -45,11 +45,11 @@ What's the difference between a fork and a distribution? 相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险: - 1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 - 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 - 3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 - 4.**他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 - 5.**他们可能不能够在硬件平台上验证分支代码可行性。** 软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 + 1.**由于代码不同,分支用户不能够基于上游版本更新代码.** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 + 2.**分支用户基本上都在运行几乎没有安全保障的代码.** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 + 3.**分支用户几乎无法从新特性中获益.** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 + 4.**他们可能无法和其他软件包整合在一起.** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 + 5.**他们可能不能够在硬件平台上验证分支代码可行性.**软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 总之,开源发行版只是一个由上游组织协同开发、并且提供商业服务与支持的包裹。分支是开源项目的独立发展工作流,并且不能从上游社区协同工作开发的结果中收益。 From d0c245461316ece1db912495d2699b2f07285c06 Mon Sep 17 00:00:00 2001 From: wlz <57861805+Wlzzzz-del@users.noreply.github.com> Date: Wed, 21 Jul 2021 09:48:32 +0800 Subject: [PATCH 11/40] Update 20180713 What-s the difference between a fork and a distribution.md --- ...he difference between a fork and a distribution.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/translated/talk/20180713 What-s the difference between a fork and a distribution.md index 523fa71c33..ab70a266c7 100644 --- a/translated/talk/20180713 What-s the difference between a fork and a distribution.md +++ b/translated/talk/20180713 What-s the difference between a fork and a distribution.md @@ -44,12 +44,11 @@ What's the difference between a fork and a distribution? 一只鸟、帝王蝶或者鲸鱼一旦掉队就失去了许多优势,例如团队带来的保护以及知道哪儿有食物、庇护所和目的地。 相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险: - - 1.**由于代码不同,分支用户不能够基于上游版本更新代码.** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 - 2.**分支用户基本上都在运行几乎没有安全保障的代码.** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 - 3.**分支用户几乎无法从新特性中获益.** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 - 4.**他们可能无法和其他软件包整合在一起.** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 - 5.**他们可能不能够在硬件平台上验证分支代码可行性.**软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 + 1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 + 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 + 3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 + 4. **他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 + 5. **他们可能不能够在硬件平台上验证分支代码可行性。**软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 总之,开源发行版只是一个由上游组织协同开发、并且提供商业服务与支持的包裹。分支是开源项目的独立发展工作流,并且不能从上游社区协同工作开发的结果中收益。 From 81f3844bc9e48fc5fb6d72ed573671e5ac7e2ee9 Mon Sep 17 00:00:00 2001 From: wlz <57861805+Wlzzzz-del@users.noreply.github.com> Date: Wed, 21 Jul 2021 09:48:57 +0800 Subject: [PATCH 12/40] Update 20180713 What-s the difference between a fork and a distribution.md --- ...3 What-s the difference between a fork and a distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/translated/talk/20180713 What-s the difference between a fork and a distribution.md index ab70a266c7..179962ba29 100644 --- a/translated/talk/20180713 What-s the difference between a fork and a distribution.md +++ b/translated/talk/20180713 What-s the difference between a fork and a distribution.md @@ -48,7 +48,7 @@ What's the difference between a fork and a distribution? 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 4. **他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 - 5. **他们可能不能够在硬件平台上验证分支代码可行性。**软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 + 5. **他们可能不能够在硬件平台上验证分支代码可行性。** 软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 总之,开源发行版只是一个由上游组织协同开发、并且提供商业服务与支持的包裹。分支是开源项目的独立发展工作流,并且不能从上游社区协同工作开发的结果中收益。 From a46ec1d2a33f3d9b862979cc59159f821469089e Mon Sep 17 00:00:00 2001 From: wlz <57861805+Wlzzzz-del@users.noreply.github.com> Date: Wed, 21 Jul 2021 09:49:35 +0800 Subject: [PATCH 13/40] Update 20180713 What-s the difference between a fork and a distribution.md --- ...3 What-s the difference between a fork and a distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/translated/talk/20180713 What-s the difference between a fork and a distribution.md index 179962ba29..87abb65fe8 100644 --- a/translated/talk/20180713 What-s the difference between a fork and a distribution.md +++ b/translated/talk/20180713 What-s the difference between a fork and a distribution.md @@ -45,7 +45,7 @@ What's the difference between a fork and a distribution? 相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险: 1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 - 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益,。 + 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益。 3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 4. **他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 5. **他们可能不能够在硬件平台上验证分支代码可行性。** 软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 From b22e5d9b12c8739c80d3f01bcec242c0c251d863 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Jul 2021 10:50:22 +0800 Subject: [PATCH 14/40] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zxy-wyx 感谢您,完成了第一篇翻译贡献! --- .../20210629 A brief history of FreeDOS.md | 100 +++++++++--------- 1 file changed, 51 insertions(+), 49 deletions(-) diff --git a/translated/talk/20210629 A brief history of FreeDOS.md b/translated/talk/20210629 A brief history of FreeDOS.md index 3931cd87d6..c6e3703a80 100644 --- a/translated/talk/20210629 A brief history of FreeDOS.md +++ b/translated/talk/20210629 A brief history of FreeDOS.md @@ -3,88 +3,90 @@ [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) [#]: translator: (zxy-wyx) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) FreeDOS 简史 ====== -经历了近30年的发展, FreeDOS 已经成为了世界先进的 DOS。 -![第一批使用计算机的人][1] -一个老师正在给他的一个学生讲[编程之道][2]。 “编程之道包含在所有的软件中--不管它多么微不足道,” 老师说道。 +> 经历了近 30 年的发展, FreeDOS 已经成为了世界先进的 DOS。 -“编程之道在手提电脑里面吗?” 学生问道。 +![](https://img.linux.net.cn/data/attachment/album/202107/21/104903zzxiyc4i4gkpxiph.jpg) -“是的,” 老师回答道。 +> 一个大师正在给他的一个弟子讲 [编程之道][2]。 “编程之道包含在所有的软件中 —— 不管它多么微不足道,” 大师说道。 +> +> “编程之道在手持计算器里面吗?” 弟子问道。 +> +> “是的,” 大师回答道。 +> +> “编程之道在电子游戏里面吗?” 弟子继续问道。 +> +> “即便是电子游戏中,” 大师说。 +> +> “那编程之道在个人电脑的 DOS 里面吗?” +> +> 大师咳嗽了一下,稍稍改变了一下姿势,说道,“今天的课就到这里吧。” +> +> ——《编程之道》,Geoffrey James,InfoBooks,1987 -“编程之道在电脑游戏里面吗?”学生继续问道 +过去,计算仅限于昂贵的大型机和“大铁疙瘩”计算机系统,如 PDP 11。但是微处理器的出现在 20 世纪 70 年代带来了一场计算革命。你终于可以在家里有一台电脑了——“个人电脑”时代已经到了! -“他甚至在电脑游戏里面," 老师说。 +我记得看到的最早的个人电脑包括 Commodore、TRS-80 和 Apple。个人电脑成了一个热门话题,所以 IBM 决定进入这个市场。在经历了一个快速开发周期之后,IBM 于 1981 年 8 月发布了 IBM 5150 个人电脑(最初的“IBM PC”)。 -“那编程之道在个人电脑的操作系统里面吗?” +从零开始创建一台计算机并非易事,因此 IBM 以用“现成”的硬件来构建 PC 而闻名,并从外部开发商那里获得了其他组件的授权。其中之一是微软授权的操作系统。反过来,微软从西雅图计算机产品公司获得了 86-DOS ,进行了各种更新,并将新版本作为 IBM PC-DOS 与 IBM PC 一起首次亮相。 -老师咳嗽了一下,稍稍改变了姿势,说道,“今天的课结束了。” +### 早期的 DOS -编程之道, Geoffrey James, 信息类书籍, 1987 +运行在最多只有 640 千字节内存中的 DOS,除了管理硬件和允许用户启动应用程序之外,真的做不了什么。因此,PC-DOS 1.0 命令行非常贫乏,只包含了一些设置日期和时间、管理文件、控制终端和格式化软盘的命令。DOS 还包括一个 BASIC 语言解释器,这是那个时代所有个人计算机的一个标准功能。 -过去,计算仅限于昂贵的大型机和“超大型计算机”计算机系统,如 PDP 11。但是微处理器的出现在 20 世纪 70 年代带来了一场计算机革命。 你终于可以在家里有一台电脑了——“个人电脑浪潮”已经到了! +直到 PC-DOS 2.0,DOS 才变得更加有趣,为命令行添加了新的命令,并包含了其他有用的工具。但对我来说,直到 1991 年的 MS-DOS 5.0 才有了“现代感”。微软在这个版本中对 DOS 进行了大修,更新了许多命令,并用一个新的全屏编辑器取代了老旧的 Edlin 编辑器,使之更方便用户使用。DOS 5 还包括我喜欢的其他特性,比如基于微软 QuickBASIC 编译器的新 BASIC 解释器,简称 QBASIC. 如果你曾经在 DOS 上玩过 Gorillas 游戏,那可能就是在 MS-DOS 5.0 中运行的。 -我记得看到的最早的个人电脑包括 Commodore, TRS-80, 和 Apple。个人电脑成了一个热门话题,所以 IBM 决定进入这个市场。 在经历了一个短暂的开发周期之后,IBM 于 1981 年 8 月发布了 IBM 5150 个人计算机(最初的“IBM PC”)。 +尽管进行了这些升级,但我对 DOS 命令行并不完全满意。DOS 从来没有偏离原来的设计,有其局限性。DOS 为用户提供了一些工具,可以从命令行执行一些事情 —— 否则,你就得使用 DOS 命令行来启动应用程序。微软认为用户大部分时间都会花在几个关键的应用程序上,比如文字处理器或电子表格。 -从零开始创建一台计算机并非易事,因此 IBM 用现成的硬件来构建 PC 而闻名,并从外部开发人员那里获得了其他组件的许可。 其中之一是微软授权的操作系统。反过来,微软从西雅图电脑产品公司获得了 86-DOS ,进行了各种更新,并在 IBM PC 上推出了新版本的 IBM PC-DOS。 - -###早期的 DOS - -早期的 DOS 在内存中运行最多为 640 千字节, DOS 只能管理硬件,允许用户启动应用程序。因此,PC-DOS 1.0 命令行非常贫乏,只包含了一些设置日期和时间、管理文件、控制终端和格式化软盘的命令。DOS 还包括一个基本的语言解释器,这是这个时代所有个人计算机的一个基本功能。 - -直到 PC-DOS 2.0,DOS 才变得更加有趣,在命令行中添加了新的命令,并包含了其他有用的工具。但对我来说,直到1991 年 MS-DOS 5.0 才开始感觉到先进。微软在这个版本中对 DOS 进行了全面改革,更新了许多命令,并用一个新的全屏编辑器取代了老旧的 Edlin 编辑器,这个编辑器对用户更加友好。 DoS 5 还包括我喜欢的其他特性,比如基于 Microsoft QuickBASIC Compiler, 简称 QBASIC. 如果你曾经在 DOS 上玩过 the Gorillas 游戏, 可能是在 MS-DOS 5.0 中运行。 - -尽管进行了这些升级,但我对 DOS 命令行并不完全满意。DOS 从来没有偏离原来的设计,改变有限。DOS 为用户提供了一些工具,可以从命令行执行一些事情--否则,你就应该使用 DOS 命令行来启动应用程序。微软认为用户大部分时间都会花在几个关键的应用程序上,比如文字处理器或电子表格。 - -但是开发人员想要一个功能更强的 DOS,此时一个子行业正在萌芽,以提供整洁的工具和程序。有些是全屏应用程序,但也有许多是增强 DOS 命令环境的命令行实用程序. 当我学到一点 C 编程时,我开始编写自己的实用程序,扩展或替换 DOS 命令行。尽管 MS-DOS 的基础相当有限,但我发现第三方实用程序加上我自己的工具创建了一个功能强大的DOS命令行。 +但是开发人员想要一个功能更强的 DOS,此时一个细分行业正在萌芽,以提供小巧优雅的工具和程序。有些是全屏应用程序,但也有许多是增强 DOS 命令环境的命令行实用程序。当我学会一点 C 语言编程时,我开始编写自己的实用程序,扩展或替换 DOS 命令行。尽管 MS-DOS 的基础相当有限,但我发现第三方实用程序加上我自己的工具创建了一个功能强大的 DOS 命令行。 ### FreeDOS -1994 年初,我开始在科技杂志上看到很多微软高管的采访,他们说下一个版本的 Windows 将完全取代 DOS。 我以前使用过 Windows,但如果你还记得那个时代,你就知道 Windows 3.1 不是一个很好的平台。 Windows 3.1 是笨重的和有很多漏洞的——如果一个应用程序崩溃,它可能会摧毁整个 Windows 系统。我也不喜欢 Windows 的图形用户界面。我更喜欢在命令行做我的工作,而不是用鼠标。 +1994 年初,我开始在科技杂志上看到很多对微软高管的采访,他们说下一个版本的 Windows 将完全取代 DOS。我以前使用过 Windows,但如果你还记得那个时代,你就知道 Windows 3.1 并不是一个很好的平台。Windows 3.1 很笨重,有很多毛病,如果一个应用程序崩溃,它可能会使整个 Windows 系统瘫痪。我也不喜欢 Windows 的图形用户界面。我更喜欢在命令行做我的工作,而不是用鼠标。 -我考虑了 Windows,并决定,“如果 Windows3.2 或 Windows4.0 将类似于 Windows3.1,我我将不会去使用它。” 但我有什么选择?此时,我已经对 Linux 进行了实验,并认为 [linux很棒][3]—但是 Linux 没有任何应用程序。我的文字处理器、电子表格和其他程序都在 DOS 上。我需要 DOS。 +我考虑过 Windows,并决定,“如果 Windows 3.2 或 Windows 4.0 会像 Windows 3.1 一样,我就不会去使用它。” 但我有什么选择?此时,我已经尝试过 Linux,并认为 [Linux 很棒][3],但是 Linux 没有任何应用程序。我的文字处理器、电子表格和其他程序都在 DOS 上。我需要 DOS。 -然后我有了个主意!我想,“如果开发人员能够在互联网上共同编写一个完整的 Unix 操作系统,那么我们当然可以在 DOS 中做同样的事情。”毕竟,与 Unix 相比,DOS 是一个相当简单的操作系统。DOS 一次运行一个任务(单任务),并且有一个更简单的内存模型。写我们自己的 DOS 应该不难。 +然后我有了个主意!我想,“如果开发人员能够在互联网上共同编写一个完整的 Unix 操作系统,那么我们当然可以对 DOS 做同样的事情。”毕竟,与 Unix 相比,DOS 是一个相当简单的操作系统。DOS 一次运行一个任务(单任务),并且有一个更简单的内存模型。编写我们自己的 DOS 应该不难。 -因此,在 1994 年 6 月 29 日,我在一个名为 Usenet 的留言板网络上向 ‘comp.os.msdos.apps’[发布了一个公告][4] 。 +因此,在 1994 年 6 月 29 日,我在一个名为 Usenet 的留言板网络上向 “comp.os.msdos.apps” [发布了一个公告][4]: -PD-DOS 项目宣布: +> PD-DOS 项目公告: +> +> 几个月前,我发表了关于启动公共领域版本的 DOS 的文章。 当时大家对此的普遍支持,许多人都同意这样的说法:“开始编写吧!”所以,我就…… +> +> 宣布首次生产 PD-DOS 的努力。我已经写了一个“清单”,描述了这样一个项目的目标和工作大纲,以及一个“任务列表”,它准确地显示了需要编写什么。我会把这些贴在这里,供大家讨论。 -几个月前,我发表了关于启动 DOS 公共领域版本的文章。 当时对此的普遍支持很强烈,许多人都同意这样的说法:“开始创作吧!”所以我有..。 +\* 关于这个名字的说明 —— 我希望这个新的 DOS 成为每个人都可以使用的东西,我天真地认为,当每个人都可以使用它时,它就是“公共领域”。我很快就意识到了这种差别,所以我们把 “PD-DOS” 改名为 “Free-DOS”,然后去掉连字符变成 “FreeDOS”。 -第一次宣布努力生产 PD-DOS。我已经写了一个“清单”,描述了这样一个项目的目标和工作大纲,以及一个“任务列表”,它准确地显示了需要写什么。我会把这些贴在这里,然后讨论一下。 - -*关于这个名字的注释--我希望这个新的 DOS 成为每个人都可以使用的东西,我天真地认为,当每个人都可以使用它时,它就是“公共领域”。我很快就意识到了这种差别,所以我们把 “PD-DOS” 改名为 “Free-DOS”,然后去掉连字符变成 “FreeDOS”。 - -一些开发人员联系我,提供他们为替换或增强 DOS 命令行而创建的实用程序,类似于我自己的努力。就在项目宣布几个月后,我们汇集了我们的实用程序,并创建了一个实用的系统,我们在 1994 年 9 月发布了一个名为 “Alpha 1” 的系统。当时的发展相当迅速,我们在 1994 年 12 月采用了 “Alpha 2”,1995 年 1 月采用了“Alpha 3”,1995 年 6 月采用了“Alpha 4”。 +一些开发人员联系我,提供他们为替换或增强 DOS 命令行而创建的实用程序,类似于我自己的努力。就在项目宣布几个月后,我们汇集了我们的实用程序,并创建了一个实用的系统,我们在 1994 年 9 月发布了一个 “Alpha 1” 版本。在那些日子里,发展是相当迅速的,我们在 1994 年 12 月发布了 “Alpha 2”,1995 年 1 月发布了 “Alpha 3”,1995 年 6 月发布了“Alpha 4”。 ### 一个现代的 DOS -从那以后,我们一直致力于使 FreeDOS 成为“现代” DOS。而大部分现代化都集中在创建一个丰富的命令行环境上。是的,DOS 仍然需要支持应用程序,但是我们相信 FreeDOS 也需要一个强大的命令行环境。这就是为什么 FreeDOS 包含了许多有用的工具,包括导航目录、管理文件、播放音乐、连接网络的命令,……以及类似 Unix 的实用程序集合,如 “Less”、“Du”、“Head”、“tail”、“Se”和“trt”。 +从那以后,我们一直致力于使 FreeDOS 成为 “现代” DOS。而这种现代化大部分都集中在创建一个丰富的命令行环境上。是的,DOS 仍然需要支持应用程序,但是我们相信 FreeDOS 也需要一个强大的命令行环境。这就是为什么 FreeDOS 包含了许多有用的工具,包括浏览目录、管理文件、播放音乐、连接网络的命令,……以及类似 Unix 的实用程序集合,如 `less`、`du`、`head`、`tail`、`sed` 和 `tr`。 -虽然 FreeDOS 的开发已经放缓,但它并没有停止。开发人员继续为 FreeDOS 编写新程序,并向 FreeDOS 添加新功能。我对 FreeDOS 1.3 RC4 的几个重要补充感到特别兴奋,FreeDOS 1.3 RC4 是即将发布的FreeDOS 1.3 的最新候选版本。最近的一些更新如下: +虽然 FreeDOS 的开发已经放缓,但它并没有停止。开发人员继续为 FreeDOS 编写新程序,并向 FreeDOS 添加新功能。我对 FreeDOS 1.3 RC4 的几个重要补充感到特别兴奋,FreeDOS 1.3 RC4 是即将发布的 FreeDOS 1.3 的最新候选版本。最近的一些更新如下: - *Mateusz Viste 创建了一个新的电子书阅读器,名为 Ancient Machine Book (AMB),我们利用它作为 FreeDOS 1.3 RC4 中的新帮助系统。 - *Rask Ingemann Lambertsen、Andrew Jenner、TK Chia 和其他人正在更新 GCC 的 ia-16 版本,包括一个新的_libi86_库,它提供了与 Borland TurboC++ 编译器的 C 库的某种程度的兼容性。 - *Jason Hood 更新了一个可下载的 CD-ROM 重定向器,以替代微软的 MSCDEX,最多支持10个驱动器。 - *SuperIlu 已经创建了 DOjS,这是一个 Javascript 开发画布,具有集成的编辑器、图形和声音输出,以及鼠标、键盘和操纵杆输入。 - *Japheth 已经创建了一个 DOS32PAE 扩展程序,它能够通过 PAE 分页使用大量的内存。 + * Mateusz Viste 创建了一个新的电子书阅读器,名为 Ancient Machine Book(AMB),我们利用它作为 FreeDOS 1.3 RC4 中的新帮助系统。 + * Rask Ingemann Lambertsen、Andrew Jenner、TK Chia 和其他人正在更新 GCC 的 IA-16 版本,包括一个新的libi86 库,它提供了与 Borland TurboC++ 编译器的 C 库的某种程度的兼容性。 + * Jason Hood 更新了一个可卸载的 CD-ROM 重定向器,以替代微软的 MSCDEX,最多支持 10 个驱动器。 + * SuperIlu 创建了 DOjS,这是一个 Javascript 开发画布,具有集成的编辑器、图形和声音输出,以及鼠标、键盘和操纵杆输入。 + * Japheth 创建了一个 DOS32PAE 扩展程序,它能够通过 PAE 分页使用大量的内存。 -尽管 FreeDOS 有了新的发展,我们仍然忠于我们的 DOS 根基。在我们继续朝着 FreeDOS 1.3 “最终”的方向努力时,我们提出了几个核心假设,包括: +尽管 FreeDOS 有了新的发展,我们仍然忠于我们的 DOS 根基。在我们继续朝着 FreeDOS 1.3 “最终”版本努力时,我们带着几个核心假设,包括: - ***兼容性是关键**-如果FreeDOS不能运行经典DOS应用程序,它就不是真正的DOS。虽然我们提供了许多优秀的开源工具、应用程序和游戏,但您也可以运行遗留的DOS应用程序。 - ***继续在旧 PC 上运行(XT,‘286,386 等)**-FreeDOS 1.3 将保持 16 位英特尔,但在可能的情况下将支持扩展驱动程序支持的新硬件。为此,我们继续专注于单用户命令行环境。 - ***FreeDOS 是开源软件**-我一直说,如果人们不能访问、学习和修改源代码,FreeDOS 就不是“免费 DOS”。FreeDOS 1.3 将包括尽可能多地使用公认的开源许可证的软件。但 DOS 实际上早于 GNU 通用公共许可证 (1989)和开放源码定义 (1998),因此一些 DOS 软件可能会使用自己的“免费源代码”许可证,而这并不是标准的“开源”许可。当我们认为软件包包括在 FreeDOS,我们将继续评估任何许可证,以确保它们是合适的“开放源码”,即使它们没有得到正式承认。 + * **兼容性是关键** —— 如果 FreeDOS 不能运行经典 DOS 应用程序,它就不是真正的 “DOS”。虽然我们提供了许多优秀的开源工具、应用程序和游戏,但你也可以运行你的传统的 DOS 应用程序。 + * **继续在旧 PC 上运行(XT、286、386 等)** —— FreeDOS 1.3 将保持 16 位英特尔架构,但在可能的情况下将支持扩展驱动程序支持的新硬件。为此,我们继续专注于单用户命令行环境。 + * **FreeDOS 是开源软件** —— 我一直说,如果人们不能访问、学习和修改源代码,FreeDOS 就不是“自由的 DOS”。FreeDOS 1.3 将包括尽可能多地包括使用公认的开源许可证的软件。但 DOS 实际上早于 GNU 通用公共许可证(1989)和开放源码定义(1998),因此一些 DOS 软件可能会使用它自己的“免费源代码”许可证,而不是标准的“开源”许可。当我们考虑将软件包纳入 FreeDOS 时,我们将继续评估任何许可证,以确保它们是合适的“开放源码”,即使它们没有得到正式承认。 -我们欢迎您的帮助,使FreeDOS强大! 请加入我们的电子邮件名单-我们欢迎所有新来者和投稿人。我们通过电子邮件列表进行交流,但是列表的容量非常小,所以不太可能填满你的收件箱。 +我们欢迎你的帮助,使 FreeDOS 强大!请加入我们的电子邮件列表,我们欢迎所有新来者和贡献者。我们通过电子邮件列表进行交流,不过这个列表的信件量非常小,所以不太可能撑爆你的收件箱。 -访问FreeDOS网站[www.freedos.org][5]. +访问 FreeDOS 网站 [www.freedos.org][5]。 -------------------------------------------------------------------------------- @@ -93,7 +95,7 @@ via: https://opensource.com/article/21/6/history-freedos 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[zxy-wyx](https://github.com/zxy-wyx) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1a1ad269c9d03d15f6c21b9bc16fa9ddcfa560cf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Jul 2021 10:51:18 +0800 Subject: [PATCH 15/40] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zxy-wyx 本文首发地址:https://linux.cn/article-13601-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/zxy-wyx --- .../talk => published}/20210629 A brief history of FreeDOS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210629 A brief history of FreeDOS.md (99%) diff --git a/translated/talk/20210629 A brief history of FreeDOS.md b/published/20210629 A brief history of FreeDOS.md similarity index 99% rename from translated/talk/20210629 A brief history of FreeDOS.md rename to published/20210629 A brief history of FreeDOS.md index c6e3703a80..5601e5c66c 100644 --- a/translated/talk/20210629 A brief history of FreeDOS.md +++ b/published/20210629 A brief history of FreeDOS.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (zxy-wyx) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13601-1.html) FreeDOS 简史 ====== From 25ad94f0ddbecb812edd7d2052fc389d7b7917c9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Jul 2021 11:57:21 +0800 Subject: [PATCH 16/40] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tanloong 感谢您,完成了第一篇翻译贡献! --- ...de to NLP analysis with Python and NLTK.md | 143 ++++++++---------- 1 file changed, 63 insertions(+), 80 deletions(-) diff --git a/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md b/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md index 8223727f4b..80e8ce60a8 100644 --- a/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md +++ b/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md @@ -1,18 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (tanloong) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (An advanced guide to NLP analysis with Python and NLTK) [#]: via: (https://opensource.com/article/20/8/nlp-python-nltk) [#]: author: (Girish Managoli https://opensource.com/users/gammay) -用 Python 和 NLTK 进行 NLP 分析的高级教程 +进阶教程:用 Python 和 NLTK 进行 NLP 分析 ====== -进一步学习自然语言处理的基本概念 -![Brain on a computer screen][1] -在[之前的文章][2]里,我介绍了自然语言处理NLP和宾夕法尼亚大学研发的自然语言处理工具包 ([NLTK][3])。我演示了用 Python 解析文本和定义停用词的方法,并介绍了语料库的概念。语料库是由文本构成的数据集,通过提供现成的文本数据来辅助文本处理。在这篇文章里,我将继续用各种语料库对文本进行对比和分析。 +> 进一步学习自然语言处理的基本概念 + +![](https://img.linux.net.cn/data/attachment/album/202107/21/115633k8l9nkqowqkowpwm.jpg) + +在 [之前的文章][2] 里,我介绍了自然语言处理natural language processing(NLP)和宾夕法尼亚大学研发的自然语言处理工具包Natural Language Toolkit ([NLTK][3])。我演示了用 Python 解析文本和定义停顿词stopword的方法,并介绍了语料库corpus的概念。语料库是由文本构成的数据集,通过提供现成的文本数据来辅助文本处理。在这篇文章里,我将继续用各种语料库对文本进行对比和分析。 这篇文章主要包括以下部分: @@ -21,38 +23,35 @@ * Tree树库treebank * 命名实体识别Named entity recognition +### 词网和同义词集 -### WordNet 和同义词集synsets +[词网][4]WordNet 是 NLTK 里的一个大型词汇数据库语料库。词网包含各单词的诸多认知同义词cognitive synonyms(认知同义词常被称作“同义词集synset”)。在词网里,名词、动词、形容词和副词,各自被组织成一个同义词的网络。 -[WordNet][4] 是 NLTK 里的一个大型词典数据库。WordNet 包含各单词的诸多认知同义词cognitive synonyms (一个认知同义词常被称作 synset)。在 WordNet 里,名词、动词、形容词和副词,各自被组织成一个同义词的网络。 +词网是一个很有用的文本分析工具。它有面向多种语言的版本(汉语、英语、日语、俄语和西班牙语等),也使用多种许可证(从开源许可证到商业许可证都有)。初代版本的词网由普林斯顿大学研发,面向英语,使用类 MIT 许可证MIT-like license。 -WordNet 是文本分析的一个很有用的工具。它有面向多种语言的版本 (汉语、英语、日语、俄语和西班牙语等),也使用多种许可证 (从开源许可证到商业许可证都有)。初代版本的 WordNet 由普林斯顿大学研发,面向英语,使用类 MIT 许可证MIT-like license。 - -因为一个词可能有多个意义或多个词性,所以可能与多个 synset 相关联。每个 synset 通常提供下列属性: +因为一个词可能有多个意义或多个词性,所以可能与多个同义词集相关联。每个同义词集通常提供下列属性: |**属性** | **定义** | **例子**| |---|---|---| -|名称Name| 此 synset 的名称 | 单词 code 有 5 个 synset,名称分别是 `code.n.01`、 `code.n.02`、 `code.n.03`、`code.v.01` 和 `code.v.02`| -|词性POS| 此 synset 的词性 | 单词 code 有 3 个名词词性的 synset 和 2 个动词词性的 synset| -|定义Definition| 该词作对应词性时的定义 | 动词 code 的一个定义是:(计算机科学) 数据或计算机程序指令的象征性排列symbolic arrangement| -|例子Examples| 使用该词的例子 | code 一词的例子:为了安全,我们应该给信息编码。We should encode the message for security reasons| -|词元Lemmas| 与该词相关联的其他 synset (包括那些不一定严格地是该词的同义词,但可以大体看作同义词的);词元直接与其他词元相关联,而不是直接与单词words/rt>相关联|`code.v.02` 的词元是`code.v.02.encipher`、`code.v.02.cipher`、`code.v.02.cypher`、`code.v.02.encrypt`、`code.v.02.inscribe` 和 `code.v.02.write_in_code`| -|反义词Antonyms| 意思相反的词 | 词元 `encode.v.01.encode` 的反义词是 `decode.v.01.decode`| +|名称Name| 此同义词集的名称 | 单词 `code` 有 5 个同义词集,名称分别是 `code.n.01`、 `code.n.02`、 `code.n.03`、`code.v.01` 和 `code.v.02`| +|词性POS| 此同义词集的词性 | 单词 `code` 有 3 个名词词性的同义词集和 2 个动词词性的同义词集| +|定义Definition| 该词作对应词性时的定义 | 动词 `code` 的一个定义是:(计算机科学)数据或计算机程序指令的象征性排列symbolic arrangement| +|例子Example| 使用该词的例子 | `code` 一词的例子:We should encode the message for security reasons| +|词元Lemma| 与该词相关联的其他同义词集(包括那些不一定严格地是该词的同义词,但可以大体看作同义词的);词元直接与其他词元相关联,而不是直接与单词word相关联|`code.v.02` 的词元是 `code.v.02.encipher`、`code.v.02.cipher`、`code.v.02.cypher`、`code.v.02.encrypt`、`code.v.02.inscribe` 和 `code.v.02.write_in_code`| +|反义词Antonym| 意思相反的词 | 词元 `encode.v.01.encode` 的反义词是 `decode.v.01.decode`| |上义词Hypernym|该词所属的一个范畴更大的词 | `code.v.01` 的一个上义词是 `tag.v.01`| -|分项词Meronym| 属于该词组成部分的词 | computer 的一个分项词是 chip | -|总项词Holonym| 该词作为组成部分所属的词 | window 的一个总项词是 computer screen| +|分项词Meronym| 属于该词组成部分的词 | `computer` 的一个分项词是 `chip` | +|总项词Holonym| 该词作为组成部分所属的词 | `window` 的一个总项词是 `computer screen`| -synset 还有一些其他属性,在 `<你的 Python 安装路径>/Lib/site-packages` 下的 `nltk/corpus/reader/wordnet.py`,你可以找到它们。 +同义词集还有一些其他属性,在 `<你的 Python 安装路径>/Lib/site-packages` 下的 `nltk/corpus/reader/wordnet.py`,你可以找到它们。 下面的代码或许可以帮助理解。 这个函数: - ``` from nltk.corpus import wordnet - def synset_info(synset): print("Name", synset.name()) print("POS:", synset.pos()) @@ -75,7 +74,6 @@ for synset in synsets: 将会显示: - ``` 5 synsets: Name code.n.01 @@ -116,7 +114,7 @@ Part Holonyms: [] Part Meronyms: [] ``` -同义词集synsets词元lemmas在 WordNet 里是按照树状结构组织起来的,下面的代码会给出直观的展现: +同义词集synset词元lemma在词网里是按照树状结构组织起来的,下面的代码会给出直观的展现: ``` def hypernyms(synset): @@ -127,9 +125,9 @@ for synset in synsets:     print(synset.name() + " tree:")     pprint(synset.tree(rel=hypernyms))     print() +``` -[/code] [code] - +``` code.n.01 tree: [Synset('code.n.01'),  [Synset('written_communication.n.01'), @@ -155,24 +153,23 @@ code.v.02 tree:    ... ``` -WordNet 并没有涵盖所有的单词和其信息 (现今英语有约 17,0000 个单词,最新版的 WordNet 涵盖了约 15,5000 个),但它开了个好头。掌握了 WordNet 的各个概念后,如果你觉得它词汇少,不能满足你的需要,可以转而使用其他工具。或者,你也可以打造自己的“词网”WordNet! +词网并没有涵盖所有的单词和其信息(现今英语有约 17,0000 个单词,最新版的 词网 涵盖了约 15,5000 个),但它开了个好头。掌握了“词网”的各个概念后,如果你觉得它词汇少,不能满足你的需要,可以转而使用其他工具。或者,你也可以打造自己的“词网”! #### 自主尝试 -使用 Python 库,下载维基百科的 [open source][5] 页面,并列出该页面所有单词的同义词集synsets 词元lemmas。 +使用 Python 库,下载维基百科的 “[open source][5]” 页面,并列出该页面所有单词的同义词集synset词元lemma。 ### 相似度比较 相似度比较的目的是识别出两篇文本的相似度,在搜索引擎、聊天机器人等方面有很多应用。 -比如,相似度比较可以识别 football 和 soccer 是否有相似性。 +比如,相似度比较可以识别 `football` 和 `soccer` 是否有相似性。 ``` syn1 = wordnet.synsets('football') syn2 = wordnet.synsets('soccer') -# A word may have multiple synsets, so need to compare each synset of word1 with synset of word2 -# 一个单词可能有多个 synset,需要把 word1 的每个 synset 和 word2 的每个 synset 分别比较 +# 一个单词可能有多个 同义词集,需要把 word1 的每个同义词集和 word2 的每个同义词集分别比较 for s1 in syn1:     for s2 in syn2:         print("Path similarity of: ") @@ -180,9 +177,9 @@ for s1 in syn1:         print(s2, '(', s2.pos(), ')', '[', s2.definition(), ']')         print("   is", s1.path_similarity(s2))         print() +``` -[/code] [code] - +``` Path similarity of: Synset('football.n.01') ( n ) [ any of various games played with a ball (round or oval) in which two teams try to kick or carry or propel the ball into each other's goal ] Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ] @@ -194,9 +191,9 @@ Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players t    is 0.05 ``` -两个词各个 synset 之间路径相似度path similarity最大的是 0.5,表明它们关联性很大 ([路径相似度path similarity][6]指两个词的意义在上下义关系的词汇分类结构hypernym/hypnoym taxonomy中的最短距离)。 +两个词各个同义词集之间路径相似度path similarity最大的是 0.5,表明它们关联性很大([路径相似度path similarity][6]指两个词的意义在上下义关系的词汇分类结构hypernym/hypnoym taxonomy中的最短距离)。 -那么 code 和 bug 呢?这两个计算机领域的词的相似度是: +那么 `code` 和 `bug` 呢?这两个计算机领域的词的相似度是: ``` Path similarity of: @@ -215,7 +212,7 @@ Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or m    is 0.09090909090909091 ``` -这些是这两个词各 synset 之间路径相似度path similarity的最大值,这些值表明两个词是有关联性的。 +这些是这两个词各同义词集之间路径相似度path similarity的最大值,这些值表明两个词是有关联性的。 NLTK 提供多种相似度计分器similarity scorers,比如: @@ -232,7 +229,7 @@ NLTK 提供多种相似度计分器similarity scorers, 使用 Python 库,从维基百科的 [Category: Lists of computer terms][7] 生成一个术语列表,然后计算各术语之间的相似度。 -### tree树库treebank +### 树和树库 使用 NLTK,你可以把文本表示成树状结构以便进行分析。 @@ -240,7 +237,6 @@ NLTK 提供多种相似度计分器similarity scorers, 这是一份简短的文本,对其做预处理和词性标注: - ``` import nltk @@ -251,8 +247,7 @@ words = nltk.tokenize.word_tokenize(text) words_tagged = nltk.pos_tag(words) ``` -要把文本转换成树状结构,你必须定义一个语法grammar 。这个例子里用的是一个基于 [Penn Treebank tags][8] 的简单语法。 - +要把文本转换成树状结构,你必须定义一个语法grammar。这个例子里用的是一个基于 [Penn Treebank tags][8] 的简单语法。 ``` # A simple grammar to create tree @@ -261,7 +256,6 @@ grammar = "NP: {<JJ><NN>}" 然后用这个语法grammar创建一颗tree: - ``` # Create tree parser = nltk.RegexpParser(grammar) @@ -271,7 +265,6 @@ pprint(tree) 运行上面的代码,将得到: - ``` Tree('S', [('I', 'PRP'), ('love', 'VBP'), Tree('NP', [('open', 'JJ'), ('source', 'NN')])]) ``` @@ -284,10 +277,7 @@ tree.draw() ![NLTK Tree][9] -(Girish Managoli, [CC BY-SA 4.0][10]) - -这个树状结构有助于准确解读文本的意思。比如,用它可以找到文本的主语 ([subject][11]): - +这个树状结构有助于准确解读文本的意思。比如,用它可以找到文本的 [主语][11]: ``` subject_tags = ["NN", "NNS", "NP", "NNP", "NNPS", "PRP", "PRP$"] @@ -300,22 +290,22 @@ def subject(sentence_tree): print("Subject:", subject(tree)) ``` -结果显示主语是 I: +结果显示主语是 `I`: ``` Subject: I ``` -这是一个比较基础的文本分析步骤,可以用到更广泛的应用场景中。 比如,在聊天机器人方面,如果用户告诉机器人:“给我妈妈 Jane 预订一张机票,1 月 1 号伦敦飞纽约的“,机器人可以用这种分析方法解读这个指令: +这是一个比较基础的文本分析步骤,可以用到更广泛的应用场景中。 比如,在聊天机器人方面,如果用户告诉机器人:“给我妈妈 Jane 预订一张机票,1 月 1 号伦敦飞纽约的”,机器人可以用这种分析方法解读这个指令: **动作**: 预订 **动作的对象**: 机票 **乘客**: Jane **出发地**: 伦敦 **目的地**: 纽约 -**日期**: (明年) 1 月 1 号 +**日期**: (明年)1 月 1 号 -树库treebank指由许多预先标注好的tree构成的语料库。现在已经有面向多种语言的树库,既有开源的,也有限定条件下才能免费使用的,以及商用的。其中使用最广泛的是面向英语的宾州树库。宾州树库取材于 _华尔街日报_ Wall Street Journal。NLTK 也包含了宾州树库作为一个子语料库。下面是一些使用树库treebank的方法: +树库treebank指由许多预先标注好的tree构成的语料库。现在已经有面向多种语言的树库,既有开源的,也有限定条件下才能免费使用的,以及商用的。其中使用最广泛的是面向英语的宾州树库。宾州树库取材于华尔街日报Wall Street Journal。NLTK 也包含了宾州树库作为一个子语料库。下面是一些使用树库treebank的方法: ``` words = nltk.corpus.treebank.words() @@ -326,8 +316,9 @@ tagged_sents = nltk.corpus.treebank.tagged_sents() print(len(tagged_sents), "sentences:") print(tagged_sents) -[/code] [code] +``` +``` 100676 words: ['Pierre', 'Vinken', ',', '61', 'years', 'old', ',', ...] 3914 sentences: @@ -339,9 +330,9 @@ print(tagged_sents) ``` sent0 = tagged_sents[0] pprint(sent0) +``` -[/code] [code] - +``` [('Pierre', 'NNP'),  ('Vinken', 'NNP'),  (',', ','), @@ -354,20 +345,20 @@ pprint(sent0) ``` grammar = ''' -    Subject: {<NNP><NNP>} -    SubjectInfo: {<CD><NNS><JJ>} -    Action: {<MD><VB>} -    Object: {<DT><NN>} -    Stopwords: {<IN><DT>} -    ObjectInfo: {<JJ><NN>} -    When: {<NNP><CD>} + Subject: {} + SubjectInfo: {} + Action: {} + Object: {
} + Stopwords: {
} + ObjectInfo: {} + When: {} ''' parser = nltk.RegexpParser(grammar) tree = parser.parse(sent0) print(tree) +``` -[/code] [code] - +``` (S   (Subject Pierre/NNP Vinken/NNP)   ,/, @@ -385,28 +376,24 @@ print(tree) 图形化地显示: - ``` tree.draw() ``` ![NLP Treebank image][12] -(Girish Managoli, [CC BY-SA 4.0][10]) - trees树库treebanks的概念是文本分析的一个强大的组成部分。 #### 自主尝试 -使用 Python 库,下载维基百科的 [open source][5] 页面,将得到的文本以图形化的树状结构展现出来。 +使用 Python 库,下载维基百科的 “[open source][5]” 页面,将得到的文本以图形化的树状结构展现出来。 -### 命名实体识别Named entity recognition +### 命名实体识别 无论口语还是书面语都包含着重要数据。文本处理的主要目标之一,就是提取出关键数据。几乎所有应用场景所需要提取关键数据,比如航空公司的订票机器人或者问答机器人。 NLTK 为此提供了一个命名实体识别named entity recognition的功能。 这里有一个代码示例: - ``` sentence = 'Peterson first suggested the name "open source" at Palo Alto, California' ``` @@ -427,9 +414,9 @@ ne_tagged = nltk.ne_chunk(pos_tagged) print("NE tagged text:") print(ne_tagged) print() +``` -[/code] [code] - +``` NE tagged text: (S   (PERSON Peterson/NNP) @@ -454,9 +441,9 @@ print("Recognized named entities:") for ne in ne_tagged:     if hasattr(ne, "label"):         print(ne.label(), ne[0:]) +``` -[/code] [code] - +``` Recognized named entities: PERSON [('Peterson', 'NNP')] FACILITY [('Palo', 'NNP'), ('Alto', 'NNP')] @@ -471,28 +458,24 @@ ne_tagged.draw() ![NLTK Treebank tree][13] -(Girish Managoli, [CC BY-SA 4.0][10]) +NLTK 内置的命名实体标注器named-entity tagger,使用的是宾州法尼亚大学的 [Automatic Content Extraction][14](ACE)程序。该标注器能够识别组织机构ORGANIZATION、人名PERSON、地名LOCATION、设施FACILITY地缘政治实体geopolitical entity等常见实体entites。 -NLTK 内置的命名实体标注器named-entity tagger,使用的是宾州法尼亚大学的 [Automatic Content Extraction][14] (ACE) 程序。 该标注器能够识别组织机构ORGANIZATION、人名PERSON、地名LOCATION、设施FACILITY地缘政治实体geopolitical entity等常见实体entites。 - -NLTK 也可以使用其他标注器tagger,比如 [Stanford Named Entity Recognizer][15]. 这个经过训练的标注器用 Java 写成,但 NLTK 提供了一个使用它的接口 (详情请查看 [nltk.parse.stanford][16] 或 [nltk.tag.stanford][17])。 +NLTK 也可以使用其他标注器tagger,比如 [Stanford Named Entity Recognizer][15]. 这个经过训练的标注器用 Java 写成,但 NLTK 提供了一个使用它的接口(详情请查看 [nltk.parse.stanford][16] 或 [nltk.tag.stanford][17])。 #### 自主尝试 -使用 Python 库,下载维基百科的 [open source][5] 页面,并识别出对开源open source有影响力的人的名字,以及他们为开源open source做贡献的时间和地点。 +使用 Python 库,下载维基百科的 “[open source][5]” 页面,并识别出对开源open source有影响力的人的名字,以及他们为开源open source做贡献的时间和地点。 ### 高级实践 如果你准备好了,尝试用这篇文章以及此前的文章介绍的知识构建一个超级结构superstructure。 -使用 Python 库,下载维基百科的 [Category: Computer science page][18],然后: - +使用 Python 库,下载维基百科的 “[Category: Computer science page][18]”,然后: * 找出其中频率最高的单词unigrams、二元搭配bigrams三元搭配trigrams,将它们作为一个关键词列表或者技术列表。相关领域的学生或者工程师需要了解这样一份列表里的内容。 * 图形化地显示这个领域里重要的人名、技术、日期和地点。这会是一份很棒的信息图。 * 构建一个搜索引擎。你的搜索引擎性能能够超过维基百科吗? - ### 下一步? 自然语言处理是应用构建application building的典型支柱。NLTK 是经典、丰富且强大的工具集,提供了为现实世界构建有吸引力、目标明确的应用的工作坊。 @@ -508,7 +491,7 @@ via: https://opensource.com/article/20/8/nlp-python-nltk 作者:[Girish Managoli][a] 选题:[lujun9972][b] 译者:[tanloong](https://github.com/tanloong) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 12fa02e6cf5b5ef3ca6356525502d03337680c1c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Jul 2021 12:00:26 +0800 Subject: [PATCH 17/40] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tanloong 本文首发地址:https://linux.cn/article-13602-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/tanloong --- ... An advanced guide to NLP analysis with Python and NLTK.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200807 An advanced guide to NLP analysis with Python and NLTK.md (99%) diff --git a/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md b/published/20200807 An advanced guide to NLP analysis with Python and NLTK.md similarity index 99% rename from translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md rename to published/20200807 An advanced guide to NLP analysis with Python and NLTK.md index 80e8ce60a8..65fc9c9f76 100644 --- a/translated/tech/20200807 An advanced guide to NLP analysis with Python and NLTK.md +++ b/published/20200807 An advanced guide to NLP analysis with Python and NLTK.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tanloong) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13602-1.html) [#]: subject: (An advanced guide to NLP analysis with Python and NLTK) [#]: via: (https://opensource.com/article/20/8/nlp-python-nltk) [#]: author: (Girish Managoli https://opensource.com/users/gammay) From 13957ed6f185926fbf3a19819578d69f1499a3e9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Jul 2021 16:28:38 +0800 Subject: [PATCH 18/40] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @piaoshi 感谢您,完成了第一篇翻译贡献! --- ...7 Using Git Version Control as a Writer.md | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/translated/news/20210627 Using Git Version Control as a Writer.md b/translated/news/20210627 Using Git Version Control as a Writer.md index d9181e59a1..da76290ad1 100644 --- a/translated/news/20210627 Using Git Version Control as a Writer.md +++ b/translated/news/20210627 Using Git Version Control as a Writer.md @@ -3,36 +3,40 @@ [#]: author: (Theena https://news.itsfoss.com/author/theena/) [#]: collector: (lujun9972) [#]: translator: (piaoshi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -作为一个写作者如何使用Git版本控制 +作为一个写作者如何使用 Git 版本控制 ====== +> 我使用 Vim 和 Git 来写小说。是的,你也可以用 Git 来完成非编码任务。 + +![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/Using-Git-for-Writing.jpg?w=1200&ssl=1) + 我相信当代的写作者们应该开始思考他们的工作流程了。 在一个注意力高度分散的世界里,作为写作者,我们必须对每天执行的任务链拥有控制权。传统上,作家们会把他们的写作放在分散注意力的事较少、注意力高度集中的时间段。不幸的是,海明威、阿特伍德们的这些建议不再真正适用于我们了。我们所生活的世界联系得更紧密了,因此对作家来说就有了更多的陷阱。这首先要求我们要有足够的自制力,不要让社交媒体或小狗和小猫的可爱视频在我们写作的时候分散我们的注意力。 -但是,如果你的写作需要快速地检查事实、拼写不常见和技术性的词汇等,断开与互联网连接并不是一个现实的选项——这正是我写作时的场景。另一个问题是你用于写作的应用程序本身的干扰;作为一个长期使用 MS Word 的人,我发现它越来越漂亮,但速度越来越慢,也越来越让人分心。作为当初我[迁移到 Vim 的主要原因][1]之一,我曾详细地谈到了这一点,所以我不打算再在这个问题上大谈特谈。重点是,在现代世界中,在现代设备上进行写作,可能远非理想状态。 +但是,如果你的写作需要快速地检查事实、拼写不常见和技术性的词汇等,断开与互联网连接并不是一个现实的选项 —— 这正是我写作时的场景。另一个问题是你用于写作的应用程序本身的干扰;作为一个长期使用 MS Word 的人,我发现它越来越漂亮,但速度越来越慢,也越来越让人分心。作为当初我 [迁移到 Vim 的主要原因][1] 之一,我曾详细地谈到了这一点,所以我不打算再在这个问题上大谈特谈。重点是,在现代世界中,在现代设备上进行写作,可能远非理想状态。 -因为我已经详细介绍过了[我为什么转向 Vim][2]和开源版本控制,在这篇文章中,我更想谈谈该 **怎么做**,特别是如何使用开源的版本控制技术,比如git(和GitHub)。 +因为我已经详细介绍过了 [我为什么转向 Vim][2] 和开源版本控制,在这篇文章中,我更想谈谈该 **怎么做**,特别是如何使用开源的版本控制技术,比如 Git(和 GitHub)。 ### 什么是版本控制?再来一次? ![Source: https://git-scm.com/][3] -上图是我们如何进行传统版本控制的一个说明。这个图中假设你有一台设备,而且你只在那台设备上写作。但对我而言,我在许多机器上写作,包括我的安卓手机和一些不同年代的笔记本电脑,我会在特定的任务特定的位置使用到它们。我在所有这些设备上进行的一个共同任务就是写作——因此,我的设备必须以合理的方式捕捉变化并控制文件的版本。不要再让我将 `file1V1_device1_date.doc` 作为文件名了。 +上图是我们如何进行传统版本控制的一个说明。这个图中假设你有一台设备,而且你只在那台设备上写作。但对我而言,我在许多机器上写作,包括我的安卓手机和一些不同年代的笔记本电脑,我会在特定的任务、特定的位置使用到它们。我在所有这些设备上进行的一个共同任务就是写作 —— 因此,我的设备必须以合理的方式捕捉变化并控制文件的版本。不要再让我将 `file1V1_device1_date.doc` 作为文件名了。 -上图也没有考虑到我们用来写作的工具。像 LibreOffice Write 这样的文字处理器可以在 Linux、Mac 和 Windows 系统上使用,但在手机上使用文字处理器将会是一段不愉快的经历。我们中的一些写作者还使用其他文本工具——包括 Gmail 或我们的电子邮件客户端——来为我们的写作打草稿。但按逻辑顺序跟踪所有这些文件和电子邮件是相当折磨人的——我就用这样的流程写过一本书,相信我:我花在弄清文件名、版本变化、评论、给自己的注释以及带有附加注释的电子邮件上的时间,足以让我精神错乱。 +上图也没有考虑到我们用来写作的工具。像 LibreOffice Write 这样的文字处理器可以在 Linux、Mac 和 Windows 系统上使用,但在手机上使用文字处理器将会是一段不愉快的经历。我们中的一些写作者还使用其他文本工具(包括 Gmail 或我们的电子邮件客户端)来为我们的写作打草稿。但按逻辑顺序跟踪所有这些文件和电子邮件是相当折磨人的,我就用这样的流程写过一本书,相信我:我花在弄清文件名、版本变化、评论、给自己的注释以及带有附加注释的电子邮件上的时间,足以让我精神错乱。 -读到这里,你们中的一些人可能会正确地指出,有云备份技术呀。虽然云存储的好处是巨大的,而且我也在继续使用它们,但其版本控制几乎没有,或者说并不强大。 +读到这里,你们中的一些人可能会正确地指出,有云备份技术呀。虽然云存储的好处是巨大的,而且我也在继续使用它们,但其版本控制几乎不存在,或者说并不强大。 ### 一个更好的工作流程 就像地球上的其它地方一样,大流行病的开始引发了一些焦虑和一些反思。我利用这段时间在 [The Odin Project][4](强烈推荐给那些想学习 html、CSS、JavaScript/Ruby 的人)上自学了网络开发。 -在课程的第一个模块中,有一个关于 Git 的介绍:什么是版本控制,以及它试图解决什么问题。读了这一章后,我豁然开朗。我立即意识到,这个 _git_ 正是我作为一个写作者所要寻找的东西。 +在课程的第一个模块中,有一个关于 Git 的介绍:什么是版本控制,以及它试图解决什么问题。读了这一章后,我豁然开朗。我立即意识到,这个 _Git_ 正是我作为一个写作者所要寻找的东西。 是的,更好的方法不是本地化的版本控制,而是 _分布式_ 的版本控制。“分布式”描述的是设备的分布,而我在这些设备上访问文件,以及之后进行编辑修改。下图是分布式版本控制的一个直观说明。 @@ -44,7 +48,7 @@ * 使我的稿件库可以从任何地方、任何设备上访问 * 易于使用 - * 减少或消除因在写作、学习和编码各工作流程之间的场景切换而产生的摩擦——尽可能使用同一工具(即 Vim)。 + * 减少或消除因在写作、学习和编码各工作流程之间的场景切换而产生的摩擦 —— 尽可能使用同一工具(即 Vim)。 * 可扩展性 * 易于维护 @@ -52,7 +56,7 @@ ![][6] -如你所见,我的版本控制系统是分布式版本控制的一个简单的适配。在我的例子中,通过将 git 版本控制应用到云存储([pCloud][7])的一个文件夹上,我可以同时利用这两种技术的优点。因此,我的工作流程可以用下图描述: +如你所见,我的版本控制系统是分布式版本控制的一个简单的适配。在我的例子中,通过将 Git 版本控制应用到云存储([pCloud][7])的一个文件夹上,我可以同时利用这两种技术的优点。因此,我的工作流程可以用下图描述: ![][8] @@ -68,9 +72,9 @@ 你们中的写作者一定想知道这个系统存在什么缺点。以下是我在持续使用和完善这一工作流程时预计到的几个问题。 * 对草稿的评论:文字处理器的一个更有用的功能是具有评论的功能。当我希望以后再回到文本的某一部分时,我经常在这部分为自己留下一个评论。我仍然没有想出一个解决这个问题的办法。 - * 协作:文字处理程序允许写作者之间进行协作。在我以前做广告相关工作的时候,我会用 Google Docs 来写文案,然后分享链接给我的设计师,从而他可以为广告和网站对文案进行摘录。现在,我的解决方法是用 markdown 写文案,并通过 Pandoc 将 markdown 文件导出为 .doc 文件。更关键的是,当我的手稿完成后,我仍然需要将文件以 .doc 格式发送给我的编辑。一旦我的编辑做了一些修改并把它发回来,我再尝试用 Vim 打开它就没有意义了。在这一点上,该系统的局限性变得更加明显。 + * 协作:文字处理程序允许写作者之间进行协作。在我以前做广告相关工作的时候,我会用 Google Docs 来写文案,然后分享链接给我的设计师,从而他可以为广告和网站对文案进行摘录。现在,我的解决方法是用 Markdown 写文案,并通过 Pandoc 将 Markdown 文件导出为 .doc 文件。更关键的是,当我的手稿完成后,我仍然需要将文件以 .doc 格式发送给我的编辑。一旦我的编辑做了一些修改并把它发回来,我再尝试用 Vim 打开它就没有意义了。在这一点上,该系统的局限性变得更加明显。 -我并不是说这是最好的方法,但在我职业生涯的这个阶段,这是对我来说最好的方法。我想,随着我对我的新的[用于写作的开源工具][10]和版本控制越来越熟悉和适应,我将进一步完善这个方法。 +我并不是说这是最好的方法,但在我职业生涯的这个阶段,这是对我来说最好的方法。我想,随着我对我的新的 [用于写作的开源工具][10] 和版本控制越来越熟悉和适应,我将进一步完善这个方法。 我希望这篇文章能为那些想使用 Git 进行文档版本控制的写作者提供一个很好的介绍。这肯定不是一篇详尽的文章,但我将分享一些有用的链接,使你的旅程更容易。 @@ -78,8 +82,6 @@ 2. [开始使用 Git][12] 3. GitHub 的 Git 基础知识教程 -作为彩蛋,这里有一段我在安卓设备上使用 Vim 处理一首诗,并将改动推送到 Git 的屏幕录像。 - -------------------------------------------------------------------------------- via: https://news.itsfoss.com/version-control-writers/ @@ -87,7 +89,7 @@ via: https://news.itsfoss.com/version-control-writers/ 作者:[Theena][a] 选题:[lujun9972][b] 译者:[piaoshi](https://github.com/piaoshi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -95,12 +97,12 @@ via: https://news.itsfoss.com/version-control-writers/ [b]: https://github.com/lujun9972 [1]: https://news.itsfoss.com/how-i-started-loving-vim/ [2]: https://news.itsfoss.com/configuring-vim-writing/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/local.png?w=800&ssl=1 [4]: https://www.theodinproject.com/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjgwMCIgd2lkdGg9IjY2OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwNSIgd2lkdGg9IjYxNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/distributed.png?w=668&ssl=1 +[6]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/Version_Control.png?w=617&ssl=1 [7]: https://itsfoss.com/recommends/pcloud/ -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijc1MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/Version_Control_2.png?w=886&ssl=1 [9]: https://www.youtube.com/watch?v=NtH-HhaLw-Q [10]: https://itsfoss.com/open-source-tools-writers/ [11]: https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/introduction-to-git From b80f2e5b507c524263912a2597e6eb79c4a5bb03 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Jul 2021 16:29:46 +0800 Subject: [PATCH 19/40] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @piaoshi 本文首发地址:https://linux.cn/article-13604-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/Piaoshi --- .../20210627 Using Git Version Control as a Writer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210627 Using Git Version Control as a Writer.md (99%) diff --git a/translated/news/20210627 Using Git Version Control as a Writer.md b/published/20210627 Using Git Version Control as a Writer.md similarity index 99% rename from translated/news/20210627 Using Git Version Control as a Writer.md rename to published/20210627 Using Git Version Control as a Writer.md index da76290ad1..9c62e93ebd 100644 --- a/translated/news/20210627 Using Git Version Control as a Writer.md +++ b/published/20210627 Using Git Version Control as a Writer.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (piaoshi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13604-1.html) 作为一个写作者如何使用 Git 版本控制 ====== From 4d94a9c8d39c8ab5583fbbb9fca97f845d6b0ef3 Mon Sep 17 00:00:00 2001 From: Piaoshi Date: Wed, 21 Jul 2021 23:04:11 +0800 Subject: [PATCH 20/40] Delete source file and summit translated file-tech-20210529 Configuring Vim as a Writing Tool.md --- ...10529 Configuring Vim as a Writing Tool.md | 206 ------------------ ...10529 Configuring Vim as a Writing Tool.md | 193 ++++++++++++++++ 2 files changed, 193 insertions(+), 206 deletions(-) delete mode 100644 sources/tech/20210529 Configuring Vim as a Writing Tool.md create mode 100644 translated/tech/20210529 Configuring Vim as a Writing Tool.md diff --git a/sources/tech/20210529 Configuring Vim as a Writing Tool.md b/sources/tech/20210529 Configuring Vim as a Writing Tool.md deleted file mode 100644 index b7afb5e863..0000000000 --- a/sources/tech/20210529 Configuring Vim as a Writing Tool.md +++ /dev/null @@ -1,206 +0,0 @@ -[#]: subject: (Configuring Vim as a Writing Tool) -[#]: via: (https://news.itsfoss.com/configuring-vim-writing/) -[#]: author: (Theena https://news.itsfoss.com/author/theena/) -[#]: collector: (lujun9972) -[#]: translator: (piaoshi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Configuring Vim as a Writing Tool -====== - -In my first column I spoke about why I moved [my writing to Vim][1] – away from the standard tools of modern writers such as word processors (MS Word and their open source equivalents), text editors (Notepad since I’ve been a Windows user until last year), and cloud based storage technology. If you are a writer, I urge you to [read that part 1][1] before continuing here. - -Essentially, I argued that the more devices you use, the more writing tools you’ll need, the more complex the workflow eventually becomes. This is pertinent because I have four devices, including an Android phone, a main daily driver laptop running Linux, and a couple of older laptops, including a Mac, I take when I go outdoors for shoots. - -Vim was the perfect solution for me, and how I work; while I won’t argue that my new workflow is the best way for writers to work in the modern world, I will argue that it is important for writers to have a tool that works across all our devices, and is powerful enough to meet the needs for the different kinds of writing that we writers engage in everyday. - -Vim’s main benefit from this perspective, therefore, is that it is cross-platform – no matter what device you are on, Vim will work. I won’t speak extensively about using Vim in the Apple ecosystem, but a cursory glance at the reviews for [this app][2] tells me that somewhere someone needs Vim no matter what device they are using. - -Now let’s say you are a writer who wants to start using Vim. Where do you start once you’ve installed it? - -This part of the article isn’t necessarily a tutorial but a series of recommendations, including an examination of a .vimrc configuration file for prose writing. Wherever possible I will link to the respective YouTube tutorial that I learnt from. - -Linux users already have Vim pre-installed – launch it via the terminal emulator of choice. For Windows and Mac users, you can download it from the [official site][3]. - -### Recommendations - -**Post Vim Installation/Launch** - - * Open Vim Tutor via terminal. (Mac users can launch it this way, while Windows users can launch it using this method. You will not be using Vim to do any writing during this phase – instead you will spend 15 minutes everyday doing the Vim Tutorial. Don’t spend a minute longer or shorter; see how much progress you can make inside the tutorial within the allotted 15 minutes. You will find that every day, you progress that much deeper into the tutorial. Inside a month, you should be able to complete the entire tutorial within those 15 minutes. - * Becoming a better typist has immense benefits for Vim usage. This is optional, but I am relearning to type from scratch and it is having the side effect of making Vim even more useful. I began spending 15 minutes everyday on this site as a warm up before I went into the Vim Tutorial. - - - -I allocated 30 minutes at the start of every day for both these exercises to warm up, and 30 minutes every evening to cool down before I went to bed. This may have contributed to my quick transition from my old tool kit to Vim, but your mileage may vary. - -Once again, let me stress that the above steps _**other than Vim Tutor**_ is optional; it all depends on your individual motivation levels. - -We now come to the meat of this article: How do you configure Vim to be writer-friendly? - -### How to configure .vimrc for writing - -_Before I begin, I’d like to remind readers here that I am not a tech person – I am a novelist – and that any errors you see in the below are my own; I would love for feedback from experienced Vim users on how to refine my configuration file even further._ - -Below is my .vimrc file. You can clone mine from my [GitHub][4] and refine it further. - -``` -syntax on - -set noerrorbells "This removes vim's default error bell, turning it off so that it doesn't annoy us -set textwidth=100 "Ensures that each line is not longer than 100 columns -set tabstop=4 softtabstop=4 -set shiftwidth=4 -set expandtab -set smartindent -set linebreak -set number -set showmatch -set showbreak=+++ -set smartcase -set noswapfile -set undodir=~/.vim/undodir -set undofile -set incsearch -set spell -set showmatch -set confirm -set ruler -set autochdir -set autowriteall -set undolevels=1000 -set backspace=indent,eol,start - -" The next two settings ensure that line breaks and wrap work how writers, not -" coders, prefer it - -set wrap -nnoremap :set linebreak -nnoremap :set nolinebreak - - -call plug#begin('~/.vim/plugged') - -" This is for color themes - -Plug 'colepeters/spacemacs-theme.vim' -Plug 'sainnhe/gruvbox-material' -Plug 'phanviet/vim-monokai-pro' -Plug 'flazz/vim-colorschemes' -Plug 'chriskempson/base16-vim' -Plug 'gruvbox-community/gruvbox' - -" This is a selection of plugins to make prose writing easier. - -Plug 'dpelle/vim-LanguageTool' -Plug 'ron89/thesaurus_query.vim' -Plug 'junegunn/goyo.vim' -Plug 'junegunn/limelight.vim' -Plug 'reedes/vim-pencil' -Plug 'reedes/vim-wordy' - - -" This section are nice-to-haves for easier integration with machine, using vim-airline and such. - -Plug 'vim-airline/vim-airline' - -"This section deals with workspace and session management - -Plug 'thaerkh/vim-workspace' - -"Related to above, the following code saves all session files in a single directory outside your -"workspace - -let g:workspace_session_directory = $HOME . '/.vim/sessions/' - - -"Related to above, this is a activity tracker for vim - -Plug 'wakatime/vim-wakatime' - -" A disturbance in the force: we are using some emacs functionality here, org-mode specifically - -Plug 'jceb/vim-orgmode' - - - -" This is for language-specific plugins - -Plug 'plasticboy/vim-markdown' - - - call plug#end() - -colorscheme pacific -set background=dark - -if executable('rg') - let g:rg_derive_root='true' -endif -``` - -Learn how to install Vim Plugin. This tutorial helped me. I use Vim Plugged because it was the simplest and most elegant in my view. - -![][5] - -#### .vimrc housekeeping for writers - - * `syntax on` : this ensures that vim acknowledges what syntax I am using. I primarily use markdown for most note-taking and writing articles such as this one; while plain-text is my preferred method when working on my fiction. - * `set noerrorbells` : for the sake of your sanity, I highly recommend turning this on - * `set textwidth=100` : For ease of reading because no one wants to be horizontal scrolling a text document - * `set spell“ - * `set wrap` : ensures text wraps like how writers, not coders, would want it. You will notice that I haven’t spent much time discussing some of the other basic configuration, but I don’t feel those are salient for writers. I do some hobbyist coding so my .vimrc is a reflection of that. If all you want to do is to write on Vim, then the above configuration ought to get you started. - - - -From that point, your .vimrc is a living document of what you want to do with Vim, and how you want Vim to do that for you. - -#### A note on plug-ins - -Plug-ins are specified between lines 43-98. Assuming you’ve followed the tutorial on how to install vim plug-ins, I highly recommend the following vim writing-specific plug-ins to get started: - - * `vim-LanguageTool` - * `thesaurus_query.vim` - * `vim-pencil` - * `vim-wordy` - * `vim-goyo` - * `vim-markdown` - - - -#### Conclusion - -In this article, we gently introduced how writers can get started on vim, including a basic primer on configuring .vimrc for writing. In addition to mine, I am going to link here to the .vimrc of other writers that I found on GitHub, and have used as inspiration for my own. - -![][6] - -Remember that this is just a starter kit of a .vimrc for writers. As your needs evolve, you will find that Vim can evolve with it. Therefore, learning to configure your .vimrc is worth investing some time in. - -In the next article, I will be examining specifics of my writing workflow, using Vim and Git and GitHub. - -#### 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/configuring-vim-writing/ - -作者:[Theena][a] -选题:[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/theena/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/how-i-started-loving-vim/ -[2]: https://apps.apple.com/us/app/ivim/id1266544660 -[3]: https://www.vim.org/ -[4]: https://github.com/MiragianCycle/dotfiles -[5]: https://i1.wp.com/i.ytimg.com/vi/n9k9scbTuvQ/hqdefault.jpg?w=780&ssl=1 -[6]: https://i2.wp.com/i.ytimg.com/vi/Pq3JMp3stxQ/hqdefault.jpg?w=780&ssl=1 diff --git a/translated/tech/20210529 Configuring Vim as a Writing Tool.md b/translated/tech/20210529 Configuring Vim as a Writing Tool.md new file mode 100644 index 0000000000..b08e1f0deb --- /dev/null +++ b/translated/tech/20210529 Configuring Vim as a Writing Tool.md @@ -0,0 +1,193 @@ +[#]: subject: (Configuring Vim as a Writing Tool) +[#]: via: (https://news.itsfoss.com/configuring-vim-writing/) +[#]: author: (Theena https://news.itsfoss.com/author/theena/) +[#]: collector: (lujun9972) +[#]: translator: (piaoshi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +将 Vim 配置成一个写作工具 +====== + +在我的第一个专栏中,我谈到了我为什么把 [我的写作工作迁移到了 Vim 上][1] -- 远离现代写作者们的标准工具,如文字处理器(MS Word 及它的开源替代方案)、文本编辑器(记事本,因为直到去年我一直是 Windows 用户)和云存储技术。如果你是一个写作者,在继续下面的内容前,我建议你先阅读一下 [那篇文章的第一部分][1] 。 + +基本上可以说,你使用的设备越多,你需要的写作工具就越多,最终你的工作流程就越复杂。这一点对我来说是很贴切的,因为我有四台设备,包括一部安卓手机,一台日常用的运行 Linux 的主力笔记本电脑,还有两台旧的笔记本电脑,其中一台是 Mac,我去户外拍摄时会带着它。 + +Vim 对于我和我的工作方式来说是一个完美的解决方案;虽然我不会说我的新的工作流程是现代世界写作者工作的最佳方式,但我可以说的是,对于写作者来说,拥有一个能在我们所有设备上工作的工具非常重要的,并且这个工具要足够强大以满足我们写作者每天从事的不同类型的写作需求。 + +从这个角度来看,Vim 的主要优势是它是跨平台的 -- 无论在什么设备上,Vim 都能工作。在苹果生态系统中使用 Vim 的情况我就不细说了,但粗略地看一下 [这个应用程序][2] 的评论,我就会让知道,在某些地方有某些人需要 Vim,不管他们使用的是什么设备。 + +现在我们假设你是一个想开始使用 Vim 的写作者。一旦你安装了它,你该从哪里开始呢? + +我在这一部分给你的不是一个教程,而是一系列的建议,包含对一个用于诗歌写作的 .vimrc 配置文件的解读。只要有可能,我就会链接到我学习相应内容时用到的 YouTube 上的教程。 + +对于 Linux 用户来说,系统已经预装了 Vim -- 通过你喜欢的终端模拟器就可以启动它。对于 Windows 和 Mac 用户,你可以从 [Vim 官方网站][3] 下载它。 + +### 建议 + +**安装/启用 Vim 后** + + * 通过终端打开 Vim Tutor。( Mac 用户可以用这种方式启动,而 Windows 用户也可以用这种方法启动。[译者注:原文这里本应该有链接,可能作者忘记添加了。无论如何,在终端中, Linux 中的命令是 vimtutor,Windows 在安装目录下找到 vimtutor.bat 命令并运行;Mac?应该与 Linux 一样?我没 Mac 呀!])在这个阶段,你不会使用 Vim 进行任何写作 -- 相反,你要每天花15分钟做 Vim 教程。不要多花一分钟或少花一分钟;看看在规定的15分钟内,你能在教程中取得多大的进展。你会发现,每天你都会在教程中取得更大的进步。在一个月内,你应该能够利用这些15分钟完成整个教程。 + * 成为一个更好的打字员对 Vim 的使用来说有极大的好处。这不是必须的,但我正在重新学习打字,它的副作用是使 Vim 变得更加有用了。我每次都以花15分钟练习打字开始,作为进入 Vim 教程前的热身。 + +在每一天的开始,我分配了30分钟的时间做这两项练习进行热身,而每天晚上睡觉前再分配30分钟进行练习以让我安定下来。这样的做法帮我快速从旧的工具包过渡到了 Vim,但你的安排可能有所不同。 + +我再次强调, _**除了Vim Tutor之外**_ ,上述步骤都是可选的;这完全取决于你个人的动机水平。 + +现在我们来到了这篇文章的重点:如何配置 Vim ,使它对写作者友好? + +### 如何配置用于写作的 .vimrc + +_在开始之前,我想在这里提醒各位读者,我不是一个技术人员 -- 我是一个小说家 -- 你在下面看到的任何错误都是我自己的;我希望有经验的 Vim 用户能提供反馈,告诉我如何进一步完善我的配置文件。_ + +下面是我的 .vimrc 文件。你可以从我的 [GitHub][4] 上下载,并进一步完善它。 + +``` +syntax on + +set noerrorbells "取消 Vim 的错误警告铃声,关闭它以免打扰到我们 +set textwidth=100 "确保每一行不超过100字符 +set tabstop=4 softtabstop=4 +set shiftwidth=4 +set expandtab +set smartindent +set linebreak +set number +set showmatch +set showbreak=+++ +set smartcase +set noswapfile +set undodir=~/.vim/undodir +set undofile +set incsearch +set spell +set showmatch +set confirm +set ruler +set autochdir +set autowriteall +set undolevels=1000 +set backspace=indent,eol,start + +" 下面的设置确保按写作者而不是程序员喜欢的方式折行 + +set wrap +nnoremap :set linebreak +nnoremap :set nolinebreak + + +call plug#begin('~/.vim/plugged') + +" 这是颜色风格插件 + +Plug 'colepeters/spacemacs-theme.vim' +Plug 'sainnhe/gruvbox-material' +Plug 'phanviet/vim-monokai-pro' +Plug 'flazz/vim-colorschemes' +Plug 'chriskempson/base16-vim' +Plug 'gruvbox-community/gruvbox' + +" 这是为了更容易的诗歌写作选择的一些插件 + +Plug 'dpelle/vim-LanguageTool' +Plug 'ron89/thesaurus_query.vim' +Plug 'junegunn/goyo.vim' +Plug 'junegunn/limelight.vim' +Plug 'reedes/vim-pencil' +Plug 'reedes/vim-wordy' + + +" 这一部分是为了更容易地与机器集成,用了 vim-airline 这类插件 + +Plug 'vim-airline/vim-airline' + +" 这一部分外理工作区和会话管理 + +Plug 'thaerkh/vim-workspace' + +" 与上面插件相关, 下面的代码将你的所有的会话文件保存到一个你工作区之外的目录 + +let g:workspace_session_directory = $HOME . '/.vim/sessions/' + + +" 与上面插件相关,这是一个 Vim 活动的跟踪器 + +Plug 'wakatime/vim-wakatime' + +" 一个干扰因素:我在这里使用了一些 Emacs 的功能,特别是 org-mode + +Plug 'jceb/vim-orgmode' + + +" 这是文件格式相关插件 + +Plug 'plasticboy/vim-markdown' + + +call plug#end() + +colorscheme pacific +set background=dark + +if executable('rg') + let g:rg_derive_root='true' +endif +``` + +学习如何安装 Vim 插件时,这个教程帮助了我。我使用 Vim Plugged 插件管理器是因为在我看来它是最简单、最优雅的。 + +![][5] + +#### 对于写作者的 .vimrc 的选项的整理 + + * `syntax on` : 这可以确保 Vim 知道我在使用什么语法。做笔记,写这种文章时我主要使用 Markdown ;而在写小说的时候,纯文本是我的首选格式。 + * `set noerrorbells` : 为了你的精神状态,我强烈建议打开这个选项。 + * `set textwidth=100` : 为了便于阅读,没有人愿意横向滚动一个文本文件。 + * `set spell` : 提醒你,如果有拼写错误的话。 + * `set wrap` : 确保文本以写作者而不是程序员的方式进行折行。 + +你会注意到,我没有花更多时间讨论其他一些基本配置选项,因为我并不觉得那些对写作者来说有多重要。因为我做一些业余的编码工作,所以我的 .vimrc 配置反映了这一点。如果你只想在 Vim 上写作,那么上述配置就应该能让你顺利开始。 + +从这点上来说,你的 .vimrc 是一个活的文档,它能生动地反映你想用 Vim 做什么,以及你希望 Vim 如何为你做这些事情。 + +#### 关于插件的说明 + +第43-98行之间是我对插件的配置。如果你已经学习了关于如何安装 Vim 插件的教程,我强烈推荐你从以下专为写作开发的 Vim 插件开始: + + * `vim-LanguageTool` + * `thesaurus_query.vim` + * `vim-pencil` + * `vim-wordy` + * `vim-goyo` + * `vim-markdown` + +#### 总结 + +在这篇文章中,我们简单地介绍了写作者可以怎样开始使用 Vim,以及一个在写作工作中需要的 .vimrc 入门配置。除了我的 .vimrc 之外,我还将在这里链接到我在 GitHub 上发现的其他写作者的 .vimrc,它们是我自己配置时的灵感来源。 + +![][6] + +请劳记,这只是一个写作者的 .vimrc 的入门配置。你会发现,随着你的需求的发展,Vim 也可以随之发展。因此,投入一些时间学习配置你的 .vimrc 是值得的。 + +在下一篇文章中,我将会检视我在写作时的工作流程的具体细节,这个工作流程中我使用了 Vim 和 Git 及 GitHub。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/configuring-vim-writing/ + +作者:[Theena][a] +选题:[lujun9972][b] +译者:[piaoshi](https://github.com/piaoshi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/theena/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/how-i-started-loving-vim/ +[2]: https://apps.apple.com/us/app/ivim/id1266544660 +[3]: https://www.vim.org/ +[4]: https://github.com/MiragianCycle/dotfiles +[5]: https://i1.wp.com/i.ytimg.com/vi/n9k9scbTuvQ/hqdefault.jpg?w=780&ssl=1 +[6]: https://i2.wp.com/i.ytimg.com/vi/Pq3JMp3stxQ/hqdefault.jpg?w=780&ssl=1 From fc3b856ce91e1e65b54e0bc2a4c3341085411110 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Jul 2021 05:02:24 +0800 Subject: [PATCH 21/40] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210721=20Ru?= =?UTF-8?q?n=20GitHub=20Actions=20on=20Fedora=20CoreOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md --- ...721 Run GitHub Actions on Fedora CoreOS.md | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md diff --git a/sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md b/sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md new file mode 100644 index 0000000000..c4b80e2b99 --- /dev/null +++ b/sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md @@ -0,0 +1,219 @@ +[#]: subject: (Run GitHub Actions on Fedora CoreOS) +[#]: via: (https://fedoramagazine.org/run-github-actions-on-fedora-coreos/) +[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Run GitHub Actions on Fedora CoreOS +====== + +![][1] + +[United Artists][2], Public domain, via Wikimedia Commons + +[GitHub Actions][3] is a service provided to quickly setup continuous integration and delivery (CI/CD) workflows . These workflows run on hosts called _runners_. GitHub provides [hosted runners][4] with a limited set of operating system choice (Windows Server, Ubuntu, MacOS). + +Another option is to use [self-hosted][5] runners which gives the repository administrator more control on the runners. Self-hosted runners are dedicated to a repository or organization. The following article goes through the steps of configuring self-hosted runners using Fedora CoreOS. + +### Getting Started + +Fedora CoreOS is a minimalist operating system designed to be easy to deploy and maintain at scale. The operating system will automaticaly update and provide, by default, the tools needed to run containers. For all of these reasons, Fedora CoreOS is a great choice to consider for running CI/CD workflows. + +The first step to configure and provision a Fedora CoreOS machine is to generate an [Ignition][6] file. [Butane][7] allows you to generate Ignition’s file using a friendlier format (YAML). + +#### Configure a Fedora CoreOS runner + +To execute GitHub actions on Fedora CoreOS, the host needs the binaries and scripts used to register and run the runner. Download the binaries and scripts from the [actions runner project][8] and deploy under _/usr/local/sbin/actions-runner_. + +``` +version: "1.3.0" +variant: fcos +storage: + directories: + - path: /usr/local/sbin/actions-runner + mode: 0755 + user: + name: core + group: + name: core + files: + - path: /usr/local/sbin/actions-runner/actions-runner-linux.tar.gz + overwrite: true + contents: + source: https://github.com/actions/runner/releases/download/v2.278.0/actions-runner-linux-x64-2.278.0.tar.gz + mode: 0755 + user: + name: core + group: + name: core +``` + +#### Registration and Removal token + +Configuring runners for a project requires a “token”. This prevents registering or removing self-hosted runners from projects without the correct permissions. Tokens provided by Github have a one hour expiration time. If the runner restarts after this time it will require a new registration token. + +The token can be problematic, in particular with Fedora CoreOS automatic updates. The update process expects that the host will restart at least once every couple weeks after receiving new data. + +Luckily, it is possible to use GitHub REST API to obtain these tokens and automatically configure the runner every time the host restarts. The following _manage-runner.sh_ script uses the APIs to retrieve a token, remove any runner already configured and register the runner with a new token. + +``` +#!/bin/bash +# Handles the Github Action runner configuration. +# Remove and Registration token expires after 1 hour, if we want our runner +# to work after a reboot (auto update) we need to refresh the tokens. + +# First remove the runner with a fresh remove token +REMOVE_TOKEN=$(curl -u ${GITHUB_USER}:${GITHUB_TOKEN} -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/actions/runners/remove-token | jq -r '.token') +/usr/local/sbin/actions-runner/config.sh remove --token ${REMOVE_TOKEN} + + +# Then register the runner with a fresh registration token +REGISTRATION_TOKEN=$(curl -u ${GITHUB_USER}:${GITHUB_TOKEN} -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/actions/runners/registration-token | jq -r '.token') +/usr/local/sbin/actions-runner/config.sh --url https://github.com/cverna/fcos-actions-runner --token ${REGISTRATION_TOKEN} --labels fcos --unattended +``` + +The script above uses a few environment variables that contain a GitHub username and a [Personal Access Token][9] used to authenticate the REST API requests. The Personal Access Token requires the repo permissions in order to successfully retrieve the runner registration and removal tokens. The token is security sensitive so it is better to store it in a different file with stricter permissions. In this example that file is _actions-runner_. + +``` +GITHUB_USER= +GITHUB_REPO= +GITHUB_TOKEN= +``` + +Following is the Butane snippet that creates these two files – _manage-runner.sh_ and _actions-runner_. + +``` +- path: /usr/local/sbin/actions-runner/manage-runner.sh + contents: + local: manage-runner.sh + mode: 0755 + user: + name: core + group: + name: core + - path: /etc/actions-runner + contents: + local: actions-runner + mode: 0700 + user: + name: core + group: + name: core +``` + +### Running Actions on Fedora CoreOS + +Finally, create the systemd services that will configure and start the runner. Define the services in the Butane configuration file. + +``` +systemd: + units: + - name: github-runner-configure.service + enabled: true + contents: | + [Unit] + Description=Configure the github action runner for a repository + After=network-online.target boot-complete.target + Requires=boot-complete.target + [Service] + EnvironmentFile=/etc/actions-runner + Type=oneshot + RemainAfterExit=yes + User=core + WorkingDirectory=/usr/local/sbin/actions-runner + ExecStartPre=tar xvf actions-runner-linux.tar.gz --no-same-owner + ExecStart=/usr/local/sbin/actions-runner/manage-runner.sh + [Install] + WantedBy=multi-user.target + - name: github-runner.service + enabled: true + contents: | + [Unit] + Description=Run the github action runner + After=github-runner-configure.service + [Service] + WorkingDirectory=/usr/local/sbin/actions-runner + User=core + ExecStart=/usr/local/sbin/actions-runner/run.sh + [Install] + WantedBy=multi-user.target +``` + +This creates two services, _github-runner-configure.service_ (running once when the host has finished booting) and _github-runner.service_ (running the Actions runner binaries and waiting for new CI/CD jobs). + +Now that the Butane configuration is complete, generate an Ignition file out of it and provision a Fedora CoreOS Actions runner. + +``` +$ podman run -i --rm -v $PWD:/code:z --workdir /code quay.io/coreos/butane:release --pretty --strict --files-dir /code config.yaml -o config.ignition +``` + +Once the Ignition file is generated, it can be used to provision a runner on the platforms where Fedora CoreOS is [available][10]. + +> [Getting started with Fedora CoreOS][11] + +### Configure an Action to use a self-hosted runner + +The following test Action workflow will test the FCOS self-hosted worker. Create the following file in your git repository _.github/workflows/main.yml_ + +``` +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: fcos + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: Run a one-line script + run: podman run --rm fedora-minimal:34 echo Hello World ! +``` + +Note that the _runs-on_ configuration is set up to use a runner with the label _fcos_. + +The code presented in this article is available [here][12]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/run-github-actions-on-fedora-coreos/ + +作者:[Clément Verna][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/cverna/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/modern-times-816x345.jpg +[2]: https://commons.wikimedia.org/wiki/File:Chaplin_-_Modern_Times.jpg +[3]: https://docs.github.com/en/actions +[4]: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners +[5]: https://docs.github.com/en/actions/hosting-your-own-runners +[6]: https://github.com/coreos/ignition +[7]: https://github.com/coreos/butane +[8]: https://github.com/actions/runner +[9]: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token +[10]: https://docs.fedoraproject.org/en-US/fedora-coreos/bare-metal/ +[11]: https://fedoramagazine.org/getting-started-with-fedora-coreos/ +[12]: https://github.com/cverna/fcos-actions-runner From 68cae95c8e0fce1d9a7893e26d1f7ad5503ada0b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Jul 2021 05:02:51 +0800 Subject: [PATCH 22/40] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210722=20To?= =?UTF-8?q?p=20Android=20Emulators=20to=20Run=20and=20Test=20Android=20App?= =?UTF-8?q?s=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210722 Top Android Emulators to Run and Test Android Apps on Linux.md --- ...s to Run and Test Android Apps on Linux.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20210722 Top Android Emulators to Run and Test Android Apps on Linux.md diff --git a/sources/tech/20210722 Top Android Emulators to Run and Test Android Apps on Linux.md b/sources/tech/20210722 Top Android Emulators to Run and Test Android Apps on Linux.md new file mode 100644 index 0000000000..4310ba1c27 --- /dev/null +++ b/sources/tech/20210722 Top Android Emulators to Run and Test Android Apps on Linux.md @@ -0,0 +1,135 @@ +[#]: subject: (Top Android Emulators to Run and Test Android Apps on Linux) +[#]: via: (https://itsfoss.com/android-emulators-linux/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Top Android Emulators to Run and Test Android Apps on Linux +====== + +Android is built on top of a heavily customized Linux kernel. So, running mobile apps on Linux makes sense using an Android emulator. + +While this is not something new that you can do on your Linux machine, it is a feature more in demand after Windows introduced the ability to run Android apps in 2021. + +Not just limited to using apps, some of the Android emulators can also come in handy for development and testing. + +Hence, I have compiled a list of the best emulators that you can use to test or run Android applications/games on Linux. + +### 1\. Anbox + +Anbox is a pretty popular emulator that lets Linux users run Android apps. Probably this is what Deepin Linux utilizes to make help run Android apps out of the box. + +It isolates the Android operating system from the host using a container, which also lets them make the latest Android version available to use. + +Android apps running will not have direct access to your hardware—which is a good security decision. + +Unlike some of the other options here, Anbox does not technically need an emulation layer to make Android work. In other words, it is as close to a native Android experience on your Linux system. + +For this reason, it may not be the easiest option available. You cannot just use the Google Play Store to install applications, you need to utilize Android Debug Bridge (ADB). All you need is the APK file of an app to install and use it. + +[Anbox][1] + +### 2\. Genymotion + +![][2] + +Genymotion is an impressive solution tailored for testing and development. + +It is not a free and open-source option. They provide virtual Android experiences as a service through the cloud or a desktop client that is independent of Android Studio. + +You can simulate a variety of hardware configurations and Android versions to create a virtual device for testing. It also gives you the ability to scale up and has multiple Android virtual devices running for extensive tests. + +It can help you test how file uploading works in your app, impacts battery, performance, memory, and so on. + +While it is a premium solution mostly for professionals, it does support the latest Linux distributions that include Ubuntu 20.04 LTS. + +[Genymotion][3] + +### 3\. Android-x86 + +![][4] + +Android x86 is an open-source project to make Android run on a PC with 32-bit support. + +You can choose to install it using a virtual machine manager on your Linux system or directly try it on your PC. + +Official [installation instructions][5] are available if you need to go ahead. + +Unlike some other options, it is a simple emulator that tries to work on a PC with no fancy features. + +[Android x86][6] + +### 4\. Android Studio (Virtual Devices) + +![][7] + +Android Studio is a full-fledged tool for development and testing. Fortunately, with the support for Linux, you can use it to emulate the Android experience for experiments if you need to. + +You just need to create an Android Virtual Device (AVD) that you can configure and then simulate as an emulator. + +There are good chances to find support for some of the latest smartphones, TVs, and smartwatches as well. + +It needs a certain learning curve to be able to pull it off, but it is free and completely open-source. + +[Android Studio][8] + +### 5\. ARChon + +![][9] + +An interesting solution is an Android emulator that you can use in Linux and any other platform. + +It helps run Android apps on Chrome OS or with Chrome browser on any operating system. Unlike some others, you may not get a complete Android experience but only the ability to run Android apps. + +You just have to unpack the runtime and load it into Chrome extensions. Next, add the app you want to use by downloading the APK file onto it. + +[ARChon][10] + +### 6\. Bliss OS + +![][11] + +Bliss OS is yet another open-source project, similar to Android x86 that aims to make Android run on PC. + +Unlike Android x86, it gives more compatibility options by supporting both 32-bit and 64-bit architectures. Also, you can download the compatible file as per your processor. + +It is actively maintained and supports the latest Android versions available in the market. + +[Bliss OS][12] + +### Wrapping Up + +While you will find several Android emulators available for Linux, they may not replace a full-fledged smartphone experience. + +Every emulator comes with a set of features along with a specific purpose. Choose the one that you need! + +Have you tried Android emulators yet? What’s your favorite emulator that you have used in Linux? Feel free to let me know in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/android-emulators-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://anbox.io +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/genymotion-android-emulator.png?resize=800%2C508&ssl=1 +[3]: https://www.genymotion.com +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/android-x86-emulator.jpg?resize=1920%2C1080&ssl=1 +[5]: https://www.android-x86.org/installhowto.html +[6]: https://www.android-x86.org +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/android-virtual-devices-studio.png?resize=800%2C296&ssl=1 +[8]: https://developer.android.com/studio +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/arcrhon.jpg?resize=800%2C426&ssl=1 +[10]: https://archon-runtime.github.io +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/bliss-os-android.png?resize=800%2C576&ssl=1 +[12]: https://blissos.org From 3cf98927b5ad91ccc0ec74538dc815e55a21d292 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Jul 2021 05:03:47 +0800 Subject: [PATCH 23/40] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210720=20Yo?= =?UTF-8?q?u=20Can=20Now=20Use=20KDE=20Connect=20in=20Windows=20as=20Well?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md --- ... Now Use KDE Connect in Windows as Well.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md diff --git a/sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md b/sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md new file mode 100644 index 0000000000..0a84562890 --- /dev/null +++ b/sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md @@ -0,0 +1,91 @@ +[#]: subject: (You Can Now Use KDE Connect in Windows as Well) +[#]: via: (https://news.itsfoss.com/kde-connect-windows/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +You Can Now Use KDE Connect in Windows as Well +====== + +KDE Connect is a popular open-source tool that lets you share a connection between a phone and your computer. + +While it was always limited to the Linux platform, it looks like that it is coming to Windows after all. + +And, cross-platform availability of software is always a good thing. + +### What is KDE Connect? + +In case you are coming across it for the first time—KDE connect lets you share files, links, sync notifications, gives you the ability to reply to messages, and more. + +You can also choose to control your desktop and perform some custom commands remotely. And, you can also use your phone to control the volume/skip the music playing on your computer. + +### KDE Connect Available as Beta in Microsoft Store + +![][1] + +As per a Reddit thread posted a few weeks back, a KDE contributor mentions that the beta version is available from the [Microsoft Store][2]. + +However, it is only accessible through the private link and cannot be found when you search for it in the Microsoft Store. + +This also marks official support for Windows. + +![][3] + +### KDE Connect for Windows: Here’s How it Looks + +![][4] + +You just need to make sure that both of your devices are connected to the same network. + +Next, all you have to do is pair them and then start sharing files/links, browse your phone, and also get notifications. + +You can choose to tweak some of the options that include storage paths for shared images or change the sound to play when you try to ring the device. + +![][5] + +As you can notice here, you have a variety of options to make use of. + +I tried connecting my Android device for a while, and it worked just fine. You may want to explore more to learn what else you can do with it. + +### Why is it Good News for Windows Users? + +Undoubtedly Windows users already had plenty of options to achieve the same functions without KDE Connect. But with KDE connect onboard, it will finally provide the opportunity to use an open-source and privacy-friendly tool that they can pair their devices with. + +After all, you would not want your notifications, and links/files that you share to be spied upon by a shoddy third-party application. + +In that case, KDE Connect is your friend. + +Even though it is in beta right now. You can try it out by visiting the link and installing it from the Microsoft store. + +[KDE Connect on Microsoft Store][2] + +**Via**: [Omg!Ubuntu!][6] + +#### 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/kde-connect-windows/ + +作者:[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,PHN2ZyBoZWlnaHQ9IjIyOCIgd2lkdGg9Ijc2MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://www.microsoft.com/en-gb/p/kde-connect/9n93mrmsxbf0?&activetab=pivot:overviewtab +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI4NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2MyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://www.omgubuntu.co.uk/2021/07/kde-connect-windows-app From 96cb221e6549ed1b33aa989db07b0075366db70d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 22 Jul 2021 08:29:55 +0800 Subject: [PATCH 24/40] translated --- ...king Linux Video Player for Minimalists.md | 93 ------------------ ...king Linux Video Player for Minimalists.md | 94 +++++++++++++++++++ 2 files changed, 94 insertions(+), 93 deletions(-) delete mode 100644 sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md create mode 100644 translated/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md diff --git a/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md b/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md deleted file mode 100644 index 67f0f58036..0000000000 --- a/sources/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: subject: (Meet Clapper: A Sleek Looking Linux Video Player for Minimalists) -[#]: via: (https://itsfoss.com/clapper-video-player/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Meet Clapper: A Sleek Looking Linux Video Player for Minimalists -====== - -Love minimalism? You’ll love Clapper. - -Clapper is a new [video player for Linux][1]. Actually, it’s more for GNOME than Linux. - -Built on top of GNOME’s JavaScript library and GTK4 toolkit, it blends naturally in the GNOME desktop environment. It uses [GStreamer][2] for media backend and [OpenGL][3] for rendering. - -I like application with minimalist approach. While VLC is the Swiss Knife of media players, I prefer [MPV player][4] for the sleek, minimal interface. And now I think I am going to stick with Clapper for sometime. - -### Clapper video player - -![A screenshot of Clapper video player][5] - -[Clapper uses hardware acceleration][6] by default. It supports Intel and AMD GPUs and works on both Xorg and Wayland. - -[Clapper][7] doesn’t use the traditional upper window bar. There are auto-hiding preference menu, mode changer and window control buttons for you to access a few features. This gives it a sleek, minimalist look. - -It has three modes: - - * Windowed mode: the default mode shows the progress bar and window control - * Floating mode: the progress bar is hidden and the player is floating on top of other applications like the ‘[always on top][8]‘ feature or ‘picture in picture’ mode - * Fullscreen mode: Player goes full screen, progress bar is bigger but they all auto-hide - - - -![Interface of Clapper video player with preference control and window modes][9] - -Clapper also has an adaptive UI which can also be used on Linux-based smartphones and tablets. So if you have got yourself a Pine Phone or Librem5, you can use Clapper on it. - -There is support for subtitles with option to change the font. However, the subtitles didn’t work in my testing. There is also no option to explicitly add subtitles to a playing video. This is something that must be improved. - -Like VLC, Clapper also gives you the option to resume playback from the last point if you open the same video file again. One of the [handy features I love in VLC][10]. - -Clapper supports playing videos from the internet as well if you provide the URL. - -Here, in the screenshot, I am playing a YouTube video in Clapper. It is a beautiful song sung by a beautiful singer and actress. Can you guess which song or movie it is? - -![Clapper playing a video from YouTube][11] - -### Install Clapper on Linux - -Clapper is available in AUR for Arch and Manjaro users. That should not be a surprise for anyone. AUR has everything under the sun. - -For other distributions, Clapper officially provides [Flatpak package][12]. So, please [enable Flatpak support for your distribution][13] and then use the following command to install it: - -``` -flatpak install flathub com.github.rafostar.Clapper -``` - -Once installed, simply search for it in the application menu or right click on a video file and choose to open it with Clapper. - -Clapper is far from being the perfect video player. However, it has potential to become a popular Linux application. - -If you use it, please do share your experience. If you find bugs, please [notify the developer][14]. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/clapper-video-player/ - -作者:[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/video-players-linux/ -[2]: https://gstreamer.freedesktop.org/ -[3]: https://www.opengl.org/ -[4]: https://itsfoss.com/mpv-video-player/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-screenshot.png?resize=800%2C498&ssl=1 -[6]: https://github.com/Rafostar/clapper/wiki/Hardware-acceleration -[7]: https://github.com/Rafostar/clapper -[8]: https://itsfoss.com/always-on-top/ -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-video-player-interface.jpg?resize=800%2C480&ssl=1 -[10]: https://itsfoss.com/simple-vlc-tips/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-youtube-video.jpg?resize=800%2C501&ssl=1 -[12]: https://flathub.org/apps/details/com.github.rafostar.Clapper -[13]: https://itsfoss.com/flatpak-guide/ -[14]: https://github.com/Rafostar/clapper/issues diff --git a/translated/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md b/translated/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md new file mode 100644 index 0000000000..be278de96f --- /dev/null +++ b/translated/tech/20210720 Meet Clapper- A Sleek Looking Linux Video Player for Minimalists.md @@ -0,0 +1,94 @@ +[#]: subject: (Meet Clapper: A Sleek Looking Linux Video Player for Minimalists) +[#]: via: (https://itsfoss.com/clapper-video-player/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +认识 Clapper:一款外观时尚的 Linux 视频播放器,适合极简主义者使用 +====== + +喜欢极简主义吗?你会喜欢 Clapper 的。 + +Clapper 是一个新的 [Linux 视频播放器][1]。实际上,它更多的是为 GNOME 而不是为 Linux。 + +它构建在 GNOME 的 JavaScript 库和 GTK4 工具包之上,自然地融合在 GNOME 的桌面环境中。它使用 [GStreamer][2] 作为媒体后端,使用 [OpenGL][3] 进行渲染。 + +我喜欢极简主义的应用。虽然 VLC 是媒体播放器中的瑞士刀,但我更喜欢 [MPV 播放器][4],因为它的界面时尚、简约。现在我想要坚持使用 Clapper 一段时间了。 + +### Clapper 视频播放器 + +![A screenshot of Clapper video player][5] + +[Clapper 默认使用硬件加速][6]。它支持英特尔和 AMD 的 GPU,在 Xorg 和 Wayland 上都能工作。 + +[Clapper][7] 不使用传统的上部窗口栏。有自动隐藏的偏好菜单、模式切换器和窗口控制按钮供你访问一些功能。这给了它一个时尚、简约的外观。 + +它有三种模式: + + * 窗口模式:默认模式显示进度条和窗口控制。 + * 浮动模式:进度条被隐藏,播放器漂浮在其他应用程序的顶部,就像“[总是在顶部][8]”或“画中画”模式。 + * 全屏模式:播放器进入全屏,进度条变大,但它们都会自动隐藏起来 + + + +![Interface of Clapper video player with preference control and window modes][9] + +Clapper 也有一个自适应的用户界面,也可以在基于 Linux 的智能手机和平板电脑上使用。因此,如果你有自己的 Pine Phone 或 Librem5,你可以在它上面使用 Clapper。 + +它支持字幕,并可选择改变字体。然而,在我的测试中,字幕并不可用。也没有选项可以明确地在播放的视频中添加字幕。这一点必须改进。 + +和 VLC 一样,如果你再次打开同一个视频文件,Clapper 也可以让你选择从最后一个点恢复播放。这是我喜欢的 VLC 中的一个[方便的功能][10]。 + +如果你提供 URL,Clapper 也支持从互联网上播放视频。 + +这里的截图中,我正在 Clapper 中播放一个 YouTube 视频。这是一首由一位美丽的歌手和演员唱的优美歌曲。你能猜到这是哪首歌或哪部电影吗? + + +![Clapper playing a video from YouTube][11] + +### 在 Linux 上安装 Clapper + +对 Arch 和 Manjaro 用户而言,Clapper 可在 AUR 中找到。这不是对所有人的惊喜。AUR 有这世上的一切。 + +对于其他发行版,Clapper 官方提供了 [Flatpak 包][12]。所以,请[为你的发行版启用 Flatpak 支持][13],然后使用下面的命令来安装它: + +``` +flatpak install flathub com.github.rafostar.Clapper +``` + +安装后,只需在应用菜单中搜索它,或右击视频文件,选择用 Clapper 打开它。 + +Clapper 远不是一个完美的视频播放器。然而,它有可能成为一个流行的 Linux 应用。 + +如果你使用它,请分享你的经验。如果你发现问题,请[通知开发者][14]。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/clapper-video-player/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/video-players-linux/ +[2]: https://gstreamer.freedesktop.org/ +[3]: https://www.opengl.org/ +[4]: https://itsfoss.com/mpv-video-player/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-screenshot.png?resize=800%2C498&ssl=1 +[6]: https://github.com/Rafostar/clapper/wiki/Hardware-acceleration +[7]: https://github.com/Rafostar/clapper +[8]: https://itsfoss.com/always-on-top/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-video-player-interface.jpg?resize=800%2C480&ssl=1 +[10]: https://itsfoss.com/simple-vlc-tips/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-youtube-video.jpg?resize=800%2C501&ssl=1 +[12]: https://flathub.org/apps/details/com.github.rafostar.Clapper +[13]: https://itsfoss.com/flatpak-guide/ +[14]: https://github.com/Rafostar/clapper/issues From 3a10100e29dd6d3836f94ea04bf99ec191c06893 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 22 Jul 2021 08:32:47 +0800 Subject: [PATCH 25/40] translating --- sources/tech/20210720 Run a Linux virtual machine in Podman.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210720 Run a Linux virtual machine in Podman.md b/sources/tech/20210720 Run a Linux virtual machine in Podman.md index 72df55d22a..5c91c4eb51 100644 --- a/sources/tech/20210720 Run a Linux virtual machine in Podman.md +++ b/sources/tech/20210720 Run a Linux virtual machine in Podman.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/linux-podman) [#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From e86fb3ec0ff0031f840979d3f872fd7dc504fc45 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Jul 2021 20:56:18 +0800 Subject: [PATCH 26/40] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Wlzzzz-del 感谢您,完成了第一篇翻译贡献! --- ...rence between a fork and a distribution.md | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/translated/talk/20180713 What-s the difference between a fork and a distribution.md index 87abb65fe8..3cb7d0bd95 100644 --- a/translated/talk/20180713 What-s the difference between a fork and a distribution.md +++ b/translated/talk/20180713 What-s the difference between a fork and a distribution.md @@ -1,56 +1,60 @@ -What's the difference between a fork and a distribution? 分支与发行版有什么不同? ====== -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/spoons_forks_520x292_jh.png?itok=DzEzZBuG) +> 开源软件的发行版和分支是不一样的。了解其中的区别和潜在的风险。 -如果你们对开源软件有过一段时间地了解,一定曾在许多相关的途径中听说过分支(fork)和发行版(distribution)两个词。许多人对这两个词的区别不太清楚,因此我将试着通过这篇文章为大家解答这一疑惑。 +![](https://img.linux.net.cn/data/attachment/album/202107/22/205518spblrgcpxrlnbibe.jpg) -### 首先地,关于定义 +如果你们对开源软件有过一段时间的了解,一定曾在许多相关方面中听说过分支fork发行版distribution两个词。许多人对这两个词的区别不太清楚,因此我将试着通过这篇文章为大家解答这一疑惑。 + +(LCTT 译注:fork 一词,按我们之前的倡议,在版本控制工作流中,为了避免和同一个仓库的 branch 一词混淆,我们建议翻译为“复刻”。但是在项目和发行版这个语境下,没有这个混淆,惯例上还是称之为“分支”。) + +### 首先,一些定义 在解释分支与发行版两者的细微区别与相似之处之前,让我们先给一些相关的重要概念下定义。 **[开源软件][1]** 是指具有以下特点的软件: - * 在特定的 [协议][2] 限制下,软件供所有人免费传播与使用 - * 在特定的协议限制下,软件源代码供所有人使用与修改 + * 在特定的 [许可证][2] 限制下,软件供所有人免费分发 + * 在特定的许可证限制下,软件源代码可以供所有人查看与修改 -开源软件有以下几种 **消费** 方式: +开源软件可以按以下方式 **使用**: - * 以二进制或者源代码的方式下载,通常是不收费的。(例如,[Eclipse开发者环境][3]) + * 以二进制或者源代码的方式下载,通常是免费的。(例如,[Eclipse 开发者环境][3]) * 作为一个商业公司的产品,有时向用户提供一些服务并以此收费。(例如,[红帽产品][4]) - * 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的[Freetype软件][5]) + * 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的 [Freetype 软件][5]) -将 **自由且开源(FOSS)** 中的”自由“理解成“零成本”是不准确的。自由且开源仅仅意味着这个软件在遵守软件协议的前提下是可以免费传播、修改、学习和使用的。软件传播者也可能为该软件定价。例如,免费使用的Linux发行版有Fedora、Centos等。另外,收费的发行版有红帽企业版Linux、SUSE等。 +自由开源软件free and open source software(FOSS)不一定是“零成本”的“免费free”。自由开源软件仅仅意味着这个软件在遵守软件许可证的前提下可以自由地分发、修改、研究和使用。软件分发者也可能为该软件定价。例如,Linux 可以是 Fedora、Centos、Gentoo 等免费发行版,也可以是付费的发行版,如红帽企业版 Linux(RHEL)、SUSE Linux 企业版(SLES)等。 -**社区(community)** 指的是为一个开源项目协同工作和贡献的团体或个人。任何人或者团体都可以在遵守协议的前提下通过例如编写或者审查代码、撰写使用文档、测试软件、管理会议、更新网站等方式为开源项目作出贡献。例如,在[Openhub.net][6]网站,我们可以看见政府、非营利性机构、商业公司和教育团队等组织都在[为一些开源项目作出贡献][7]。 +社区community指的是在一个开源项目上协作的团体或个人。任何人或者团体都可以在遵守协议的前提下,通过编写或审查代码/文档/测试套件、管理会议、更新网站等方式为开源项目作出贡献。例如,在 [Openhub.net][6] 网站上,我们可以看见政府、非营利性机构、商业公司和教育团队等组织都在 [为一些开源项目作出贡献][7]。 -**项目(project)** 是集合作开发、文档和测试的结果。绝大多数项目都搭建了主要仓库用来存储代码、文档、测试文件和目前正在开发的文件。 +一个开源项目project是集协作开发、文档和测试的结果。大多数项目都搭建了一个中央仓库用来存储代码、文档、测试文件和目前正在开发的文件。 -**发行版(distribution)** 是指开源项目的一份的副本,通常以二进制或源代码为样式。例如,Centos、Fedora、红帽企业版Linux、SUSE、Ubuntu等都是Linux这一项目的发行版。Tectonic、谷歌的Kubernetes引擎、亚马逊的容器服务和红帽的OpenShift都是Kubernetes项目的发行版。 +发行版distribution是指开源项目的一份的二进制或源代码的副本。例如,CentOS、Fedora、红帽企业版 Linux(RHEL)、SUSE Linux、Ubuntu 等都是 Linux 项目的发行版。Tectonic、谷歌的 Kubernetes 引擎(GKE)、亚马逊的容器服务和红帽的 OpenShift 都是 Kubernetes 项目的发行版。 -开源项目的商业发行版经常被称作 **产品(products)** ,类似地红帽OpenStack平台是红帽OpenStack产品系列旗下的一个基于OpenStack上游项目搭建并且百分百开源的发行版。 +开源项目的商业发行版经常被称作产品products,因此,红帽 OpenStack 平台是红帽 OpenStack 的产品,它是 OpenStack 上游项目的一个发行版,并且是百分百开源的。 -**主干(trunk)** 是该开源项目发展的主要社区工作流。 +主干trunk是开发开源项目的社区的主要工作流。 -**分支(fork)** 是开源项目主干的一个版本,他是分离自主干的独立工作流。 +开源分支fork是开源项目主干的一个版本,它是分离自主干的独立工作流。 -因此, **一个发行版并不等同于一个分支** 。发行版是上游项目的包裹,具有可用性,经常作为产品进行销售。然而,发行版的核心代码和文档需要遵守上游项目的版本规则。从上游版本中获取开源代码的分支用户必须依靠他们自身来维护分支项目,这意味着他们失去了上游社区协同工作带来的好处。 +因此,**发行版并不等同于分支**。发行版是上游项目的一种包装,由厂商提供,经常作为产品进行销售。然而,发行版的核心代码和文档与上游项目的版本保持一致。分支,以及任何基于分支的的发行版,导致代码和文档的版本与上游项目不同。对上游项目进行了分支的用户必须自己来维护分支项目,这意味着他们失去了上游社区协同工作带来的好处。 -为了对软件分支进行进一步的解释,让我来用动物迁徙作比喻。鲸鱼和海狮从北极迁徙到加利福尼亚和墨西哥;帝王蝶从阿拉斯加迁徙到墨西哥;并且北半球的燕子和许多其他鸟类飞翔南方去过冬。成功迁徙的关键因素在于,团队中的所有动物团结一致,紧跟领导者,找到食物和庇护所,并且不会迷路。 +为了进一步解释软件分支,让我来用动物迁徙作比喻。鲸鱼和海狮从北极迁徙到加利福尼亚和墨西哥;帝王斑蝶从阿拉斯加迁徙到墨西哥;并且北半球的燕子和许多其他鸟类飞翔南方去过冬。成功迁徙的关键因素在于,团队中的所有动物团结一致,紧跟领导者,找到食物和庇护所,并且不会迷路。 ### 独立前行带来的风险 -一只鸟、帝王蝶或者鲸鱼一旦掉队就失去了许多优势,例如团队带来的保护以及知道哪儿有食物、庇护所和目的地。 +一只鸟、帝王蝶或者鲸鱼一旦掉队就失去了许多优势,例如团队带来的保护,以及知道哪儿有食物、庇护所和目的地。 相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险: - 1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术争论,分支的代码修改的越多,将这一分支作为上游项目需要花费的时间和金钱成本就越高。 - 2. **分支用户基本上都在运行几乎没有安全保障的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能将无法从这次修复中受益。 - 3. **分支用户几乎无法从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户习惯的新特性。如果一个组织分离于上游,由于代码不同他们几乎不能与主干版本进行更新。 - 4. **他们可能无法和其他软件包整合在一起。** 开源项目很少被发展成为单一的实体;相反地,他们经常被与其他项目打包在一起构成一套解决方案。分支代码可能不能够与其他项目整合,因为分支代码的开发者并不与上游的其他参与者们合作。 - 5. **他们可能不能够在硬件平台上验证分支代码可行性。** 软件包裹通常被搭载在硬件平台上进行验证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 -总之,开源发行版只是一个由上游组织协同开发、并且提供商业服务与支持的包裹。分支是开源项目的独立发展工作流,并且不能从上游社区协同工作开发的结果中收益。 + 1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术债,对分支的代码修改的越多,将这一分支重新归入上游项目需要花费的时间和金钱成本就越高。 + 2. **分支用户有可能运行不太安全的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能无法从这次修复中受益。 + 3. **分支用户可能不会从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户利益的新特性。如果一个组织从上游分支,由于代码不同,它们可能无法纳入新的功能。 + 4. **它们可能无法和其他软件包整合在一起。** 开源项目很少是作为单一实体开发的;相反地,它们经常被与其他项目打包在一起构成一套解决方案。分支代码可能无法与其他项目整合,因为分支代码的开发者没有与上游的其他参与者们合作。 + 5. **它们可能不会得到硬件平台认证。** 软件包通常被搭载在硬件平台上进行认证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。 + +总之,开源发行版只是一个来自上游的、多组织协同开发的、由供应商销售与支持的打包集合。分支是一个开源项目的独立开发工作流,有可能无法从上游社区协同工作的结果中受益。 -------------------------------------------------------------------------------- @@ -59,7 +63,7 @@ via: https://opensource.com/article/18/7/forks-vs-distributions 作者:[Jonathan Gershater][a] 选题:[lujun9972](https://github.com/lujun9972) 译者:[Wlzzzz-del](https://github.com/Wlzzzz-del) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 09d1e34d9cb4b82370172e6bf97a4876232c5331 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Jul 2021 20:57:23 +0800 Subject: [PATCH 27/40] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Wlzzzz-del 本文首发地址: https://linux.cn/article-13605-1.html 您的 LCTT 专页地址:https://linux.cn/lctt/Wlzzzz-del --- ...713 What-s the difference between a fork and a distribution.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/talk => published}/20180713 What-s the difference between a fork and a distribution.md (100%) diff --git a/translated/talk/20180713 What-s the difference between a fork and a distribution.md b/published/20180713 What-s the difference between a fork and a distribution.md similarity index 100% rename from translated/talk/20180713 What-s the difference between a fork and a distribution.md rename to published/20180713 What-s the difference between a fork and a distribution.md From 3124d9167b41af987e2f549b5dc12573ec22013a Mon Sep 17 00:00:00 2001 From: Piaoshi Date: Thu, 22 Jul 2021 22:13:51 +0800 Subject: [PATCH 28/40] =?UTF-8?q?=E7=94=B3=E9=A2=86=E7=BF=BB=E8=AF=91[tech?= =?UTF-8?q?]:=2020210418=20F(r)iction-=20Or=20How=20I=20Learnt=20to=20Stop?= =?UTF-8?q?=20Worrying=20and=20Start=20Loving=20Vim.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...on- Or How I Learnt to Stop Worrying and Start Loving Vim.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md b/sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md index 7743b5f167..3375b7377e 100644 --- a/sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md +++ b/sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/how-i-started-loving-vim/) [#]: author: (Theena https://news.itsfoss.com/author/theena/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (piaoshi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d9996224bceff2c84e2ac2269daea745d9d9c9f7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Jul 2021 05:03:29 +0800 Subject: [PATCH 29/40] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210723=20Fi?= =?UTF-8?q?xing=20Flatpak=20Error:=20No=20remote=20refs=20found=20similar?= =?UTF-8?q?=20to=20=E2=80=98flathub=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210723 Fixing Flatpak Error- No remote refs found similar to ‘flathub.md --- ...o remote refs found similar to ‘flathub.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20210723 Fixing Flatpak Error- No remote refs found similar to ‘flathub.md diff --git a/sources/tech/20210723 Fixing Flatpak Error- No remote refs found similar to ‘flathub.md b/sources/tech/20210723 Fixing Flatpak Error- No remote refs found similar to ‘flathub.md new file mode 100644 index 0000000000..af768edbab --- /dev/null +++ b/sources/tech/20210723 Fixing Flatpak Error- No remote refs found similar to ‘flathub.md @@ -0,0 +1,84 @@ +[#]: subject: (Fixing Flatpak Error: No remote refs found similar to ‘flathub’) +[#]: via: (https://itsfoss.com/no-remote-ref-found-flatpak/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fixing Flatpak Error: No remote refs found similar to ‘flathub’ +====== + +So, I just installed Fedora. Installing my favorite applications was among the list of things to do after installing Fedora. + +I tried installing VLC in Flatpak form, but it gave me an error: + +**error: No remote refs found similar to ‘flathub’** + +![No remote refs found error displayed with Flatpak][1] + +### Fixing “no remote refs found similar to flathub” error + +The fix is rather simple. Add the Flathub repository in the following way: + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +It will ask for your password, or you could use the above command with sudo. + +Now, if you try to install a Fltapak package from Fltahub, it should work as expected. + +![Adding the Flathub repoistory fixes the issue][2] + +### Reason why you see this error and how it was fixed + +Now that have fixed the error, it would be a good idea to also learn why you saw this error in the first place and how it was fixed. + +Like most other package managers in Linux, Flatpak also works on the concept of repositories. In simpler words, you can imagine package repositories as a warehouse where packages are stored. + +But in order to retrieve a package from this warehouse, you need to know the address of the warehouse first. + +That’s what happens here. You are trying to download (and install) a package from a certain repository (Flathub in this case). But your system doesn’t know about this “flathub”. + +In order to solve this issue, you added the Flathub repository. When you do that, your Linux system can look for the package you are trying to install in this repository. + +You may see all the remote Flatpak repository added to your system. + +![List Flatpak repositories added to your system][3] + +Let’s have a deeper look at the command which was used for adding the repository: + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + + * flatpak: this is the flatpak CLI tool. + * remote-add: this option indicates that you are adding a new remote repository. + * –if-not-exists: this ensures that the remote repository is only added if it is not added already. + * flathub: this is short reference for the complete URL of the actual repository. You may name it something else but the convention is to use the one provided by the developer. + * : The actual repository address. + + + +_**So, the bottom line is that when you see Flatpak complaining about ‘no remote refs found similar to xyz’, verify that the said repository is not added and if that’s the case, figure out its URL and add it to the system.**_ + +I hope this quick tip help you with this Flatpak issue. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/no-remote-ref-found-flatpak/ + +作者:[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://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/flatpak-remote-ref-not-found-error-800x265.png?resize=800%2C265&ssl=1 +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/flatpak-no-remote-ref-problem-fixed.png?resize=800%2C317&ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/flatpak-list-repositories.png?resize=800%2C317&ssl=1 From 46de005c6f81fe0fc6a5e367f47483a16e806fe1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Jul 2021 05:03:56 +0800 Subject: [PATCH 30/40] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210722=20Wr?= =?UTF-8?q?ite=20your=20first=20JavaScript=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210722 Write your first JavaScript code.md --- ...210722 Write your first JavaScript code.md | 204 ++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 sources/tech/20210722 Write your first JavaScript code.md diff --git a/sources/tech/20210722 Write your first JavaScript code.md b/sources/tech/20210722 Write your first JavaScript code.md new file mode 100644 index 0000000000..b4466dd5ba --- /dev/null +++ b/sources/tech/20210722 Write your first JavaScript code.md @@ -0,0 +1,204 @@ +[#]: subject: (Write your first JavaScript code) +[#]: via: (https://opensource.com/article/21/7/javascript-cheat-sheet) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Write your first JavaScript code +====== +JavaScript was created for the web, but it can do so much more. Learn +the basics, then download our cheat sheet so you always have the details +at hand. +![Code with javascript on white background][1] + +JavaScript is a programming language full of pleasant surprises. Many people first encounter JavaScript as a language for the web. There's a JavaScript engine in all the major browsers, there are popular frameworks such as JQuery, Cash, and Bootstrap to help make web design easier, and there are even programming environments written in JavaScript. It seems to be everywhere on the internet, but it turns out that it's also a useful language for projects like [Electron][2], an open source toolkit for building cross-platform desktop apps with JavaScript. + +JavaScript is a surprisingly multipurpose language with a wide assortment of libraries for much more than just making websites. Learning the basics of the language is easy, and it's a gateway to building whatever you imagine. + +### Install JavaScript + +As you progress with JavaScript, you may find yourself wanting advanced JavaScript libraries and runtimes. When you're just starting, though, you don't have to install JavaScript at all. All major web browsers include a JavaScript engine to run the code. You can write JavaScript using your favorite text editor, load it into your web browser, and see what your code does. + +### Get started with JavaScript + +To write your first JavaScript code, open your favorite text editor, such as [Notepad++][3], [Atom][4], or [VSCode][5]. Because it was developed for the web, JavaScript works well with HTML, so first, just try some basic HTML: + + +``` +<[html][6]> +  <[head][7]> +    <[title][8]>JS</[title][8]> +  </[head][7]> +  <[body][9]> +    <[p][10] id="example">Nothing here.</[p][10]> +  </[body][9]> +</[html][6]> +``` + +Save the file, and then open it in a web browser. + +![HTML displayed in browser][11] + +(Seth Kenlon, [CC BY-SA 4.0][12]) + +To add JavaScript to this simple HTML page, you can either create a JavaScript file and refer to it in the page's `head` or just embed your JavaScript code in the HTML using the `