Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu Wang 2019-12-25 15:49:32 +08:00
commit 5a62b3ba58
12 changed files with 1256 additions and 317 deletions

View File

@ -1,28 +1,28 @@
[#]: collector: (lujun9972)
[#]: translator: (robsean)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11711-1.html)
[#]: subject: (Install Android 8.1 Oreo on Linux To Run Apps & Games)
[#]: via: (https://fosspost.org/tutorials/install-android-8-1-oreo-on-linux)
[#]: author: (Python Programmer;Open Source Software Enthusiast. Worked On Developing A Lot Of Free Software. The Founder Of Foss Post;Foss Project. Computer Science Major. )
在 Linux 上安装 Android 8.1 Oreo 来运行应用程序和游戏
在 Linux 上安装安卓 8.1 Oreo 来运行应用程序和游戏
======
![](https://i2.wp.com/fosspost.org/wp-content/uploads/2019/02/android-8.1-oreo-x86-on-linux.png?resize=1237%2C527&ssl=1)
[android x86][1] 是一个自由开放源码的项目将谷歌制作的android系统从 ARM 架构移植到 x86 架构, 运行用户在他们的桌面机器上运行 android 系统来享受所有的 android 功能和应用程序及游戏。
[android x86][1] 是一个自由而开源的项目,将谷歌制作的安卓系统从 ARM 架构移植到了 x86 架构,可以让用户在他们的桌面电脑上运行安卓系统来享受所有的安卓功能和应用程序及游戏。
几周前android x86 项目完成 android 8.1 Oreo 系统到 x86 架构的移植。在这篇文章中,我们将解释如何在你的 Linux 系统上安装它,以便你能够随时使用你的 android 应用程序和游戏。
在前一段时间android x86 项目完成了安卓 8.1 Oreo 系统的 x86 架构移植。在这篇文章中,我们将解释如何在你的 Linux 系统上安装它,以便你能够随时使用你的安卓 用程序和游戏。
### 在 Linux 上安装 Android x86 8.1 Oreo
### 在 Linux 上安装安卓 x86 8.1 Oreo
#### 准备环境
首先,让我们下载 android x86 8.1 Oreo 系统镜像。你可以从[这个页面][2]下载它,只需单击 android-x86_64-8.1-r1.iso 文件下 “View” 按钮。
首先,让我们下载 android x86 8.1 Oreo 系统镜像。你可以从[这个页面][2]下载它,只需单击 android-x86_64-8.1-r1.iso 文件下 “View” 按钮。
我们将在我们的 Linux 系统上使用 QEMU 来运行 android x86 。QEMU 是一个非常好的模拟器软件,它也是自由和开放源码的,并且在所有主要的 Linux 发行版存储库中都是可用的。
我们将在我们的 Linux 系统上使用 QEMU 来运行 android x86。QEMU 是一个非常好的模拟器软件,它也是自由而开源的,并且在所有主要的 Linux 发行版存储库中都是可用的。
在 Ubuntu/Linux Mint/Debian 上安装 QEMU
@ -36,115 +36,115 @@ sudo apt-get install qemu qemu-kvm libvirt-bin
sudo dnf install qemu qemu-kvm
```
对于其它发行版,只需要搜索 qemu 和 qemu-kvm 软件包,并安装它们。
对于其它发行版,只需要搜索 qemuqemu-kvm 软件包,并安装它们。
在你安装 QEMU 后,我们将需要运行下面的命令来创建 android.img 文件,它就像某种分配给 android 系统的磁盘空间。所有 android 文件和系统都将位于该镜像文件中:
在你安装 QEMU 后,我们将需要运行下面的命令来创建 `android.img` 文件,它就像某种分配给安卓系统的磁盘空间。所有安卓文件和系统都将位于该镜像文件中:
```
qemu-img create -f qcow2 android.img 15G
```
我们在这里说,我们想为 android 分配一个最大 15GB 的磁盘空间,但是,你可以更改它到你想要的任意大小(确保它至少大于5GB)
我们在这里的意思是,我们想为该安卓系统分配一个最大 15GB 的磁盘空间,但是,你可以更改它到你想要的任意大小(确保它至少大于 5GB
现在,首次启动运行 android 系统,运行:
现在,首次启动运行该安卓系统,运行:
```
sudo qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img -cdrom /home/mhsabbagh/android-x86_64-8.1-r1.iso
```
将 /home/mhsabbagh/android-x86_64-8.1-r1.iso 替换为你从 android x86 网站下载的文件的路径。我们在这里正在使用的其它选项的解释,你可以参考[这篇文章][3]。
`/home/mhsabbagh/android-x86_64-8.1-r1.iso` 替换为你从 android x86 网站下载的文件的路径。关于我们在这里正在使用的其它选项的解释,你可以参考[这篇文章][3]。
在你运行上面的命令后,android 系统将启动:
在你运行上面的命令后,该安卓系统将启动:
![Install Android 8.1 Oreo on Linux To Run Apps & Games 39 android 8.1 oreo on linux][4]
![][4]
#### 安装系统
从这个窗口中,选择 “Advanced options”, 它将引导到下面的菜单,你应如下在其中选择 “Auto_installation”
![Install Android 8.1 Oreo on Linux To Run Apps & Games 41 android 8.1 oreo on linux][5]
![][5]
在这以后,安装器将告知你是否想要继续,选择 Yes
在这以后,安装器将告知你是否想要继续,选择 “Yes”
![Install Android 8.1 Oreo on Linux To Run Apps & Games 43 android 8.1 oreo on linux][6]
![][6]
接下来,安装器将无需你的指示而继续进行:
![Install Android 8.1 Oreo on Linux To Run Apps & Games 45 android 8.1 oreo on linux][7]
![][7]
最后,你将收到这个信息,它表示你已经成功安装 android 8.1
最后,你将收到这个信息,它表示你已经成功安装安卓 8.1
![Install Android 8.1 Oreo on Linux To Run Apps & Games 47 android 8.1 oreo on linux][8]
![][8]
现在,完全关闭 QEMU 窗口。
现在,关闭 QEMU 窗口即可
#### 启动和使用 Android 8.1 Oreo
#### 启动和使用 安卓 8.1 Oreo
现在,android 系统已经完全安装在你的 android.img 文件中,你应该使用下面的 QEMU 命令来启动它,而不是前面的命令:
现在,安卓系统已经完全安装在你的 `android.img` 文件中,你应该使用下面的 QEMU 命令来启动它,而不是前面的命令:
```
sudo qemu-system-x86_64 -m 2048 -boot d -enable-kvm -smp 3 -net nic -net user -hda android.img
```
注意,我们所做的只是移除 -cdrom 选项和它的参数。这是告诉 QEMU ,我们不再想从我们下载的 ISO 文件启动,相反,从安装的 android 系统启动。
注意,我们所做的只是移除 `-cdrom` 选项及其参数。这是告诉 QEMU我们不再想从我们下载的 ISO 文件启动,相反,从这个安装的安卓系统启动。
你现在能够看到 android 启动菜单:
你现在能够看到安卓的启动菜单:
![Install Android 8.1 Oreo on Linux To Run Apps & Games 49 android 8.1 oreo on linux][9]
![][9]
然后,你将带去第一个准备向导,选择你的语言并继续:
然后,你将进入第一个准备向导,选择你的语言并继续:
![Install Android 8.1 Oreo on Linux To Run Apps & Games 51 android 8.1 oreo on linux][10]
![][10]
从这里,选择 “Set up as new” 选项:
![Install Android 8.1 Oreo on Linux To Run Apps & Games 53 android 8.1 oreo on linux][11]
![][11]
然后,android 将询问你是否想登陆到你当前的谷歌账号。这步骤是可选的,但是这很重要,以便你随后可以使用 Play Store
然后,安卓将询问你是否想登录到你当前的谷歌账号。这步骤是可选的,但是这很重要,以便你随后可以使用谷歌 Play 商店
![Install Android 8.1 Oreo on Linux To Run Apps & Games 55 android 8.1 oreo on linux][12]
![][12]
然后,你将需要接受条款:
![Install Android 8.1 Oreo on Linux To Run Apps & Games 57 android 8.1 oreo on linux][13]
![][13]
现在,你可以选择你当前的时区:
![Install Android 8.1 Oreo on Linux To Run Apps & Games 59 android 8.1 oreo on linux][14]
![][14]
系统将询问你是否想启动一些数据收集功能。如果我是你的话,我将简单地关闭它们,像这样:
系统将询问你是否想启动一些数据收集功能。如果我是你的话,我将简单地全部关闭它们,像这样:
![Install Android 8.1 Oreo on Linux To Run Apps & Games 61 android 8.1 oreo on linux][15]
![][15]
最后,你将有两种启动类型可供选择,我建议你选择 Launcher3 选项,并使其成为默认项:
![Install Android 8.1 Oreo on Linux To Run Apps & Games 63 android 8.1 oreo on linux][16]
![][16]
然后,你将看到完整工作的 android 系统主屏幕:
然后,你将看到完整工作的安卓系统主屏幕:
![Install Android 8.1 Oreo on Linux To Run Apps & Games 65 android 8.1 oreo on linux][17]
![][17]
从现在起,你可以做你想做的任何事情;你可以使用内置的 android 应用程序,或者你可以浏览你是系统设置来根据你的喜好进行调整。你可以更改你的系统的外观和体验,或者你可以像示例一样运行 Chrome
从现在起,你可以做你想做的任何事情;你可以使用内置的安卓应用程序,或者你可以浏览你的系统设置来根据你的喜好进行调整。你可以更改你的系统的外观和体验,或者你可以像示例一样运行 Chrome
![Install Android 8.1 Oreo on Linux To Run Apps & Games 67 android 8.1 oreo on linux][18]
![][18]
你可以从 Google Play store 开始安装一些应用程序程序,像 WhatsApp 和其它的应用程序,以供你自己使用:
你可以开始从谷歌 Play 商店安装一些应用程序程序,像 WhatsApp 和其它的应用程序,以供你自己使用:
![Install Android 8.1 Oreo on Linux To Run Apps & Games 69 android 8.1 oreo on linux][19]
![][19]
你现在可以用你的系统做任何你想做的事。恭喜!
### 以后如何轻松地运行 Android 8.1 Oreo
### 以后如何轻松地运行安卓 8.1 Oreo
我们不想总是不得不打开终端窗口,并写那些长长的 QEMU 命令来运行 android 系统,相反,我们想在我们需要时一次单击就运行它。
我们不想总是不得不打开终端窗口,并写那些长长的 QEMU 命令来运行安卓系统,相反,我们想在我们需要时一次单击就运行它。
为此,我们将使用下面的命令在 /usr/share/applications 下创建一个名为 android.desktop 的新文件:
为此,我们将使用下面的命令在 `/usr/share/applications` 下创建一个名为 `android.desktop` 的新文件:
```
sudo nano /usr/share/applications/android.desktop
```
并在其中粘贴下面的内容(右键单击然后粘贴)
并在其中粘贴下面的内容(右键单击然后粘贴)
```
[Desktop Entry]
@ -158,33 +158,32 @@ StartupNotify=true
Categories=GTK;
```
再强调一次,你必需使用你系统上的本地镜像路径来替换 /home/mhsabbagh/android.img 。然后保存文件 (Ctrl + X ,然后按 Y ,然后按 Enter)
再强调一次,你必需使用你系统上的本地镜像路径来替换 `/home/mhsabbagh/android.img` 。然后保存文件(`Ctrl+X`,然后按 `Y`,然后按回车)
注意,我们需要使用 “pkexec” 来使用 root 权限运行 QEMU ,因为从较新的版本开始,普通用户不允许通过 libvirt 访问 KVM 技术;这就是为什么它将每次要求你输入 root 密码的原因。
注意,我们需要使用 `pkexec` 来使用 root 权限运行 QEMU ,因为从较新的版本开始,普通用户不允许通过 libvirt 访问 KVM 技术;这就是为什么它将每次要求你输入 root 密码的原因。
现在,你将在应用程序菜单中看到 android 图标,你可以在你想使用 android 的任何时间来简单地单击图标QEMU 程序将启动:
现在,你将在应用程序菜单中看到安卓图标,你可以在你想使用安卓的任何时间来简单地单击该图标QEMU 程序将启动:
![Install Android 8.1 Oreo on Linux To Run Apps & Games 71 android 8.1 oreo on linux][20]
![][20]
### 总结
我们向你展示如何你的 Linux 系统上安装和运行 android 8.1 Oreo 。从现在起,在没有其它一些软件的(像 Blutsticks 和类似的方法)的情况下,你应该更容易地完成基于 android 的任务。在这里,你有一个完整工作和功能的 android 系统,你可以随心所欲地操作它,如果一些东西出差,你可以简单地核弹攻击镜像文件,然后随时再一次重新运行安装程序。
你之前尝试过 android x86 吗?你的经验如何?
我们向你展示如何在你的 Linux 系统上安装和运行安卓 8.1 Oreo 。从现在起,在没有其它一些软件的(像 Blutsticks 和类似的方法)的情况下,你可以更容易地完成基于安卓的任务。在这里,你有一个完整工作和功能的安卓系统,你可以随心所欲地操作它,如果一些东西出错,你可以简单地干掉该镜像文件,然后随时再一次重新运行安装程序。
你之前尝试过 android x86 吗?你的体验如何?
--------------------------------------------------------------------------------
via: https://fosspost.org/tutorials/install-android-8-1-oreo-on-linux
作者:[Python Programmer;Open Source Software Enthusiast. Worked On Developing A Lot Of Free Software. The Founder Of Foss Post;Foss Project. Computer Science Major.][a]
作者:[M.Hanny Sabbagh][a]
选题:[lujun9972][b]
译者:[robsean](https://github.com/robsean)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:
[a]: https://fosspost.org/author/mhsabbagh
[b]: https://github.com/lujun9972
[1]: http://www.android-x86.org/
[2]: http://www.android-x86.org/download

View File

@ -0,0 +1,77 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-11712-1.html)
[#]: subject: (Customize your Linux desktop with FVWM)
[#]: via: (https://opensource.com/article/19/12/fvwm-linux-desktop)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
使用 FVWM 自定义 Linux 桌面
======
> 本文是 24 天 Linux 桌面特别系列的一部分。如果你正在寻找轻巧、快速且简单的 Linux 窗口管理器,那么 FVWM 可以胜任。但是,如果你正在寻找可以深入、探索和魔改的窗口管理器,那么 FVWM 是必须的。
![](https://img.linux.net.cn/data/attachment/album/201912/25/062800dwh3yhfcpx3ggjxp.jpg)
[FVWM][2] 窗口管理器最早脱胎于对 1993 年的 [TWM][3] 的修改。经过几年的迭代,诞生了一个可高度自定义的环境,它可以配置任何行为、动作或事件。它支持自定义键绑定、鼠标手势、主题、脚本等。
尽管 FVWM 在安装后即可投入使用但默认分发版本仅提供了极其少的配置。这是开始自定义桌面环境的良好基础但是如果你只想将其用作桌面那么可能要安装由其它用户发布的完整配置版本。FVWM 有几种不同的分发版,包括模仿 Windows 95 的 FVWM95至少在外观和布局上。我尝试了 [FVWM-Crystal][4],这是一个具有一些现代 Linux 桌面约定的现代主题。
可以从 Linux 发行版的软件仓库中安装要尝试的 FVWM 分发版。如果找不到特定的 FVWM 分发版,那么可以安装基础的 FVWM2 包,然后进入 [Box-Look.org][5] 手动下载主题包。这样就需要更多的工作,但比从头开始构建要少。
安装后,请注销当前的桌面会话,以便你可以登录 FVWM。默认情况下会话管理器KDM、GDM、LightDM 或 XDM取决于你的设置将继续登录到以前的桌面因此你必须在登录之前覆盖该桌面。
对于 GDM
![Select your desktop session in GDM][6]
对于 KDM
![Select your desktop session with KDM][7]
### FVWM 桌面
无论你使用什么主题和配置当你在桌面上单击鼠标左键时FVWM 至少会显示一个菜单。菜单的内容取决于你所安装的内容。FVWM-Crystal 分发版中的菜单包含对常用首选项的快速访问,例如屏幕分辨率、壁纸设置、窗口装饰等。
同 FVWM 中的几乎所有东西一样,你可以编辑菜单中你要想的内容,但 FVWM-Crystal 的特色在于其应用菜单栏。应用菜单位于屏幕的左上角每个图标都包含了相关的应用启动器的菜单。例如GIMP 图标表示图像编辑器KDevelop 图标表示集成开发环境IDEGNU 图标表示文本编辑器,等等,具体取决于你在系统上安装的程序。
![FVWM-crystal running on Slackware 14.2][8]
FVWM-Crystal 还提供了虚拟桌面、任务栏、时钟和应用栏。
关于背景,你可以使用与 FVWM-Crystal 捆绑在一起的壁纸,也可以使用 `feh` 命令设置自己的壁纸(你可能需要从仓库中安装它)。此命令有一些设置背景的选项,包括 `--bg-scale` 使用你选择的图片缩放填充屏幕,`--bg-fill` 直接填充而不缩放图片,等等。
```
$ feh --bg-scale ~/Pictures/wallpapers/mybackground.jpg
```
大多数配置文件都包含在 `$HOME/.fvwm-crystal` 中,某些系统范围的默认文件位于 `/usr/share/fvwm-crystal`
### 自己尝试一下
FVWM 是大多作为一个桌面构建平台,它也是窗口管理器。它不会为你做到面面俱到,它期望你来配置尽可能的一切。
如果你正在寻找轻巧、快速且简单的窗口管理器,那么 FVWM 可以胜任。但是,如果你正在寻找可以深入、探索和魔改的窗口管理器,那么 FVWM 是必须的。
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/fvwm-linux-desktop
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer)
[2]: http://www.fvwm.org/
[3]: https://en.wikipedia.org/wiki/Twm
[4]: https://www.box-look.org/p/1018270/
[5]: http://box-look.org
[6]: https://opensource.com/sites/default/files/advent-gdm_0.jpg (Select your desktop session in GDM)
[7]: https://opensource.com/sites/default/files/advent-kdm.jpg (Select your desktop session with KDM)
[8]: https://opensource.com/sites/default/files/advent-fvwm-crystal.jpg (FVWM-crystal running on Slackware 14.2)

View File

@ -1,183 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Start, Stop & Restart Services in Ubuntu and Other Linux Distributions)
[#]: via: (https://itsfoss.com/start-stop-restart-services-linux/)
[#]: author: (Sergiu https://itsfoss.com/author/sergiu/)
How to Start, Stop & Restart Services in Ubuntu and Other Linux Distributions
======
Services are essential background processes that are usually run while booting up and shut down with the OS.
If you are a sysadmin, youll deal with the service regularly.
If you are a normal desktop user, you may come across the need to restart a service like [setting up Barrier for sharing mouse and keyboard between computers][1]. or when you are [using ufw to setup firewall][2].
Today I will show you two different ways you can manage services. Youll learn to start, stop and restart services in Ubuntu or any other Linux distribution.
systemd vs init
Ubuntu and many other distributions these days use systemd instead of the good old init.
In systemd, you manage sevices with systemctl command.
In init, you manage service with service command.
Youll notice that even though your Linux system uses systemd, it is still able to use the service command (intended to be used with init system). This is because service command is actually redirect to systemctl. Its sort of backward compatibility introduced by systemd because sysadmins were habitual of using the service command.
Ill show both systemctl and service command in this tutorial.
_I am Ubuntu 18.04 here, but the process (no pun intended) is the same for other versions._
### Method 1: Managing services in Linux with systemd
I am starting with systemd because of the obvious reason of its widespread adoption.
#### 1\. List all services
In order to manage the services, you first need to know what services are available on your system.
You can use the systemd command to list all the services on your Linux system:
```
systemctl list-unit-files --type service -all
```
![systemctl list-unit-files][3]
This command will output the state of all services. The value of a services state can be enabled, disabled, masked (inactive until mask is unset), static and generated.
Combine it with the [grep command][4] and you can **display just the running services**:
```
sudo systemctl | grep running
```
![Display running services systemctl][5]
Now that you know how to reference all different services, you can start actively managing them.
**Note:** ***<service-***_**name>**_ _in the commands should be replaced by the name of the service you wish to manage (e.g. network-manager, ufw etc.)._
#### **2\. Start a** service
To start a service in Linux, you just need to use its name like this:
```
systemctl start <service-name>
```
#### 3\. **Stop** a service
To stop a systemd service, you can use the stop option of systemctl command:
```
systemctl stop <service-name>
```
#### 4\. Re**start** a service
To restart a service in Linux with systemd, you can use:
```
systemctl restart <service-name>
```
#### 5\. Check the status of a service
You can confirm that you have successfully executed a certain action by printing the service status:
```
systemctl status <service-name>
```
This will output information in the following manner:
![systemctl status][6]
That was systemd. Lets switch to init now.
### Method 2: Managing services in Linux with init
The commands in init are also as simple as system.
#### 1\. List all services
To list all the Linux services, use
```
service --status-all
```
![service status-all][7]
The services preceded by **[ ]** are **disabled** and those with **[ + ]** are **enabled**.
#### **2\. Start** a service
To start a service in Ubuntu and other distributions, use this command:
```
service <service-name> start
```
#### **3\. Stop** a service
Stopping a service is equally easy.
```
service <service-name> stop
```
#### 4\. Re**start** a service
If you want to restart a service, the command is:
```
service <service-name> restart
```
#### 5\. Check the status of a service
Furthermore, to check if your intended result was achieved, you can output the service ****status**:**
```
service <service-name> status
```
This will output information in the following manner:
![service status][8]
This will, most importantly, tell you if a certain service is active **(**running**)** or not.
**Wrapping Up**
Today I detailed two very simple methods of managing services on Ubuntu or any other Linux system. I hope this article was helpful to you.
Which method do you prefer? Let us know in the comment section below!
--------------------------------------------------------------------------------
via: https://itsfoss.com/start-stop-restart-services-linux/
作者:[Sergiu][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/sergiu/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/keyboard-mouse-sharing-between-computers/
[2]: https://itsfoss.com/set-up-firewall-gufw/
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/systemctl_list_services.png?ssl=1
[4]: https://linuxhandbook.com/grep-command-examples/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/systemctl_grep_running.jpg?ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/systemctl_status.jpg?ssl=1
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/service_status_all.png?ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/service_status.jpg?ssl=1

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -0,0 +1,95 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Chill out with the Linux Equinox Desktop Environment)
[#]: via: (https://opensource.com/article/19/12/ede-linux-desktop)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
Chill out with the Linux Equinox Desktop Environment
======
This article is part of a special series of 24 days of Linux desktops.
EDE is not the most glamorous, minimal, nor efficient desktop. But its
soft, muted tones are calming, its familiarity soothing, and its icon
theme fun.
![Linux penguin at the north pole beside an igloo][1]
I haven't used the Fast Light Toolkit ([FLTK][2]) for anything serious yet, but I'm a fan of the C++ GUI toolkit that's pretty simple to learn and (in my experience) reliable even across updates. When I found out that there was a desktop environment built with FLTK, I was eager to try it—and I was quickly glad I did. The [Equinox Desktop Environment (EDE)][3] is a fast and simple desktop written in C++ and FLTK for Unix desktops. It uses common desktop conventions, so it looks and feels familiar right away, and after only a few days of using it, I found its simplicity provides a minimal elegance that I enjoy.
![EDE desktop][4]
### Installing EDE
You are likely to find EDE included in your distribution's software repository, but you can also find it in its [SourceForge repository][5]. If you're already running a different desktop, it's safe to install EDE on the same system because it brings along just a few extra applications, which are specific to EDE so they won't get in your way on other desktops.
EDE is only the desktop, and it uses the [Pekwm][6] window manager to handle layout.
After installing EDE, log out of your current desktop session so you can log into your new one. By default, your session manager (KDM, GDM, LightDM, or XDM, depending on your setup) will continue to log you into your previous desktop, so you must override that before logging in.
With GDM:
![][7]
With SDDM:
![][8]
When EDE first boots, you might be prompted to confirm some startup tasks. On my Slackware workstation, KDE had marked some services as startup tasks (such as the HPLIP print monitor and a Bluetooth daemon), and EDE imported them with just one confirmation box.
![Importing desktop services in EDE][9]
After setting it up once, you won't need to do it again.
### EDE desktop tour
EDE's layout is exactly what most people expect from a desktop: application menu on the left, taskbar in the middle, system tray on the right. It's the standard off-the-shelf layout that confuses nobody; this is a desktop that's safe to install on a Linux computer and hand over, with confidence, to someone who's never used Linux in their life. They'll fall right into this desktop with a soft and gentle landing.
You can bring up a small desktop menu with a right-click. This allows you to make an application launcher on the desktop, create a folder, and set some theme options.
The panel at the bottom of the screen is retractable, so you can work full-screen if you prefer. Click the clock in the bottom-right of the screen to bring up a calendar and time-zone settings.
EDE has a small Configuration Place application that provides access to a few simple preferences:
* Background and icon settings
* Screensaver settings
* Time and clock
* System bell
* Keyboard
* Preferred applications
![EDE Configuration Place][10]
There's not much more to EDE. There's no file manager, no text editor, or paint program, or game of solitaire. You must bring anything you want to run on your desktop. That means you get to pick and choose from the wide array of Linux applications and use whatever you love the most.
### EDE as a statement
I found the simplicity of EDE oddly comforting, at least as a kind of "holiday" desktop; it's a nice place to visit. It's not the most glamorous desktop available, nor the most minimal, nor the most efficient. But its soft, muted tones are calming, its familiarity soothing, and its icon theme fun and exuberant. EDE is a desktop that's proud of its slow and steady pace.
If you're in the mood to put your feet up and enjoy a clean and pleasant interface, try EDE.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/ede-linux-desktop
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/penguin.igloo_.png?itok=K92O7H6b (Linux penguin at the north pole beside an igloo)
[2]: https://www.fltk.org/
[3]: https://sourceforge.net/projects/ede/
[4]: https://opensource.com/sites/default/files/uploads/advent-ede.jpg (EDE desktop)
[5]: http://ede.sf.net
[6]: https://opensource.com/article/19/12/pekwm-linux-desktop
[7]: https://opensource.com/sites/default/files/advent-gdm_2.jpg
[8]: https://opensource.com/sites/default/files/advent-kdm_1.jpg
[9]: https://opensource.com/sites/default/files/uploads/advent-ede-init.jpg (Importing desktop services in EDE)
[10]: https://opensource.com/sites/default/files/uploads/advent-ede-conf.jpg (EDE Configuration Place)

View File

@ -0,0 +1,72 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Top articles for learning Python in 2020)
[#]: via: (https://opensource.com/article/19/12/learn-python)
[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg)
Top articles for learning Python in 2020
======
No matter where you are in your Python programming journey,
Opensource.com's top Python articles from 2019 will help you along the
way.
![Hands on a keyboard with a Python book ][1]
Python had a big year in 2019. According to popular resources like [GitHub][2] and [Stack Overflow][3], it's trending as the second most popular language in the world.
> "Python, the fastest-growing major programming language, has risen in the ranks of programming languages in our survey yet again, edging out Java this year and standing as the second most loved language (behind Rust)."
> — [Stack Overflow Insights][3]
Similarly, Python grew in readership on Opensource.com by leaps and bounds. Here are the top Python articles from 2019, grouped by topic, for your perusal.
### Why choose Python?
There are many languages out there, so what makes Python such a destination? If the most-read articles tell us anything, it's that people enjoy its flexibility. There are [multiple paradigms][4] that are accessible to Python developers, as Jigyasa Grover explains, including the popular [object-oriented programming][5] Seth Kenlon's tutorial shows.
If you're a long-time user and looking for advanced examples of why Python is a perfect language, Moshe Zadka covers his [top 5 reasons for loving Python][6]. If that's not enough, you can also use it play around with powerful tools without a lot of code, like in Parul Pandey's tutorial on [image manipulation][7].
### Configuring Python
As Python's popularity continues to rise, more people are starting with the language than ever before. Many of those first-timers are doing so on the Mac operating system and are using a [guide to setting up Python 3][8] that Moshe and I wrote.
After installing Python, decisions on where to write your code come next. There are many options when it comes to text editors and integrated development environments (IDEs), but readers appear to favor graphical options, as Stephan Avenwedde's article about [Pythonic][9] and my article on [JupyterLab][10] were the most read articles on that topic in 2019.
On the path to getting confident with the language, developers will have to face the multitude of options available for how to manage versions of the language and project dependencies. Luckily, László Kiss Kollár's article makes [managing Python packages][11] a bit simpler.
When you're ready to configure an IDE with all of the features you'll want to make the most of the language, be sure to give the [opinionated linter Black][12] a try, as Moshe explains, to keep your code clean.
### Wrapping up
No matter where you are in your path to enjoying Python programming, the top Python articles from 2019 are here to help you along the way. I can't wrap this up without at least one acknowledgment of the importance of testing, and Moshe offers another well-read article [on tox][13] for that purpose.
Thank you to all the authors who wrote for Opensource.com in 2019! If you're just learning to program in Python, let us know in the comments what you want to know. And, if you're a seasoned veteran, consider sharing your tips and tricks with us by [writing an article][14] about your favorite Python topic.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/learn-python
作者:[Matthew Broberg][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/mbbroberg
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book )
[2]: https://octoverse.github.com/#top-languages
[3]: https://insights.stackoverflow.com/survey/2019
[4]: https://opensource.com/article/19/10/python-programming-paradigms
[5]: https://opensource.com/article/19/7/get-modular-python-classes
[6]: https://opensource.com/article/19/10/why-love-python
[7]: https://opensource.com/article/19/3/python-image-manipulation-tools
[8]: https://opensource.com/article/19/5/python-3-default-mac
[9]: https://opensource.com/article/19/5/graphically-programming-pythonic
[10]: https://opensource.com/article/19/5/jupyterlab-python-developers-magic
[11]: https://opensource.com/article/19/4/managing-python-packages
[12]: https://opensource.com/article/19/5/python-black
[13]: https://opensource.com/article/19/5/python-tox
[14]: https://opensource.com/how-submit-article

View File

@ -0,0 +1,119 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Unix is turning 50. What does that mean?)
[#]: via: (https://www.networkworld.com/article/3511428/unix-is-turning-50-what-does-that-mean.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
Unix is turning 50. What does that mean?
======
Unix time, also known as 'epoch time,' is the number of seconds that have passed since Jan 1, 1970. As Unix turns 50, let's take a look at what worries kernel developers.
[cbaquiran][1] [(CC0)][2]
2020 is a significant year for Unix. At the very start of the year, Unix turns 50.
While some of the early development of Unix predates the official start of its "epoch," Jan 1, 1970 remains the zero-point in POSIX time and the recognized beginning of all things Unix. Jan 1, 2020 will mark 50 years since that moment.
### Unix time vs human time
In terms of human time, 50 years is a big deal. In terms of Unix time, there's nothing particularly special about 50 years. 48.7 years would be no less significant.
[][3]
BrandPost Sponsored by HPE
[Take the Intelligent Route with Consumption-Based Storage][3]
Combine the agility and economics of HPE storage with HPE GreenLake and run your IT department with efficiency.
Unix (including Linux) systems store date/time values as the number of seconds that have elapsed since 1970-01-01 00:00:00 UTC in 32 bits. To determine how many seconds have passed since that time and, thus, what right now looks like as a Unix time value, you can issue a command like this:
```
$ date +%s
1576883876
```
The **%s** argument tells the date command to display the current date/time as the number of seconds since the start of 1970-01-01.
### How much time can Unix systems manage?
To understand how much time Unix systems can accommodate, we need to look at the capacity of a 32-bit field. It can be calculated like this:
```
$ echo '2^32' | bc
4294967296
```
However, since Unix needs to accommodate negative numbers, it reserves one bit for a number's sign, thus reducing this to:
```
$ echo '2^31' | bc
2147483648
```
And, since Unix numbering begins with 0, that means we have 2,147,483,648 values, but the largest possible value is 2,147,483,647. Unix date/time values cannot exceed that number  just like the odometer on your car probably can't exceed 999,999 miles. Add 1 and the value turns to 0.
### How long is a year in seconds?
The number of seconds in most years can be calculated like this hours/day multiplied by minutes/hour multiplied by seconds/minute multiplied by the number of days in a year:
```
$ expr 24 \* 60 \* 60 \* 365
31536000
```
In leap years, we just add another day:
```
$ expr 24 \* 60 \* 60 \* 366
31622400
```
### **How will Unix see its 50 year birthday?**
12:00 AM on Jan 1, 2020 will be **1577836800** in epoch time. The calculation is a little tricky, but mostly because we have to accommodate leap years. Since the start of the epoch, we've had 12 leap years, starting in 1972, the last in 2016. And, when we reach 2020, we will have had 38 regular years.
Heres a calculation using the **expr** command to count the seconds in these 50 years:
```
$ expr 24 \* 60 \* 60 \* 365 \* 38 + 24 \* 60 \* 60 \* 366 \* 12
1577836800
```
The first half of that is calculating the seconds in the 38 non-leap years. We then add a similar calculation for leap years with their 366 days. Conversely, you could use the seconds per year figures presented earlier and just do this:
```
$ expr 31536000 \* 38 + 31622400 \* 12
1577836800
```
This way of tracking dates and times made Unix systems fairly impervious to the Y2K scare that had people in late 1999 worried that moving into the year 2000 would wreak havoc on computer systems. Far fewer problems were experienced than people feared. In fact, only applications which stored years in a two-digit format would see the year going to 00 as a sign that time jumping backwards. Still, lots of application developers had some tedious extra work piled onto their plates to ensure that their systems wouldnt run into serious problems when 2000 hit.
### When Unix time will run into problems
Unix systems wont run into a **Y2K** type of problem until **2038** when dates stored as described above will overrun their 32-bit space allotments. But thats 18 years from now, and kernel developers are already working on how they will avert disaster. Its a bit too early to start panicking.
The year 2038 problem is sometimes referred to as the **Y2K38** problem. We have until Tuesday, January 19, 2038 to address it. If the problem isnt resolved, systems after that date may think its 1901. One way to address the problem would be to switch to 64-bit representations of date/time information. Some people believe that even that will be a lot more complex than it sounds. In any case, its probably still too early to panic. And, in the meantime, maybe after singing "Auld Lang Syne" this New Years Eve, you can sing "Happy Birthday" to Unix. Its turning 50, and thats still a very big deal.
Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3511428/unix-is-turning-50-what-does-that-mean.html
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[1]: https://pixabay.com/en/birthday-cake-cake-birthday-380178/
[2]: https://creativecommons.org/publicdomain/zero/1.0/
[3]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE20773&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
[4]: https://www.facebook.com/NetworkWorld/
[5]: https://www.linkedin.com/company/network-world

View File

@ -0,0 +1,87 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Why your Python code should be flat and sparse)
[#]: via: (https://opensource.com/article/19/12/zen-python-flat-sparse)
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
Why your Python code should be flat and sparse
======
This is part of a special series about the Zen of Python focusing on the
fifth and sixth principles: flatness and sparseness.
![Digital creative of a browser on the internet][1]
The [Zen of Python][2] is called that for a reason. It was never supposed to provide easy-to-follow guidelines for programming. The rules are specified tersely and are designed to engage the reader in deep thought.
In order to properly appreciate the Zen of Python, you must read it and then meditate upon the meanings. If the Zen was designed to be a set of clear rules, it would be a fault that it has rules that contradict each other. However, as a tool to help you meditate on the best solution, contradictions are powerful.
### Flat is better than nested.
Nowhere is the pressure to be "flat" more obvious than in Python's strong insistence on indentation. Other languages will often introduce an implementation that "cheats" on the nested structure by reducing indentation requirements. To appreciate this point, let's take a look at JavaScript.
JavaScript is natively async, which means that programmers write code in JavaScript using a lot of callbacks.
```
a(function(resultsFromA) {
  b(resultsFromA, function(resultsfromB) {
    c(resultsFromC, function(resultsFromC) {
      console.log(resultsFromC)
   }
  }
}
```
Ignoring the code, observe the pattern and the way indentation leads to a right-most point. This distinctive "arrow" shape is tough on the eye to quickly walk through the code, so it's seen as undesirable and even nicknamed "callback hell." However, in JavaScript, it is possible to "cheat" and not have indentation reflect nesting.
```
a(function(resultsFromA) {
b(resultsFromA,
  function(resultsfromB) {
c(resultsFromC,
  function(resultsFromC) {
    console.log(resultsFromC)
}}}
```
Python affords no such options to cheat: every nesting level in the program must be reflected in the indentation level. So deep nesting in Python _looks_ deeply nested. That makes "callback hell" was a worse problem in Python than in JavaScript: nesting callbacks mean indenting with no options to "cheat" with braces.
This challenge, in combination with the Zen principle, has led to an elegant solution by a library I worked on. In the [Twisted][3] framework, we came up with the _deferred_ abstraction, which would later inspire the popular JavaScript _promise_ abstraction. In this way, Python's unwavering commitment to clear code forces Python developers to discover new, powerful abstractions.
```
future_value = future_result()
future_value.addCallback(a)
future_value.addCallback(b)
future_value.addCallback(c)
```
(This might look familiar to modern JavaScript programmers: Promises were heavily influenced by Twisted's deferreds.)
### Sparse is better than dense.
The easiest way to make something less dense is to introduce nesting. This habit is why the principle of sparseness follows the previous one: after we have reduced nesting as much as possible, we are often left with _dense_ code or data structures. Density, in this sense, is jamming too much information into a small amount of code, making it difficult to decipher when something goes wrong.
Reducing that denseness requires creative thinking, and there are no simple solutions. The Zen of Python does not offer simple solutions. All it offers are ways to find what can be improved in the code, without always giving guidance for "how."
Take a walk. Take a shower. Smell the flowers. Sit in a lotus position and think hard, until finally, inspiration strikes. When you are finally enlightened, it is time to write the code.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/zen-python-flat-sparse
作者:[Moshe Zadka][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/moshez
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet)
[2]: https://www.python.org/dev/peps/pep-0020/
[3]: https://twistedmatrix.com/trac/

View File

@ -0,0 +1,416 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (8 Commands to Check Memory Usage on Linux)
[#]: via: (https://www.2daygeek.com/linux-commands-check-memory-usage/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
8 Commands to Check Memory Usage on Linux
======
Linux is not like Windows and you will not get a GUI always, especially in a server environment.
As a Linux administrator, it is important to know how to check your available and used resources, such as memory, CPU, disk space, etc.
If there are any applications that use too much resources on the system to run your system at the optimum level you need to find and fix.
If you want to **[find out the top 10 memory (RAM) consumption processes in Linux][1]**, go to the following article.
In Linux, there are commands for everything, so use the corresponding commands.
In this tutorial, we will show you eight powerful commands to check memory usage on a Linux system, including RAM and swap.
**[Creating swap space on a Linux system][2]** is very important.
The following commands can help you check memory usage in Linux in different ways.
* free Command
* /proc/meminfo File
* vmstat Command
* ps_mem Command
* smem Command
* top Command
* htop Command
* glances Command
### 1) How to Check Memory Usage on Linux Using the free Command
**[Free command][3]** is the most powerful command widely used by the Linux administrator. But it provides very little information compared to the “/proc/meminfo” file.
Free command displays the total amount of free and used physical and swap memory on the system, as well as buffers and caches used by the kernel.
These information is gathered from the “/proc/meminfo” file.
```
# free -m
total used free shared buff/cache available
Mem: 15867 9199 1702 3315 4965 3039
Swap: 17454 666 16788
```
* **total:** Total installed memory
* **used:** Memory is currently in use by running processes (used= total free buff/cache)
* **free:** Unused memory (free= total used buff/cache)
* **shared:** Memory shared between two or more processes (multiple processes)
* **buffers:** Memory reserved by the kernel to hold a process queue request.
* **cache:** Size of the page cache that holds recently used files in RAM
* **buff/cache:** Buffers + Cache
* **available:** Estimation of how much memory is available for starting new applications, without swapping.
### 2) How to Check Memory Usage on Linux Using the /proc/meminfo File
The “/proc/meminfo” file is a virtual file that contains various real-time information about memory usage.
It shows memory stats in kilobytes, most of which are somewhat difficult to understand.
However it contains useful information about memory usage.
```
# cat /proc/meminfo
MemTotal: 16248572 kB
MemFree: 1764576 kB
MemAvailable: 3136604 kB
Buffers: 234132 kB
Cached: 4731288 kB
SwapCached: 28516 kB
Active: 9004412 kB
Inactive: 3552416 kB
Active(anon): 8094128 kB
Inactive(anon): 2896064 kB
Active(file): 910284 kB
Inactive(file): 656352 kB
Unevictable: 80 kB
Mlocked: 80 kB
SwapTotal: 17873388 kB
SwapFree: 17191328 kB
Dirty: 252 kB
Writeback: 0 kB
AnonPages: 7566736 kB
Mapped: 3692368 kB
Shmem: 3398784 kB
Slab: 278976 kB
SReclaimable: 125480 kB
SUnreclaim: 153496 kB
KernelStack: 23936 kB
PageTables: 73880 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 25997672 kB
Committed_AS: 24816804 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
Percpu: 3392 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB
DirectMap4k: 1059088 kB
DirectMap2M: 14493696 kB
DirectMap1G: 2097152 kB
```
### 3) How to Check Memory Usage on Linux Using the vmstat Command
The **[vmstat command][4]** is another useful tool for reporting virtual memory statistics.
vmstat reports information about processes, memory, paging, block IO, traps, disks, and cpu functionality.
vmstat does not require special permissions, and it can help identify system bottlenecks.
```
# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 682060 1769324 234188 4853500 0 3 25 91 31 16 34 13 52 0 0
```
If you want to understand this in detail, read the field description below.
**Procs**
* **r:** The number of runnable processes (running or waiting for run time).
* **b:** The number of processes in uninterruptible sleep.
**Memory**
* **swpd:** the amount of virtual memory used.
* **free:** the amount of idle memory.
* **buff:** the amount of memory used as buffers.
* **cache:** the amount of memory used as cache.
* **inact:** the amount of inactive memory. (-a option)
* **active:** the amount of active memory. (-a option)
**Swap**
* **si:** Amount of memory swapped in from disk (/s).
* **so:** Amount of memory swapped to disk (/s).
**IO**
* **bi:** Blocks received from a block device (blocks/s).
* **bo:** Blocks sent to a block device (blocks/s).
**System**
* **in:** The number of interrupts per second, including the clock.
* **cs:** The number of context switches per second.
**CPU : These are percentages of total CPU time.**
* **us:** Time spent running non-kernel code. (user time, including nice time)
* **sy:** Time spent running kernel code. (system time)
* **id:** Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
* **wa:** Time spent waiting for IO. Prior to Linux 2.5.41, included in idle.
* **st:** Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.
Run the following command for detailed information.
```
# vmstat -s
16248580 K total memory
2210256 K used memory
2311820 K active memory
2153352 K inactive memory
11368812 K free memory
107584 K buffer memory
2561928 K swap cache
17873388 K total swap
0 K used swap
17873388 K free swap
44309 non-nice user cpu ticks
164 nice user cpu ticks
14332 system cpu ticks
382418 idle cpu ticks
1248 IO-wait cpu ticks
1407 IRQ cpu ticks
2147 softirq cpu ticks
0 stolen cpu ticks
1022437 pages paged in
260296 pages paged out
0 pages swapped in
0 pages swapped out
1424838 interrupts
4979524 CPU context switches
1577163147 boot time
3318 forks
```
### 4) How to Check Memory Usage on Linux Using the ps_mem Command
**[ps_mem][5]** is a simple Python script that allows you to get core memory usage accurately for a program in Linux.
This can determine how much RAM is used per program (not per process).
It calculates the total amount of memory used per program, total = sum (private RAM for program processes) + sum (shared RAM for program processes).
The shared RAM is problematic to calculate, and the tool automatically selects the most accurate method available for the running kernel.
```
# ps_mem
Private + Shared = RAM used Program
180.0 KiB + 30.0 KiB = 210.0 KiB xf86-video-intel-backlight-helper (2)
192.0 KiB + 66.0 KiB = 258.0 KiB cat (2)
312.0 KiB + 38.5 KiB = 350.5 KiB lvmetad
380.0 KiB + 25.5 KiB = 405.5 KiB crond
392.0 KiB + 32.5 KiB = 424.5 KiB rtkit-daemon
852.0 KiB + 117.0 KiB = 969.0 KiB gnome-session-ctl (2)
928.0 KiB + 56.5 KiB = 984.5 KiB gvfs-mtp-volume-monitor
1.0 MiB + 42.5 KiB = 1.0 MiB dconf-service
1.0 MiB + 106.5 KiB = 1.1 MiB gvfs-goa-volume-monitor
1.0 MiB + 180.5 KiB = 1.2 MiB gvfsd
.
.
5.3 MiB + 3.0 MiB = 8.3 MiB evolution-addressbook-factory
8.5 MiB + 1.2 MiB = 9.7 MiB gnome-session-binary (4)
7.5 MiB + 3.1 MiB = 10.5 MiB polkitd
7.4 MiB + 3.3 MiB = 10.7 MiB pulseaudio (2)
7.0 MiB + 7.0 MiB = 14.0 MiB msm_notifier
12.7 MiB + 2.3 MiB = 15.0 MiB evolution-source-registry
13.3 MiB + 2.5 MiB = 15.8 MiB gnome-terminal-server
15.8 MiB + 1.0 MiB = 16.8 MiB tracker-miner-fs
18.7 MiB + 1.8 MiB = 20.5 MiB python3.7
16.6 MiB + 4.0 MiB = 20.5 MiB evolution-calendar-factory
22.3 MiB + 753.0 KiB = 23.0 MiB gsd-keyboard (2)
22.4 MiB + 832.0 KiB = 23.2 MiB gsd-wacom (2)
20.8 MiB + 2.5 MiB = 23.3 MiB blueman-tray
22.0 MiB + 1.8 MiB = 23.8 MiB blueman-applet
23.1 MiB + 934.0 KiB = 24.0 MiB gsd-xsettings (2)
23.7 MiB + 1.2 MiB = 24.9 MiB gsd-media-keys (2)
23.4 MiB + 1.6 MiB = 25.0 MiB gsd-color (2)
23.9 MiB + 1.2 MiB = 25.1 MiB gsd-power (2)
16.5 MiB + 8.9 MiB = 25.4 MiB evolution-alarm-notify
27.2 MiB + 2.0 MiB = 29.2 MiB systemd-journald
28.7 MiB + 2.8 MiB = 31.5 MiB c
29.6 MiB + 2.2 MiB = 31.8 MiB chrome-gnome-sh (2)
43.9 MiB + 6.8 MiB = 50.7 MiB WebExtensions
46.7 MiB + 6.7 MiB = 53.5 MiB goa-daemon
86.5 MiB + 55.2 MiB = 141.7 MiB Xorg (2)
191.4 MiB + 24.1 MiB = 215.4 MiB notepadqq-bin
306.7 MiB + 29.0 MiB = 335.7 MiB gnome-shell (2)
601.6 MiB + 77.7 MiB = 679.2 MiB firefox
1.0 GiB + 109.7 MiB = 1.1 GiB chrome (15)
2.3 GiB + 123.1 MiB = 2.5 GiB Web Content (8)
----------------------------------
5.6 GiB
==================================
```
### 5) How to Check Memory Usage on Linux Using the smem Command
**[smem][6]** is a tool that can provide numerous reports of memory usage on Linux systems. Unlike existing tools, smem can report Proportional Set Size (PSS), Unique Set Size (USS) and Resident Set Size (RSS).
Proportional Set Size (PSS): refers to the amount of memory used by libraries and applications in the virtual memory system.
Unique Set Size (USS) : Unshared memory is reported as USS (Unique Set Size).
Resident Set Size (RSS) : The standard measure of physical memory (it typically shared among multiple applications) usage known as resident set size (RSS) will significantly overestimate memory usage.
```
# smem -tk
PID User Command Swap USS PSS RSS
3383 daygeek cat 0 92.0K 123.0K 1.7M
3384 daygeek cat 0 100.0K 129.0K 1.7M
1177 daygeek /usr/lib/gnome-session-ctl 0 436.0K 476.0K 4.6M
1171 daygeek /usr/bin/dbus-daemon --conf 0 524.0K 629.0K 3.8M
1238 daygeek /usr/lib/xdg-permission-sto 0 592.0K 681.0K 5.9M
1350 daygeek /usr/lib/gsd-screensaver-pr 0 652.0K 701.0K 5.8M
1135 daygeek /usr/lib/gdm-x-session --ru 0 648.0K 723.0K 6.0M
.
.
1391 daygeek /usr/lib/evolution-data-ser 0 16.5M 25.2M 63.3M
1416 daygeek caffeine-ng 0 28.7M 31.4M 66.2M
4855 daygeek /opt/google/chrome/chrome - 0 38.3M 46.3M 120.6M
2174 daygeek /usr/lib/firefox/firefox -c 0 44.0M 50.7M 120.3M
1254 daygeek /usr/lib/goa-daemon 0 46.7M 53.3M 80.4M
3416 daygeek /opt/google/chrome/chrome - 0 44.7M 54.2M 103.3M
4782 daygeek /opt/google/chrome/chrome - 0 57.2M 65.8M 142.3M
1137 daygeek /usr/lib/Xorg vt2 -displayf 0 77.2M 129.6M 192.3M
3376 daygeek /opt/google/chrome/chrome 0 117.8M 131.0M 210.9M
4448 daygeek /usr/lib/firefox/firefox -c 0 124.4M 133.8M 224.1M
3558 daygeek /opt/google/chrome/chrome - 0 157.3M 165.7M 242.2M
2310 daygeek /usr/lib/firefox/firefox -c 0 159.6M 169.4M 259.6M
4331 daygeek /usr/lib/firefox/firefox -c 0 176.8M 186.2M 276.8M
4034 daygeek /opt/google/chrome/chrome - 0 179.3M 187.9M 264.6M
3911 daygeek /opt/google/chrome/chrome - 0 183.1M 191.8M 269.4M
3861 daygeek /opt/google/chrome/chrome - 0 199.8M 208.2M 285.2M
2746 daygeek /usr/bin/../lib/notepadqq/n 0 193.5M 217.5M 261.5M
1194 daygeek /usr/bin/gnome-shell 0 203.7M 219.0M 285.1M
2945 daygeek /usr/lib/firefox/firefox -c 0 294.5M 308.0M 410.2M
2786 daygeek /usr/lib/firefox/firefox -c 0 341.2M 354.3M 459.1M
4193 daygeek /usr/lib/firefox/firefox -c 0 417.4M 427.6M 519.3M
2651 daygeek /usr/lib/firefox/firefox -c 0 417.0M 430.1M 535.6M
2114 daygeek /usr/lib/firefox/firefox -c 0 430.6M 473.9M 610.9M
2039 daygeek /usr/lib/firefox/firefox -- 0 601.3M 677.5M 840.6M
-------------------------------------------------------------------------------
90 1 0 4.8G 5.2G 8.0G
```
### 6) How to Check Memory Usage on Linux Using the top Command
**[top command][7]** is one of the most frequently used commands by Linux administrators to understand and view the resource usage for a process on a Linux system.
It displays the total memory of the system, current memory usage, free memory and total memory used by the buffers.
In addition, it displays total swap memory, current swap usage, free swap memory, and total cached memory by the system.
```
# top -b | head -10
top - 11:04:39 up 40 min, 1 user, load average: 1.59, 1.42, 1.28
Tasks: 288 total, 2 running, 286 sleeping, 0 stopped, 0 zombie
%Cpu(s): 13.3 us, 1.5 sy, 0.0 ni, 84.4 id, 0.0 wa, 0.3 hi, 0.5 si, 0.0 st
KiB Mem : 16248572 total, 7755928 free, 4657736 used, 3834908 buff/cache
KiB Swap: 17873388 total, 17873388 free, 0 used. 9179772 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2114 daygeek 20 3182736 616624 328228 R 83.3 3.8 7:09.72 Web Content
2039 daygeek 20 4437952 849616 261364 S 13.3 5.2 7:58.54 firefox
1194 daygeek 20 4046856 291288 165460 S 4.2 1.8 1:57.68 gnome-shell
4034 daygeek 20 808556 273244 88676 S 4.2 1.7 1:44.72 chrome
2945 daygeek 20 3309832 416572 150112 S 3.3 2.6 4:04.60 Web Content
1137 daygeek 20 564316 197292 183380 S 2.5 1.2 2:55.76 Xorg
2651 daygeek 20 3098420 547260 275700 S 1.7 3.4 2:15.96 Web Content
2786 daygeek 20 2957112 463912 240744 S 1.7 2.9 3:22.29 Web Content
1 root 20 182756 10208 7760 S 0.8 0.1 0:04.51 systemd
442 root -51 S 0.8 0:05.02 irq/141-iw+
1426 daygeek 20 373660 48948 29820 S 0.8 0.3 0:03.55 python3
2174 daygeek 20 2466680 122196 78604 S 0.8 0.8 0:17.75 WebExtensi+
```
### 7) How to Check Memory Usage on Linux Using the htop Command
The **[htop command][8]** is an interactive process viewer for Linux/Unix systems. It is a text-mode application and requires the ncurses library, it was developed by Hisham.
It is designed as an alternative to the top command.
This is similar to the top command, but allows you to scroll vertically and horizontally to see all the processes running the system.
htop comes with Visual Colors, which have added benefits and are very evident when it comes to tracking system performance.
You are free to carry out any tasks related to processes, such as process killing and renicing without entering their PIDs.
[![][9]][10]
### 8) How to Check Memory Usage on Linux Using the glances Command
**[Glances][11]** is a cross-platform system monitoring tool written in Python.
You can see all information in one place such as CPU usage, Memory usage, running process, Network interface, Disk I/O, Raid, Sensors, Filesystem info, Docker, System info, Uptime, etc,.
![][9]
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/linux-commands-check-memory-usage/
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/how-to-find-high-cpu-consumption-processes-in-linux/
[2]: https://www.2daygeek.com/add-extend-increase-swap-space-memory-file-partition-linux/
[3]: https://www.2daygeek.com/free-command-to-check-memory-usage-statistics-in-linux/
[4]: https://www.2daygeek.com/linux-vmstat-command-examples-tool-report-virtual-memory-statistics/
[5]: https://www.2daygeek.com/ps_mem-report-core-memory-usage-accurately-in-linux/
[6]: https://www.2daygeek.com/smem-linux-memory-usage-statistics-reporting-tool/
[7]: https://www.2daygeek.com/linux-top-command-linux-system-performance-monitoring-tool/
[8]: https://www.2daygeek.com/linux-htop-command-linux-system-performance-resource-monitoring-tool/
[9]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[10]: https://www.2daygeek.com/wp-content/uploads/2019/12/linux-commands-check-memory-usage-2.jpg
[11]: https://www.2daygeek.com/linux-glances-advanced-real-time-linux-system-performance-monitoring-tool/

View File

@ -0,0 +1,149 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Khadas VIM3L: An Open Source HTPC Device)
[#]: via: (https://itsfoss.com/vim3l/)
[#]: author: (Community https://itsfoss.com/author/itsfoss/)
Khadas VIM3L: An Open Source HTPC Device
======
If youve read our list of [Raspberry Pi alternatives][1], you might have come across VIM by Khadas.
China-based [Khadas][2] is becoming increasingly popular for its single board computers (SCB). Apart from the generic do-it-yourself (DIY) VIM series, Khadas also has [Tone boards][3] that can be utilized for DJing and [Edge][4] boards for AI and other related projects.
As discussed in [Raspberry Pi projects][5], one of the most popular use of a single board computer is to use it as a media center. You can turn your TV in more than just a smart TV (without being monitored) and play local music, videos, pictures and even games on your TV. You can also watch streaming services through these media center.
You can always configure VIm (or any other SCB) as a media center. Its a good DIY exercise but not everyone would like it.
This is why Khadas has introduced [VIM3L][6] which is a ready to use media center device based on VIM 3. In this article, well have a look at this device and see how to set it up.
### VIM 3L specifications
One of the strong point of Khadas is its emphasis on open source. All their source code, including [U-Boot][7], mainline Linux and Android is available on [their GitHub repository][8].
VIM3L comes with [CoreELEC][9] operating system. CoreELEC is a custom Linux distribution that comes with software like [Kodi][10] and its add-ons to give you a complete HTPC (home theatre PC) experience.
![][11]
You are not restricted to CoreELEC though. You can get the barebon version of VIM 3L and use Android or install your a Linux distribution of your choice.
* Amlogic S905D3 SoC with quad-core Cortex-A55 CPU clocked at 1.9GHz
* 16GB eMMC
* 2GB RAM
* 2x WiFi antennas
* PCIe 2.0 and M.2 NVMe SSD support
* HDMI port
* Dolby Audio
The HTPC version costs slightly more than the bare board but it consists of some additional hardware along with CoreELEC operating system:
* Transparent DIY case
* Metal DIY case
* Heatsink
* IR Remote
![VIM3L HTPC Kit][12]
VIM3L is capable of running 4K video at 75 fps. It also includes TrustZone based security for DRM video streaming. Both Android and CoreELEC are capable of [OTA updates][13].
[VIM3L HTPC version costs $89.99][14] and the bare board (with Android) costs $69.99. Its FOSS readers can _**get $6 off with itsfossfuns coupon code**_ that can be used at the checkout page of Khadas shop.
[Khadas VIM3 Series][15]
You may opt for the free shipping option but it will take 2-3 weeks for the device to reach you from China. You can pay $20 extra for an express DHL shipping. The shipping options are available at checkout. I think you might have to pay custom tax depending on your countrys rules so ordering one from Amazon would be better in such a case but you wont get the Its FOSS special discount on Amazon.
Now that you are aware of the specifications, let me show you how to set it up and how was my experience with it.
_The amazon links in this article are affiliate links. Please read our [affiliate policy][16]._
### Setting up VIM3L and using it as home theatre PC
Initially, when you start VIM3L, a window appears on the screen which consists of a series of questions and options. Everything you choose determines the initial state of its operation. In each case, however, you can modify your options from the settings menu. Better not to rush through the settings, since the multitude of options you have at startup seem to turn the VIM3L into a superpower device.
![Setting up proxy network][17]
The addition of the proxy connectivity in the internet settings is a welcome option. As a enthusiast of user privacy, I enabled it to connect through the [Tor network][18]. The choice is of course yours.
![Peripheral devices][19]
You can modify how many and which peripheral devices you have on that device. For example, in addition to the handheld control, you can mount a keyboard or even a console controller. Correct! A console controller that will allow you to play games.
![Option to save logs][20]
An important addition is the log storage option. With this, the users can consult the logs in case of an event of an error or malfunction. This could help in troubleshooting the issue.
![Plenty of add-ons][21]
On the left, a user can see options such as music, videos, radio, photos, games and many other options that we would like to take some time to cover.
Add-ons further extends the capabilities of your HTPC. Here, you can find music libraries, documentaries, games, open-source software and more. The software includes various graphics, audio, and video editors, simulators etc.
You have the freedom to choose whether you want to download them through 3rd party repositories, or from the environment of the accessory. Also, if you try to install software, you will most likely notice that along with the program, appropriate libraries and software are also installed. As you can see, this is not an accessory from scratch, but an accessory that is ready to cope with its users choices.
VIM3L has different configuration profile consisting of a standard, intermediate, expert profile. As you climb into difficulty, your choices are multiplied, giving you total freedom.
### Thoughts on VIM3L
![][22]
I liked VIM3L for what it offers. This is not to say that it is a perfect device.
I found that some point, the controller is not fully accurate in signal transmission. As a result, after pressing a button twice, the signal is sent later and there is a quick change of screen. Maybe the controller I received was faulty.
In conclusion, I would like to say that its not an expensive device and the feature it offers are good enough to provide you with entertainment, fun, productivity, and creativity. Most importantly, the software it offers are free and open source.
If you like what you see here, you can either order it from [its own shop that ships from China][6] or get it from [Amazon][23].
Preview | Product | Price |
---|---|---|---
![Khadas Amlogic S905D3 VIM3L HTPC Kit][24] ![Khadas Amlogic S905D3 VIM3L HTPC Kit][24] | [Khadas Amlogic S905D3 VIM3L HTPC Kit][25] | $89.99[][26] | [Buy on Amazon][27]
Have you used VIM3L or any other pre-built media center device? Or do you prefer making your own HTPC? Do share your views.
--------------------------------------------------------------------------------
via: https://itsfoss.com/vim3l/
作者:[Community][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/itsfoss/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/raspberry-pi-alternatives/
[2]: https://www.khadas.com/
[3]: https://www.amazon.com/dp/B07K6GQNH3?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Tone boards)
[4]: https://www.khadas.com/edge
[5]: https://itsfoss.com/raspberry-pi-projects/
[6]: https://www.khadas.com/vim3l
[7]: https://www.denx.de/wiki/U-Boot
[8]: https://github.com/khadas
[9]: https://coreelec.org/
[10]: https://itsfoss.com/install-kodi-ubuntu/
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/VIM3L_OS_Freedom_graphic.jpg?ssl=1
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/VIM3L-Htpc-Kit.jpg?ssl=1
[13]: https://source.android.com/devices/tech/ota
[14]: https://www.amazon.com/dp/B081H66D7Q?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (VIM3L HTPC version costs $89.99)
[15]: https://www.khadas.com/shop-vim3
[16]: https://itsfoss.com/affiliate-policy/
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/khadas_vim3l_3.jpg?ssl=1
[18]: https://itsfoss.com/tor-guide/
[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/khadas_vim3l_2.jpg?ssl=1
[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/khadas_vim3l_4.jpg?ssl=1
[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/khadas_vim3l_1.jpg?ssl=1
[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/VIM3L.jpg?ssl=1
[23]: https://www.amazon.com/dp/B081H66D7Q?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Amazon)
[24]: https://i0.wp.com/m.media-amazon.com/images/I/41YC-mlA2PL._SL160_.jpg?ssl=1
[25]: https://www.amazon.com/dp/B081H66D7Q?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Khadas Amlogic S905D3 VIM3L HTPC Kit)
[26]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime)
[27]: https://www.amazon.com/dp/B081H66D7Q?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon)

View File

@ -1,75 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Customize your Linux desktop with FVWM)
[#]: via: (https://opensource.com/article/19/12/fvwm-linux-desktop)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
使用 FVWM 自定义 Linux 桌面
======
本文是 24 天 Linux 桌面特别系列的一部分。如果你正在寻找轻巧,快速且简单的 Linux 窗口管理器,那么 FVWM 可以胜任。但是,如果你正在寻找可以深入,探索和破解,那么 FVWM 是必须的。
![Coding on a computer][1]
[FVWM][2] 窗口管理器最早是对早在 1993 年的 [TWM][3] 的修改。经过几年的迭代,出现了一个可高度自定义的环境,它可以配置任何行为、动作或事件。它支持自定义键绑定、鼠标手势、主题、脚本等。
尽管 FVWM 在安装后即可使用但默认发行版仅提供最小的配置。这是开始自定义桌面环境的良好基础但是如果你只想将其用作桌面那么可能要安装另一个用户发布的完整配置。FVWM 有几种不同的发行版,包括模仿 Windows 95 的 FVWM95至少在外观和布局上。我尝试了 [FVWM-Crystal][4],这是一个具有一些现代 Linux 桌面约定的现代主题。
从 Linux 发行版的软件仓库中安装要尝试的 FVWM 发行版。如果找不到特定的 FVWM 发行版,那么可以安装基础的 FVWM2 包,然后进入 [Box-Look.org][5] 手动下载主题包。这样就需要更多的工作,但比从头开始构建要少。
安装后,请注销当前的桌面会话,以便你可以登录 FVWM。默认情况下会话管理器KDM、GDM、LightDM 或 XDM取决于你的设置将继续登录到以前的桌面因此你必须在登录之前覆盖该桌面。
对于 GDM
![Select your desktop session in GDM][6]
对于 KDM
![Select your desktop session with KDM][7]
### FVWM 桌面
无论你使用什么主题和配置当你在桌面上单击鼠标左键时FVWM 至少会显示一个菜单。菜单的内容取决于你所安装的。FVWM-Crystal 分发中的菜单包含对常用首选项的快速访问,例如屏幕分辨率、壁纸设置、窗口装饰等。
与 FVWM 中的几乎所有东西一样,你可以在菜单中编辑你要想的内容,但 FVWM-Crystal 倾向应用菜单栏。应用菜单位于屏幕的左上角每个图标都包含相关应用启动器的菜单。例如GIMP 图标表示图像编辑器KDevelop 图标表示集成开发环境IDEGNU 图标表示文本编辑器,等等,具体取决于你在系统上安装的程序。
![FVWM-crystal running on Slackware 14.2][8]
FVWM-Crystal 还提供虚拟桌面、任务栏、时钟和应用栏。
关于背景,你可以使用与 FVWM-Crystal 捆绑在一起的壁纸,也可以使用 **feh** 命令设置自己的壁纸(你可能需要从仓库中安装它)。此命令有一些设置背景的选项,包括 **\-bg-scale** 使用缩放填充屏幕,**\-bg-fill** 直接填充而不缩放图片,等等。
```
`$ feh --bg-scale ~/Pictures/wallpapers/mybackground.jpg`
```
大多数配置文件都包含在 **$HOME/.fvwm-crystal** 中,某些系统范围的默认文件位于 **/usr/share/fvwm-crystal**。
### 自己尝试一下
FVWM 是桌面构建平台,也是窗口管理器。它不会为你做什么事情,它期望你来配置尽可能的一切。
如果你正在寻找轻巧,快速且简单的窗口管理器,那么 FVWM 可以胜任。但是,如果你正在寻找可以深入,探索和破解,那么 FVWM 是必须的。
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/12/fvwm-linux-desktop
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer)
[2]: http://www.fvwm.org/
[3]: https://en.wikipedia.org/wiki/Twm
[4]: https://www.box-look.org/p/1018270/
[5]: http://box-look.org
[6]: https://opensource.com/sites/default/files/advent-gdm_0.jpg (Select your desktop session in GDM)
[7]: https://opensource.com/sites/default/files/advent-kdm.jpg (Select your desktop session with KDM)
[8]: https://opensource.com/sites/default/files/advent-fvwm-crystal.jpg (FVWM-crystal running on Slackware 14.2)

View File

@ -0,0 +1,183 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Start, Stop & Restart Services in Ubuntu and Other Linux Distributions)
[#]: via: (https://itsfoss.com/start-stop-restart-services-linux/)
[#]: author: (Sergiu https://itsfoss.com/author/sergiu/)
如何在 Ubuntu 和其他 Linux 发行版中启动、停止和重启服务
======
服务是必不可少的后台进程,它通常随系统启动,并在关机时关闭。
如果你是系统管理员,那么你会定期处理服务。
如果你是普通桌面用户,你可能会遇到需要重启服务的情况,例如[安装 Barrier 来用于在计算机之间共享鼠标和键盘][1]。或[在使用 ufw 设置防火墙][2]时。
今天,我将向你展示两种管理服务的方式。你将学习在 Ubuntu 或任何其他 Linux 发行版中启动、停止和重启服务。
systemd 与 init
如今Ubuntu 和许多其他发行版都使用 systemd 而不是旧的 init。
在 systemd 中,可以使用 systemctl 命令管理服务。
在 init 中,你可以使用 service 命令管理服务。
你会注意到,即使你的 Linux 系统使用 systemd它仍然可以使用 service 命令(为了与 init 系统一起使用)。这是因为 service 命令实际上已重定向到 systemctl。systemd 引入了向后兼容性,因为系统管理员们习惯使用 service 命令。
在本教程中,我将同时展示 systemctl 和 service 命令。
_我的是 Ubuntu 18.04但其他版本的过程也一样_。
### 方法 1使用 systemd 在 Linux 中管理服务
我从 systemd 开始,因为它被广泛接受。
#### 1\. 列出所有服务
为了管理服务,你首先需要知道系统上有哪些服务可用。
你可以使用 systemd 命令列出 Linux 系统上的所有服务:
```
systemctl list-unit-files --type service -all
```
![systemctl list-unit-files][3]
此命令将输出所有服务的状态。服务状态有启用、禁用、屏蔽(在取消掩码之前处于非活动状态)、静态和已生成。
与 [grep 命令][4] 结合,你可以**仅显示正在运行的服务**
```
sudo systemctl | grep running
```
![Display running services systemctl][5]
现在,你知道了如何引用所有不同的服务,你可以开始主动管理它们。
**注意:** 命令中的 **&lt;service-name&gt;** 应该用你想管理的服务名代替。比如network-manager、ufw 等)
#### 2\. 启动服务
要在 Linux 中启动服务,你只需使用它的名字:
```
systemctl start <service-name>
```
#### 3\. 停止服务
要停止 systemd 服务,可以使用 systemctl 命令的 stop 选项:
```
systemctl stop <service-name>
```
#### 4\. 重启服务
要重启 systemd 服务,可以使用:
```
systemctl restart <service-name>
```
#### 5\. 检查服务状态
你可以通过打印服务状态来确认你已经成功执行特定操作:
```
systemctl status <service-name>
```
这将以以下方式输出:
![systemctl status][6]
这是 systemd 的内容。现在切换到 init。
### 方法 2使用 init 在 Linux 中管理服务
init 的命令和 systemd 的一样简单。
#### 1\. 列出所有服务
要列出所有 Linux 服务,使用:
```
service --status-all
```
![service status-all][7]
前面的 **[ ]** 代表**禁用****[ + ]** 代表**启用**。
#### 2\. 启动服务
要在 Ubuntu 和其他发行版中启动服务,使用命令:
```
service <service-name> start
```
#### 3\. 停止服务
停止服务同样简单。
```
service <service-name> stop
```
#### 4\. 重启服务
如果你想重启服务,命令是:
```
service <service-name> restart
```
#### 5\. 检查服务状态
此外,要检查是否达到了预期的结果,你可以输出服务**状态**
```
service <service-name> status
```
这将以以下方式输出:
![service status][8]
最重要的是,这将告诉你某项服务是否处于活跃状态(**正在运行**)。
**总结**
今天,我详细介绍了两种在 Ubuntu 或任何其他 Linux 系统上管理服务的非常简单的方法。 希望本文对你有所帮助。
你更喜欢哪种方法? 让我在下面的评论中知道!
--------------------------------------------------------------------------------
via: https://itsfoss.com/start-stop-restart-services-linux/
作者:[Sergiu][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/sergiu/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/keyboard-mouse-sharing-between-computers/
[2]: https://itsfoss.com/set-up-firewall-gufw/
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/systemctl_list_services.png?ssl=1
[4]: https://linuxhandbook.com/grep-command-examples/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/systemctl_grep_running.jpg?ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/12/systemctl_status.jpg?ssl=1
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/service_status_all.png?ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/service_status.jpg?ssl=1