mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-03 01:10:13 +08:00
Merge branch 'LCTT:master' into master
This commit is contained in:
commit
be15b455b6
411
published/20200916 Analyze Linux startup performance.md
Normal file
411
published/20200916 Analyze Linux startup performance.md
Normal file
@ -0,0 +1,411 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (jiamn)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-14462-1.html)
|
||||
[#]: subject: (Analyze Linux startup performance)
|
||||
[#]: via: (https://opensource.com/article/20/9/systemd-startup-configuration)
|
||||
[#]: author: (David Both https://opensource.com/users/dboth)
|
||||
|
||||
Linux 启动性能分析
|
||||
======
|
||||
|
||||
> 用 systemd-analyze 洞悉并解决 Linux 启动性能问题。
|
||||
|
||||

|
||||
|
||||
系统管理员的一部分工作就是分析系统性能,发现并解决引起性能不佳、启动时间长的问题。系统管理员也需要去检查 systemd 的配置和使用的其它方面。
|
||||
|
||||
systemd 初始化系统提供了 `systemd-analyze` 工具,可以帮助发现性能问题和其他重要的 systemd 信息。在以前的文章《[分析 systemd 日历和时间跨度][2]》里,我用了 `systemd-analyze` 去分析 systemd 里的时间戳和时间跨度,但是这个工具还有很多其他用法,这个文章里我将再揭示一些。
|
||||
|
||||
(LCTT 译注:systemd 是目前主流 Linux 发行版采用的系统管理系统)
|
||||
|
||||
(LCTT 译注:为了区分英文的 “boot” 和 “startup” 的不同涵义,此处将 “boot” 翻译为“引导”,“startup” 翻译为“启动”。)
|
||||
|
||||
### 概述启动
|
||||
|
||||
Linux 启动过程是值得学习关注的地方,因为 `systemd-analyze` 工具很多功能聚焦在<ruby>启动<rt>startup</rt></ruby>过程。但是首先,要理解<ruby>引导<rt>boot</rt></ruby>和<ruby>启动<rt>startup</rt></ruby>。引导阶段从 BIOS 加电自检(POST)开始,结束于内核完成加载并控制主机系统,然后是开始了启动过程,也是 systemd 日志的开始点。
|
||||
|
||||
这个系列的第二篇文章《[理解 Linux 启动时的 systemd][3]》中,我详细讨论了启动阶段的内容和过程。在这篇文章里,我想研究一下启动过程,看看需要多少时间和大部分时间花费在哪里。
|
||||
|
||||
下面我将展示的结果来自我的主要工作站,这比虚拟机的结果要有趣得多。这个工作站包括一块 华硕 TUF X299 Mark 2 主板、一个英特尔 i9-7960X CPU(16 核 32 线程),64 G 内存。下面的一些命令非 root 用户也可以使用,但是我在这篇文章里使用了 root 用户,以避免在用户之间切换。
|
||||
|
||||
检查启动过程有几种方法,最简单的 `systemd-analyze` 命令显示了启动的几个主要部分耗费的时间,包括内核启动、装载运行 initrd(即初始 ramdisk,这是一个用来初始化一些硬件、挂载 `/` 根文件系统的临时系统镜像),还有用户空间(加载所有使主机达到可用状态的程序和守护程序)。如果没有像该命令传递子命令,默认是 `systemd-analyze time`:
|
||||
|
||||
```
|
||||
[root@david ~]$ systemd-analyze
|
||||
Startup finished in 53.921s (firmware) + 2.643s (loader) + 2.236s (kernel) + 4.348s (initrd) + 10.082s (userspace) = 1min 13.233s
|
||||
graphical.target reached after 10.071s in userspace
|
||||
[root@david ~]#
|
||||
```
|
||||
|
||||
这个输出中最值得注意的数据是在固件(BIOS)中花费的时间:几乎 54 秒。这是一个不太正常的时间,我的其他物理系统都没有花费这么长的时间来通过 BIOS。
|
||||
|
||||
我的 System76 Oryx Pro 笔记本在 BIOS 阶段只花了 8.506 秒,我家里所有的系统都在 10 秒以内。在线搜索一阵之后,我发现这块主板以其超长的 BIOS 引导时间而闻名。我的主板从不“马上启动”,总是挂起,我需要关机再开机,BIOS 报错,按 `F1` 进入 BIOS 设置,选择要引导的驱动器完成引导,多花费的时间就是这样用掉的。
|
||||
|
||||
不是所有主机都会显示固件数据(LCTT 译注:固件引导中不涉及 systemd)。我的不科学的实验使我相信,这个数据只显示给英特尔 9 代或以上的处理器。但这可能是不正确的。
|
||||
|
||||
这个关于引导、启动的概述提供了很好的(虽然有限)的信息,但是还有很多关于启动的信息,我将在下面描述。
|
||||
|
||||
### 分配责任
|
||||
|
||||
你可以用 `systemd-analyze blame` 来发现哪个 systemd 单元的初始化时间最长。其结果按照初始化时间长短排序,从多到少:
|
||||
|
||||
```
|
||||
[root@david ~]$ systemd-analyze blame
|
||||
5.417s NetworkManager-wait-online.service
|
||||
3.423s dracut-initqueue.service
|
||||
2.715s systemd-udev-settle.service
|
||||
2.519s fstrim.service
|
||||
1.275s udisks2.service
|
||||
1.271s smartd.service
|
||||
996ms upower.service
|
||||
637ms lvm2-monitor.service
|
||||
533ms lvm2-pvscan@8:17.service
|
||||
520ms dmraid-activation.service
|
||||
460ms vboxdrv.service
|
||||
396ms initrd-switch-root.service
|
||||
<截断:删去了好多时间不长的条目>
|
||||
```
|
||||
|
||||
因为很多服务是并行开始的,在 BIOS 之后所有单元加在一起的总数大大超过了 `systemd-analyze time` 汇总数。很多都是小数,不能显著的节省时间。
|
||||
|
||||
这个命令提供的数据指明了改善启动时间的办法。无用的服务可以禁用(`disable`)。在这个启动过程中,似乎没有任何一个服务需要花费过长的时间。你可能会在每次启动时看到不同的结果。(LCTT 译注:并行启动服务的原因)
|
||||
|
||||
### 关键链
|
||||
|
||||
就像项目管理中的关键路径一样,关键链显示了在启动过程中发生的时间关键的事件链(LCTT 译注:systemd 可以定义服务间的依赖,构成关键链)。如果启动缓慢,这些是你想查看的 systemd 单元,因为它们是导致延迟的单元。这个工具不会显示所有启动的单元,只显示这个关键事件链中的单元。(LCTT 译注:相当于最短路径。并不显示依赖不在关键链上的服务单元)
|
||||
|
||||
```
|
||||
[root@david ~]# systemd-analyze critical-chain
|
||||
The time when unit became active or started is printed after the "@" character.
|
||||
The time the unit took to start is printed after the "+" character.
|
||||
|
||||
graphical.target @10.071s
|
||||
└─lxdm.service @10.071s
|
||||
└─plymouth-quit.service @10.047s +22ms
|
||||
└─systemd-user-sessions.service @10.031s +7ms
|
||||
└─remote-fs.target @10.026s
|
||||
└─remote-fs-pre.target @10.025s
|
||||
└─nfs-client.target @4.636s
|
||||
└─gssproxy.service @4.607s +28ms
|
||||
└─network.target @4.604s
|
||||
└─NetworkManager.service @4.383s +219ms
|
||||
└─dbus-broker.service @4.434s +136ms
|
||||
└─dbus.socket @4.369s
|
||||
└─sysinit.target @4.354s
|
||||
└─systemd-update-utmp.service @4.345s +9ms
|
||||
└─auditd.service @4.301s +42ms
|
||||
└─systemd-tmpfiles-setup.service @4.254s +42ms
|
||||
└─import-state.service @4.233s +19ms
|
||||
└─local-fs.target @4.229s
|
||||
└─Virtual.mount @4.019s +209ms
|
||||
└─systemd-fsck@dev-mapper-vg_david2\x2dVirtual.service @3.742s +274ms
|
||||
└─local-fs-pre.target @3.726s
|
||||
└─lvm2-monitor.service @356ms +637ms
|
||||
└─dm-event.socket @319ms
|
||||
└─-.mount
|
||||
└─system.slice
|
||||
└─-.slice
|
||||
[root@david ~]#
|
||||
```
|
||||
|
||||
前面有 `@` 的数字表示单元激活开始启动所使用的绝对秒数。前面有 `+` 的数字显示单元启动所需的时间。
|
||||
|
||||
### 系统状态
|
||||
|
||||
有时候你需要确定系统的当前状态,`systemd-analyze dump` 命令转储了当前系统状态的大量数据。有主要的启动时间戳,一个每个 systemd 单元的列表,并对每个单元状态进行了完整描述:
|
||||
|
||||
```
|
||||
[root@david ~]# systemd-analyze dump
|
||||
Timestamp firmware: 1min 7.983523s
|
||||
Timestamp loader: 3.872325s
|
||||
Timestamp kernel: Wed 2020-08-26 12:33:35 EDT
|
||||
Timestamp initrd: Wed 2020-08-26 12:33:38 EDT
|
||||
Timestamp userspace: Wed 2020-08-26 12:33:42 EDT
|
||||
Timestamp finish: Wed 2020-08-26 16:33:56 EDT
|
||||
Timestamp security-start: Wed 2020-08-26 12:33:42 EDT
|
||||
Timestamp security-finish: Wed 2020-08-26 12:33:42 EDT
|
||||
Timestamp generators-start: Wed 2020-08-26 16:33:42 EDT
|
||||
Timestamp generators-finish: Wed 2020-08-26 16:33:43 EDT
|
||||
Timestamp units-load-start: Wed 2020-08-26 16:33:43 EDT
|
||||
Timestamp units-load-finish: Wed 2020-08-26 16:33:43 EDT
|
||||
Timestamp initrd-security-start: Wed 2020-08-26 12:33:38 EDT
|
||||
Timestamp initrd-security-finish: Wed 2020-08-26 12:33:38 EDT
|
||||
Timestamp initrd-generators-start: Wed 2020-08-26 12:33:38 EDT
|
||||
Timestamp initrd-generators-finish: Wed 2020-08-26 12:33:38 EDT
|
||||
Timestamp initrd-units-load-start: Wed 2020-08-26 12:33:38 EDT
|
||||
Timestamp initrd-units-load-finish: Wed 2020-08-26 12:33:38 EDT
|
||||
-> Unit system.slice:
|
||||
Description: System Slice
|
||||
Instance: n/a
|
||||
Unit Load State: loaded
|
||||
Unit Active State: active
|
||||
State Change Timestamp: Wed 2020-08-26 12:33:38 EDT
|
||||
Inactive Exit Timestamp: Wed 2020-08-26 12:33:38 EDT
|
||||
Active Enter Timestamp: Wed 2020-08-26 12:33:38 EDT
|
||||
Active Exit Timestamp: n/a
|
||||
Inactive Enter Timestamp: n/a
|
||||
May GC: no
|
||||
<截断:删除了大量的输出行>
|
||||
```
|
||||
|
||||
在我的主工作站上,这个命令生成了 49680 行输出,大概 1.66MB,这个命令非常快,不需要等待。
|
||||
|
||||
我很喜欢为各种连接设备(如存储设备)提供的大量细节。每个 systemd 单元有一个部分,包括各种运行时、缓存、日志目录的模式、启动单元的命令行、PID、开始时间戳,以及内存和文件限制等细节。
|
||||
|
||||
`systemd-analyze` 的手册页里展示了 `systemd-analyze --user dump` 选项,目的是显示用户管理器的内部状态。但这个选项对我来说是失败的,互联网搜索之后表明它可能有一些问题。在 systemd 里,`--user` 实例用来管理和控制处理器给每个用户的进程资源。处理能力按分给每个用户的进程都属于一个控制组,我将在以后的文章中介绍。
|
||||
|
||||
### 分析图表
|
||||
|
||||
大多数啥都不懂的猥琐老板(PHB)和许多优秀的管理者都发现漂亮的图表比我通常喜欢的基于文本的系统性能数据更容易阅读和理解。但有时,即使是我也喜欢一个好的图表,`systemd-analyze` 提供了显示引导/启动数据的 [SVG][4] 矢量图表。
|
||||
|
||||
下面的命令生成一个矢量图文件,来显示在引导和启动过程发生的事件。生成这个文件只需要几秒:
|
||||
|
||||
```
|
||||
[root@david ~]# systemd-analyze plot > /tmp/bootup.svg
|
||||
```
|
||||
|
||||
这个命令创建了一个 SVG 文件,SVG 是一个定义了一系列图形矢量的文本文件,包括 Image Viewer、Ristretto、Okular、Eye of Mate、LibreOffice Draw 在内的这些可以生成图形的应用,可以用 SVG 来创建图像。
|
||||
|
||||
我用 LibreOffice Draw(LCTT 译注:一个办公文档软件)来渲染一幅图形。这张图形很大,你需要放到很大才能看清细节。这里是它的一小部分:
|
||||
|
||||
![The bootup.svg file displayed in LibreOffice Draw.][5]
|
||||
|
||||
图中时间轴上零点(0)的左边是引导阶段,零点的右边是启动阶段。这一小部分显示了内核、initrd 和 initrd 启动的进程。
|
||||
|
||||
这张图一目了然地显示了什么时候启动,启动需要多少时间,以及主要的依赖项。关键路径用红色高亮显示。
|
||||
|
||||
另外一个生成图形输出的命令是 `systemd-analyze plot`,它生成了 [DOT][7] 格式的文本依赖图。产生的数据流通过 `dot` 工具进行处理,这是一组用来从多种类型数据中生成矢量图文件的程序。这些 SVG 文件也能被上面列出的工具处理。
|
||||
|
||||
首先,生成文件,在我的主工作站花了 9 分钟:
|
||||
|
||||
```
|
||||
[root@david ~]# time systemd-analyze dot | dot -Tsvg > /tmp/test.svg
|
||||
Color legend: black = Requires
|
||||
dark blue = Requisite
|
||||
dark grey = Wants
|
||||
red = Conflicts
|
||||
green = After
|
||||
|
||||
real 8m37.544s
|
||||
user 8m35.375s
|
||||
sys 0m0.070s
|
||||
[root@david ~]#
|
||||
```
|
||||
|
||||
我不会在这里重现输出,因为产生的图形就像一大堆意大利面条。但是你应该试试,看看我想让你看到的结果。
|
||||
|
||||
### 条件
|
||||
|
||||
在阅读 systemd-analyze(1) 的手册页时,我发现了一个更有趣的功能,但又有点通用,就是条件子命令。(是的,我确实在读手册页,而且我神奇地通过这种方式学到了很多东西!)。这个 `condition` 子命令能用来测试 systemd 单元文件中的条件和断言。
|
||||
|
||||
它也可以在脚本中用来评估一个或多个条件 —— 如果所有条件都满足,则返回 0;如果有条件不满足,则返回 1。在其它情况下,它都会输出其结果文本。
|
||||
|
||||
下面的例子来自手册页,稍微有点复杂。它测试了内核版本是否在 4.0 和 5.1 之间,主机是否使用交流电供电,系统结构是否是 ARM,以及 `/etc/os-release` 目录是否存在。我添加了 `echo $?` 来打印返回值。
|
||||
|
||||
```
|
||||
[root@david ~]# systemd-analyze condition 'ConditionKernelVersion = ! <4.0' \
|
||||
'ConditionKernelVersion = >=5.1' \
|
||||
'ConditionACPower=|false' \
|
||||
'ConditionArchitecture=|!arm' \
|
||||
'AssertPathExists=/etc/os-release' ; \
|
||||
echo $?
|
||||
test.service: AssertPathExists=/etc/os-release succeeded.
|
||||
Asserts succeeded.
|
||||
test.service: ConditionArchitecture=|!arm succeeded.
|
||||
test.service: ConditionACPower=|false failed.
|
||||
test.service: ConditionKernelVersion=>=5.1 succeeded.
|
||||
test.service: ConditionKernelVersion=!<4.0 succeeded.
|
||||
Conditions succeeded.
|
||||
0
|
||||
[root@david ~]#
|
||||
```
|
||||
|
||||
条件和断言的列表大约从 systemd.unit(5) 手册页的第 600 行左右开始。
|
||||
|
||||
### 列出配置文件
|
||||
|
||||
`systemd-analyze` 工具提供了一种将各种配置文件的内容发送到 STDOUT 的方法,如图所示。其基本目录是 `/etc/`。
|
||||
|
||||
```
|
||||
[root@david ~]# systemd-analyze cat-config systemd/system/display-manager.service
|
||||
# /etc/systemd/system/display-manager.service
|
||||
[Unit]
|
||||
Description=LXDM (Lightweight X11 Display Manager)
|
||||
#Documentation=man:lxdm(8)
|
||||
Conflicts=getty@tty1.service
|
||||
After=systemd-user-sessions.service getty@tty1.service plymouth-quit.service livesys-late.service
|
||||
#Conflicts=plymouth-quit.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/lxdm
|
||||
Restart=always
|
||||
IgnoreSIGPIPE=no
|
||||
#BusName=org.freedesktop.lxdm
|
||||
|
||||
[Install]
|
||||
Alias=display-manager.service
|
||||
[root@david ~]#
|
||||
```
|
||||
|
||||
打了这么多字却和标准的 `cat` 命令做的差不多。我发现下一条命令小有帮助,它能在标准的 systemd 所在的位置搜索具有指定模式的内容:
|
||||
|
||||
```
|
||||
[root@david ~]# systemctl cat backup*
|
||||
# /etc/systemd/system/backup.timer
|
||||
# This timer unit runs the local backup program
|
||||
# (C) David Both
|
||||
# Licensed under GPL V2
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=Perform system backups
|
||||
Requires=backup.service
|
||||
|
||||
[Timer]
|
||||
Unit=backup.service
|
||||
OnCalendar=*-*-* 00:15:30
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
|
||||
|
||||
# /etc/systemd/system/backup.service
|
||||
# This service unit runs the rsbu backup program
|
||||
# By David Both
|
||||
# Licensed under GPL V2
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=Backup services using rsbu
|
||||
Wants=backup.timer
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
Environment="HOME=/root"
|
||||
ExecStart=/usr/local/bin/rsbu -bvd1
|
||||
ExecStart=/usr/local/bin/rsbu -buvd2
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
[root@david ~]#
|
||||
```
|
||||
|
||||
这两个命令在每个文件的内容前面都有一个注释行,包含文件的完整路径和名称。
|
||||
|
||||
### 单元文件检查
|
||||
|
||||
当创建了一个新的单元文件,可以利用 `verify` 子命令帮助检查语法是否正确。它能指出来不正确的拼写,并列出缺失的服务单元。
|
||||
|
||||
```
|
||||
[root@david ~]# systemd-analyze verify /etc/systemd/system/backup.service
|
||||
```
|
||||
|
||||
秉承 Unix/Linux 的“沉默是金”的宗旨,没有输出意味着扫描的文件中没有错误。
|
||||
|
||||
### 安全性
|
||||
|
||||
`security` 子命令检查指定服务的安全级别。它只能针对服务单元,其他类型的单元文件不起作用:
|
||||
|
||||
```
|
||||
[root@david ~]# systemd-analyze security display-manager
|
||||
NAME DESCRIPTION >
|
||||
✗ PrivateNetwork= Service has access to the host's network >
|
||||
✗ User=/DynamicUser= Service runs as root user >
|
||||
✗ CapabilityBoundingSet=~CAP_SET(UID|GID|PCAP) Service may change UID/GID identities/capabilities >
|
||||
✗ CapabilityBoundingSet=~CAP_SYS_ADMIN Service has administrator privileges >
|
||||
✗ CapabilityBoundingSet=~CAP_SYS_PTRACE Service has ptrace() debugging abilities >
|
||||
✗ RestrictAddressFamilies=~AF_(INET|INET6) Service may allocate Internet sockets >
|
||||
✗ RestrictNamespaces=~CLONE_NEWUSER Service may create user namespaces >
|
||||
✗ RestrictAddressFamilies=~… Service may allocate exotic sockets >
|
||||
✗ CapabilityBoundingSet=~CAP_(CHOWN|FSETID|SETFCAP) Service may change file ownership/access mode/capabilities unres>
|
||||
✗ CapabilityBoundingSet=~CAP_(DAC_*|FOWNER|IPC_OWNER) Service may override UNIX file/IPC permission checks >
|
||||
✗ CapabilityBoundingSet=~CAP_NET_ADMIN Service has network configuration privileges >
|
||||
✗ CapabilityBoundingSet=~CAP_SYS_MODULE Service may load kernel modules
|
||||
<截断>
|
||||
✗ CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG Service may issue vhangup() >
|
||||
✗ CapabilityBoundingSet=~CAP_WAKE_ALARM Service may program timers that wake up the system >
|
||||
✗ RestrictAddressFamilies=~AF_UNIX Service may allocate local sockets >
|
||||
|
||||
→ Overall exposure level for backup.service: 9.6 UNSAFE ?
|
||||
lines 34-81/81 (END)
|
||||
```
|
||||
|
||||
是的,表情符是输出的一部分。但是,当然,许多服务需要几乎完全访问所有的东西,以便完成它们的工作。我针对几个服务运行了这个程序,包括我自己的备份服务;结果可能有所不同,但最底下一行似乎大多是一样的。
|
||||
|
||||
这个工具对于在严格的安全环境检查和修复用户空间的服务单元是很有用的。我不认为我们的大多数都能用到它。
|
||||
|
||||
### 最后总结
|
||||
|
||||
这个强力的工具提供了一些有趣而惊人的有用选项。本文探讨的大部分内容是关于使用 systemd-analyze 来深入了解 Linux 使用 systemd 的启动性能。它还可以分析 systemd 的其他方面。
|
||||
|
||||
其中有些工具的作用有限,有几个应该完全忘记。但在解决启动和其他 systemd 功能的问题时,大多数都能起到很好的作用。
|
||||
|
||||
### 资源
|
||||
|
||||
互联网上关于 systemd 有很多信息,但是很多过于简略、晦涩,甚至是误导。除了这篇文章中提到的资源外,以下网页提供了关于systemd启动的更详细和可靠的信息。这个列表在我开始写这一系列文章后有所增长,以反映我所做的研究。
|
||||
|
||||
* [systemd.unit(5) 手册页][9] 包含了一份单元文件部分及其配置选项的清单,并对每个部分进行了简明的描述。
|
||||
* Fedora 项目有一个很好的实用 [systemd 指南][10]。它包含了配置、管理和维护使用 systemd 的 Fedora 计算机所需的几乎所有知识。
|
||||
* Fedora 项目还有一份很好的 [备忘录][11],将旧的 SystemV 命令与 systemd 命令进行了对照。
|
||||
* Red Hat 文档包含了对 [单元文件结构][12] 的详细描述和其他重要的信息。
|
||||
* 关于 systemd 技术的细节和创建它的原因,可以去看 Freedesktop.org [systemd 详述][13]。
|
||||
* [Linux.com][14] 的“更多 systemd 乐趣”提供了很多高级的 systemd [信息和技巧][15]。
|
||||
|
||||
此外,systemd 设计者和主要开发者 Lennart Poettering 也为 Linux 系统管理员撰写了一系列深度技术文档,尽管这些文章写于 2010 年 4 月到 2011 年 9 月,现在看也是非常适应时宜。关于 systemd 及其生态系统的其他好文章,大部分都是基于这些文章的。
|
||||
|
||||
* [Rethinking PID 1][16]
|
||||
* [systemd for Administrators, Part I][17]
|
||||
* [systemd for Administrators, Part II][18]
|
||||
* [systemd for Administrators, Part III][19]
|
||||
* [systemd for Administrators, Part IV][20]
|
||||
* [systemd for Administrators, Part V][21]
|
||||
* [systemd for Administrators, Part VI][22]
|
||||
* [systemd for Administrators, Part VII][23]
|
||||
* [systemd for Administrators, Part VIII][24]
|
||||
* [systemd for Administrators, Part IX][25]
|
||||
* [systemd for Administrators, Part X][26]
|
||||
* [systemd for Administrators, Part XI][27]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/9/systemd-startup-configuration
|
||||
|
||||
作者:[David Both][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[jiamn](https://github.com/jiamn)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/dboth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0 (Magnifying glass on code)
|
||||
[2]: https://opensource.com/article/20/7/systemd-calendar-timespans
|
||||
[3]: https://opensource.com/article/20/5/systemd-startup?utm_campaign=intrel
|
||||
[4]: https://en.wikipedia.org/wiki/Scalable_Vector_Graphics
|
||||
[5]: https://opensource.com/sites/default/files/uploads/bootup.svg-graph.png (The bootup.svg file displayed in LibreOffice Draw.)
|
||||
[6]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[7]: https://en.wikipedia.org/wiki/DOT_(graph_description_language)
|
||||
[8]: mailto:getty@tty1.service
|
||||
[9]: https://man7.org/linux/man-pages/man5/systemd.unit.5.html
|
||||
[10]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html
|
||||
[11]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet
|
||||
[12]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-services-with-systemd_configuring-basic-system-settings#Managing_Services_with_systemd-Unit_File_Structure
|
||||
[13]: https://www.freedesktop.org/wiki/Software/systemd/
|
||||
[14]: http://Linux.com
|
||||
[15]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/
|
||||
[16]: http://0pointer.de/blog/projects/systemd.html
|
||||
[17]: http://0pointer.de/blog/projects/systemd-for-admins-1.html
|
||||
[18]: http://0pointer.de/blog/projects/systemd-for-admins-2.html
|
||||
[19]: http://0pointer.de/blog/projects/systemd-for-admins-3.html
|
||||
[20]: http://0pointer.de/blog/projects/systemd-for-admins-4.html
|
||||
[21]: http://0pointer.de/blog/projects/three-levels-of-off.html
|
||||
[22]: http://0pointer.de/blog/projects/changing-roots
|
||||
[23]: http://0pointer.de/blog/projects/blame-game.html
|
||||
[24]: http://0pointer.de/blog/projects/the-new-configuration-files.html
|
||||
[25]: http://0pointer.de/blog/projects/on-etc-sysinit.html
|
||||
[26]: http://0pointer.de/blog/projects/instances.html
|
||||
[27]: http://0pointer.de/blog/projects/inetd.html
|
183
published/20210401 Partition a drive on Linux with GNU Parted.md
Normal file
183
published/20210401 Partition a drive on Linux with GNU Parted.md
Normal file
@ -0,0 +1,183 @@
|
||||
[#]: subject: (Partition a drive on Linux with GNU Parted)
|
||||
[#]: via: (https://opensource.com/article/21/4/linux-parted-cheat-sheet)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (hwlife)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-14463-1.html)
|
||||
|
||||
在 Linux 上使用 GNU Parted 对磁盘分区
|
||||
======
|
||||
|
||||
> 了解对新的储存设备分区的基础知识,然后下载我们的速查表,让信息近在咫尺。
|
||||
|
||||

|
||||
|
||||
在 21 世纪,我们往往认为数据存储是理所当然的。我们有许多存储介质,相对价格便宜,而且有许多不同的可用类型。然而,不论你获得的免费云存储空间有多少,没有比有一个物理硬盘空间来存储重要的数据更好了(或容量真的很大的,而当你又在一个慢速网络上时)。然而,没有几块硬盘买回来就是现成的,至少在理想的状况下可以直接使用的。无论你是买了一块新硬盘,还用不同分区安装一个系统,你需要知道怎么在 Linux 上为磁盘分区。
|
||||
|
||||
这篇文章介绍了 GNU Parted ,它磁盘分区最好的工具之一。如果你偏向使用图形化程序,而不算终端命令行,请阅读我的《[为 Linux 格式化驱动器][2]》这篇文章。
|
||||
|
||||
### 磁盘标签、分区和文件系统
|
||||
|
||||
技术上来说,一个硬盘驱动器不需要很多软件,就可用作存储设备。然而,在没有分区表和文件系统等现代惯例的情况下使用硬盘是困难的、不切实际的,而且对你的数据不安全。
|
||||
|
||||
关于硬盘驱动器,这里有三个你需要知道的重要概念:
|
||||
|
||||
* <ruby>磁盘标签<rt>disk label</rt></ruby>(或者 <ruby>分区表<rt>partition table</rt></ruby>)是放置在磁盘驱动器起始位置的元数据,它告诉计算机可用的存储是何种类型、以及它在磁盘驱动器的位置等信息。
|
||||
* <ruby>分区<rt>partition</rt></ruby> 是一个识别文件系统位置的边界。举个例子,如果你有一个 512GB 的硬盘,你可以用占用所有磁盘容量(512GB)分成一个分区,或者分成两个分区,每个占用 256GB ,或者分成三个分区,占用各种不同大小的空间等等。
|
||||
* <ruby>文件系统<rt>filesystem</rt></ruby> 是一个硬盘驱动器和计算机两者约定俗成的存储方案。计算机必须知道怎样读取文件系统来拼凑存储在驱动器上的数据,并且必须知道怎样写入数据到文件系统并保持数据的完整性。
|
||||
|
||||
GNU Parted 程序管理着前两个概念:磁盘标签和分区。Parted 对文件系统有所了解,但是它把文件系统的实现细节交给了其他类似 `mkfs` 这样的工具。
|
||||
|
||||
> 下载 [GNU Parted 速查表][3]
|
||||
|
||||
### 确定磁盘驱动器的位置
|
||||
|
||||
使用 GNU Parted 之前,你必须确定你的驱动器在你的系统上的位置。首先,将你要格式化的磁盘驱动器连接到你的系统,然后用 `parted` 命令查看连接到你的计算机的设备:
|
||||
|
||||
```
|
||||
$ parted /dev/sda print devices
|
||||
/dev/sda (2000GB)
|
||||
/dev/sdb (1000GB)
|
||||
/dev/sdc (1940MB)
|
||||
```
|
||||
|
||||
你最新连接设备的名称在字母表上晚于连接时间更长的设备。举个例子,`/dev/sdc` 最有可能是我刚刚连接的磁盘。我能通过它的容量大小来确认,相比于我的工作站上的主要驱动器的 TB 大小来说,因为我知道我插入的 U 盘只有 2GB(1940MB,足够接近)大小。如果你不能确定,你可以得到的更多关于你想要分区的驱动器的信息:
|
||||
|
||||
```
|
||||
$ parted /dev/sdc print
|
||||
Model: Yoyodyne Tiny Drive 1.0 (scsi)
|
||||
Disk /dev/sdc: 1940MB
|
||||
Sector size (logical/physical): 512B/512B
|
||||
Partition Table: msdos
|
||||
Disk Flags:
|
||||
|
||||
Number Start End Size File system Name Flags
|
||||
1 1049kB 2048kB 1024kB BS Bloat Hidden
|
||||
2 2049kB 1939MB 1937MB FAT32 MyDrive
|
||||
```
|
||||
|
||||
有些驱动器比其他驱动器有更多的元数据。这个磁盘表明它的物理驱动器品牌是 Yoyodyne ,此外,在磁盘的起始处包含了一个小的隐藏分区,后面是一个兼容 Windows 的臃肿的 FAT32 分区。这确实是我要重新打算格式化的驱动器。
|
||||
|
||||
继续之前,_确认_ 你已经确定了要分区的正确驱动器。 _对错误的驱动器重新分区会导致数据丢失。_ 为了安全起见,在本文中所有具有潜在破环性的命令都指向在你的系统中不太可能有的 `/dev/sdX` 设备。
|
||||
|
||||
### 创建磁盘标签(或者分区表)
|
||||
|
||||
要在磁盘上创建一个分区,驱动器必须要有一个<ruby>磁盘标签<rt>disk label</rt></ruby>。磁盘标签也被叫做 <ruby>分区表<rt>partition table</rt></ruby>,所以 Parted 对两个术语都接受。
|
||||
|
||||
要创建一个磁盘卷标,使用 `mklabel` 或 `mktable` 子命令:
|
||||
|
||||
```
|
||||
$ parted /dev/sdX mklabel gpt
|
||||
```
|
||||
|
||||
这个命令在 `/dev/sdX` 的驱动器前面创建了一个 **gpt** 标签,删除了任何可能存在的标签。这是一个快速的过程,因为所有被替换的信息都是关于分区的元数据。
|
||||
|
||||
### 创建分区
|
||||
|
||||
要在磁盘创建分区,使用 `mkpart` 子命令,后跟可选的分区名称,再跟分区的开始和结束位置。如果你在磁盘上只需要一个分区,那么大小调整是容易的:开始位置输入 1 ,结束位置输入 100% 。使用 `--align opt` 参数允许 Parted 调整分区边界位置便于磁盘获得最佳性能:
|
||||
|
||||
```
|
||||
$ parted /dev/sdX --align opt \
|
||||
mkpart example 1 100%
|
||||
```
|
||||
|
||||
用 `print` 子命令查看你的新分区:
|
||||
|
||||
```
|
||||
$ parted /dev/sdX print
|
||||
Model: Yoyodyne Tiny Drive 1.0 (scsi)
|
||||
Disk /dev/sdi: 1940MB
|
||||
Sector size (logical/physical): 512B/512B
|
||||
Partition Table: gpt
|
||||
Disk Flags:
|
||||
|
||||
Number Start End Size
|
||||
1 1049kB 1939MB 1938MB
|
||||
```
|
||||
|
||||
你不必将整个磁盘用作一个分区。分区的优势是在一个磁盘上可以存在多个文件系统,它们之间不会相互干扰。在确定分区大小的时候,你可以使用 `unit` 子命令来设置你想用的测量方法。Parted 可以理解<ruby>扇区<rt>sector</rt></ruby>、<ruby>柱面<rt>cylinder</rt></ruby>、<ruby>磁头<rt>head</rt></ruby>、<ruby>字节<rt>byte</rt></ruby>、KB、MB、GB、TB 和百分比。(LCTT 译注:具体使用方法请参阅手册页)
|
||||
|
||||
你也可以指定你打算使用的分区的文件系统。这并不会创建文件系统,但是它为你以后方便使用提供了元数据。
|
||||
|
||||
将磁盘对半分,一个是 XFS 文件系统,另一个是 EXT4 文件系统:
|
||||
|
||||
```
|
||||
$ parted /dev/sdX --align opt \
|
||||
mkpart xfs 1 50%
|
||||
$ parted /dev/sdX --align opt \
|
||||
mkpart ext4 51% 100%
|
||||
```
|
||||
|
||||
### 命名分区
|
||||
|
||||
除了标记分区用于什么文件系统之外,你也可以为每个分区命名。一些文件管理器和工具可以读取分区名称,能够帮助你区分驱动器。例如,我经常有几个不同的驱动器连接到我的媒体工作站,每个属于一个不同的项目。当创建这些驱动器的时候,我同时命名了分区和文件系统,这样,无论我怎么看我的系统,有重要数据的位置都会被清楚地标示出来。
|
||||
|
||||
要命名一个分区,你必须知道它的序号:
|
||||
|
||||
```
|
||||
$ parted /dev/sdX print
|
||||
[...]
|
||||
Number Start End Size File system Name Flags
|
||||
1 1049kB 990MB 989MB xfs example
|
||||
2 1009MB 1939MB 930MB ext4 noname
|
||||
```
|
||||
|
||||
要命名分区 1:
|
||||
|
||||
```
|
||||
$ parted /dev/sdX name 1 example
|
||||
$ parted /dev/sdX print
|
||||
[...]
|
||||
Number Start End Size File system Name Flags
|
||||
1 1049kB 990MB 989MB xfs example
|
||||
2 1009MB 1939MB 930MB ext4 noname
|
||||
```
|
||||
|
||||
### 创建文件系统
|
||||
|
||||
要让你的驱动器能够正常使用,你必须在新分区上创建一个文件系统。GNU Parted 并不做这些,因为它只是一个分区管理器。在磁盘上创建文件系统的 Linux 命令是 `mkfs`,但也有一些有用的工具可以让你用来创建特定类型的文件系统。例如,`mkfs.ext4` 创建 EXT4 文件系统,`mkfs.xfs` 创建 XFS 文件系统等等。
|
||||
|
||||
你的分区位于磁盘驱动器的“内部” ,所以你不是在 `/dev/sdX` 上创建文件系统,而是在 `/dev/sdX1` 上为第一个分区创建文件系统,在 `/dev/sdX2` 上为第二个分区创建,以此类推。
|
||||
|
||||
这里是一个创建 XFS 文件系统的例子:
|
||||
|
||||
```
|
||||
$ sudo mkfs.xfs -L mydrive /dev/sdX1
|
||||
```
|
||||
|
||||
### 下载我们的速查表
|
||||
|
||||
Parted 是一个灵活而强大的工具。你可以发出命令,如本文所示的那样,或者激活一个交互模式以不断 “连接” 你指定的驱动器:
|
||||
|
||||
```
|
||||
$ parted /dev/sdX
|
||||
(parted) print
|
||||
[...]
|
||||
Number Start End Size File system Name Flags
|
||||
1 1049kB 990MB 989MB xfs example
|
||||
2 1009MB 1939MB 930MB ext4 noname
|
||||
|
||||
(parted) name 1 mydrive
|
||||
(parted)
|
||||
```
|
||||
|
||||
如果你打算经常使用 Parted ,[下载我们的 GNU Parted 速查表][3],让信息近在咫尺。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/4/linux-parted-cheat-sheet
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[hwlife](https://github.com/hwlife)
|
||||
校对:[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/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image)
|
||||
[2]: https://opensource.com/article/18/11/partition-format-drive-linux#gui
|
||||
[3]: https://opensource.com/downloads/parted-cheat-sheet
|
@ -0,0 +1,174 @@
|
||||
[#]: subject: "View your Linux server's network connections with netstat"
|
||||
[#]: via: "https://opensource.com/article/22/2/linux-network-security-netstat"
|
||||
[#]: author: "Sahana Sreeram https://opensource.com/users/sahanasreeram01gmailcom"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "hwlife"
|
||||
[#]: reviewer: "wxy"
|
||||
[#]: publisher: "wxy"
|
||||
[#]: url: "https://linux.cn/article-14461-1.html"
|
||||
|
||||
使用 netstat 查看你的 Linux 服务器网络连接
|
||||
======
|
||||
|
||||
> netstat 命令为你的 Linux 服务器提供了监测和网络故障排除的重要观察手段。
|
||||
|
||||

|
||||
|
||||
在 [之前的文章中][2],我分享了一些管理你的个人 Linux 服务器的首要步骤。我简要的提到了监测网络连接的监听端口,我想通过 Linux 系统的 `netstat` 命令来扩展开讲讲。
|
||||
|
||||
服务监测和端口扫描是标准的行业惯例。有很好的软件,如 [Prometheus][3] 协助这个过程自动化,[SELinux][4] 协助上下文和保护系统访问权限。然而,我相信了解你的服务器是如何连接到其他网络和设备的,是建立正常服务器基准的关键,能够帮助你识别有可能表明错误和入侵等异常情况。作为一个初学者,我已经掌握了 `netstat` 命令为我的服务器提供了监测和网络故障排除的重要观察手段。
|
||||
|
||||
`netstat` 和类似的一些网络监测工具被归入 [net-tools 软件包][5] 里,用来显示关于活动连接的信息。因为运行在开放的端口的服务往往容易被利用,定期进行网络监测能够帮助你及早探测到可疑的活动。
|
||||
|
||||
### 安装 netstat
|
||||
|
||||
`netstat` 经常预装在 Linux 发行版上。如果 `netstat` 没有在你的服务器上安装,用你的包管理器安装它。下面是在基于 Debian 的系统上:
|
||||
|
||||
```
|
||||
$ sudo apt-get install net-tools
|
||||
```
|
||||
|
||||
在基于 Fedora 的系统上:
|
||||
|
||||
```
|
||||
$ dnf install net-tools
|
||||
```
|
||||
|
||||
### 使用 netstat
|
||||
|
||||
就其本身而言,`netstat` 命令显示了全部建立成功的连接。你可以使用 `netstat` 的参数指定进一步预期的输出。举个例子,要显示所有监听和非监听的连接,使用 `--all`(`-a` 为简写)的参数。这将返回许多结果,所以在例子中我用管道符输出给 `head` 命令来显示输出的前 15 行:
|
||||
|
||||
```
|
||||
$ netstat --all | head -n 15
|
||||
Active Internet connections (servers and established)
|
||||
Proto Recv-Q Send-Q Local Address Foreign Address State
|
||||
tcp 0 0 *:27036 *:* LISTEN
|
||||
tcp 0 0 localhost:27060 *:* LISTEN
|
||||
tcp 0 0 *:16001 *:* LISTEN
|
||||
tcp 0 0 localhost:6463 *:* LISTEN
|
||||
tcp 0 0 *:ssh *:* LISTEN
|
||||
tcp 0 0 localhost:57343 *:* LISTEN
|
||||
tcp 0 0 *:ipp *:* LISTEN
|
||||
tcp 0 0 *:4713 *:* LISTEN
|
||||
tcp 0 0 10.0.1.222:48388 syd15s17-in-f5.1e:https ESTABLISHED
|
||||
tcp 0 0 10.0.1.222:48194 ec2-35-86-38-2.us:https ESTABLISHED
|
||||
tcp 0 0 10.0.1.222:56075 103-10-125-164.va:27024 ESTABLISHED
|
||||
tcp 0 0 10.0.1.222:46680 syd15s20-in-f10.1:https ESTABLISHED
|
||||
tcp 0 0 10.0.1.222:52730 syd09s23-in-f3.1e:https ESTABLISHED
|
||||
```
|
||||
|
||||
要只显示 TCP 端口,使用 `--all` 和 `--tcp` 参数,或者简写成 `-at` :
|
||||
|
||||
```
|
||||
$ netstat -at | head -n 5
|
||||
Active Internet connections (servers and established)
|
||||
Proto Recv-Q Send-Q Local Address Foreign Address State
|
||||
tcp 0 0 *:27036 *:* LISTEN
|
||||
tcp 0 0 localhost:27060 *:* LISTEN
|
||||
tcp 0 0 *:16001 *:* LISTEN
|
||||
```
|
||||
|
||||
要只显示 UDP 端口,使用 `--all` 和 `--udp` 参数,或者简写成 `-au` :
|
||||
|
||||
```
|
||||
$ netstat -au | head -n 5
|
||||
Active Internet connections (servers and established)
|
||||
Proto Recv-Q Send-Q Local Address Foreign Address State
|
||||
udp 0 0 *:27036 *:*
|
||||
udp 0 0 10.0.1.222:44741 224.0.0.56:46164 ESTABLISHED
|
||||
udp 0 0 *:bootpc
|
||||
```
|
||||
|
||||
`netstat` 命令参数常常是简单易懂的。举个例子,要显示带有全部进程 ID(PID)和数字地址的监听 TCP 和 UDP 的端口:
|
||||
|
||||
```
|
||||
$ sudo netstat --tcp --udp --listening --programs --numeric
|
||||
Active Internet connections (only servers)
|
||||
Proto Recv-Q Send-Q Local Address Foreign Addr State PID/Program name
|
||||
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
|
||||
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2500/dnsmasq
|
||||
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1726/sshd
|
||||
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1721/cupsd
|
||||
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 4023/sshd: tux@
|
||||
tcp6 0 0 :::111 :::* LISTEN 1/systemd
|
||||
tcp6 0 0 :::22 :::* LISTEN 1726/sshd
|
||||
tcp6 0 0 ::1:631 :::* LISTEN 1721/cupsd
|
||||
tcp6 0 0 ::1:6010 :::* LISTEN 4023/sshd: tux@
|
||||
udp 0 0 0.0.0.0:40514 0.0.0.0:* 1499/avahi-daemon:
|
||||
udp 0 0 192.168.122.1:53 0.0.0.0:* 2500/dnsmasq
|
||||
udp 0 0 0.0.0.0:67 0.0.0.0:* 2500/dnsmasq
|
||||
udp 0 0 0.0.0.0:111 0.0.0.0:* 1/systemd
|
||||
udp 0 0 0.0.0.0:5353 0.0.0.0:* 1499/avahi-daemon:
|
||||
udp6 0 0 :::111 :::* 1/systemd
|
||||
udp6 0 0 :::44235 :::* 1499/avahi-daemon:
|
||||
udp6 0 0 :::5353 :::* 1499/avahi-daemon:
|
||||
```
|
||||
|
||||
这个常用组合简写版本是 `-tulpn` 。
|
||||
|
||||
要显示一个指定服务的信息,[使用 grep 命令过滤][6]:
|
||||
|
||||
```
|
||||
$ sudo netstat -anlp | grep cups
|
||||
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1721/cupsd tcp6 0 0 ::1:631 :::* LISTEN 1721/cupsd
|
||||
unix 2 [ ACC ] STREAM LISTENING 27251 1/systemd /var/run/cups/cups.sock
|
||||
unix 2 [ ] DGRAM 59530 1721/cupsd
|
||||
unix 3 [ ] STREAM CONNECTED 55196 1721/cupsd /var/run/cups/cups.sock
|
||||
```
|
||||
|
||||
### 接下来的步骤
|
||||
|
||||
一旦你运行了 `netstat` 命令,你就可以采取措施来保护你的系统,确保只有你主动使用的服务在你的网络上被监听。
|
||||
|
||||
1. 识别通常被利用的端口和服务。一般来说,关闭你实际不使用的端口。
|
||||
2. 留意不常见的端口号,认识了解在你系统上使用的合法端口。
|
||||
3. 密切注意 SELinux 错误。有时你需要做的只是更新上下文,以匹配你对系统做的合法更改,但是要阅读错误警告,以确保 SELinux 提醒你的不是可疑或者恶意的活动。
|
||||
|
||||
如果你发现一个端口正在运行一个可疑的服务,或者你只是简单的想要关闭你不再使用的端口,你可以遵从以下这些步骤,通过防火墙规则手动拒绝端口访问:
|
||||
|
||||
如果你在使用 `firewall-cmd` ,运行这些命令:
|
||||
|
||||
```
|
||||
$ sudo firewall-cmd –remove-port=<port number>/tcp
|
||||
$ sudo firewall-cmd –runtime-to-permanent
|
||||
```
|
||||
|
||||
如果你在使用 UFW,运行以下的命令:
|
||||
|
||||
```
|
||||
$ sudo ufw deny <port number>
|
||||
```
|
||||
|
||||
下一步,使用 `systemctl` 来停止这个服务:
|
||||
|
||||
```
|
||||
$ systemctl stop <service>
|
||||
```
|
||||
|
||||
### 理解 netstat
|
||||
|
||||
`netstat` 是一个快速收集你的服务器网络连接信息的有用工具。定期网络监测是了解你的系统的重要组成部分,对帮助你保持你的系统安全有着重要意义。将这一步纳入你的日常管理中,你可以使用类似 `netstat` 或者 `ss` ,以及 [Nmap 等开源端口扫描器或者 Wireshark 等嗅探器][7] ,它们都允许设定 [计划任务][8]。
|
||||
|
||||
随着服务器存储了大量的个人数据,确保个人服务器的安全日益重要。通过了解你的服务器怎样连接到互联网,你可以降低你的机器的风险,同时你仍可以在数字时代大量的连接中获得益处。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/2/linux-network-security-netstat
|
||||
|
||||
作者:[Sahana Sreeram][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[hwlife](https://github.com/hwlife)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/sahanasreeram01gmailcom
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rack_server_sysadmin_cloud_520.png?itok=fGmwhf8I (A rack of servers, blue background)
|
||||
[2]: https://opensource.com/article/21/4/securing-linux-servers
|
||||
[3]: https://opensource.com/article/19/11/introduction-monitoring-prometheus
|
||||
[4]: https://opensource.com/business/13/11/selinux-policy-guide
|
||||
[5]: http://sourceforge.net/projects/net-tools/
|
||||
[6]: https://opensource.com/article/21/3/grep-cheat-sheet
|
||||
[7]: https://redhat.com/sysadmin/troubleshoot-dhcp-nmap-tcpdump-and-wireshark
|
||||
[8]: https://opensource.com/article/22/2/redhat.com/sysadmin/nmap-scripting-engine
|
@ -20,7 +20,7 @@ Xfce Terminal 1.0.0:时隔一年后的一次功能丰富的重大升级
|
||||
|
||||
### 新的维护者和版本管理方案
|
||||
|
||||
Igor Zakharov 从 2016 年到 2020 年一直在领导它的开发工作。不幸的是,在 2021 年,当新的维护者 [Sergios][1] Anestis Kefalidis(也是 Thunar 文件管理器的开发者)接手后,它就没有被维护了。
|
||||
Igor Zakharov 从 2016 年到 2020 年一直在领导它的开发工作。不幸的是,在 2021 年它就没有被维护过,直到新的维护者 [Sergios][1] Anestis Kefalidis(也是 Thunar 文件管理器的开发者)接手。
|
||||
|
||||
而且,自从 Sergios 接管了这个项目后,版本管理方案也发生了变化。经过与社区的协商,采用了 Thunar 的旧版本计划。
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://opensource.com/article/22/2/manage-calendar-linux-konsolekalender-kde"
|
||||
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
@ -1,209 +0,0 @@
|
||||
[#]: subject: "Top 10 Most Beautiful Linux Distributions [Featured]"
|
||||
[#]: via: "https://www.debugpoint.com/2022/03/beautiful-linux-distributions-2022/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "amagicboy"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Top 10 Most Beautiful Linux Distributions [Featured]
|
||||
======
|
||||
WE GIVE YOU THE TOP 10 BEAUTIFUL LINUX DISTRIBUTIONS OF 2022. THEY ARE A
|
||||
VISUAL TREAT TO YOUR EYES WHILE BEING A ROBUST OPERATING SYSTEM.
|
||||
The most fantastic thing about [Linux Distributions][1] is you can customize them to any extent to satisfy your visual needs. Whether based on Ubuntu or Fedora, you have all the tools you need to customize a Linux desktop.
|
||||
|
||||
But, there are many Linux Distributions that looks stunning without any customization. The developers have made them so that you can experience the visual treat right after installation without any additional effort on customization.
|
||||
|
||||
Hence, we compiled a list of the most beautiful Linux distributions you can try right now and give your PC a visual makeover.
|
||||
|
||||
### Most Beautiful Linux Distributions of 2022
|
||||
|
||||
#### 1\. Zorin OS
|
||||
|
||||
The first Linux Distribution which we would like to feature is Zorin OS. The Zorin OS is a beautiful Linux distribution that uses Zorin Desktop based on GNOME. It is perfect for newcomers who wants a nice desktop but are also productive at the same time.
|
||||
|
||||
One of the unique features that Zorin OS brings is its ability to transform its look to make it like any other operating system. That means the taskbar, application menu, and the Dock can change with just one click option from its Layout settings, and this gives you the utmost flexibility and out of the box experience while using ZorinOS.
|
||||
|
||||
[Read more about Zorin OS][2]
|
||||
|
||||
![Zorin OS 16 Desktop][3]
|
||||
|
||||
#### 2\. Elementary OS
|
||||
|
||||
The elementaryOS is one of the most beautiful Linux distributions today based on Ubuntu Long Term Support (LTS) release. This Linux Distribution uses the stunning Pantheon Desktop environment whose look and feel is inspired by macOS.
|
||||
|
||||
The elementary OS is perfect for those coming from macOS to the Linux world as they would find many things familiar, such as gestures and window decorations.
|
||||
|
||||
However, you may not find many customization options available in elementary OS settings. You may need to depend on external script commands to make further customization. However, the default looks are beautiful and serve their purpose for the majority of the users.
|
||||
|
||||
The most significant advantage of elementary OS is its curated app store. The App Store provides you with all categories of applications specially designed for the elementary OS, which looks and works great.
|
||||
|
||||
[Read more about elementaryOS][4]
|
||||
|
||||
![elementary OS 6 ODIN Desktop][5]
|
||||
|
||||
#### 3\. Deepin OS
|
||||
|
||||
The third distribution which we would like to highlight is Deepin OS. The Deepin OS is based on Debian and was created by Deepin Technology Co from China. It uses its own Deepin Desktop Environment based on Qt. The Deepin desktop looks incredible with its widgets, colour schemes, window decorations, wallpapers that give you an out of the box visual treat.
|
||||
|
||||
With its well-polished visual components, you may think that it looks almost similar to macOS. And thanks to the Debian “stable” branch, Deepin OS is the perfect choice if you want an excellent looking Linux distribution with stability.
|
||||
|
||||
Why is Deepin OS beautiful?
|
||||
|
||||
* _Awesome Qt-based Deepin Desktop_
|
||||
* _Native widgets and dark theme support_
|
||||
* _Several options to customize the Dock_
|
||||
* _Transparency, Window effects, CursDockheme, Icon Theme support_
|
||||
* _Accent Color_
|
||||
|
||||
|
||||
|
||||
[Read more about Deepin OS][6]
|
||||
|
||||
![Deepin 20 Desktop][7]
|
||||
|
||||
#### 4\. Cutefish OS
|
||||
|
||||
The fourth Linux Distribution which we feature here is [CutefishOS][8]. This Debian and Ubuntu-based Linux distribution feature a natively developed Cutefish desktop. This Linux Distribution is currently under development. But due to its looks, its already making waves across the user’s base.
|
||||
|
||||
Under the hood, CutefishOS is built upon Qt and KDE Framework. This efficient Linux Distribution with Cutefish desktop features the global menu feature at the top bar out of the box.
|
||||
|
||||
The customization options are still being worked on as its currently under development. But with the latest release, you get the native dark mode, accent colour, animation effects, dock position (left, right, bottom), among other options.
|
||||
|
||||
If you want to experiment with a nice desktop that looks completely different, you may go ahead. Also, you may go over the complete review and tutorials of this desktop presented below.
|
||||
|
||||
[Cutefish OS Review][9]
|
||||
|
||||
![Cutefish OS][10]
|
||||
|
||||
#### 5\. Manjaro KDE Plasma
|
||||
|
||||
The Manjaro Linux KDE Edition is one of the best looking Linux distributions today. Based on Arch Linux, Manjaro KDE Edition features the stock KDE Plasma desktop environment with some additional tweaks and widgets. The green colour palette of Manjaro gives you a fresh look and feel. You can customize further with built-in KDE tools and settings and change icons and themes from KDE Stores.
|
||||
|
||||
The Manjar KDE Edition is a perfect combination of performance and beauty with the power of Arch Linux. And it is an ideal starting point for the new Arch Linux users.
|
||||
|
||||
[Read more about Manjaro KDE Desktop][11]
|
||||
|
||||
![Manjaro KDE Plasma][12]
|
||||
|
||||
#### 6\. Garuda Linux
|
||||
|
||||
The famous Garduda Linux is the 6th OS on this list. Garuda Linux is based on Arch Linux and brings a beautiful desktop for you. It features all major desktop environments with custom-designed icon themes and colour palettes. This operating system uses Zen Kernel, optimized for performance in your hardware.
|
||||
|
||||
[][13]
|
||||
|
||||
SEE ALSO: 10 Things to Do After Installing Fedora 33
|
||||
|
||||
The look and feel are stunning in Garuda Linux. The macOS style looks that you get out of the box. The combination of neon icon theme, lovely colour palette, blur and Transparency with the global menu is perfect for its own.
|
||||
|
||||
One of the primary advantages of Garuda is it provides you with the choice of all desktop environments – KDE Plasma, GNOME, Xfce, LXQt, MATE and others.
|
||||
|
||||
[Read more about Garuda Linux][14]
|
||||
|
||||
![Garuda Linux][15]
|
||||
|
||||
#### 7\. Linux Mint Cinnamon Edition
|
||||
|
||||
We all love Linux Mint because of its simplicity, elegance and stability. It is one of the widely used and famous Linux distributions today. And perhaps the most used Linux distribution after Ubuntu. However, it is not that fancy looking if you compare this with other Linux Distributions here in this list.
|
||||
|
||||
But the default Cinnamon desktop looks clean and perfect if you like the legacy user interface, which looks fantastic.
|
||||
|
||||
The Linux Mint Cinnamon edition is perfect for all users, especially new users of Linux or even you are migrating from Windows. The default looks and feels with Mint’s green colour pallette look refreshing.
|
||||
|
||||
If you are unable to decide an eye candy Linux distribution with stability, choose the Linux Mint Cinnamon edition without a doubt.
|
||||
|
||||
[Read more about Linux Mint][16]
|
||||
|
||||
![Linux Mint 20 – Cinnamon Edition Desktop][17]
|
||||
|
||||
#### 8\. Nitrux OS
|
||||
|
||||
[Nitrux Linux][18] is based on Debian, which features a modified version of KDE Plasma desktop called NX Desktop. This unique Linux distribution brings its own set of Nitrux applications built upon Maui kit and Qt. Nitrux is systemd-free and uses OpenRC as an init system. With all these unique features and stunning looks, it is one of the best Linux distributions today.
|
||||
|
||||
Nitrux OS default look is perfectly designed with modified KDE Plasma desktop with Kvantum theme engine, icon theme, colour palette and cursor theme. The team behind Nitrux OS also brings a separate desktop called Maui Shell, a beautiful convergent desktop that adapts itself based on screen size.
|
||||
|
||||
If you need a KDE Plasma desktop with out of the box modification with stability, then go for Nitrux OS. You won’t be disappointed.
|
||||
|
||||
[Read more about Nitrux OS][18]
|
||||
|
||||
![Nitrux 2.0 + Desktop][19]
|
||||
|
||||
#### 9\. Ubuntu Kylin
|
||||
|
||||
The Ubuntu Kylin is an official Ubuntu flavour designed explicitly for the Chinese people who use a simplified Chinese script. However, it supports another language as well.
|
||||
|
||||
This modified Ubuntu flavour uses Ubuntu Kaylin User Interface (aka UKUI). The UKUI desktop is created using Qt to support MATE Desktop components.
|
||||
|
||||
Ubuntu Kylin looks elegant, and it would remind you of a combination of GNOME and KDE Plasma in terms of looks and design.
|
||||
|
||||
It features a nicely designed icon set, bottom taskbar, nice application view, app switcher, rounded corner, and more These features are carefully crafted.
|
||||
|
||||
[Read more about Ubuntu Kylin][20]
|
||||
|
||||
![Ubuntu Kylin Desktop][21]
|
||||
|
||||
#### 10\. Pop OS
|
||||
|
||||
The Pop OS is developed by System76, which manufactures computer hardware. This Ubuntu-based Linux Distribution comes pre-installed in all the System6 hardware. However, you can separately download and install it from its official repository in your system.
|
||||
|
||||
The Pop OS features the default GNOME desktop with additional tweaks and configurations. This desktop features the pre-GNOME 40 era desktop with several extensions and tweaks pre-configured. For example, you get a bottom dock that can be configured to move around in the desktop, a launcher to launch applications, rounded corners and many such features. This desktop also features auto tiling and optimized keyboard navigation to make you more productive.
|
||||
|
||||
The look and feel are clean and beautifully designed with a colour palette, built-in dark mode, rounded corners in the application window, and icon theme.
|
||||
|
||||
[Read more about Pop OS][22]
|
||||
|
||||
![Pop OS 21.10 Desktop][23]
|
||||
|
||||
### Closing Notes
|
||||
|
||||
I hope this list of beautiful Linux distributions of 2022 helps you decide which one you want for your desktop or laptop. Because these are already configured to look beautiful, they are powerful.
|
||||
|
||||
Take your pick and start your Linux journey.
|
||||
|
||||
* * *
|
||||
|
||||
We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][24], [Twitter][25], [YouTube][26], and [Facebook][27] and never miss an update!
|
||||
|
||||
##### Also Read
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/2022/03/beautiful-linux-distributions-2022/
|
||||
|
||||
作者:[Arindam][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.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.debugpoint.com/category/distributions
|
||||
[2]: https://zorin.com
|
||||
[3]: https://www.debugpoint.com/wp-content/uploads/2021/08/Zorin-OS-16-Desktop-1024x576.jpg
|
||||
[4]: https://elementary.io/
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2021/08/elementary-OS-6-ODIN-Desktop-1024x576.jpg
|
||||
[6]: https://www.deepin.org/en/
|
||||
[7]: https://www.debugpoint.com/wp-content/uploads/2020/09/Deepin-20-Desktop-1024x568.jpg
|
||||
[8]: https://en.cutefishos.com/
|
||||
[9]: https://www.debugpoint.com/2021/11/cutefish-os-review-2021/
|
||||
[10]: https://www.debugpoint.com/wp-content/uploads/2021/11/Cutefish-OS-1024x581.jpg
|
||||
[11]: https://manjaro.org/downloads/official/kde/
|
||||
[12]: https://www.debugpoint.com/wp-content/uploads/2022/03/Manjaro-KDE-Plasma-1024x576.jpg
|
||||
[13]: https://www.debugpoint.com/2020/10/10-things-to-do-fedora-33-after-install/
|
||||
[14]: https://garudalinux.org/
|
||||
[15]: https://www.debugpoint.com/wp-content/uploads/2022/03/Garuda-Linux-1024x577.jpg
|
||||
[16]: https://linuxmint.com/
|
||||
[17]: https://www.debugpoint.com/wp-content/uploads/2020/07/Linux-Mint-20-Cinnamon-Edition-Desktop-1024x763.png
|
||||
[18]: https://nxos.org/
|
||||
[19]: https://www.debugpoint.com/wp-content/uploads/2022/03/Nitrux-2.0-Desktop-1024x581.jpg
|
||||
[20]: https://www.ubuntukylin.com
|
||||
[21]: https://www.debugpoint.com/wp-content/uploads/2022/03/Ubuntu-Kylin-Desktop-1024x574.jpg
|
||||
[22]: https://pop.system76.com/
|
||||
[23]: https://www.debugpoint.com/wp-content/uploads/2021/12/Pop-OS-21.10-Desktop-1024x579.jpg
|
||||
[24]: https://t.me/debugpoint
|
||||
[25]: https://twitter.com/DebugPoint
|
||||
[26]: https://www.youtube.com/c/debugpoint?sub_confirmation=1
|
||||
[27]: https://facebook.com/DebugPoint
|
@ -2,7 +2,7 @@
|
||||
[#]: via: "https://www.debugpoint.com/2022/03/lightweight-linux-distributions-2022/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "robsean"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
@ -1,97 +0,0 @@
|
||||
[#]: subject: "Xubuntu 22.04 LTS – New Features and Release Details"
|
||||
[#]: via: "https://www.debugpoint.com/2022/04/xubuntu-22-04-lts/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Xubuntu 22.04 LTS – New Features and Release Details
|
||||
======
|
||||
A LIST OF NEW FEATURES IN XUBUNTU 22.04 LTS (JAMMY JELLYFISH) AND
|
||||
ADDITIONAL INFORMATION ABOUT THE RELEASE.
|
||||
![Xubuntu 22.04 Desktop][1]
|
||||
|
||||
### Xubuntu 22.04 LTS – New Features
|
||||
|
||||
Xubuntu 22.04 LTS is powered by Linux Kernel 5.15 and underlying packages from Ubuntu 22.04 LTS. In addition to that, the default desktop environment version is Xfce 4.16. The Xfce desktop environment did not see any significant release since its release in Dec 2020.
|
||||
|
||||
Even so the Xfce desktop version 4.16 remained as the Xubuntu 21.10 (last release), and the desktop components and native applications get some improvements and bug fixes.
|
||||
|
||||
Perhaps the vital work in this release is the initial support for GTK4 and libhandy in the Greybird theme (via version 3.23.1). That means the GTK4 apps from the GNOME ecosystem look good in Xubuntu with their theme.
|
||||
|
||||
### Application Updates
|
||||
|
||||
The default file manager Thunar 4.16.10 adds several performance improvements, including regression fixes, translation updates and under the hood changes. Although while scanning the changelog, I could not find anything substantial to report which is visible to the user. But if you are interested, you can read the NEWS file in detail [here][2].
|
||||
|
||||
In fact, Thunar is now under development with Xfce 4.17, which contains some exciting changes. But unfortunately, we all need to wait for that in the short term release because it’s too early to feature those in a long term version.
|
||||
|
||||
Apart from that, Xfce Terminal remains in 0.8.10 in this release. Similar to Thunar, Xfce Terminal 1.0.0 major updates won’t be available in this LTS release.
|
||||
|
||||
[][3]
|
||||
|
||||
SEE ALSO: Pop OS 22.04 LTS - New Features and Release Updates
|
||||
|
||||
Besides these two, other desktop components remain with their last stable version with Xfce Panel 4.16.3, Xfce window manager 4.16.1 and Xfce Desktop 4.16. It is worth mentioning that Xfce is still working on the GTK4 transition, and not much clarity is available on the schedule.
|
||||
|
||||
Furthermore, the native applications see their version bumped to the latest stable iteration. But one significant change is Firefox executable is now a Snap version in Xubuntu 22.04 following Ubuntu. So, ideally, users would not feel any difference but may face some issues with extensions and other utilities due to its sandbox nature.
|
||||
|
||||
In addition to that, Xubuntu 22.04 expects a few nice wallpapers from the community contest, including a default one. The results are pending. However, you can find out some exciting submissions on [this page][4].
|
||||
|
||||
### Summary and Download
|
||||
|
||||
To sum up, major core frameworks, apps and their versions are down below.
|
||||
|
||||
* GNOME 42
|
||||
* GTK 3.24.32
|
||||
* MATE 1.26
|
||||
* Xfce 4.16
|
||||
* Firefox 99
|
||||
* Thunderbird 91.8
|
||||
* Atril Document Viewer 1.26
|
||||
* Engrampa Archive Manager 1.26
|
||||
* Ristretto Image Viewer 0.12.2
|
||||
* LibreOffice 7.3.x
|
||||
* Catfish 4.16.3
|
||||
* Mousepad 0.5.8
|
||||
|
||||
|
||||
|
||||
Finally, to download the BETA version of Xubuntu 22.04, refer to the link below to the ISO file. You can try to install on a virtual machine or try it in a physical system.
|
||||
|
||||
* [xubuntu-22.04-beta-desktop-amd64.iso][5]
|
||||
* [Other download options include torrents, checksums][6]
|
||||
|
||||
|
||||
|
||||
_Via [official changelog][7]_
|
||||
|
||||
* * *
|
||||
|
||||
We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][8], [Twitter][9], [YouTube][10], and [Facebook][11] and never miss an update!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/2022/04/xubuntu-22-04-lts/
|
||||
|
||||
作者:[Arindam][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.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2022/04/Xubuntu-22.04-Desktop-1024x575.jpg
|
||||
[2]: https://archive.xfce.org/src/xfce/thunar/4.16/
|
||||
[3]: https://www.debugpoint.com/2022/04/pop-os-22-04-lts/
|
||||
[4]: https://contest.xubuntu.org/wallpaper_contest/xubuntu-22-04-community-wallpaper-contest/?action=view
|
||||
[5]: https://cdimage.ubuntu.com/xubuntu/releases/22.04/beta/xubuntu-22.04-beta-desktop-amd64.iso
|
||||
[6]: https://cdimage.ubuntu.com/xubuntu/releases/22.04/beta/
|
||||
[7]: https://wiki.xubuntu.org/releases/22.04/release-notes
|
||||
[8]: https://t.me/debugpoint
|
||||
[9]: https://twitter.com/DebugPoint
|
||||
[10]: https://www.youtube.com/c/debugpoint?sub_confirmation=1
|
||||
[11]: https://facebook.com/DebugPoint
|
@ -1,125 +0,0 @@
|
||||
[#]: subject: "Create Your Own Custom Light and Dark Wallpaper for GNOME"
|
||||
[#]: via: "https://www.debugpoint.com/2022/04/custom-light-dark-wallpaper-gnome/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "robsean"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Create Your Own Custom Light and Dark Wallpaper for GNOME
|
||||
======
|
||||
AN EASY GUIDE ON – HOW TO CREATE YOUR CUSTOM LIGHT AND DARK WALLPAPER
|
||||
FOR the GNOME desktop.
|
||||
the GNOME desktop.
|
||||
|
||||
[GNOME 42][1] brings the much-awaited light and dark theme to GNOME Desktop. It also brings the light and dark version of wallpaper, which automatically changes when you switch between light and dark themes.
|
||||
|
||||
So, by default, GNOME gives you a set of pre-configured light and dark wallpapers. But what if you want a different wallpaper that changes automatically when the theme changes?
|
||||
|
||||
Here’s how to configure and create your own custom wallpaper for both light and dark themes in GNOME.
|
||||
|
||||
### How to create custom light and dark wallpaper for GNOME
|
||||
|
||||
Firstly, make sure you have two versions of wallpaper handy with you. In general, they should be standard PNG or JPG images. For example, we used below two wallpapers for this demo.
|
||||
|
||||
![Sample light and dark wallpaper for demo][2]
|
||||
|
||||
But if you do not have proper light and dark wallpaper and looking for more, I will let you know how to get them or prepare for your own at the end of this guide. Stay with me.
|
||||
|
||||
Second, we need to create a schema file for our own. The automatic changing of wallpaper is handled by an XML file called adwaita.xml, which defines specific light and dark backgrounds tags. So, we will create our XML file for the wallpapers.
|
||||
|
||||
To do that, copy the contents of adwaita.xml from GitLab, and create a new XML file (the link is down below). You should see two tags inside this file – “filename” and “filename-dark”. These two XML tags contain the fully qualified path of both the wallpapers. Now, add the path to your images under these two tags, as I have shown below.
|
||||
|
||||
[Download the XML file from here (adwaita.xml.in)][3]
|
||||
|
||||
![Change the XML file][4]
|
||||
|
||||
Third, save this file to with any name you want. If the “gnome-background-properties” are not there, create it. For this example, I used my_cool_backgrounds.xml.
|
||||
|
||||
![Save the file][5]
|
||||
|
||||
And you are all set. Finally, open the settings and go to the Appearance tab, and you should see the new wallpapers are visible as an option.
|
||||
|
||||
[][6]
|
||||
|
||||
SEE ALSO: New GNOME Text Editor - Everything You Need to Know
|
||||
|
||||
Select your own custom light and dark wallpaper and enjoy.
|
||||
|
||||
![Appearance tab has now your own custom light and dark wallpaper][7]
|
||||
|
||||
### How to download or make your own dynamic wallpaper
|
||||
|
||||
Definitely, you must think, who has the time to find and create both day and night versions of wallpaper? There are several websites that give you dynamic wallpapers ready-made that you can easily download and install.
|
||||
|
||||
One website I would recommend is [dynamicwallpaper.club][8] which has some excellent high-quality wallpapers up to 6K for macOS. And you can easily download them.
|
||||
|
||||
Additionally, if you plan to download from the above website, remember that the site’s images are in [heic format][9] because the website is for macOS. The High-Efficiency Video Coding (HEIC) is Apple’s proprietary version of the HEIF or High-Efficiency Image File format.
|
||||
|
||||
So, how to convert them in Linux systems? Well, you need a driver to view and convert the dynamic heic images in Ubuntu or Fedora Linux. Open a terminal and run the below commands to install the driver.
|
||||
|
||||
users –
|
||||
|
||||
```
|
||||
|
||||
sudo apt install heif-gdk-pixbuf
|
||||
|
||||
```
|
||||
|
||||
Fedora users –
|
||||
|
||||
```
|
||||
|
||||
sudo dnf install libheif
|
||||
|
||||
```
|
||||
|
||||
(without this plugin, Plasma apps can’t open heic images)
|
||||
|
||||
```
|
||||
|
||||
sudo apt install qt-heif-image-plugin
|
||||
sudo dnf install qt-heif-image-plugin
|
||||
|
||||
```
|
||||
|
||||
Finally, open the heic image with your favourite image viewer and save it as JPG/PNG.
|
||||
|
||||
Last of all, don’t forget to let me know down below in the comment section whether you are able to create your own custom dark and light wallpaper for GNOME.
|
||||
|
||||
![Custom Light and Dark wallpaper in GNOME – transition][10]
|
||||
|
||||
Cheers.
|
||||
|
||||
* * *
|
||||
|
||||
We bring the latest tech, software news and stuff that matters. Stay in touch via [Telegram][11], [Twitter][12], [YouTube][13], and [Facebook][14] and never miss an update!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/2022/04/custom-light-dark-wallpaper-gnome/
|
||||
|
||||
作者:[Arindam][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.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.debugpoint.com/2022/03/gnome-42-release/
|
||||
[2]: https://www.debugpoint.com/wp-content/uploads/2022/04/Sample-light-and-dark-wallpaper-for-demo.jpg
|
||||
[3]: https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/tree/main/backgrounds
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2022/04/Change-the-XML-file-1024x568.jpg
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2022/04/Save-the-file-1024x548.jpg
|
||||
[6]: https://www.debugpoint.com/2021/12/gnome-text-editor/
|
||||
[7]: https://www.debugpoint.com/wp-content/uploads/2022/04/Apperance-tab-has-now-your-own-custom-light-and-dark-wallpaper-1024x657.jpg
|
||||
[8]: https://dynamicwallpaper.club
|
||||
[9]: https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format
|
||||
[10]: https://www.debugpoint.com/wp-content/uploads/2022/04/Custom-Light-and-Dark-wallpaper-in-GNOME-transition-1024x556.gif
|
||||
[11]: https://t.me/debugpoint
|
||||
[12]: https://twitter.com/DebugPoint
|
||||
[13]: https://www.youtube.com/c/debugpoint?sub_confirmation=1
|
||||
[14]: https://facebook.com/DebugPoint
|
@ -1,422 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (jiamn)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Analyze Linux startup performance)
|
||||
[#]: via: (https://opensource.com/article/20/9/systemd-startup-configuration)
|
||||
[#]: author: (David Both https://opensource.com/users/dboth)
|
||||
|
||||
分析 Linux 启动性能
|
||||
======
|
||||
用 systemd-analyze 查看 Linux 启动性能或者解决一些问题
|
||||
|
||||
![Magnifying glass on code][1]
|
||||
|
||||
|
||||
系统管理员的一部分工作就是分析系统性能,去发现并解决引起性能不佳、长时间启动系统的问题。系统维护者也需要去检查系统配置和使用等。
|
||||
|
||||
systemd 初始化系统提供了 systemd-analyze 工具,帮助查看性能和其他重要的 systemd 信息。在以前的文章 分析 [_systemd 日历和时间间隔_][2] 里,我用了 systemd-analyze 去分析 systemd 里的时间戳和时间间隔,但是这个工具有很多其他用法,这个文章里我再揭示一些。
|
||||
|
||||
(译者注: systemd 是目前主流Linux release 采用的系统管理; boot 翻译为启动,startup 翻译为起动)
|
||||
|
||||
### 总览
|
||||
|
||||
LINUX 起动顺序是值得学习关注的地方,因为 systemd-analyze 工具很多功能聚焦在起动 startup 过程。但是首先,要理解启动 boot 和起动 startup 。启动从 BIOS 加电自检(POST)开始,装载和控制主机系统结束,然后是起动 startup ,systemd 日志开始。
|
||||
这个系列的第二篇文章, [_理解LINUX起动 systemd_][3],我讨论了起动 startup 的一点顺序上的细节,文章里,我试图解释起动 startup 顺序时间总进程和大部分时间花费在哪里。
|
||||
我的主工作站比虚拟机的结果更有意义。工作站组成是ASUS TUF X299 Mark 2 主板,Intel i9-7960X cpu (16核 32线程),64G内存。一些命令非超级用户可以使用,但是我在这篇文章里使用了超级用户避免在用户之间切换。
|
||||
检查起动过程有几个选项,最简单的是从 systemd-analyze 命令显示起动的几个主要分段耗费的时间汇总,内核起动,装载运行 initrd (初始ramdisk,一个临时系统镜像用来初始化一些硬件,挂载 / 根文件系统),还有用户空间 (所有的程序和后台进程需要主机起动到一个可用的状态)。如果没有子命令传递给命令, systemd-analyze time 是这样的:
|
||||
|
||||
```
|
||||
[root@david ~]$ systemd-analyze
|
||||
Startup finished in 53.921s (firmware) + 2.643s (loader) + 2.236s (kernel) + 4.348s (initrd) + 10.082s (userspace) = 1min 13.233s
|
||||
graphical.target reached after 10.071s in userspace
|
||||
[root@david ~]#
|
||||
```
|
||||
特别要注意的 BIOS 花费了接近54秒,这是一个非同寻常的时间段,基本上所有的物理硬件系统都要使用 BIOS。
|
||||
|
||||
我的System76 Oryx Pro笔记本在BIOS只花了8.506秒,我家里所有的系统都在10秒以内。在线搜索一阵之后,我发现这个主板(译者注:作者的主工作站主板)因为不同寻常的 BIOS 启动时间著名,我的主板从不“启动”,总是挂掉,我需要关机再开机,BIOS报错,按 F1 进入 BIO S设置,选择要启动的驱动器完成启动,多出的时间就是这样用掉的。
|
||||
|
||||
不是所有主机显示固件数据(译者注:固件启动中无法使用 systemd)。用Intel 9代或者更高的处理器就感觉不科学。尽管那不是正确的。(译者注:更高代的 cpu 启动时间更短,因为优化的 BIOS )
|
||||
|
||||
总结关于启动起动是非常有趣的,同时提供了很好的(虽然有限)的信息,仍然有很多关于起动的信息,就像下面我将描述的一样。
|
||||
|
||||
### 指定火炬
|
||||
|
||||
你可以用 systemd-analyze blame 去发现初始化每个 systemd 单元用掉的时间,结果按照初始化时间长短排序,从多到少:
|
||||
|
||||
|
||||
```
|
||||
[root@david ~]$ systemd-analyze blame
|
||||
5.417s NetworkManager-wait-online.service
|
||||
3.423s dracut-initqueue.service
|
||||
2.715s systemd-udev-settle.service
|
||||
2.519s fstrim.service
|
||||
1.275s udisks2.service
|
||||
1.271s smartd.service
|
||||
996ms upower.service
|
||||
637ms lvm2-monitor.service
|
||||
533ms lvm2-pvscan@8:17.service
|
||||
520ms dmraid-activation.service
|
||||
460ms vboxdrv.service
|
||||
396ms initrd-switch-root.service
|
||||
<SNIP – removed lots of entries with increasingly small times>
|
||||
```
|
||||
注:删去了好多时间不长的条目
|
||||
|
||||
因为很多服务是并行开始的,在 BIOS 之后所有单元加在一起的总数超过了 systemd-analyze time 汇总数。很多都是小数,不能显著的节省时间。
|
||||
|
||||
这个命令提供的数据显明了提升启动时间的办法。无用的服务禁止(disable)掉。在起动序列中花掉很多时间的单一服务呈现明显。每次启动起动你可以看到不同结果。(译者注:并行起动服务的原因)
|
||||
|
||||
### 严格链
|
||||
|
||||
项目管理中有个严格链,(译者注:systemd可以定义服务间严格依赖,构成严格链)在起动中可以通过查看一个严格链与时间相关的事件。
|
||||
有一些systemd单元起动中很慢,可能因为依赖严格链影响的,工具没有从开始显示所有单元,仅仅是有严格限制关系的事件。(译者注:相当于最短路径。并不显示依赖但不在严格链上的服务单元)
|
||||
|
||||
|
||||
```
|
||||
[root@david ~]# systemd-analyze critical-chain
|
||||
The time when unit became active or started is printed after the "@" character.
|
||||
The time the unit took to start is printed after the "+" character.
|
||||
|
||||
graphical.target @10.071s
|
||||
└─lxdm.service @10.071s
|
||||
└─plymouth-quit.service @10.047s +22ms
|
||||
└─systemd-user-sessions.service @10.031s +7ms
|
||||
└─remote-fs.target @10.026s
|
||||
└─remote-fs-pre.target @10.025s
|
||||
└─nfs-client.target @4.636s
|
||||
└─gssproxy.service @4.607s +28ms
|
||||
└─network.target @4.604s
|
||||
└─NetworkManager.service @4.383s +219ms
|
||||
└─dbus-broker.service @4.434s +136ms
|
||||
└─dbus.socket @4.369s
|
||||
└─sysinit.target @4.354s
|
||||
└─systemd-update-utmp.service @4.345s +9ms
|
||||
└─auditd.service @4.301s +42ms
|
||||
└─systemd-tmpfiles-setup.service @4.254s +42ms
|
||||
└─import-state.service @4.233s +19ms
|
||||
└─local-fs.target @4.229s
|
||||
└─Virtual.mount @4.019s +209ms
|
||||
└─systemd-fsck@dev-mapper-vg_david2\x2dVirtual.service @3.742s +274ms
|
||||
└─local-fs-pre.target @3.726s
|
||||
└─lvm2-monitor.service @356ms +637ms
|
||||
└─dm-event.socket @319ms
|
||||
└─-.mount
|
||||
└─system.slice
|
||||
└─-.slice
|
||||
[root@david ~]#
|
||||
```
|
||||
|
||||
@后面的秒数数字是从起动开始到单元激活的时间,+后面是单元开始花费的时间。
|
||||
|
||||
### 系统状态
|
||||
|
||||
有时候你需要决定系统的当前状态, systemd-analyze dump 命令挖显出当前系统状态的一堆数据。有主要的启动时间戳,一个每个 systemd 单元的列表,和一个每个完整的详细描述:
|
||||
|
||||
|
||||
```
|
||||
[root@david ~]# systemd-analyze dump
|
||||
Timestamp firmware: 1min 7.983523s
|
||||
Timestamp loader: 3.872325s
|
||||
Timestamp kernel: Wed 2020-08-26 12:33:35 EDT
|
||||
Timestamp initrd: Wed 2020-08-26 12:33:38 EDT
|
||||
Timestamp userspace: Wed 2020-08-26 12:33:42 EDT
|
||||
Timestamp finish: Wed 2020-08-26 16:33:56 EDT
|
||||
Timestamp security-start: Wed 2020-08-26 12:33:42 EDT
|
||||
Timestamp security-finish: Wed 2020-08-26 12:33:42 EDT
|
||||
Timestamp generators-start: Wed 2020-08-26 16:33:42 EDT
|
||||
Timestamp generators-finish: Wed 2020-08-26 16:33:43 EDT
|
||||
Timestamp units-load-start: Wed 2020-08-26 16:33:43 EDT
|
||||
Timestamp units-load-finish: Wed 2020-08-26 16:33:43 EDT
|
||||
Timestamp initrd-security-start: Wed 2020-08-26 12:33:38 EDT
|
||||
Timestamp initrd-security-finish: Wed 2020-08-26 12:33:38 EDT
|
||||
Timestamp initrd-generators-start: Wed 2020-08-26 12:33:38 EDT
|
||||
Timestamp initrd-generators-finish: Wed 2020-08-26 12:33:38 EDT
|
||||
Timestamp initrd-units-load-start: Wed 2020-08-26 12:33:38 EDT
|
||||
Timestamp initrd-units-load-finish: Wed 2020-08-26 12:33:38 EDT
|
||||
-> Unit system.slice:
|
||||
Description: System Slice
|
||||
Instance: n/a
|
||||
Unit Load State: loaded
|
||||
Unit Active State: active
|
||||
State Change Timestamp: Wed 2020-08-26 12:33:38 EDT
|
||||
Inactive Exit Timestamp: Wed 2020-08-26 12:33:38 EDT
|
||||
Active Enter Timestamp: Wed 2020-08-26 12:33:38 EDT
|
||||
Active Exit Timestamp: n/a
|
||||
Inactive Enter Timestamp: n/a
|
||||
May GC: no
|
||||
<SNIP – Deleted a bazillion lines of output>
|
||||
```
|
||||
|
||||
注:删掉了很多输出行
|
||||
|
||||
在我的主工作站,这个命令生成了49680行大概1.66MB,命令很快,你不需要等待。
|
||||
|
||||
我喜欢多种连接设备的规格细节,例如存储。每个 systemd 单元有一节例如模块的多种运行时、缓存、日志目录、单元开始命令、PID、开始时间戳、内存和文件限制。
|
||||
|
||||
systemd-analyze 的 man 帮助手册里展示了 systemd-analyze --user dump 选项,显示用户管理器的内部状态。但是我失败了,互联网搜索之后表明机器有一些问题。在 systemd 里, --user 实例用来管理和控制处理器给每个用户的资源。处理能力按分给每个用户的控制组 control group(译者注:系统管理一个特性)分配,我回头再写。
|
||||
|
||||
### 分析图表
|
||||
|
||||
很多尖头老板( pointy-haired-bosses )和好的经理人发现好的图表特别容易阅读理解,比我经常看的文本类系统性能数据好。看,我喜欢好图表,systemd-analyze 提供了显示启动/起动数据用 [SVG][4] 向量图表。
|
||||
|
||||
下面的命令生成一个向量图文件来显示在启动起动之间发生的事件。生成这个文件只需要几秒:
|
||||
|
||||
```
|
||||
`[root@david ~]# systemd-analyze plot > /tmp/bootup.svg`
|
||||
```
|
||||
|
||||
这个命令创建了 SVG,SVG是一个定义图向量应用的文本文件,包括Image Viewer、Ristretto、 Okular、 Eye of Mate、 LibreOffice Draw、和其他,(译者注:这些是文档应用)用来生成图。这些应用可以处理 SVG 来创建一个图像。
|
||||
|
||||
我用 LibreOffice Draw(译者注:一个办公文档软件)去渲染一幅图。图很大,你需要放大来看细节。这里放的比较小:
|
||||
|
||||
![The bootup.svg file displayed in LibreOffice Draw.][5]
|
||||
|
||||
(David Both, [CC BY-SA 4.0][6])
|
||||
|
||||
启动起始是图上左面的时间线0,起动序列在0的右面。这个小图显示了内核、initrd、和initrd处理开启。
|
||||
|
||||
这个图显示了谁什么时候开始,持续了多久,和主要的依赖。严格路径是红色高亮的。
|
||||
|
||||
另外一个生成图片输出的命令是 systemd-analyze plot,它生成了[DOT][7] 格式纹理依赖图。结果数据流通过 dot 工具管道,这是一族用来生成向量图文件多种类型数据的程序。这些 SVG 文件也能被上面列出的工具处理。
|
||||
|
||||
首先,生成文件,在我的主工作站花了9分钟:
|
||||
|
||||
|
||||
```
|
||||
[root@david ~]# time systemd-analyze dot | dot -Tsvg > /tmp/test.svg
|
||||
Color legend: black = Requires
|
||||
dark blue = Requisite
|
||||
dark grey = Wants
|
||||
red = Conflicts
|
||||
green = After
|
||||
|
||||
real 8m37.544s
|
||||
user 8m35.375s
|
||||
sys 0m0.070s
|
||||
[root@david ~]#
|
||||
```
|
||||
|
||||
我不想重新生成输出了,因为比意大利面还好。但是你应该试试看看我想让你看到的结果。
|
||||
|
||||
### 条件
|
||||
|
||||
我不想重新生成输出了,因为比意大利面还好。但是你应该试试看看我想让你看到的结果。
|
||||
|
||||
很多有意思的,也有些普遍的,当我读 systemd-analyze man 帮助时发现 condition 子命令 (是的,我读了man帮助手册,我就是这样学习的)。这个 condition 子命令能用来测试条件和断言 systemd 单元文件。
|
||||
|
||||
把它放到程序里评估一个或者多个条件成立是否返回 0 值,或者条件没有成立返回 1。 在其他情况,它根据调查结果吐出文本。
|
||||
|
||||
下面的例子,来自man帮助手册,稍微有点复杂。它测试了内核版本是不是在 4.0 和 5.1,主机使 用AC power,系统结构不是 arm,并且它的目录 /etc/os-release 是否存在。我加了 echo $? 来打印返回值。
|
||||
|
||||
|
||||
```
|
||||
[root@david ~]# systemd-analyze condition 'ConditionKernelVersion = ! <4.0' \
|
||||
'ConditionKernelVersion = >=5.1' \
|
||||
'ConditionACPower=|false' \
|
||||
'ConditionArchitecture=|!arm' \
|
||||
'AssertPathExists=/etc/os-release' ; \
|
||||
echo $?
|
||||
test.service: AssertPathExists=/etc/os-release succeeded.
|
||||
Asserts succeeded.
|
||||
test.service: ConditionArchitecture=|!arm succeeded.
|
||||
test.service: ConditionACPower=|false failed.
|
||||
test.service: ConditionKernelVersion=>=5.1 succeeded.
|
||||
test.service: ConditionKernelVersion=!<4.0 succeeded.
|
||||
Conditions succeeded.
|
||||
0
|
||||
[root@david ~]#
|
||||
```
|
||||
|
||||
条件和断言在 systemd.unit(5) man帮助手册的大概 600 行。
|
||||
|
||||
### 罗列配置文件
|
||||
|
||||
systemd-analyze 工具可以发送多种配置文件内容去标准输出,像这儿展示的,基础根目录是 /etc/:
|
||||
|
||||
|
||||
```
|
||||
[root@david ~]# systemd-analyze cat-config systemd/system/display-manager.service
|
||||
# /etc/systemd/system/display-manager.service
|
||||
[Unit]
|
||||
Description=LXDM (Lightweight X11 Display Manager)
|
||||
#Documentation=man:lxdm(8)
|
||||
Conflicts=[getty@tty1.service][8]
|
||||
After=systemd-user-sessions.service [getty@tty1.service][8] plymouth-quit.service livesys-late.service
|
||||
#Conflicts=plymouth-quit.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/lxdm
|
||||
Restart=always
|
||||
IgnoreSIGPIPE=no
|
||||
#BusName=org.freedesktop.lxdm
|
||||
|
||||
[Install]
|
||||
Alias=display-manager.service
|
||||
[root@david ~]#
|
||||
```
|
||||
|
||||
这和标准的 cat 命令做的差不多。我发现另外一条小有帮助的命令,它能在标准的 systemd 所在的位置搜索模式匹配的内容:
|
||||
|
||||
|
||||
```
|
||||
[root@david ~]# systemctl cat backup*
|
||||
# /etc/systemd/system/backup.timer
|
||||
# This timer unit runs the local backup program
|
||||
# (C) David Both
|
||||
# Licensed under GPL V2
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=Perform system backups
|
||||
Requires=backup.service
|
||||
|
||||
[Timer]
|
||||
Unit=backup.service
|
||||
OnCalendar=*-*-* 00:15:30
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
|
||||
# /etc/systemd/system/backup.service
|
||||
# This service unit runs the rsbu backup program
|
||||
# By David Both
|
||||
# Licensed under GPL V2
|
||||
#
|
||||
|
||||
[Unit]
|
||||
Description=Backup services using rsbu
|
||||
Wants=backup.timer
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
Environment="HOME=/root"
|
||||
ExecStart=/usr/local/bin/rsbu -bvd1
|
||||
ExecStart=/usr/local/bin/rsbu -buvd2
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
[root@david ~]#
|
||||
```
|
||||
|
||||
这些命令为每个文件提供了包含文件的全路径和文件名的注释行。
|
||||
|
||||
### 单元文件检查
|
||||
|
||||
当创建了一个新的单元文件,利用 verify 子命令帮助检查语法是否正确。它能指出来不正确的拼写和呼叫错误服务单元的指导。
|
||||
|
||||
|
||||
```
|
||||
`[root@david ~]# systemd-analyze verify /etc/systemd/system/backup.service`
|
||||
```
|
||||
|
||||
Unix/Linux 的反馈宗旨是“沉默是金”,没有输出意味着扫描文件没有错。
|
||||
|
||||
### 安全
|
||||
|
||||
security 子命令检查指定服务的安全级别。只能针对服务单元,其他类型的单元文件不可用:
|
||||
|
||||
|
||||
```
|
||||
[root@david ~]# systemd-analyze security display-manager
|
||||
NAME DESCRIPTION >
|
||||
✗ PrivateNetwork= Service has access to the host's network >
|
||||
✗ User=/DynamicUser= Service runs as root user >
|
||||
✗ CapabilityBoundingSet=~CAP_SET(UID|GID|PCAP) Service may change UID/GID identities/capabilities >
|
||||
✗ CapabilityBoundingSet=~CAP_SYS_ADMIN Service has administrator privileges >
|
||||
✗ CapabilityBoundingSet=~CAP_SYS_PTRACE Service has ptrace() debugging abilities >
|
||||
✗ RestrictAddressFamilies=~AF_(INET|INET6) Service may allocate Internet sockets >
|
||||
✗ RestrictNamespaces=~CLONE_NEWUSER Service may create user namespaces >
|
||||
✗ RestrictAddressFamilies=~… Service may allocate exotic sockets >
|
||||
✗ CapabilityBoundingSet=~CAP_(CHOWN|FSETID|SETFCAP) Service may change file ownership/access mode/capabilities unres>
|
||||
✗ CapabilityBoundingSet=~CAP_(DAC_*|FOWNER|IPC_OWNER) Service may override UNIX file/IPC permission checks >
|
||||
✗ CapabilityBoundingSet=~CAP_NET_ADMIN Service has network configuration privileges >
|
||||
✗ CapabilityBoundingSet=~CAP_SYS_MODULE Service may load kernel modules
|
||||
<SNIP>
|
||||
✗ CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG Service may issue vhangup() >
|
||||
✗ CapabilityBoundingSet=~CAP_WAKE_ALARM Service may program timers that wake up the system >
|
||||
✗ RestrictAddressFamilies=~AF_UNIX Service may allocate local sockets >
|
||||
|
||||
→ Overall exposure level for backup.service: 9.6 UNSAFE 😨
|
||||
lines 34-81/81 (END)
|
||||
```
|
||||
|
||||
是的,哭脸(emoji)是输出。但是当然,很多服务的工作比美观更重要。我列举了一些服务,包括我自己的备份服务,结果可能不同,但是最下面一行看起来是一样的。
|
||||
这个工具对于在严格的安全环境检查和修复用户空间服务单元是很有用的。我不认为我们的大多数都能用到它。
|
||||
|
||||
### 最后总结
|
||||
|
||||
强有力的工具(sysmted-analyze)提供了一些有意思和迷人的有益的选项。这篇文章阐述了用 systemd-analyze 来分析 systemd Linux内部起动性能。它同样能分析 systemd 的其他方面。
|
||||
工具的某部分是限制使用的,有些被遗漏。但是大多数对于起动和其他 systemd 功能的问题解决提供了很好的结果。
|
||||
|
||||
### 资源
|
||||
|
||||
互联网上关于 systemd 有很多信息,但是很多过于简洁,迟钝,甚至误导。这篇文章中提到的额外的资源,是列在下面的关于 systemd 起动的更细节更可信的web页面。我罗列了自从我开始这个系列的文章影响我研究的内容。
|
||||
|
||||
* The [systemd.unit(5) 手册页面][9] 包含了非常棒的每个都是丰富细节描述的一些单元文件节段和它们的配置文件选项。
|
||||
* The Fedora 项目有一个好的练习 [systemd 指导][10]. 它指导了你用 Fedora systemd 要知道的设置,管理,维护。
|
||||
* The Fedora 项目还有一个好的 [备忘录][11] 兼容交叉了老的 SystemV 命令和 systemd 以及比较。
|
||||
* Red Hat 文档包含了一个详细的描述 [单元文件结构][12] 和其他一样重要的信息。
|
||||
* 关于systemd技术细节和创建的原因,可以去 Freedesktop.org's [ systemd 详述][13].
|
||||
* [Linux.com][14]的 "更多 systemd 乐趣" 提供了很多高级的 systemd [信息和提示][15].
|
||||
|
||||
|
||||
下面是 systemd 设计者和主要开发者 Lennart Poettering 关于 Linux 系统管理员的深度技术文档,这些文章尽管写于2010年4月到2011年9月,现在看也是非常适应时宜的。其他很棒的 systemd 相关的体系都基于这些设计。
|
||||
|
||||
* [Rethinking PID 1][16]
|
||||
* [systemd for Administrators, Part I][17]
|
||||
* [systemd for Administrators, Part II][18]
|
||||
* [systemd for Administrators, Part III][19]
|
||||
* [systemd for Administrators, Part IV][20]
|
||||
* [systemd for Administrators, Part V][21]
|
||||
* [systemd for Administrators, Part VI][22]
|
||||
* [systemd for Administrators, Part VII][23]
|
||||
* [systemd for Administrators, Part VIII][24]
|
||||
* [systemd for Administrators, Part IX][25]
|
||||
* [systemd for Administrators, Part X][26]
|
||||
* [systemd for Administrators, Part XI][27]
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/9/systemd-startup-configuration
|
||||
|
||||
作者:[David Both][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[jiamn](https://github.com/jiamn)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/dboth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0 (Magnifying glass on code)
|
||||
[2]: https://opensource.com/article/20/7/systemd-calendar-timespans
|
||||
[3]: https://opensource.com/article/20/5/systemd-startup?utm_campaign=intrel
|
||||
[4]: https://en.wikipedia.org/wiki/Scalable_Vector_Graphics
|
||||
[5]: https://opensource.com/sites/default/files/uploads/bootup.svg-graph.png (The bootup.svg file displayed in LibreOffice Draw.)
|
||||
[6]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[7]: https://en.wikipedia.org/wiki/DOT_(graph_description_language)
|
||||
[8]: mailto:getty@tty1.service
|
||||
[9]: https://man7.org/linux/man-pages/man5/systemd.unit.5.html
|
||||
[10]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html
|
||||
[11]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet
|
||||
[12]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-services-with-systemd_configuring-basic-system-settings#Managing_Services_with_systemd-Unit_File_Structure
|
||||
[13]: https://www.freedesktop.org/wiki/Software/systemd/
|
||||
[14]: http://Linux.com
|
||||
[15]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/
|
||||
[16]: http://0pointer.de/blog/projects/systemd.html
|
||||
[17]: http://0pointer.de/blog/projects/systemd-for-admins-1.html
|
||||
[18]: http://0pointer.de/blog/projects/systemd-for-admins-2.html
|
||||
[19]: http://0pointer.de/blog/projects/systemd-for-admins-3.html
|
||||
[20]: http://0pointer.de/blog/projects/systemd-for-admins-4.html
|
||||
[21]: http://0pointer.de/blog/projects/three-levels-of-off.html
|
||||
[22]: http://0pointer.de/blog/projects/changing-roots
|
||||
[23]: http://0pointer.de/blog/projects/blame-game.html
|
||||
[24]: http://0pointer.de/blog/projects/the-new-configuration-files.html
|
||||
[25]: http://0pointer.de/blog/projects/on-etc-sysinit.html
|
||||
[26]: http://0pointer.de/blog/projects/instances.html
|
||||
[27]: http://0pointer.de/blog/projects/inetd.html
|
@ -1,194 +0,0 @@
|
||||
[#]: subject: (Partition a drive on Linux with GNU Parted)
|
||||
[#]: via: (https://opensource.com/article/21/4/linux-parted-cheat-sheet)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (hwlife)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
||||
在 Linxu 上使用 GNU Parted 对磁盘分区
|
||||
======
|
||||
了解对新的储存设备分区的基础知识,然后下载我们的备忘表隔,保持信息交流方便。
|
||||
|
||||
![Cheat Sheet cover image][1]
|
||||
|
||||
在 21 世纪,我们倾向于数据存储是理所当然的。我们有许多存储介质,相对价格便宜,而且有许多不同的可用类型。不论你获得的免费云存储空间有多少,没有比有一个物理硬盘空间来存储重要的数据更好了(容量真的很大或者当你在一个慢速网络上时) 。然而,理想的磁盘分区是没有几块硬盘买回来就是现成的,至少,如果你买了一块新硬盘或者用不同分区安装一个系统,你需要知道怎么在 Linux 上为磁盘分区。
|
||||
|
||||
这篇文章介绍 GNU Parted ,磁盘分区最好的工具之一。如果你偏向使用图形化程序替代终端命令行,阅读我的 [为 Linux 格式化驱动器][2] 这篇文章。
|
||||
|
||||
### 磁盘卷标,分区和文件系统
|
||||
|
||||
技术上来说,一个硬盘驱动器不需要很多软件来服务于存储设备。然而,使用一个驱动器没有现代化的转换技术比如分区表和文件系统是困难的,不切实际的,对你的数据是不安全的。
|
||||
|
||||
这里有三个你需要知道的关于硬盘驱动器的重要概念:
|
||||
|
||||
|
||||
* A **磁盘卷标** 或者 **分区表** 是放置在磁盘驱动器起始位置的元数据,它为计算机读取关于可用存储是何种类型,磁盘驱动器的位置等信息做提示。
|
||||
* A **分区** 是一个证明文件系统所在位置的边界。举个例子,如果你有一个 512GB 的硬盘,你可以用占用所有磁盘容量 (512GB) 分成一个分区,或者分成两个分区,每个占用 256GB ,或者分成三个分区占用一些其他大小变化等等。
|
||||
* A **文件系统** 是一个硬盘驱动器和计算机两者约定俗成的存储体系。计算机必须知道怎样读取文件系统上拼合在一起存储在驱动器上的的数据,并且知道怎样写入数据到文件系统并保持数据的完整性。
|
||||
|
||||
|
||||
GNU Parted 程序管理前两个概念:磁盘卷标和分区。Parted 对文件系统有所了解,但是它留下了文件系统详细操作给了其他类似 `mkfs` 这样的工具。
|
||||
|
||||
**[下载 [GNU Parted 备忘表格][3]]**
|
||||
|
||||
### 查找磁盘驱动器
|
||||
|
||||
使用 GNU Parted 之前,你必须在你的系统上确定你的驱动器所在位置。首先,连接你想要格式化你的系统的磁盘驱动器,然后用 `parted` 命令查看连接到你的计算机的内容:
|
||||
|
||||
|
||||
```
|
||||
$ parted /dev/sda print devices
|
||||
/dev/sda (2000GB)
|
||||
/dev/sdb (1000GB)
|
||||
/dev/sdc (1940MB)
|
||||
```
|
||||
你最新连接设备的名称在字母表上晚于连接时间更长的设备。举个例子,`/dev/sdc` 最有可能是我刚刚连接的磁盘。我能通过它的容量大小来确认,相比于我的工作站上的主要驱动器的 TB 大小来说,因为我知道我插入的 U 盘 只有 2GB (1940MB 足够接近) 大小。如果你不能确定,你可以得到的更多关于你想要分区的驱动器的信息:
|
||||
|
||||
|
||||
```
|
||||
$ parted /dev/sdc print
|
||||
Model: Yoyodyne Tiny Drive 1.0 (scsi)
|
||||
Disk /dev/sdc: 1940MB
|
||||
Sector size (logical/physical): 512B/512B
|
||||
Partition Table: msdos
|
||||
Disk Flags:
|
||||
|
||||
Number Start End Size File system Name Flags
|
||||
1 1049kB 2048kB 1024kB BS Bloat Hidden
|
||||
2 2049kB 1939MB 1937MB FAT32 MyDrive
|
||||
```
|
||||
|
||||
有些驱动器比其他驱动器有更多的元数据。这个磁盘证明它自己的物理驱动器商标是 Yoyodyne ,此外,在磁盘的起始包含了一个小的有些臃肿的隐藏分区和一个兼容 Windows 的 FAT32 分区。这确实是我要重新打算格式化的驱动器。
|
||||
|
||||
继续之前, _确认_ 你已经证实你要分区正确的驱动器。 _重新分区错误的驱动器会导致数据丢失。_ 为了安全起见,在文章中整个潜在的破环性命令都引用为在你的系统中不太可能有的 `/dev/sdX` 设备。
|
||||
|
||||
### 创建磁盘卷标或者分区表
|
||||
|
||||
要在磁盘上创建一个分区,驱动器必须要有一个磁盘卷标。磁盘卷标也被叫做 _分区表_,所以 Parted 对两个术语都接受。
|
||||
|
||||
要创建一个磁盘卷标,使用 `mklabel` 或 `mktable` 子命令:
|
||||
|
||||
|
||||
```
|
||||
`$ parted /dev/sdX mklabel gpt`
|
||||
```
|
||||
|
||||
这个命令在位于 `/dev/sdX` 的驱动器前面创建了一个 **gpt** 的标签,删除了任何可能存在的标签。这是一个快速的过程因为所有关于被替换的分区信息都存在于元数据。
|
||||
|
||||
|
||||
### 创建分区
|
||||
|
||||
要在磁盘创建分区,使用 `mkpart` 子命令,后跟分区的可选名称,再跟分区的开始和结束位置。如果你在磁盘上只需要一个分区,那么大小调整是容易的:开始位置输入 1 ,结束位置输入 100% 。使用 `--align opt` 参数允许 Parted 调整分区边界位置便于磁盘获得最佳性能:
|
||||
|
||||
|
||||
```
|
||||
$ parted /dev/sdX --align opt \
|
||||
mkpart example 1 100%
|
||||
```
|
||||
|
||||
用 `print` 子命令查看你的新分区:
|
||||
|
||||
|
||||
```
|
||||
$ parted /dev/sdX print
|
||||
Model: Yoyodyne Tiny Drive 1.0 (scsi)
|
||||
Disk /dev/sdi: 1940MB
|
||||
Sector size (logical/physical): 512B/512B
|
||||
Partition Table: gpt
|
||||
Disk Flags:
|
||||
|
||||
Number Start End Size
|
||||
1 1049kB 1939MB 1938MB
|
||||
```
|
||||
|
||||
你不必使用整个磁盘作为一个分区。分区的优势是在一个磁盘上可以存在多个文件系统,它们之间不会相互干扰。但调整分区的时候,你可以使用 `unit` 子命令来设置你想用的测量方法。Parted 理解扇区,柱面,磁头,字节,KB ,MB ,GB ,TB 和百分比。
|
||||
|
||||
你也可以指定你打算使用分区的文件系统。这并不能够完全创建文件系统,但是它为你以后方便使用提供了元数据。
|
||||
|
||||
将磁盘对半分,一个是 XFS 文件系统,另一个是 EXT4 文件系统:
|
||||
|
||||
|
||||
```
|
||||
$ parted /dev/sdX --align opt \
|
||||
mkpart xfs 1 50%
|
||||
$ parted /dev/sdX --align opt \
|
||||
mkpart ext4 51% 100%
|
||||
```
|
||||
|
||||
### 命令分区
|
||||
|
||||
除了标记分区用于什么文件系统之外,你也可以为每个分区命名。一些文件管理器和工具可以读取分区名称,能够帮助你区分驱动器。例如,我经常有几个不同的驱动器连接到我的媒体工作站,每个属于一个不同的项目。当创建这些驱动器的时候,我把分区和文件系统名称都命名了,以至于不论我怎么看我的系统,重要数据的位置都被清楚的标记。
|
||||
|
||||
要命名一个分区,你必须知道它的序号:
|
||||
|
||||
|
||||
```
|
||||
$ parted /dev/sdX print
|
||||
[...]
|
||||
Number Start End Size File system Name Flags
|
||||
1 1049kB 990MB 989MB xfs example
|
||||
2 1009MB 1939MB 930MB ext4 noname
|
||||
```
|
||||
|
||||
要命名分区 1:
|
||||
|
||||
|
||||
```
|
||||
$ parted /dev/sdX name 1 example
|
||||
$ parted /dev/sdX print
|
||||
[...]
|
||||
Number Start End Size File system Name Flags
|
||||
1 1049kB 990MB 989MB xfs example
|
||||
2 1009MB 1939MB 930MB ext4 noname
|
||||
```
|
||||
|
||||
### 创建文件系统
|
||||
|
||||
要让你的驱动器能够正常使用,你必须在新分区上创建一个文件系统。GNU Parted 没有这样做,因为它只是一个分区管理器。在磁盘上使用 `mkfs` 命令来创建文件系统,而且有些对你有帮助的工具使用别名来创建特定种类的文件系统。例如, `mkfs.ext4` 创建 EXT4 文件系统, `mkfs.xfs` 创建 XFS 文件系统等等。
|
||||
|
||||
你的分区位于磁盘驱动器的 "内部" ,所以不用在 `/dev/sdX` 上创建文件系统,只需要在第一个分区创建你的 `/dev/sdX1` 文件系统, `/dev/sdX2` 是第二个文件系统,以此类推。
|
||||
|
||||
这里是一个创建 XFS 文件系统的例子:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo mkfs.xfs -L mydrive /dev/sdX1`
|
||||
```
|
||||
|
||||
### 下载我们的备注表格
|
||||
|
||||
Parted 是一个灵活而强大的工具。如本文所示,你可以发出命令,或者激活一个交互模式以不断 "连接" 你指定的驱动器:
|
||||
|
||||
|
||||
```
|
||||
$ parted /dev/sdX
|
||||
(parted) print
|
||||
[...]
|
||||
Number Start End Size File system Name Flags
|
||||
1 1049kB 990MB 989MB xfs example
|
||||
2 1009MB 1939MB 930MB ext4 noname
|
||||
|
||||
(parted) name 1 mydrive
|
||||
(parted)
|
||||
```
|
||||
|
||||
如果你打算经常使用 Parted , [下载我们的 GNU Parted 备忘表格][3]以至于你可以方便使用所有的子命令。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/21/4/linux-parted-cheat-sheet
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[hwlife](https://github.com/hwlife)
|
||||
校对:[校对者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/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image)
|
||||
[2]: https://opensource.com/article/18/11/partition-format-drive-linux#gui
|
||||
[3]: https://opensource.com/downloads/parted-cheat-sheet
|
@ -1,203 +0,0 @@
|
||||
[#]: subject: "View your Linux server's network connections with netstat"
|
||||
[#]: via: "https://opensource.com/article/22/2/linux-network-security-netstat"
|
||||
[#]: author: "Sahana Sreeram https://opensource.com/users/sahanasreeram01gmailcom"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "hwlife"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
使用 netstat 查看你的 Linux 服务器网络连接
|
||||
======
|
||||
netstat 命令对你的 Linux 服务器提供了监测和网络故障排除这两个重要的观察手段。
|
||||
|
||||
![A rack of servers, blue background][1]
|
||||
|
||||
在 [之前的文章中][2],我分享了一些重要的首要步骤来管理你的个人 Linux 服务器。我简要的提到了使用监听端口来监测网络连接,并且我想通过 Linux 系统的 `netstat` 命令来扩展开讲讲。
|
||||
|
||||
|
||||
服务监测和端口扫描是标准的行业惯例。有类似 [Prometheus][3] 协助过程自动化,[SELinux][4] 协助上下文和保护系统访问权限。然而,我相信了解怎样使你的服务器连接到其他网络和设备是建立正常服务器基准的关键,能够帮助你认识到可能提示错误和入侵等异常情况。作为一个初学者,我已经掌握了 `netstat` 命令对我的服务器提供了监测和网络故障排除这两个重要的观察手段。
|
||||
|
||||
|
||||
在 [net-tools 软件包][5] 里,Netstat 和相似的一些网络监测工具被收集在一起,用来显示关于活动连接的信息。因为服务运行在开放的端口经常会被利用,定期日常网络监测能够帮助你及早探测到可以的活动。
|
||||
|
||||
|
||||
### 安装 netstat
|
||||
|
||||
Nestat 在 Linux 发行版上经常是预装软件。如果 netstat 没有在你的服务器上安装,用你的包管理器安装它。下面是在基于 Debian 的系统上:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo apt-get install net-tools`
|
||||
```
|
||||
|
||||
在基于 Fedora 的系统上:
|
||||
|
||||
|
||||
```
|
||||
`$ dnf install net-tools`
|
||||
```
|
||||
|
||||
### 使用 netstat
|
||||
|
||||
就其本身而言, `netstat` 命令显示了全部建立成功的连接。你可以使用 `netstat` 的参数指定进一步预定的输出。举个例子,要显示所有监听和非监听的连接,使用 `--all` (`-a` 为简写)的参数。这将返回许多结果,所以在例子中我用管道符输出给 `head` 命令来显示输出的前15行消息:
|
||||
|
||||
```
|
||||
|
||||
|
||||
$ netstat --all | head -n 15
|
||||
Active Internet connections (servers and established)
|
||||
Proto Recv-Q Send-Q Local Address Foreign Address State
|
||||
tcp 0 0 *:27036 *:* LISTEN
|
||||
tcp 0 0 localhost:27060 *:* LISTEN
|
||||
tcp 0 0 *:16001 *:* LISTEN
|
||||
tcp 0 0 localhost:6463 *:* LISTEN
|
||||
tcp 0 0 *:ssh *:* LISTEN
|
||||
tcp 0 0 localhost:57343 *:* LISTEN
|
||||
tcp 0 0 *:ipp *:* LISTEN
|
||||
tcp 0 0 *:4713 *:* LISTEN
|
||||
tcp 0 0 10.0.1.222:48388 syd15s17-in-f5.1e:https ESTABLISHED
|
||||
tcp 0 0 10.0.1.222:48194 ec2-35-86-38-2.us:https ESTABLISHED
|
||||
tcp 0 0 10.0.1.222:56075 103-10-125-164.va:27024 ESTABLISHED
|
||||
tcp 0 0 10.0.1.222:46680 syd15s20-in-f10.1:https ESTABLISHED
|
||||
tcp 0 0 10.0.1.222:52730 syd09s23-in-f3.1e:https ESTABLISHED
|
||||
|
||||
```
|
||||
|
||||
要只显示 TCP 端口,使用 `--all` 和 `--tcp` 参数,或者简写成 `-at` :
|
||||
|
||||
```
|
||||
|
||||
|
||||
$ netstat -at | head -n 5
|
||||
Active Internet connections (servers and established)
|
||||
Proto Recv-Q Send-Q Local Address Foreign Address State
|
||||
tcp 0 0 *:27036 *:* LISTEN
|
||||
tcp 0 0 localhost:27060 *:* LISTEN
|
||||
tcp 0 0 *:16001 *:* LISTEN
|
||||
|
||||
```
|
||||
|
||||
要只显示 UDP 端口,使用 `--all` 和 `--udp` 参数,或者简写成 `-au` :
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
$ netstat -au | head -n 5
|
||||
Active Internet connections (servers and established)
|
||||
Proto Recv-Q Send-Q Local Address Foreign Address State
|
||||
udp 0 0 *:27036 *:*
|
||||
udp 0 0 10.0.1.222:44741 224.0.0.56:46164 ESTABLISHED
|
||||
udp 0 0 *:bootpc
|
||||
|
||||
```
|
||||
|
||||
netstat 命令参数常常是简单易懂的。举个例子,要显示带有全部进程 ID (PID) 和数字地址的监听 TCP 和 UDP 的端口:
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
$ sudo netstat --tcp --udp --listening --programs --numeric
|
||||
Active Internet connections (only servers)
|
||||
Proto Recv-Q Send-Q Local Address Foreign Addr State PID/Program name
|
||||
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
|
||||
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2500/dnsmasq
|
||||
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1726/sshd
|
||||
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1721/cupsd
|
||||
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 4023/sshd: tux@
|
||||
tcp6 0 0 :::111 :::* LISTEN 1/systemd
|
||||
tcp6 0 0 :::22 :::* LISTEN 1726/sshd
|
||||
tcp6 0 0 ::1:631 :::* LISTEN 1721/cupsd
|
||||
tcp6 0 0 ::1:6010 :::* LISTEN 4023/sshd: tux@
|
||||
udp 0 0 0.0.0.0:40514 0.0.0.0:* 1499/avahi-daemon:
|
||||
udp 0 0 192.168.122.1:53 0.0.0.0:* 2500/dnsmasq
|
||||
udp 0 0 0.0.0.0:67 0.0.0.0:* 2500/dnsmasq
|
||||
udp 0 0 0.0.0.0:111 0.0.0.0:* 1/systemd
|
||||
udp 0 0 0.0.0.0:5353 0.0.0.0:* 1499/avahi-daemon:
|
||||
udp6 0 0 :::111 :::* 1/systemd
|
||||
udp6 0 0 :::44235 :::* 1499/avahi-daemon:
|
||||
udp6 0 0 :::5353 :::* 1499/avahi-daemon:
|
||||
|
||||
```
|
||||
|
||||
这个常用组合简写版本是 `-tulpn` 。
|
||||
|
||||
要显示一个指定服务的信息,[使用 `grep` 命令过滤][6]:
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
$ sudo netstat -anlp | grep cups
|
||||
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1721/cupsd tcp6 0 0 ::1:631 :::* LISTEN 1721/cupsd
|
||||
unix 2 [ ACC ] STREAM LISTENING 27251 1/systemd /var/run/cups/cups.sock
|
||||
unix 2 [ ] DGRAM 59530 1721/cupsd
|
||||
unix 3 [ ] STREAM CONNECTED 55196 1721/cupsd /var/run/cups/cups.sock
|
||||
|
||||
```
|
||||
|
||||
### 下一步骤
|
||||
|
||||
一旦你运行了 `netstat` 命令,你可以在你的网络确认你活动的服务正在监听来确保你的系统安全,进而采取措施。
|
||||
|
||||
1. 认识普遍被利用的端口和服务。一般来说,关闭你没有实际使用的端口。
|
||||
2. 留意不常见的端口号,认识了解在你系统上使用的合法端口。
|
||||
3. 密切注意 SELinux 错误。有时你需要更新全部上下文去匹配你对系统做的合法更改, 但是阅读错误警告能够确保 SELinux 没有提醒你可疑或者恶意的活动。
|
||||
|
||||
|
||||
如果你发现一个端口正在运行一个可以的服务,或者你只是简单的想要关闭你不再使用的端口,你可以遵从以下这些步骤通过防火墙规则手动拒绝端口访问:
|
||||
|
||||
|
||||
如果你在使用 `firewall-cmd` ,运行这些命令:
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
$ sudo firewall-cmd –remove-port=<port number>/tcp
|
||||
$ sudo firewall-cmd –runtime-to-permanent
|
||||
|
||||
```
|
||||
|
||||
如果你在使用 UFW,运行以下的命令:
|
||||
|
||||
|
||||
```
|
||||
`$ sudo ufw deny <port number>`
|
||||
```
|
||||
|
||||
下一步,使用 `systemctl` 来停止这个服务:
|
||||
|
||||
```
|
||||
`$ systemctl stop <service>`
|
||||
```
|
||||
|
||||
### 理解 netstat
|
||||
|
||||
Netstat 是一个快速收集你的服务器网络连接信息的有效工具。定期网络监测是了解你的系统的重要组成部分,也对帮助你保持你的系统安全有着重要意义。将这一步纳入你的日常管理中,你可以使用类似 netstat 或者 ss ,以及 [Nmap 开源端口扫描器 或者像 Wireshark 嗅探器][7] ,它们都允许设定 [计划任务][8]。
|
||||
|
||||
作为服务器存储了大量的个人数据,确保个人服务器的安全日益重要。通过理解你的服务器怎样连接到互联网,你可以降低你的机器的风险,同时你仍可以在数字时代大量的连接中获得益处。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/22/2/linux-network-security-netstat
|
||||
|
||||
作者:[Sahana Sreeram][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[hwlife](https://github.com/hwlife)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/sahanasreeram01gmailcom
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rack_server_sysadmin_cloud_520.png?itok=fGmwhf8I (A rack of servers, blue background)
|
||||
[2]: https://opensource.com/article/21/4/securing-linux-servers
|
||||
[3]: https://opensource.com/article/19/11/introduction-monitoring-prometheus
|
||||
[4]: https://opensource.com/business/13/11/selinux-policy-guide
|
||||
[5]: http://sourceforge.net/projects/net-tools/
|
||||
[6]: https://opensource.com/article/21/3/grep-cheat-sheet
|
||||
[7]: https://redhat.com/sysadmin/troubleshoot-dhcp-nmap-tcpdump-and-wireshark
|
||||
[8]: https://opensource.com/article/22/2/redhat.com/sysadmin/nmap-scripting-engine
|
@ -0,0 +1,208 @@
|
||||
[#]: subject: "Top 10 Most Beautiful Linux Distributions [Featured]"
|
||||
[#]: via: "https://www.debugpoint.com/2022/03/beautiful-linux-distributions-2022/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "amagicboy"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
精选10个最美的 Linux 发行版
|
||||
======
|
||||
|
||||
我们选出 2022 年 10 个最美的Linux发行版,保证系统稳定的前提下,会给您良好的视觉体验。
|
||||
|
||||
定制化拓展 Linux 发行版以满足需求是非常有意思的事。无论是 Ubuntu 还是 Fedora ,都有各种各样的工具去定制化 Linux 桌面。
|
||||
|
||||
但是,有很多不需要任何定制化而且令人眼前一亮的 Linux 发行版。它们的开发者使它们在安装后不需要再定制化就能有一个非常好的视觉效果。
|
||||
|
||||
现在,我们编制了一份最美 Linux 发行版列表,您可以现在尝试来更新您电脑的视觉外观。
|
||||
|
||||
### 2022 最美的 Linux 发行版
|
||||
|
||||
#### 1\. Zorin OS
|
||||
|
||||
最先介绍的 Linux 发行版是 Zorin OS. Zorin OS 使用基于 GNOME 的 Zorin Desktop ,非常适合追求美观的桌面和生产力的新用户。
|
||||
|
||||
Zorin OS 最有特点的功能之一是它可以随意转化为其他操作系统桌面,这意味着只需要设置布局选项,就可以改变任务栏、应用菜单、 Dock 栏,给用户最大的的灵活性,安装即用。
|
||||
|
||||
[阅读有关 Zorin OS 更多信息][2]
|
||||
|
||||
![Zorin OS 16 桌面][3]
|
||||
|
||||
#### 2\. Elementary OS
|
||||
|
||||
Elementary OS 是基于 Ubuntu 长期稳定支持(LTS) 发行版中最美观的一个。它使用吸引人的 Pantheon 桌面环境,其外观和使用体验受到了 macOS 的启发。
|
||||
|
||||
Elementary OS 非常适合从 maxOS 进入 Linux 世界的新用户,因为他们会发现许多熟悉的东西,比如手势和窗口样式。
|
||||
|
||||
但是,Elementary OS 不能通过设置菜单定制化大部分功能,只能依靠拓展脚本命令拓展功能。但是,系统默认桌面十分美观,能满足大部分人的需求。
|
||||
|
||||
Elementary OS 最具特色是它精心设计的应用商店。应用商店提供所有类别的应用,特别是那些专为 Elementary OS 定制而且外观精美、功能强大的应用。
|
||||
|
||||
[阅读有关 elementaryOS 更多信息][4]
|
||||
|
||||
![elementary OS 6 ODIN 桌面][5]
|
||||
|
||||
#### 3\. Deepin OS
|
||||
|
||||
第三个介绍的 Linux 发行版是 Deepin OS . Deepin OS 基于 Debian ,由中国 Deepin 科技公司开发。它使用基于 QT 的自研桌面环境。 Deepin 桌面部件、配色方案、窗口样式、壁纸看起来都非常不错,给用户安装即享的视觉体验。
|
||||
|
||||
Deepin OS 一流的视觉组件和 macOS 非常相似。并且由于 Deepin 的稳定分支,如果您想要一个外观精美且稳定的 Linux 发行版,Deepin 是最适合的选择。
|
||||
|
||||
为什么 Deepin OS 体验很好?
|
||||
* _基于 QT 的酷炫桌面_
|
||||
* _原生部件及支持暗色主题_
|
||||
* _多项选择定制化 Dock 栏_
|
||||
* _透明性、窗口效果、 CursDockheme , 图标主题_
|
||||
* _强调色_
|
||||
|
||||
[阅读有关 Deepin OS 更多信息][6]
|
||||
|
||||
![ Deepin 20 桌面][7]
|
||||
|
||||
#### 4\. Cutefish OS
|
||||
|
||||
第四个介绍的 Linux 发行版是 [CutefishOS][8] .这种基于 Debian 和 Ubuntu 的 Linux 发行版特点是本地开发的 Cutefish 桌面。 Cutefish OS 还在发展中,但由于它的外观, Cutefish OS 已经在用户群体中掀起波澜。
|
||||
|
||||
Cutefish OS 底层基于 QT 和 KDE 框架构建。这种带有 Cutefish 桌面的 Linux 发行版顶部有丰富的全局菜单。
|
||||
|
||||
在 Cutefish OS 发展过程中也支持定制化。但在最新的发行版中, Cutefish OS 支持深色模式,强调色、动画效果、任务栏位置(左、右、下)等其他选项。
|
||||
|
||||
|
||||
如果您想体验完全不同的桌面风格,可以尝试 Cutefish OS . 您也可以查看下面提供的关于此桌面的完整评论和教程。
|
||||
|
||||
[Cutefish OS 评论][9]
|
||||
|
||||
![Cutefish OS][10]
|
||||
|
||||
#### 5\. Manjaro KED Plasma
|
||||
|
||||
Manjaro KDE 是现在外观最好看的 Linux 发行版之一。 Manjaro KDE 基于 Arch Linux ,以 KDE Plasma 为特色,添加了一些额外调整工具和窗口。 Manjaro 的绿色调色板给您全新的外观和体验。 您可以通过 KDE 构建工具定制化功能,在 KDE Stores 中也可以设置和改变图标主题。
|
||||
|
||||
Manjaro KDE 是 Arch Linux 性能和外观最完美的结合体。对于 Arch Linux 新用户来说, Manjaro 是一个理想的开始。
|
||||
|
||||
[阅读有关 Manjaro KED 更多信息][11]
|
||||
|
||||
![Manjaro KDE Plasma][12]
|
||||
|
||||
#### 6\. Garuda Linux
|
||||
|
||||
出名的 Garuda Linux 是榜单上的第六位。 Garuda Linux 基于 Arch Linux ,带有美观的桌面,特点是支持所有主流桌面的定制化图标、主题。 Garuda Linux 使用 Zen 内核,优化了硬件性能。
|
||||
|
||||
[][13]
|
||||
|
||||
补充: 安装 Fedora 33 后要做的 10 件事
|
||||
|
||||
Garuda Linux 的外观和体验令人印象深刻。 macOS 风格看起来非常的方便。 Neon 图标主题、亲切的调色板、全局菜单的模糊和透明性的结合是其自身的完美选择。
|
||||
|
||||
Garuda 最主要的优点是支持所有桌面环境 — KDE Plasma , GNOME , Xfce , LXQT , MATE , 等等。
|
||||
|
||||
[阅读有关 Garuda Linux 更多信息][14]
|
||||
|
||||
![Garuda Linux][15]
|
||||
|
||||
#### 7\. Linux Mint Cinnamon Edition
|
||||
|
||||
我们推荐 Linux Mint 是因为它非常的简洁,优美和稳定。它是目前最被广泛使用和出名的 Linux 发行版之一,或许仅在 Ubuntu 使用人数之下。但和本列表中其他 Linux 发行版比较起来,它看起来不是很精致。
|
||||
|
||||
但是如果您喜欢看起来很棒的经典用户桌面,默认的 Cinnamon 桌面看起来干净且完美。
|
||||
|
||||
Linux Mint 发行版对所有用户都非常友好,特别是第一次使用 Linux 或者从 Windows 转到 Linux 的用户。默认的 Mint 绿色调色板外观和体验都能使人耳目一新。
|
||||
|
||||
如果您无法确定一个稳定的令人眼花缭乱的 Linux 发行版,那就毫不犹豫的选择 Linux Mint 吧。
|
||||
|
||||
[阅读有关 Linux Mint 更多信息][16]
|
||||
|
||||
![Linux Mint 20 — Cinnamon 版本桌面][17]
|
||||
|
||||
#### 8\. Nitrux OS
|
||||
|
||||
[Nitrux Linux][18] 基于 Debian ,其特点是名为 NX 桌面的 KDE Plasma 修改版。独特的 Linux 发行版有一套使用 Maui 套件和 QT 编译的 Nitrux 应用。 Nitrux 是开源的 Linux 发行版,使用 OpenRC 作为初始化系统。独特的功能和外观, Nitrux 是目前最好的 Linux 发行版之一。
|
||||
|
||||
Nitrux OS 默认外观与经过改进的 KDE Plasma 桌面完美结合,带有 Kvantum 主题引擎、图标主题、配色表、鼠标主题功能。 Nitrux OS 背后团队还开发了名为 Maui Shell 的独立聚合桌面,可以根据屏幕大小进行自我调整。
|
||||
|
||||
如果您需要一款稳定方便的 KDE Plasma 桌面,那么 Nitrux OS 非常适合您。您不会失望的。
|
||||
|
||||
[阅读有关 Nitrux OS 更多信息][18]
|
||||
|
||||
![Nitrux 2.0 桌面][19]
|
||||
|
||||
#### 9\. Ubuntu Kylin
|
||||
|
||||
Ubuntu Kylin 是专门为使用简体中文脚本的中国人设计的官方版本。但它同时也支持其他语言。
|
||||
|
||||
定制化的 Ubuntu 版本使用 Ubuntu Kaylin 用户桌面( aka UKUI )。 UKUI 桌面使用 Qt 开发,支持 MATE 桌面组件。
|
||||
|
||||
Ubuntu Kylin 看起来精致,就像是 GNOME 和 KDE Plasma 在外观和设计上的结合。
|
||||
|
||||
Ubuntu Kylin 特点是其精美设计的图标系统,底部的任务栏,漂亮的应用视图,应用切换器,圆的窗口对角和更多精心制作的功能。
|
||||
|
||||
[阅读有关 Ubuntu Kylin 更多信息][20]
|
||||
|
||||
![Ubuntu Kylin 桌面][21]
|
||||
|
||||
#### 10\. Pop OS
|
||||
|
||||
Pop OS 是从管理计算机硬件的 System76 发展而来。 此 Linux 发行版在所有 System6 硬件上都预安装。但是,您可以从官方仓库下载然后安装。
|
||||
|
||||
Pop OS 特点是默认的带有额外调整和配置的 GNOME 桌面。此桌面具有 GNOME 40 时代之前的特点,预配置了多个拓展和调整。比如您可以获得可以配置自由调整的底部任务栏、一个用于启动应用程序的启动器、窗口圆角等许多此类功能。此桌面还有自动平铺和优化的键盘导航功能,可提高您的工作效率。
|
||||
|
||||
Pop OS 的颜色搭配、深色模式、应用窗口的圆角、图标主题,使它的外观和体验都非常的舒服和赏心悦目。
|
||||
|
||||
[阅读有关 Pop OS 更多信息][22]
|
||||
|
||||
![Pop OS 21.10 桌面][23]
|
||||
|
||||
### 结语
|
||||
|
||||
希望这份 2022 最美 Linux 发行版榜单能帮你选择您想要的桌面或者系统。 因为这些 Linux 发行版已经配置成看起来很漂亮,而且他们性能很强大。
|
||||
|
||||
选择并开始您的 Linux 之旅吧。
|
||||
|
||||
* * *
|
||||
|
||||
我们介绍最新的技术、软件新闻和重要资讯。通过 [Telegram][24] , [Twitter][25] , [YouTube][26] , [Facebook][27] 保持联系,不要错过任何更新!
|
||||
|
||||
##### 另请阅读
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/2022/03/beautiful-linux-distributions-2022/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[amagicboy](https://github.com/amagicboy)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.debugpoint.com/category/distributions
|
||||
[2]: https://zorin.com
|
||||
[3]: https://www.debugpoint.com/wp-content/uploads/2021/08/Zorin-OS-16-Desktop-1024x576.jpg
|
||||
[4]: https://elementary.io/
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2021/08/elementary-OS-6-ODIN-Desktop-1024x576.jpg
|
||||
[6]: https://www.deepin.org/en/
|
||||
[7]: https://www.debugpoint.com/wp-content/uploads/2020/09/Deepin-20-Desktop-1024x568.jpg
|
||||
[8]: https://en.cutefishos.com/
|
||||
[9]: https://www.debugpoint.com/2021/11/cutefish-os-review-2021/
|
||||
[10]: https://www.debugpoint.com/wp-content/uploads/2021/11/Cutefish-OS-1024x581.jpg
|
||||
[11]: https://manjaro.org/downloads/official/kde/
|
||||
[12]: https://www.debugpoint.com/wp-content/uploads/2022/03/Manjaro-KDE-Plasma-1024x576.jpg
|
||||
[13]: https://www.debugpoint.com/2020/10/10-things-to-do-fedora-33-after-install/
|
||||
[14]: https://garudalinux.org/
|
||||
[15]: https://www.debugpoint.com/wp-content/uploads/2022/03/Garuda-Linux-1024x577.jpg
|
||||
[16]: https://linuxmint.com/
|
||||
[17]: https://www.debugpoint.com/wp-content/uploads/2020/07/Linux-Mint-20-Cinnamon-Edition-Desktop-1024x763.png
|
||||
[18]: https://nxos.org/
|
||||
[19]: https://www.debugpoint.com/wp-content/uploads/2022/03/Nitrux-2.0-Desktop-1024x581.jpg
|
||||
[20]: https://www.ubuntukylin.com
|
||||
[21]: https://www.debugpoint.com/wp-content/uploads/2022/03/Ubuntu-Kylin-Desktop-1024x574.jpg
|
||||
[22]: https://pop.system76.com/
|
||||
[23]: https://www.debugpoint.com/wp-content/uploads/2021/12/Pop-OS-21.10-Desktop-1024x579.jpg
|
||||
[24]: https://t.me/debugpoint
|
||||
[25]: https://twitter.com/DebugPoint
|
||||
[26]: https://www.youtube.com/c/debugpoint?sub_confirmation=1
|
||||
[27]: https://facebook.com/DebugPoint
|
@ -0,0 +1,92 @@
|
||||
[#]: subject: "Xubuntu 22.04 LTS – New Features and Release Details"
|
||||
[#]: via: "https://www.debugpoint.com/2022/04/xubuntu-22-04-lts/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "geekpi"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
Xubuntu 22.04 LTS - 新功能和发布细节
|
||||
======
|
||||
Xubuntu 22.04 LTS(Jammy jellyfish)的新功能列表以及关于该版本的其他信息。
|
||||
![Xubuntu 22.04 Desktop][1]
|
||||
|
||||
### Xubuntu 22.04 LTS - 新功能
|
||||
|
||||
Xubuntu 22.04 LTS 由 Linux Kernel 5.15 和 Ubuntu 22.04 LTS 的基础软件包提供支持。除此以外,默认的桌面环境版本是 Xfce 4.16。Xfce 桌面环境自 2020 年 12 月发布以来,没有看到任何重要的版本。
|
||||
|
||||
即便如此,Xfce 桌面 4.16 版本仍然是 Xubuntu 21.10(最后一个版本),桌面组件和本地应用得到了一些改进和错误修复。
|
||||
|
||||
也许这个版本的重要工作是在 Greybird 主题中对 GTK4 和 libhandy 的初步支持(通过 3.23.1 版本)。这意味着来自 GNOME 生态系统的 GTK4 应用在 Xubuntu 的主题下看起来不错。
|
||||
|
||||
### 应用更新
|
||||
|
||||
默认的文件管理器 Thunar 4.16.10 增加了一些性能改进,包括回归修复、翻译更新和一些变化。虽然在扫描更新日志的时候,我找不到任何对用户可见的实质性报告。但如果你有兴趣,你可以[在这][2]详细阅读新闻。
|
||||
|
||||
|
||||
事实上,Thunar 现在正在开发 Xfce 4.17,它包含了一些令人兴奋的变化。但不幸的是,我们都需要在短期版本中等待,因为要在长期版本中实现这些功能还为时过早。
|
||||
|
||||
除此之外,Xfce Terminal 在这个版本中仍然是 0.8.10。与 Thunar 类似,Xfce Terminal 1.0.0 的主要更新也不会在这个 LTS 版本中出现。
|
||||
|
||||
除了这两个,其他的桌面组件仍然是最后的稳定版本,包括 Xfce Panel 4.16.3、Xfce window manager 4.16.1 和 Xfce Desktop 4.16。值得一提的是,Xfce 仍在进行 GTK4 的过渡工作,目前还没有太明确的时间表。
|
||||
|
||||
此外,原生应用看到它们的版本被提升到最新的稳定迭代版本。但一个重大变化是 Firefox 可执行文件现在是继 Ubuntu 之后的 Xubuntu 22.04 中的 Snap 版本。因此,在理想情况下,用户不会感觉到任何差异,但由于其沙盒性质,可能会在扩展程序和其他工具方面面临一些问题。
|
||||
|
||||
除此之外,Xubuntu 22.04 还期望从社区竞赛中获得一些漂亮的壁纸,包括一个默认壁纸。结果还没有出来。然而,你可以在[本页面][4]上找到一些令人兴奋的投稿。
|
||||
|
||||
### 总结和下载
|
||||
|
||||
总结一下,主要的核心框架、应用和它们的版本都在下面。
|
||||
|
||||
* GNOME 42
|
||||
* GTK 3.24.32
|
||||
* MATE 1.26
|
||||
* Xfce 4.16
|
||||
* Firefox 99
|
||||
* Thunderbird 91.8
|
||||
* Atril Document Viewer 1.26
|
||||
* Engrampa Archive Manager 1.26
|
||||
* Ristretto Image Viewer 0.12.2
|
||||
* LibreOffice 7.3.x
|
||||
* Catfish 4.16.3
|
||||
* Mousepad 0.5.8
|
||||
|
||||
|
||||
|
||||
最后,要下载 Xubuntu 22.04 的 BETA 版本,请参考下面的 ISO 文件的链接。你可以尝试在虚拟机上安装或在物理系统中尝试。
|
||||
|
||||
* [xubuntu-22.04-beta-desktop-amd64.iso][5]
|
||||
* [其他下载选项包括torrent, checksum][6]
|
||||
|
||||
|
||||
|
||||
_通过 [官方更新日志][7]_
|
||||
|
||||
* * *
|
||||
|
||||
我们带来最新的技术、软件新闻和重要的东西。通过 [Telegram][8]、[Twitter][9]、[YouTube][10] 和 [Facebook][11] 保持联系,永远不要错过任何更新!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/2022/04/xubuntu-22-04-lts/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.debugpoint.com/wp-content/uploads/2022/04/Xubuntu-22.04-Desktop-1024x575.jpg
|
||||
[2]: https://archive.xfce.org/src/xfce/thunar/4.16/
|
||||
[4]: https://contest.xubuntu.org/wallpaper_contest/xubuntu-22-04-community-wallpaper-contest/?action=view
|
||||
[5]: https://cdimage.ubuntu.com/xubuntu/releases/22.04/beta/xubuntu-22.04-beta-desktop-amd64.iso
|
||||
[6]: https://cdimage.ubuntu.com/xubuntu/releases/22.04/beta/
|
||||
[7]: https://wiki.xubuntu.org/releases/22.04/release-notes
|
||||
[8]: https://t.me/debugpoint
|
||||
[9]: https://twitter.com/DebugPoint
|
||||
[10]: https://www.youtube.com/c/debugpoint?sub_confirmation=1
|
||||
[11]: https://facebook.com/DebugPoint
|
@ -0,0 +1,123 @@
|
||||
[#]: subject: "Create Your Own Custom Light and Dark Wallpaper for GNOME"
|
||||
[#]: via: "https://www.debugpoint.com/2022/04/custom-light-dark-wallpaper-gnome/"
|
||||
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
|
||||
[#]: collector: "lujun9972"
|
||||
[#]: translator: "robsean"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
创建你自己的自定义的 GNOME 的明暗壁纸
|
||||
======
|
||||
一份简单的指南 – 如何针对 GNOME 桌面环境来创建你的自定义明暗壁纸。
|
||||
|
||||
[GNOME 42][1] 将备受期待的明暗主题到 GNOME 桌面环境。它也带来壁纸的明暗版本,当你切换明暗主题时,它会自动地转换。
|
||||
|
||||
因此,默认情况下,GNOME 给予你一套预配置的明暗壁纸。但是如果你想要在主题更改时自动地转换成另一种不同的壁纸要怎么做呢?
|
||||
|
||||
这里是如何在 GNOME 中配置和创建你自己的明暗壁纸的方法。
|
||||
|
||||
### 如何针对 GNOME 桌面环境来创建自定义的明暗壁纸
|
||||
|
||||
第一,确保你手边有两个版本的壁纸。一般来说,它们应该是标准的 PNG 或 JPG 图像文件。例如,我们针对这个示例使用下面的两张壁纸。
|
||||
|
||||
![Sample light and dark wallpaper for demo][2]
|
||||
|
||||
但是,如果你没有合适的明暗壁纸,或者正在查找更多的壁纸,在这篇指南的结尾,我将让你知道如何获取它们,或者如何自己准备它们。请与我同行。
|
||||
|
||||
第二, 我们需要为我们自己创建一个 schema 文件。The automatic changing of wallpaper is handled by an XML file called adwaita.xml, 它定义了特殊的明暗背景标记。因此,我们将为壁纸创建我们自己的 XML 文件。
|
||||
|
||||
为做到这一点,从 GitLab 复制 adwaita.xml 的内容,并创建一个新的 XML 文件 (链接在下面)。你能够会在这个文件中看到两个标记 – “filename” 和 “filename-dark”。这两个 XML 标记包含这两个壁纸的完整的限定的路径。现在,在这两个标记下添加你的图像文件的路径,如我下图所示。。
|
||||
|
||||
[从这里下载 XML 文件 (adwaita.xml)][3]
|
||||
|
||||
![Change the XML file][4]
|
||||
|
||||
第三,使用你想要的任意名称保存这个文件。如果这里没有 “gnome-background-properties”,创建它。针对这个示例,我使用 my_cool_backgrounds.xml 。
|
||||
|
||||
![Save the file][5]
|
||||
|
||||
与此同时,你就准备好了所有的东西。最后,打开 settings 并转到 Appearance 标签页,你应该会看到一个新的可视的壁纸选项。
|
||||
|
||||
[][6]
|
||||
|
||||
请参考:新的 GNOME 文本编辑器 - 你需要知晓的一切
|
||||
|
||||
选择你自己的自定义的明暗壁纸,尽情享受。
|
||||
|
||||
![Appearance tab has now your own custom light and dark wallpaper][7]
|
||||
|
||||
### 如何下载或制作你自己的动态壁纸
|
||||
|
||||
当然,你必然会想,谁有时间去查找和创建壁纸的日夜版本?这里有一些网站来向你提供预制好的动态壁纸,你可以轻松地下载和安装。
|
||||
|
||||
我推荐的一个网站是 [dynamicwallpaper.club][8] ,针对 macOS 来说,它有一些高达 6K 的极好的高质量的壁纸。你可以轻松地下载它们。
|
||||
|
||||
此外,如果你打算从上述网站下载,请记住该网站的图像文件是 [heic][9] 格式的,因为这个网站是针对 macOS 的。高效视频编码 (HEIC) 是苹果的专有的 HEIF (High-Efficiency Image File) 的格式版本。
|
||||
|
||||
那么,如何在 Linux 系统中转换它们? 好吧,在 Ubuntu 或 Fedora Linux 中,你需要一个驱动程序来查看和转换动态的 heic 图像文件。打开一个终端,运行下面的命令开安装驱动程序。
|
||||
|
||||
Ubuntu 用户 –
|
||||
|
||||
```
|
||||
|
||||
sudo apt install heif-gdk-pixbuf
|
||||
|
||||
```
|
||||
|
||||
Fedora 用户 –
|
||||
|
||||
```
|
||||
|
||||
sudo dnf install libheif
|
||||
|
||||
```
|
||||
|
||||
(没有这个插件的帮助,Plasma 应用程序就不能打开 heic 格式的图像文件)
|
||||
|
||||
```
|
||||
|
||||
sudo apt install qt-heif-image-plugin
|
||||
sudo dnf install qt-heif-image-plugin
|
||||
|
||||
```
|
||||
|
||||
最后,使用你喜欢的图像查看器打开 heic 图像文件,并将其保存为 JPG/PNG 图像文件。
|
||||
|
||||
最好,不要忘记在下面的评论区告诉我,你是否能够针对 GNOME 桌面环境来创建你自己的自定义的明暗壁纸了。
|
||||
|
||||
![Custom Light and Dark wallpaper in GNOME – transition][10]
|
||||
|
||||
谢谢。
|
||||
|
||||
* * *
|
||||
|
||||
我们带来最新的科技、软件新闻和重要的题材。通过 [Telegram][11]、[Twitter][12][YouTube][13] 和 [Facebook][14] 保持联系、不错过一次更新!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.debugpoint.com/2022/04/custom-light-dark-wallpaper-gnome/
|
||||
|
||||
作者:[Arindam][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[robsean](https://github.com/robsean)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.debugpoint.com/author/admin1/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.debugpoint.com/2022/03/gnome-42-release/
|
||||
[2]: https://www.debugpoint.com/wp-content/uploads/2022/04/Sample-light-and-dark-wallpaper-for-demo.jpg
|
||||
[3]: https://gitlab.gnome.org/GNOME/gnome-backgrounds/-/tree/main/backgrounds
|
||||
[4]: https://www.debugpoint.com/wp-content/uploads/2022/04/Change-the-XML-file-1024x568.jpg
|
||||
[5]: https://www.debugpoint.com/wp-content/uploads/2022/04/Save-the-file-1024x548.jpg
|
||||
[6]: https://www.debugpoint.com/2021/12/gnome-text-editor/
|
||||
[7]: https://www.debugpoint.com/wp-content/uploads/2022/04/Apperance-tab-has-now-your-own-custom-light-and-dark-wallpaper-1024x657.jpg
|
||||
[8]: https://dynamicwallpaper.club
|
||||
[9]: https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format
|
||||
[10]: https://www.debugpoint.com/wp-content/uploads/2022/04/Custom-Light-and-Dark-wallpaper-in-GNOME-transition-1024x556.gif
|
||||
[11]: https://t.me/debugpoint
|
||||
[12]: https://twitter.com/DebugPoint
|
||||
[13]: https://www.youtube.com/c/debugpoint?sub_confirmation=1
|
||||
[14]: https://facebook.com/DebugPoint
|
Loading…
Reference in New Issue
Block a user