Merge pull request #25 from LCTT/master

update 0924
This commit is contained in:
SamMa 2021-09-24 09:37:54 +08:00 committed by GitHub
commit 0dfdfdc280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 1825 additions and 325 deletions

View File

@ -4,21 +4,23 @@
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: "wxy"
[#]: publisher: " "
[#]: url: " "
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13813-1.html"
Linux 黑话解释:什么是 sudo rm -rf为什么如此危险
======
当你刚接触 Linux 时,你会经常遇到这样的建议:永远不要运行 `sudo rm -rf /`。在 Linux 世界里,围绕着 `sudo rm -rf` 有很多梗。
![][11]
当你刚接触 Linux 时,你会经常遇到这样的建议:永远不要运行 `sudo rm -rf /`。在 Linux 世界里,更是围绕着 `sudo rm -rf` 有很多梗。
![][1]
但似乎关于它有一些混乱的现象。在 [清理 Ubuntu 以腾出空间][2] 的教程中,我建议运行一些涉及 `sudo``rm -rf` 的命令。一位读者问我,如果 `sudo rm -rf` 是一个不应该运行的危险的 Linux 命令,我为什么要建议这样做。
但似乎对于它也有一些混乱的认识。在 [清理 Ubuntu 以腾出空间][2] 的教程中,我建议运行一些涉及 `sudo``rm -rf` 的命令。一位读者问我,如果 `sudo rm -rf` 是一个不应该运行的危险的 Linux 命令,我为什么要建议这样做。
因此,我想到了写一篇 Linux 黑话解释,以消除误解。
### sudo rm -rf在做什么?
### sudo rm -rf 在做什么?
让我们按步骤来学习。
@ -66,11 +68,11 @@ $
`rm -rf` 命令看作一把刀。刀是一个危险的东西吗?有可能。如果你用刀切蔬菜,那是好事。如果你用刀切手指,那当然是不好的。
`rm -rf` 命令也是如此。它本身并不危险。它毕竟是用来删除文件的。但是,如果你在不知情的情况下用它来删除重要文件,那就有问题了。
`rm -rf` 命令也是如此。它本身并不危险。它是用来删除文件的。但是,如果你在不知情的情况下用它来删除重要文件,那就有问题了。
现在来看看 `sudo rm -rf /`
你知道,使用 `sudo`,你以 root 身份运行一个命令,这允许你对系统进行任何改变。
你知道,使用 `sudo`,你以 root 身份运行一个命令,这允许你对系统进行任何改变。
`/` 是根目录的符号。`/var` 表示根目录下的 `var` 目录。`/var/log/apt` 指的是根目录的 `log` 目录下的 `apt` 目录。
@ -80,7 +82,7 @@ $
这就是为什么建议不要运行 `sudo rm -rf /` 命令,因为你会抹去你的整个 Linux 系统。
请注意,在某些情况下,你可能正在运行像 `sudo rm -rf /var/log/apt` 这样的命令,这可能是的。同样,你必须注意你正在删除的东西,就像你必须注意你正在用刀切割的东西一样。
请注意,在某些情况下,你可能正在运行像 `sudo rm -rf /var/log/apt` 这样的命令,这可能是没问题的。同样,你必须注意你正在删除的东西,就像你必须注意你正在用刀切割的东西一样。
### 我在玩火:如果我运行 sudo rm -rf /,看看会发生什么呢?
@ -93,7 +95,7 @@ rm: it is dangerous to operate recursively on '/'
rm: use --no-preserve-root to override this failsafe
```
我的意思是,人是会打错字的,如果你不小心打了 `/ var/log/apt`,而不是 `/var/log/apt``/` 和 `var` 之间的空格意味着你给出了 `/``var` 目录来删除),你将会删除根目录。
我的意思是,人是会打错字的,如果你不小心打了 `/ var/log/apt`,而不是 `/var/log/apt``/` 和 `var` 之间的空格意味着你给出了 `/``var` 目录来删除),你将会删除根目录。LCTT 译注:我真干过,键盘敲的飞起,结果多敲了一个空格,然后就丢了半个文件系统 —— 那时候 Linux 还没这种故障安全保护。)
![使用 sudo rm -rf 时要注意][9]
@ -105,7 +107,7 @@ rm: use --no-preserve-root to override this failsafe
所以,我在一个虚拟机中运行基本的操作系统。我运行 `sudo rm -rf / --no-preserve-root`,你可以在下面的视频中看到灯光熄灭(大约 1 分钟)。
![video](https://player.vimeo.com/video/594025609)
![video](https://vimeo.com/594025609)
### 清楚了么?
@ -115,8 +117,6 @@ Linux 有一个活跃的社区,大多数人都会帮助新用户。 之所以
最后,请记住。<ruby>不要喝酒胡搞<rt>Dont drink and root</rt></ruby>。在运行你的 Linux 系统时要安全驾驶。
![][11]
--------------------------------------------------------------------------------
via: https://itsfoss.com/sudo-rm-rf/

View File

@ -0,0 +1,126 @@
[#]: subject: "Start using YAML now"
[#]: via: "https://opensource.com/article/21/9/intro-yaml"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13811-1.html"
YAML 使用入门
======
> 什么是 YAML为什么我们现在应该开始使用它
![](https://img.linux.net.cn/data/attachment/album/202109/23/095242fw0qzzp5fe6e565z.jpg)
[YAML](https://yaml.org/)<ruby>YAML 不是标记语言<rt>YAML Ain't Markup Language</rt></ruby>)是一种适宜阅读理解的数据序列化语言。它的语法简单而易于阅读。它不包含引号、打开和关闭的标签或大括号。它不包含任何可能使人类难以解析嵌套规则的东西。你可以看一下你的 YAML 文档就知道它在什么。
### YAML 特性
YAML 有一些超级特性,使其优于其他序列化格式:
* 易于略读。
* 易于使用。
* 可在编程语言之间移植。
* 敏捷语言的原生数据结构。
* 支持通用工具的一致模型。
* 支持一次性处理。
* 表现力和可扩展性。
我将通过一些例子进一步向你展示 YAML 的强大。
你能弄清楚下面发生了什么吗?
```
-------
# My grocery list
groceries:
- Milk
- Eggs
- Bread
- Butter
...
```
上面的例子包含了一个简单的杂货购物清单,它是一个完全格式化的 YAML 文档。在 YAML 中,字符串不加引号,而列表需要简单的连字符和空格。一个 YAML 文档以 `---` 开始,以 `...` 结束但它们是可选的。YAML中的注释以 `#` 开始。
缩进是 YAML 的关键。缩进必须包含空格,而不是制表符。虽然所需的空格数量是灵活的,但保持一致是个好主意。
### 基本元素
#### 集合
YAML 有两种类型的集合。列表(用于序列)和字典(用于映射)。列表是键值对,每个值都在一个新的行中,以连字符和空格开始。字典也是键值对,每个值都是一个映射,包含一个键、一个冒号和空格以及一个值。
例如:
```
# My List
groceries:
- Milk
- Eggs
- Bread
- Butter
# My dictionary
contact:
name: Ayush Sharma
email: myemail@example.com
```
列表和字典经常被结合起来,以提供更复杂的数据结构。列表可以包含字典,而字典可以包含列表。
#### 字符串
YAML 中的字符串不需要加引号。多行字符串可以用 `|``>` 来定义。前者保留了换行符,而后者则没有。
例如:
```
my_string: |
This is my string.
It can contain many lines.
Newlines are preserved.
```
```
my_string_2: >
This is my string.
This can also contain many lines.
Newlines aren't preserved and all lines are folded.
```
#### 锚点
YAML 可以通过节点锚点来获得可重复的数据块。`&` 字符定义了一个数据块,以后可以用 `*` 来引用。例如:
```
billing_address: &add1
house: B1
street: My Street
shipping_address: *add1
```
至止你对 YAML 的了解就足以让你开始工作了。你可以使用在线 YAML 解析器来测试。如果你每天都与 YAML 打交道,那么 [这个方便的备忘单][3] 会对你有所帮助。
_这篇文章最初发表在[作者的个人博客][4]上并经授权改编。_
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/intro-yaml
作者:[Ayush Sharma][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ayushsharma
[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]: mailto:myemail@example.com
[3]: https://yaml.org/refcard.html
[4]: https://notes.ayushsharma.in/2021/08/introduction-to-yaml

View File

@ -0,0 +1,80 @@
[#]: subject: "Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes"
[#]: via: "https://news.itsfoss.com/ubuntu-touch-ota-19/"
[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes
======
Ubuntu Touch is an open-source OS for mobile devices that respects user privacy, unlike Googles Android for privacy-focused users. The UBports community has released yet another update of Ubuntu Touch that is based on Ubuntu 16.04.
This release supports many new devices and contains significant updates on certain phones, along with numerous bug fixes.
Lets take a look at them.
![Source: UBports][1]
### Whats New?
#### Framework and Packages
The 16.04.7 Qt framework and packages like qml-module-qtwebview and libqt5webview5-dev have been added to the App framework. This improves application compatibility with other platforms.
#### Imrpovements to Halium devices
The gyroscope and magnetic field sensors can now be accessed on the Halium 5.1 and 7.1 devices. Do note that the functionality of the compass is still under development. The same applies to the magnetic field sensor for the Halium 9 and 10 devices that now use sensorfw, thus replacing the legacy platform-API.
#### Pixel 3a
You can completely shut down the device as intended. It no longer hangs in the process of the shutdown, so you should have better battery life. Additionally, the freezing of the camera app while capturing sounds when recording videos has also been fixed.
#### Messaging App Fix
The messaging app has also received a minor update. When messages arrive, the keyboard will no longer appear automatically but when needed. This is useful if the user doesnt want to reply or access the keyboard on demand.
#### Media Hub
A bug that prevented the device from sleep when audio sounds were played in successions has been fixed. Another major bug that reduced battery life drastically, because of uncleared requested wake locks, has also been taken care of.
### Other Improvements
There are several new devices added to support Ubuntu Touch, along with fixes for the Wi-Fi, audio, and camera.
You can look at the [official release notes][2] to check the list of devices added and explore more technical details.
### Update or Installation
Ubuntu Touch users should automatically receive an update or head to the updates in the System Settings to check for available updates.
Those willing to try out Ubuntu Touch for the first time can explore the [official website][3] and check if their device is supported correctly before installation.
I am particularly looking forward to the Ubuntu Touch OS update with Ubuntu 18.04 or newer as its base after several minor updates.
_What do you think about this new update? Have you tried it yet?_
#### 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/ubuntu-touch-ota-19/
作者:[Rishabh Moharir][a]
选题:[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/rishabh/
[b]: https://github.com/lujun9972
[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyMiIgd2lkdGg9IjM0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[2]: https://ubports.com/blog/ubports-news-1/post/ubuntu-touch-ota-19-release-3779
[3]: https://ubuntu-touch.io/get-ubuntu-touch

View File

@ -0,0 +1,172 @@
[#]: subject: "GNOME 41 Released: The Most Popular Linux Desktop Environment Gets Better"
[#]: via: "https://news.itsfoss.com/gnome-41-release/"
[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/"
[#]: collector: "lujun9972"
[#]: translator: "wxy"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
GNOME 41 Released: The Most Popular Linux Desktop Environment Gets Better
======
GNOME 41 stable release is ultimately here.
While GNOME 40 was a radical change forcing many users to adapt to a new workflow, GNOME 41 seems to settle the dust.
With GNOME 41, there are no significant workflow changes but new **feature additions** and **improvements** across the board.
GNOME 41 beta has been out there for a while. And, we tried the stable release right before the release date using [GNOME OS][1] to highlight what you can expect with it.
### GNOME 41 Features: Whats New?
![][2]
GNOME 41 does not give you any new visual treats but useful improvements to help you improve the workflow or take control of it.
There are some GNOME app upgrades that come along with it.
Let me mention the key highlights of GNOME 41.
#### GNOME 41 Software Context Tiles
![][3]
Every release, users look forward to the improvements made to the GNOME Software Center.
While they have been improving it in the right direction, it needed a visual overhaul. And, this time, GNOME 41 comes with a much-needed UI refresh.
The software store is more descriptive and should look appealing to new users. Using emojis/creative icons to categorize applications makes the software center pop.
Like the [Apps for GNOME][4] portal, the application screens on the Software center include more details to inform the user as much as possible without needing to refer to the project page or the web.
![][5]
In other words, these are the context tiles added to an app page that provides information about device support, safety/permissions, age rating, download size, the project, and more.
You also get to choose the available add-ons for a particular app like GIMP to install in one go. So, you save time from finding add-ons and installing them individually.
GNOME 41 Software should prove to be much more helpful than it ever was.
#### New Multitasking Options
![][6]
To help you improve the workflow, GNOME 41 comes baked in with new multitasking tweaks.
You get the toggle the hot corner to quickly open the Activities Overview. The ability to resize windows upon dragging them to the edges has also been added.
If you want, you can set a fixed number of workspaces available or keep it dynamic to adapt as you require.
In addition to these, you also get features to tweak:
* Multi-monitor workspaces
* Application switching behaviour
When you have multiple displays, you can choose to keep the workspaces restricted to a single screen or continue over connected displays.
And, when you head to switch applications and navigate through them, you can customize to preview the applications only in the same workspace or from all workspaces.
#### Power Saving Settings
![][7]
A helpful performance tweak to save power is now available in GNOME 41. This is incredibly useful for laptop users to tune their performance manually or if an app requests switching the mode to save power.
![][8]
#### GNOME Calendar Improvements
GNOME Calendar now can open ICS files along with the ability to import the events.
#### Touchpad Gestures
The workflow experience should be seamless when you utilize three-finger vertical swipe up/down actions to get the activity overview, and three-finger horizontal swipe right/left actions to navigate between workspaces.
It is good to see the focus on improving the workflow using the touchpad, similar to [elementary OS 6 features][9].
#### GNOME Connections App
![][10]
A new “Connections” app has been added to connect to remote computers no matter the platform.
I still see the application as an alpha build, but maybe with the following few updates, you should get the finished version of the application.
I havent tried if it works, but it might be worth another brief article to show you how to use it.
#### SIP/VoIP Support
With [GNOME 41 beta release][11], we spotted the inclusion of SIP/VoIP support.
If you are a business user or prefer international calls, you can now make VoIP calls directly from the dialpad in GNOME 41.
Unfortunately, I couldnt find the “Calls” app included when using GNOME OS with GNOME 41 stable release. So, I couldnt grab a screenshot of how it looks.
#### GNOME Web / Epiphany Improvements
![][12]
GNOME Web or Epiphany browser has been receiving a lot of good improvements lately.
With GNOME 41, the epiphany browser now utilizes AdGuards script to block YouTube advertisements. Not to forget, the support for epiphany canary builds has been added as well.
#### Other Improvements
Under the hood, several subtle but essential changes result in a better and faster user experience.
For instance, you may notice the icons more prominent in the header areas of application/windows. This is to improve clarity and enhance the look.
Similarly, there are numerous improvements to GNOME apps and functionalities that you might bump into when you use them:
* GNOME Map now shows the mean sea levels in a user-friendly way
* Improvements to Nautilus file manager to support password-protected zip files and the ability to toggle to let you enable/disable automatic trash cleaning
* Music app getting a UI refresh
* GNOME Text Editor gaining more features
* GTK updated to 4.4.0
* Addition of libawaita to potentially improve the user experience with GNOME apps
You can refer to the [official changelog and the announcement blog post][13] to explore all the technical changes.
### Wrapping Up
GNOME 41 may not be an experience-breaking upgrade, but it is a significant update with many valuable additions.
You can expect it with Fedora 35, which should release next month. Unfortunately, Ubuntu 21.10 will not include it, but you can wait it out for other Linux distributions.
#### 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/gnome-41-release/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/gnome-os/
[2]: https://i2.wp.com/i.ytimg.com/vi/holOYrZquBQ/hqdefault.jpg?w=780&ssl=1
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://news.itsfoss.com/apps-for-gnome-portal/
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMSIgd2lkdGg9IjQ0MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM2NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[9]: https://news.itsfoss.com/elementary-os-6-features/
[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[11]: https://news.itsfoss.com/gnome-41-beta/
[12]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[13]: https://help.gnome.org/misc/release-notes/41.0/

View File

@ -0,0 +1,111 @@
[#]: subject: "5 reasons to switch to Firefox right now"
[#]: via: "https://opensource.com/article/21/9/switch-to-firefox"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
5 reasons to switch to Firefox right now
======
Version 0.1 of Mozilla Firefox was released 19 years ago.
![red panda][1]
Mozilla Firefox was one of the applications that opened my eyes to open source. It wasn't by any means the tipping point, but it was part of a larger cumulative effect of several open source applications grabbing my attention, which ultimately resulted in me switching to Linux, and never looking back. Since switching to Firefox, which occurred well before I consciously changed to open source, I've been an avid Firefox user. My mobile phone was a Firefox OS mobile phone, and it was until the project was abandoned. Interestingly, though, I didn't necessarily consider myself a Firefox _fan_. I used it then and continue to use it today because it continues to be the best browser available in many different ways. Here are five reasons you should [switch to Firefox][2] right now.
### 1\. Firefox is focused on privacy
The maintainer of Firefox is the [Mozilla foundation][3], a non-profit organization not motivated at all by your personal data. Mozilla doesn't care about what you search for, what websites you visit, or how much time you spend on the web. That's just not Mozilla's business model, but it is expressly the business model of many other popular browsers.
Even if you don't object to a browser tracking your activities for privacy reasons, you may have had the experience of making that one-time purchase of an unusual gift, only to have every site you visit try to sell you that item for the rest of your life. The Internet is big, so it sometimes seems like a good idea to restructure it based on users' interests. I admit that if all of my searches could have "open source" appended to them, it would probably provide more relevant results. But then again, I'd rather opt in to that kind of optimization rather than have it, along with many other unknowns, being decided for me, outside my control.
![Privacy in Firefox][4]
Privacy in Firefox (Seth Kenlon, CC BY-SA 4.0) 
Mozilla has this policy: [Take less. Keep it safe. No secrets.][5]
Never one to stop short, Firefox also offers account [monitoring][6], an optional service from Mozilla that alerts you if any of your online accounts become compromised through a large-scale data breach. Additionally, Mozilla offers a paid VPN service using open source Wireguard software so you can browse safely from anywhere.
### 2\. Firefox can use containers
It may be hard to believe, but there was a time when leading web browsers did not feature tabs. In the late 90s and early 00s, when you wanted to visit two web pages simultaneously, you had to open two separate browser windows. Firefox (and the Mozilla browser before it) was an early adopter of the tabbed interface.
Tabs are expected in browsers now, but through Firefox's extensions, there's been an interesting new twist on the power of the tabbed interface. Developed by Mozilla itself, the [Firefox Multi-Account Containers plugin][7] can turn each tab into an isolated "container" within your browser.
![Containerized tabs in Firefox][8]
Containerized tabs in Firefox (Seth Kenlon, CC BY-SA 4.0) 
For instance, say your employer uses Google Apps, but you don't trust Google with your personal information. You can use the Multi-Account Containers plugin to isolate your work activities so that Google touches only your professional life and has no access to any other part of your life.
You can even open the same site with two different accounts, and as a bonus, the tabs are color-coded, so it's useful whether you're looking to isolate sites or just add new visual cues to your browser.
### 3\. Firefox user interface design
As much as we humans tend to get excited about new things, there's just as much comfort to be found in something familiar and reliable. Firefox has updated its interface over the years, and it's had its fair share of innovations that are now unofficial industry standards, but overall it has remained very much the same. Its user interface retains all the standard conventions you already take for granted.
When you download a file, you're prompted for how you want Firefox to handle the file. At your option, you can open the file in an appropriate application or save it to your hard drive. You can prompt Firefox to remember your choices for the future or have it continue to prompt you.
![Firefox user interface][9]
Firefox user interface (Seth Kenlon, CC BY-SA 4.0)
When you need an application menu, you can find it in a modern-style "hamburger" menu, or else you can press the **Alt** key to show a traditional menu along the top of the Firefox window.
Everything in Firefox is familiar, whether you're a long-time user of Firefox or not because it builds on years of user interface design. Where it can innovate, it does, but where it's counter-productive to change something intuitive, it refrains.
### 4\. Developer tools in Firefox
Back in the early days of the world wide web, you could navigate to any website and view the source code. There was a high chance of learning HTML just from doing this a few times. Everything was open, transparent, obvious, and relatively straightforward.
The Internet has evolved into a powerful [cloud-based supercomputer][10], and extracting meaningful context from a website now sometimes requires more than just a text dump of its underlying markup. To ensure everyone can reverse engineer (and engineer) how a website functions, Firefox incorporates a set of powerful development tools into the browser.
![Developer tools][11]
Developer tools (Seth Kenlon, CC BY-SA 4.0) 
Although this was a Firefox-based innovation originally (by [Firebug][12] back in 2006), many browsers have a devtools feature now. Not all devtools are equal, though, and it's Firefox's developer panels that make Firefox my go-to browser for web design and UX testing.
### 5\. Firefox is open source
Most importantly, Firefox is fully open source. It's an excellent browser with nothing to hide. It's got no ulterior motive aside from keeping the web open, educating people about the Internet, and promoting open source solutions to everyday tasks.
![Firefox is open source][13]
Firefox is open source (Seth Kenlon, CC BY-SA 4.0) 
You can contribute to Firefox. You can file bugs about things that you don't like. You can see the code you run when you interface with the Internet. Firefox has taken a stand for the open web for decades. It's stayed true to its principles and arguably has forced the hand of several competitors who probably wouldn't have chosen to go open source if Firefox hadn't set the public's expectations.
Firefox is a powerful force on the modern Internet, and it's a great browser. Firefox runs on your desktop and mobile devices, so do yourself a favor and [get Firefox][14].
Learn how to contribute to one of the largest and most popular open source projects on the web:...
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/switch-to-firefox
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/redpanda_firefox_pet_animal.jpg?itok=aSpKsyna (red panda)
[2]: http://getfirefox.org
[3]: https://foundation.mozilla.org/en/
[4]: https://opensource.com/sites/default/files/firefox-privacy.jpg
[5]: https://blog.mozilla.org/en/products/firefox/firefox-data-privacy-promise/
[6]: https://monitor.firefox.com
[7]: https://github.com/mozilla/multi-account-containers#readme
[8]: https://opensource.com/sites/default/files/firefox-container.jpg
[9]: https://opensource.com/sites/default/files/screenshot_from_2021-09-16_12-13-14.png
[10]: https://www.redhat.com/en/products/open-hybrid-cloud
[11]: https://opensource.com/sites/default/files/firefox-dev.jpg
[12]: https://getfirebug.com/
[13]: https://opensource.com/sites/default/files/firefox-open.jpg
[14]: http://getfirefox.com

View File

@ -2,7 +2,7 @@
[#]: via: "https://opensource.com/article/21/9/test-vagrant"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "

View File

@ -1,183 +0,0 @@
[#]: subject: "Use this Linux command-line tool to learn more about your NVMe drives"
[#]: via: "https://opensource.com/article/21/9/nvme-cli"
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Use this Linux command-line tool to learn more about your NVMe drives
======
The nvme-cli command has lots of useful options, and it's a great way to
take control of how you manage your data.
![Command line prompt][1]
NVMe stands for _Non-Volatile Memory Express_, and it refers to how software and storage communicate across PCIe and other protocols, including TCP. It's an [open specification][2] led by a non-profit organization and defines several forms of solid-state storage.
My laptop has an NVMe drive, as does my desktop. And they're fast. I love how quickly my computers boot and how quickly they're able to read and write data. There's no perceptible delay.
It also didn't take long for me to get curious about the technology driving this ultra-fast storage, so I did a little investigation. I learned that NVMe drives consume less power while delivering much faster access to data compared to even SSD drives over SATA. That was interesting, but I wanted to know more about my particular NVMe drives, and I wanted to know how they compared with other drives. Could I securely erase the drive? How could I check its integrity?
Those questions led me to an Internet search that yielded an open source project with a collection of tools to manage NVMe drives. It's called [nvme-cli][3].
### Install nvme-cli
You can install `nvme-cli` from your distribution's package manager. For instance, on Fedora, CentOS, or similar:
```
`$ sudo dnf install nvme-cli`
```
On Debian, Mint, Elementary, and similar:
```
`$ sudo apt install nvme-cli`
```
### Exploring an NVMe drive
After installing `nvme-cli` for my distribution, I wanted to explore my drive. There's no man page for `nvme-cli`, but you can get lots of help by entering `nvme help`:
```
$ nvme help
nvme-1.14
usage: nvme &lt;command&gt; [&lt;device&gt;] [&lt;args&gt;]
The '&lt;device&gt;' may be either an NVMe character device (ex: /dev/nvme0) or an
nvme block device (ex: /dev/nvme0n1).
The following are all implemented sub-commands:
 list List all NVMe devices and namespaces on machine
 list-subsys List nvme subsystems
 id-ctrl Send NVMe Identify Controller
 id-ns Send NVMe Identify Namespace, display structure
 id-ns-granularity Send NVMe Identify Namespace Granularity List, display structure
 list-ns Send NVMe Identify List, display structure
 list-ctrl Send NVMe Identify Controller List, display structure
 nvm-id-ctrl Send NVMe Identify Controller NVM Command Set, display structure
 primary-ctrl-caps Send NVMe Identify Primary Controller Capabilities
[...]
```
### List all NVMe drives
The `sudo nvme list` command lists all NVMe devices and namespaces on your machine. I used it and found an NVMe drive at `/dev/nvme0n1`. Here is the output:
```
$ sudo nvme list
Node SN Model Namespace Usage Format FW Rev
\--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1    S42GMY9M141281 SAMSUNG MZVLB256HAHQ-000L7 1
214.68 GB / 256.06 GB 512  B + 0 B 0L2QEXD7
```
I have a drive called `nvme0n1`. It lists the serial number, brand, size, firmware revision, and so on.
You can get even more information about the drive and the features it supports by using the `id-ctrl` subcommand:
```
$ sudo nvme id-ctrl /dev/nvme0n1
NVME Identify Controller:
vid : 0x144d
ssvid : 0x144d
sn : S42GMY9M141281
mn : SAMSUNG MZVLB256HAHQ-000L7
fr : 0L2QEXD7
rab : 2
ieee : 002538
cmic : 0
mdts : 9
cntlid : 0x4
ver : 0x10200
rtd3r : 0x186a0
rtd3e : 0x7a1200
[...]
```
### Drive health
You can read about the overall health of a drive with the `smart-log` subcommand:
```
$ sudo nvme smart-log /dev/nvme0n1
Smart Log for NVME device:nvme0n1 namespace-id:ffffffff
critical_warning : 0
temperature : 21 C
available_spare : 100%
available_spare_threshold : 10%
percentage_used : 2%
endurance group critical warning summary: 0
data_units_read : 5,749,452
data_units_written : 10,602,948
host_read_commands : 77,809,121
host_write_commands : 153,405,213
controller_busy_time : 756
power_cycles : 1,719
power_on_hours : 1,311
unsafe_shutdowns : 129
media_errors : 0
num_err_log_entries : 1,243
Warning Temperature Time : 0
Critical Composite Temperature Time : 0
Temperature Sensor 1 : 21 C
Temperature Sensor 2 : 22 C
Thermal Management T1 Trans Count : 0
Thermal Management T2 Trans Count : 0
Thermal Management T1 Total Time : 0
Thermal Management T2 Total Time : 0
```
This provides you with the drive's current temperature, the hours of use it's had so far, how many times it was unsafely shut down, and so on.
### Formatting an NVMe drive
You can format an NVMe drive with `nvme-cli`, but beware: This erases all of the data on the drive! If there's important data on your drive, you _must_ back it up before doing this, or else you **will** lose data. The subcommand is `format`:
```
`$ sudo nvme format /dev/nvme0nX`
```
(For safety, I've replaced the actual location of the drive with **X** to prevent copy-paste mishaps. Change the **X** to **1** or the appropriate location as listed in the results of `nvme list`.)
### Securely erasing an NVMe drive
When you get ready to sell or dispose of your NVMe computer, you probably want to erase the drive securely. The same warnings apply here as with the format process: Back up important data first because this command erases it!
```
`$ sudo nvme sanitize /dev/nvme0nX`
```
### Try nvme-cli
The `nvme-cli` command is released under a [GPLv2][4] license. It's a robust command with lots of useful options, and it's a great way to take control of how you manage your data.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/nvme-cli
作者:[Don Watkins][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/don-watkins
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt)
[2]: https://nvmexpress.org/
[3]: https://github.com/linux-nvme/nvme-cli
[4]: https://github.com/linux-nvme/nvme-cli/blob/master/LICENSE

View File

@ -0,0 +1,284 @@
[#]: subject: "Add storage with LVM"
[#]: via: "https://opensource.com/article/21/9/add-storage-lvm"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Add storage with LVM
======
LVM enables extreme flexibility in how you configure your storage.
![Storage units side by side][1]
Logical Volume Manager (LVM) allows for a layer of abstraction between the operating system and the hardware. Normally, your OS looks for disks (`/dev/sda`, `/dev/sdb`, and so on) and partitions within those disks (`/dev/sda1`, `/dev/sdb1`, and so on).
In LVM, a virtual layer is created between the operating system and the disks. Instead of one drive holding some number of partitions, LVM creates a unified storage pool (called a _Volume Group_) that spans any number of physical drives (called _Physical Volumes_). Using the storage available in a Volume Group, LVM provides what appear to be disks and partitions to your OS.
And the operating system is completely unaware that it's being "tricked."
![Drive space][2]
Opensource.com, [CC BY-SA 4.0][3]
Because the LVM creates volume groups and logical volumes virtually, it makes it easy to resize or move them, or create new volumes, even while the system is running. Additionally, LVM provides features that are not present otherwise, like creating live snapshots of logical volumes, without unmounting the disk first.
A volume group in an LVM is a named virtual container that groups together the underlying physical disks. It acts as a pool from which logical volumes of different sizes can be created. Logical volumes contain the actual file system and can span multiple disks, and don't need to be physically contiguous.
### Features
* Partition names normally have system designations like `/dev/sda1`. LVM volumes have normal human-understandable names, like `home` or `media`.
* The total size of partitions is limited by the size of the underlying physical disk. In LVM, volumes can span multiple disks, and are only limited by the total size of all physical disks in the LVM.
* Partitions can normally only be resized, moved, or deleted when the disk is not in use and is unmounted. LVM volumes can be manipulated while the system is running.
* Partitions can only be expanded by allocating them free space adjacent to the partition. LVM volumes can take free space from anywhere.
* Expanding a partition involves moving the data around to make free space, which is time-consuming and could lead to data loss during a power outage. LVM volumes can take free space from anywhere in the volume group, even on another disk.
* Because its so easy to create volumes in an LVM, it encourages creating different volumes, like creating separate volumes to test features or to try different operating systems. With partitions, this process would be time-consuming and error-prone.
* Snapshots can only be created in an LVM. It allows you to create a point-in-time image of the current logical volume, even while the system is running. This is great for backups.
### Test setup
As a demonstration, assume your system has the following drive configuration:
```
NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda    202:0    0   8G  0 disk
`-xvda1 202:1    0   8G  0 part /
xvdb    202:16   0   1G  0 disk
xvdc    202:32   0   1G  0 disk
xvdd    202:48   0   2G  0 disk
xvde    202:64   0   5G  0 disk
xvdf    202:80   0   8G  0 disk
```
#### Step 1. Initialize disks to use with LVM
Run `pvcreate /dev/xvdb /dev/xvdc /dev/xvdd /dev/xvde /dev/xvdf`. The output should be:
```
Physical volume "/dev/xvdb" successfully created
Physical volume "/dev/xvdc" successfully created
Physical volume "/dev/xvdd" successfully created
Physical volume "/dev/xvde" successfully created
Physical volume "/dev/xvdf" successfully created
```
See the result using `pvs` or `pvdisplay`:
```
"/dev/xvde" is a new physical volume of "5.00 GiB"
\--- NEW Physical volume ---
PV Name               /dev/xvde
VG Name
PV Size               5.00 GiB
Allocatable           NO
PE Size               0
Total PE              0
Free PE               0
Allocated PE          0
PV UUID               728JtI-ffZD-h2dZ-JKnV-8IOf-YKdS-8srJtn
"/dev/xvdb" is a new physical volume of "1.00 GiB"
\--- NEW Physical volume ---
PV Name               /dev/xvdb
VG Name
PV Size               1.00 GiB
Allocatable           NO
PE Size               0
Total PE              0
Free PE               0
Allocated PE          0
PV UUID               zk1phS-7uXc-PjBP-5Pv9-dtAV-zKe6-8OCRkZ
"/dev/xvdd" is a new physical volume of "2.00 GiB"
\--- NEW Physical volume ---
PV Name               /dev/xvdd
VG Name
PV Size               2.00 GiB
Allocatable           NO
PE Size               0
Total PE              0
Free PE               0
Allocated PE          0
PV UUID               R0I139-Ipca-KFra-2IZX-o9xJ-IW49-T22fPc
"/dev/xvdc" is a new physical volume of "1.00 GiB"
\--- NEW Physical volume ---
PV Name               /dev/xvdc
VG Name
PV Size               1.00 GiB
Allocatable           NO
PE Size               0
Total PE              0
Free PE               0
Allocated PE          0
PV UUID               FDzcVS-sq22-2b13-cYRj-dXHf-QLjS-22Meae
"/dev/xvdf" is a new physical volume of "8.00 GiB"
\--- NEW Physical volume ---
PV Name               /dev/xvdf
VG Name
PV Size               8.00 GiB
Allocatable           NO
PE Size               0
Total PE              0
Free PE               0
Allocated PE          0
PV UUID               TRVSH9-Bo5D-JHHb-g0NX-8IoS-GG6T-YV4d0p
```
#### Step 2. Create the volume group
Run `vgcreate myvg /dev/xvdb /dev/xvdc /dev/xvdd /dev/xvde /dev/xvdf`. See the results with `vgs` or `vgdisplay`:
```
\--- Volume group ---
VG Name               myvg
System ID
Format                lvm2
Metadata Areas        5
Metadata Sequence No  1
VG Access             read/write
VG Status             resizable
MAX LV                0
Cur LV                0
Open LV               0
Max PV                0
Cur PV                5
Act PV                5
VG Size               16.98 GiB
PE Size               4.00 MiB
Total PE              4347
Alloc PE / Size       0 / 0
Free  PE / Size       4347 / 16.98 GiB
VG UUID               ewrrWp-Tonj-LeFa-4Ogi-BIJJ-vztN-yrepkh
```
#### Step 3: Create logical volumes
Run the following commands:
```
lvcreate myvg --name media --size 4G
lvcreate myvg --name home --size 4G
```
Verify the results using `lvs` or `lvdisplay`:
```
\--- Logical volume ---
LV Path                /dev/myvg/media
LV Name                media
VG Name                myvg
LV UUID                LOBga3-pUNX-ZnxM-GliZ-mABH-xsdF-3VBXFT
LV Write Access        read/write
LV Creation host, time ip-10-0-5-236, 2017-02-03 05:29:15 +0000
LV Status              available
# open                 0
LV Size                4.00 GiB
Current LE             1024
Segments               1
Allocation             inherit
Read ahead sectors     auto
\- currently set to     256
Block device           252:0
\--- Logical volume ---
LV Path                /dev/myvg/home
LV Name                home
VG Name                myvg
LV UUID                Hc06sl-vtss-DuS0-jfqj-oNce-qKf6-e5qHhK
LV Write Access        read/write
LV Creation host, time ip-10-0-5-236, 2017-02-03 05:29:40 +0000
LV Status              available
# open                 0
LV Size                4.00 GiB
Current LE             1024
Segments               1
Allocation             inherit
Read ahead sectors     auto
\- currently set to     256
Block device           252:1
```
#### Step 4: Create the file system
Create the file system using:
```
mkfs.ext3 /dev/myvg/media
mkfs.ext3 /dev/myvg/home
```
Mount it:
```
mount /dev/myvg/media /media
mount /dev/myvg/home /home
```
See your full setup using `lsblk`:
```
NAME         MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda         202:0    0   8G  0 disk
`-xvda1      202:1    0   8G  0 part /
xvdb         202:16   0   1G  0 disk
xvdc         202:32   0   1G  0 disk
xvdd         202:48   0   2G  0 disk
xvde         202:64   0   5G  0 disk
`-myvg-media 252:0    0   4G  0 lvm  /media
xvdf         202:80   0   8G  0 disk
`-myvg-home  252:1    0   4G  0 lvm  /home
```
#### Step 5: Extending the LVM
Add a new disk at `/dev/xvdg`. To extend the `home` volume, run the following commands:
```
pvcreate /dev/xvdg
vgextend myvg /dev/xvdg
lvextend -l 100%FREE /dev/myvg/home
resize2fs /dev/myvg/home
```
Run `df -h` and you should see your new size reflected.
And that's it!
LVM enables extreme flexibility in how you configure your storage. Try it out, and have fun with LVM!
* * *
_This article was originally published on the [author's personal blog][4] and has been adapted with permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/add-storage-lvm
作者:[Ayush Sharma][a]
选题:[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/ayushsharma
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-storage.png?itok=95-zvHYl (Storage units side by side)
[2]: https://opensource.com/sites/default/files/lvm.png (Drive space)
[3]: https://creativecommons.org/licenses/by-sa/4.0/
[4]: https://notes.ayushsharma.in/2017/02/working-with-logical-volume-manager-lvm

View File

@ -0,0 +1,320 @@
[#]: subject: "Install PowerShell on Fedora Linux"
[#]: via: "https://fedoramagazine.org/install-powershell-on-fedora-linux/"
[#]: author: "TheEvilSkeletonOzymandias42 https://fedoramagazine.org/author/theevilskeleton/https://fedoramagazine.org/author/ozymandias42/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Install PowerShell on Fedora Linux
======
![][1]
Photos by [NOAA][2] and [Cedric Fox][3] on [Unsplash][4]
PowerShell (also written pwsh) is a powerful open source command-line and object-oriented shell developed and maintained by Microsoft. It is syntactically verbose and intuitive for the user. This article is a guide on how to install PowerShell on the host and inside a Podman or Toolbox container.
### Table of contents
* [Why use PowerShell][5]
* [Demonstration][6]
* [Comparison between Bash and PowerShell][7]
* [Install PowerShell][8]
* [Install PowerShell on a host using the package manager][9]
* [Method 1: Microsoft repositories][10]
* [Method 2: RPM file][11]
* [Install via container][12]
* [Method 1: Podman container][13]
* [Method 2: Fedora Linux Toolbox container][14]
### Why use PowerShell
PowerShell, as the name suggests, is _power_ful. The syntax is verbose and semantically clear to the end user. For those that dont want to write long commands all the time, most commands are aliased. The aliases can be viewed with _Get-Alias_ or [here][15].
The most important difference between PowerShell and traditional shells, however, is its output pipeline. While normal shells output strings or character streams, PowerShell outputs objects. This has far reaching implications for how command pipelines work and comes with quite a few advantages.
#### Demonstration
The following examples illustrate the verbosity and simplicity. Lines that start with the pound symbol (**#**) are comments. Lines that start with **PS &gt;** are commands, **PS &gt;** being the prompt:
```
# Return all files greater than 50MB in the current directory.
## Longest form
PS > Get-Childitem | Where-Object Length -gt 50MB
## Shortest form (with use of aliases)
PS > gci | ? Length -gt 40MB
## Output looks like this
Directory: /home/Ozymandias42/Downloads
Mode LastWriteTime Length Name
---- ------------- ------ ----
----- 20/08/2020 13:55 2000683008 40MB-file.img
# In order: get VMs, get snapshots, only select the last 3 and remove selected list:
PS > Get-VM VM-1 | Get-Snapshot | Select-Object -Last 3 | Remove-Snapshot
```
What this shows quite well is that input-output reformatting with tools like _cut_, _sed_, _awk_ or similar, which Bash scripts often need, is usually not necessary in PowerShell. The reason for this is that PowerShell works fundamentally different than traditional POSIX shells such as Bash, Zsh, or other shells like Fish. The commands of traditional shells are output as strings whereas in PowerShell they are output as objects.
#### Comparison between Bash and PowerShell
The following example illustrates the advantages of the object-output in PowerShell in contrast to the traditional string-output in Bash. Suppose you want a script that outputs all processes that occupy 200MB or more in RAM. With Bash, this might look something like this:
```
$ ps -eO rss | awk -F' ' \
'{ if($2 >= (1024*200)) { \
printf("%s\t%s\t%s\n",$1,$2,$6);} \
}'
PID RSS COMMAND
A B C
[...]
```
The first obvious difference is readability or more specifically, semantic clarity. Neither _ps_ nor _awk_ are self-descriptive. _ps_ shows the **p**rocess **s**tatus and _awk_ is a text processing tool and language whose letters are the initials of its developers last names, **A**ho, **W**einberger, **K**ernighan (see [Wikipedia][16]). Before contrasting it with PowerShell however, examine the script:
* _ps -e_ outputs all running processes;
* _-O rss_ outputs the default output of _ps_ plus the amount of kilobytes each process uses, the _rss_ field; this output looks like this:
```
PID RSS S TTY TIME COMMAND 1 13776 S ? 00:00:01 /usr/lib/systemd/systemd
```
* | pipe operator uses the output of the command on the left side as input for the command on the right side.
* _awk -F _ declares “space” as the input field separator. So going with the above example, PID is the first, RSS the second and so on.
* _{ if($2 &gt;= (1024*200)_ is the beginning of the actual AWK-script. It checks whether field 2 ([RSS][17]) contains a number larger than or equal to 1024*200KB (204800KB, or 200MB);
* _{ printf(“%s\t%s\t%s\n”,$1,$2,$6);} }_ continues the script. If the previous part evaluates to true, this outputs the first, second and sixth field ([PID][18], [RSS][17] and COMMAND fields respectively).
With this in mind, step back and look at what was required for this script to be written and for it to work:
* The input command _ps_ had to have the field we wanted to filter against in its output. This was not the case by default and required us to use the _-O_ flag with the _rss_ field as argument.
* We had to treat the output of _ps_ as a list of input fields, requiring us to know their order and structure. Or in other words, we had to at least _know_ that _RSS_ would be the second field. Meaning we had to know how the output of _ps_ would look beforehand.
* We then had to know what unit the data we were filtering against was in as well as what unit the processing tool would work in. Meaning we had to know that the _RSS_ field uses kilobytes and that _awk_ does too. Otherwise we would not have been able to write the expression _($2 &lt;= 1024*200)_
Now, contrast the above with the PowerShell equivalent:
```
# Longest form
PS > Get-Process | Where-Object WorkingSet -ge 200MB
# Shortest form (with use of aliases)
PS > gps | ? ws -ge 200MB
NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName
------ ----- ----- ------ -- -- -----------
A B C D E F G
[...]
```
This first thing to notice is that we have perfect semantic clarity. The commands are perfectly self-descriptive in what they do.
Furthermore there is no requirement for input-output reformatting, nor is there concern about the unit used by the input command. The reason for this is that PowerShell does not output strings, but objects.
To understand this think about the following. In Bash the output of a command is equal to that what it prints out in the terminal. In PowerShell what is printed on the terminal is not equal to the information, that is actually available. This is, because the output-printing system in PowerShell also works with objects. So every command in PowerShell marks some of the properties of its output objects as printable and others not. However, it always includes all properties, whereas Bash only includes what it actually prints. One can think of it like JSON objects. Where output in Bash would be separated into “fields” by a delimiter such as a space or tab, it becomes an easily addressable object property in PowerShell, with the only requirement being, that one has to know its name. Like _WorkingSet_ in the above example.
To see all available properties of a commands output objects and their types, one can simply do something like:
```
PS > Get-Process | Get-Member
```
### Install PowerShell
PowerShell is available in several package formats, including RPM used by Fedora Linux. This article shows how to install PowerShell on Fedora Linux using various methods.
I recommend installing it natively. But I will also show how to do it in a container. I will show using both the official Microsoft PowerShell container and a Fedora Linux 30 toolbox container. The advantage of the container-method is that its guaranteed to work, since all dependencies are bundled in it, and isolation from the host. Regardless, I recommend doing it natively, despite the official docs only explicitly stating Fedora Linux releases 28 to 30 as being supported.
**Note:** Supported means guaranteed to work. It does not necessarily mean incompatible with other releases. This means, that while not guaranteed, releases higher than 30 should still work. They did in fact work in our tests.
It is more difficult to set up PowerShell and run it in a container than to run it directly on a host. It takes more time to install and you will not be able to run host commands directly.
#### Install PowerShell on a host using the package manager
##### Method 1: Microsoft repositories
Installation is as straight-forward as can be and the procedure doesnt differ from any other software installed through third party repositories.
It can be split into four general steps:
1. Adding the new repositorys GPG key
2. Adding repository to DNF repository list
3. Refreshing DNF cache to include available packages from the new repository
4. Installing new packages
Powershell is then launched with the command _pwsh_.
```
$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
$ curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
$ sudo dnf makecache
$ sudo dnf install powershell
$ pwsh
```
To remove the repository and packages, run the following.
```
$ sudo rm /etc/yum.repos.d/microsoft.repo
$ sudo dnf remove powershell
```
##### Method 2: RPM file
This method is not meaningfully different from the first method. In fact it adds the GPG key and the repository implicitly when installing the RPM file. This is because the RPM file contains the link to both in its metadata.
First, get the _.rpm_ file for the version you want from the [PowerShell Core GitHub repository][19]. See the readme.md
“Get Powershell” table for links.
Second, enter the following:
```
$ sudo dnf install powershell-<version>.rhel.7.<architecture>.rpm
```
Substitute _&lt;version&gt;_ and _&lt;architecture&gt;_ with the version and architecture you want to use respectively, for example [powershell-7.1.3-1.rhel.7.x86_64.rpm][20].
Alternatively you could even run it with the link instead, skipping the need to download it first.
```
$ sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v<version>/powershell-<version>.rhel.7.<architecture>.rpm
```
To remove PowerShell, run the following.
```
$ sudo dnf remove powershell
```
#### Install via container
##### Method 1: Podman container
Podman is an [Open Container Initiative][21] (OCI) compliant drop-in replacement for Docker.
Microsoft provides a [PowerShell Docker container][22]. The following example will use that container with Podman.
For more information about Podman, visit [Podman.io][23]. Fedora Magazine has a [tag][24] dedicated to Podman.
To use PowerShell in Podman, run the following script:
```
$ podman run \
-it \
--privileged \
--rm \
--name powershell \
--env-host \
--net=host --pid=host --ipc=host \
--volume $HOME:$HOME \
--volume /:/var/host \
mcr.microsoft.com/powershell \
/usr/bin/pwsh -WorkingDirectory $(pwd)
```
This script creates a Podman container for PowerShell and immediately attaches to it. It also mounts the _/home_ and the hosts root directories into the container so theyre available there. However, the hosts root directory is available in _/var/host_.
Unfortunately, you can only indirectly run host commands while inside the container. As a workaround, run _chroot /var/host_ to chroot to the root and then run host commands.
To break the command down, everything is mandatory unless specified:
* -it creates a persistent environment that does not kick you out when you enter it;
* \--privileged gives extended privileges to the container (optional);
* \--rm removes the container when you exit;
* \--name powershell sets the name of the container to _powershell_;
* \--env-host sets all host environment variables to the containers variables (optional);
* \--volume $HOME:$HOME mounts the user directory;
* \--volume /:/var/host mounts the root directory to _/var/host_ (optional);
* \--net=host --pid=host --ipc=host runs the process in the hosts namespaces instead of a separate set of namespaces for the contained process;
* docker.io/microsoft/powershell enters the container;
* /usr/bin/pwsh -WorkingDirectory $(pwd) enters the container in the current directory (optional).
Optional but very convenient: alias _pwsh_ with the script to easily access the Podman container by typing _pwsh_.
To remove the PowerShell image, run the following.
```
$ podman rmi mcr.microsoft.com/powershell
```
##### Method 2: Fedora Linux Toolbox container
Toolbox is an elegant solution to setup persistent environments without affecting the host system as a whole. It acts as a wrapper around Podman and takes care of supplying a lot of the flags demonstrated in the previous method. For this reason, Toolbox is a lot easier to use than Podman. It was designed to work for development and debugging. With Toolbox, you can run any command the same as you would directly on the Fedora Workstation host (including _dnf_).
The installation procedure is similar to the installation on the host methods, with the only difference being that those steps are done inside a container. Make sure you have the _toolbox_ package installed.
Preparing and entering the Fedora 34 Toolbox container is a two step process:
1. Creating the Fedora 34 Toolbox container
2. Running the Fedora 34 Toolbox container
```
$ toolbox create --image registry.fedoraproject.org/f34/fedora-toolbox
$ toolbox enter --container fedora-toolbox
```
Then, follow the instructions at [Method 1: Microsoft repositories][10].
Optional but very convenient: alias _pwsh_ with _toolbox run container fedora-toolbox_ _pwsh_ to easily access the Toolbox container by typing _pwsh_.
To remove the Toolbox container, make certain you have stopped the Toolbox session by entering _exit_ and then run the following:
```
$ podman kill fedora-toolbox
$ toolbox rm fedora-toolbox
```
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/install-powershell-on-fedora-linux/
作者:[TheEvilSkeletonOzymandias42][a]
选题:[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/theevilskeleton/https://fedoramagazine.org/author/ozymandias42/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2021/05/powershell-816x345.jpg
[2]: https://unsplash.com/@noaa?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[3]: https://unsplash.com/@thecedfox?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[4]: https://unsplash.com/s/photos/shell?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[5]: tmp.c7U2gcu9Hl#why-use-powershell
[6]: tmp.c7U2gcu9Hl#demonstration
[7]: tmp.c7U2gcu9Hl#comparison-between-bash-and-powershell
[8]: tmp.c7U2gcu9Hl#install-powershell
[9]: tmp.c7U2gcu9Hl#install-on-host-via-package-manager
[10]: tmp.c7U2gcu9Hl#method-1-microsoft-repositories
[11]: tmp.c7U2gcu9Hl#method-2-rpm-file
[12]: tmp.c7U2gcu9Hl#install-via-container
[13]: tmp.c7U2gcu9Hl#method-1-podman-container
[14]: tmp.c7U2gcu9Hl#method-2-fedora-toolbox-container
[15]: https://ilovepowershell.com/2011/11/03/list-of-top-powershell-alias/
[16]: https://en.wikipedia.org/wiki/AWK
[17]: https://en.wikipedia.org/wiki/Resident_set_size
[18]: https://en.wikipedia.org/wiki/Process_identifier
[19]: https://github.com/PowerShell/PowerShell
[20]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/powershell-7.1.3-1.rhel.7.x86_64.rpm
[21]: https://opencontainers.org/
[22]: https://hub.docker.com/_/microsoft-powershell
[23]: https://podman.io/
[24]: https://fedoramagazine.org/tag/podman/

View File

@ -0,0 +1,115 @@
[#]: subject: "My favorite LibreOffice productivity tips"
[#]: via: "https://opensource.com/article/21/9/libreoffice-tips"
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
My favorite LibreOffice productivity tips
======
Here are some LibreOffice keyboard shortcuts and formatting tips that
might save you valuable time.
![woman on laptop sitting at the window][1]
LibreOffice is my productivity application of choice. It's one of the most potent reasons for recommending Linux distributions to educators and students, whether PK-12 or higher education. Now that the school year is upon us, I thought I would recommend some LibreOffice shortcuts and tips that might save you valuable time.
### Work faster with keyboard shortcuts
I use a lot of keyboard shortcuts. Here are the most common shortcuts that apply to all LibreOffice applications.
* **Ctrl**+**N**—Create a new document
* **Ctrl**+**O**—Open a document
* **Ctrl**+**S**—Save a document
* **Ctrl**+**Shift**+**S**—Save as
* **Ctrl**+**P**—Print a document
Here are some shortcut keys just for LibreOffice Writer:
* **Home**—Takes you to the beginning of the current line.
* **End**—Takes you to the end of a line.
* **Ctrl**+**Home**—Takes the cursor to the start of the document
* **Ctrl**+**End**—Takes the cursor to the end of the document
* **Ctrl**+**A**—Select All
* **Ctrl**+**D**—Double Underline
* **Ctrl**+**E**—Centered
* **Ctrl**+**H**—Find and Replace
* **Ctrl**+**L**—Align Left
* **Ctrl**+**R**—Align Right
Function keys have value too:
* **F2**—Opens the formula bar
* **F3**—Completes auto-text
* **F5**—Opens the navigator
* **F7**—Opens spelling and grammar
* **F11**—Opens styles and formatting
* **Shift**+**F11**—Creates a new style
### Document formats
There are lots of document formats out there, and LibreOffice supports a good number of them. By default, LibreOffice saves documents to the Open Document Format, an open source standard that stores stylesheets and data in a ZIP container labeled as ODT for text documents, ODS for spreadsheets, and ODP for presentations. It's a flexible format and is maintained by the LibreOffice community as well as the Document Foundation.
The Open Document Format is on by default, so you don't need to do anything to get LibreOffice to use it.
Another open specification for documents is Microsoft's [Office Open XML format][2]. It's an ISO standard and is well supported by all the major office solutions.
If you work with folks using Microsoft Office (which itself is not open source, but it does use the open OOXML format), then they're definitely used to DOCX, XLSX, and, PPTX formats and probably can't open ODT, ODS, or ODP files. You can avoid a lot of confusion by setting LibreOffice to save to OOXML by default.
To set OOXML as your preferred format: 
1. Click on the **Tools** menu and select **Options** at the bottom of the menu.
2. In the **Options** window, click on the **Load/Save** category in the left panel and select **General**.
![LibreOffice settings panel][3]
(Don Watkins, [CC BY-SA 4.0][4])
3. Navigate to the **Default File Format and ODF Settings** section.
4. Choose _Text document_ for the **Document type** and choose _Open XML (Transitional) (*.docx)_ for the **Always save as **drop-down list.
5. Click **Apply** and then **OK**. 
6. Deselect the **Warn when not saving in ODF or default format** to avoid confirmation dialogue boxes when saving.
![LibreOffice save formats][5]
(Don Watkins, [CC BY-SA 4.0][4])
Repeat the same process XLSX and PPTX documents by following the same logic. 
### Free your office
The LibreOffice project is managed by a thriving community of users and developers, in tandem with the Document Foundation. This includes an Engineering Steering Committee, a Board of Directors, independent developers and designers and translators, and more. These teams are always open to your contribution, so if you're eager to participate in a great open source project, don't hesitate to [get involved][6].
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/libreoffice-tips
作者:[Don Watkins][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/don-watkins
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop)
[2]: https://www.iso.org/standard/71691.html
[3]: https://opensource.com/sites/default/files/uploads/libreoffice-panel.jpg (LibreOffice settings panel)
[4]: https://creativecommons.org/licenses/by-sa/4.0/
[5]: https://opensource.com/sites/default/files/uploads/libreoffice-save-format.jpg (LibreOffice save formats)
[6]: https://www.libreoffice.org/community/get-involved/

View File

@ -0,0 +1,189 @@
[#]: subject: "Build your website with Jekyll"
[#]: via: "https://opensource.com/article/21/9/build-website-jekyll"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Build your website with Jekyll
======
Jekyll is an open source static site generator. You can write your
content in Markdown, use HTML/CSS for structure and presentation, and
Jekyll compiles it all into static HTML.
![Person using a laptop][1]
Static website generators and JAMStack have taken off in recent years. And with good reason. There is no need for complex backends with only static HTML, CSS, and Javascript to serve. Not having backends means better security, lower operational overhead, and cheaper hosting. A win-win-win!
In this article, I'm going to talk about Jekyll. As of this writing, [my personal website uses Jekyll][2]. Jekyll uses a Ruby engine to convert articles written in Markdown to generate HTML. [Sass][3] allows merging complex CSS rules into flat files. [Liquid][4] allows some programmatic control over otherwise static content.
### Install Jekyll
The [Jekyll website][5] has installation instructions for Linux, MacOS, and Windows. After installation, the [Quickstart guide][6] will set up a basic Hello-World project.
Now visit `http://localhost:4000` in your browser. You should see your default "awesome" blog.
![Default "awesome" blog][7]
Screenshot by Ayush Sharma, [CC BY-SA 4.0][8]
### Directory structure
The default site contains the following files and folders:
* `_posts`: Your blog entries.
* `_site`: The final compiled static website.
* `about.markdown`: Content for the about page.
* `index.markdown`: Content for the home page.
* `404.html`: Content for the 404 page.
* `_config.yml`: Site-wide configuration for Jekyll.
### Creating new blog entries
Creating posts is simple. All you need to do is create a new file under `_posts` with the proper format and extension, and youre all set.
A valid file name is `2021-08-29-welcome-to-jekyll.markdown`. A post file must contain what Jekyll calls the YAML Front Matter. Its a special section at the beginning of the file with the metadata. If you see the default post, youll see the following:
```
\---
layout: post
title: "Welcome to Jekyll!"
date:  2021-08-29 11:28:12 +0530
categories: jekyll update
\---
```
Jekyll uses the above metadata, and you can also define custom `key: value` pairs. If you need some inspiration, [have a look at my website's front matter][9]. Aside from the front matter, you can [use in-built Jekyll variables][10] to customize your website.
Lets create a new post. Create `2021-08-29-ayushsharma.markdown` in the `_posts` folder. Add the following content:
```
\---
layout: post
title:  "Check out ayushsharma.in!"
date:   2021-08-29 12:00:00 +0530
categories: mycategory
\---
This is my first post.
# This is a heading.
## This is another heading.
This is a [link](<http://notes.ayushsharma.in>)
This is my category:
```
If the `jekyll serve` command is still running, refresh the page, and you'll see the new entry below.
![New blog entry][11]
Screenshot by Ayush Sharma, [CC BY-SA 4.0][8]
Congrats on creating your first article! The process may seem simple, but there's a lot you can do with Jekyll. Using simple markdown, you can generate an archive of posts, syntax highlighting for code snippets, and separate pages for posts in one category.
### Drafts
If you're not ready to publish your content yet, you can create a new `_drafts` folder. Markdown files in this folder are only rendered by passing the `--drafts` argument.
### Layouts and Includes
Note the front matter of the two articles in our `_posts` folder, and you'll see `layout: post` in the Front Matter. The `_layout` folder contains all the layouts. You won't find them in your source code because Jekyll loads them by default. The default source code used by Jekyll is [here][12]. If you follow the link, you'll see that the `post` layout uses the [`default` layout][13]. The default layout contains the code `{{ content }}` which is where content is injected. The layout files will also contain `include` directives. These load files from the [`includes` folder][14] and allow composing a page using different components.
Overall, this is how layouts work—you define them in the front matter and inject your content within them. Includes provide other sections of the page to compose a whole page. This is a standard web-design technique—defining header, footer, aside, and content elements and then injecting content within them. This is the real power of static site generators—full programmatic control over assembling your website with final compilation into static HTML.
### Pages
Not all content on your website will be an article or a blog post. You'll need about pages, contact pages, project pages, or portfolio pages. This is where Pages come in. They work exactly like Posts do, meaning they're markdown files with front matter. But they don't go in the `_posts` directory. They either stay in your project root or in folders of their own. For Layouts and Includes, you can use the same ones as you do for your Posts or create new ones. Jekyll is very flexible and you can be as creative as you want! Your default blog already has `index.markdown` and `about.markdown`. Feel free to customize them as you wish.
### Data files
Data files live in the `_data` directory, and can be `.yml`, `.json`, or `.csv`. For example, a `_data/members.yml` file may contain:
```
\- name: A
 github: a@a
\- name: B
 github: b@b
\- name: C
 github: c@c
```
Jekyll reads these during site generation. You can access them using `site.data.members`.
```
&lt;ul&gt;
{ % for member in site.data.members %}
 &lt;li&gt;
 &lt;a href="[https://github.com/"\&gt;][15]
      { { member.name }}
 &lt;/a&gt;
 &lt;/li&gt;
{ % endfor %}
&lt;/ul&gt;
```
### Permalinks
Your `_config.yml` file defines the format of your permalinks. You can [use a variety of default variables][16] to assemble your own custom permalink.
### Building your final website
The command `jekyll serve `is great for local testing. But once you're done with local testing, you'll want to build the final artifact to publish. The command `jekyll build --source source_dir --destination destination_dir` builds your website into the `_site` folder. Note that this folder is cleaned up before every build, so don't place important things in there. Once you have the content, you can host it on a static hosting service of your choosing.
You should now have a decent overall grasp of what Jekyll is capable of and what the main bits and pieces do. If youre looking for inspiration, the official [JAMStack website has some amazing examples][17].
![Example Jekyll sites from JAMStack][18]
Screenshot by Ayush Sharma, [CC BY-SA 4.0][8]
Happy coding :)
* * *
_This article was originally published on the [author's personal blog][19] and has been adapted with permission._
See how Jekyll, an open source generator of static HTML files, makes running a blog as easy as...
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/build-website-jekyll
作者:[Ayush Sharma][a]
选题:[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/ayushsharma
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
[2]: https://gitlab.com/ayush-sharma/ayushsharma-in
[3]: https://sass-lang.com/
[4]: https://shopify.github.io/liquid/
[5]: https://jekyllrb.com/docs/installation/
[6]: https://jekyllrb.com/docs/
[7]: https://opensource.com/sites/default/files/uploads/2016-08-15-introduction-to-jekyll-welcome-to-jekyll.png (Default "awesome" blog)
[8]: https://creativecommons.org/licenses/by-sa/4.0/
[9]: https://gitlab.com/ayush-sharma/ayushsharma-in/-/blob/2.0/_posts/2021-07-15-the-evolution-of-ayushsharma-in.md
[10]: https://jekyllrb.com/docs/variables/
[11]: https://opensource.com/sites/default/files/uploads/2016-08-15-introduction-to-jekyll-new-article.png (New blog entry)
[12]: https://github.com/jekyll/minima/blob/master/_layouts/post.html
[13]: https://github.com/jekyll/minima/blob/master/_layouts/default.html#L12
[14]: https://github.com/jekyll/minima/tree/master/_includes
[15]: https://github.com/"\>
[16]: https://jekyllrb.com/docs/permalinks/
[17]: https://jamstack.org/examples/
[18]: https://opensource.com/sites/default/files/uploads/2016-08-15-introduction-to-jekyll-jamstack-examples.png (Example Jekyll sites from JAMStack)
[19]: https://notes.ayushsharma.in/2021/08/introduction-to-jekyll

View File

@ -0,0 +1,233 @@
[#]: subject: "JingPad Review: A Real Linux Tab for True Linux Fans"
[#]: via: "https://itsfoss.com/jingpad-a1-review/"
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
[#]: collector: "lujun9972"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
JingPad Review: A Real Linux Tab for True Linux Fans
======
If you follow Linux news enthusiastically, you might have come across a new name recently: [JingOS][1].
It is a new Linux distribution designed for touch devices. It can also be used as a regular desktop operating system on non-touch devices.
![JingOS][2]
JingOS is not the primary product for Beijing based JingLing tech. They have created this OS for their flagship product, JingPad, an ARM-based Linux tablet.
This review focuses on two aspects:
* The hardware side of JingPad tablet
* The software side of JingOS
So that you know
People at Jing sent me the JingPad for free to review the device. I can keep the device forever. However, this does not mean that review is biased in their favor to show only the positives. I am sharing my experience with the device and its operating system.
### JingPad: The first impression
![JingPad A1][3]
To be frank with you, I was expecting a mediocre, generic tablet preinstalled with a Linux OS. I was wrong.
The moment I unboxed the device and hold it in my hands, I got a feeling that I am looking at a premium device. The black colored tablet has a smooth finish. The back has a glossy finish and though I prefer matte usually, I liked the shiny body. I learned later that they used Corning Gorilla Glass for the back.
The hardware specification of the gadget is more than just decent. Take a look:
* 11 inches AMOLED screen with 4:3 aspect ratio
* 2K screen with 266PPI and 350nit
* Unisoc Tiger T7510 ARM Chip
* 8000mAh battery
* Weighs around 550g so not too heavy
* Around 7 mm in thickness
* 16 MP back camera and 8 MP front camera
* Dual band WiFi and Bluetooth 5.0
* 8 GB RAM
* 256 GB UMCP storage which can be expanded by MicroSD of 512 GB in size
JingPad also has companion stylus and keyboard. The review unit did not have the stylus but I did get the detachable keyboard. More on the keyboard later.
Note
JingOS is in alpha stage of development. A lot of things do not work as expected or promised at this moment. It should eventually get better in the later stages of development.
### JingOS: Experience the user interface
The JingOS will immediately remind you of iOS or Deepin OS, whichever you prefer. The interface is clean and the 2K display makes things look pretty.
There are row of application icons and a dock at the bottom. Swiping up from the bottom brings an activity area displaying all the running applications. From here, you can drag an application upward to close it. Touching the trash will close all the running applications. To minimize an application, you have to swipe from right to left.
![JingOS interface][4]
Swiping down from the top left brings the notification center. Doing the same on the top right corner lets you access the Settings menu.
The theming option is limited to light and dark themes but hey, you are getting the dark theme at least. Changing the theme requires a restart, which is an annoyance.
![JingOS provides a dark mode][5]
From what I see and experience, JingOS uses Ubuntu as base. For the interface, it is using KDE Plasma and probably some parts of GNOME underneath. The footprints of KDE Plasma are visible at places. For example, look at this screenshot notification.
![JingOS is built on top of KDE Plasma][6]
Since it is based on Ubuntu, you can use the apt-get commands in the terminal. The terminal (KDEs Konsole) can be used with both keyboard and on-screen keyboard. You also have the option to split the terminal window.
![Terminal][7]
Something that bothered me with JingOS is that it only works in the landscape mode. I could not find a way to use it in the portrait mode. This creates an issue if you are trying to log into a website in the browser because the on-screen keyboard takes half of the screen and you cannot see the form fields properly.
![Works only in landscape mode][8]
There is also no tap to wake feature. Face unlock is also missing. There is a fingerprint reader on the power button but it does not work for now. JingOS will add this feature in the [next couple of months through software update][9].
Overall, JingOS is pretty to look at, pretty to use for most part of it.
### Keyboard
The review device I got came with the companion keyboard. The keyboard is made for JingPad. It is magnetic and the tab sticks to it. It is detected automatically, no wonder there. It doubles up as cover to give the device front and back protection.
![JingPad with keyboard][10]
You can tilt the device at certain angles to use it comfortably as a laptop.
![JingPad with keyboard placed at angle][11]
**At the time of writing this review, the keyboard support is in initial stages for JingOS. This is why it does not work as it should.**
There are several function keys on the keyboard for controlling the volume, brightness, media playback, screen lock etc.
Most function keys work, except the one for showing the desktop. The super key, which has JingPad logo, does not work as well. I was expecting it to bring the home screen from running applications but that did not work.
The worst part is that when the keyboard is attached, it does not show the mouse pointer on the screen. That means going into a hybrid use mode where you touch the applications icon to open them and then use the keyboard for typing. This must be improved in the future.
Coming to the typing, the keys are a bit tiny but not miniscule. I think thats expected from the keyboard that has to match the 11 inches screen. The keys
The added weight of the keyboard makes the device heavier than usual but I guess youll have to make a compromise with the ease of use and the increased weight.
Another thing I noticed that when you put the lid down in the keyboard mode, the screen is not locked automatically. I expected a similar behavior to closing the lid of laptop.
### Battery life, charging and performance
JingPad comes with a 8000 mAh and claims to have up to 10 hours of battery life. They also claim that their 18W fast charger will charge the device completely in 3 hours.
My review device did not come with the fast charger because it was still under manufacturing when they shipped the device. I got a travel adapter instead and it took slightly more than 5 hours to charge the device.
I tested and found that if you keep the device on standby, the battery lasts around 42 hours. If you start using it continuously, it goes for 6 hours max. Now, this depends on what kind of work you are doing on the system. A few tweaks like reducing screen brightness, refresh rate, disabling connectivity could give it some extra battery life.
### Camera and sound
![][12]
There are two cameras here. 16 MP back camera for taking pictures (well, why not) and 8 MP front camera for video calls and online meetings.
Camera performance is okay. The default camera does not come with AI features like the smartphones but thats fine. You are not going to use it primarily as a camera, after all.
The front camera is good enough for the video calls. The placement of front camera is on the top so when you are using it in the landscape mode, it may seem that you are not looking directly into the camera. But people could still see and hear you well so that should not be an issue.
Speaking of hearing, JingPad has 4 speakers, two on each side. They provide decent sound for causal YouTube and watching streaming content for a single person. No complaints in this department.
### Applications
JingPad comes pre-installed with some of its own applications. These applications include a file manager, camera app, voice recorder, camera app, gallery app, music and video applications. Many of these applications are open source and you can find the code on [their GitHub repository][13].
![The music app from JingOS][14]
JingOS has an app store of its own where it provides a handful of applications that work on the touch devices.
![JingOS App Store][15]
The app store does not offer many applications at the moment but _**you can use the apt package manager**_ to get additional software (from JingOSs repositories).
My biggest complaint is not about the lack of applications. Its about the versions of some of the offered applications. I downloaded Mozilla Firefox from the app store and it installed version 82. The current Firefox version is 92 at the time of writing the review. I tried updating the system, even in command line, to see if it gets updates but there were none.
Because of this outdated version, I could not [play Netflix on Firefox][16]. There is no dedicated Netflix app so this was the only way to test it.
![Issue with outdated Firefox][17]
There are plans to add Android apps support as well. I cannot say how well it will work but something is better than nothing.
### Using JingPad for coding
I am not a programmer, not anymore at least. But since JingPads targeted customer include young coders who are frequently on the move, I tried using it for some simple coding.
There is no IDE available from the App Store but VS Code was available to install from the APT repository as well as in DEB file format. I installed it and opened it but it never ran like it was supposed to be.
So, I installed Gedit and wrote some sample bash scripts. Not much of coding but with the attached keyboard, it was not too bad.
It would have been a lot better if the copy-paste worked but unfortunately, I was not able to select and copy the code from random websites like a true programmer of the 21st century. I hope this gets fixed in the future updates.
### Android compatibility and other operating systems
I know what you are thinking. The tab looks good hardware wise. It is designed to run a Linux distribution based on Ubuntu. So can I use Ubuntu or some other distributions?
JingOS team says that you are free to install any other operating system on it. It uses ARM architecture so that is something to keep in mind while replacing the OS.
You will also be able to install JingOS back. I am yet to experiment with this part. Ill update the review when I do that.
As per the [roadmap of JingOS][18], there are plans for adding Android compatibility. This means you should be able to install Android or Android based ROM/distributions. As per the JingOS team, they will be developing the solution in house instead of using tools like Anbox. That will be interesting to see.
Heres a demo video of an Android app running on JingPad under JingOS:
### Conclusion
JingOS is in alpha stage of development at the moment. Most of the issues I have encountered in this review should be addressed in the future OTA updates, as their roadmap suggests. The final stable version of JingPad should be available by March 2022.
JingPad as a device comes on the pricey side but it also gives you a high-end gadget. 2K AMOLED display with Gorilla Glass, 8 GB RAM, 256 GB UMCP storage and other stuff you get only in high-end devices. The sound from the speakers is decent.
The magnetic tab cover and the detachable keyboards are also of premium quality. These things matter because you are paying a good amount of money for it.
The [JingPad with the Pencil][19] (stylus) and the keyboard costs $899. It comes with free international shipping and 1-year warranty. In many countries, there will also be additional custom duty levied on top of this price.
That seems like a lot of money, right? If you compare it to the price of iPad Air with same specifications (256 GB storage, WiFi+Cellular), keyboard and Pencil, the Apple device price reaches $1300 in the USA.
It is natural to compare JingPad with PineTab, another ARM-based Linux tablet. But PineTab is not a high-end gadget. It has modest specification and geared towards DIY tinkerers. JingPad, on the other hand, targets regular users, not just the DIY geeks.
Altogether, JingPad is aiming to give you a true Linux tablet but in the premium range. You get what you are paying for. A premium device for a premium pricing, with the freedom to run Linux on it.
_**But at this stage, JingOS has a lot of pending work to make JingPad a consumer level Linux tablet.**_ You should wait for the final device unless you really want your hands on it right away.
I plan to make a video review of the device where you can see it in action. I am not very good at doing video reviews, so this will take some time. You may leave your comments on what you would like to see in the video review and Ill try to cover it.
_Meanwhile, you can follow the updates on JingPad and JingOS development on their [Telegram channel][20] or [Discord][21]. You may also watch the demos on [their YouTube channel][22]._
--------------------------------------------------------------------------------
via: https://itsfoss.com/jingpad-a1-review/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://en.jingos.com/
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jing-os-interaface.webp?resize=768%2C512&ssl=1
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad.jpeg?resize=800%2C529&ssl=1
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-interface.webp?resize=800%2C584&ssl=1
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-theme-change.webp?resize=800%2C584&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-plasma-notification.webp?resize=800%2C584&ssl=1
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-terminal.webp?resize=800%2C584&ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-landscape.webp?resize=800%2C584&ssl=1
[9]: https://forum-cdn.jingos.com/uploads/default/original/1X/4c6ef800ef62f0315852fde4f2c32958b32d93a9.png
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-with-keyboard.webp?resize=800%2C600&ssl=1
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-keyboard-angle.webp?resize=800%2C600&ssl=1
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-camera.png?resize=787%2C552&ssl=1
[13]: https://github.com/JingOS-team/JingOS
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-music-app.webp?resize=800%2C584&ssl=1
[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-app-store.webp?resize=800%2C584&ssl=1
[16]: https://itsfoss.com/netflix-firefox-linux/
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/JingPad-Netflix-Issue.webp?resize=800%2C584&ssl=1
[18]: https://forum.jingos.com/t/feature-roadmap-of-jingos-arm-on-the-jingpad-a1/1708
[19]: https://www.indiegogo.com/projects/jingpad-world-s-first-consumer-level-linux-tablet#/
[20]: https://t.me/JingOS_Linux
[21]: https://discord.gg/uuWc8qKM
[22]: https://www.youtube.com/channel/UCRbaVa2v845SEtRadSlhWmA

View File

@ -1,129 +0,0 @@
[#]: subject: "Start using YAML now"
[#]: via: "https://opensource.com/article/21/9/intro-yaml"
[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
现在就开始使用 YAML
======
什么是 YAML为什么我们现在应该开始使用它了
![woman on laptop sitting at the window][1]
YAMLYAML Ain't Markup Language是一种人类可读的数据序列化语言。它的语法很简单而且是人类可读的。它不包含引号、打开和关闭标签或大括号。它不包含任何可能使人类难以解析嵌套规则的东西。你可以扫描你的 YAML 文档并立即知道发生了什么。
### YAML 特性
YAML 有一些超级特性,使其优于其他序列化格式:
* 易于浏览。
* 易于使用。
* 可在编程语言之间移植。
* 敏捷语言的原生数据结构。
* 支持通用工具的一致的模型。
* 支持一次性处理。
* 表现力和可扩展性。
我将通过一些例子进一步向你展示 YAML 的强大。
你能弄清楚下面发生了什么吗?
```
\-------
# My grocery list
groceries:
- Milk
- Eggs
- Bread
- Butter
...
```
上面的例子包含了一个简单的要买的杂货清单,它是一个完全格式化的 YAML 文档。在 YAML 中,字符串不加引号,而列表需要简单的连字符和空格。一个 YAML 文档以 **\---** 开始,以 **...** 结束但它们是可选的。YAML中的注释以 **#** 开始。
缩进是 YAML 的关键。缩进必须包含空格,而不是制表符。虽然所需的空格数量是灵活的,但保持一致是个好主意。
### 基本元素
#### 集合
YAML 有两种类型的集合。_列表_用于序列和_字典_用于映射。列表是键值对每个值都在一个新的行中以连字符和空格开始。字典是键值对每个值都是一个映射包含一个键、一个冒号和空格以及一个值。
例如:
```
# My List
groceries:
- Milk
- Eggs
- Bread
- Butter
# My dictionary
contact:
name: Ayush Sharma
email: [myemail@example.com][2]
```
列表和字典经常被结合起来,以提供更复杂的数据结构。列表可以包含字典,而字典可以包含列表。
#### 字符串
YAML 中的字符串不需要加引号。多行字符串可以用 **|** 或 **&gt;** 来定义。前者保留了换行符,而后者则没有。
例如:
```
my_string: |
This is my string.
It can contain many lines.
Newlines are preserved.
my_string_2: &gt;
This is my string.
This can also contain many lines.
Newlines aren't preserved and all lines are folded.
```
#### 锚点
YAML 可以通过节点锚点来获得可重复的数据块。**&amp;** 字符定义了一个数据块,以后可以用 * 来引用。例如:
```
billing_address: &amp;add1
house: B1
street: My Street
shipping_address: *add1
```
到此为止,你对 YAML 的了解足以让你开始工作。你可以使用在线 YAML 解析器来测试。如果你每天都与 YAML 打交道,那么[这个方便的备忘单][3]会对你有所帮助。
* * *
_这篇文章最初发表在[作者的个人博客][4]上并经授权改编。_
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/intro-yaml
作者:[Ayush Sharma][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/ayushsharma
[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]: mailto:myemail@example.com
[3]: https://yaml.org/refcard.html
[4]: https://notes.ayushsharma.in/2021/08/introduction-to-yaml

View File

@ -0,0 +1,182 @@
[#]: subject: "Use this Linux command-line tool to learn more about your NVMe drives"
[#]: via: "https://opensource.com/article/21/9/nvme-cli"
[#]: author: "Don Watkins https://opensource.com/users/don-watkins"
[#]: collector: "lujun9972"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
使用这个 Linux 命令行工具来了解你的 NVMe 驱动器的更多信息
======
nvme-cli 命令有很多有用的选项,且它是一个很好的方式来控制你如何管理你的数据。
![Command line prompt][1]
NVMe 是指 _Non-Volatile Memory_(非易失性内存主机控制器接口规范),它指的是软件和存储如何通过 PCIe 和其他协议(包括 TCP进行通信。它是一个由非营利组织领导的[开放规范][2],并定义了几种形式的固态存储。
我的笔记本电脑有一个 NVMe 驱动器,我的台式机也有。而且它们的速度很快。我喜欢我的电脑启动的速度,以及它们读写数据的速度。没有可察觉的延迟。
没过多久我就对驱动这种超高速存储的技术产生了好奇所以我做了一些调查。我了解到NVMe 驱动器消耗的电力更少,而提供的数据访问速度甚至比 SATA 的 SSD 驱动器快得多。这很有趣,但我想知道更多关于我的特定 NVMe 驱动器的信息,我想知道它们与其他驱动器相比如何。我可以安全地擦除驱动器吗?我怎样才能检查它的完整性?
这些问题让我在互联网上搜索,发现了一个开源项目,其中有一系列管理 NVMe 驱动器的工具。它被称为 [nvme-cli][3]。
### 安装 nvme-cli
你可以从你的发行版的包管理器中安装 `nvme-cli`。例如,在 Fedora、CentOS 或类似系统上:
```
`$ sudo dnf install nvme-cli`
```
在 Debian、Mint、Elementary 和类似系统上:
```
`$ sudo apt install nvme-cli`
```
### 探索 NVMe 驱动器
在为我的发行版安装 `nvme-cli` 后,我想探索我的驱动器。`nvme-cli` 没有手册页,但你可以通过输入 `nvme help` 获得很多帮助:
```
$ nvme help
nvme-1.14
usage: nvme &lt;command&gt; [&lt;device&gt;] [&lt;args&gt;]
The '&lt;device&gt;' may be either an NVMe character device (ex: /dev/nvme0) or an
nvme block device (ex: /dev/nvme0n1).
The following are all implemented sub-commands:
list List all NVMe devices and namespaces on machine
list-subsys List nvme subsystems
id-ctrl Send NVMe Identify Controller
id-ns Send NVMe Identify Namespace, display structure
id-ns-granularity Send NVMe Identify Namespace Granularity List, display structure
list-ns Send NVMe Identify List, display structure
list-ctrl Send NVMe Identify Controller List, display structure
nvm-id-ctrl Send NVMe Identify Controller NVM Command Set, display structure
primary-ctrl-caps Send NVMe Identify Primary Controller Capabilities
[...]
```
### 列出所有的 NVMe 驱动器
`sudo nvme list` 命令列出你机器上所有的 NVMe 设备和命名空间。我用它在 `/dev/nvme0n1` 找到了一个 NVMe 驱动器。下面是输出结果:
```
$ sudo nvme list
Node SN Model Namespace Usage Format FW Rev
\--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1 S42GMY9M141281 SAMSUNG MZVLB256HAHQ-000L7 1
214.68 GB / 256.06 GB 512 B + 0 B 0L2QEXD7
```
我有一个名为 `nvme0n1` 的驱动器。它列出了序列号、品牌、尺寸、固件版本等等。
通过使用 `id-ctrl` 子命令,你可以得到更多关于该硬盘和它所支持的特性的信息:
```
$ sudo nvme id-ctrl /dev/nvme0n1
NVME Identify Controller:
vid : 0x144d
ssvid : 0x144d
sn : S42GMY9M141281
mn : SAMSUNG MZVLB256HAHQ-000L7
fr : 0L2QEXD7
rab : 2
ieee : 002538
cmic : 0
mdts : 9
cntlid : 0x4
ver : 0x10200
rtd3r : 0x186a0
rtd3e : 0x7a1200
[...]
```
### 驱动器健康
你可以通过 `smart-log` 子命令来了解硬盘的整体健康状况:
```
$ sudo nvme smart-log /dev/nvme0n1
Smart Log for NVME device:nvme0n1 namespace-id:ffffffff
critical_warning : 0
temperature : 21 C
available_spare : 100%
available_spare_threshold : 10%
percentage_used : 2%
endurance group critical warning summary: 0
data_units_read : 5,749,452
data_units_written : 10,602,948
host_read_commands : 77,809,121
host_write_commands : 153,405,213
controller_busy_time : 756
power_cycles : 1,719
power_on_hours : 1,311
unsafe_shutdowns : 129
media_errors : 0
num_err_log_entries : 1,243
Warning Temperature Time : 0
Critical Composite Temperature Time : 0
Temperature Sensor 1 : 21 C
Temperature Sensor 2 : 22 C
Thermal Management T1 Trans Count : 0
Thermal Management T2 Trans Count : 0
Thermal Management T1 Total Time : 0
Thermal Management T2 Total Time : 0
```
这为你提供了硬盘的当前温度、到目前为止的使用时间、不安全的关机次数等等。
### 格式化一个 NVMe 驱动器
你可以用 `nvme-cli` 格式化一个 NVMe 驱动器,但要注意。这将删除驱动器上的所有数据!如果你的硬盘上有重要的数据,你必须在这样做之前将其备份,否则你**将会**丢失数据。子命令是 `format`
```
`$ sudo nvme format /dev/nvme0nX`
```
(为了安全起见,我用 **X** 替换了驱动器的实际位置,以防止复制粘贴的错误。将 **X** 改为 **1**`nvme list` 结果中列出的适当位置)。
### 安全地擦除 NVMe 驱动器
当你准备出售或处理你的 NVMe 电脑时,你可能想安全地擦除驱动器。这里的警告与格式化过程中的警告相同。首先要备份重要的数据,因为这个命令会删除这些数据!
```
`$ sudo nvme sanitize /dev/nvme0nX`
```
### 尝试 nvme-cli
`nvme-cli` 命令是在 [GPLv2][4] 许可下发布的。它是一个强大的命令,有很多有用的选项,它是控制你如何管理数据的好方法。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/9/nvme-cli
作者:[Don Watkins][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/don-watkins
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt)
[2]: https://nvmexpress.org/
[3]: https://github.com/linux-nvme/nvme-cli
[4]: https://github.com/linux-nvme/nvme-cli/blob/master/LICENSE