Merge branch 'master' of https://github.com/LCTT/TranslateProject into translating

This commit is contained in:
geekpi 2022-08-12 08:35:14 +08:00
commit 051c134074
11 changed files with 1717 additions and 30 deletions

View File

@ -3,27 +3,28 @@
[#]: author: "Bala Kalavala https://www.opensourceforu.com/author/bala-kalavala/"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14918-1.html"
人工智能、机器学习和深度学习:有什么区别?
人工智能AI、机器学习ML和深度学习DL:有什么区别?
======
我们经常交替使用人工智能、机器学习和深度学习这些术语,尽管我们几乎每天都阅读或听到它们。本文解释了这些技术是如何演变的以及它们有何不同。
> 我们经常交替使用人工智能AI、机器学习ML和深度学习DL这些术语尽管我们几乎每天都阅读或听到它们。本文解释了这些技术是如何演变的以及它们有何不同。
![AI ML and DL Whats the Difference][1]
人工智能 (AI)、机器学习 (ML) 和深度学习 (DL) 通常可以互换使用。但是,它们并不完全相同。人工智能是最广泛的概念,它赋予机器模仿人类行为的能力。机器学习是将人工智能应用到系统或机器中,帮助其自我学习和不断改进。最后,深度学习使用复杂的算法和深度神经网络来重复训练特定的模型或模式。
<ruby>人工智能<rt>Artificial Intelligence</rt></ruby>AI<ruby>机器学习<rt>Machine Learning</rt></ruby>ML<ruby>深度学习<rt>Deep Learning</rt></ruby>DL通常可以互换使用。但是,它们并不完全相同。人工智能是最广泛的概念,它赋予机器模仿人类行为的能力。机器学习是将人工智能应用到系统或机器中,帮助其自我学习和不断改进。最后,深度学习使用复杂的算法和深度神经网络来重复训练特定的模型或模式。
让我们看看每个术语的演变和历程,以更好地理解人工智能、机器学习和深度学习实际指的是什么。
#### 人工智能
自过去 70 多年以来,人工智能已经取得了长足的进步,它渗透到我们生活的方方面面,无论我们是否知道,也不管喜欢与否。在过去十年中,机器学习和深度学习的进步已经在各种规模的行业和组织中创造了人工智能热潮。云服务提供商通过开发免费的开源服务和提供新的场景来增加势头。
自过去 70 多年以来,人工智能已经取得了长足的进步。无论我们是否知道,也不管喜欢与否,,它已经渗透到了我们生活的方方面面。在过去十年中,机器学习和深度学习的进步已经在各种规模的行业和组织中创造了人工智能热潮。云服务提供商通过开发免费的开源服务和提供新的场景进一步推动的这种势头。
![Figure 1: Overview of AI, ML and DL][2]
人工智能可能是自 1956 年以来最受关注的概念。到 2015 年GPU 的广泛使用使并行处理更快、更强大、更便宜。更便宜的选择导致大数据的大量存储(纯文本到图像、映射等)。这产生了对数据分析的需求,更普遍地称为数据科学,导致机器学习发展为实现人工智能的方法。
人工智能可能是自 1956 年以来最受关注的概念。到 2015 年GPU 的广泛使用使并行处理更快、更强大、更便宜。而愈加廉价的存储可以大规模地存储大数据(从纯文本到图像、映射等)。这产生了对数据分析的需求,它被更普遍地称为<ruby>数据科学<rt>data science</rt></ruby>,导致机器学习发展为实现人工智能的方法。
#### 机器学习
@ -35,13 +36,13 @@
#### 深度学习
深度学习是神经网络和机器学习的进化,是人工智能社区的创意。它了人类思维在特定场景中的工作方式然后在这项工作上比人类做得更好例如IBM 的 Watson 与自己下国际象棋,并在游戏中取得了很大进步,最终击败了世界冠军。谷歌的 AlphaGo 也学会了如何玩围棋游戏,一遍又一遍地玩它以提高自己,并成为冠军。
深度学习是神经网络和机器学习的进化,是人工智能社区的创意。它学习了人类思维在特定场景中的工作方式然后在这项工作上比人类做得更好例如IBM 的 Watson 与自己下国际象棋,并在游戏中取得了很大进步,最终击败了世界冠军。谷歌的 AlphaGo 也学会了如何玩围棋游戏,一遍又一遍地玩它以提高自己,并成为冠军。
人工智能、机器学习和深度学习正在不断发展。参与数据科学的每个人都希望推进这些概念以改善我们的日常生活。好在开源社区、私营企业、科学家和政府机构都在为此共同努力。
人工智能、机器学习和深度学习正在不断发展。参与数据科学的每个人都希望推进这些概念以改善我们的日常生活。开源社区、私营企业、科学家和政府机构都在为此共同努力。
![Figure 3: Types of AI, ML and DL][4]
总而言之,虽然 AI 有助于创建智能机器,但机器学习有助于构建 AI 驱动的应用。 深度学习是机器学习的一个子集。它通过利用复杂算法处理大量数据来训练特定模型。由于狭义 AI 极难开发,机器学习正在通过刚性计算解决这一领域的机遇。 至少对于实现通用 AI深度学习有助于将 AI 和机器学习结合在一起。
总而言之,虽然 AI 有助于创建智能机器,但机器学习有助于构建 AI 驱动的应用。深度学习是机器学习的一个子集。它通过利用复杂算法处理大量数据来训练特定模型。由于狭义 AI 极难开发,机器学习正在通过刚性计算解决这一领域的机遇。至少对于实现通用 AI深度学习有助于将 AI 和机器学习结合在一起。
--------------------------------------------------------------------------------
@ -50,7 +51,7 @@ via: https://www.opensourceforu.com/2022/08/ai-ml-and-dl-whats-the-difference/
作者:[Bala Kalavala][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -3,34 +3,30 @@
[#]: author: "Agil Antony https://opensource.com/users/agantony"
[#]: collector: "lkxed"
[#]: translator: "Yufei-Yan"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-14919-1.html"
删除 Git 远程分支的本地引用
删除 Git 远程分支的本地引用
======
遵循几个简单的步骤来保持 Git 仓库的整洁
![](https://img.linux.net.cn/data/attachment/album/202208/11/150612dv5diwgve5k2cobk.jpg)
![A diagram of a branching process][1]
> 遵循几个简单的步骤来保持 Git 仓库的整洁
Image by: Opensource.com
图片来源Opensource.com
在合并一个 GibLab 或 GitHub 的 pull request 后,通常需要从远程仓库中删掉这个主题分支来保持仓库的整洁。然而,这只会删掉远程仓库的主题分支。本地 Git 仓库也会从例行清理中收益。
在合并一个 GibLab 的合并请求MR或 GitHub 的拉取请求PR你通常需要从远程仓库中删掉这个主题分支来保持仓库的整洁。然而这只会删掉远程仓库的主题分支。本地 Git 仓库也会从例行清理中收益。
要同步本地仓库和远程仓库的信息,可以执行 `git prune` 命令来删除本地仓库中远程分支的本地引用。
按照以下三个简单的步骤:
### 1. 检出仓库中的核心分支(比如 main 或者 master
1、检出仓库中的核心分支比如 `main` 或者 `master`
```
$ git checkout <central_branch_name>
```
### 2. 列出所有远程和本地分支
2、列出所有远程和本地分支
```
$ git branch -a
@ -48,7 +44,7 @@ $ git branch -a
在这个例子中,`test-branch` 是从远程仓库中删除的主题分支的名字。
### 3. 删除远程分支的本地引用
3、删除远程分支的本地引用
首先,列出所有可以从本地仓库中删除的分支:
@ -82,9 +78,9 @@ URL: git@example.com:myorg/mydata-4.10.git
### 维护 Git 仓库
保持 Git 仓库的整洁,一开始似乎并不紧急,但是随着仓库规模的增长,删除不必要的数据就变得更为重要。不要因为需要从无用的数据中挣脱出来而降低你的节奏
保持 Git 仓库的整洁,一开始似乎并不紧急,但是随着仓库规模的增长,删除不必要的数据就变得更为重要。不要让从无用的数据筛选而拖慢你
经常删除远程分支的本地引用,对于维护一个可用的 Git 仓库是一个非常好的习惯
经常删除远程分支的本地引用,是维护一个可用的 Git 仓库是一个好方法
--------------------------------------------------------------------------------
@ -92,8 +88,8 @@ via: https://opensource.com/article/22/8/delete-local-reference-remote-branch-gi
作者:[Agil Antony][a]
选题:[lkxed][b]
译者:[https://github.com/Yufei-Yan](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[Yufei-Yan](https://github.com/Yufei-Yan)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,72 @@
[#]: subject: "Cutefish OS Development Restarts with A Revised Vision"
[#]: via: "https://www.debugpoint.com/cutefish-development-restarts/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Cutefish OS Development Restarts with A Revised Vision
======
After a month of possible discussions, talks and threads, Cutefish OS officially restarts its development.
A while back, I wrote that [Cutefish OS stopped development][1], and there is no activity on GitHub. Well, it looks like the developers resurrected the project on GitHub with some vision of the future of the OS.
On July 31st, the main GitHub repo of Cutefish OS is updated with the following:
> Your Favorite CutefishOS are back nowNew website in the works (coming soon)
Not only that, but the team also gave a brief about the roadmap of this project.
![Cutefish OS - Application Menu][2]
### Cutefish OS Development Upcoming Milestones
Firstly, the primary object is the official website preparation.
Secondly, the next release would probably be based on [Ubuntu 22.04 LTS][3], as per the note on GitHub. Cutefish OS was available with different spins, such as Ubuntu and Debian. Also, you could install only the [Cutefish Desktop in Arch Linux][4].
Thirdly, the team aims to assess current issues and start accepting pull requests. After completing this exercise, it would be easier to prioritize the items that needed fixing. And finally, planning for the new features for future releases.
Not only that but there is also a possibility of a new Cutefish flavour with openEuler Linux. The [openEuler Linux][5] is a distribution created by Huawei for commercial and enterprise uses.
![Current Cutefish OS Plan][6]
### A New Name?
When I was looking for additional information, I found that the team registered a new domain with a new name, i.e. [openfish.org][7]. The desktop environment or entire OS would be renamed to openfish. Its just a guess from my side at this point.
The old domain cutefishos.com was probably taken over by someone else, hence the decision.
But, in my opinion, “openfish” is a better branding name than “cutefish”.
### Whats Next
The last version of version 0.8 had several issues related to the Keyboard, settings windows, Flatpak apps, etc. The best way is to fix those as a first step with the last baseline. Then probably a version 1.0 with additional features.
Hopefully, we will get to see more updates on the development in the coming weeks. If you want to be heard and ask about expectations or feature requests, [create a post on GitHub][8].
Welcome back, Cutefish OS.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/cutefish-development-restarts/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/cutefish-os-development-halts/
[2]: https://www.debugpoint.com/wp-content/uploads/2021/11/Cutefish-OS-Application-Menu-1024x582.jpg
[3]: https://www.debugpoint.com/web-stories/ubuntu-22-04-review/
[4]: https://www.debugpoint.com/cutefish-arch-linux-install/
[5]: https://www.openeuler.org/en/
[6]: https://www.debugpoint.com/wp-content/uploads/2022/08/Current-Cutefish-OS-Plan.jpg
[7]: http://openfish.org/
[8]: https://github.com/cutefishos/cutefishos/issues

View File

@ -0,0 +1,98 @@
[#]: subject: "Kali Linux 2022.3 Introduces a Test Lab Environment and New VirtualBox Image"
[#]: via: "https://news.itsfoss.com/kali-linux-2022-3-release/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Kali Linux 2022.3 Introduces a Test Lab Environment and New VirtualBox Image
======
Kali Linux is back with exciting additions for its third upgrade in 2022.
As usual, you can expect new tools and refinements across the board. In addition, there are a few key highlights, including a **new test lab environment** and a **VirtualBox image**.
Here, let me give you more details on the release.
### Kali Linux 2022.3: Whats New?
Kali Linux 2022.3 release marks the start of their **new Discord server**, allowing the community to get together and chat all about Kali Linux.
Along with the community getting a Discord server, things that should grab your attention for the upgrade include:
* **A new test lab environment for easy testing.**
* **Opening kali-tools repository for community submissions.**
* **New releases in NetHunter store.**
* **A new VirtualBox image format.**
* **Bunch of new tools.**
### Test Lab Environment
Kali Linux is tailored for security researchers to test and learn. But, to enhance the experience and make it effortless for anyone to build a test lab, Kali Linux now adds easy-to-install packages like [DVWA][1], and [Juice Shop][2].
The developers also mention that there will be more packages available in the near future.
### New Tools
The new upgrade includes five interesting tools, they are:
* **BruteShark** (Network Analysis Tool)
* **DefectDojo** (Open-source application vulnerability)
* **phpsploit** (Stealth post-exploitation framework)
* **shellfire** (Exploiting command injection vulnerabilities)
* **SprayingToolkit** (Password attacks)
You can explore the tools to learn more about it.
### Enhanced VirtualBox Support
While Kali Linux was already available for VMware and VirtualBox, we now have a new image format for VirtualBox users.
You can now download a **VDI** disk image and a **.vbox** metadata file for VirtualBox. It is the native format for VirtualBox images, and faster to download, considering a better compression ratio.
For users looking to be on the latest and greatest, Kali Linux has made **weekly builds of VM images available**, built from its rolling branch.
Additionally, if you need to build your custom VM images, Kali Linux has made some scripts available on [GitLab][3].
### Other Improvements
Kali Linux 2022.3 adds several significant upgrades to the table. Some include:
* Linux Kernel 5.15 update for Raspberry Pi devices.
* Technical improvements for ARM devices.
* Documentation updates with new pages.
* Maintenance work for network repository.
* Numerous updates to the NetHunter store along with imminent Android 12 support.
### Download Kali Linux 2022.3
You can find the latest Kali Linux 2022.3 ISO on its [official download page][4], along with the new VirtualBox image file and weekly update packages.
[Kali Linux 2022.3][5]
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/kali-linux-2022-3-release/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://www.kali.org/tools/dvwa/
[2]: https://www.kali.org/tools/juice-shop/
[3]: https://gitlab.com/kalilinux/build-scripts/kali-vm
[4]: https://www.kali.org/get-kali/
[5]: https://www.kali.org/get-kali/#kali-platforms

View File

@ -0,0 +1,294 @@
[#]: subject: "What is the Difference Between macOS and Linux?"
[#]: via: "https://itsfoss.com/mac-linux-difference/"
[#]: author: "Ankush Das https://itsfoss.com/author/ankush/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
What is the Difference Between macOS and Linux?
======
We often[compare Linux with Windows][1], but what about comparing it with macOS?
While the differences between Linux and Windows are quite obvious, Linux and macOS may seem similar to many.
Both can run Unix commands in the terminal, and the user experience is vastly different from Windows. And not all Windows applications and games are available for macOS and Linux.
This is why some people even think Apples macOS is based on Linux. But that is not the case. macOS is not Linux despite the similarities.
There are plenty of differences between the two UNIX-like operating systems and I shall highlight both the similarities and the differences in this article.
So, lets compare Apple and Orange Penguin.
### macOS vs. Linux: Origins
macOS has a fascinating history. The foundation of it was built by Steve Jobss NeXT computer company when he wasnt at Apple. Technically, it was based on the [Mach Kernel][2] and the UNIX-derived BSD.
Back then, a [NeXTSTEP][3] operating system was created to power the devices/computers built by **NeXT**. While it got some attention, it wasnt a big success. Apple later acquired NeXT and brought back Steve onboard as part of the deal, making NeXTSTEP OS the base for macOS.
This is why macOS has a combination of Unix components along with Apples proprietary technologies.
**On the contrary**, Linux (the kernel) was built as a free and open-source replacement for Unix.
Linux is not an operating system but needs different components like [desktop environments][4] to form an operating system. There are [hundreds of Linux-based operating systems][5] called distributions.
For simplicity, we tend to address it as **Linux** OS instead of a specific Linux distribution.
### macOS kernel vs Linux kernel
The macOS kernel is officially known as XNU. The [acronym][6] stands for “XNU is Not Unix.” According to [Apples Github page][7], XNU is “a hybrid kernel combining the Mach kernel developed at Carnegie Mellon University with components from FreeBSD and C++ API for writing drivers”. The BSD subsystem part of the code is [“typically implemented as user-space servers in microkernel systems”][8]. The Mach part is responsible for low-level work, such as multitasking, protected memory, virtual memory management, kernel debugging support, and console I/O.
While the macOS kernel combines the feature of a microkernel ([Mach][9])) and a monolithic kernel ([BSD][10]), Linux is solely a monolithic kernel. A [monolithic kernel][11] is responsible for managing the CPU, memory, inter-process communication, device drivers, file system, and system server calls.
### Heres What They Have in Common
macOS utilizes Unix components, and Linux was built as an alternative to Unix. So, what do we have in common here?
Both give access to **Unix commands, bash/zsh, and other shells**.
The [default shell][12] can be different, but you can always change it as per your preferences.
Thats about it. I cant think of anything else similar between the two.
Probably a decade back, we could say that both Linux/macOS offered fewer applications.
But thats not the case anymore.
The software ecosystem and game support for both have evolved over the years, which we will discuss later in this article.
### Codebase: Proprietary vs. Open-Source
![open source proprietary illustration][13]
macOS is a proprietary operating system, meaning you cannot view the complete operating systems source code.
Sure, you have [part of the macOS (mostly GNU) libraries source code available][14]. There is also the [XNU kernel code][15] used in the development of macOS and iOS operating systems. But [you cannot just take this code and build a macOS clone][16] to be installed on any hardware.
Its not the end of the world without the source code, but you get **less transparency** on Apples claims and practices to secure and enhance your computer experience.
Some might argue that proprietary code remains hidden for security reasons. However, both proprietary and open-source software remain vulnerable to threats.
**The difference between them** is: that open-source software often gets fixed sooner because of community participation by several developers, compared to limited employees working on macOS.
Unless you trust Apple without questions, Linuxs open-source model gets an edge.
### Purpose and Usage: macOS vs. Linux
macOS is tailored for desktop and laptop usage. It is well-suited for **video editing, graphics designing, and audio editing**.
When it comes to Linux, you get a host of possibilities. You can use Linux for:
* Desktop
* Toaster (yes! I hope you know about [IoT][17])
* Single Board Computers
* Server
Of course, it is not the same experience when using it on various platforms, but Linux can run for various use-cases.
So, if you like Linux, you can choose to continue using it on other platforms for a comfortable experience.
### macOS vs Linux: User Experience
When it comes to user experience, it comes down to personal preferences.
macOS offers a **pleasing user interface**. It is visually appealing with subtle animations and high-resolution wallpapers/icons.
![macOS Monterey][18]
You can expect an easy and seamless experience across the platform.
With Linux, you can get an equally pleasing user interface that is easy to use.
![Zorin OS 16 Pro][19]
**Unfortunately**, the user experience slightly varies because of the distribution you decide to install and the desktop environment it comes along with.
You can explore some of the [best desktop environments][20] listed. You can even opt for [macOS-like Linux distributions][21].
For instance, if you are using **Pop!_OS, Ubuntu, Zorin OS, or elementary OS**, you could have an excellent user experience.
![Pop!_OS 22.04 LTS][22]
If you end up using something like MX Linux, or different, the user experience may not be comparable to macOS.
![MX Linux][23]
Overall, the out-of-the-box experience with Linux is inconsistent, but it is capable enough if you know what you are doing.
And if you are coming from Windows, the interface could be confusing initially.
### Customizability
![customizability][24]
If you want an operating system that lets you tinker with every aspect of it, macOS is not for you.
While Apples designs could be aesthetically pleasing by default, not everyone likes them.
If you want to personalize, take control, and heavily customize the operating systems nuts and bolts, Linux should be the perfect pick.
You can choose to customize the user interface as much as you want, with a wide range of different elements, and go wild with your preferences. To get started, look at our [KDE customization][25] guide to explore the possibilities.
While that is good, it could backfire when customizing things on a Linux system. So, you need to learn/explore what you want to customize.
### Hardware Requirements to run macOS vs Linux
![hardware illustration][26]
This is where macOS suffers a solid defeat.
If you want access to macOS and have a good experience with it, you need to purchase Apple hardware, which is costly.
For example, the base configurations for macOS-powered laptops start with **8 GB of RAM** and **256 GB of storage**, available for **$1200** or more.
Unless you want to constantly use the swap space for multitasking and already have a cloud storage space, it would be a terrible idea to get one for yourself.
In contrast, if you would rather not spend a lot but still want a decent configuration for your system (PC/laptop), it is easy to get a device with 16 GB RAM + 512 GB SSD to run Linux for around 800 USD.
**A personal note**: Im used to 32 Gigs of RAM + 500 GB of SSD storage. To get that kind of multitasking headroom (without using the swap), I will have to pay a premium to Apple.
Some skilled tinkerers try running macOS on non-Apple hardware. Such a system is called [Hackintosh][27] but it is certainly nowhere close to the comfort of running Linux on a regular computer.
### Software Ecosystem
macOS offers a **top-notch native experience** with macOS-exclusive applications or tools made by Apple.
Yes, you may have to purchase those applications. However, unlike some subscription options, you get one-time purchase alternatives with macOS for professional applications.
![Final Cut Pro on macOS][28]
For users who want to design, edit videos, edit photos, and have a creative workflow, macOSs software suite should be a great choice if you do not mind investing in it.
The free Apple tools like iMovie, Keynote, etc. are good themselves. Couple them with premium tools like Final Cut Pro, Affinity Designer, and more and you get world-class editing experience. Not to forget that creative tools like Adobe are also available on macOS.
Additionally, Apple has strict guidelines for applications available for its platform that enhance the native experience with third-party apps (free or paid).
This is why many designers and editors prefer using macOS over any other operating systems.
For the Linux platform, you have **great FOSS alternatives** to some macOS-only apps. Unless you like or have experience with macOS-specific applications, you should not have trouble with software available for Linux.
![kdenlive editor][29]
The native app experience depends on the Linux distribution you use.
![Planner (To-do list app for Linux)][30]
It may not be as seamless as macOS, but if you are not a professional-grade video/graphics editor, you should not have any issues.
### Gaming on Linux and macOS
![gaming illustration][31]
While Apples making good progress on making its new M1/M2 chips as capable as possible, macOS currently has poor support for games.
A handful of games work, and most arent supported officially. To be honest, investing in a Mac for gaming is not what it is for.
Regarding Linux, numerous AAA games and Indie titles work fine. Sure, there are some hiccups with certain games. But, with Valves push towards official game support for Steam Deck, even the latest releases like “**Spider-Man: Remastered**” are Steam Deck verified.
Ultimately, helping improve the game support for the Linux platform.
Additionally, considering that the PC graphics card market is almost back to normal (near or below MSRP), you can get a sweet PC build or laptop without worrying about performance bottlenecks.
Would you spend upwards of **$1800 for a Mac with 16 GB of RAM and 512 GB of SSD** or get a PC/laptop with 32 GB RAM (or more), and at least 1 TB SSD (or more)?
Thats your call.
### Package Manager
![package manager illustration new][32]
A package manager helps you quickly find, install, and remove software in your operating system.
Linux has been the superior force in package management compared to anything out there.
You get options like [Flatpak][33], [Snap][34], [Synaptic][35], and more out of the box.
But, Mac users do not have anything to rely on by default. Fortunately, an option like [Homebrew][36] makes life easier for macOS users.
It also supports Linux. So, you can use it across multiple devices to make things easy.
### Operating System Updates
![software update illustration][37]
Apple does not share specific timelines for software updates to the operating system.
For instance, **macOS Ventura** (the upcoming version upgrade at the time of writing) suddenly ditched all the Mac devices before 2017.
Interestingly, the previous operating system versions had average support for about **seven years**, but with newer changes, it seems to be about **five** now.
With Apple silicons, it may not be a straightforward answer. But, it is safe to assume at least 4-5 years of software support.
Linux gives you options. If you want a stable operating system without feature upgrades but focused on maintenance and security, [LTS editions][38] of Linux distributions give you up to **five years** of updates for free. This is primarily true for [Ubuntu][39] or Ubuntu-based distributions like Linux Mint.
Furthermore, theres a subscription plan for Ubuntu, where you can continue receiving security updates for up to **10 years**.
And, it does not end there; you can also opt for [rolling-release distributions][40] that get constant bleeding-edge updates with no timeline for an end. As long as your hardware is competent enough, you should be able to update the operating system with no issues.
### macOS vs. Linux: What Should You Pick?
macOS can be well worth the price tag if you need it.
It is not an easy recommendation for users who just need to surf the web, send emails, and perform some tasks that are possible on any platform.
macOS remains a niche pick.
However, Linux has improved to become a usable choice for former Windows/macOS users, computer science students, developers, creative professionals (like us) and a wide range of potential users.
There are many reasons to pick Linux over macOS, but not the other way around (I think). What are your thoughts on macOS vs. Linux? You are welcome to share your thoughts in the comments down below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/mac-linux-difference/
作者:[Ankush Das][a]
选题:[lkxed][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/lkxed
[1]: https://itsfoss.com/linux-better-than-windows/
[2]: https://en.wikipedia.org/wiki/Mach_(kernel)
[3]: https://en.wikipedia.org/wiki/NeXTSTEP
[4]: https://itsfoss.com/what-is-desktop-environment/
[5]: https://itsfoss.com/what-is-linux/
[6]: https://github.com/apple/darwin-xnu
[7]: https://github.com/apple/darwin-xnu
[8]: http://osxbook.com/book/bonus/ancient/whatismacosx/arch_xnu.html
[9]: https://en.wikipedia.org/wiki/Mach_(kernel
[10]: https://en.wikipedia.org/wiki/FreeBSD
[11]: https://www.howtogeek.com/howto/31632/what-is-the-linux-kernel-and-what-does-it-do/
[12]: https://linuxhandbook.com/change-shell-linux/
[13]: https://itsfoss.com/wp-content/uploads/2022/08/open-source-proprietary-illustration.jpg
[14]: https://opensource.apple.com/releases/
[15]: https://github.com/apple/darwin-xnu
[16]: https://www.techrepublic.com/article/why-apple-open-sourcing-mac-os-x-isnt-terribly-exciting/
[17]: https://www.ibm.com/blogs/internet-of-things/what-is-the-iot/
[18]: https://itsfoss.com/wp-content/uploads/2022/08/macos-monterey-screenshot.jpg
[19]: https://itsfoss.com/wp-content/uploads/2021/12/zorin-os-16-mac.png
[20]: https://itsfoss.com/best-linux-desktop-environments/
[21]: https://itsfoss.com/macos-like-linux-distros/
[22]: https://itsfoss.com/wp-content/uploads/2022/08/pop-os-screenshot-2022.png
[23]: https://itsfoss.com/wp-content/uploads/2022/07/10.-MX-Linux.jpg
[24]: https://itsfoss.com/wp-content/uploads/2022/08/customizability-illustration.jpg
[25]: https://itsfoss.com/kde-customization/
[26]: https://itsfoss.com/wp-content/uploads/2022/08/hardware-illustration-800x450.jpg
[27]: https://www.freecodecamp.org/news/build-a-hackintosh/
[28]: https://itsfoss.com/wp-content/uploads/2022/08/final-cut-pro-mac.jpg
[29]: https://itsfoss.com/wp-content/uploads/2022/08/kdenlive-editor.jpg
[30]: https://itsfoss.com/wp-content/uploads/2021/08/planner-board-view.png
[31]: https://itsfoss.com/wp-content/uploads/2022/08/gaming-illustration.jpg
[32]: https://itsfoss.com/wp-content/uploads/2022/08/package-manager-illustration-new.jpg
[33]: https://itsfoss.com/what-is-flatpak/
[34]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/
[35]: https://itsfoss.com/synaptic-package-manager/
[36]: https://itsfoss.com/homebrew-linux/
[37]: https://itsfoss.com/wp-content/uploads/2022/07/software-update-illustration.jpg
[38]: https://itsfoss.com/long-term-support-lts/
[39]: https://itsfoss.com/getting-started-with-ubuntu/
[40]: https://itsfoss.com/best-rolling-release-distros/

View File

@ -0,0 +1,229 @@
[#]: subject: "Create beautiful PDFs in LaTeX"
[#]: via: "https://opensource.com/article/22/8/pdf-latex"
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Create beautiful PDFs in LaTeX
======
Use the LaTeX markup language to compose documents.
The LaTeX document preparation system has an interesting history. When programmer Don Knuth wrote his first book, The Art of Computer Programming, in 1968, it was produced using an old-style printing press method. When he published the second edition in 1976, the publisher had moved to modern phototypesetting.
Knuth was unhappy with how the new edition looked. Addressing the problem from a programmer's perspective, Knuth decided to create his own text processing system so his future books could be formatted to look the same way, for every book in the series. And so it was that Don Knuth wrote the first version of TeX in 1978.
A few years later, Leslie Lamport created a set of macros that help authors write complex documents more easily. Lamport's macro extensions, LaTeX, essentially extends TeX to easily produce all kinds of documents. For example, many academic organizations use LaTeX to publish journals and proceedings.
### Writing documents in LaTeX
It's easy to learn the basics of LaTeX by writing a short article. Let's start by borrowing from the [About Opensource.com][4] page to create this sample input file:
```
$ cat about.tex
\documentclass{article}
\begin{document}
Opensource.com is a premier, daily publication focused on
open source and Linux tutorials, stories, and resources.
We're a diverse and inviting group, made up of staff
editors, Correspondents, contributors, and readers. We
value differences in skills, talents, backgrounds, and
experiences. There are a few different ways to get involved
as a reader or a writer.
\end{document}
```
Like other document formatting programs, LaTeX collects words and fills paragraphs. That means you can add new text in the middle of a paragraph and not worry about how the final document will look. As long as you don't add a blank line in the middle of a paragraph, LaTeX creates fully justified paragraphs. When it finds a blank line, LaTeX starts a new paragraph.
LaTeX needs a few control statements to define the document. Every LaTeX document should start with a declaration of the document's *class*. LaTeX supports several kinds of documents, including letters, books, and articles. For this example, I used `\documentclass{article}` to set the *article* class.
Tell LaTeX where the text begins and ends with the `\begin{document}` and `\end{document}` statements. If you add text before the `\begin{document}`, LaTeX generates an error. Any text after `\end{document}` is ignored.
Process this document using LaTeX with the `latex` command:
```
$ latex about.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(./about.tex
LaTeX2e <2020-10-01> patch level 4
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
No file about.aux.
[1] (./about.aux) )
Output written on about.dvi (1 page, 736 bytes).
Transcript written on about.log.
```
LaTeX produces a lot of text so you can see what it is doing. If your document contains errors, LaTeX prints a message, and possibly prompt for what it should do. In most cases, you can type `exit` at the prompt to force LaTeX to quit.
If LaTeX was successful in generating a document, it produces a file with a `.dvi` extension. The *DVI* stands for *Device Independent* because you can use a variety of tools to create other kinds of output. For example, the **dvipdf** program converts the DVI file to a PDF file.
```
$ dvipdf about.dvi
```
![LaTeX output][5]
### Adding lists
LaTeX supports two kinds of lists: an *enumerated* list where each item starts with a number, and an *itemized* or "bullet" list. Add a short enumerated list after the second paragraph to list the ways that folks can get involved with Opensource.com:
```
\begin{enumerate}
\item Be a writer
\item Be a reader
\end{enumerate}
```
Similar to how you need to provide `\begin` and `\end` statements around a document definition, you also need to provide `\begin` and `\end` statements around a list. Within the list, start each new item with an `\item` command. When you process this new file with LaTeX and convert it to PDF format, you see your list formatted as a numbered list:
![LaTeX output][6]
You can also add lists within a list. This is a neat feature if you need to provide a list with several options for each item. For example, you can add a few different resources for folks who want to become writers at Opensource.com. The embedded list uses its own `\begin` and `\end` statements. I'll add some extra space around this example so it's easier to see, but LaTeX doesn't really care about the blank lines and extra spaces:
```
\begin{enumerate}
\item Be a writer
  \begin{itemize}
  \item Resources for writers
  \item Contributor Club
  \item Correspondent Program
  \end{itemize}
\item Be a reader
\end{enumerate}
```
The new list is inserted as an embedded list inside item number 1 because you added the list between the two original `\item` statements. You could have instead inserted this list after item number 2 by adding the new list before the `\end{enumerate}` statement.
![LaTeX output][7]
### Sections and subsections
You can make a long document easier to read by breaking it up into sections. To add a section title to a LaTeX document, use the `\section{...}` statement, and write the section's title inside the braces. For example, you can add a new section titled "About Opensource.com" to the top of the document with this:
```
$ head about.tex
\documentclass{article}
\begin{document}
\section{About Opensource.com}
Opensource.com is a premier, daily publication focused on
open source and Linux tutorials, stories, and resources.
We're a diverse and inviting group, made up of staff
editors, Correspondents, contributors, and readers. We
```
The *article* document class adds a number before each major section, and increases the font size so it stands out in the document.
![LaTeX output][8]
For documents that require more organization, you can add subsections using the `\subsection{...}` command. Like the `\section{...}` command, enter the subsection's title between the curly braces.
```
$ head about.tex
\documentclass{article}
\begin{document}
\section{About Opensource.com}
Opensource.com is a premier, daily publication focused on
open source and Linux tutorials, stories, and resources.
\subsection{Welcome to the Opensource.com community}
```
![LaTeX output][9]
### Title and author
Scientific articles meant for publication require a title, author, and publication date. LaTeX provides a method to add this information by inserting commands that define each, then generates the article's title with a separate `\maketitle` command.
Add "About Us" as the article's title, "Opensource.com Editors" for the author, and "July 10, 2022" as the publication date. You must enter this block after the `\begin{document}` and before the rest of the content, such as the first section:
```
\title{About Us}
\author{Opensource.com Editors}
\date{July 10, 2022}
\maketitle
```
When you process the document, LaTeX adds the title, author, and date to the top of the artcle:
![LaTeX output][10]
### Adding emphasis
Scientific and other technical documents often include terms and phrases that need to carry special emphasis. LaTeX provides several font effects you can use in technical documents, including emphasis text (usually displayed in italics), bold text, and small caps.
Update your LaTeX document to put the phrase "staff editors, Correspondents, contributors, and readers" in italics text, and the specific words "reader" and "writer" later in the paragraph in emphasis text. You can also put the phrase "skills, talents, backgrounds, and experiences" in bold. And while it's not the correct way to style it, you can use small caps to type "Linux."
```
$ head -20 about.tex
\documentclass{article}
\begin{document}
\title{About Us}
\author{Opensource.com Editors}
\date{July 10, 2022}
\maketitle
\section{About Opensource.com}
Opensource.com is a premier, daily publication focused on
open source and \textsc{Linux} tutorials, stories, and resources.
\subsection{Welcome to the Opensource.com community}
We're a diverse and inviting group, made up of \textit{staff
editors, Correspondents, contributors, and readers}. We
value differences in \textbf{skills, talents, backgrounds, and
experiences}. There are a few different ways to get involved
as a \emph{reader} or a \emph{writer}.
```
This sample shows different ways to apply different styles to text. When you need to add emphasis, use the `\emph{...}` command, with the word or phrase between the curly braces. To display text in italics, boldface, or small caps, use a variation of the `\text` command: `\textit{...}` for italics, `\textbf{...}` for boldface, and `\textsc{...}` for small caps. LaTeX supports lots of other ways to style text, but these styles get you pretty far in writing scientific documents.
![LaTeX output][11]
### Using LaTeX
I've only touched on a few ways to write scientific and technical documents in LaTeX. Depending on your needs, you can also use LaTeX to insert footnotes and typeset mathematical equations and expressions. To explore other ways to use LaTeX for scientific writing, also read [A introduction to creating documents in LaTeX][12] here on Opensource.com.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/8/pdf-latex
作者:[Jim Hall][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jim-hall
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/coffee_tea_laptop_computer_work_desk.png
[2]: https://unsplash.com/@jonasleupe?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[3]: https://unsplash.com/s/photos/tea-cup-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[4]: https://opensource.com/about
[5]: https://opensource.com/sites/default/files/2022-08/latex-output.jpg
[6]: https://opensource.com/sites/default/files/2022-08/latex-output-list.jpg
[7]: https://opensource.com/sites/default/files/2022-08/latex-output-list-2.jpg
[8]: https://opensource.com/sites/default/files/2022-08/latex-output-heading.jpg
[9]: https://opensource.com/sites/default/files/2022-08/latex-output-subheading.jpg
[10]: https://opensource.com/sites/default/files/2022-08/latex-output-about.jpg
[11]: https://opensource.com/sites/default/files/2022-08/latex-output-emphasis.jpg
[12]: https://opensource.com/article/17/6/introduction-latex

View File

@ -0,0 +1,269 @@
[#]: subject: "Hibernation in Fedora Workstation"
[#]: via: "https://fedoramagazine.org/hibernation-in-fedora-36-workstation/"
[#]: author: "Alexander Wellbrock https://fedoramagazine.org/author/w4tsn/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Hibernation in Fedora Workstation
======
![][1]
Photo by [Beth Jnr][2] on [Unsplash][3]
This article walks you through the manual setup for hibernation in Fedora Linux 36 Workstation using BTRFS and is based on a [gist by eloylp on github][4].
### Goal and Rationale
Hibernation stores the current runtime state of your machine effectively the contents of your RAM, onto disk and does a clean shutdown. Upon next boot this state is restored from disk to memory such that everything, including open programs, is how you left it.
Fedora Workstation uses ZRAM. This is a sophisticated approach to swap using compression inside a portion of your RAM to avoid the slower on-disk swap files. Unfortunately this means you dont have persistent space to move your RAM upon hibernation when powering off your machine.
### How it works
The technique configures _systemd_ and _dracut_ to store and restore the contents of your RAM in a temporary swap file on disk. The swap file is created just before and removed right after hibernation to avoid trouble with ZRAM. A persistent swap file is not recommended in conjunction with ZRAM, as it creates some confusing problems compromising your systems stability.
### A word on compatibility and expectations
Hibernation following this guide might not work flawless on your particular machine(s). Due to possible shortcomings of certain drivers you might experience glitches like non-working wifi or display after resuming from hibernation. In that case feel free to reach out to the comment section of the [gist on github][4], or try the tips from the troubleshooting section at the bottom of this article.
The changes introduced in this article are linked to the systemd hibernation.service and hibernation.target units and hence wont execute on their own nor interfere with your system if you dont initiate a hibernation. That being said, if it does not work it still adds some small bloat which you might want to remove.
### Hibernation in Fedora Workstation
The first step is to create a btrfs sub volume to contain the swap file.
```
$ btrfs subvolume create /swap
```
In order to calculate the size of your swap file use _swapon_ to get the size of your _zram_ device.
```
$ swapon
NAME TYPE SIZE USED PRIO
/dev/zram0 partition 8G 0B 100
```
In this example the machine has 16G of RAM and a 8G zram device. ZRAM stores roughly double the amount of system RAM compressed in a portion of your RAM. Let that sink in for a moment. This means that in total the memory of this machine can hold 8G * 2 + 8G of RAM which equals 24G uncompressed data. Create and configure the swapfile using the following commands.
```
$ touch /swap/swapfile
# Disable Copy On Write on the file
$ chattr +C /swap/swapfile
$ fallocate --length 24G /swap/swapfile
$ chmod 600 /swap/swapfile
$ mkswap /swap/swapfile
```
Modify the dracut configuration and rebuild your initramfs to include the
resume
module, so it can later restore the state at boot.
```
$ cat <<-EOF | sudo tee /etc/dracut.conf.d/resume.conf
add_dracutmodules+=" resume "
EOF
$ dracut -f
```
In order to configure grub to tell the kernel to resume from hibernation using the swapfile, you need the UUID and the physical offset.
Use the following command to determine the UUID of the swap file and take note of it.
```
$ findmnt -no UUID -T /swap/swapfile
dbb0f71f-8fe9-491e-bce7-4e0e3125ecb8
```
Calculate the correct offset. In order to do this youll unfortunately need _gcc_ and the [source of the btrfs_map_physical tool][5], which computes the physical offset of the swapfile on disk. Invoke gcc in the directory you placed the source in and run the tool.
```
$ gcc -O2 -o btrfs_map_physical btrfs_map_physical.c
$ ./btrfs_map_physical /path/to/swapfile
FILE OFFSET EXTENT TYPE LOGICAL SIZE LOGICAL OFFSET PHYSICAL SIZE DEVID PHYSICAL OFFSET
0 regular 4096 2927632384 268435456 1 <4009762816>
4096 prealloc 268431360 2927636480 268431360 1 4009766912
268435456 prealloc 268435456 3251634176 268435456 1 4333764608
536870912 prealloc 268435456 3520069632 268435456 1 4602200064
805306368 prealloc 268435456 3788505088 268435456 1 4870635520
1073741824 prealloc 268435456 4056940544 268435456 1 5139070976
1342177280 prealloc 268435456 4325376000 268435456 1 5407506432
1610612736 prealloc 268435456 4593811456 268435456 1 5675941888
```
The first value in the _PHYSICAL OFFSET_ column is the relevant one. In the above example it is **4009762816**.
Take note of the _pagesize_ you get from _getconf PAGESIZE_.
Calculate the kernel _resume_offset_ through division of _physical offset_ by the _pagesize_. In this example that is _4009762816 / 4096 = 978946_.
Update your grub configuration file and add the _resume_ and _resume_offset_ kernel cmdline parameters.
```
grubby --args="resume=UUID=dbb0f71f-8fe9-491e-bce7-4e0e3125ecb8 resume_offset=2459934" --update-kernel=ALL
```
The created _swapfile_ is only used in the hibernation stage of system shutdown and boot hence not configured in _fstab_. Systemd units control this behavior, so create the two units _hibernate-preparation.service_ and _hibernate-resume.service_.
```
$ cat <<-EOF | sudo tee /etc/systemd/system/hibernate-preparation.service
[Unit]
Description=Enable swap file and disable zram before hibernate
Before=systemd-hibernate.service
[Service]
User=root
Type=oneshot
ExecStart=/bin/bash -c "/usr/sbin/swapon /swap/swapfile && /usr/sbin/swapoff /dev/zram0"
[Install]
WantedBy=systemd-hibernate.service
EOF
$ systemctl enable hibernate-preparation.service
$ cat <<-EOF | sudo tee /etc/systemd/system/hibernate-resume.service
[Unit]
Description=Disable swap after resuming from hibernation
After=hibernate.target
[Service]
User=root
Type=oneshot
ExecStart=/usr/sbin/swapoff /swap/swapfile
[Install]
WantedBy=hibernate.target
EOF
$ systemctl enable hibernate-resume.service
```
Systemd does memory checks on login and hibernation. In order to avoid issues when moving the memory back and forth between _swapfile_ and _zram_ disable some of them.
```
$ mkdir -p /etc/systemd/system/systemd-logind.service.d/
$ cat <<-EOF | sudo tee /etc/systemd/system/systemd-logind.service.d/override.conf
[Service]
Environment=SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1
EOF
$ mkdir -p /etc/systemd/system/systemd-hibernate.service.d/
$ cat <<-EOF | sudo tee /etc/systemd/system/systemd-hibernate.service.d/override.conf
[Service]
Environment=SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1
EOF
```
**Reboot your machine for the changes to take effect**. The following SELinux configuration wont work if you dont reboot first.
SELinux wont like hibernation attempts just yet. Change that with a new policy. An easy although “brute” approach is to initiate hibernation and use the audit log of this failed attempt via _audit2allow_. The following command will fail, returning you to a login prompt.
```
systemctl hibernate
```
After youve logged in again check the audit log, compile a policy and install it. The _-b_ option filters for audit log entries from last boot. The _-M_ option compiles all filtered rules into a module, which is then installed using _semodule -i_.
```
$ audit2allow -b
#============= systemd_sleep_t ==============
allow systemd_sleep_t unlabeled_t:dir search;
$ cd /tmp
$ audit2allow -b -M systemd_sleep
$ semodule -i systemd_sleep.pp
```
Check that hibernation is working via _systemctl hibernate_ again. After resume check that ZRAM is indeed the only active swap device.
```
$ swapon
NAME TYPE SIZE USED PRIO
/dev/zram0 partition 8G 0B 100
```
You now have hibernation configured.
### GNOME Shell hibernation integration
You might want to add a hibernation button to the GNOME Shell “Power Off / Logout” section. Check out the extension [Hibernate Status Button][6] to do so.
### Troubleshooting
A first place to troubleshoot any problems is through _journalctl -b_. Have a look around the end of the log, after trying to hibernate, to pin-point log entries that tell you what might be wrong.
Another source of information on errors is the Problem Reporting tool. Especially problems, that are not common but more specific to your hardware configuration. Have a look at it before and after attempting hibernation and see if something comes up. Follow up on any issues via BugZilla and see if others experience similar problems.
### Revert the changes
To reverse the changes made above, follow this check-list:
* remove the swapfile
* remove the swap subvolume
* remove the dracut configuration and rebuild dracut
* remove kernel cmdline args via _grubby remove-args=_
* disable and remove hibernation preparation and resume services
* remove systemd overrides for _systemd-logind.service_ and _systemd-hibernation.service_
* remove SELinux module via _semodule -r systemd_sleep_
### Credits and Additional Resources
This article is a community effort based primarily on the work of eloylp. As author of this article Id like to make transparent that Ive participated in the discussion to advance the gist behind this but many more minds contributed to make this work. Make certain to check out the [discussion on github][7].
There are already some _ansible_ playbooks and shell scripts to automate the process depicted in this guide. For example check out the shell scripts by [krokwen][8] and [pietryszak][9] or the _ansible_ playbook by [jorp][10]
See the [arch wiki][11] for the full guide on how to calculate the swapfile offset.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/hibernation-in-fedora-36-workstation/
作者:[Alexander Wellbrock][a]
选题:[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/w4tsn/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2022/08/Hibernation_in_Fedora_Workstation-816x345.jpg
[2]: https://unsplash.com/@bthjnr?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[3]: https://unsplash.com/s/photos/late-night-on-the-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[4]: https://gist.github.com/eloylp/b0d64d3c947dbfb23d13864e0c051c67
[5]: https://github.com/osandov/osandov-linux/blob/master/scripts/btrfs_map_physical.c
[6]: https://github.com/arelange/gnome-shell-extension-hibernate-status
[7]: https://gist.github.com/eloylp/b0d64d3c947dbfb23d13864e0c051c67?permalink_comment_id=3889734#gistcomment-3889734
[8]: https://pastebin.com/nLSkaMQZ
[9]: https://github.com/pietryszak/fedora-hibernation
[10]: https://github.com/jorp/fedora_hibernate
[11]: https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Hibernation_into_swap_file_on_Btrfs

View File

@ -0,0 +1,187 @@
[#]: subject: "How to Record Streaming Audio in Ubuntu and other Linux Distributions"
[#]: via: "https://itsfoss.com/record-streaming-audio/"
[#]: author: "Abhishek Prakash https://itsfoss.com/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Record Streaming Audio in Ubuntu and other Linux Distributions
======
How to record audio in Ubuntu and other Linux distributions?
If you want to record a voice over through the microphone of your computer, you can use GNOME Sound recorder or Audacity.
Using GNOME Sound Recorder is easy but it lacks features. Audacity could be overwhelming initially but it has plenty of features for professional level recording. However, I am not going into that detail in this tutorial.
GNOME Sound Recorder works with the microphone. There is another tool called Audio recorder and you can use it to record streaming music (from Sptify, YouTube, internet radio, Skype and most other sources) apart from microphone input.
To summarize, Ill show you the steps:
* To record sound using GNOME Sound Recorder
* To record streaming audio using Audio Recorder
### Using Sound Recorder to record audio from the microphone
GNOME desktop environment has a good variety of useful applications. Sound Recorder is one of them.
You can install the [Sound Recorder][1] from the Ubuntu Software Center.
![Sound Recorder can be installed from the Ubuntu Software Center][2]
Or, you can use this command in the terminal to install it:
```
sudo apt install gnome-sound-recorder
```
Once installed, you can find it in the system menu and start from there.
![GNOME Sound Recorder][3]
Before you start using it, you should ensure that you have the correct input source chosen in the system settings. GNOME Sound Recorder
![Ensure that you have chosen correct input in system settings][4]
Once you open the Sound Recorder application, it will show an interface like the one below.
![Hit the Record button to start audio recording][5]
Hit on the record button and it starts recording audio instantly. While recording, you get options to pause, stop or discord the recording.
![Options while recording audio][6]
Your recordings are saved and available from the application interface itself. Click on the saved recordings to highlight it.
You can replay the recordings or delete it. You can choose to save it to another location by clicking the save/download button. You may also rename the recordings using the edit button.
![Saved recordings][7]
Thats quite convenient, right? You can choose to record in MP3, FLAC and a couple of more formats.
#### Removing GNOME Sound Recorder
Dont like it or find it lacking in terms of features?
You can remove GNOME Sound Recorder from the Ubuntu Software Center or use the following command:
```
sudo apt remove gnome-sound-recorder
```
The application of GNOME Sound recorder is limited. It only records from the microphone and this is not what you would want in certain situations.
Imagin you want to record a Skype call or something which is playing in an application or web browser? The nifty Audio Recorder helps in such cases.
### Using Audio Recorder to record streaming audio
You can watch this video to see how to use Audio Recorder. Its a bit old but the steps are the same.
![A Video from YouTube][8]
[Subscribe to our YouTube channel for more Linux videos][9]
You can use the [official PPA][10] to install Audio Recorder in Ubuntu and Linux Mint. Use the following commands in the terminal (Ctrl+Alt+T) one by one:
```
sudo apt-add-repository ppa:audio-recorder/ppa
sudo apt update
sudo apt install audio-recorder
```
Alternatively, you can download the source code from [launchpad][11]. Once installed, you can start the application from the Activity Overview:
![Audio Recorder][12]
#### Record all kinds of sound from various sources
Audio Recorder records all kinds of sounds your computer makes.
It records audio played through your systems soundcard, microphones, browsers, webcams and more.
In other words, it records even if your system sneezes (given that you want to record it). It allows you to select the recording device such as webcam, microphone, Skype, etc.
To record the streaming music, select the appropriate source. For example, if you are playing streaming radio in Rhythmbox, then select Rythmbox.
![Audio-Recorder Audio Settings][13]
#### Record at your convenience
Audio Recorder also gives you the option of setting timer. You can start, stop or pause recording at a given clock time or at a pre-defined interval. You can also set the limit on the recorded file size.
Moreover, you can pause (and stop) when there is no audio (or very low sound) and resume it when sound comes back.
All you have to do is to edit the text in the Timer panel. Comment out the “rules” you dont want to apply and edit the ones per your requirement.
![Audio-recorder Timer Settings][14]
It provides additional settings like auto start at login, show tray icon and other record settings.
![Audio-recorder Additional Settings][15]
#### Save the recorded music file in various file formats
Another gem. You can save the recorded file in your favourite file format. Supported file formats are OGG audio, Flac, MP3, SPX and WAV. I prefer MP3 for my recordings.
The **recorded files are stored in ~/Audio** i.e., in the Audio folder inside your home directory.
![Audio-recorder Audio Formats][16]
#### How good is Audio Recorder?
I used Audio Recorder in Ubuntu to [record the music played on YouTube][17]. I saved a 2-minute video in MP3 format that took 934 KB of space. But I must say I was not expecting the recorded sound quality to be so good. Honestly, I could not distinguish it from the original YouTube song.
#### Removing Audio Recorder
If you dont find Audio Recorder to your liking, you can remove it using the following commands:
```
sudo apt remove audio-recorder
```
It will be a good idea to [remove the PPA as well][18]:
```
sudo apt-add-repository -r ppa:audio-recorder/ppa
```
### Conclusion
There are probably several other tools for audio recording in Linux. Like GNOME, other desktop environments may also have sound recording apps. I know Deepin has one for sure.
GNOME Sound Recorder is a decent tool for recording sound from your microphone. For recording sound from various sources, Audio Recorder is a good choice.
I hope it helps with your audio recording needs. Let me know if you have any suggestions.
--------------------------------------------------------------------------------
via: https://itsfoss.com/record-streaming-audio/
作者:[Abhishek Prakash][a]
选题:[lkxed][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/
[b]: https://github.com/lkxed
[1]: https://wiki.gnome.org/Apps/SoundRecorder
[2]: https://itsfoss.com/wp-content/uploads/2022/08/sound-recorder-ubuntu.png
[3]: https://itsfoss.com/wp-content/uploads/2022/08/sound-recorder.png
[4]: https://itsfoss.com/wp-content/uploads/2022/08/microphone-settings-ubuntu.png
[5]: https://itsfoss.com/wp-content/uploads/2022/08/using-sound-recorder-linux.png
[6]: https://itsfoss.com/wp-content/uploads/2022/08/sound-recording-with-sound-recorder.png
[7]: https://itsfoss.com/wp-content/uploads/2022/08/sound-recorder-interface.png
[8]: https://youtu.be/o7Ia2QGeB7Q
[9]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
[10]: https://launchpad.net/~audio-recorder/+archive/ubuntu/ppa
[11]: https://launchpad.net/audio-recorder
[12]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-in-overview.png
[13]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-audio-settings.png
[14]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-timer-settings.png
[15]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-additional-settings.png
[16]: https://itsfoss.com/wp-content/uploads/2022/08/audio-recorder-audio-formats.png
[17]: https://itsfoss.com/youtube-dl-audio-only/
[18]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/

View File

@ -0,0 +1,164 @@
[#]: subject: "Our favorite Linux replacements for antiquated open source tools"
[#]: via: "https://opensource.com/article/22/8/replace-antiquated-linux-tools"
[#]: author: "Opensource.com https://opensource.com/users/admin"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Our favorite Linux replacements for antiquated open source tools
======
We asked our community of contributors what open source tools they are using in place of those that feel outdated or antiquated.
Here at [Opensource.com][2], we thought it would be interesting to survey some of our authors to get a feel for what tools they feel are antiquated (but perhaps still useful!) and what they think of the replacement utilities. What follows is a series of responses and a bit of fun, too.
We sent out the following prompt:
* Have you discovered some of your favorite tools have become outdated or deprecated? Or maybe you just switched it up for something new?
* What do you use now? Tell us a little about how you feel it is helpful to have made the switch.
### Firewalls
A biggie for me is iptables. I sweated blood learning how to use iptables, and ebtables, and arptables, and how to manipulate MAC addresses, and more. I built dozens of firewalls around scripts to set up rulesets, and I eventually got pretty good at it. Now nftables makes all that obsolete. The fun never stops. I still think somebody with marketing clout could make software-defined boundaries work. —[Greg Scott][3]
#### +1 on iptables
I have been using iptables since I first learned Linux 25+ years ago. The newest tool is firewalld, but that and all other firewall tools I have seen for Red Hat-based distros are still based on and wrap around the kernel-level netfilter modules. I find the [firewalld][4] tool creates huge sets of rules that don't do anything more for me than the older iptables. I am sure some large environments need those complex rulesets, but they could also be implemented using iptables or scripts like Greg's.
I do like `nmcli`, but it is taking me some time to learn it. In fact, I prefer it to the old `ifcfg` and `ip` commands. It feels more integrated into the system than the older ones. But I do like the older `ifcfg-` interface configuration files. Those are easy to create and understand. They don't require the INI-style format that requires section headers. In fact, the old-style files are not even sequence sensitive. —[David Both][5]
#### ipchains?
To further underscore this example, are you sure you weren't using ipchains back then? (The ipfirewall and ipfwadm successor, ipchains wasn't supplanted by iptables until around 2001.) —[Jeremy Stanley][6]
*In response to Jeremy. ^^*
My very first firewall was ipchains, circa late 1999. Everything after that was iptables. Back then, I had to build my own kernel to get all the netfilter modules I needed. Modern conveniences like flat-panel monitors and DSL were science fiction in those days. And don't even think about fiber. I had to ride a horse uphill through blizzards every day to visit customers. And then it was uphill back home, too. —[Greg Scott][7]
### Text editing
I just have to ask—who's still using troff (groff) and who has moved on to... hmm, shall we say, LibreOffice or AsciiDoctor or...?
I have a dear friend who continues with a troff-based product on his Sun SPARCStation V. —[Chris Hermansen][8]
**[[ Related read Old-school technical writing with groff ]][9]**
#### Editing man pages
*^^ In response to Chris*
Anyone maintaining man pages! Though lots of people are probably generating those from other markup these days. Some folks (like me) do still compose or edit the troff files directly instead. —[Jeremy Stanley][10]
#### Markup stacks
There are always people who use older things, but there are superior tools nowadays. I wouldn't use LibreOffice for the kind of stuff you'd use troff/groff for—if you are writing at that level, you probably depend on a text editor you know well, source-control for managing your inputs, and you are comfortable with markup languages.
That means you want to use a markup stack. There are many, including:
* Sphinx + ReST + GitHub Actions + GitHub Pages
* MkDocs + Markdown + GitLab CI + GitLab Pages
* Nikola + Jupyter Notebooks + Jenkins + (AWS S3 + CloudFront)
What is common to all the stacks is:
* A thing that pulls different input files into one coherent whole (Sphinx/MkDocs/Nikola)
* A reasonably high-level text markup language (ReST/Markdown/MD embedded in Jupyter Notebooks)
* A CI pipeline to transform those into the output format (usually a tree of HTML files, but sometimes a PDF or something)
* A place where people can download the published version (GitHub Pages, GitLab Pages, AWS S3 + CloudFront)
I'll note that these are pretty much orthogonal choices. Any reasonable generator can take any input (even MkDocs, for which it is least true, has the mkdocs-gen-files plugin so you can use Pandoc to convert stuff to Markdown). Any reasonable CI can run any generator and push to any target.
So even with the list above, there are 81 stacks available.
(Sphinx/MkDocs/Nikola) x (ReST/Markdown/Jupyter Notebooks) x (GHA/GitLab CI/Jenkins) x (GHP/GLP/S3+CF)
Because Pandoc understands troff (ms/man), you can plug troff+ms or troff+man into the "markup" slot if you really want to. You can probably install Jenkins on the Sun SPARCStation V and keep using the same machine and format. But why? :)
There's probably an article for OSDC there: "How I converted troff docs to a modern stack using mkdocs+mkdocs-gen-files and GitLab CI." —[Moshe Zadka][11]
#### Other groff examples
Actually, I'm writing an article right now about "Old school technical writing with groff" (part of a larger series I'm writing about tech writing tools). I don't use groff for serious tech writing, but it's in my toolkit of things I learned and will probably never forget. And I review groff when I teach "Writing with Digital Technologies."
While writing the article, I recalled that when I installed Linux in 1993, there weren't *any* writing apps on Linux. No word processors, just groff and LaTeX. I used LaTeX to write my physics lab reports (because it could do math easily) and groff to write papers for other classes (because I could opt to print to a line printer instead, which I thought was a clever way to make my paper look longer). If I wanted to write with a word processor, I had to dual-boot back to DOS to run WordPerfect or Galaxy Write. StarOffice came out for Linux in 1996. I bought StarOffice.
Interestingly, Brian Kernighan still writes all his books in groff. "Unix: A History and a Memoir" (2020) and "Understanding the Digital World" (2021) were both completely processed in groff. —[Jim Hall][12]
### Revisiting the fmt command
I use the `fmt` command a lot these days. It's really handy for a ton of stuff. If you write Readme documentation (or other docs) in plain text, you know the pain when you insert some new text in the middle of a line, and then the lines don't end at the same column. You can run `fmt` to clean that up.
More commonly, I'm on an email list where list members prefer to receive emails in plain text, so my email client is set for plain text most of the time. If I need to reply to someone's list email (and they didn't send it in plain text), a paragraph is usually just one long line, and my email client doesn't correctly line-wrap when I reply. It's just `>` at the start of a long sentence.
So I do this:
```
$ fmt -p '>' > /tmp/f
{copy & paste ">" quoted text}
^D
```
And then:
```
$ cat /tmp/f
```
And then copy and paste the result into my email. —[Jim Hall][13]
### Changes to bootloaders
Just when your *foo* is sufficiently sharp, there are reasonable odds the tools will be replaced.
LILO to GRUB was painful until my GRUB-foo reached a sufficient level. GRUB2 is awesome, but a new learning curve.
Muscle memory is also an issue — `ipconfig`, `nslookup`, and `netstat` are on auto-pilot. Plus, if you're using other Linux environments, like Tiny Core Linux, you might not always have the latest and greatest tools.
Switching from `if-cfg` -style scripts to `nmcli` is the new learning curve, so this never really ends. —[Steven Ellis][14]
**[[ Related read 6 deprecated Linux commands and the tools you should be using instead ]][15]**
### Quick FIPS set up
Often things change for the better; my two cents. The question was asked, *Have you discovered some of your favorite tools have become outdated or deprecated? Or maybe you just switched it up for something new?*
A colleague recently asked me how to enable FIPS on Linux, and it's something I had not done in a while. I remember how arcane this process was, which involved enabling a repo, installing a package (dracut-fips), running commands (`dracut` ) to regenerate initramfs, modifying the GRUB bootloader config file (fips=1), etc.
Also, *What do you use now? Tell us a little about how you feel it is helpful to have made the switch.*
Luckily on RHEL9, the above has been replaced by the `fips-mode-setup` command with two handy flags, `--check` and `--setup`. That's it! Run those commands, reboot the system, and your machine boots up with FIPS enabled. Super easy! —[Gaurav Kamathe][16]
### Old and comfortable
Clearly, both the fun of open source and the strong opinions are still present, as is the variety of tools and the freedom to choose what works best for you. Perhaps these tools and others like them are old—even antiquated—but they may still serve a purpose. Some of these older utilities inspired more modern solutions without losing their own inherent value. Finally, there's something to be said for user comfort and familiarity. With open source, all those hours spent developing your foo need not be lost just because some vendor decided it was time for a new release.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/8/replace-antiquated-linux-tools
作者:[Opensource.com][a]
选题:[lkxed][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/admin
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/GOV_2dot0.png
[2]: https://opensource.com/
[3]: https://opensource.com/users/greg-scott
[4]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd
[5]: https://opensource.com/users/dboth
[6]: https://opensource.com/users/fungi
[7]: https://opensource.com/users/greg-scott
[8]: https://opensource.com/users/clhermansen
[9]: https://opensource.com/article/22/8/old-school-technical-writing-groff
[10]: https://opensource.com/users/fungi
[11]: https://opensource.com/users/moshez
[12]: https://opensource.com/users/jim-hall
[13]: https://opensource.com/users/jim-hall
[14]: https://opensource.com/users/steven-ellis
[15]: https://www.redhat.com/sysadmin/deprecated-linux-command-replacements?intcmp=7013a000002qLH8AAM
[16]: https://opensource.com/users/gkamathe

View File

@ -0,0 +1,159 @@
[#]: subject: "Using Machine Learning to Identify Reefs in the Ocean"
[#]: via: "https://www.opensourceforu.com/2022/08/using-machine-learning-to-identify-reefs-in-the-ocean/"
[#]: author: "Geetali Saha https://www.opensourceforu.com/author/geetali-saha/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Using Machine Learning to Identify Reefs in the Ocean
======
*Various data and image processing techniques, along with machine learning algorithms, make it possible to study, analyse, understand and identify unknown and lesser-known facts via supervised or unsupervised learning. This article explains the use of PyQGIS to identify reefs in the Indian coastal region.*
It was in the middle of the last century that mankind started exploring regions beyond the earth through satellites and space missions. This exploration is broadly classified into in situ or onsite observation and remote sensing. The in situ observations are limited and the major challenge is to reach out to parts of the Earth and space for monitoring the physical characteristics by acquiring information through reflected and emitted radiation. These can be achieved with the help of sensors and cameras on board satellites, aircraft, unmanned aerial vehicles and drones. Passive remote sensing involves the use of charge coupled devices, radiometers, film photography and infrared. Radars and LiDARs are active remote sensing elements that emit energy, and scan locations/objects based on the radiation that is reflected or back scattered from the target. The observations are either some data or image.
Geographic information systems (GIS) integrate data, location, maps and information, thereby providing a platform to understand geographical patterns. Popular open source GIS tools are quantum GIS (QGIS), geographic resources analysis support systems (GRASS GIS), system for automated geoscientific analyses (SAGA GIS) and MapWindow. Machine learning owes its popularity to open source programming/GUI choices like WEKA, KNIME, R and Python programming. The merger of GIS and machine learning has opened new avenues in research to explore beyond what is visible through sensors.
| | Raster maps | Vector maps |
| :- | :- | :- |
| Created by | Created with pixels | Created with mathematical formulae |
| Scaling | Quality loss when scaling is done | Scalable to any size |
| Programs used | Adobe Photoshop, Corel Painter, Gimp, Artweaver, Pixlr X | Adobe Illustrator, Sketch, Coreldraw, Affinity Designer, Inkscape |
| Comprise | Raster data is made up of pixels (also grid cells). These are usually regularly spaced and square | Real-world features in maps are represented as points, lines, and polygons (areas) |
| File types | .jpg, .png, .gif, .tiff, .psd, .bmp | .ai, .eps, .cdr, .svg, .pdf, .dfx |
| Advantages | The inherent nature of raster maps, e.g., one attribute maps, is ideally suited for mathematical modelling and quantitative analysis. | Topology rules can help data integrity with vector data models. Network analysis and proximity operations use such an approach. |
| Drawback | Raster maps reflect only one attribute or characteristic for an area. Processing of diverse characteristics becomes cumbersome | Vector data is processing intensive. Any feature edits require updates on topology. With many features, vector manipulation algorithms are complex |
resources analysis support systems (GRASS GIS), system for automated geoscientific analyses (SAGA GIS) and MapWindow. Machine learning owes its popularity to open source programming/GUI choices like WEKA, KNIME, R and Python programming. The merger of GIS and machine learning has opened new avenues in research to explore beyond what is visible through sensors.
In this article we are using the Python console of the quantum GIS platform — PyQGIS.
Maps are available either in raster or vector form for study and we can choose them depending on our task, software and region of interest. Vector data is focused on modelling discrete features with precise shapes and boundaries. Raster data is more about modelling continuous phenomena of the earth and images. The same can be imported to the Project template of the QGIS window.
The map used in the present setup is downloaded from [https://www.naturalearthdata.com.][1] Natural Earth Vector comes in ESRI shapefile format, the de facto standard for vector geodata. Character encoding is UTF-8. Natural Earth Raster comes in TIFF format with a TFW world file. All Natural Earth data uses the geographic coordinate system (projection), WGS84 datum. Natural Earth shapefile character encoding is specified in the code page flag in the shapefiles DBF file; for additional compatibility it is also specified in the CPG file. Natural Earths WGS84 projection is specified in shapefiles PRJ file.
![Figure 1: PyQGIS process flow][2]
Natural Earth is a public domain map data set available at 1:10m, 1:50m, and 1:110m scales. Featuring tightly integrated vector and raster data, with Natural Earth you can make a variety of visually pleasing, well-crafted maps with cartography or GIS software. Natural Earth was built through a collaboration of many volunteers and is supported by NACIS (North American Cartographic Information Society). It is free for use in any type of project.
The present map belongs to a category of most detailed maps — major coral reefs from WDB2 or World Data Bank 2. I am using QGIS 3.22 Białowieża version and working using its Python console. I have modified the reefs data set by appending the names of the nearest island and limited the entire list to 98 reefs along the western coast of India, including other countries.
*Step 1:* Open a new project in QGIS and select HCMGIS > BaseMap > Google Satellite Hybrid.
*Step 2:* This should load the previously geo-referenced global map on the Project view. The moment this is done, Layers (left lower section) will show the Google satellite hybrid image. Pan to the western water bodies of India and zoom on the location, as seen in Figure 2.
![Figure 2: Project view of QGIS][3]
*Step 3:* Select all the map files related to the desired features and convert them to .kml using any tool freely available online. You can set the output reference settings to Lat long Wgs 84 standard and choose to convert. Download the .kml file once conversion is completed. We did it using the tool at [https://products.aspose.app/gis/en/conversion/shapefile-to-kml.][4]
*Step 4:* Select layers that can be superimposed to this Google satellite hybrid image (refer Figure 3).
![Figure 3: Layer selection in QGIS][5]
*Step 5:* Open the data source manager vector file addition option from the menu.
*Step 6:* Provide the correct path to obtain the .kml file from the download location and add it.
*Step 7:* Open the concerned .kml file into the Data Source Manager-Vector mode and select the Add option (middle button on the right bottom). It should display the list of eligible files that can be added to it (refer Figure 4).
![Figure 4: Data source manager][6]
**Step 8:** Click Add layers (which you wish to include in the map to view).
Close the data source manager. You should be able to locate two files on the Layers window:
* The reef details file
* Google satellite hybrid image file
Remember to put the reef details in first position followed by the Google satellite hybrid image, else the reef details wont be visible at the desired locations.
Zoom on to your region of interest or make sure you select only those reefs and islands that you wish to study. You should be able to identify specific locations that are in the Arabian Sea. They presently appear with a yellow background (see Figure 5).
![Figure 5: View of the reef details][7]
You can access the properties with a right click on the reefs layer for other options.
Now, if you wish, you may alter the colour and the boundary of the symbols and change their representation.
A typical outline of the reefs located on specific islands is shown in Figure 6.
![Figure 6: Reefs located on specific islands][8]
### Moving on to the Python console
Python was first introduced in QGIS 0.9, and Python codes can be implemented in the QGIS environment using the following ways:
* Issue commands in the Python console within QGIS (the most popular choice and also widely implemented)
* Create and use plugins
* Automatically run Python code when QGIS starts
* Create processing algorithms
* Create functions for expressions in QGIS
* Create custom applications based on the QGIS API
![Figure 7: A typical QGIS Python console][9]
A wonderful resource for learning common task execution is to download the existing plugins from the plugin repository. QGIS provides an integrated Python console for scripting. It can be accessed from the *Plugins ► Python Console* menu.
QGIS essentially works as a layer based approach, and hence it becomes vital to obtain the currently selected layer in the layer list on the top. The ID visibility is optional. If the current layer happens to be a vector layer, the features are the most vital components and so is the feature count. In the QGIS environment, the iface variable, an instance of *QgisInterface*, allows the user to access the map canvas, menus, toolbars and other parts of the QGIS application.
The *iface.activeLayer()* method gives us the currently selected layer.
```
>>>layer = iface.activeLayer()
>>>dir(layer)
for f in layer.getFeatures():
print (f)
```
Executing the code in the console will provide the output, as shown in Figure 8.
![Figure 8: Output][10]
```
for f in layer.getFeatures():
print (f[fid], f[NAME])
output_file = open(d:/Geetali/Reefs_WestCoastIndian.txt, w)
```
This will generate a *.txt* document at the desired location with the desired name.
Finally we will execute the code below to display the names of the reefs
```
for f in layer.getFeatures():
geom = f.geometry()
line = %s, %s\n % (f[fid], f[NAME])
output_file.write(line)
output_file.close()
```
Figure 9 shows that after complete execution of the Python code, we have successfully loaded the names of the 98 reefs on the western coast of India.
![Figure 9: Names of the 98 reefs on the western coast of India][11]
--------------------------------------------------------------------------------
via: https://www.opensourceforu.com/2022/08/using-machine-learning-to-identify-reefs-in-the-ocean/
作者:[Geetali Saha][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.opensourceforu.com/author/geetali-saha/
[b]: https://github.com/lkxed
[1]: https://www.naturalearthdata.com.
[2]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-1-PyQGIS-process-flow.jpg
[3]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-2-Project-view-of-QGIS.jpg
[4]: https://products.aspose.app/gis/en/conversion/shapefile-to-kml.
[5]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-3-Layer-selection-in-QGIS.jpg
[6]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-4-Data-source-manager.jpg
[7]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-5-View-of-the-reef-details-3.jpg
[8]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-6-Reefs-located-on-specific-islands-3.jpg
[9]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-7-A-typical-QGIS-Python-console-1.jpg
[10]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-8-Output.jpg
[11]: https://www.opensourceforu.com/wp-content/uploads/2022/06/Figure-9-Names-of-the-98-reefs-on-the-western-coast-of-India-1.jpg

View File

@ -0,0 +1,218 @@
[#]: subject: "A gentle introduction to HTML"
[#]: via: "https://opensource.com/article/22/8/gentle-introduction-html"
[#]: author: "Jim Hall https://opensource.com/users/jim-hall"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
A gentle introduction to HTML
======
Learn the markup language of the web.
![Digital creative of a browser on the internet][1]
I feel confident in claiming that HTML is the most widely used markup language ever. While other markup languages exist, including , LaTeX, and [Markdown][2], no other markup language is as widespread as the Hyper Text Markup Language. HTML is the de facto language of the Web. First implemented in web browsers in 1994, the language continues to evolve. Yet the basics of HTML remain the same.
If you are just getting started in HTML, I wanted to offer this gentle introduction to learning HTML. I focus on the essentials of HTML to build a basic understanding of how HTML works. You can use this as a starting point to learn more about HTML.
### Collect words to fill a paragraph
Let's start with a basic understanding of HTML and how client applications like web browsers display HTML documents. At its core, HTML *collects* words in a file and *fills* a paragraph. That means if you don't add instructions (called markup) to an HTML file, and just leave it as plain text, a web browser turns all that text into a single paragraph.
Start with this sample text, saved in a plain text file called `index.html`. This is a paragraph from the old *King's Toaster* story, an Internet fable about how you might build a toaster out of a microcontroller:
```
The engineer replied,
"Using a four-bit microcontroller, I would write a simple
program that reads the darkness knob and quantizes its
position to one of 16 shades of darkness, from snow white
to coal black.
The program would use that darkness level as the index to
a 16-element table of initial timer values.
Then it would turn on the heating elements and start the
timer with the initial value selected from the table.
At the end of the time delay, it would turn off the heat
and pop up the toast.
Come back next week, and I'll show you a working
prototype."
```
You can put this file on a web server and access it like you would any website, or you can save it to your local disk and open it directly in a web browser. How you get the file into the web browser doesn't really matter. But you should name the file with an `.html` extension, which web browsers recognize by default as an HTML file.
In this case, I've written the file on separate lines. I've also added some blank lines, to demonstrate that HTML doesn't care about extra white space. This extra space may help humans read the HTML code, but the web browser just treats it as one block by default. Viewed on a web browser, this file looks like this:
![The HTML page as displayed in a web browser][3]
Image by:
(Jim Hall, CC BY-SA 4.0)
### Inline and block elements
At the core of HTML is the concept of *inline* and *block* elements. You can think of block elements as *always filling a rectangle*. Inline elements *follow only the inline text*.
The basic block element is called the *division*, and uses the `<div>` tag. The basic inline element is the *span*, with the `<span>` tag. Most HTML tags are some kind of block element or inline element, so it helps to start with just these two to understand how they work.
Add some `<div>` and `<span>` tags to your HTML document to see what block and inline elements look like:
```
<div>
The engineer replied,
"Using a four-bit microcontroller, I would write a simple
program that reads the darkness knob and quantizes its
position to one of 16 shades of darkness, from snow white
to coal black.
<span>
The program would use that darkness level as the index to
a 16-element table of initial timer values.
</span>
Then it would turn on the heating elements and start the
timer with the initial value selected from the table.
At the end of the time delay, it would turn off the heat
and pop up the toast.
Come back next week, and I'll show you a working
prototype."
</div>
```
I've added a `<div>` block element around the whole paragraph, and a `<span>` around just one sentence. Notice that when I start an HTML element like `<div>` or `<span>`, I need to provide its corresponding *closing* tag like `</div>` and `</span>`. Most HTML elements are formed like this, with an opening and closing tag.
The web browser uses these tags to display HTML content in a certain way, but because `<div>` and `<span>` don't really define any special formatting on their own, you can't see that anything has changed. Your sample paragraph looks the same as before:
![This really is a different screenshot than the one above, but it looks exactly the same because &lt;div&gt; and &lt;span&gt; do not add extra styling to the web page][4]
Image by:
(Jim Hall, CC BY-SA 4.0)
You can include *direct styling* in these tags with a style instruction, so you can see how the block and inline elements behave. To make the boundaries of each element stand out, let's use a light blue background for the `<div>` block and a pink background for the `<span>` :
```
<div style="background-color:lightblue">
The engineer replied,
"Using a four-bit microcontroller, I would write a simple
program that reads the darkness knob and quantizes its
position to one of 16 shades of darkness, from snow white
to coal black.
<span style="background-color:pink">
The program would use that darkness level as the index to
a 16-element table of initial timer values.
</span>
Then it would turn on the heating elements and start the
timer with the initial value selected from the table.
At the end of the time delay, it would turn off the heat
and pop up the toast.
Come back next week, and I'll show you a working
prototype."
</div>
```
With these changes, the entire paragraph has a light blue background. The `<div>` block element is a rectangle, so the blue fills even the empty space after the last sentence ends. Meanwhile, the second sentence has a pink background. This highlight follows the sentence because `<span>` is an inline element.
![Adding colors helps us see the difference between block elements (blue) and inline elements (pink)][5]
Image by:
(Jim Hall, CC BY-SA 4.0)
Most HTML elements are either block or inline. The only difference is these other elements carry some default styles, depending on what they are. For example, `<p>` is a block element that has extra space above and below the block. The heading tags, `<h1>` through `<h6>`, are also block elements defined at different font sizes and text styles like italics and bold. The `<strong>` tag is an inline element that displays text in a **bold** weight. Similarly, `<em>` is also an inline element that sets the text in an *italics* style.
### Finishing an HTML page
Some HTML elements are required. While the sample HTML file you have used display correctly on any web browser, it is not technically a *correct* HTML page. There are a few elements you need to add:
Every HTML document should provide a document type declaration. Use the single tag `<!DOCTYPE html>` on the first line of the HTML file to define an HTML document. The HTML standard also expects you to wrap the document text in two block elements: `<html>` to define the full page, and `<body>` to define the document body.
```
<!DOCTYPE html>
<html>
<body>
<div style="background-color:lightblue">
The engineer replied,
...
</div>
</body>
</html>
```
HTML documents also need a `<head>` block before the `<body>` that provides *meta information* about the page. The only required meta information is the title of the document, defined by the `<title>` element:
```
<!DOCTYPE html>
<html>
<head>
<title>The King's Toaster</title>
</head>
<body>
<div style="background-color:lightblue">
The engineer replied,
"Using a four-bit microcontroller, I would write a simple
program that reads the darkness knob and quantizes its
position to one of 16 shades of darkness, from snow white
to coal black.
<span style="background-color:pink">
The program would use that darkness level as the index to
a 16-element table of initial timer values.
</span>
Then it would turn on the heating elements and start the
timer with the initial value selected from the table.
At the end of the time delay, it would turn off the heat
and pop up the toast.
Come back next week, and I'll show you a working
prototype."
</div>
</body>
</html>
```
The supporting tags like `<html>`, `<head>`, and `<body>` do not change how the HTML page appears in a web browser, but they are required for a technically correct HTML document:
![Adding colors helps us see the difference between block elements (blue) and inline elements (pink)][6]
Image by:
(Jim Hall, CC BY-SA 4.0)
This gentle introduction to HTML provides just the essentials of HTML, but now that you understand block and inline elements, you're well on your way to learning how to write HTML documents using other HTML tags.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/8/gentle-introduction-html
作者:[Jim Hall][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jim-hall
[b]: https://github.com/lkxed
[1]: https://opensource.com/sites/default/files/lead-images/browser_web_internet_website.png
[2]: https://opensource.com/%20https%3A//opensource.com/article/19/9/introduction-markdown
[3]: https://opensource.com/sites/default/files/2022-08/html-plain-text.webp
[4]: https://opensource.com/sites/default/files/2022-08/html-text-div-span.webp
[5]: https://opensource.com/sites/default/files/2022-08/html-text-div-span-color.webp
[6]: https://opensource.com/sites/default/files/2022-08/html-text-div-span-color.webp