mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-03 01:10:13 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
52960073b2
563
published/20180306 How To Check All Running Services In Linux.md
Normal file
563
published/20180306 How To Check All Running Services In Linux.md
Normal file
@ -0,0 +1,563 @@
|
||||
如何查看 Linux 中所有正在运行的服务
|
||||
======
|
||||
|
||||
有许多方法和工具可以查看 Linux 中所有正在运行的服务。大多数管理员会在 System V(SysV)初始化系统中使用 `service service-name status` 或 `/etc/init.d/service-name status`,而在 systemd 初始化系统中使用 `systemctl status service-name`。
|
||||
|
||||
以上命令可以清楚地显示该服务是否在服务器上运行,这也是每个 Linux 管理员都该知道的非常简单和基础的命令。
|
||||
|
||||
如果你对系统环境并不熟悉,也不清楚系统在运行哪些服务,你会如何检查?
|
||||
|
||||
是的,我们的确有必要这样检查一下。这将有助于我们了解系统上运行了什么服务,以及哪些是必要的、哪些需要被禁用。
|
||||
|
||||
init(<ruby>初始化<rt>initialization</rt></ruby>的简称)是在系统启动期间运行的第一个进程。`init` 是一个守护进程,它将持续运行直至关机。
|
||||
|
||||
大多数 Linux 发行版都使用如下的初始化系统之一:
|
||||
|
||||
- System V 是更老的初始化系统
|
||||
- Upstart 是一个基于事件的传统的初始化系统的替代品
|
||||
- systemd 是新的初始化系统,它已经被大多数最新的 Linux 发行版所采用
|
||||
|
||||
### 什么是 System V(SysV)
|
||||
|
||||
SysV(意即 System V) 初始化系统是早期传统的初始化系统和系统管理器。由于 sysVinit 系统上一些长期悬而未决的问题,大多数最新的发行版都适用于 systemd 系统。
|
||||
|
||||
### 什么是 Upstart 初始化系统
|
||||
|
||||
Upstart 是一个基于事件的 /sbin/init 的替代品,它控制在启动时的任务和服务的开始,在关机时停止它们,并在系统运行时监控它们。
|
||||
|
||||
它最初是为 Ubuntu 发行版开发的,但其是以适合所有 Linux 发行版的开发为目标的,以替换过时的 System-V 初始化系统。
|
||||
|
||||
### 什么是 systemd
|
||||
|
||||
systemd 是一个新的初始化系统以及系统管理器,它已成为大多数 Linux 发行版中非常流行且广泛适应的新的标准初始化系统。`systemctl` 是一个 systemd 管理工具,它可以帮助我们管理 systemd 系统。
|
||||
|
||||
### 方法一:如何在 System V(SysV)系统中查看运行的服务
|
||||
|
||||
以下命令可以帮助我们列出 System V(SysV) 系统中所有正在运行的服务。
|
||||
|
||||
如果服务很多,我建议使用文件查看命令,如 `less`、`more` 等,以便得到清晰的结果。
|
||||
|
||||
```
|
||||
# service --status-all
|
||||
或
|
||||
# service --status-all | more
|
||||
或
|
||||
# service --status-all | less
|
||||
```
|
||||
|
||||
```
|
||||
abrt-ccpp hook is installed
|
||||
abrtd (pid 2131) is running...
|
||||
abrt-dump-oops is stopped
|
||||
acpid (pid 1958) is running...
|
||||
atd (pid 2164) is running...
|
||||
auditd (pid 1731) is running...
|
||||
Frequency scaling enabled using ondemand governor
|
||||
crond (pid 2153) is running...
|
||||
hald (pid 1967) is running...
|
||||
htcacheclean is stopped
|
||||
httpd is stopped
|
||||
Table: filter
|
||||
Chain INPUT (policy ACCEPT)
|
||||
num target prot opt source destination
|
||||
1 ACCEPT all ::/0 ::/0 state RELATED,ESTABLISHED
|
||||
2 ACCEPT icmpv6 ::/0 ::/0
|
||||
3 ACCEPT all ::/0 ::/0
|
||||
4 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:80
|
||||
5 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:21
|
||||
6 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:22
|
||||
7 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:25
|
||||
8 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:2082
|
||||
9 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:2086
|
||||
10 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:2083
|
||||
11 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:2087
|
||||
12 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:10000
|
||||
13 REJECT all ::/0 ::/0 reject-with icmp6-adm-prohibited
|
||||
|
||||
Chain FORWARD (policy ACCEPT)
|
||||
num target prot opt source destination
|
||||
1 REJECT all ::/0 ::/0 reject-with icmp6-adm-prohibited
|
||||
|
||||
Chain OUTPUT (policy ACCEPT)
|
||||
num target prot opt source destination
|
||||
|
||||
iptables: Firewall is not running.
|
||||
irqbalance (pid 1826) is running...
|
||||
Kdump is operational
|
||||
lvmetad is stopped
|
||||
mdmonitor is stopped
|
||||
messagebus (pid 1929) is running...
|
||||
SUCCESS! MySQL running (24376)
|
||||
rndc: neither /etc/rndc.conf nor /etc/rndc.key was found
|
||||
named is stopped
|
||||
netconsole module not loaded
|
||||
Usage: startup.sh { start | stop }
|
||||
Configured devices:
|
||||
lo eth0 eth1
|
||||
Currently active devices:
|
||||
lo eth0
|
||||
ntpd is stopped
|
||||
portreserve (pid 1749) is running...
|
||||
master (pid 2107) is running...
|
||||
Process accounting is disabled.
|
||||
quota_nld is stopped
|
||||
rdisc is stopped
|
||||
rngd is stopped
|
||||
rpcbind (pid 1840) is running...
|
||||
rsyslogd (pid 1756) is running...
|
||||
sandbox is stopped
|
||||
saslauthd is stopped
|
||||
smartd is stopped
|
||||
openssh-daemon (pid 9859) is running...
|
||||
svnserve is stopped
|
||||
vsftpd (pid 4008) is running...
|
||||
xinetd (pid 2031) is running...
|
||||
zabbix_agentd (pid 2150 2149 2148 2147 2146 2140) is running...
|
||||
```
|
||||
|
||||
执行以下命令,可以只查看正在运行的服务:
|
||||
|
||||
```
|
||||
# service --status-all | grep running
|
||||
```
|
||||
|
||||
```
|
||||
crond (pid 535) is running...
|
||||
httpd (pid 627) is running...
|
||||
mysqld (pid 911) is running...
|
||||
rndc: neither /etc/rndc.conf nor /etc/rndc.key was found
|
||||
rsyslogd (pid 449) is running...
|
||||
saslauthd (pid 492) is running...
|
||||
sendmail (pid 509) is running...
|
||||
sm-client (pid 519) is running...
|
||||
openssh-daemon (pid 478) is running...
|
||||
xinetd (pid 485) is running...
|
||||
```
|
||||
|
||||
运行以下命令以查看指定服务的状态:
|
||||
|
||||
```
|
||||
# service --status-all | grep httpd
|
||||
httpd (pid 627) is running...
|
||||
```
|
||||
|
||||
或者,使用以下命令也可以查看指定服务的状态:
|
||||
|
||||
```
|
||||
# service httpd status
|
||||
httpd (pid 627) is running...
|
||||
```
|
||||
|
||||
使用以下命令查看系统启动时哪些服务会被启用:
|
||||
|
||||
```
|
||||
# chkconfig --list
|
||||
```
|
||||
|
||||
```
|
||||
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
htcacheclean 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
httpd 0:off 1:off 2:off 3:on 4:off 5:off 6:off
|
||||
ip6tables 0:off 1:off 2:on 3:off 4:on 5:on 6:off
|
||||
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
modules_dep 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
named 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
netfs 0:off 1:off 2:off 3:off 4:on 5:on 6:off
|
||||
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
nmb 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
nscd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
portreserve 0:off 1:off 2:on 3:off 4:on 5:on 6:off
|
||||
quota_nld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
restorecond 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
rpcbind 0:off 1:off 2:on 3:off 4:on 5:on 6:off
|
||||
rsyslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
saslauthd 0:off 1:off 2:off 3:on 4:off 5:off 6:off
|
||||
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
smb 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
snmpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
snmptrapd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
udev-post 0:off 1:on 2:on 3:off 4:on 5:on 6:off
|
||||
winbind 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
|
||||
|
||||
xinetd based services:
|
||||
chargen-dgram: off
|
||||
chargen-stream: off
|
||||
daytime-dgram: off
|
||||
daytime-stream: off
|
||||
discard-dgram: off
|
||||
discard-stream: off
|
||||
echo-dgram: off
|
||||
echo-stream: off
|
||||
finger: off
|
||||
ntalk: off
|
||||
rsync: off
|
||||
talk: off
|
||||
tcpmux-server: off
|
||||
time-dgram: off
|
||||
time-stream: off
|
||||
```
|
||||
|
||||
### 方法二:如何在 System V(SysV)系统中查看运行的服务
|
||||
|
||||
另外一种在 Linux 系统上列出运行的服务的方法是使用 initctl 命令:
|
||||
|
||||
```
|
||||
# initctl list
|
||||
rc stop/waiting
|
||||
tty (/dev/tty3) start/running, process 1740
|
||||
tty (/dev/tty2) start/running, process 1738
|
||||
tty (/dev/tty1) start/running, process 1736
|
||||
tty (/dev/tty6) start/running, process 1746
|
||||
tty (/dev/tty5) start/running, process 1744
|
||||
tty (/dev/tty4) start/running, process 1742
|
||||
plymouth-shutdown stop/waiting
|
||||
control-alt-delete stop/waiting
|
||||
rcS-emergency stop/waiting
|
||||
readahead-collector stop/waiting
|
||||
kexec-disable stop/waiting
|
||||
quit-plymouth stop/waiting
|
||||
rcS stop/waiting
|
||||
prefdm stop/waiting
|
||||
init-system-dbus stop/waiting
|
||||
ck-log-system-restart stop/waiting
|
||||
readahead stop/waiting
|
||||
ck-log-system-start stop/waiting
|
||||
splash-manager stop/waiting
|
||||
start-ttys stop/waiting
|
||||
readahead-disable-services stop/waiting
|
||||
ck-log-system-stop stop/waiting
|
||||
rcS-sulogin stop/waiting
|
||||
serial stop/waiting
|
||||
```
|
||||
|
||||
### 方法三:如何在 systemd 系统中查看运行的服务
|
||||
|
||||
以下命令帮助我们列出 systemd 系统中所有服务:
|
||||
|
||||
```
|
||||
# systemctl
|
||||
UNIT LOAD ACTIVE SUB DESCRIPTION
|
||||
sys-devices-virtual-block-loop0.device loaded active plugged /sys/devices/virtual/block/loop0
|
||||
sys-devices-virtual-block-loop1.device loaded active plugged /sys/devices/virtual/block/loop1
|
||||
sys-devices-virtual-block-loop2.device loaded active plugged /sys/devices/virtual/block/loop2
|
||||
sys-devices-virtual-block-loop3.device loaded active plugged /sys/devices/virtual/block/loop3
|
||||
sys-devices-virtual-block-loop4.device loaded active plugged /sys/devices/virtual/block/loop4
|
||||
sys-devices-virtual-misc-rfkill.device loaded active plugged /sys/devices/virtual/misc/rfkill
|
||||
sys-devices-virtual-tty-ttyprintk.device loaded active plugged /sys/devices/virtual/tty/ttyprintk
|
||||
sys-module-fuse.device loaded active plugged /sys/module/fuse
|
||||
sys-subsystem-net-devices-enp0s3.device loaded active plugged 82540EM Gigabit Ethernet Controller (PRO/1000 MT Desktop Adapter)
|
||||
-.mount loaded active mounted Root Mount
|
||||
dev-hugepages.mount loaded active mounted Huge Pages File System
|
||||
dev-mqueue.mount loaded active mounted POSIX Message Queue File System
|
||||
run-user-1000-gvfs.mount loaded active mounted /run/user/1000/gvfs
|
||||
run-user-1000.mount loaded active mounted /run/user/1000
|
||||
snap-core-3887.mount loaded active mounted Mount unit for core
|
||||
snap-core-4017.mount loaded active mounted Mount unit for core
|
||||
snap-core-4110.mount loaded active mounted Mount unit for core
|
||||
snap-gping-13.mount loaded active mounted Mount unit for gping
|
||||
snap-termius\x2dapp-8.mount loaded active mounted Mount unit for termius-app
|
||||
sys-fs-fuse-connections.mount loaded active mounted FUSE Control File System
|
||||
sys-kernel-debug.mount loaded active mounted Debug File System
|
||||
acpid.path loaded active running ACPI Events Check
|
||||
cups.path loaded active running CUPS Scheduler
|
||||
systemd-ask-password-plymouth.path loaded active waiting Forward Password Requests to Plymouth Directory Watch
|
||||
systemd-ask-password-wall.path loaded active waiting Forward Password Requests to Wall Directory Watch
|
||||
init.scope loaded active running System and Service Manager
|
||||
session-c2.scope loaded active running Session c2 of user magi
|
||||
accounts-daemon.service loaded active running Accounts Service
|
||||
acpid.service loaded active running ACPI event daemon
|
||||
anacron.service loaded active running Run anacron jobs
|
||||
apache2.service loaded active running The Apache HTTP Server
|
||||
apparmor.service loaded active exited AppArmor initialization
|
||||
apport.service loaded active exited LSB: automatic crash report generation
|
||||
aptik-battery-monitor.service loaded active running LSB: start/stop the aptik battery monitor daemon
|
||||
atop.service loaded active running Atop advanced performance monitor
|
||||
atopacct.service loaded active running Atop process accounting daemon
|
||||
avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack
|
||||
colord.service loaded active running Manage, Install and Generate Color Profiles
|
||||
console-setup.service loaded active exited Set console font and keymap
|
||||
cron.service loaded active running Regular background program processing daemon
|
||||
cups-browsed.service loaded active running Make remote CUPS printers available locally
|
||||
cups.service loaded active running CUPS Scheduler
|
||||
dbus.service loaded active running D-Bus System Message Bus
|
||||
postfix.service loaded active exited Postfix Mail Transport Agent
|
||||
```
|
||||
* `UNIT` 相应的 systemd 单元名称
|
||||
* `LOAD` 相应的单元是否被加载到内存中
|
||||
* `ACTIVE` 该单元是否处于活动状态
|
||||
* `SUB` 该单元是否处于运行状态(LCTT 译注:是较于 ACTIVE 更加详细的状态描述,不同的单元类型有不同的状态。)
|
||||
* `DESCRIPTION` 关于该单元的简短描述
|
||||
|
||||
以下选项可根据类型列出单元:
|
||||
|
||||
```
|
||||
# systemctl list-units --type service
|
||||
UNIT LOAD ACTIVE SUB DESCRIPTION
|
||||
accounts-daemon.service loaded active running Accounts Service
|
||||
acpid.service loaded active running ACPI event daemon
|
||||
anacron.service loaded active running Run anacron jobs
|
||||
apache2.service loaded active running The Apache HTTP Server
|
||||
apparmor.service loaded active exited AppArmor initialization
|
||||
apport.service loaded active exited LSB: automatic crash report generation
|
||||
aptik-battery-monitor.service loaded active running LSB: start/stop the aptik battery monitor daemon
|
||||
atop.service loaded active running Atop advanced performance monitor
|
||||
atopacct.service loaded active running Atop process accounting daemon
|
||||
avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack
|
||||
colord.service loaded active running Manage, Install and Generate Color Profiles
|
||||
console-setup.service loaded active exited Set console font and keymap
|
||||
cron.service loaded active running Regular background program processing daemon
|
||||
cups-browsed.service loaded active running Make remote CUPS printers available locally
|
||||
cups.service loaded active running CUPS Scheduler
|
||||
dbus.service loaded active running D-Bus System Message Bus
|
||||
fwupd.service loaded active running Firmware update daemon
|
||||
getty@tty1.service loaded active running Getty on tty1
|
||||
grub-common.service loaded active exited LSB: Record successful boot for GRUB
|
||||
irqbalance.service loaded active running LSB: daemon to balance interrupts for SMP systems
|
||||
keyboard-setup.service loaded active exited Set the console keyboard layout
|
||||
kmod-static-nodes.service loaded active exited Create list of required static device nodes for the current kernel
|
||||
```
|
||||
|
||||
以下选项可帮助您根据状态列出单位,输出与前例类似但更直截了当:
|
||||
|
||||
```
|
||||
# systemctl list-unit-files --type service
|
||||
|
||||
UNIT FILE STATE
|
||||
accounts-daemon.service enabled
|
||||
acpid.service disabled
|
||||
alsa-restore.service static
|
||||
alsa-state.service static
|
||||
alsa-utils.service masked
|
||||
anacron-resume.service enabled
|
||||
anacron.service enabled
|
||||
apache-htcacheclean.service disabled
|
||||
apache-htcacheclean@.service disabled
|
||||
apache2.service enabled
|
||||
apache2@.service disabled
|
||||
apparmor.service enabled
|
||||
apport-forward@.service static
|
||||
apport.service generated
|
||||
apt-daily-upgrade.service static
|
||||
apt-daily.service static
|
||||
aptik-battery-monitor.service generated
|
||||
atop.service enabled
|
||||
atopacct.service enabled
|
||||
autovt@.service enabled
|
||||
avahi-daemon.service enabled
|
||||
bluetooth.service enabled
|
||||
```
|
||||
|
||||
运行以下命令以查看指定服务的状态:
|
||||
|
||||
```
|
||||
# systemctl | grep apache2
|
||||
apache2.service loaded active running The Apache HTTP Server
|
||||
```
|
||||
|
||||
或者,使用以下命令也可查看指定服务的状态:
|
||||
|
||||
```
|
||||
# systemctl status apache2
|
||||
● apache2.service - The Apache HTTP Server
|
||||
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
|
||||
Drop-In: /lib/systemd/system/apache2.service.d
|
||||
└─apache2-systemd.conf
|
||||
Active: active (running) since Tue 2018-03-06 12:34:09 IST; 8min ago
|
||||
Process: 2786 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
|
||||
Main PID: 1171 (apache2)
|
||||
Tasks: 55 (limit: 4915)
|
||||
CGroup: /system.slice/apache2.service
|
||||
├─1171 /usr/sbin/apache2 -k start
|
||||
├─2790 /usr/sbin/apache2 -k start
|
||||
└─2791 /usr/sbin/apache2 -k start
|
||||
|
||||
Mar 06 12:34:08 magi-VirtualBox systemd[1]: Starting The Apache HTTP Server...
|
||||
Mar 06 12:34:09 magi-VirtualBox apachectl[1089]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.2.15. Set the 'ServerName' directive globally to suppre
|
||||
Mar 06 12:34:09 magi-VirtualBox systemd[1]: Started The Apache HTTP Server.
|
||||
Mar 06 12:39:10 magi-VirtualBox systemd[1]: Reloading The Apache HTTP Server.
|
||||
Mar 06 12:39:10 magi-VirtualBox apachectl[2786]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using fe80::7929:4ed1:279f:4d65. Set the 'ServerName' directive gl
|
||||
Mar 06 12:39:10 magi-VirtualBox systemd[1]: Reloaded The Apache HTTP Server.
|
||||
```
|
||||
|
||||
执行以下命令,只查看正在运行的服务:
|
||||
```
|
||||
# systemctl | grep running
|
||||
acpid.path loaded active running ACPI Events Check
|
||||
cups.path loaded active running CUPS Scheduler
|
||||
init.scope loaded active running System and Service Manager
|
||||
session-c2.scope loaded active running Session c2 of user magi
|
||||
accounts-daemon.service loaded active running Accounts Service
|
||||
acpid.service loaded active running ACPI event daemon
|
||||
apache2.service loaded active running The Apache HTTP Server
|
||||
aptik-battery-monitor.service loaded active running LSB: start/stop the aptik battery monitor daemon
|
||||
atop.service loaded active running Atop advanced performance monitor
|
||||
atopacct.service loaded active running Atop process accounting daemon
|
||||
avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack
|
||||
colord.service loaded active running Manage, Install and Generate Color Profiles
|
||||
cron.service loaded active running Regular background program processing daemon
|
||||
cups-browsed.service loaded active running Make remote CUPS printers available locally
|
||||
cups.service loaded active running CUPS Scheduler
|
||||
dbus.service loaded active running D-Bus System Message Bus
|
||||
fwupd.service loaded active running Firmware update daemon
|
||||
getty@tty1.service loaded active running Getty on tty1
|
||||
irqbalance.service loaded active running LSB: daemon to balance interrupts for SMP systems
|
||||
lightdm.service loaded active running Light Display Manager
|
||||
ModemManager.service loaded active running Modem Manager
|
||||
NetworkManager.service loaded active running Network Manager
|
||||
polkit.service loaded active running Authorization Manager
|
||||
```
|
||||
|
||||
使用以下命令查看系统启动时会被启用的服务列表:
|
||||
|
||||
```
|
||||
# systemctl list-unit-files | grep enabled
|
||||
acpid.path enabled
|
||||
cups.path enabled
|
||||
accounts-daemon.service enabled
|
||||
anacron-resume.service enabled
|
||||
anacron.service enabled
|
||||
apache2.service enabled
|
||||
apparmor.service enabled
|
||||
atop.service enabled
|
||||
atopacct.service enabled
|
||||
autovt@.service enabled
|
||||
avahi-daemon.service enabled
|
||||
bluetooth.service enabled
|
||||
console-setup.service enabled
|
||||
cron.service enabled
|
||||
cups-browsed.service enabled
|
||||
cups.service enabled
|
||||
display-manager.service enabled
|
||||
dns-clean.service enabled
|
||||
friendly-recovery.service enabled
|
||||
getty@.service enabled
|
||||
gpu-manager.service enabled
|
||||
keyboard-setup.service enabled
|
||||
lightdm.service enabled
|
||||
ModemManager.service enabled
|
||||
network-manager.service enabled
|
||||
networking.service enabled
|
||||
NetworkManager-dispatcher.service enabled
|
||||
NetworkManager-wait-online.service enabled
|
||||
NetworkManager.service enabled
|
||||
```
|
||||
|
||||
`systemd-cgtop` 按资源使用情况(任务、CPU、内存、输入和输出)列出控制组:
|
||||
|
||||
```
|
||||
# systemd-cgtop
|
||||
|
||||
Control Group Tasks %CPU Memory Input/s Output/s
|
||||
/ - - 1.5G - -
|
||||
/init.scope 1 - - - -
|
||||
/system.slice 153 - - - -
|
||||
/system.slice/ModemManager.service 3 - - - -
|
||||
/system.slice/NetworkManager.service 4 - - - -
|
||||
/system.slice/accounts-daemon.service 3 - - - -
|
||||
/system.slice/acpid.service 1 - - - -
|
||||
/system.slice/apache2.service 55 - - - -
|
||||
/system.slice/aptik-battery-monitor.service 1 - - - -
|
||||
/system.slice/atop.service 1 - - - -
|
||||
/system.slice/atopacct.service 1 - - - -
|
||||
/system.slice/avahi-daemon.service 2 - - - -
|
||||
/system.slice/colord.service 3 - - - -
|
||||
/system.slice/cron.service 1 - - - -
|
||||
/system.slice/cups-browsed.service 3 - - - -
|
||||
/system.slice/cups.service 2 - - - -
|
||||
/system.slice/dbus.service 6 - - - -
|
||||
/system.slice/fwupd.service 5 - - - -
|
||||
/system.slice/irqbalance.service 1 - - - -
|
||||
/system.slice/lightdm.service 7 - - - -
|
||||
/system.slice/polkit.service 3 - - - -
|
||||
/system.slice/repowerd.service 14 - - - -
|
||||
/system.slice/rsyslog.service 4 - - - -
|
||||
/system.slice/rtkit-daemon.service 3 - - - -
|
||||
/system.slice/snapd.service 8 - - - -
|
||||
/system.slice/system-getty.slice 1 - - - -
|
||||
```
|
||||
|
||||
同时,我们可以使用 `pstree` 命令(输出来自 SysVinit 系统)查看正在运行的服务:
|
||||
|
||||
```
|
||||
# pstree
|
||||
init-+-crond
|
||||
|-httpd---2*[httpd]
|
||||
|-kthreadd/99149---khelper/99149
|
||||
|-2*[mingetty]
|
||||
|-mysqld_safe---mysqld---9*[{mysqld}]
|
||||
|-rsyslogd---3*[{rsyslogd}]
|
||||
|-saslauthd---saslauthd
|
||||
|-2*[sendmail]
|
||||
|-sshd---sshd---bash---pstree
|
||||
|-udevd
|
||||
`-xinetd
|
||||
```
|
||||
|
||||
我们还可以使用 `pstree` 命令(输出来自 systemd 系统)查看正在运行的服务:
|
||||
|
||||
```
|
||||
# pstree
|
||||
systemd─┬─ModemManager─┬─{gdbus}
|
||||
│ └─{gmain}
|
||||
├─NetworkManager─┬─dhclient
|
||||
│ ├─{gdbus}
|
||||
│ └─{gmain}
|
||||
├─accounts-daemon─┬─{gdbus}
|
||||
│ └─{gmain}
|
||||
├─acpid
|
||||
├─agetty
|
||||
├─anacron
|
||||
├─apache2───2*[apache2───26*[{apache2}]]
|
||||
├─aptd───{gmain}
|
||||
├─aptik-battery-m
|
||||
├─atop
|
||||
├─atopacctd
|
||||
├─avahi-daemon───avahi-daemon
|
||||
├─colord─┬─{gdbus}
|
||||
│ └─{gmain}
|
||||
├─cron
|
||||
├─cups-browsed─┬─{gdbus}
|
||||
│ └─{gmain}
|
||||
├─cupsd
|
||||
├─dbus-daemon
|
||||
├─fwupd─┬─{GUsbEventThread}
|
||||
│ ├─{fwupd}
|
||||
│ ├─{gdbus}
|
||||
│ └─{gmain}
|
||||
├─gnome-keyring-d─┬─{gdbus}
|
||||
│ ├─{gmain}
|
||||
│ └─{timer}
|
||||
```
|
||||
|
||||
### 方法四:如何使用 chkservice 在 systemd 系统中查看正在运行的服务
|
||||
|
||||
`chkservice` 是一个管理系统单元的终端工具,需要超级用户权限。
|
||||
|
||||
```
|
||||
# chkservice
|
||||
```
|
||||
|
||||
![][1]
|
||||
|
||||
要查看帮助页面,请按下 `?` ,它将显示管理 systemd 服务的可用选项。
|
||||
|
||||
![][2]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/how-to-check-all-running-services-in-linux/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
译者:[jessie-pang](https://github.com/jessie-pang)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.2daygeek.com/author/magesh/
|
||||
[1]:https://www.2daygeek.com/wp-content/uploads/2018/03/chkservice-1.png
|
||||
[2]:https://www.2daygeek.com/wp-content/uploads/2018/03/chkservice-2.png
|
@ -1,122 +1,120 @@
|
||||
如何在 Linux 上使用 Pbcopy 和 Pbpaste 命令
|
||||
如何在 Linux 上使用 pbcopy 和 pbpaste 命令
|
||||
======
|
||||
|
||||

|
||||
|
||||
由于 Linux 和 Mac OS X 是基于 *Nix 的系统,因此许多命令可以在两个平台上运行。但是,某些命令可能在两个平台上都没有,比如 **pbcopy** 和 **pbpast**。这些命令仅在 Mac OS X 平台上可用。Pbcopy 命令将标准输入复制到剪贴板。然后,你可以在任何地方使用 Pbpaste 命令粘贴剪贴板内容。当然,上述命令可能有一些 Linux 替代品,例如 **Xclip**。 Xclip 与 Pbcopy 完全相同。但是,从 Mac OS 切换到 Linux 的发行版的人将会错过这两个命令,但仍然更喜欢使用它们。别担心!这个简短的教程描述了如何在 Linux 上使用 Pbcopy 和 Pbpaste 命令。
|
||||
由于 Linux 和 Mac OS X 是基于 *Nix 的系统,因此许多命令可以在两个平台上运行。但是,某些命令可能在两个平台上都没有,比如 `pbcopy` 和 `pbpast`。这些命令仅在 Mac OS X 平台上可用。`pbcopy` 命令将标准输入复制到剪贴板。然后,你可以在任何地方使用 `pbpaste` 命令粘贴剪贴板内容。当然,上述命令可能有一些 Linux 替代品,例如 `xclip`。 `xclip` 与 `pbcopy` 完全相同。但是,从 Mac OS 切换到 Linux 的发行版的人将会找不到这两个命令,不过仍然想使用它们。别担心!这个简短的教程描述了如何在 Linux 上使用 `pbcopy` 和 `pbpaste` 命令。
|
||||
|
||||
### 安装 Xclip / Xsel
|
||||
### 安装 xclip / xsel
|
||||
|
||||
就像我已经说过的那样,Linux 中没有 Pbcopy 和 Pbpaste 命令。但是,我们可以通过 shell 别名使用 Xclip 和/或 Xsel 命令复制 pbcopy 和 pbpaste 命令的功能。Xclip 和 Xsel 包存在于大多数 Linux 发行版的默认存储库中。请注意,你无需安装这两个程序。只需安装上述任何一个程序即可。
|
||||
就像我已经说过的那样,Linux 中没有 `pbcopy` 和 `pbpaste` 命令。但是,我们可以通过 shell 别名使用 xclip 和/或 xsel 命令复制 `pbcopy` 和 `pbpaste` 命令的功能。xclip 和 xsel 包存在于大多数 Linux 发行版的默认存储库中。请注意,你无需安装这两个程序。只需安装上述任何一个程序即可。
|
||||
|
||||
要在 Arch Linux 及其衍生产版上安装它们,请运行:
|
||||
|
||||
```
|
||||
$ sudo pacman xclip xsel
|
||||
|
||||
```
|
||||
|
||||
在 Fedora 上:
|
||||
|
||||
```
|
||||
$ sudo dnf xclip xsel
|
||||
|
||||
```
|
||||
|
||||
在 Debian、Ubuntu、Linux Mint 上:
|
||||
|
||||
```
|
||||
$ sudo apt install xclip xsel
|
||||
|
||||
```
|
||||
|
||||
Once installed, you need create aliases for pbcopy and pbpaste commands. To do so, edit your **~/.bashrc** file:
|
||||
安装后,你需要为 pbcopy 和 pbpaste 命令创建别名。为此,请编辑 **~/.bashrc**:
|
||||
安装后,你需要为 `pbcopy` 和 `pbpaste` 命令创建别名。为此,请编辑 `~/.bashrc`:
|
||||
|
||||
```
|
||||
$ vi ~/.bashrc
|
||||
|
||||
```
|
||||
|
||||
如果要使用 Xclip,请粘贴以下行:
|
||||
如果要使用 xclip,请粘贴以下行:
|
||||
|
||||
```
|
||||
alias pbcopy='xclip -selection clipboard'
|
||||
alias pbpaste='xclip -selection clipboard -o'
|
||||
|
||||
```
|
||||
|
||||
如果要使用 xsel,请在 ~/.bashrc 中粘贴以下行。
|
||||
如果要使用 xsel,请在 `~/.bashrc` 中粘贴以下行。
|
||||
|
||||
```
|
||||
alias pbcopy='xsel --clipboard --input'
|
||||
alias pbpaste='xsel --clipboard --output'
|
||||
|
||||
```
|
||||
|
||||
保存并关闭文件。
|
||||
|
||||
接下来,运行以下命令以更新 ~/.bashrc 中的更改。
|
||||
接下来,运行以下命令以更新 `~/.bashrc` 中的更改。
|
||||
|
||||
```
|
||||
$ source ~/.bashrc
|
||||
|
||||
```
|
||||
|
||||
ZSH 用户将上述行粘贴到 **~/.zshrc** 中。
|
||||
ZSH 用户将上述行粘贴到 `~/.zshrc` 中。
|
||||
|
||||
### 在 Linux 上使用 Pbcopy 和 Pbpaste 命令
|
||||
### 在 Linux 上使用 pbcopy 和 pbpaste 命令
|
||||
|
||||
让我们看一些例子。
|
||||
|
||||
pbcopy 命令将文本从 stdin 复制到剪贴板缓冲区。例如,看看下面的例子。
|
||||
`pbcopy` 命令将文本从 stdin 复制到剪贴板缓冲区。例如,看看下面的例子。
|
||||
|
||||
```
|
||||
$ echo "Welcome To OSTechNix!" | pbcopy
|
||||
|
||||
```
|
||||
|
||||
上面的命令会将文本 “Welcome to OSTechNix” 复制到剪贴板中。你可以稍后访问此内容并使用如下所示的 Pbpaste 命令将其粘贴到任何位置。
|
||||
上面的命令会将文本 “Welcome to OSTechNix” 复制到剪贴板中。你可以稍后访问此内容并使用如下所示的 `pbpaste` 命令将其粘贴到任何位置。
|
||||
|
||||
```
|
||||
$ echo `pbpaste`
|
||||
Welcome To OSTechNix!
|
||||
|
||||
```
|
||||
|
||||

|
||||
|
||||
以下是一些其他例子。
|
||||
|
||||
我有一个名为 **file.txt*** 的文件,其中包含以下内容。
|
||||
我有一个名为 `file.txt` 的文件,其中包含以下内容。
|
||||
|
||||
```
|
||||
$ cat file.txt
|
||||
Welcome To OSTechNix!
|
||||
|
||||
```
|
||||
|
||||
你可以直接将文件内容复制到剪贴板中,如下所示。
|
||||
|
||||
```
|
||||
$ pbcopy < file.txt
|
||||
|
||||
```
|
||||
|
||||
现在,只要你用其他文件的内容更新了剪切板,那么剪切板中的内容就可用了。
|
||||
|
||||
要从剪贴板检索内容,只需输入:
|
||||
|
||||
```
|
||||
$ pbpaste
|
||||
Welcome To OSTechNix!
|
||||
|
||||
```
|
||||
|
||||
你还可以使用管道字符将任何 Linux 命令的输出发送到剪贴板。看看下面的例子。
|
||||
|
||||
```
|
||||
$ ps aux | pbcopy
|
||||
|
||||
```
|
||||
|
||||
现在,输入 “pbpaste” 命令以显示剪贴板中 “ps aux” 命令的输出。
|
||||
现在,输入 `pbpaste` 命令以显示剪贴板中 `ps aux` 命令的输出。
|
||||
|
||||
```
|
||||
$ pbpaste
|
||||
|
||||
```
|
||||
|
||||

|
||||
|
||||
使用 Pbcopy 和 Pbpaste 命令可以做更多的事情。我希望你现在对这些命令有一个基本的想法。
|
||||
使用 `pbcopy` 和 `pbpaste` 命令可以做更多的事情。我希望你现在对这些命令有一个基本的想法。
|
||||
|
||||
就是这些了。还有更好的东西。敬请关注!
|
||||
|
||||
@ -131,7 +129,7 @@ via: https://www.ostechnix.com/how-to-use-pbcopy-and-pbpaste-commands-on-linux/
|
||||
作者:[SK][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
120
sources/tech/20171102 Using User Namespaces on Docker.md
Normal file
120
sources/tech/20171102 Using User Namespaces on Docker.md
Normal file
@ -0,0 +1,120 @@
|
||||
translating by lujun9972
|
||||
Using User Namespaces on Docker
|
||||
======
|
||||
User Namespaces is officially added to Docker ver. 1.10, which allows the host system to map its own `uid` and `gid` to some different `uid` and `gid` for containers' processes. This is a big improvement in Docker's security. So I will show an example of the problem that User Namespaces can resolve, and then show how to enable it.
|
||||
|
||||
### Creating a Docker Machine
|
||||
|
||||
If you already have a docker machine to try out the User Namaspaces, you can skip this step. I'm using Docker Toolbox on my Macbook, so I simply create a Docker Machine on VirutalBox with `docker-machine` command (e.g. hostname=`host1`):
|
||||
```
|
||||
# Create host1
|
||||
$ docker-machine create --driver virtualbox host1
|
||||
|
||||
# Login to host1
|
||||
$ docker-machine ssh host1
|
||||
|
||||
```
|
||||
|
||||
### Understanding what a non-root user can do if User Namespaces is not enabled
|
||||
|
||||
Before setting up User Namespaces, let's see what the problem is. What was actually wrong with Docker? First of all, one of the great benefits on using Docker is that user can have root privilege on containers so that user can easily install software packages. But this is like a double-edged sword in Linux container technology. With some little twist, non-root user can get root access to, for instance, `/etc` of the host system. Here's how to do it.
|
||||
```
|
||||
# Run a container and mount host1's /etc onto /root/etc
|
||||
$ docker run --rm -v /etc:/root/etc -it ubuntu
|
||||
|
||||
# Make some change on /root/etc/hosts
|
||||
root@34ef23438542:/# vi /root/etc/hosts
|
||||
|
||||
# Exit from the container
|
||||
root@34ef23438542:/# exit
|
||||
|
||||
# Check /etc/hosts
|
||||
$ cat /etc/hosts
|
||||
|
||||
```
|
||||
|
||||
As you can see, it is surprizingly easy, and it's obvious that Docker wasn't designed for shared computers. But now, with the User Namespaces, Docker lets you avoid this problem.
|
||||
|
||||
### Enabling User Namespaces
|
||||
```
|
||||
# Create a user called "dockremap"
|
||||
$ sudo adduser dockremap
|
||||
|
||||
# Setup subuid and subgid
|
||||
$ sudo sh -c 'echo dockremap:500000:65536 > /etc/subuid'
|
||||
$ sudo sh -c 'echo dockremap:500000:65536 > /etc/subgid'
|
||||
|
||||
```
|
||||
|
||||
And then, open `/etc/init.d/docker`, and add `--userns-remap=default` next to `/usr/local/bin/docker daemon` like this:
|
||||
```
|
||||
$ sudo vi /etc/init.d/docker
|
||||
:
|
||||
:
|
||||
/usr/local/bin/docker daemon --userns-remap=default -D -g "$DOCKER_DIR" -H unix:// $DOCKER_HOST $EXTRA_ARGS >> "$DOCKER_LOGFILE" 2>&1 &
|
||||
:
|
||||
:
|
||||
|
||||
```
|
||||
|
||||
And restart Docker:
|
||||
```
|
||||
$ sudo /etc/init.d/docker restart
|
||||
|
||||
```
|
||||
|
||||
That's all!
|
||||
|
||||
**Note:** If you're using CentOS 7, there are two things you need to know.
|
||||
|
||||
**1.** User Namespaces is not enabled on the kernel by default. You can enable it by executing the following command and restart the system.
|
||||
```
|
||||
sudo grubby --args="user_namespace.enable=1" \
|
||||
--update-kernel=/boot/vmlinuz-3.10.0-XXX.XX.X.el7.x86_64
|
||||
|
||||
```
|
||||
|
||||
**2.** CentOS 7 uses systemctl to manage services, so the file you need to edit is `/usr/lib/systemd/system/docker.service`.
|
||||
|
||||
### Checking if User Namespaces is working properly
|
||||
|
||||
If everything's set properly, you shouldn't be able to edit host1's `/etc` from a container. So let's check it out.
|
||||
```
|
||||
# Create a container and mount host1's /etc to container's /root/etc
|
||||
$ docker run --rm -v /etc:/root/etc -it ubuntu
|
||||
|
||||
# Check the owner of files in /root/etc, which should be "nobody nogroup".
|
||||
root@d5802c5e670a:/# ls -la /root/etc
|
||||
total 180
|
||||
drwxr-xr-x 11 nobody nogroup 1100 Mar 21 23:31 .
|
||||
drwx------ 3 root root 4096 Mar 21 23:50 ..
|
||||
lrwxrwxrwx 1 nobody nogroup 19 Mar 21 23:07 acpi -> /usr/local/etc/acpi
|
||||
-rw-r--r-- 1 nobody nogroup 48 Mar 10 22:09 boot2docker
|
||||
drwxr-xr-x 2 nobody nogroup 60 Mar 21 23:07 default
|
||||
:
|
||||
:
|
||||
|
||||
# Try creating a file in /root/etc
|
||||
root@d5802c5e670a:/# touch /root/etc/test
|
||||
touch: cannot touch '/root/etc/test': Permission denied
|
||||
|
||||
# Try deleting a file
|
||||
root@d5802c5e670a:/# rm /root/etc/hostname
|
||||
rm: cannot remove '/root/etc/hostname': Permission denied
|
||||
|
||||
```
|
||||
|
||||
Okay, great. This is how User Namespaces works.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://coderwall.com/p/s_ydlq/using-user-namespaces-on-docker
|
||||
|
||||
作者:[Koji Tanaka][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[lujun9972](https://github.com/lujun9972)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://coderwall.com/kjtanaka
|
@ -1,3 +1,5 @@
|
||||
icecoobe translating
|
||||
|
||||
How To Check System Hardware Manufacturer, Model And Serial Number In Linux
|
||||
======
|
||||
Getting system hardware information is not a problem for Linux GUI and Windows users but CLI users facing trouble to get this details.
|
||||
|
@ -0,0 +1,336 @@
|
||||
How To Add Additional IP (Secondary IP) In Ubuntu System
|
||||
======
|
||||
Linux admin should be aware of this because it’s a routine task. Many of you wondering why we need to add more than one IP address in server? why we need add this to single network card? am i right?
|
||||
|
||||
Also you can have a question like, how to assign multiple IP addresses to single network card in linux. In this article you can get an answer for this.
|
||||
|
||||
When we setup a new server, ideally it will have one IP address, which is server main IP address and linked with server hostname.
|
||||
|
||||
We should not host any application in server main IP address, which is not advisable. If you want to host any application on server, we should add additional IP or Secondary IP for that.
|
||||
|
||||
This is the best practices in industry, this allows users to install SSL certificate. Most of the system comes with single network card, which is more than enough to add additional IP address.
|
||||
|
||||
**Suggested Read :**
|
||||
**(#)** [9 Methods To Check Your Public IP Address In Linux Command Line][1]
|
||||
**(#)** [3 Easy Ways To Check DNS (Domain Name Server) Records In Linux Terminal][2]
|
||||
**(#)** [Check DNS (Domain Name Server) Records On Linux Using Dig Command][3]
|
||||
**(#)** [Check DNS (Domain Name Server) Records On Linux Using Nslookup Command][4]
|
||||
**(#)** [Check DNS (Domain Name Server) Records On Linux Using Host Command][5]
|
||||
|
||||
We can add IP address in the same interface or create sub interface on the same device then add IP in that. By default interface name comes `ethX (eth0)` till Ubuntu 14.04 LTS but from Ubuntu 15.10 network interfaces names have been changed from `ethX` to `enXXXXX` (For server ens33 & For desktop enp0s3).
|
||||
|
||||
In this article we will teach you how to perform this on Ubuntu and it is derivative.
|
||||
|
||||
**`Make a note:`** You should not add IP address entry after DNS details. If so, DNS wont work.
|
||||
|
||||
### How To Add Secondary IP Address Temporarily In Ubuntu 14.04 LTS
|
||||
|
||||
Before adding IP address in system. Just verify the server main IP address by running any of the below commands.
|
||||
```
|
||||
# ifconfig
|
||||
|
||||
or
|
||||
|
||||
# ip addr
|
||||
|
||||
eth0 Link encap:Ethernet HWaddr 08:00:27:98:b7:36
|
||||
inet addr:192.168.56.150 Bcast:192.168.56.255 Mask:255.255.255.0
|
||||
inet6 addr: fe80::a00:27ff:fe98:b736/64 Scope:Link
|
||||
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
|
||||
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
|
||||
TX packets:105 errors:0 dropped:0 overruns:0 carrier:0
|
||||
collisions:0 txqueuelen:1000
|
||||
RX bytes:902 (902.0 B) TX bytes:16423 (16.4 KB)
|
||||
|
||||
eth1 Link encap:Ethernet HWaddr 08:00:27:6a:cf:d3
|
||||
inet addr:10.0.3.15 Bcast:10.0.3.255 Mask:255.255.255.0
|
||||
inet6 addr: fe80::a00:27ff:fe6a:cfd3/64 Scope:Link
|
||||
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
|
||||
RX packets:80 errors:0 dropped:0 overruns:0 frame:0
|
||||
TX packets:146 errors:0 dropped:0 overruns:0 carrier:0
|
||||
collisions:0 txqueuelen:1000
|
||||
RX bytes:8698 (8.6 KB) TX bytes:17047 (17.0 KB)
|
||||
|
||||
lo Link encap:Local Loopback
|
||||
inet addr:127.0.0.1 Mask:255.0.0.0
|
||||
inet6 addr: ::1/128 Scope:Host
|
||||
UP LOOPBACK RUNNING MTU:65536 Metric:1
|
||||
RX packets:25 errors:0 dropped:0 overruns:0 frame:0
|
||||
TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
|
||||
collisions:0 txqueuelen:1
|
||||
RX bytes:1730 (1.7 KB) TX bytes:1730 (1.7 KB)
|
||||
|
||||
```
|
||||
|
||||
As i can see, the server main IP address is `192.168.56.150` so, i’m going to assign next IP `192.168.56.151` as a secondary IP. This can be done using below method.
|
||||
```
|
||||
# ip addr add 192.168.56.151/24 broadcast 192.168.56.255 dev eth0 label eth0:1
|
||||
|
||||
```
|
||||
|
||||
Fire the following command to check newly added IP address. If you reboot the server then the newly added IP address go off because we have added this temporarily.
|
||||
```
|
||||
# ip addr
|
||||
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
|
||||
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
||||
inet 127.0.0.1/8 scope host lo
|
||||
valid_lft forever preferred_lft forever
|
||||
inet6 ::1/128 scope host
|
||||
valid_lft forever preferred_lft forever
|
||||
2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
|
||||
link/ether 08:00:27:98:b7:36 brd ff:ff:ff:ff:ff:ff
|
||||
inet 192.168.56.150/24 brd 192.168.56.255 scope global eth0
|
||||
valid_lft forever preferred_lft forever
|
||||
inet 192.168.56.151/24 brd 192.168.56.255 scope global secondary eth0:1
|
||||
valid_lft forever preferred_lft forever
|
||||
inet6 fe80::a00:27ff:fe98:b736/64 scope link
|
||||
valid_lft forever preferred_lft forever
|
||||
3: eth1: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
|
||||
link/ether 08:00:27:6a:cf:d3 brd ff:ff:ff:ff:ff:ff
|
||||
inet 10.0.3.15/24 brd 10.0.3.255 scope global eth1
|
||||
valid_lft forever preferred_lft forever
|
||||
inet6 fe80::a00:27ff:fe6a:cfd3/64 scope link
|
||||
valid_lft forever preferred_lft forever
|
||||
|
||||
```
|
||||
|
||||
### How To Add Secondary IP Address Permanently In Ubuntu 14.04 LTS
|
||||
|
||||
To add secondary IP address permanently on Ubuntu system, just edit `/etc/network/interfaces` file and add the requires IP details.
|
||||
```
|
||||
# vi /etc/network/interfaces
|
||||
|
||||
# The loopback network interface
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
# The primary network interface
|
||||
auto eth0
|
||||
iface eth0 inet static
|
||||
address 192.168.56.150
|
||||
netmask 255.255.255.0
|
||||
network 192.168.56.0
|
||||
broadcast 192.168.56.255
|
||||
gateway 192.168.56.1
|
||||
|
||||
auto eth0:1
|
||||
iface eth0:1 inet static
|
||||
address 192.168.56.151
|
||||
netmask 255.255.255.0
|
||||
|
||||
```
|
||||
|
||||
Save and close the file then restart the network interface
|
||||
```
|
||||
# service networking restart
|
||||
or
|
||||
# ifdown eth0:1 && ifup eth0:1
|
||||
|
||||
```
|
||||
|
||||
Verify the newly added IP address.
|
||||
```
|
||||
# ifconfig
|
||||
eth0 Link encap:Ethernet HWaddr 08:00:27:98:b7:36
|
||||
inet addr:192.168.56.150 Bcast:192.168.56.255 Mask:255.255.255.0
|
||||
inet6 addr: fe80::a00:27ff:fe98:b736/64 Scope:Link
|
||||
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
|
||||
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
|
||||
TX packets:84 errors:0 dropped:0 overruns:0 carrier:0
|
||||
collisions:0 txqueuelen:1000
|
||||
RX bytes:962 (962.0 B) TX bytes:11905 (11.9 KB)
|
||||
|
||||
eth0:1 Link encap:Ethernet HWaddr 08:00:27:98:b7:36
|
||||
inet addr:192.168.56.151 Bcast:192.168.56.255 Mask:255.255.255.0
|
||||
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
|
||||
|
||||
eth1 Link encap:Ethernet HWaddr 08:00:27:6a:cf:d3
|
||||
inet addr:10.0.3.15 Bcast:10.0.3.255 Mask:255.255.255.0
|
||||
inet6 addr: fe80::a00:27ff:fe6a:cfd3/64 Scope:Link
|
||||
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
|
||||
RX packets:4924 errors:0 dropped:0 overruns:0 frame:0
|
||||
TX packets:3185 errors:0 dropped:0 overruns:0 carrier:0
|
||||
collisions:0 txqueuelen:1000
|
||||
RX bytes:4037636 (4.0 MB) TX bytes:422516 (422.5 KB)
|
||||
|
||||
lo Link encap:Local Loopback
|
||||
inet addr:127.0.0.1 Mask:255.0.0.0
|
||||
inet6 addr: ::1/128 Scope:Host
|
||||
UP LOOPBACK RUNNING MTU:65536 Metric:1
|
||||
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
|
||||
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
|
||||
collisions:0 txqueuelen:1
|
||||
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
|
||||
|
||||
```
|
||||
|
||||
### How To Add Secondary IP Address Temporarily In Ubuntu 16.04 LTS
|
||||
|
||||
As discussed in the beginning of the article, network interfaces names have been changed
|
||||
from ‘ethX’ to ‘enXXXX’ (enp0s3) since Ubuntu 15.10 so, replace your interface name instead of us.
|
||||
|
||||
Let me check the IP information on my system before performing this.
|
||||
```
|
||||
# ifconfig
|
||||
or
|
||||
# ip addr
|
||||
|
||||
enp0s3: flags=4163 mtu 1500
|
||||
inet 192.168.56.201 netmask 255.255.255.0 broadcast 192.168.56.255
|
||||
inet6 fe80::a00:27ff:fe97:132e prefixlen 64 scopeid 0x20
|
||||
ether 08:00:27:97:13:2e txqueuelen 1000 (Ethernet)
|
||||
RX packets 7 bytes 420 (420.0 B)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 294 bytes 24747 (24.7 KB)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
|
||||
enp0s8: flags=4163 mtu 1500
|
||||
inet 10.0.3.15 netmask 255.255.255.0 broadcast 10.0.3.255
|
||||
inet6 fe80::344b:6259:4dbe:eabb prefixlen 64 scopeid 0x20
|
||||
ether 08:00:27:12:e8:c1 txqueuelen 1000 (Ethernet)
|
||||
RX packets 1 bytes 590 (590.0 B)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 97 bytes 10209 (10.2 KB)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
|
||||
lo: flags=73 mtu 65536
|
||||
inet 127.0.0.1 netmask 255.0.0.0
|
||||
inet6 ::1 prefixlen 128 scopeid 0x10
|
||||
loop txqueuelen 1000 (Local Loopback)
|
||||
RX packets 325 bytes 24046 (24.0 KB)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 325 bytes 24046 (24.0 KB)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
|
||||
```
|
||||
|
||||
As i can see, the server main IP address is `192.168.56.201` so, i’m going to assign next IP `192.168.56.202` as a secondary IP. This can be done using below command.
|
||||
```
|
||||
# ip addr add 192.168.56.202/24 broadcast 192.168.56.255 dev enp0s3
|
||||
|
||||
```
|
||||
|
||||
Run the below command to check if the new IP has been assigned or not. This will go off when you reboot the machine.
|
||||
```
|
||||
# ip addr
|
||||
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
|
||||
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
||||
inet 127.0.0.1/8 scope host lo
|
||||
valid_lft forever preferred_lft forever
|
||||
inet6 ::1/128 scope host
|
||||
valid_lft forever preferred_lft forever
|
||||
2: enp0s3: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
|
||||
link/ether 08:00:27:97:13:2e brd ff:ff:ff:ff:ff:ff
|
||||
inet 192.168.56.201/24 brd 192.168.56.255 scope global enp0s3
|
||||
valid_lft forever preferred_lft forever
|
||||
inet 192.168.56.202/24 brd 192.168.56.255 scope global secondary enp0s3
|
||||
valid_lft forever preferred_lft forever
|
||||
inet6 fe80::a00:27ff:fe97:132e/64 scope link
|
||||
valid_lft forever preferred_lft forever
|
||||
3: enp0s8: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
|
||||
link/ether 08:00:27:12:e8:c1 brd ff:ff:ff:ff:ff:ff
|
||||
inet 10.0.3.15/24 brd 10.0.3.255 scope global dynamic enp0s8
|
||||
valid_lft 86353sec preferred_lft 86353sec
|
||||
inet6 fe80::344b:6259:4dbe:eabb/64 scope link
|
||||
valid_lft forever preferred_lft forever
|
||||
|
||||
```
|
||||
|
||||
### How To Add Secondary IP Address Permanently In Ubuntu 16.04 LTS
|
||||
|
||||
To add secondary IP address permanently on Ubuntu system, just edit `/etc/network/interfaces` file and add the requires IP details.
|
||||
|
||||
We should not add secondary IP address after dns-nameservers because it wont work and add the IP details in the below format.
|
||||
|
||||
Moreover we don’t need to add sub interface (how we did previously in Ubuntu 14.04 LTS).
|
||||
```
|
||||
# vi /etc/network/interfaces
|
||||
|
||||
# interfaces(5) file used by ifup(8) and ifdown(8)
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
# The primary network interface
|
||||
auto enp0s3
|
||||
iface enp0s3 inet static
|
||||
address 192.168.56.201
|
||||
netmask 255.255.255.0
|
||||
|
||||
iface enp0s3 inet static
|
||||
address 192.168.56.202
|
||||
netmask 255.255.255.0
|
||||
|
||||
gateway 192.168.56.1
|
||||
network 192.168.56.0
|
||||
broadcast 192.168.56.255
|
||||
dns-nameservers 8.8.8.8 8.8.4.4
|
||||
dns-search 2daygeek.local
|
||||
|
||||
```
|
||||
|
||||
Save and close the file then restart the network interface
|
||||
```
|
||||
# systemctl restart networking
|
||||
or
|
||||
# ifdown enp0s3 && ifup enp0s3
|
||||
|
||||
```
|
||||
|
||||
Run the below command to check if the new IP has been assigned or not.
|
||||
```
|
||||
# ip addr
|
||||
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
|
||||
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
|
||||
inet 127.0.0.1/8 scope host lo
|
||||
valid_lft forever preferred_lft forever
|
||||
inet6 ::1/128 scope host
|
||||
valid_lft forever preferred_lft forever
|
||||
2: enp0s3: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
|
||||
link/ether 08:00:27:97:13:2e brd ff:ff:ff:ff:ff:ff
|
||||
inet 192.168.56.201/24 brd 192.168.56.255 scope global enp0s3
|
||||
valid_lft forever preferred_lft forever
|
||||
inet 192.168.56.202/24 brd 192.168.56.255 scope global secondary enp0s3
|
||||
valid_lft forever preferred_lft forever
|
||||
inet6 fe80::a00:27ff:fe97:132e/64 scope link
|
||||
valid_lft forever preferred_lft forever
|
||||
3: enp0s8: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
|
||||
link/ether 08:00:27:12:e8:c1 brd ff:ff:ff:ff:ff:ff
|
||||
inet 10.0.3.15/24 brd 10.0.3.255 scope global dynamic enp0s8
|
||||
valid_lft 86353sec preferred_lft 86353sec
|
||||
inet6 fe80::344b:6259:4dbe:eabb/64 scope link
|
||||
valid_lft forever preferred_lft forever
|
||||
|
||||
```
|
||||
|
||||
Also, let me ping the new IP address.
|
||||
```
|
||||
# ping 192.168.56.202 -c 4
|
||||
PING 192.168.56.202 (192.168.56.202) 56(84) bytes of data.
|
||||
64 bytes from 192.168.56.202: icmp_seq=1 ttl=64 time=0.019 ms
|
||||
64 bytes from 192.168.56.202: icmp_seq=2 ttl=64 time=0.087 ms
|
||||
64 bytes from 192.168.56.202: icmp_seq=3 ttl=64 time=0.034 ms
|
||||
64 bytes from 192.168.56.202: icmp_seq=4 ttl=64 time=0.042 ms
|
||||
|
||||
--- 192.168.56.202 ping statistics ---
|
||||
4 packets transmitted, 4 received, 0% packet loss, time 3068ms
|
||||
rtt min/avg/max/mdev = 0.019/0.045/0.087/0.026 ms
|
||||
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/how-to-add-additional-ip-secondary-ip-in-ubuntu-debian-system/
|
||||
|
||||
作者:[Prakash Subramanian][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.2daygeek.com/author/prakash/
|
||||
[1]:https://www.2daygeek.com/check-find-server-public-ip-address-linux/
|
||||
[2]:https://www.2daygeek.com/check-find-dns-records-of-domain-in-linux-terminal/
|
||||
[3]:https://www.2daygeek.com/dig-command-check-find-dns-records-lookup-linux/
|
||||
[4]:https://www.2daygeek.com/nslookup-command-check-find-dns-records-lookup-linux/
|
||||
[5]:https://www.2daygeek.com/host-command-check-find-dns-records-lookup-linux/
|
@ -1,204 +0,0 @@
|
||||
[Moelf](https://github.com/moelf/) Translating
|
||||
Don’t Install Yaourt! Use These Alternatives for AUR in Arch Linux
|
||||
======
|
||||
**Brief: Yaourt had been the most popular AUR helper, but it is not being developed anymore. In this article, we list out some of the best alternatives to Yaourt for Arch based Linux distributions. **
|
||||
|
||||
[Arch User Repository][1] popularly known as AUR is the community-driven software repository for Arch users. Debian/Ubuntu users can think of AUR as the equivalent of PPA.
|
||||
|
||||
It contains the packages that are not directly endorsed by [Arch Linux][2]. If someone develops a software or package for Arch Linux, it can be provided through this community repositories. This enables the end-user to access more software than what they get by default.
|
||||
|
||||
So, how do you use AUR then? Well, you need a different tool to install software from AUR. Arch’s package manager [pacman][3] doesn’t support it directly. These ‘special tools’ are called [AUR helpers][4].
|
||||
|
||||
Yaourt (Yet AnOther User Repository Tool) is/was a wrapper for pacman that helps to install AUR packages on Arch Linux. It uses the same syntax as pacman. Yaourt has great support for Arch User Repository for searching, installing, conflict resolution and dependency maintenance.
|
||||
|
||||
However, Yaourt development has been slow lately and is [listed][5] as “Discontinued or problematic” on Arch Wiki. [Many Arch User believe it’s not secure][6] and hence go towards a different AUR helper.
|
||||
|
||||
![AUR Helpers other than Yaourt][7]
|
||||
|
||||
In this article, we will see the best Yaourt alternatives that you can use for installing software from AUR.
|
||||
|
||||
### Best AUR helpers to use AUR
|
||||
|
||||
I am deliberating omitting some of the other popular AUR helpers like trizen or packer because they too have been flagged as ‘discontinued or problematic’.
|
||||
|
||||
#### 1\. aurman
|
||||
|
||||
[aurman][8] is one of the best AUR helpers and serves pretty well as an alternative to Yaourt. It has almost similar syntax to pacman with support for all pacman operations. You can search the AUR, resolve dependencies, check PKGBUILD content before a package build etc.
|
||||
|
||||
##### Features of aurman
|
||||
|
||||
* aurman supports all pacman operations and incorporates reliable dependency resolving, conflict detection and split package support.
|
||||
* Threaded sudo loop runs in the background saving you from entering your password each time.
|
||||
* Provides development package support and distincts between explictily and inlicitly installed packages.
|
||||
* Support for searching of AUR packages and repositories.
|
||||
* You can see and edit the PKGBUILDs before starting AUR package build.
|
||||
* It can also be used as a standalone [dependency solver][9].
|
||||
|
||||
|
||||
|
||||
##### Installing aurman
|
||||
```
|
||||
git clone https://aur.archlinux.org/aurman.git
|
||||
cd aurman
|
||||
makepkg -si
|
||||
|
||||
```
|
||||
|
||||
##### Using aurman
|
||||
|
||||
Searching for an application through aurman in Arch User Repository is done in the following manner:
|
||||
```
|
||||
aurman -Ss <package-name>
|
||||
|
||||
```
|
||||
|
||||
Installing an application using aurman:
|
||||
```
|
||||
aurman -S <package-name>
|
||||
|
||||
```
|
||||
|
||||
#### 2\. yay
|
||||
|
||||
[yay][10] is the next best AUR helper written in Go with the objective of providing an interface of pacman with minimal user input, yaourt like search and with almost no dependencies.
|
||||
|
||||
##### Features of yay
|
||||
|
||||
* yay provides AUR table completion and download the PKGBUILD from ABS or AUR.
|
||||
* Supports search narrowing and no sourcing of PKGBUILD.
|
||||
* The binary has no additional dependencies than pacman.
|
||||
* Provides advanced dependency solver and remove make dependencies at the end of the build process.
|
||||
* Supports colored output when you enable Color option in the /etc/pacman.conf file.
|
||||
* It can be made to support only AUR package or only repo packages.
|
||||
|
||||
|
||||
|
||||
##### Installing yay
|
||||
|
||||
You can install yay by cloning the git repo and building it. Use the below command to install yay in Arch Linux :
|
||||
```
|
||||
git clone https://aur.archlinux.org/yay.git
|
||||
cd yay
|
||||
makepkg -si
|
||||
|
||||
```
|
||||
|
||||
##### Using yay
|
||||
|
||||
Searching an application through Yay in AUR:
|
||||
```
|
||||
yay -Ss <package-name>
|
||||
|
||||
```
|
||||
|
||||
Installing an application:
|
||||
```
|
||||
yay -S <package-name>
|
||||
|
||||
```
|
||||
|
||||
#### 3\. pakku
|
||||
|
||||
[Pakku][11] is another pacman wrapper which is still in its initial stage. However, just because its new doesn’t mean its lacking any of the features supported by other AUR helper. It does its job pretty nice and along with searching and installing applications from AUR, it removes dependencies after a build.
|
||||
|
||||
##### Features of pakku
|
||||
|
||||
* Searching and installing packages from Arch User Repository.
|
||||
* Viewing files and changes between builds.
|
||||
* Building packages from official repositories and removing make dependencies after a build.
|
||||
* PKGBUILD retrieving and Pacman integration.
|
||||
* Pacman-like user interface and pacman options supports.
|
||||
* Pacman configuration supports and no PKGBUILD sourcing.
|
||||
|
||||
|
||||
|
||||
##### Installing pakku
|
||||
```
|
||||
git clone https://aur.archlinux.org/pakku.git
|
||||
cd pakku
|
||||
makepkg -si
|
||||
|
||||
```
|
||||
|
||||
##### Using pakku
|
||||
|
||||
You can search an application from AUR using below command.:
|
||||
```
|
||||
pakku -Ss spotify
|
||||
|
||||
```
|
||||
|
||||
And then the package can be installed similar to pacman:
|
||||
```
|
||||
pakku -S spotify
|
||||
|
||||
```
|
||||
|
||||
#### 4\. aurutils
|
||||
|
||||
[aurutils][12] is basically a collection of scripts that automates the usage of Arch User Repository. It can search AUR, check updates for different applications installed and settle up dependencies issues.
|
||||
|
||||
##### Features of aurutils
|
||||
|
||||
* aurutils uses a local repository which gives it a benefit of pacman file support, and all packages works with –asdeps.
|
||||
* There can be multiple repos for different tasks.
|
||||
* Update local repository in one go with aursync -u
|
||||
* pkgbase, long format and raw support for aursearch
|
||||
* Ability to ignore package
|
||||
|
||||
|
||||
|
||||
##### Installing aurutils
|
||||
```
|
||||
git clone https://aur.archlinux.org/aurutils.git
|
||||
cd aurutils
|
||||
makepkg -si
|
||||
|
||||
```
|
||||
|
||||
##### Using aurutils
|
||||
|
||||
Searching an application via aurutils:
|
||||
```
|
||||
aurutils -Ss <package-name>
|
||||
|
||||
```
|
||||
|
||||
Installing a package from AUR:
|
||||
```
|
||||
aurutils -S <package-name>
|
||||
|
||||
```
|
||||
|
||||
All of these packages can directly be installed if you are already using Yaourt or any other AUR helper.
|
||||
|
||||
#### Final Words on AUR helpers
|
||||
|
||||
Arch Linux has some [more AUR helper][4] that can automate certain tasks for the Arch User Repository. Many users are still using Yaourt for their AUR-work and
|
||||
|
||||
The choice differs for each user and we would like to know which one you use for your Arch Linux. Let us know in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/best-aur-helpers/
|
||||
|
||||
作者:[Ambarish Kumar][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://itsfoss.com/author/ambarish/
|
||||
[1]:https://wiki.archlinux.org/index.php/Arch_User_Repository
|
||||
[2]:https://www.archlinux.org/
|
||||
[3]:https://wiki.archlinux.org/index.php/pacman
|
||||
[4]:https://wiki.archlinux.org/index.php/AUR_helpers
|
||||
[5]:https://wiki.archlinux.org/index.php/AUR_helpers#Comparison_table
|
||||
[6]:https://www.reddit.com/r/archlinux/comments/4azqyb/whats_so_bad_with_yaourt/
|
||||
[7]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/06/no-yaourt-arch-800x450.jpeg
|
||||
[8]:https://github.com/polygamma/aurman
|
||||
[9]:https://github.com/polygamma/aurman/wiki/Using-aurman-as-dependency-solver
|
||||
[10]:https://github.com/Jguer/yay
|
||||
[11]:https://github.com/kitsunyan/pakku
|
||||
[12]:https://github.com/AladW/aurutils
|
@ -0,0 +1,499 @@
|
||||
50 Best Ubuntu Apps You Should Be Using Right Now
|
||||
======
|
||||
**Brief: A comprehensive list of best Ubuntu apps for all kind of users. These software will help you in getting a better experience with your Linux desktop.**
|
||||
|
||||
I have written about [things to do after installing Ubuntu][1] several times in the past. Each time I suggest installing the essential applications in Ubuntu.
|
||||
|
||||
But the question arises, what are the essential Ubuntu applications? There is no set answer here. It depends on your need and the kind of work you do on your Ubuntu desktop.
|
||||
|
||||
Still, I have been asked to suggest some good Ubuntu apps by a number of readers. This is the reason I have created this comprehensive list of Ubuntu applications you can use regularly.
|
||||
|
||||
The list has been divided into respective categories for ease of reading and ease of comprehension.
|
||||
|
||||
### Best Ubuntu apps for a better Ubuntu experience
|
||||
|
||||
![Best Ubuntu Apps][2]
|
||||
|
||||
Of course, you don’t have to use all of these applications. Just go through this list of essential Ubuntu software, read the description and then install the ones you need or are inclined to use. Just keep this page bookmarked for future reference or simply search on Google with term ‘best ubuntu apps itsfoss’.
|
||||
|
||||
The best Ubuntu application list is intended for average Ubuntu user. Therefore not all the applications here are open source. I have also marked the slightly complicated applications that might not be suitable for a beginner. The list should be valid for Ubuntu 16.04,18.04 and other versions.
|
||||
|
||||
Unless exclusively mentioned, the software listed here are available in Ubuntu Software Center.
|
||||
|
||||
If you don’t find any application in the software center or if it is missing installation instruction, let me know and I’ll add the installation procedure.
|
||||
|
||||
Enough talk! Let’s see what are the best apps for Ubuntu.
|
||||
|
||||
#### Web Browser
|
||||
|
||||
Ubuntu comes with Firefox as the default web browser. Since the Quantum release, Firefox has improved drastically. Personally, I always use more than one web browser for the sake of distinguishing between different type of works.
|
||||
|
||||
##### Google Chrome
|
||||
|
||||
![Google Chrome Logo][3]
|
||||
|
||||
Google Chrome is the most used web browser on the internet for a reason. With your Google account, it allows you seamless syncing across devices. Plenty of extensions and apps further enhance its capabilities. You can [download Chrome in Ubuntu from its website][4].
|
||||
|
||||
##### Brave
|
||||
|
||||
![brave browser][5]
|
||||
|
||||
Google Chrome might be the most used web browser but it’s a privacy invader. An [alternative browser][6] is [Brave][7] that blocks ads and tracking scripts by default. This provides you with a faster and secure web browsing experience.
|
||||
|
||||
#### Music applications
|
||||
|
||||
![best music apps ubuntu][8]
|
||||
|
||||
Ubuntu has Rhythmbox as the default music player which is not at all a bad choice for the default music player. However, you can definitely install a better music player.
|
||||
|
||||
##### Sayonara
|
||||
|
||||
[Sayonara][9] is a small, lightweight music player with a nice dark user interface. It comes with all the essential features you would expect in a standard music player. It integrates well with the Ubuntu desktop environment and doesn’t eat up your RAM.
|
||||
|
||||
##### Audacity
|
||||
|
||||
[Audacity][10] is more of an audio editor than an audio player. You can record and edit audio with this free and open source tool. It is available for Linux, Windows and macOS. You can install it from the Software Center.
|
||||
|
||||
##### MusicBrainz Picard
|
||||
|
||||
[Picard][11] is not a music player, it is a music tagger. If you have tons of local music files, Picard allows you to automatically update the music files with correct tracks, album, artist info and album cover art.
|
||||
|
||||
#### Streaming Music Applications
|
||||
|
||||
![Streaming Music app Ubuntu][12]
|
||||
|
||||
In this age of the internet, music listening habit has surely changed. People these days rely more on streaming music players rather than storing hundreds of local music files. Let’s see some apps you can use for streaming music.
|
||||
|
||||
##### Spotify
|
||||
|
||||
[Spotify][13] is the king of streaming music. And the good thing is that it has a native Linux app. The [Spotify app on Ubuntu][14] integrates well with the media key and sound menu along with the desktop notification. Do note that Spotify may or may not be available in your country.
|
||||
|
||||
##### Nuvola music player
|
||||
|
||||
[Nuvola][15] is not a streaming music service like Spotify. It is a desktop music player that allows you to use several streaming music services in one application. You can use Spotify, Deezer, Google Play Music, Amazon Cloud Player and many more such services.
|
||||
|
||||
#### Video Players
|
||||
|
||||
![Video players for Linux][16]
|
||||
|
||||
Ubuntu has the default GNOME video player (previously known as Totem) which is okay but it doesn’t support various media codecs. There are certainly other video players better than the GNOME video player.
|
||||
|
||||
##### VLC
|
||||
|
||||
The free and open source software [VLC][17] is the king of video players. It supports almost all possible media codecs. It also allows you to increase the volume up to 200%. It can also resume playing from the last known position. There are so many [VLC tricks][18] you can use to get the most of it.
|
||||
|
||||
##### MPV
|
||||
|
||||
[MPV][19] is a video player that deserves more attention. A sleek minimalist GUI and plenty of features, MPV has everything you would expect from a good video player. You can even use it in the command line. If you are not happy with VLC, you should surely give MPV a try.
|
||||
|
||||
#### Cloud Storage Service
|
||||
|
||||
Local backups are fine but cloud storage gives an additional degree of freedom. You don’t have to carry a USB key with you all the time or worry about a hard disk crash with cloud services.
|
||||
|
||||
##### Dropbox
|
||||
|
||||
![Dropbox logo][20]
|
||||
|
||||
[Dropbox][21] is one of the most popular Cloud service providers. You get 2GB of free storage with the option to get more by referring others. Dropbox provides a native Linux client and you can download it from its website. It creates a local folder on your system that is synced with the cloud servers.
|
||||
|
||||
##### pCloud
|
||||
|
||||
![pCloud icon][22]
|
||||
|
||||
[pCloud][23] is another good cloud storage service for Linux. It also has a native Linux client that you can download from its website. You get up to 20GB of free storage and if you need more, the pricing is better than Dropbox. pCloud is based in Switzerland, a country renowned for strict data privacy laws.
|
||||
|
||||
#### Image Editors
|
||||
|
||||
I am sure that you would need a photo editor at some point in time. Here are some of the best Ubuntu apps for editing images.
|
||||
|
||||
##### GIMP
|
||||
|
||||
![gimp icon][24]
|
||||
|
||||
[GIMP][25] is a free and open source image editor available for Linux, Windows and macOS. It’s the best alternative for Adobe Photoshop in Linux. You can use it for all kind of image editing. There are plenty of resources available on the internet to help you with Gimp.
|
||||
|
||||
##### Inkscape
|
||||
|
||||
![inkscape icon][26]
|
||||
|
||||
[Inkscape][27] is also a free and open source image editor specifically focusing on vector graphics. You can design vector arts and logo on it. You can compare it to Adobe Illustrator. Like Gimp, Inkscape too has plenty of tutorials available online.
|
||||
|
||||
#### Paint applications
|
||||
|
||||
Painting applications are not the same as image editors though their functionalities overlap at times. Here are some paint apps you can use in Ubuntu.
|
||||
![Painting apps for Ubuntu Linux][28]
|
||||
|
||||
##### Krita
|
||||
|
||||
[Krita][29] is a free and open source digital painting application. You can create digital art, comics and animation with it. It’s a professional grade software and is even used as the primary software in art schools.
|
||||
|
||||
##### Pinta
|
||||
|
||||
[Pinta][30] might not be as feature rich as Krita but that’s deliberate. You can think of Pinta as Microsoft Paint for Linux. You can draw, paint, add text and do other such small tasks you do in a paint application.
|
||||
|
||||
#### Photography applications
|
||||
|
||||
Amateur photographer or a professional? You have plenty of [photography tools][31] at your disposal. Here are some recommended applications.
|
||||
|
||||
##### digiKam
|
||||
|
||||
![digikam][32]
|
||||
|
||||
With open source software [digiKam][33], you can handle your high-end camera images in a professional manner. digiKam provides all the tools required for viewing, managing, editing, enhancing, organizing, tagging and sharing photographs.
|
||||
|
||||
##### Darktable
|
||||
|
||||
![Darktable icon][34]
|
||||
|
||||
[darktable][35] is an open source photography workflow application with a special focus on raw image development. This is the best alternative you can get for Adobe Lightroom. It is also available for Windows and macOS.
|
||||
|
||||
#### Video editors
|
||||
|
||||
![Video editors Ubuntu][36]
|
||||
|
||||
There is no dearth of [video editors for Linux][37] but I won’t go in detail here. Take a look at some of the feature-rich yet relatively simple to use video editors for Ubuntu.
|
||||
|
||||
##### Kdenlive
|
||||
|
||||
[Kdenlive][38] is the best all-purpose video editor for Linux. It has enough features that compare it to iMovie or Movie Maker.
|
||||
|
||||
##### Shotcut
|
||||
|
||||
[Shotcut][39] is another good choice for a video editor. It is an open source software with all the features you can expect in a standard video editor.
|
||||
|
||||
#### Image and video converter
|
||||
|
||||
If you need to [convert the file format][40] of your images and videos, here are some of my recommendations.
|
||||
|
||||
##### Xnconvert
|
||||
|
||||
![xnconvert logo][41]
|
||||
|
||||
[Xnconvert][42] is an excellent batch image conversion tool. You can bulk resize images, convert the file type and rename them.
|
||||
|
||||
##### Handbrake
|
||||
|
||||
![Handbrake Logo][43]
|
||||
|
||||
[HandBrake][44] is an easy to use open source tool for converting videos from a number of formats to a few modern, popular formats.
|
||||
|
||||
#### Screenshot and screen recording tools
|
||||
|
||||
![Screenshot and recorders Ubuntu][45]
|
||||
|
||||
Here are the best Ubuntu apps for taking screenshots and recording your screen.
|
||||
|
||||
##### Shutter
|
||||
|
||||
[Shutter][46] is my go-to tool for taking screenshots. You can also do some quick editing to those screenshots such as adding arrows, text or resizing the images. The screenshots you see on It’s FOSS have been edited with Shutter. Definitely one of the best apps for Ubuntu.
|
||||
|
||||
##### Kazam
|
||||
|
||||
[Kazam][47] is my favorite [screen recorder for Linux][48]. It’s a tiny tool that allows you to record the entire window, an application window or a selected area. You can also use shortcuts to pause or resume recording. The tutorials on [It’s FOSS YouTube channel][49] have been recorded with Kazam.
|
||||
|
||||
#### Office suites
|
||||
|
||||
I cannot imagine that you could use a computer without a document editor. And why restrict yourself to just one document editor? Go for a complete office suite.
|
||||
|
||||
##### LibreOffice
|
||||
|
||||
![LibreOffice logo][50]
|
||||
|
||||
[LibreOffice][51] comes preinstalled on Ubuntu and it is undoubtedly the [best open source office software][52]. It’s a complete package comprising of a document editor, spreadsheet tool, presentation software, maths tool and a graphics tool. You can even edit some PDF files with LibreOffice.
|
||||
|
||||
##### WPS Office
|
||||
|
||||
![WPS Office logo][53]
|
||||
|
||||
[WPS Office][54] has gained popularity for being a Microsoft Office clone. It has an interface identical to Microsoft Office and it claims to be more compatible with MS Office. If you are looking for something similar to the Microsoft Office, WPS Office is a good choice.
|
||||
|
||||
#### Downloading tools
|
||||
|
||||
![Downloading software Ubuntu][55]
|
||||
|
||||
If you often download videos or other big files from the internet, these tools will help you.
|
||||
|
||||
##### youtube-dl
|
||||
|
||||
This is one of the rare Ubuntu application on the list that is command line based. If you want to download videos from YouTube, DailyMotion or other video websites, youtube-dl is an excellent choice. It provides plenty of [advanced option for video downloading][56].
|
||||
|
||||
##### uGet
|
||||
|
||||
[uGet][57] is a feature rich [download manager for Linux][58]. It allows you to pause and resume your downloads, schedule your downloads, monitor clipboard for downloadable content. A perfect tool if you have a slow, inconsistent internet or daily data limit.
|
||||
|
||||
#### Code Editors
|
||||
|
||||
![Coding apps for Ubuntu][59]
|
||||
|
||||
If you are into programming, the default Gedit text editor might not be sufficient for your coding needs. Here are some of the better code editors for you.
|
||||
|
||||
##### Atom
|
||||
|
||||
[Atom][60] is a free and [open source code editor][61] from GitHub. Even before it was launched its first stable version, it became a hot favorite among coders for its UI, features and vast range of plugins.
|
||||
|
||||
##### Visual Studio Code
|
||||
|
||||
[VS Code][62] is an open source code editor from Microsoft. Don’t worry about Microsoft, VS Code is an awesome editor for web development. It also supports a number of other programming languages.
|
||||
|
||||
#### PDF and eBooks related applications
|
||||
|
||||
![eBook Management tools in Ubuntu][63]
|
||||
|
||||
In this digital age, you cannot only rely on the real paper books especially when there are plenty of free eBooks available. Here are some Ubuntu apps for managing PDFs and eBooks.
|
||||
|
||||
##### Calibre
|
||||
|
||||
If you are a bibliophile and collect eBooks, you should use [Calibre][64]. It is an eBook manager with all the necessary software for [creating eBooks][65], converting eBook formats and managing an eBook library.
|
||||
|
||||
##### Okular
|
||||
|
||||
Okular is mostly a PDF viewer with options for editing PDF files. You can do some basic [PDF editing on Linux][66] with Okular such as adding pop-ups notes, inline notes, freehand line drawing, highlighter, stamp etc.
|
||||
|
||||
#### Messaging applications
|
||||
|
||||
![Messaging apps for Ubuntu][67]
|
||||
|
||||
I believe you use at least one [messaging app on Linux][68]. Here are my recommendations.
|
||||
|
||||
##### Skype
|
||||
|
||||
[Skype][69] is the most popular video chatting application. It is also used by many companies and businesses for interviews and meetings. This makes Skype one of the must-have applications for Ubuntu.
|
||||
|
||||
##### Rambox
|
||||
|
||||
[Rambox][70] is not a messaging application on its own. But it allows you to use Skype, Viber, Facebook Messanger, WhatsApp, Slack and a number of other messaging applications from a single application window.
|
||||
|
||||
#### Notes and To-do List applications
|
||||
|
||||
Need a to-do list app or simple an app for taking notes? Have a look at these:
|
||||
|
||||
##### Simplenote
|
||||
|
||||
![Simplenote logo][71]
|
||||
|
||||
[Simplenote][72] is a free and open source note taking application from WordPress creators [Automattic][73]. It is available for Windows, Linux, macOS, iOS and Android. Your notes are synced to a cloud server and you can access them on any device. You can download the DEB file from its website.
|
||||
|
||||
##### Remember The Milk
|
||||
|
||||
![Remember The Milk logo][74]
|
||||
|
||||
[Remember The Milk][75] is a popular to-do list application. It is available for Windows, Linux, macOS, iOS and Android. Your to-do list is accessible on all the devices you own. You can also access it from a web browser. It also has an official native application for Linux that you can download from its website.
|
||||
|
||||
#### Password protection and encryption
|
||||
|
||||
![Encryption software Ubuntu][76]
|
||||
|
||||
If there are other people regularly using your computer perhaps you would like to add an extra layer of security by password protecting files and folders.
|
||||
|
||||
##### EncryptPad
|
||||
|
||||
[EncryptPad][77] is an open source text editor that allows you to lock your files with a password. You can choose the type of encryption. There is also a command line version of this tool.
|
||||
|
||||
##### Gnome Encfs Manager
|
||||
|
||||
Gnome Encfs Manager allows you to [lock folders with a password in Linux][78]. You can keep whatever files you want in a secret folder and then lock it with a password.
|
||||
|
||||
#### Gaming
|
||||
|
||||
![Gaming on Ubuntu][79]
|
||||
|
||||
[Gaming on Linux][80] is a lot better than what it used to be a few years ago. You can enjoy plenty of games on Linux without going back to Windows.
|
||||
|
||||
##### Steam
|
||||
|
||||
[Steam][81] is a digital distribution platform that allows you to purchase (if required) games. Steam has over 1500 [games for Linux][82]. You can download the Steam client from the Software Center.
|
||||
|
||||
##### PlayOnLinux
|
||||
|
||||
[PlayOnLinux][83] allows you to run Windows games on Linux over WINE compatibility layer. Don’t expect too much out of it because not every game will run flawlessly with PlayOnLinux.
|
||||
|
||||
#### Package Managers [Intermediate to advanced users]
|
||||
|
||||
![Package Management tools Ubuntu][84]
|
||||
|
||||
Ubuntu Software Center is more than enough for an average Ubuntu user’s software needs but you can have more control on it using these applications.
|
||||
|
||||
##### Gdebi
|
||||
|
||||
Gedbi is a tiny packagae manager that you can use for installing DEB files. It is faster than the Software Center and it also handles dependency issues.
|
||||
|
||||
##### Synaptic
|
||||
|
||||
Synaptic was the default GUI package manager for most Linux distributions a decade ago. It still is in some Linux distributions. This powerful package manager is particularly helpful in [finding installed applications and removing them][85].
|
||||
|
||||
#### Backup and Recovery tools
|
||||
|
||||
![Backup and data recovery tools for Ubuntu][86]
|
||||
|
||||
Backup and recovery tools are must-have software for any system. Let’s see what softwares you must have on Ubuntu.
|
||||
|
||||
##### Timeshift
|
||||
|
||||
Timeshift is a tool that allows you to [take a snapshot of your system][87]. This allows you to restore your system to a previous state in case of an unfortunate incident when your system configuration is messed up. Note that it’s not the best tool for your personal data backup though. For that, you can use Ubuntu’s default Deja Dup (also known as Backups) tool.
|
||||
|
||||
##### TestDisk [Intermediate Users]
|
||||
|
||||
This is another command line tool on this list of best Ubuntu application. [TestDisk][88] allows you to [recover data on Linux][89]. If you accidentally deleted files, there are still chances that you can get it back using TestDisk.
|
||||
|
||||
#### System Tweaking and Management Tools
|
||||
|
||||
![System Maintenance apps Ubuntu][90]
|
||||
|
||||
##### GNOME/Unity Tweak Tool
|
||||
|
||||
These Tweak tools are a must for every Ubuntu user. They allow you to access some advanced system settings. Best of all, you can [change themes in Ubuntu][91] using these tweak tools.
|
||||
|
||||
##### UFW Firewall
|
||||
|
||||
[UFW][92] stands for Uncomplicated Firewall and rightly so. UFW has predefined firewall settings for Home, Work and Public networks.
|
||||
|
||||
##### Stacer
|
||||
|
||||
If you want to free up space on Ubuntu, try Stacer. This graphical tool allows you to [optimize your Ubuntu system][93] by removing unnecessary files and completely uninstalling software. Download Stacer from [its website][94].
|
||||
|
||||
#### Other Utilities
|
||||
|
||||
![Utilities Ubuntu][95]
|
||||
|
||||
In the end, I’ll list some of my other favorite Ubuntu apps that I could not put into a certain category.
|
||||
|
||||
##### Neofetch
|
||||
|
||||
One more command line tool! Neofetch displays your system information such as [Ubuntu version][96], desktop environment, theme, icons, RAM etc info along with [ASCII logo of the distribution][97]. Use this command for installing Neofetch.
|
||||
```
|
||||
sudo apt install neofetch
|
||||
|
||||
```
|
||||
|
||||
##### Etcher
|
||||
|
||||
Ubuntu has a live USB creator tool installed already but Etcher is a better application for this task. It is also available for Windows and macOS. You can download it [from its website][98].
|
||||
|
||||
##### gscan2pdf
|
||||
|
||||
I use this tiny tool for the sole purpose of [converting images into PDF][99]. You can use it for combining multiple images into one PDF file as well.
|
||||
|
||||
##### Audio Recorder
|
||||
|
||||
Another tiny yet essential Ubuntu application for [recording audio on Ubuntu][100]. You can use it to record sound from system microphone, from music player or from any other source.
|
||||
|
||||
### Your suggestions for essential Ubuntu applications?
|
||||
|
||||
I would like to conclude my list of best Ubuntu apps here. I know that you might not need or use all of them but I am certain that you would like most of the software listed here.
|
||||
|
||||
Did you find some useful applications that you didn’t know about before? If you would have to suggest your favorite Ubuntu application, which one would it be?
|
||||
|
||||
In the end, if you find this article useful, please share it on social media, Reddit, Hacker News or other community or forums you visit regularly. This way you help us grow :)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/best-ubuntu-apps/
|
||||
|
||||
作者:[Abhishek Prakash][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/abhishek/
|
||||
[1]:https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/
|
||||
[2]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/best-ubuntu-apps-featured.jpeg
|
||||
[3]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/google-chrome.jpeg
|
||||
[4]:https://www.google.com/chrome/
|
||||
[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/brave-browser-icon.jpeg
|
||||
[6]:https://itsfoss.com/open-source-browsers-linux/
|
||||
[7]:https://brave.com/
|
||||
[8]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/music-apps-ubuntu.jpeg
|
||||
[9]:https://itsfoss.com/sayonara-music-player/
|
||||
[10]:https://www.audacityteam.org/
|
||||
[11]:https://itsfoss.com/musicbrainz-picard/
|
||||
[12]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/streaming-music-apps-ubuntu.jpeg
|
||||
[13]:https://www.spotify.com//
|
||||
[14]:https://itsfoss.com/install-spotify-ubuntu-1404/
|
||||
[15]:https://tiliado.eu/nuvolaplayer/
|
||||
[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/Video-Players-linux.jpg
|
||||
[17]:https://www.videolan.org/index.html
|
||||
[18]:https://itsfoss.com/vlc-pro-tricks-linux/
|
||||
[19]:https://mpv.io/
|
||||
[20]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/dropbox-icon.jpeg
|
||||
[21]:https://www.dropbox.com/
|
||||
[22]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/pcloud-icon.jpeg
|
||||
[23]:https://itsfoss.com/recommends/pcloud/
|
||||
[24]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/gimp-icon.jpeg
|
||||
[25]:https://www.gimp.org/
|
||||
[26]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/inkscape-icon.jpeg
|
||||
[27]:https://inkscape.org/en/
|
||||
[28]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/paint-apps-ubuntu.jpeg
|
||||
[29]:https://krita.org/en/
|
||||
[30]:https://pinta-project.com/pintaproject/pinta/
|
||||
[31]:https://itsfoss.com/image-applications-ubuntu-linux/
|
||||
[32]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/digikam-icon.jpeg
|
||||
[33]:https://www.digikam.org/
|
||||
[34]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/darktable-icon.jpeg
|
||||
[35]:https://www.darktable.org/
|
||||
[36]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/video-editing-apps-ubuntu.jpeg
|
||||
[37]:https://itsfoss.com/best-video-editing-software-linux/
|
||||
[38]:https://kdenlive.org/en/
|
||||
[39]:https://shotcut.org/
|
||||
[40]:https://itsfoss.com/format-factory-alternative-linux/
|
||||
[41]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/xnconvert-logo.jpeg
|
||||
[42]:https://www.xnview.com/en/xnconvert/
|
||||
[43]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/handbrake-logo.jpeg
|
||||
[44]:https://handbrake.fr/
|
||||
[45]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/screen-recording-ubuntu-apps.jpeg
|
||||
[46]:http://shutter-project.org/
|
||||
[47]:https://launchpad.net/kazam
|
||||
[48]:https://itsfoss.com/best-linux-screen-recorders/
|
||||
[49]:https://www.youtube.com/c/itsfoss?sub_confirmation=1
|
||||
[50]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/libre-office-logo.jpeg
|
||||
[51]:https://www.libreoffice.org/download/download/
|
||||
[52]:https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/
|
||||
[53]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/wps-office-logo.jpeg
|
||||
[54]:http://wps-community.org/
|
||||
[55]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/download-apps-ubuntu.jpeg
|
||||
[56]:https://itsfoss.com/download-youtube-linux/
|
||||
[57]:http://ugetdm.com/
|
||||
[58]:https://itsfoss.com/4-best-download-managers-for-linux/
|
||||
[59]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/coding-apps-ubuntu.jpeg
|
||||
[60]:https://atom.io/
|
||||
[61]:https://itsfoss.com/best-modern-open-source-code-editors-for-linux/
|
||||
[62]:https://itsfoss.com/install-visual-studio-code-ubuntu/
|
||||
[63]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/pdf-management-apps-ubuntu.jpeg
|
||||
[64]:https://calibre-ebook.com/
|
||||
[65]:https://itsfoss.com/create-ebook-calibre-linux/
|
||||
[66]:https://itsfoss.com/pdf-editors-linux/
|
||||
[67]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/messaging-apps-ubuntu.jpeg
|
||||
[68]:https://itsfoss.com/best-messaging-apps-linux/
|
||||
[69]:https://www.skype.com/en/
|
||||
[70]:https://rambox.pro/
|
||||
[71]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/simplenote-logo.jpeg
|
||||
[72]:http://simplenote.com/
|
||||
[73]:https://automattic.com/
|
||||
[74]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/remember-the-milk-logo.jpeg
|
||||
[75]:https://itsfoss.com/remember-the-milk-linux/
|
||||
[76]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/encryption-apps-ubuntu.jpeg
|
||||
[77]:https://itsfoss.com/encryptpad-encrypted-text-editor-linux/
|
||||
[78]:https://itsfoss.com/password-protect-folder-linux/
|
||||
[79]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/gaming-ubuntu.jpeg
|
||||
[80]:https://itsfoss.com/linux-gaming-guide/
|
||||
[81]:https://store.steampowered.com/
|
||||
[82]:https://itsfoss.com/free-linux-games/
|
||||
[83]:https://www.playonlinux.com/en/
|
||||
[84]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/package-management-apps-ubuntu.jpeg
|
||||
[85]:https://itsfoss.com/how-to-add-remove-programs-in-ubuntu/
|
||||
[86]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/backup-recovery-tools-ubuntu.jpeg
|
||||
[87]:https://itsfoss.com/backup-restore-linux-timeshift/
|
||||
[88]:https://www.cgsecurity.org/wiki/TestDisk
|
||||
[89]:https://itsfoss.com/recover-deleted-files-linux/
|
||||
[90]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/system-maintenance-apps-ubuntu.jpeg
|
||||
[91]:https://itsfoss.com/install-themes-ubuntu/
|
||||
[92]:https://wiki.ubuntu.com/UncomplicatedFirewall
|
||||
[93]:https://itsfoss.com/optimize-ubuntu-stacer/
|
||||
[94]:https://github.com/oguzhaninan/Stacer
|
||||
[95]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/07/utilities-apps-ubuntu.jpeg
|
||||
[96]:https://itsfoss.com/how-to-know-ubuntu-unity-version/
|
||||
[97]:https://itsfoss.com/display-linux-logo-in-ascii/
|
||||
[98]:https://etcher.io/
|
||||
[99]:https://itsfoss.com/convert-multiple-images-pdf-ubuntu-1304/
|
||||
[100]:https://itsfoss.com/record-streaming-audio/
|
@ -1,77 +0,0 @@
|
||||
translating---geekpi
|
||||
|
||||
Learn Python programming the easy way with EduBlocks
|
||||
======
|
||||
|
||||

|
||||
|
||||
If you are you looking for a way to move your students (or yourself) from programming in [Scratch][1] to learning [Python][2], I recommend you look into [EduBlocks][3]. It brings a familiar drag-and-drop graphical user interface (GUI) to Python 3 programming.
|
||||
|
||||
One of the barriers when transitioning from Scratch to Python is the absence of the drag-and-drop GUI that has made Scratch the go-to application in K-12 schools. EduBlocks' drag-and-drop version of Python 3 changes that paradigm. It aims to "help teachers to introduce text-based programming languages, like Python, to children at an earlier age."
|
||||
|
||||
The hardware requirements for EduBlocks are quite modest—a Raspberry Pi and an internet connection—and should be available in many classrooms.
|
||||
|
||||
EduBlocks was developed by Joshua Lowe, a 14-year-old Python developer from the United Kingdom. I saw Joshua demonstrate his project at [PyCon 2018][4] in May 2018.
|
||||
|
||||
### Getting started
|
||||
|
||||
It's easy to install EduBlocks. The website provides clear installation instructions, and you can find detailed screenshots in the project's [GitHub][5] repository.
|
||||
|
||||
Install EduBlocks from the Raspberry Pi command line by issuing the following command:
|
||||
```
|
||||
curl -sSL get.edublocks.org | bash
|
||||
|
||||
```
|
||||
|
||||
### Programming EduBlocks
|
||||
|
||||
Once the installation is complete, launch EduBlocks from either the desktop shortcut or the Programming menu on the Raspberry Pi.
|
||||
|
||||

|
||||
|
||||
Once you launch the application, you can start creating Python 3 code with EduBlocks' drag-and-drop interface. Its menus are clearly labeled. You can start with sample code by clicking the **Samples** menu button. You can also choose a different color scheme for your programming palette by clicking **Theme**. With the **Save** menu, you can save your code as you work, then **Download** your Python code. Click **Run** to execute and test your code.
|
||||
|
||||
You can see your code by clicking the **Blockly** button at the far right. It allows you to toggle between the "Blockly" interface and the normal Python code view (as you would see in any other Python editor).
|
||||
|
||||

|
||||
|
||||
EduBlocks comes with a range of code libraries, including [EduPython][6], [Minecraft][7], [Sonic Pi][8], [GPIO Zero][9], and [Sense Hat][10].
|
||||
|
||||
### Learning and support
|
||||
|
||||
The project maintains a [learning portal][11] with tutorials and other resources for easily [hacking][12] the version of Minecraft that comes with Raspberry Pi, programming the GPIOZero and Sonic Pi, and controlling LEDs with the Micro:bit code editor. Support for EduBlocks is available on Twitter [@edu_blocks][13] and [@all_about_code][14] and through [email][15].
|
||||
|
||||
For a deeper dive, you can access EduBlocks' source code on [GitHub][16]; the application is [licensed][17] under GNU Affero General Public License v3.0. EduBlocks' creators (project lead [Joshua Lowe][18] and fellow developers [Chris Dell][19] and [Les Pounder][20]) want it to be a community project and invite people to open issues, provide feedback, and submit pull requests to add features or fixes to the project.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/8/edublocks
|
||||
|
||||
作者:[Don Watkins][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/don-watkins
|
||||
[1]:https://scratch.mit.edu/
|
||||
[2]:https://www.python.org/
|
||||
[3]:https://edublocks.org/
|
||||
[4]:https://us.pycon.org/2018/about/
|
||||
[5]:https://github.com/AllAboutCode/EduBlocks
|
||||
[6]:https://edupython.tuxfamily.org/
|
||||
[7]:https://minecraft.net/en-us/edition/pi/
|
||||
[8]:https://sonic-pi.net/
|
||||
[9]:https://gpiozero.readthedocs.io/en/stable/
|
||||
[10]:https://www.raspberrypi.org/products/sense-hat/
|
||||
[11]:https://edublocks.org/learn.html
|
||||
[12]:https://edublocks.org/resources/1.pdf
|
||||
[13]:https://twitter.com/edu_blocks?lang=en
|
||||
[14]:https://twitter.com/all_about_code
|
||||
[15]:mailto:support@edublocks.org
|
||||
[16]:https://github.com/allaboutcode/edublocks
|
||||
[17]:https://github.com/AllAboutCode/EduBlocks/blob/tarball-install/LICENSE
|
||||
[18]:https://github.com/JoshuaLowe1002
|
||||
[19]:https://twitter.com/cjdell?lang=en
|
||||
[20]:https://twitter.com/biglesp?lang=en
|
@ -1,3 +1,5 @@
|
||||
translating by pityonline
|
||||
|
||||
What is CI/CD?
|
||||
======
|
||||
|
||||
|
@ -0,0 +1,77 @@
|
||||
6 Reasons Why Linux Users Switch to BSD
|
||||
======
|
||||
Thus far I have written several articles about [BSD][1] for It’s FOSS. There is always at least one person in the comments asking “Why bother with BSD?” I figure that the best way to respond was to write an article on the topic.
|
||||
|
||||
### Why use BSD over Linux?
|
||||
|
||||
In preparation for this article, I chatted with several BSD users, some of whom moved to BSD after using Linux for years. The points in this article are based on the opinions of real BSD users. This article hopes to offer a different viewpoint.
|
||||
|
||||
![why use bsd over linux][2]
|
||||
|
||||
#### 1\. BSD is More than Just a Kernel
|
||||
|
||||
Several people pointed out that BSD offers an operating system that is one big cohesive package to the end-user. They point out that the named “Linux” refers to just the kernel. A Linux distro consists of the aforementioned kernel and a number of different applications and packages selected by the creator of that distro. Sometimes installing new packages can cause incompatibility, which will lead to system crashes.
|
||||
|
||||
A typical BSD consists of a kernel and all of the packages that it needs to get things done. The majority of these packages are actively developed by the project. This leads to tighter integration and improved responsiveness.
|
||||
|
||||
#### 2\. Packages are More Trustworthy
|
||||
|
||||
Speaking of packages, another point that the BSD users raised was the trustworthiness of packages. In Linux, packages are available from a bunch of different sources, some provided by distro developers and others by third parties. [Ubuntu][3] and [other distros][4] have encountered issues with malware hidden in third-party apps.
|
||||
|
||||
In BSD, all packages are provided by “a centralized package/ports system with every package getting built as part of a single repository with security systems in place each step of the way”. This ensures that a hacker can’t sneak malicious software into a seemingly-safe application and lends to the long-term stability of BSD.
|
||||
|
||||
#### 3\. Slow Change = Better Long-Term Stability
|
||||
|
||||
If development was a race, Linux would be the rabbit and BSD the turtle. Even the slowest Linux distro releases a new version at least once a year (except Debian, of course). In the BSD world, major releases take longer. This means that there is more of a focus on getting things right then getting them pushed out to the user.
|
||||
|
||||
This also means that changes to the operating system happen over time. The Linux world has experienced several rapid and major changes that we still feel to this day (cough, [systemD][5], cough). Like with Debian, long development cycles help BSD to test new ideas to make sure they work properly before making them permanent. It also helps to produce code less likely to have issues.
|
||||
|
||||
#### 4\. Linux is Too Cluttered
|
||||
|
||||
None of the BSD users made this point outright, but it was suggested by many of their experiences. Many of them bounced from Linux distro to Linux distro in the quest to find one that worked for them. In many instances, they could not get all of their hardware or software to work correctly. Then, they decided to give BSD a try and everything just worked.
|
||||
|
||||
When it came to choosing which BSD they were going to use, the choice was fairly easy. There are only half a dozen BSDs that are being actively developed. Of those BSDs, each one has a specific purpose. “[OpenBSD][6] security, [FreeBSD][7] more desktop/server, [NetBSD][8] “run on anything and everything”, [DragonFlyBSD][9] scaling and performance.” Meanwhile, the Linux world is full of distros that just add a theme or icon pack to an existing distro. The smaller number of BSD projects means that there is less duplication of effort and more overall focus.
|
||||
|
||||
#### 5\. ZFS Support
|
||||
|
||||
One BSD user noted that one of the main reasons that he switched to BSD was [ZFS][10]. In fact almost all of the people I talked to mentioned ZFS support on BSD as the reason they did not return to Linux.
|
||||
|
||||
This is an area where Linux will lose out on for the time being. While [OpenZFS][11] is available on some Linux distros, ZFS is built into the BSD kernels. This alone means that ZFS will have better performance on BSD. While there have been several attempts to get ZFS into the Linux kernel, licensing issues will be solved first.
|
||||
|
||||
#### 6\. License
|
||||
|
||||
There was also a difference of opinion on licenses. The general idea held by many is the GPL is not truly free because it put limits on how you can make use of the software. Some also think that the GPL is “too large and difficult to interpret which can lead to legal problems down the road if a person is not careful when developing a product with this license”.
|
||||
|
||||
On the other hand, the BSD license only has three clauses and allows anyone to “take the software, make changes, and do whatever you want with it, but it also offers protection to the developer”.
|
||||
|
||||
#### Conclusion
|
||||
|
||||
These are just a few of the reason why people use BSD over Linux. If you want, you can read some of the other comments [here][12]. If you are a BSD user and feel I missed something important, please comment below.
|
||||
|
||||
If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][13].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/why-use-bsd/
|
||||
|
||||
作者:[John Paul][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://itsfoss.com/author/john/
|
||||
[1]:https://itsfoss.com/category/bsd/
|
||||
[2]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/why-BSD.png
|
||||
[3]:https://itsfoss.com/snapstore-cryptocurrency-saga/
|
||||
[4]:https://www.bleepingcomputer.com/news/security/malware-found-in-arch-linux-aur-package-repository/
|
||||
[5]:https://www.freedesktop.org/wiki/Software/systemd/
|
||||
[6]:https://www.openbsd.org/
|
||||
[7]:https://www.freebsd.org/
|
||||
[8]:http://netbsd.org/
|
||||
[9]:http://www.dragonflybsd.org/
|
||||
[10]:https://en.wikipedia.org/wiki/ZFS
|
||||
[11]:http://open-zfs.org/wiki/Main_Page
|
||||
[12]:https://discourse.trueos.org/t/why-do-you-guys-use-bsd/2601
|
||||
[13]:http://reddit.com/r/linuxusersgroup
|
142
sources/tech/20180810 How To Remove Or Disable Ubuntu Dock.md
Normal file
142
sources/tech/20180810 How To Remove Or Disable Ubuntu Dock.md
Normal file
@ -0,0 +1,142 @@
|
||||
How To Remove Or Disable Ubuntu Dock
|
||||
======
|
||||
|
||||

|
||||
|
||||
**If you want to replace the Ubuntu Dock in Ubuntu 18.04 with some other dock (like Plank dock for example) or panel, and you want to remove or disable the Ubuntu Dock, here's what you can do and how.**
|
||||
|
||||
Ubuntu Dock - the bar on the left-hand side of the screen which can be used to pin applications and access installed applications -
|
||||
|
||||
|
||||
### How to access the Activities Overview without Ubuntu Dock
|
||||
|
||||
Without Ubuntu Dock, you may have no way of accessing the Activities / installed application list (which can be accessed from Ubuntu Dock by clicking on Show Applications button at the bottom of the dock). For example if you want to use Plank dock.
|
||||
|
||||
Obviously, that's not the case if you install Dash to Panel extension to use it instead Ubuntu Dock, because Dash to Panel provides a button to access the Activities Overview / installed applications.
|
||||
|
||||
Depending on what you plan to use instead of Ubuntu Dock, if there's no way of accessing the Activities Overview, you can enable the Activities Overview Hot Corner option and simply move your mouse to the upper left corner of the screen to open the Activities. Another way of accessing the installed application list is using a keyboard shortcut: `Super + A` .
|
||||
|
||||
If you want to enable the Activities Overview hot corner, use this command:
|
||||
```
|
||||
gsettings set org.gnome.shell enable-hot-corners true
|
||||
|
||||
```
|
||||
|
||||
If later you want to undo this and disable the hot corners, you need to use this command:
|
||||
```
|
||||
gsettings set org.gnome.shell enable-hot-corners false
|
||||
|
||||
```
|
||||
|
||||
You can also enable or disable the Activities Overview Hot Corner option by using the Gnome Tweaks application (the option is in the `Top Bar` section of Gnome Tweaks), which can be installed by using this command:
|
||||
```
|
||||
sudo apt install gnome-tweaks
|
||||
|
||||
```
|
||||
|
||||
### How to remove or disable Ubuntu Dock
|
||||
|
||||
Below you'll find 4 ways of getting rid of Ubuntu Dock which work in Ubuntu 18.04.
|
||||
|
||||
**Option 1: Remove the Gnome Shell Ubuntu Dock package.**
|
||||
|
||||
The easiest way of getting rid of the Ubuntu Dock is to remove the package.
|
||||
|
||||
This completely removes the Ubuntu Dock extension from your system, but it also removes the `ubuntu-desktop` meta package. There's no immediate issue if you remove the `ubuntu-desktop` meta package because does nothing by itself. The `ubuntu-meta` package depends on a large number of packages which make up the Ubuntu Desktop. Its dependencies won't be removed and nothing will break. The issue is that if you want to upgrade to a newer Ubuntu version, any new `ubuntu-desktop` dependencies won't be installed.
|
||||
|
||||
As a way around this, you can simply install the `ubuntu-desktop` meta package before upgrading to a newer Ubuntu version (for example if you want to upgrade from Ubuntu 18.04 to 18.10).
|
||||
|
||||
If you're ok with this and want to remove the Ubuntu Dock extension package from your system, use the following command:
|
||||
```
|
||||
sudo apt remove gnome-shell-extension-ubuntu-dock
|
||||
|
||||
```
|
||||
|
||||
If later you want to undo the changes, simply install the extension back using this command:
|
||||
```
|
||||
sudo apt install gnome-shell-extension-ubuntu-dock
|
||||
|
||||
```
|
||||
|
||||
Or to install the `ubuntu-desktop` meta package back (this will install any ubuntu-desktop dependencies you may have removed, including Ubuntu Dock), you can use this command:
|
||||
```
|
||||
sudo apt install ubuntu-desktop
|
||||
|
||||
```
|
||||
|
||||
**Option 2: Install and use the vanilla Gnome session instead of the default Ubuntu session.**
|
||||
|
||||
Another way to get rid of Ubuntu Dock is to install and use the vanilla Gnome session. Installing the vanilla Gnome session will also install other packages this session depends on, like Gnome Documents, Maps, Music, Contacts, Photos, Tracker and more.
|
||||
|
||||
By installing the vanilla Gnome session, you'll also get the default Gnome GDM login / lock screen theme instead of the Ubuntu defaults as well as Adwaita Gtk theme and icons. You can easily change the Gtk and icon theme though, by using the Gnome Tweaks application.
|
||||
|
||||
Furthermore, the AppIndicators extension will be disabled by default (so applications that make use of the AppIndicators tray won't show up on the top panel), but you can enable this by using Gnome Tweaks (under Extensions, enable the Ubuntu appindicators extension).
|
||||
|
||||
In the same way, you can also enable or disable Ubuntu Dock from the vanilla Gnome session, which is not possible if you use the Ubuntu session (disabling Ubuntu Dock from Gnome Tweaks when using the Ubuntu session does nothing).
|
||||
|
||||
If you don't want to install these extra packages required by the vanilla Gnome session, this option of removing Ubuntu Dock is not for you so check out the other options.
|
||||
|
||||
If you are ok with this though, here's what you need to do. To install the vanilla Gnome session in Ubuntu, use this command:
|
||||
```
|
||||
sudo apt install vanilla-gnome-desktop
|
||||
|
||||
```
|
||||
|
||||
After the installation finishes, reboot your system and on the login screen, after you click on your username, click the gear icon next to the `Sign in` button, and select `GNOME` instead of `Ubuntu` , then proceed to login:
|
||||
|
||||

|
||||
|
||||
In case you want to undo this and remove the vanilla Gnome session, you can purge the vanilla Gnome package and then remove the dependencies it installed (second command) using the following commands:
|
||||
```
|
||||
sudo apt purge vanilla-gnome-desktop
|
||||
sudo apt autoremove
|
||||
|
||||
```
|
||||
|
||||
Then reboot and select Ubuntu in the same way, from the GDM login screen.
|
||||
|
||||
**Option 3: Permanently hide the Ubuntu Dock from your desktop instead of removing it.**
|
||||
|
||||
If you prefer to permanently hide the Ubuntu Dock from showing up on your desktop instead of uninstalling it or using the vanilla Gnome session, you can easily do this using Dconf Editor. The drawback to this is that Ubuntu Dock will still use some system resources even though you're not using in on your desktop, but you'll also be able to easily revert this without installing or removing any packages.
|
||||
|
||||
Ubuntu Dock is only hidden from your desktop though. When you go in overlay mode (Activities), you'll still see and be able to use Ubuntu Dock from there.
|
||||
|
||||
To permanently hide Ubuntu Dock, use Dconf Editor to navigate to `/org/gnome/shell/extensions/dash-to-dock` and disable (set them to false) the following options: `autohide` , `dock-fixed` and `intellihide` .
|
||||
|
||||
You can achieve this from the command line if you wish, buy running the commands below:
|
||||
```
|
||||
gsettings set org.gnome.shell.extensions.dash-to-dock autohide false
|
||||
gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed false
|
||||
gsettings set org.gnome.shell.extensions.dash-to-dock intellihide false
|
||||
|
||||
```
|
||||
In case you change your mind and you want to undo this, you can either use Dconf Editor and re-enable (set them to true) autohide, dock-fixed and intellihide from `/org/gnome/shell/extensions/dash-to-dock` , or you can use these commands:
|
||||
```
|
||||
gsettings set org.gnome.shell.extensions.dash-to-dock autohide true
|
||||
gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed true
|
||||
gsettings set org.gnome.shell.extensions.dash-to-dock intellihide true
|
||||
|
||||
```
|
||||
|
||||
**Option 4: Use Dash to Panel extension.**
|
||||
|
||||
You can install Dash to Panel from
|
||||
|
||||
If you change your mind and you want Ubuntu Dock back, you can either disable Dash to Panel by using Gnome Tweaks app, or completely remove Dash to Panel by clicking the X button next to it from here:
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxuprising.com/2018/08/how-to-remove-or-disable-ubuntu-dock.html
|
||||
|
||||
作者:[Logix][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/118280394805678839070
|
||||
[1]:https://bugs.launchpad.net/ubuntu/+source/gnome-tweak-tool/+bug/1713020
|
||||
[2]:https://www.linuxuprising.com/2018/05/gnome-shell-dash-to-panel-v14-brings.html
|
||||
[3]:https://extensions.gnome.org/extension/1160/dash-to-panel/
|
@ -0,0 +1,78 @@
|
||||
translating---geekpi
|
||||
|
||||
Image creation applications for Fedora
|
||||
======
|
||||
|
||||

|
||||
|
||||
Feeling creative? There are a multitude of applications available for Fedora to aid your creativity. From digital painting, vectors, to pixel art there is something for everyone to get creative this weekend. This article highlights a selection of the applications available for Fedora for creating awesome images.
|
||||
|
||||
### Vector graphics: Inkscape
|
||||
|
||||
[Inkscape][1] is a well known and loved Open Source vector graphics editor. SVG is the primary file format of Inkscape, so all your drawings will scale no-problems! Inkscape has been around for many years, so there is a solid community and [mountains of tutorials and other resources][2] for getting started.
|
||||
|
||||
Being a vector graphics editor, Inkscape is better suited towards simpler illustrations (for example a simple comics style). However, using vector blurs, some artists create some [amazing vector drawings][3].
|
||||
|
||||
![][4]
|
||||
|
||||
Install Inkscape from the Software application in Fedora Workstation, or use the following command in Terminal:
|
||||
```
|
||||
sudo dnf install inkscape
|
||||
|
||||
```
|
||||
|
||||
### Digital Painting: Krita & Mypaint
|
||||
|
||||
[Krita][5] is a popular image creation application for digital painting, raster illustration, and texturing. Additionally, Krita is an active project, with a vibrant community — so [lots of tutorials to get started][6]. Krita features multiple brush engines, a UI with pop-up palletes, a wrap-around mode for creating seamless patterns, filters, layers, and much more.
|
||||
|
||||
![][7]
|
||||
|
||||
Install Krita from the Software application in Fedora Workstation, or use the following command in Terminal:
|
||||
```
|
||||
sudo dnf install krita
|
||||
|
||||
```
|
||||
|
||||
[Mypaint][8] is another amazing digital painting application available for Fedora. Like Krita, it has multiple brushes and the ability to use layers.
|
||||
|
||||
![][9]
|
||||
|
||||
Install Mypaint from the Software application in Fedora Workstation, or use the following command in Terminal:
|
||||
```
|
||||
sudo dnf install mypaint
|
||||
|
||||
```
|
||||
|
||||
### Pixel Art: Libresprite
|
||||
|
||||
[Libresprite][10] is an application designed for the creation of pixel art and pixel animations. It supports a range of colour modes and exports to many formats (including animated GIF). Additionally, Libresprite has drawing tools designed for the creation of pixel art: the polygon tool, and contour & shading tools.
|
||||
|
||||
![][11]
|
||||
|
||||
Libresprite is available to download from the Flathub application repository. To install, simply [enable Flathub as a software source][12], and then install via the Software application.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/image-creation-applications-fedora/
|
||||
|
||||
作者:[Ryan Lerch][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://fedoramagazine.org/introducing-flatpak/
|
||||
[1]:http://inkscape.org
|
||||
[2]:https://inkscape.org/en/learn/tutorials/
|
||||
[3]:https://inkscape.org/en/gallery/
|
||||
[4]:https://fedoramagazine.org/wp-content/uploads/2018/08/inkscape.png
|
||||
[5]:https://krita.org/en/
|
||||
[6]:https://docs.krita.org/en/
|
||||
[7]:https://fedoramagazine.org/wp-content/uploads/2018/08/krita.jpg
|
||||
[8]:http://mypaint.org/about/
|
||||
[9]:https://fedoramagazine.org/wp-content/uploads/2018/08/mypaint.png
|
||||
[10]:https://github.com/LibreSprite/LibreSprite
|
||||
[11]:https://fedoramagazine.org/wp-content/uploads/2018/08/libresprite.gif
|
||||
[12]:https://fedoramagazine.org/install-flathub-apps-fedora/
|
@ -0,0 +1,105 @@
|
||||
Strawberry: Quality sound, open source music player
|
||||
======
|
||||
|
||||

|
||||
|
||||
I recently received an email from [Jonas Kvinge][1] who forked the [Clementine open source music player][2]. Jonas writes:
|
||||
|
||||
I started working on a modified version of Clementine already in 2013, but because of other priorities, I did not pick up the work again before last year. I had not decided then if I was creating a fork, or contributing to Clementine. I ended up doing both. I started to see that I wanted the program development in a different direction. My focus was to create a music player for playing local music files, and not having to maintain support for multiple internet features that I did not use, and some which I did not want in the program at all… I also saw more and more that I disagree with the authors of Clementine and some statements that have been made regarding high-resolution audio.
|
||||
|
||||
Jonas and I are definitely working from the same perspective, at least in relation to high-resolution music files. Back in late 2016, [I looked at Clementine][3], and though it was in many ways delightful, it definitely missed the boat with respect to working with a dedicated high-resolution digital-analog converter (DAC) for music enjoyment. But that’s OK; Clementine just wasn’t built for me. Nor, it appears, was it for Jonas.
|
||||
|
||||
So, given that Jonas and I share an interest in being able to play back high-resolution audio on a dedicated listening device, I thought I’d best give [Strawberry][4], Jonas’ fork of Clementine, a try. I grabbed the [2018/07/16 release for Ubuntu][5] from Jonas’ site. It was a .deb and very straightforward to install.
|
||||
```
|
||||
sudo dpkg -i strawberry_0.2.1-27-gb2c26eb_amd64.deb
|
||||
|
||||
```
|
||||
|
||||
As usual, some necessary packages weren’t installed on my system, so I used `apt install -f` to remedy that.
|
||||
|
||||
Apt recommended the following packages:
|
||||
```
|
||||
graphicsmagick-dbg gxine xine-ui
|
||||
|
||||
```
|
||||
|
||||
and installed the following packages:
|
||||
```
|
||||
libgraphicsmagick-q16-3 libiso9660-10 liblastfm5-1 libqt5concurrent5 libvcdinfo0 libxine2 libxine2-bin libxine2-doc libxine2-ffmpeg libxine2-misc-plugins libxine2-plugins
|
||||
|
||||
```
|
||||
|
||||
Once that was all in hand, I started up Strawberry and saw this:
|
||||
|
||||

|
||||
|
||||
I verified that I could point Strawberry at ALSA in general and at my dedicated DAC in particular.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
Then I was ready to update my collection, which took less than a minute (Clementine was similarly fast).
|
||||
|
||||
The only thing I noticed that seemed a little odd was that Strawberry provided a software volume control, which isn’t of great interest to me (my hardware has a nice shiny knob on top for just that purpose).
|
||||
|
||||

|
||||
|
||||
And then I got down to some quality listening. One of the things I found I liked right away is the status button (see the strawberry at the top left of the UI). This verifies the details of the currently playing track, as shown in the screen capture to the left. Note that the effective bit rate, bit rate, and word length are shown, as well as other useful information.
|
||||
|
||||
The sound is glorious, as is customary with well-recorded high-resolution material (for those of you inclined to argue about the merits of high-resolution audio, before you post your opinions, whether pro or con, please read [this article][6], which actually treats the topic in a scientific fashion).
|
||||
|
||||
What’s cool about Strawberry, besides audio quality? Well, it’s fun to see the spectrum analyzer operating on the bottom of the screen. The overall responsiveness is smooth and quick; the album cover slides up once the music starts. There isn’t a lot of wasted space in the UI. And, as Jonas says:
|
||||
|
||||
For many people, Clementine will still be a better choice since it has features such as scrobbling and internet services, which Strawberry lacks and I do not plan to include.
|
||||
|
||||
Evidently, this is a player focused on the quality of the music, rather than the quantity. I’ll be using this player more in the future; it’s right up my alley.
|
||||
|
||||
### Fine sound collections
|
||||
|
||||
On the topic of music, especially interesting and unusual music, many thanks to [Michael Lavorgna over at Audiostream][7], who mentions these two fine online sound collections: [Cultural Equity][8] and [Smithsonian Folkways Recordings][9]. What great sources for stuff that is of historical interest and just plain fun.
|
||||
|
||||
Also thanks to Michael for reminding me about [Ektoplazm][10], a fine free music portal for those interested in “psytrance, techno, and downtempo music.” I’ve downloaded a few albums from this site in the past, and when the mood strikes, I really appreciate what it has to offer. It's especially wonderful that the music files are available in [FLAC][11].
|
||||
|
||||
### And more music…
|
||||
|
||||
In my last article, I spent so much time building that I didn’t have any time for listening. But since then, I’ve been to my favorite record store and picked up four new albums, some of which came with downloads. First up is [Jon Hopkins’][12] [Singularity][12]. I’ve been picking up the odd Jon Hopkins album since [Linn Records][13] (by the way, a great site for Linux users to buy downloads since no bloatware is required) was experimenting with a more broad-based music offering and introduced me to Jon. Some of his work is [available on Bandcamp][14] these days (including Singularity) which is a fine Linux-friendly site. For me, this is a great album—not really ambient, not really beatless, not really anything except what it is. Huge powerful swaths of music, staggering bass. Great fun! Go listen on [Bandcamp][14].
|
||||
|
||||
And if, like me, you have bought a few [Putumayo Music][15] albums over the years, keep your eyes peeled for Putumayo’s absolutely wonderful vinyl LP release of [_Vintage Latino_][16]. This great LP of vintage salsa and cha-cha is also available there to buy as a CD; you can listen to [1:00 clips on Bandcamp][17].
|
||||
|
||||
[Bombino][18] was in town last night. I had other stuff to do, but a friend went to the concert and loved it. I have three of his albums now; the last two I purchased on that fine open source medium, the vinyl LP, which came with downloads as well. His most recent album, _Deran_ , is more than worth it; check it out on the link above.
|
||||
<https://www.youtube.com/embed/1PTj1qIqcWM>
|
||||
|
||||
Last but by no means least, I managed to find a copy of [Nils Frahm’s _All Melody_][19] on vinyl (which includes a download code). I’ve been enjoying the high-resolution digital version of this album that I bought earlier this year, but it’s great fun to have it on vinyl.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/8/strawberry-new-open-source-music-player
|
||||
|
||||
作者:[Chris Hermansen][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/clhermansen
|
||||
[1]:https://github.com/jonaski
|
||||
[2]:https://www.clementine-player.org/
|
||||
[3]:https://opensource.com/life/16/10/4-open-music-players-compared
|
||||
[4]:http://www.strawbs.org/
|
||||
[5]:http://builds.jkvinge.net/ubuntu/bionic/strawberry_0.2.1-27-gb2c26eb_amd64.deb
|
||||
[6]:http://www.aes.org/e-lib/browse.cfm?elib=18296
|
||||
[7]:https://www.audiostream.com/content/alan-lomax-17000-sound-recordings-online-free
|
||||
[8]:http://research.culturalequity.org/audio-guide.jsp
|
||||
[9]:https://folkways.si.edu/radio-and-playlists/smithsonian
|
||||
[10]:http://www.ektoplazm.com/
|
||||
[11]:https://xiph.org/flac/
|
||||
[12]:https://pitchfork.com/reviews/albums/jon-hopkins-singularity/
|
||||
[13]:http://www.linnrecords.com/
|
||||
[14]:https://jonhopkins.bandcamp.com/album/singularity
|
||||
[15]:https://www.putumayo.com/
|
||||
[16]:https://www.putumayo.com/product-page/vintage-latino
|
||||
[17]:https://putumayo.bandcamp.com/album/vintage-latino
|
||||
[18]:http://www.bombinomusic.com/
|
||||
[19]:https://www.youtube.com/watch?v=1PTj1qIqcWM
|
@ -0,0 +1,77 @@
|
||||
Use Plank On Multiple Monitors Without Creating Multiple Docks With autoplank
|
||||
======
|
||||
|
||||

|
||||
|
||||
**[autoplank][1] is a small tool written in Go which adds multi-monitor support to Plank dock without having to create [multiple][2] docks.**
|
||||
|
||||
**When you move your mouse cursor to the bottom of a monitor, autoplank detect your mouse movement using** `xdotool` and it automatically moves Plank to that monitor. This tool **only works if Plank is set to run at the bottom of the screen** , at least for now.
|
||||
|
||||
There's a slight delay until Plank actually shows up on the monitor where the mouse is though. The developer says this is intentional, to make sure you actually want to access Plank on that monitor. The time delay before showing plank is not currently configurable, but that may change in the future.
|
||||
|
||||
autoplank should work with elementary OS, as well as any desktop environment or Linux distribution you use Plank dock on.
|
||||
|
||||
Plank is a simple dock that shows icons of running applications / windows. The application allows pinning applications to the dock, and comes with a few built-in simple "docklets": a clipboard manager, clock, CPU monitor, show desktop and trash. To access its settings, hold down the `Ctrl` key while right clicking anywhere on the Plank dock, and then clicking on `Preferences` .
|
||||
|
||||
Plank is used by default in elementary OS, but it can be used on any desktop environment or Linux distribution you wish.
|
||||
|
||||
### Install autoplank
|
||||
|
||||
On its GitHub page, it's mentioned that you need Go 1.8 or newer to build autoplank but I was able to successfully build it with Go 1.6 in Ubuntu 16.04 (elementary OS 0.4 Loki).
|
||||
|
||||
The developer has said on
|
||||
|
||||
**1\. Install required dependencies.**
|
||||
|
||||
To build autoplank you'll need Go (`golang-go` in Debian, Ubuntu, elementary OS, etc.). To get the latest Git code you'll also need `git` , and for detecting the monitor on which you move the mose, you'll also need to install `xdotool` .
|
||||
|
||||
Install these in Ubuntu, Debian, elementary OS and so on, by using this command:
|
||||
```
|
||||
sudo apt install git golang-go xdotool
|
||||
|
||||
```
|
||||
|
||||
**2\. Get the latest autoplank from[Git][1], build it, and install it in** `/usr/local/bin` :
|
||||
```
|
||||
git clone https://github.com/abiosoft/autoplank
|
||||
cd autoplank
|
||||
go build -o autoplank
|
||||
sudo mv autoplank /usr/local/bin/
|
||||
|
||||
```
|
||||
|
||||
You can remove the autoplank folder from your home directory now.
|
||||
|
||||
When you want to uninstall autoplank, simply remove the `/usr/local/bin/autoplank` binary (`sudo rm /usr/local/bin/autoplank`).
|
||||
|
||||
**3\. Add autoplank to startup.**
|
||||
|
||||
If you want to try autoplank before adding it to startup or creating a systemd service for it, you can simply type `autoplank` in a terminal to start it.
|
||||
|
||||
To have autoplank work between reboots, you'll need to add it to your startup applications. The exact steps for doing this depend on your desktop environments, so I won't tell you exactly how to do that for every desktop environment, but remember to use `/usr/local/bin/autoplank` as the executable in Startup Applications.
|
||||
|
||||
In elementary OS, you can open `System Settings` , then in `Applications` , on the `Startup` tab, click the `+` button in the bottom left-hand side corner of the window, then add `/usr/local/bin/autoplank` in the `Type in a custom command` field:
|
||||
|
||||

|
||||
|
||||
**Another way of using autoplank is by creating a systemd service for it, as explained[here][3].** Using a systemd service for autoplank has the advantage of restarting autoplank if it crashes for whatever reason. Use either the systemd service or add autoplank to your startup applications (don't use both).
|
||||
|
||||
**4\. After you do this, logout, login and autoplank should be running so you can move the mouse at the bottom of a monitor to move Plank dock there.**
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.linuxuprising.com/2018/08/use-plank-on-multiple-monitors-without.html
|
||||
|
||||
作者:[Logix][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/118280394805678839070
|
||||
[1]:https://github.com/abiosoft/autoplank
|
||||
[2]:https://answers.launchpad.net/plank/+question/204593
|
||||
[3]:https://github.com/abiosoft/autoplank#optional-create-a-service
|
||||
[4]:https://www.reddit.com/r/elementaryos/comments/95a879/autoplank_use_plank_on_multimonitor_setup/e3r9saq/
|
129
sources/tech/20180812 Ubuntu 18.04 Vs. Fedora 28.md
Normal file
129
sources/tech/20180812 Ubuntu 18.04 Vs. Fedora 28.md
Normal file
@ -0,0 +1,129 @@
|
||||
Ubuntu 18.04 Vs. Fedora 28
|
||||
======
|
||||

|
||||
|
||||
Hello folks. Today I'll highlight some of the features and differences between the two popular Linux distros; **Ubuntu 18.04** and **Fedora 28** . Each has their own package management; Ubuntu uses DEB while Fedora uses RPM, but both of them features the same [Desktop Environment][3] ([GNOME][4]) and aims to provide quality desktop experience for the Linux users.
|
||||
|
||||
**Ubuntu 18.04** is the latest Ubuntu [LTS][1] release and comes equipped with GNOME desktop. So is Fedora 28 that also features GNOME desktop, but both of them provides a unique desktop experience when it comes down to their software management and of course their User Interfaces too.
|
||||
|
||||
### Quick Facts
|
||||
|
||||
Did you know that Ubuntu which is based on Debian, provides the latest software earlier than the latter one? An example is the popular web browser Firefox Quantum found on Ubuntu while Debian follows behind on the ESR (Extended Support Release) version of the same web browser.
|
||||
|
||||
|
||||
|
||||
The same applies to Fedora which provides cutting-edge software to the end users and also acts as the testing platform for the next stable RHEL (Red Hat Enterprise Linux) release.
|
||||
|
||||
### Desktop overview
|
||||
|
||||
Fedora provides vanilla GNOME desktop experience while Ubuntu 18.04 have tweaked certain aspects of the desktop to enable long-time Unity users a smooth transition to GNOME Desktop Environment.
|
||||
|
||||
_Canonical decided to save development time by ditching Unity and switching to GNOME desktop (starting from Ubuntu [17.10][2]) so they can focus more on IoT.
|
||||
_
|
||||
|
||||
So on Fedora, we have a clean icon-less desktop, a hidden panel on the overview and its look featuring GNOME default theme: Adwaita.
|
||||
|
||||
[][5]
|
||||
|
||||
Whereas Ubuntu features its classic desktop style with icons, a panel on the left mimicking its traditional dock, and customized window looks (also traditional) with Ubuntu Ambiance theme set as its default look and feel.
|
||||
|
||||
[][6]
|
||||
|
||||
However, learning to use one of them and then switching to another won't cost you time. Instead, they are designed with simplicity and user-friendliness in mind so any newbie can feel right at home with either of the two Linux distros.
|
||||
|
||||
|
||||
|
||||
But it's not just the looks or UI that determines the user's decision to choose a Linux distro. Other factors come into the role too, and below are more sub-topics describing all about software management between the two Linux OS.
|
||||
|
||||
### Software center
|
||||
|
||||
Ubuntu uses dpkg; Debian Package Management, for distributing software to end users while Fedora uses Red Hat Package Management called rpm. Both are very popular package management among the Linux community and their command line tools are easy to use too.
|
||||
|
||||
[][7]
|
||||
|
||||
But each Linux distro quite varies when it comes to the software that's being distributed. Canonical releases new Ubuntu versions every six months; usually in the month of April and then on October. So for each release, the developers maintain a development schedule, after a new Ubuntu release, it enters into "freeze" state where its development on testing new software is halted.
|
||||
|
||||
|
||||
|
||||
Whereas, Fedora also following the same six months release cycle, pretty much mimics a rolling release Linux distro (though it is not one of those). Almost all software packages are updated regularly so users get the opportunity to try out the latest software, unlike Ubuntu. However, this invites "instability" on the user's side as software bugs are more commonly faced but not critical enough to render the system unusable.
|
||||
|
||||
### Software updates
|
||||
|
||||
I've mentioned above about Ubuntu "freeze" state. Well, I'll be exaggerating more about this state since it has some significant importance on the way Ubuntu software is updated... So, once a new version of Ubuntu is released, its development (testing new software) is halted.
|
||||
|
||||
_The development for the next upcoming Ubuntu release begins where it'll go through the phases of "daily builds" then "beta release" and finally shipping the new Ubuntu release to the end users._
|
||||
|
||||
In this "freeze" state Ubuntu maintainers no longer add the latest software (unless it fixes serious security issues) to its package repository. So Ubuntu users get more "bug fixes" updates than "feature" updates, which is great since the system would remain stable without disrupting user's productivity.
|
||||
|
||||
|
||||
|
||||
Fedora aims to provide cutting-edge software to the end users so users get more "feature" updates than on Ubuntu. Also, measures are taken by the developers to maintain its system stability. For instance, on computer start up the user will be given at most three working kernels (latest one on the top) choices so if one fails to start the user can revert to the other two previous working kernels.
|
||||
|
||||
### Snaps and flatpak
|
||||
|
||||
Both are new and cool sexy tools for distributing software across multiple Linux distributions. Ubuntu provides **snaps** out of the box while **flatpak** goes to Fedora. The most popular among the two is snaps where more popular and proprietary applications are finding their way on snap store. Flatpak too is gaining traction with more apps added onto its platform.
|
||||
|
||||
|
||||
|
||||
Unfortunately, both of them are still new and there are some "window theme-breaking" rants dispersed around the Internet. But still, switching between the two tools isn't nerve wrecking as they are easy to use.
|
||||
|
||||
### Apps showdown
|
||||
|
||||
Below are some of the common apps available on Ubuntu and Fedora, they are compared between the two platforms:
|
||||
|
||||
#### Calculator
|
||||
|
||||
The program launches faster on Fedora than on Ubuntu. The reason is on Fedora, calculator program is natively installed while on Ubuntu the snap version of the same program is installed.
|
||||
|
||||
#### System Monitor
|
||||
|
||||
This might sound nerdy but I find it necessary and intuitive to observe my computer performance and kill offending processes if any. The program's launch time is the same as above ie., faster on Fedora (natively installed) and slower on Ubuntu (snap version).
|
||||
|
||||
#### Help
|
||||
|
||||
I've mentioned above that Ubuntu provides a tweaked version of the GNOME Desktop Environment (for long time Unity users migration ease). Unfortunately, Ubuntu developers have either forgotten or ignored to update the Help program since it's somewhat confusing to look at the documentation (getting started videos) and finding out the demonstration videos and the actual environment varies a tad-bit slightly.
|
||||
|
||||
[][8]
|
||||
|
||||
### Conclusion
|
||||
|
||||
Ubuntu and Fedora are two popular Linux distros. Each has their own eye-candy features, so choosing between the two would be quite a challenge for newbies. I recommend trying both of them out so you can later find out which tools provided by the two Linux distro better suits you.
|
||||
|
||||
|
||||
|
||||
I hope you had a good read and let me know what I missed out/your opinions in the comment section below.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxandubuntu.com/home/ubuntu-1804-vs-fedora-28
|
||||
|
||||
作者:[LinuxAndUbuntu][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxandubuntu.com
|
||||
[1]:http://www.linuxandubuntu.com/home/ubuntu-1804-codename-announced-bionic-beaver
|
||||
[2]:http://www.linuxandubuntu.com/home/what-new-is-going-to-be-in-ubuntu-1704-zesty-zapus
|
||||
[3]:http://www.linuxandubuntu.com/home/5-best-linux-desktop-environments-with-pros-cons
|
||||
[4]:http://www.linuxandubuntu.com/home/walkthrough-on-how-to-use-gnome-boxes
|
||||
[5]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/ubuntu-18-04-gnome_orig.jpg
|
||||
[6]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/ubuntu-gnome-18-04_orig.jpg
|
||||
[7]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/ubuntu-software-center_2_orig.jpg
|
||||
[8]:http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/ubuntu-18-04-help-manual_orig.jpg
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxandubuntu.com/home/ubuntu-1804-vs-fedora-28
|
||||
|
||||
作者:[LinuxAndUbuntu][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxandubuntu.com
|
@ -0,0 +1,81 @@
|
||||
5 of the Best Linux Educational Software and Games for Kids
|
||||
======
|
||||
|
||||

|
||||
|
||||
Linux is a very powerful operating system, and that explains why it powers most of the servers on the Internet. Though it may not be the best OS in terms of user friendliness, its diversity is commendable. Everyone has their own need for Linux. Be it for coding, educational purposes or the internet of things (IoT), you’ll always find a suitable Linux distro for every use. To that end, many have dubbed Linux as the OS for future computing.
|
||||
|
||||
Because the future belongs to the kids of today, introducing them to Linux is the best way to prepare them for what the future holds. This OS may not have a reputation for popular games such as FIFA or PES; however, it offers the best educational software and games for kids. These are five of the best Linux educational software to keep your kids ahead of the game.
|
||||
|
||||
**Related** : [The Beginner’s Guide to Using a Linux Distro][1]
|
||||
|
||||
### 1. GCompris
|
||||
|
||||
If you’re looking for the best educational software for kids, [GCompris][2] should be your starting point. This software is specifically designed for kids education and is ideal for kids between two and ten years old. As the pinnacle of all Linux educational software suites for children, GCompris offers about 100 activities for kids. It packs everything you want for your kids from reading practice to science, geography, drawing, algebra, quizzes, and more.
|
||||
|
||||
![Linux educational software and games][3]
|
||||
|
||||
GCompris even has activities for helping your kids learn computer peripherals. If your kids are young and you want them to learn alphabets, colors, and shapes, GCompris has programmes for those, too. What’s more, it also comes with helpful games for kids such as chess, tic-tac-toe, memory, and hangman. GCompris is not a Linux-only app. It’s also available for Windows and Android.
|
||||
|
||||
### 2. TuxMath
|
||||
|
||||
Most students consider math a tough subject. You can change that perception by acquainting your kids with mathematical skills through Linux software applications such as [TuxMath][4]. TuxMath is a top-rated educational Math tutorial game for kids. In this game your role is to help Tux the penguin of Linux protect his planet from a rain of mathematical problems.
|
||||
|
||||
![linux-educational-software-tuxmath-1][5]
|
||||
|
||||
By finding the answer, you help Tux save the planet by destroying the asteroids with your laser before they make an impact. The difficulty of the math problems increases with each level you pass. This game is ideal for kids, as it can help them rack their brains for solutions. Besides making them good at math, it also helps them improve their mental agility.
|
||||
|
||||
### 3. Sugar on a Stick
|
||||
|
||||
[Sugar on a Stick][6] is a dedicated learning program for kids – a brand new pedagogy that has gained a lot of traction. This program provides your kids with a fully-fledged learning platform where they can gain skills in creating, exploring, discovering and also reflecting on ideas. Just like GCompris, Sugar on a Stick comes with a host of learning resources for kids, including games and puzzles.
|
||||
|
||||
![linux-educational-software-sugar-on-a-stick][7]
|
||||
|
||||
The best thing about Sugar on a Stick is that you can set it up on a USB Drive. All you need is an X86-based PC, then plug in the USB, and boot the distro from it. Sugar on a Stick is a project by Sugar Labs – a non-profit organization that is run by volunteers.
|
||||
|
||||
### 4. KDE Edu Suite
|
||||
|
||||
[KDE Edu Suite][8] is a package of software for different user purposes. With a host of applications from different fields, the KDE community has proven that it isn’t just serious about empowering adults; it also cares about bringing the young generation to speed with everything surrounding them. It comes packed with various applications for kids ranging from science to math, geography, and more.
|
||||
|
||||
![linux-educational-software-kde-1][9]
|
||||
|
||||
The KDE Suite can be used for adult needs based on necessities, as a school teaching software, or as a kid’s leaning app. It offers a huge software package and is free to download. The KDE Edu suite can be installed on most GNU/Linux Distros.
|
||||
|
||||
### 5. Tux Paint
|
||||
|
||||
![linux-educational-software-tux-paint-2][10]
|
||||
|
||||
[Tux Paint][11] is another great Linux educational software for kids. This award-winning drawing program is used in schools around the world to help children nurture the art of drawing. It comes with a clean, easy-to-use interface and fun sound effects that help children use the program. There is also an encouraging cartoon mascot that guides kids as they use the program. Tux Paint comes with a variety of drawing tools that help kids unleash their creativity.
|
||||
|
||||
### Summing Up
|
||||
|
||||
Due to the popularity of these educational software for kids, many institutions have embraced these programs as teaching aids in schools and kindergartens. A typical example is [Edubuntu][12], an Ubuntu-derived distro that is widely used by teachers and parents for educating kids.
|
||||
|
||||
Tux Paint is another great example that has grown in popularity over the years and is being used in schools to teach children how to draw. This list is by no means exhaustive. There are hundreds of other Linux educational software and games that can be very useful for your kids.
|
||||
|
||||
If you know of any other great Linux educational software and games for kids, share with us in the comments section below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.maketecheasier.com/5-best-linux-software-packages-for-kids/
|
||||
|
||||
作者:[Kenneth Kimari][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.maketecheasier.com/author/kennkimari/
|
||||
[1]:https://www.maketecheasier.com/beginner-guide-to-using-linux-distro/ (The Beginner’s Guide to Using a Linux Distro)
|
||||
[2]:http://www.gcompris.net/downloads-en.html
|
||||
[3]:https://www.maketecheasier.com/assets/uploads/2018/07/Linux-educational-software-gcompris.jpg (Linux educational software and games)
|
||||
[4]:https://tuxmath.en.uptodown.com/ubuntu
|
||||
[5]:https://www.maketecheasier.com/assets/uploads/2018/07/Linux-educational-software-tuxmath-1.jpg (linux-educational-software-tuxmath-1)
|
||||
[6]:http://wiki.sugarlabs.org/go/Sugar_on_a_Stick/Downloads
|
||||
[7]:https://www.maketecheasier.com/assets/uploads/2018/07/Linux-educational-software-sugar-on-a-stick.png (linux-educational-software-sugar-on-a-stick)
|
||||
[8]:https://edu.kde.org/
|
||||
[9]:https://www.maketecheasier.com/assets/uploads/2018/07/Linux-educational-software-kde-1.jpg (linux-educational-software-kde-1)
|
||||
[10]:https://www.maketecheasier.com/assets/uploads/2018/07/Linux-educational-software-tux-paint-2.jpg (linux-educational-software-tux-paint-2)
|
||||
[11]:http://www.tuxpaint.org/
|
||||
[12]:http://edubuntu.org/
|
@ -0,0 +1,65 @@
|
||||
Convert file systems with Fstransform
|
||||
======
|
||||
|
||||

|
||||
|
||||
Few people know that they can convert their filesystems from one type to another without losing data, i.e. non-destructively. It may sound like magic, but [Fstransform][1] can convert an ext2, ext3, ext4, jfs, reiserfs or xfs partition to another type from the list in almost any combination. More importantly, it does so in-place, without formatting or copying data anywhere. Atop of all this goodness, there is a little bonus: Fstransform can also handle ntfs, btrfs, fat and exfat partitions as well.
|
||||
|
||||
### Before you run it
|
||||
|
||||
There are certain caveats and limitations in Fstransform, so it is strongly advised to back up before attempting a conversion. Additionally, there are some limitations to be aware of when using Fstransform:
|
||||
|
||||
* Both the source and target filesystems must be supported by your Linux kernel. Sounds like an obvious thing and exposes zero risk in case you want to use ext2, ext3, ext4, reiserfs, jfs and xfs partitions. Fedora supports all of that just fine.
|
||||
* Upgrading ext2 to ext3 or ext4 does not require Fstransform. Use the Tune2fs utility instead.
|
||||
* The device with source file system must have at least 5% of free space.
|
||||
* You need to be able to unmount the source filesystem before you begin.
|
||||
* The more data your source file system stores, the longer the conversion will last. The actual speed depends on your device, but expect it to be around one gigabyte per minute. The large amount of hard links can also slow down the conversion.
|
||||
* Although Fstransform is proved to be stable, please back up data on your source filesystem.
|
||||
|
||||
|
||||
|
||||
### Installation instructions
|
||||
|
||||
Fstransform is already a part of Fedora. Install with the command:
|
||||
```
|
||||
sudo dnf install fstransform
|
||||
|
||||
```
|
||||
|
||||
### Time to convert something
|
||||
|
||||
![][2]
|
||||
|
||||
The syntax of the fstransform command is very simple: fstransform <source device> <target file system>. Keep in mind that it needs root privileges to run, so don’t forget to add sudo in the beginning. Here goes an example:
|
||||
```
|
||||
sudo fstransform /dev/sdb1 ext4
|
||||
|
||||
```
|
||||
|
||||
Note that it is not possible to convert a root file system, which is a security measure. Use a test partition or an experimental thumb drive instead. In the meantime, Fstransform will through a lot of auxiliary output in the console. The most useful part is the estimated time of completion, which keep you informed about how long the process will take. Again, few small files on an almost empty drive will make Fstransform do its job in a minute or so, whereas more real-world tasks may involve hours of wait time.
|
||||
|
||||
### More file systems are supported
|
||||
|
||||
As mentioned above, it is possible to try Fstransform with ntfs, btrfs, fat and exfat partitions. These types are very experimental, and nobody can guarantee that the converion will flow perfect. Still, there are many success stories, and you can add your own by testing Fstransform with a sample data set on a test partition. Those additional file systems can be enabled by the use of the –force-untested-file-systems parameter:
|
||||
```
|
||||
sudo fstransform /dev/sdb1 ntfs --force-untested-file-systems
|
||||
|
||||
```
|
||||
|
||||
Sometimes the process may iterrupt with an error. Feel free to repeat the command again — it may eventually complete the conversion from second or third attempt.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://fedoramagazine.org/transform-file-systems-in-linux/
|
||||
|
||||
作者:[atolstoy][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://fedoramagazine.org/author/atolstoy/
|
||||
[1]:https://github.com/cosmos72/fstransform
|
||||
[2]:https://fedoramagazine.org/wp-content/uploads/2018/08/Screenshot_20180805_230116.png
|
@ -0,0 +1,142 @@
|
||||
How To Switch Between Different Versions Of Commands In Linux
|
||||
======
|
||||
|
||||

|
||||
|
||||
A couple days ago, we discussed how to [**switch between multiple PHP versions**][1]. In that method, we used **‘update-alternatives’** command to switch from one PHP version to another. That means, the update-alternatives commands helps you to set which system wide version of PHP you want to use by default. To put this in layman terms, you can change the version of a command system wide using ‘update-alternatives’ command. What if you want to change command versions dynamically depending on what directory you’re in? This is where **‘alt’** utility comes in help. The alt is a command line tool that helps you to switch between different versions of commands in Unix-like systems. It is a simple, free, open source tool written in **Rust** programming language.
|
||||
|
||||
### Installation
|
||||
|
||||
Installing alt utility is trivial.
|
||||
|
||||
To install alt on your Linux machine, just run the following command:
|
||||
```
|
||||
$ curl -sL https://github.com/dotboris/alt/raw/master/install.sh | bash -s
|
||||
|
||||
```
|
||||
|
||||
Next, add the shims directory to your PATH environment variable depending upon the SHELL you are use.
|
||||
|
||||
For BASH:
|
||||
```
|
||||
$ echo 'export PATH="$HOME/.local/alt/shims:$PATH"' >> ~/.bashrc
|
||||
$ source ~/.bashrc
|
||||
|
||||
```
|
||||
|
||||
For ZSH:
|
||||
```
|
||||
$ echo 'export PATH="$HOME/.local/alt/shims:$PATH"' >> ~/.zshrc
|
||||
$ source ~/.zshrc
|
||||
|
||||
```
|
||||
|
||||
For FISH:
|
||||
```
|
||||
$ echo 'set -x PATH "$HOME/.local/alt/shims" $PATH' >> ~/.config/fish/config.fish
|
||||
|
||||
```
|
||||
|
||||
Alt is installed!
|
||||
|
||||
### Switch Between Different Versions Of Commands Using Alt Tool In Linux
|
||||
|
||||
Like I mentioned earlier, alt works with the current directory. That means, when you switch from one version to another, you do so for the current working directory only, not system wide.
|
||||
|
||||
Let us see an example. I have installed two PHP versions in my Ubuntu system, PHP 5.6 and PHP 7.2 respectively and I have some PHP applications in a directory called **‘myproject’**.
|
||||
|
||||
First, let us see the globally installed PHP version using command:
|
||||
```
|
||||
$ php -v
|
||||
|
||||
```
|
||||
|
||||
**Sample output:**
|
||||
|
||||
![Find PHP version][3]
|
||||
|
||||
As you see in the above screenshot, my system wide default version is PHP7.2.
|
||||
|
||||
Next, I am gong to “myproject” directory where I have kept my PHP applications.
|
||||
```
|
||||
$ cd myproject
|
||||
|
||||
```
|
||||
|
||||
Scan the available PHP versions using the following command:
|
||||
```
|
||||
$ alt scan php
|
||||
|
||||
```
|
||||
|
||||
**Sample output:**
|
||||
|
||||
![alt scan php][4]
|
||||
|
||||
As you can see, I have two PHP versions, PHP5.6 and PHP7.2. Now press **< SPACEBAR>** key to select all available versions. After selecting all available versions, you will see a cross mark behind each version as shown below picture. Use UP/DOWN arrows to move between the versions. Finally press ENTER to save the changes.
|
||||
|
||||
![Select php version][5]
|
||||
|
||||
Next run the following command to choose which PHP version you want to use inside the ‘myproject’ directory:
|
||||
```
|
||||
$ alt use php
|
||||
|
||||
```
|
||||
|
||||
I am going to use PHP5.6 version, so I selected it(use arrow keys to select) and hit ENTER key.
|
||||
|
||||
![set php version][6]
|
||||
|
||||
You can now use php 5.6 (/usr/bin/php5.6) when in /home/sk/myproject directory.
|
||||
|
||||
Let us check if the PHP5.6 is set as default inside the myproject directory:
|
||||
```
|
||||
$ php -v
|
||||
|
||||
```
|
||||
|
||||
**Sample output:**
|
||||
|
||||
![Check PHP version][7]
|
||||
|
||||
It will stay as 5.6 version until you change to different version. Got it? Good! Please note that we use php5.6 version only inside this directory. On system level, PHP7.2 is still the default version. Have a look at the following image.
|
||||
|
||||
![Check PHP version 1][8]
|
||||
|
||||
As you can see in the above screenshot, I have two different versions of PHP. Inside the ‘myproject’ directory, I got PHP5.6 and outside the myproject, PHP version is 7.2.
|
||||
|
||||
Similarly, you can set any version of your choice in each directory. I used PHP for the demonstration purpose. You can, however, use any software of your choice, for example NodeJS.
|
||||
|
||||
Here is the demonstration video for NodeJS.
|
||||
|
||||
![][9]
|
||||
|
||||
The alt utility can be useful when you wanted to test your applications under different versions of applications.
|
||||
|
||||
And, that’s all for now. More good stuffs to come. Stay tuned!
|
||||
|
||||
Cheers!
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/how-to-switch-between-different-versions-of-commands-in-linux/
|
||||
|
||||
作者:[SK][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.ostechnix.com/author/sk/
|
||||
[1]:https://www.ostechnix.com/how-to-switch-between-multiple-php-versions-in-ubuntu/
|
||||
[2]:data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
|
||||
[3]:http://www.ostechnix.com/wp-content/uploads/2018/08/Find-PHP-version.png
|
||||
[4]:http://www.ostechnix.com/wp-content/uploads/2018/08/alt-scan-php.png
|
||||
[5]:http://www.ostechnix.com/wp-content/uploads/2018/08/Select-php-version.png
|
||||
[6]:http://www.ostechnix.com/wp-content/uploads/2018/08/set-php-version.png
|
||||
[7]:http://www.ostechnix.com/wp-content/uploads/2018/08/Check-PHP-version.png
|
||||
[8]:http://www.ostechnix.com/wp-content/uploads/2018/08/Check-PHP-version-1.png
|
||||
[9]:http://www.ostechnix.com/wp-content/uploads/2018/08/Alt-NodeJS-demo.gif
|
201
sources/tech/20180813 Tips for using the top command in Linux.md
Normal file
201
sources/tech/20180813 Tips for using the top command in Linux.md
Normal file
@ -0,0 +1,201 @@
|
||||
Tips for using the top command in Linux
|
||||
======
|
||||
|
||||

|
||||
|
||||
Trying to find out what's running on your machine—and which process is using up all your memory and making things slllooowwww—is a task served well by the utility `top`.
|
||||
|
||||
`top` is an extremely useful program that acts similar to Windows Task Manager or MacOS's Activity Monitor. Running `top` on your *nix machine will show you a live, running view of the process running on your system.
|
||||
```
|
||||
$ top
|
||||
|
||||
```
|
||||
|
||||
Depending on which version of `top` you're running, you'll get something that looks like this:
|
||||
```
|
||||
top - 08:31:32 up 1 day, 4:09, 0 users, load average: 0.20, 0.12, 0.10
|
||||
|
||||
Tasks: 3 total, 1 running, 2 sleeping, 0 stopped, 0 zombie
|
||||
|
||||
%Cpu(s): 0.5 us, 0.3 sy, 0.0 ni, 99.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
|
||||
|
||||
KiB Mem: 4042284 total, 2523744 used, 1518540 free, 263776 buffers
|
||||
|
||||
KiB Swap: 1048572 total, 0 used, 1048572 free. 1804264 cached Mem
|
||||
|
||||
|
||||
|
||||
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
||||
|
||||
1 root 20 0 21964 3632 3124 S 0.0 0.1 0:00.23 bash
|
||||
|
||||
193 root 20 0 123520 29636 8640 S 0.0 0.7 0:00.58 flask
|
||||
|
||||
195 root 20 0 23608 2724 2400 R 0.0 0.1 0:00.21 top
|
||||
|
||||
```
|
||||
|
||||
Your version of `top` may look different from this, particularly in the columns that are displayed.
|
||||
|
||||
### How to read the output
|
||||
|
||||
You can tell what you're running based on the output, but trying to interpret the results can be slightly confusing.
|
||||
|
||||
The first few lines contain a bunch of statistics (the details) followed by a table with a list of results (the list). Let's start with the latter.
|
||||
|
||||
#### The list
|
||||
|
||||
These are the processes that are running on the system. By default, they are ordered by CPU usage in descending order. This means the items at the top of the list are using more CPU resources and causing more load on your system. They are literally the "top" processes by resource usage. You have to admit, it's a clever name.
|
||||
|
||||
The `COMMAND` column on the far right reports the name of the process (the command you ran to start them). In this example, they are `bash` (a command interpreter we're running `top` in), `flask` (a web micro-framework written in Python), and `top` itself.
|
||||
|
||||
The other columns provide useful information about the processes:
|
||||
|
||||
* `PID`: the process id, a unique identifier for addressing the processes
|
||||
* `USER`: the user running the process
|
||||
* `PR`: the task's priority
|
||||
* `NI`: a nicer representation of the priority
|
||||
* `VIRT`: virtual memory size in KiB (kibibytes)*
|
||||
* `RES`: resident memory size in KiB* (the "physical memory" and a subset of VIRT)
|
||||
* `SHR`: shared memory size in KiB* (the "shared memory" and a subset of VIRT)
|
||||
* `S`: process state, usually **I** =idle, **R** =running, **S** =sleeping, **Z** =zombie, **T** or **t** =stopped (there are also other, less common options)
|
||||
* `%CPU`: Percentage of CPU usage since the last screen update
|
||||
* `%MEM`: percentage of `RES` memory usage since the last screen update
|
||||
* `TIME+`: total CPU time used since the process started
|
||||
* `COMMAND`: the command, as described above
|
||||
|
||||
|
||||
|
||||
*Knowing exactly what the `VIRT`, `RES`, and `SHR` values represent doesn't really matter in everyday operations. The important thing to know is that the process with the most `VIRT` is the process using the most memory. If you're in `top` because you're debugging why your computer feels like it's in a pool of molasses, the process with the largest `VIRT` number is the culprit. If you want to learn exactly what "shared" and "physical" memory mean, check out "Linux Memory Types" in the [top manual][1].
|
||||
|
||||
And, yes, I did mean to type kibibytes, not kilobytes. The 1,024 value that you normally call a kilobyte is actually a kibibyte. The Greek kilo ("χίλιοι") means thousand and means 1,000 of something (e.g., a kilometer is a thousand meters, a kilogram is a thousand grams). Kibi is a portmanteau of kilo and byte, and it means 1,024 bytes (or 210). But, because words are hard to say, many people say kilobyte when they mean 1,024 bytes. All this means is `top` is trying to use the proper terms here, so just go with it. #themoreyouknow 🌈.
|
||||
|
||||
#### A note on screen updates:
|
||||
|
||||
Live screen updates are one of the objectively **really cool things** Linux programs can do. This means they can update their own display in real time, so they appear animated. Even though they're using text. So cool! In our case, the time between updates is important, because some of our statistics (`%CPU` and `%MEM`) are based on the value since the last screen update.
|
||||
|
||||
And because we're running in a persistent application, we can press key commands to make live changes to settings or configurations (instead of, say, closing the application and running the application again with a different command-line flag).
|
||||
|
||||
Typing `h` invokes the "help" screen, which also shows the default delay (the time between screen updates). By default, this value is (around) three seconds, but you can change it by typing `d` (presumably for "delay") or `s` (probably for "screen" or "seconds").
|
||||
|
||||
#### The details
|
||||
|
||||
Above the list of processes, there's a whole bunch of other useful information. Some of these details may look strange and confusing, but once you take some time to step through each one, you'll see they're very useful stats to pull up in a pinch.
|
||||
|
||||
The first row contains general system information
|
||||
|
||||
* `top`: we're running `top`! Hi `top`!
|
||||
* `XX:YY:XX`: the time, updated every time the screen updates
|
||||
* `up` (then `X day, YY:ZZ`): the system's [uptime][2], or how much time has passed since the system turned on
|
||||
* `load average` (then three numbers): the [system load][3] over the last one, five, and 15 minutes, respectively
|
||||
|
||||
|
||||
|
||||
The second row (`Tasks`) shows information about the running tasks, and it's fairly self-explanatory. It shows the total number of processes and the number of running, sleeping, stopped, and zombie processes. This is literally a sum of the `S` (state) column described above.
|
||||
|
||||
The third row (`%Cpu(s)`) shows the CPU usage separated by types. The data are the values between screen refreshes. The values are:
|
||||
|
||||
* `us`: user processes
|
||||
* `sy`: system processes
|
||||
* `ni`: [nice][4] user processes
|
||||
* `id`: the CPU's idle time; a high idle time means there's not a lot going on otherwise
|
||||
* `wa`: wait time, or time spent waiting for I/O completion
|
||||
* `hi`: time spent waiting for hardware interrupts
|
||||
* `si`: time spent waiting for software interrupts
|
||||
* `st`: "time stolen from this VM by the hypervisor"
|
||||
|
||||
|
||||
|
||||
You can collapse the `Tasks` and `%Cpu(s)` rows by typing `t` (for "toggle").
|
||||
|
||||
The fourth (`KiB Mem`) and fifth rows (`KiB Swap`) provide information for memory and swap. These values are:
|
||||
|
||||
* `total`
|
||||
* `used`
|
||||
* `free`
|
||||
|
||||
|
||||
|
||||
But also:
|
||||
|
||||
* memory `buffers`
|
||||
* swap `cached Mem`
|
||||
|
||||
|
||||
|
||||
By default, they're listed in KiB, but pressing `E` (for "extend memory scaling") cycles through different values: kibibytes, mebibytes, gibibytes, tebibytes, pebibytes, and exbibytes. (That is, kilobytes, megabytes, gigabytes, terabytes, petabytes, and exabytes, but their "real names.")
|
||||
|
||||
The `top` user manual shows even more information about useful flags and configurations. To find the manual on your system, you can run `man top`. There are various websites that show an [HTML rendering of the manual][1], but note that these may be for a different version of top.
|
||||
|
||||
### Two top alternatives
|
||||
|
||||
You don't always have to use `top` to understand what's going on. Depending on your circumstances, other tools might help you diagnose issues, especially when you want a more graphical or specialized interface.
|
||||
|
||||
#### htop
|
||||
|
||||
`htop` is a lot like `top`, but it brings something extremely useful to the table: a graphical representation of CPU and memory use.
|
||||
|
||||

|
||||
|
||||
This is how the environment we examined in `top` looks in `htop`. The display is a lot simpler, but still rich in features.
|
||||
|
||||
Our task counts, load, uptime, and list of processes are still there, but we get a nifty, colorized, animated view of the CPU usage per core and a graph of memory usage.
|
||||
|
||||
Here's what the different colors mean (you can also get this information by pressing `h` for "help").
|
||||
|
||||
CPU task priorities or types:
|
||||
|
||||
* blue: low priority
|
||||
* green: normal priority
|
||||
* red: kernel tasks
|
||||
* blue: virtualized tasks
|
||||
* the value at end of the bar is the percentage of used CPU
|
||||
|
||||
|
||||
|
||||
Memory:
|
||||
|
||||
* green: used memory
|
||||
* blue: buffered memory
|
||||
* yellow: cached memory
|
||||
* the values at the end of the bar show the used and total memory
|
||||
|
||||
|
||||
|
||||
If colors aren't useful for you, you can run `htop -C` to disable them; instead `htop` will use different symbols to separate the CPU and memory types.
|
||||
|
||||
At the bottom, there's a useful display of active function keys that you can use to do things like filter results or change the sort order. Try out some of the commands to see what they do. Just be careful when trying out `F9`. This will bring up a list of signals that will kill (i.e., stop) a process. I would suggest exploring these options outside of a production environment.
|
||||
|
||||
The author of `htop`, Hisham Muhammad (and yes, it's called `htop` after Hisham) presented a [lightning talk][5] about `htop` at [FOSDEM 2018][6] in February. He explained how `htop` not only has neat graphics, but also surfaces more modern statistical information about processes that older monitoring utilities (like `top`) don't.
|
||||
|
||||
You can read more about `htop` on the [manual page][7] or the [htop website][8]. (Warning: the website contains an animated background of `htop`.)
|
||||
|
||||
#### docker stats
|
||||
|
||||
If you're working with Docker, you can run `docker stats` to generate a context-rich representation of what your containers are doing.
|
||||
|
||||
This can be more helpful than `top` because, instead of separating by processes, you are separating by container. This is especially useful when a container is slow, as seeing which container is using the most resources is quicker than running `top` and trying to map the process to the container.
|
||||
|
||||
The above explanations of acronyms and descriptors in `top` and `htop` should make it easy to understand the ones in `docker stats`. However, the [docker stats documentation][9] provides helpful descriptions of each column.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/8/top-tips-speed-up-computer
|
||||
|
||||
作者:[Katie McLaughlin][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/glasnt
|
||||
[1]:http://man7.org/linux/man-pages/man1/top.1.html
|
||||
[2]:https://en.wikipedia.org/wiki/Uptime
|
||||
[3]:https://en.wikipedia.org/wiki/Load_(computing)
|
||||
[4]:https://en.wikipedia.org/wiki/Nice_(Unix)#Etymology
|
||||
[5]:https://www.youtube.com/watch?v=L25waVhy78o
|
||||
[6]:https://fosdem.org/2018/schedule/event/htop/
|
||||
[7]:https://linux.die.net/man/1/htop
|
||||
[8]:https://hisham.hm/htop/index.php
|
||||
[9]:https://docs.docker.com/engine/reference/commandline/stats/
|
@ -0,0 +1,111 @@
|
||||
5 open source strategy and simulation games for Linux
|
||||
======
|
||||
|
||||

|
||||
|
||||
Gaming has traditionally been one of Linux's weak points. That has changed somewhat in recent years thanks to Steam, GOG, and other efforts to bring commercial games to multiple operating systems, but those games are often not open source. Sure, the games can be played on an open source operating system, but that is not good enough for an open source purist.
|
||||
|
||||
So, can someone who only uses free and open source software find games that are polished enough to present a solid gaming experience without compromising their open source ideals? Absolutely. While open source games are unlikely ever to rival some of the AAA commercial games developed with massive budgets, there are plenty of open source games, in many genres, that are fun to play and can be installed from the repositories of most major Linux distributions. Even if a particular game is not packaged for a particular distribution, it is usually easy to download the game from the project's website to install and play it.
|
||||
|
||||
This article looks at strategy and simulation games. I have already written about [arcade-style games][1], [board & card games][2], [puzzle games][3], [racing & flying games][4], and [role-playing games][5].
|
||||
|
||||
### Freeciv
|
||||
|
||||

|
||||
|
||||
[Freeciv][6] is an open source version of the [Civilization series][7] of computer games. Gameplay is most similar to the earlier games in the Civilization series, and Freeciv even has options to use Civilization 1 and Civilization 2 rule sets. Freeciv involves building cities, exploring the world map, developing technologies, and competing with other civilizations trying to do the same. Victory conditions include defeating all the other civilizations, developing a space colony, or hitting deadline if neither of the first two conditions are met. The game can be played against AI opponents or other human players. Different tile-sets are available to change the look of the game's map.
|
||||
|
||||
To install Freeciv, run the following command:
|
||||
|
||||
* On Fedora: `dnf install freeciv`
|
||||
* On Debian/Ubuntu: `apt install freeciv`
|
||||
|
||||
|
||||
|
||||
### MegaGlest
|
||||
|
||||

|
||||
|
||||
[MegaGlest][8] is an open source real-time strategy game in the style of Blizzard Entertainment's [Warcraft][9] and [StarCraft][10] games. Players control one of several different factions, building structures and recruiting units to explore the map and battle their opponents. At the beginning of the match, a player can build only the most basic buildings and recruit the weakest units. To build and recruit better things, players must work their way up their factions technology tree by building structures and recruiting units that unlock more advanced options. Combat units will attack when enemy units come into range, but for optimal strategy, it is best to manage the battle directly by controlling the units. Simultaneously managing the construction of new structures, recruiting new units, and managing battles can be a challenge, but that is the point of a real-time strategy game. MegaGlest provides a nice variety of factions, so there are plenty of reasons to try new and different strategies.
|
||||
|
||||
To install MegaGlest, run the following command:
|
||||
|
||||
* On Fedora: `dnf install megaglest`
|
||||
* On Debian/Ubuntu: `apt install megaglest`
|
||||
|
||||
|
||||
|
||||
### OpenTTD
|
||||
|
||||

|
||||
|
||||
[OpenTTD][11] (see also [our review][12]) is an open source implementation of [Transport Tycoon Deluxe][13]. The object of the game is to create a transportation network and earn money, which allows the player to build an even bigger transportation network. The network can include boats, buses, trains, trucks, and planes. By default, gameplay takes place between 1950 and 2050, with players aiming to get the highest performance rating possible before time runs out. The performance rating is based on things like the amount of cargo delivered, the number of vehicles they have, and how much money they earned.
|
||||
|
||||
To install OpenTTD, run the following command:
|
||||
|
||||
* On Fedora: `dnf install openttd`
|
||||
* On Debian/Ubuntu: `apt install openttd`
|
||||
|
||||
|
||||
|
||||
### The Battle for Wesnoth
|
||||
|
||||

|
||||
|
||||
[The Battle for Wesnoth][14] is one of the most polished open source games available. This turn-based strategy game has a fantasy setting. Play takes place on a hexagonal grid, where individual units battle each other for control. Each type of unit has unique strengths and weaknesses, which requires players to plan their attacks accordingly. There are many different campaigns available for The Battle for Wesnoth, each with different objectives and storylines. The Battle for Wesnoth also comes with a map editor for players interested in creating their own maps or campaigns.
|
||||
|
||||
To install The Battle for Wesnoth, run the following command:
|
||||
|
||||
* On Fedora: `dnf install wesnoth`
|
||||
* On Debian/Ubuntu: `apt install wesnoth`
|
||||
|
||||
|
||||
|
||||
### UFO: Alien Invasion
|
||||
|
||||

|
||||
|
||||
[UFO: Alien Invasion][15] is an open source tactical strategy game inspired by the [X-COM series][20]. There are two distinct gameplay modes: geoscape and tactical. In geoscape mode, the player takes control of the big picture and deals with managing their bases, researching new technologies, and controlling overall strategy. In tactical mode, the player controls a squad of soldiers and directly confronts the alien invaders in a turn-based battle. Both modes provide different gameplay styles, but both require complex strategy and tactics.
|
||||
|
||||
To install UFO: Alien Invasion, run the following command:
|
||||
|
||||
* On Debian/Ubuntu: `apt install ufoai`
|
||||
|
||||
|
||||
|
||||
Unfortunately, UFO: Alien Invasion is not packaged for Fedora.
|
||||
|
||||
Did I miss one of your favorite open source strategy or simulation games? Share it in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/8/strategy-simulation-games-linux
|
||||
|
||||
作者:[Joshua Allen Holm][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/holmja
|
||||
[1]:https://opensource.com/article/18/1/arcade-games-linux
|
||||
[2]:https://opensource.com/article/18/3/card-board-games-linux
|
||||
[3]:https://opensource.com/article/18/6/puzzle-games-linux
|
||||
[4]:https://opensource.com/article/18/7/racing-flying-games-linux
|
||||
[5]:https://opensource.com/article/18/8/role-playing-games-linux
|
||||
[6]:http://www.freeciv.org/
|
||||
[7]:https://en.wikipedia.org/wiki/Civilization_(series)
|
||||
[8]:https://megaglest.org/
|
||||
[9]:https://en.wikipedia.org/wiki/Warcraft
|
||||
[10]:https://en.wikipedia.org/wiki/StarCraft
|
||||
[11]:https://www.openttd.org/
|
||||
[12]:https://opensource.com/life/15/7/linux-game-review-openttd
|
||||
[13]:https://en.wikipedia.org/wiki/Transport_Tycoon#Transport_Tycoon_Deluxe
|
||||
[14]:https://www.wesnoth.org/
|
||||
[15]:https://ufoai.org/
|
||||
[16]:https://opensource.com/downloads/cheat-sheets?intcmp=7016000000127cYAAQ
|
||||
[17]:https://opensource.com/alternatives?intcmp=7016000000127cYAAQ
|
||||
[18]:https://opensource.com/tags/linux?intcmp=7016000000127cYAAQ
|
||||
[19]:https://developers.redhat.com/cheat-sheets/advanced-linux-commands/?intcmp=7016000000127cYAAQ
|
||||
[20]:https://en.wikipedia.org/wiki/X-COM
|
@ -0,0 +1,221 @@
|
||||
Automating backups on a Raspberry Pi NAS
|
||||
======
|
||||

|
||||
|
||||
In the [first part][1] of this three-part series using a Raspberry Pi for network-attached storage (NAS), we covered the fundamentals of the NAS setup, attached two 1TB hard drives (one for data and one for backups), and mounted the data drive on a remote device via the network filesystem (NFS). In part two, we will look at automating backups. Automated backups allow you to continually secure your data and recover from a hardware defect or accidental file removal.
|
||||
|
||||

|
||||
|
||||
### Backup strategy
|
||||
|
||||
Let's get started by coming up with with a backup strategy for our small NAS. I recommend creating daily backups of your data and scheduling them for a time they won't interfere with other NAS activities, including when you need to access or store your files. For example, you could trigger the backup activities each day at 2am.
|
||||
|
||||
You also need to decide how long you'll keep each backup, since you would quickly run out of storage if you kept each daily backup indefinitely. Keeping your daily backups for one week allows you to travel back into your recent history if you realize something went wrong over the previous seven days. But what if you need something from further in the past? Keeping each Monday backup for a month and one monthly backup for a longer period of time should be sufficient. Let's keep the monthly backups for a year and one backup every year for long-distance time travels, e.g., for the last five years.
|
||||
|
||||
This results in a bunch of backups on your backup drive over a five-year period:
|
||||
|
||||
* 7 daily backups
|
||||
* 4 (approx.) weekly backups
|
||||
* 12 monthly backups
|
||||
* 5 annual backups
|
||||
|
||||
|
||||
|
||||
You may recall that your backup drive and your data drive are of equal size (1TB each). How will more than 10 backups of 1TB from your data drive fit onto a 1TB backup disk? If you create full backups, they won't. Instead, you will create incremental backups, reusing the data from the last backup if it didn't change and creating replicas of new or changed files. That way, the backup doesn't double every night, but only grows a little bit depending on the changes that happen to your data over a day.
|
||||
|
||||
Here is my situation: My NAS has been running since August 2016, and 20 backups are on the backup drive. Currently, I store 406GB of files on the data drive. The backups take up 726GB on my backup drive. Of course, this depends heavily on your data's change frequency, but as you can see, the incremental backups don't consume as much space as 20 full backups would. Nevertheless, over time the 1TB disk will probably become insufficient for your backups. Once your data grows close to the 1TB limit (or whatever your backup drive capacity), you should choose a bigger backup drive and move your data there.
|
||||
|
||||
### Creating backups with rsync
|
||||
|
||||
To create a full backup, you can use the rsync command line tool. Here is an example command to create the initial full backup.
|
||||
```
|
||||
pi@raspberrypi:~ $ rsync -a /nas/data/ /nas/backup/2018-08-01
|
||||
|
||||
```
|
||||
|
||||
This command creates a full replica of all data stored on the data drive, mounted on `/nas/data`, on the backup drive. There, it will create the folder `2018-08-01` and create the backup inside it. The `-a` flag starts rsync in archive-mode, which means it preserves all kinds of metadata, like modification dates, permissions, and owners, and copies soft links as soft links.
|
||||
|
||||
Now that you have created your full, initial backup as of August 1, on August 2, you will create your first daily incremental backup.
|
||||
```
|
||||
pi@raspberrypi:~ $ rsync -a --link-dest /nas/backup/2018-08-01/ /nas/data/ /nas/backup/2018-08-02
|
||||
|
||||
```
|
||||
|
||||
This command tells rsync to again create a backup of `/nas/data`. The target directory this time is `/nas/backup/2018-08-02`. The script also specified the `--link-dest` option and passed the location of the last backup as an argument. With this option specified, rsync looks at the folder `/nas/backup/2018-08-01` and checks what data files changed compared to that folder's content. Unchanged files will not be copied, rather they will be hard-linked to their counterparts in yesterday's backup folder.
|
||||
|
||||
When using a hard-linked file from a backup, you won't notice any difference between the initial copy and the link. They behave exactly the same, and if you delete either the link or the initial file, the other will still exist. You can imagine them as two equal entry points to the same file. Here is an example:
|
||||
|
||||

|
||||
|
||||
The left box reflects the state shortly after the second backup. The box in the middle is yesterday's replica. The `file2.txt` didn't exist yesterday, but the image `file1.jpg` did and was copied to the backup drive. The box on the right reflects today's incremental backup. The incremental backup command created `file2.txt`, which didn't exist yesterday. Since `file1.jpg` didn't change since yesterday, today a hard link is created so it doesn't take much additional space on the disk.
|
||||
|
||||
### Automate your backups
|
||||
|
||||
You probably don't want to execute your daily backup command by hand at 2am each day. Instead, you can automate your backup by using a script like the following, which you may want to start with a cron job.
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
|
||||
TODAY=$(date +%Y-%m-%d)
|
||||
|
||||
DATADIR=/nas/data/
|
||||
|
||||
BACKUPDIR=/nas/backup/
|
||||
|
||||
SCRIPTDIR=/nas/data/backup_scripts
|
||||
|
||||
LASTDAYPATH=${BACKUPDIR}/$(ls ${BACKUPDIR} | tail -n 1)
|
||||
|
||||
TODAYPATH=${BACKUPDIR}/${TODAY}
|
||||
|
||||
if [[ ! -e ${TODAYPATH} ]]; then
|
||||
|
||||
mkdir -p ${TODAYPATH}
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
rsync -a --link-dest ${LASTDAYPATH} ${DATADIR} ${TODAYPATH} $@
|
||||
|
||||
|
||||
|
||||
${SCRIPTDIR}/deleteOldBackups.sh
|
||||
|
||||
```
|
||||
|
||||
The first block calculates the last backup's folder name to use for links and the name of today's backup folder. The second block has the rsync command (as described above). The last block executes a `deleteOldBackups.sh` script. It will clean up the old, unnecessary backups based on the backup strategy outlined above. You could also execute the cleanup script independently from the backup script if you want it to run less frequently.
|
||||
|
||||
The following script is an example implementation of the backup strategy in this how-to article.
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
BACKUPDIR=/nas/backup/
|
||||
|
||||
|
||||
|
||||
function listYearlyBackups() {
|
||||
|
||||
for i in 0 1 2 3 4 5
|
||||
|
||||
do ls ${BACKUPDIR} | egrep "$(date +%Y -d "${i} year ago")-[0-9]{2}-[0-9]{2}" | sort -u | head -n 1
|
||||
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function listMonthlyBackups() {
|
||||
|
||||
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
|
||||
do ls ${BACKUPDIR} | egrep "$(date +%Y-%m -d "${i} month ago")-[0-9]{2}" | sort -u | head -n 1
|
||||
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function listWeeklyBackups() {
|
||||
|
||||
for i in 0 1 2 3 4
|
||||
|
||||
do ls ${BACKUPDIR} | grep "$(date +%Y-%m-%d -d "last monday -${i} weeks")"
|
||||
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function listDailyBackups() {
|
||||
|
||||
for i in 0 1 2 3 4 5 6
|
||||
|
||||
do ls ${BACKUPDIR} | grep "$(date +%Y-%m-%d -d "-${i} day")"
|
||||
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getAllBackups() {
|
||||
|
||||
listYearlyBackups
|
||||
|
||||
listMonthlyBackups
|
||||
|
||||
listWeeklyBackups
|
||||
|
||||
listDailyBackups
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function listUniqueBackups() {
|
||||
|
||||
getAllBackups | sort -u
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function listBackupsToDelete() {
|
||||
|
||||
ls ${BACKUPDIR} | grep -v -e "$(echo -n $(listUniqueBackups) |sed "s/ /\\\|/g")"
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
cd ${BACKUPDIR}
|
||||
|
||||
listBackupsToDelete | while read file_to_delete; do
|
||||
|
||||
rm -rf ${file_to_delete}
|
||||
|
||||
done
|
||||
|
||||
```
|
||||
|
||||
This script will first list all the backups to keep (according to our backup strategy), then it will delete all the backup folders that are not necessary anymore.
|
||||
|
||||
To execute the scripts every night to create daily backups, schedule the backup script by running `crontab -e` as the root user. (You need to be in root to make sure it has permission to read all the files on the data drive, no matter who created them.) Add a line like the following, which starts the script every night at 2am.
|
||||
```
|
||||
0 2 * * * /nas/data/backup_scripts/daily.sh
|
||||
|
||||
```
|
||||
|
||||
For more information, read about [scheduling tasks with cron][2].
|
||||
|
||||
* Unmount your backup drive or mount it as read-only when no backups are running
|
||||
* Attach the backup drive to a remote server and sync the files over the internet
|
||||
|
||||
|
||||
|
||||
There are additional things you can do to fortify your backups against accidental removal or damage, including the following:
|
||||
|
||||
This example backup strategy enables you to back up your valuable data to make sure it won't get lost. You can also easily adjust this technique for your personal needs and preferences.
|
||||
|
||||
In part three of this series, we will talk about [Nextcloud][3], a convenient way to store and access data on your NAS system that also provides offline access as it synchronizes your data to the client devices.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/8/automate-backups-raspberry-pi
|
||||
|
||||
作者:[Manuel Dewald][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/ntlx
|
||||
[1]:https://opensource.com/article/18/7/network-attached-storage-Raspberry-Pi
|
||||
[2]:https://opensource.com/article/17/11/how-use-cron-linux
|
||||
[3]:https://nextcloud.com/
|
@ -0,0 +1,139 @@
|
||||
How To Record Terminal Sessions As SVG Animations In Linux
|
||||
======
|
||||
|
||||

|
||||
|
||||
Recording Terminal sessions may help in several cases. You can use those recording sessions to document everything that you did in Terminal and save them for future reference. You can use them to demonstrate different Linux commands and its use cases to your juniors, students and anyone who are willing to Learn Linux. Luckily, we have many tools to record Terminal sessions in Unix-like operating systems. We already have featured some of the tools/commands which helps you to record the Terminal sessions in the past. You can go through them in the links given below.
|
||||
|
||||
|
||||
+ [How To Record Everything You Do In Terminal][3]
|
||||
+ [Asciinema – Record Terminal Sessions And Share Them On The Web][4]
|
||||
|
||||
|
||||
Today, we are going to see yet another tool to record the Terminal activities. Say hello to **“Termtosvg”**. As the name implies, Termtosvg records your Terminal sessions as standalone SVG animations. It is a simple command line utility written in **Python** programming language. It generates lightweight and clean looking animations embeddable on a project page. It supports custom color themes, terminal UI and animation controls via [SVG templates][1]. It is also compatible with asciinema recording format. Termtosvg supports GNU/Linux, Mac OS and BSD OSes.
|
||||
|
||||
|
||||
### Installing Termtosvg
|
||||
|
||||
Termtosvg can be installed using PIP, a python package manager to install applications written using Python language. If you haven’t installed PIP already, refer the following guide.
|
||||
|
||||
After installing PIP, run the following command to install Termtosvg tool:
|
||||
```
|
||||
$ pip3 install --user termtosvg
|
||||
|
||||
```
|
||||
|
||||
And, install the following prerequisites to render the Terminal screen.
|
||||
```
|
||||
$ pip3 install pyte python-xlib svgwrite
|
||||
|
||||
```
|
||||
|
||||
Done. Let us go ahead and generate Terminal sessions in SVG format.
|
||||
|
||||
### Record Terminal Sessions As SVG Animations In Linux
|
||||
|
||||
Recording Terminal sessions using Termtosvg is very simple. Just open your Terminal window and run the following command to start recording it.
|
||||
```
|
||||
$ termtosvg
|
||||
|
||||
```
|
||||
|
||||
**Note:** If you termtosvg command is not available, restart your system once.
|
||||
|
||||
You will see the following output after running ‘termtosvg’ command:
|
||||
```
|
||||
Recording started, enter "exit" command or Control-D to end
|
||||
|
||||
```
|
||||
|
||||
You will now be in a sub-shell where you can execute the Linux commands as usual. Everything you do in the Terminal will be recorded.
|
||||
|
||||
Let me run a random commands.
|
||||
```
|
||||
$ mkdir mydirectory
|
||||
|
||||
$ cd mydirectory/
|
||||
|
||||
$ touch file.txt
|
||||
|
||||
$ cd ..
|
||||
|
||||
$ uname -a
|
||||
|
||||
```
|
||||
|
||||
Once you’re done, press **CTRL+D** or type **exit** to stop recording. The resulting recording will be saved in **/tmp** folder with a unique name.
|
||||
|
||||

|
||||
|
||||
You can then open the SVG file in any web browser of your choice from Terminal like below.
|
||||
```
|
||||
$ firefox /tmp/termtosvg_ddkehjpu.svg
|
||||
|
||||
```
|
||||
|
||||
You can also directly open the SVG file from browser ( **File - > <path-to-svg>**).
|
||||
|
||||
Here is the output of the above recording in my Firefox browser.
|
||||
|
||||

|
||||
|
||||
Here is some more examples on how to use Termtosvg to record Terminal sessions.
|
||||
|
||||
Like I mentioned already, Termtosvg will record a terminal session and save it as an SVG animation file in **/tmp** directory by default.
|
||||
|
||||
However, you can generate an SVG animation with a custom name, for example **animation.svg** , and save it in a custom location, for example **/home/sk/ostechnix/**.
|
||||
```
|
||||
$ termtosvg /home/sk/ostechnix/animation.svg
|
||||
|
||||
```
|
||||
|
||||
Record a terminal session and render it using a specific template:
|
||||
```
|
||||
$ termtosvg -t ~/templates/my_template.svg
|
||||
|
||||
```
|
||||
|
||||
Record a terminal session with a specific screen geometry:
|
||||
```
|
||||
$ termtosvg -g 80x24 animation.svg
|
||||
|
||||
```
|
||||
|
||||
Record a terminal session in asciicast v2 format:
|
||||
```
|
||||
$ termtosvg record recording.cast
|
||||
|
||||
```
|
||||
|
||||
Render an SVG animation from a recording in asciicast format:
|
||||
```
|
||||
$ termtosvg render recording.cast animation.svg
|
||||
|
||||
```
|
||||
|
||||
For more details, refer [**Termtosvg manual**][2].
|
||||
|
||||
And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned!
|
||||
|
||||
Cheers!
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/how-to-record-terminal-sessions-as-svg-animations-in-linux/
|
||||
|
||||
作者:[SK][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.ostechnix.com/author/sk/
|
||||
[1]:https://nbedos.github.io/termtosvg/pages/templates.html
|
||||
[2]:https://github.com/nbedos/termtosvg/blob/develop/man/termtosvg.md
|
||||
[3]: https://www.ostechnix.com/record-everything-terminal/
|
||||
[4]: https://www.ostechnix.com/asciinema-record-terminal-sessions-share-web/
|
@ -1,227 +1,195 @@
|
||||
盘点 Python 的目标受众
|
||||
============================================================
|
||||
|
||||
Python 是为谁设计的?
|
||||
|
||||
* [Python 的参考解析器使用情况][8]
|
||||
* [CPython 主要服务于哪些受众?][9]
|
||||
* [这些相关问题的原因是什么?][10]
|
||||
* [适合进入 PyPI 规划的方面有哪些?][11]
|
||||
* [当添加它们到标准库中时,为什么一些 API 会被改变?][12]
|
||||
* [为什么一些 API 是以<ruby>临时<rt>provisional</rt></ruby>的形式被添加的?][13]
|
||||
* [为什么只有一些标准库 API 被升级?][14]
|
||||
* [标准库任何部分都有独立的版本吗?][15]
|
||||
* [这些注意事项为什么很重要?][16]
|
||||
|
||||
几年前,我在 python-dev 邮件列表中,以及在活跃的 CPython 核心开发人员和认为参与这一过程不是有效利用他们个人时间和精力的人中[强调][38]说,“CPython 的发展太快了也太慢了”是很多冲突的原因之一。
|
||||
|
||||
我一直认为事实确实如此,但这也是一个要点,在这几年中我也花费了一些时间去反思它。在我写那篇文章的时候,我还在<ruby>波音防务澳大利亚公司<rt>Boeing Defence Australia</rt></ruby>工作。下个月,我将离开波音进入<ruby>红帽亚太<rt>Red Hat Asia-Pacific</rt></ruby>,并且开始在大企业的[开源供应链管理][39]上获得<ruby>再分发者<rt>redistributor</rt></ruby>层面的视角。
|
||||
|
||||
### Python 的参考解析器使用情况
|
||||
|
||||
我尝试将 CPython 的使用情况分解如下,它虽然有些过于简化(注意,这些分类的界线并不是很清晰,他们仅关注于思考新软件特性和版本发布后不同因素的影响):
|
||||
|
||||
* 教育类:教育工作者的主要兴趣在于建模方法的教学和计算操作方面,_不会去_ 写或维护生产级别的软件。例如:
|
||||
* 澳大利亚的 [数字课程][1]
|
||||
* Lorena A. Barba 的 [AeroPython][2]
|
||||
* 个人级的自动化和爱好者的项目:主要的是软件,而且经常是只有软件,用户通常是写它的人。例如:
|
||||
* my Digital Blasphemy [图片下载器][3]
|
||||
* Paul Fenwick 的 (Inter)National [Rick Astley Hotline][4]
|
||||
* <ruby>组织<rt>organisational</rt></ruby>过程自动化:主要是软件,而且经常是只有软件,用户是为了利益而编写它的组织。例如:
|
||||
* CPython 的 [核心工作流工具][5]
|
||||
* Linux 发行版的开发、构建 & 发行管理工具
|
||||
* “<ruby>一劳永逸<rt>Set-and-forget</rt></ruby>” 的基础设施中:这里是软件,(这种说法有时候有些争议),在生命周期中该软件几乎不会升级,但是,在底层平台可能会升级。例如:
|
||||
* 大多数的自我管理的企业或机构的基础设施(在那些资金充足的可持续工程计划中,这种情况是让人非常不安的)
|
||||
* 拨款资助的软件(当最初的拨款耗尽时,维护通常会终止)
|
||||
* 有严格认证要求的软件(如果没有绝对必要的话,从经济性考虑,重新认证比常规更新来说要昂贵很多)
|
||||
* 没有自动升级功能的嵌入式软件系统
|
||||
* 持续升级的基础设施:具有健壮支撑的工程学模型的软件,对于依赖和平台升级通常是例行的,而不去关心其它的代码改变。例如:
|
||||
* Facebook 的 Python 服务基础设施
|
||||
* 滚动发布的 Linux 分发版
|
||||
* 大多数的公共 PaaS 无服务器环境(Heroku、OpenShift、AWS Lambda、Google Cloud Functions、Azure Cloud Functions等等)
|
||||
* 间隔性升级的标准的操作环境:对其核心组件进行常规升级,但这些升级以年为单位进行,而不是周或月。例如:
|
||||
* [VFX 平台][6]
|
||||
* 长周期支持的 Linux 分发版
|
||||
* CPython 和 Python 标准库
|
||||
* 基础设施管理 & 编排工具(比如 OpenStack、 Ansible)
|
||||
* 硬件控制系统
|
||||
* 短生命周期的软件:软件仅被使用一次,然后就丢弃或忽略,而不是随后接着升级。例如:
|
||||
* <ruby>临时<rt>Ad hoc</rt></ruby>自动脚本
|
||||
* 被确定为 “终止” 的单用户游戏(你玩它们一次后,甚至都忘了去卸载它,或许在一个新的设备上都不打算再去安装它)
|
||||
* 短暂的或非持久状态的单用户游戏(如果你卸载并重安装它们,你的游戏体验也不会有什么大的变化)
|
||||
* 特定事件的应用程序(这些应用程序与特定的物理事件捆绑,一旦事件结束,这些应用程序就不再有用了)
|
||||
* 频繁使用的应用程序:部署后定期升级的软件。例如:
|
||||
* 业务管理软件
|
||||
* 个人 & 专业的生产力应用程序(比如,Blender)
|
||||
* 开发工具 & 服务(比如,Mercurial、 Buildbot、 Roundup)
|
||||
* 多用户游戏,和其它明显的处于持续状态的还没有被定义为 “终止” 的游戏
|
||||
* 有自动升级功能的嵌入式软件系统
|
||||
* 共享的抽象层:在一个特定的问题领域中,设计用于让工作更高效的软件组件。即便是你没有亲自掌握该领域的所有错综复杂的东西。例如:
|
||||
* 大多数的运行时库和归入这一类的框架(比如,Django、Flask、Pyramid、SQL Alchemy、NumPy、SciPy、requests)
|
||||
* 适合归入这一类的许多测试和类型推断工具(比如,pytest、Hypothesis、vcrpy、behave、mypy)
|
||||
* 其它应用程序的插件(比如,Blender plugins、OpenStack hardware adapters)
|
||||
* 本身就代表了 “Python 世界” 基准的标准库(那是一个 [难以置信的复杂][7] 的世界观)
|
||||
|
||||
### CPython 主要服务于哪些受众?
|
||||
|
||||
从根本上说,CPython 和标准库的主要受众是哪些呢,是那些不管出于什么原因,将有限的标准库和从 PyPI 显式声明安装的第三方库组合起来所提供的服务,还不能够满足需求的那些人。
|
||||
|
||||
为了更进一步简化上面回顾的不同用法和部署模型,尽可能的总结,将最大的 Python 用户群体分开来看,一种是,在一些感兴趣的环境中将 Python 作为一种_脚本语言_使用的那些人;另外一种是将它用作一个_应用程序开发语言_的那些人,他们最终发布的是一种产品而不是他们的脚本。
|
||||
|
||||
把 Python 作为一种脚本语言来使用的开发者的典型特性包括:
|
||||
|
||||
* 主要的工作单元是由一个 Python 文件组成的(或 Jupyter notebook !),而不是一个 Python 和元数据文件的目录
|
||||
* 没有任何形式的单独的构建步骤 —— 是_作为_一个脚本分发的,类似于分发一个独立的 shell 脚本的方式
|
||||
* 没有单独的安装步骤(除了下载这个文件到一个合适的位置),除了在目标系统上要求预配置运行时环境外
|
||||
* 没有显式的规定依赖关系,除了最低的 Python 版本,或一个预期的运行环境声明。如果需要一个标准库以外的依赖项,他们会通过一个环境脚本去提供(无论是操作系统、数据分析平台、还是嵌入 Python 运行时的应用程序)
|
||||
* 没有单独的测试套件,使用“通过你给定的输入,这个脚本是否给出了你期望的结果?” 这种方式来进行测试
|
||||
* 如果在执行前需要测试,它将以 “试运行” 和 “预览” 模式来向用户展示软件_将_怎样运行
|
||||
* 如果可以完全使用静态代码分析工具,它是通过集成进用户的软件开发环境的,而不是为个别的脚本单独设置的。
|
||||
|
||||
相比之下,使用 Python 作为一个应用程序开发语言的开发者特征包括:
|
||||
|
||||
* 主要的工作单元是由 Python 和元数据文件组成的目录,而不是单个 Python 文件
|
||||
* 在发布之前有一个单独的构建步骤去预处理应用程序,哪怕是把它的这些文件一起打包进一个 Python sdist、wheel 或 zipapp 文档中
|
||||
* 是否有独立的安装步骤去预处理将要使用的应用程序,取决于应用程序是如何打包的,和支持的目标环境
|
||||
* 外部的依赖明确表示为项目目录中的一个元数据文件中,要么是直接在项目的目录中(比如,`pyproject.toml`、`requirements.txt`、`Pipfile`),要么是作为生成的发行包的一部分(比如,`setup.py`、`flit.ini`)
|
||||
* 存在一个独立的测试套件,或者作为一个 Python API 的一个单元测试,或者作为功能接口的集成测试,或者是两者的一个结合
|
||||
* 静态分析工具的使用是在项目级配置的,并作为测试管理的一部分,而不是取决于环境
|
||||
|
||||
作为以上分类的一个结果,CPython 和标准库的主要用途是,在相应的 CPython 特性发布后,为教育和<ruby>临时<rt>ad hoc</rt></ruby>的 Python 脚本环境,最终提供的是定义重分发者假定功能的独立基准 3- 5 年。
|
||||
|
||||
对于<ruby>临时<rt>ad hoc</rt></ruby>脚本使用的情况,这个 3 - 5 年的延迟是由于重分发者给用户制作新版本的延迟造成的,以及那些重分发版本的用户们花在修改他们的标准操作环境上的时间。
|
||||
|
||||
在教育环境中的情况是,教育工作者需要一些时间去评估新特性,和决定是否将它们包含进提供给他们的学生的课程中。
|
||||
|
||||
### 这些相关问题的原因是什么?
|
||||
|
||||
这篇文章很大程度上是受 Twitter 上对 [我的这个评论][20] 的讨论鼓舞的,它援引了定义在 [PEP 411][21] 中<ruby>临时<rt>Provisional</rt></ruby> API 的情形,作为一个开源项目的例子,对用户发出事实上的邀请,请其作为共同开发者去积极参与设计和开发过程,而不是仅被动使用已准备好的最终设计。
|
||||
|
||||
这些回复包括一些在更高级别的库中支持临时 API 的困难程度的一些沮丧性表述、没有这些库做临时状态的传递、以及因此而被限制为只有临时 API 的最新版本才支持这些相关特性,而不是任何早期版本的迭代。
|
||||
|
||||
我的 [主要回应][22] 是,建议开源提供者应该强制实施有限支持,通过这种强制的有限支持可以让个人的维护努力变得可持续。这意味着,如果对临时 API 的老版本提供迭代支持是非常痛苦的,到那时,只有在项目开发人员自己需要、或有人为此支付费用时,他们才会去提供支持。这与我的这个观点是类似的,那就是,志愿者提供的项目是否应该免费支持老的、商业性质的、长周期的 Python 版本,这对他们来说是非常麻烦的事,我[不认为他们应该去做][23],正如我所期望的那样,大多数这样的需求都来自于管理差劲的、习以为常的惯性,而不是真正的需求(真正的需求,应该去支付费用来解决问题)。
|
||||
|
||||
而我的[第二个回应][24]是去实现这一点,尽管多年来一直在讨论这个问题(比如,在上面链接中最早在 2011 年的一篇的文章中,以及在 Python 3 问答的回复中的 [这里][25]、[这里][26]、和[这里][27],以及去年的这篇文章 [Python 包生态系统][28] 中也提到了一些),但我从来没有真实地尝试直接去解释它在标准库设计过程中的影响。
|
||||
|
||||
如果没有这些背景,设计过程中的一部分,比如临时 API 的引入,或者是<ruby>受启发而不同于它<rt>inspired-by-not-the-same-as</rt></ruby>的引入,看起来似乎是完全没有意义的,因为他们看起来似乎是在尝试对 API 进行标准化,而实际上并没有。
|
||||
|
||||
### 适合进入 PyPI 规划的方面有哪些?
|
||||
|
||||
提交给 python-ideas 或 python-dev 的_任何_建议所面临的第一个门槛就是清楚地回答这个问题:“为什么 PyPI 上的一个模块不够好?”。绝大多数的建议都在这一步失败了,为了通过这一步,这里有几个常见的话题:
|
||||
|
||||
* 与其去下载一个合适的第三方库,新手一般可能更倾向于从互联网上 “复制粘贴” 错误的指导。(比如,这就是为什么存在 `secrets` 库的原因:它使得人们很少去使用 `random` 模块,由于安全敏感的原因,它预期用于游戏和统计模拟的)
|
||||
* 这个模块是打算去提供一个实现的参考,并允许与其它的相互竞争的实现之间提供互操作性,而不是对所有人的所有事物都是必要的。(比如,`asyncio`、`wsgiref`、`unittest`、和 `logging` 全部都是这种情况)
|
||||
* 这个模块是预期用于标准库的其它部分(比如,`enum` 就是这种情况,像`unittest`一样)
|
||||
* 这个模块是被设计去支持语言之外的一些语法(比如,`contextlib`、`asyncio` 和 `typing` 模块,就是这种情况)
|
||||
* 这个模块只是普通的临时的脚本用途(比如,`pathlib` 和 `ipaddress` 就是这种情况)
|
||||
* 这个模块被用于一个教育环境(比如,`statistics` 模块允许进行交互式地探索统计的概念,尽管你可能根本就不会用它来做全部的统计分析)
|
||||
|
||||
通过前面的 “PyPI 是不是明显不够好” 的检查,一个模块还不足以确保被接收到标准库中,但它已经足以转变问题为 “在接下来的几年中,你所推荐的要包含的库能否对一般的入门级 Python 开发人员的经验有所提升?”
|
||||
|
||||
标准库中的 `ensurepip` 和 `venv` 模块的引入也明确地告诉再分发者,我们期望的 Python 级别的打包和安装工具在任何平台的特定分发机制中都予以支持。
|
||||
|
||||
### 当添加它们到标准库中时,为什么一些 API 会被改变?
|
||||
|
||||
现在已经存在的第三方模块有时候会被批量地采用到标准库中,在其它情况下,实际上添加的是吸收了用户对现有 API 体验之后,进行重新设计和重新实现的 API,但是,会根据另外的设计考虑和已经成为其中一部分的语言实现参考来进行一些删除或细节修改。
|
||||
|
||||
例如,不像广受欢迎的第三方库的前身 `path.py`,`pathlib` 并_没有_定义字符串子类,而是以独立的类型替代。作为解决文件互操作性问题的结果,定义了文件系统路径协议,它允许使用文件系统路径的接口去使用更多的对象。
|
||||
|
||||
为了在“IP 地址” 这个概念的教学上提供一个更好的工具,为 `ipaddress` 模块设计的 API,将地址和网络的定义调整为显式的、独立定义的主机接口(IP 地址被关联到特定的 IP 网络),而最原始的 `ipaddr` 模块中,在网络术语的使用方式上不那么严格。
|
||||
|
||||
另外的情况是,标准库将综合多种现有的方法的来构建,以及为早已存在的库定义 API 时,还有可能依靠不存在的语法特性。比如,`asyncio` 和 `typing` 模块就全部考虑了这些因素,虽然在 PEP 557 中正在考虑将后者所考虑的因素应用到 `dataclasses` API 上。(它可以被总结为 “像属性一样,但是使用可变注释作为字段声明”)。
|
||||
|
||||
这类改变的原理是,这类库不会消失,并且它们的维护者对标准库维护相关的那些限制通常并不感兴趣(特别是,相对缓慢的发行节奏)。在这种情况下,在标准库文档的更新版本中,很常见的做法是使用 “See Also” 链接指向原始模块,尤其是在第三方版本提供了额外的特性以及标准库模块中忽略的那些特性时。
|
||||
|
||||
### 为什么一些 API 是以临时的形式被添加的?
|
||||
|
||||
虽然 CPython 维护了 API 的弃用策略,但在没有正当理由的情况下,我们通常不会去使用该策略(在其他项目试图与 Python 2.7 保持兼容性时,尤其如此)。
|
||||
|
||||
然而在实践中,当添加这种受已有的第三方启发而不是直接精确拷贝第三方设计的新 API 时,所承担的风险要高于一些正常设计决定可能出现问题的风险。
|
||||
|
||||
当我们考虑这种改变的风险比平常要高,我们将相关的 API 标记为临时,表示保守的终端用户要避免完全依赖它们,而共享抽象层的开发者可能希望,对他们准备去支持的那个临时 API 的版本,考虑实施比平时更严格的限制。
|
||||
|
||||
### 为什么只有一些标准库 API 被升级?
|
||||
|
||||
这里简短的回答得到升级的主要 API 有哪些?:
|
||||
|
||||
* 不太可能有大量的外部因素干扰的附加更新
|
||||
* 无论是对临时脚本使用案例还是对促进将来多个第三方解决方案之间的互操作性,都有明显好处的
|
||||
* 对这方面感兴趣的人提交了一个可接受的建议
|
||||
|
||||
如果一个用于应用程序开发的模块存在一个非常明显的限制,比如,`datetime`,如果重分发者通过可供替代的第三方选择很容易地实现了改善,比如,`requests`,或者,如果标准库的发布节奏与所需要的包之间真的存在冲突,比如,`certifi`,那么,建议对标准库版本进行改变的因素将显著减少。
|
||||
|
||||
从本质上说,这和上面的关于 PyPI 问题正好相反:因为,从应用程序开发人员体验改善的角度来说,PyPI 分发机制通常_是_足够好的,这种分发方式的改进是有意义的,允许重分发者和平台提供者自行决定将哪些内容作为他们缺省提供的一部分。
|
||||
|
||||
假设在 3-5 年时间内,缺省出现了被认为是改变带来的可感知的价值时,才会将这些改变纳入到 CPython 和标准库中。
|
||||
|
||||
### 标准库任何部分都有独立的版本吗?
|
||||
|
||||
是的,它就像是 `ensurepip` 使用的捆绑模式(CPython 发行了一个 `pip` 的最新捆绑版本,而并没有把它放进标准库中),将来可能被应用到其它模块中。
|
||||
|
||||
最有可能的第一个候选者是 `distutils` 构建系统,因为切换到这种模式将允许构建系统在多个发行版本之间保持一致。
|
||||
|
||||
这种处理方式的其它的可能候选者是 Tcl/Tk 图形捆绑和 IDLE 编辑器,它们已经被拆分,并且通过一些重分发程序转换成可选安装项。
|
||||
|
||||
### 这些注意事项为什么很重要?
|
||||
|
||||
从本质上说,那些积极参与开源开发的人就是那些致力于开源应用程序和共享抽象层的人。
|
||||
|
||||
那些写一些临时脚本或为学生设计一些教学习题的人,通常不认为他们是软件开发人员 —— 他们是教师、系统管理员、数据分析人员、金融工程师、流行病学家、物理学家、生物学家、商业分析师、动画师、架构设计师等等。
|
||||
|
||||
对于一种语言,当我们全部的担心都是开发人员的经验时,那么我们就可以根据人们所知道的内容、他们使用的工具种类、他们所遵循的开发流程种类、构建和部署他们软件的方法等假定,来做大量的简化。
|
||||
|
||||
当一个应用程序运行时(runtime),_也_作为一个脚本引擎广为流行时,事情将变的更加复杂。在同一个项目中去平衡两种受众的需求,将就会导致双方的不理解和怀疑,做任何一件事都将变得很困难。
|
||||
|
||||
这篇文章不是为了说,我们在开发 CPython 过程中从来没有做出过不正确的决定 —— 它只是去合理地回应那些对添加到 Python 标准库中的看上去很荒谬的特性的质疑,它将是 “我不是那个特性的预期目标受众的一部分”,而不是 “我对它没有兴趣,因此它对所有人都是毫无用处和没有价值的,添加它纯属骚扰我”。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html
|
||||
|
||||
作者:[Nick Coghlan][a]
|
||||
译者:[qhwdw](https://github.com/qhwdw)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.curiousefficiency.org/pages/about.html
|
||||
[1]:https://aca.edu.au/#home-unpack
|
||||
[2]:https://github.com/barbagroup/AeroPython
|
||||
[3]:https://nbviewer.jupyter.org/urls/bitbucket.org/ncoghlan/misc/raw/default/notebooks/Digital%20Blasphemy.ipynb
|
||||
[4]:https://github.com/pjf/rickastley
|
||||
[5]:https://github.com/python/core-workflow
|
||||
[6]:http://www.vfxplatform.com/
|
||||
[7]:http://www.curiousefficiency.org/posts/2015/10/languages-to-improve-your-python.html#broadening-our-horizons
|
||||
[8]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#use-cases-for-python-s-reference-interpreter
|
||||
[9]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#which-audience-does-cpython-primarily-serve
|
||||
[10]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#why-is-this-relevant-to-anything
|
||||
[11]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#where-does-pypi-fit-into-the-picture
|
||||
[12]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#why-are-some-apis-changed-when-adding-them-to-the-standard-library
|
||||
[13]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#why-are-some-apis-added-in-provisional-form
|
||||
[14]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#why-are-only-some-standard-library-apis-upgraded
|
||||
[15]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#will-any-parts-of-the-standard-library-ever-be-independently-versioned
|
||||
[16]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#why-do-these-considerations-matter
|
||||
[17]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#id1
|
||||
[18]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#id2
|
||||
[19]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#id3
|
||||
[20]:https://twitter.com/ncoghlan_dev/status/916994106819088384
|
||||
[21]:https://www.python.org/dev/peps/pep-0411/
|
||||
[22]:https://twitter.com/ncoghlan_dev/status/917092464355241984
|
||||
[23]:http://www.curiousefficiency.org/posts/2015/04/stop-supporting-python26.html
|
||||
[24]:https://twitter.com/ncoghlan_dev/status/917088410162012160
|
||||
[25]:http://python-notes.curiousefficiency.org/en/latest/python3/questions_and_answers.html#wouldn-t-a-python-2-8-release-help-ease-the-transition
|
||||
[26]:http://python-notes.curiousefficiency.org/en/latest/python3/questions_and_answers.html#doesn-t-this-make-python-look-like-an-immature-and-unstable-platform
|
||||
[27]:http://python-notes.curiousefficiency.org/en/latest/python3/questions_and_answers.html#what-about-insert-other-shiny-new-feature-here
|
||||
[28]:http://www.curiousefficiency.org/posts/2016/09/python-packaging-ecosystem.html
|
||||
[29]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#id4
|
||||
[30]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#id5
|
||||
[31]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#id6
|
||||
[32]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#id7
|
||||
[33]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#id8
|
||||
[34]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#id9
|
||||
[35]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#
|
||||
[36]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#disqus_thread
|
||||
[37]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.rst
|
||||
[38]:http://www.curiousefficiency.org/posts/2011/04/musings-on-culture-of-python-dev.html
|
||||
[39]:http://community.redhat.com/blog/2015/02/the-quid-pro-quo-of-open-infrastructure/
|
||||
[40]:http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html#
|
||||
盘点 Python 的目标受众
|
||||
======
|
||||
|
||||
Python 是为谁设计的?
|
||||
|
||||
几年前,我在 python-dev 邮件列表中,以及在活跃的 CPython 核心开发人员和认为参与这一过程不是有效利用个人时间和精力的人中[强调][17]说,“CPython 的发展太快了也太慢了” 是很多冲突的原因之一。
|
||||
|
||||
我一直认为事实确实如此,但这也是一个要点,在这几年中我也花费了很多时间去反思它。在我写那篇文章的时候,我还在波音防务澳大利亚公司(Boeing Defence Australia)工作。下个月,我离开了波音进入红帽亚太(Red Hat Asia-Pacific),并且开始在大企业的[开源供应链管理][18]方面收获了<ruby>再分发者<rt>redistributor</rt></ruby>层面的视角。
|
||||
|
||||
### Python 的参考解析器使用情况
|
||||
|
||||
我尝试将 CPython 的使用情况分解如下,尽管看起来有些过于简化(注意,这些分类的界线并不是很清晰,他们仅关注于考虑新软件特性和版本发布后不同因素的影响):
|
||||
|
||||
* 教育类:教育工作者的主要兴趣在于建模方法的教学和计算操作方面,不会去编写或维护生产级别的软件。例如:
|
||||
* 澳大利亚的[数字课程][1]
|
||||
* Lorena A. Barba 的 [AeroPython][2]
|
||||
* 个人类的自动化和爱好者的项目:主要且经常是一类自写自用的软件。例如:
|
||||
* my Digital Blasphemy [图片下载器][3]
|
||||
* Paul Fenwick 的 (Inter)National [Rick Astley Hotline][4]
|
||||
* <ruby>组织<rt>organisational</rt></ruby>过程自动化:主要且经常是为组织利益而编写的。例如:
|
||||
* CPython 的[核心工作流工具][5]
|
||||
* Linux 发行版的开发、构建和发行管理工具
|
||||
* “<ruby>一劳永逸<rt>Set-and-forget</rt></ruby>” 的基础设施:这类软件在其生命周期中几乎不会升级,但在底层平台可能会升级(这种说法有时候有些争议)。例如:
|
||||
* 大多数自我管理的企业或机构的基础设施(在那些资金充足的可持续工程计划中,这种情况是让人非常不安的)
|
||||
* 拨款资助的软件(当最初的拨款耗尽时,维护通常会终止)
|
||||
* 有严格认证要求的软件(如果没有绝对必要的话,从经济性考虑,重新认证比常规升级来说要昂贵很多)
|
||||
* 没有自动升级功能的嵌入式软件系统
|
||||
* 持续升级的基础设施:具有健壮支撑的工程学模型的软件,对于依赖和平台升级通常是例行的,不必关心源码变更。例如:
|
||||
* Facebook 的 Python 服务基础设施
|
||||
* 滚动发布的 Linux 分发版
|
||||
* 大多数的公共 PaaS 无服务器环境(Heroku、OpenShift、AWS Lambda、Google Cloud Functions、Azure Cloud Functions 等等)
|
||||
* 长周期性升级的标准的操作环境:对其核心组件进行常规升级,但这些升级以年为单位进行,而不是周或月。例如:
|
||||
* [VFX 平台][6]
|
||||
* <ruby>长期支持<rt>LTS</rt></ruby>的 Linux 分发版
|
||||
* CPython 和 Python 标准库
|
||||
* 基础设施管理和编排工具(如 OpenStack、Ansible)
|
||||
* 硬件控制系统
|
||||
* 短生命周期的软件:软件仅被使用一次,然后就丢弃或忽略,而不是随后接着升级。例如:
|
||||
* <ruby>临时<rt>Ad hoc</rt></ruby>自动化脚本
|
||||
* 被确定为 “终止” 的单用户游戏(你玩了一次后,甚至都忘了去卸载它们,或许在一个新的设备上都不打算再去安装了)
|
||||
* 不具备(或不完整)状态保存的单用户游戏(如果你卸载并重安装它们,游戏体验也不会有什么大的变化)
|
||||
* 特定事件的应用程序(这些应用程序与特定的事件捆绑,一旦事件结束,这些应用程序就不再有用了)
|
||||
* 常规用途的应用程序:部署后定期升级的软件。例如:
|
||||
* 业务管理软件
|
||||
* 个人和专业的生产力应用程序(如 Blender)
|
||||
* 开发工具和服务(如 Mercurial、Buildbot、Roundup)
|
||||
* 多用户游戏,和其它明显处于持续状态还没有被定义为 “终止” 的游戏
|
||||
* 有自动升级功能的嵌入式软件系统
|
||||
* 共享的抽象层:在一个特定的问题领域中,设计用于让工作更高效的软件组件。即便是你没有亲自掌握该领域的所有错综复杂的东西。例如:
|
||||
* 大多数的<ruby>运行时<rt>runtime</rt></ruby>库都归入这一类的框架(如 Django、Flask、Pyramid、SQL Alchemy、NumPy、SciPy、requests)
|
||||
* 适合归入这一类的许多测试和类型接口工具(如 pytest、Hypothesis、vcrpy、behave、mypy)
|
||||
* 其它应用程序的插件(如 Blender plugins、OpenStack hardware adapters)
|
||||
* 本身就代表了 “Python 世界” 基准的标准库(那是一个[难以置信的复杂][7]的世界观)
|
||||
|
||||
### CPython 主要服务于哪些受众?
|
||||
|
||||
从根本上说,CPython 和标准库的主要受众是哪些呢?是那些不管出于什么原因,将有限的标准库和从 PyPI 显式声明安装的第三方库组合起来所提供的服务还不能够满足需求的那些人。
|
||||
|
||||
为了更进一步简化上面回顾的不同用法和部署模型,宏观地将最大的 Python 用户群体分开来看,一类是在一些感兴趣的环境中将 Python 作为一种 _脚本语言_ 使用的人;另外一种是将它用作一个 _应用程序开发语言_ 的人,他们最终发布的是一种产品而不是他们的脚本。
|
||||
|
||||
把 Python 作为一种脚本语言来使用的开发者的典型特性包括:
|
||||
|
||||
* 主要的工作单元是由一个 Python 文件组成的(或 Jupyter notebook),而不是一个 Python 和元数据文件的目录
|
||||
* 没有任何形式的单独的构建步骤 —— 是作为一个脚本分发的,类似于分发一个独立的 shell 脚本的方式
|
||||
* 没有单独的安装步骤(除了下载这个文件到一个合适的位置),因为在目标系统上要求预配置运行时环境
|
||||
* 没有显式的规定依赖关系,除了最低的 Python 版本,或一个预期的运行环境声明。如果需要一个标准库以外的依赖项,他们会通过一个环境脚本去提供(无论是操作系统、数据分析平台、还是嵌入 Python 运行时的应用程序)
|
||||
* 没有单独的测试套件,使用 “通过你给定的输入,这个脚本是否给出了你期望的结果?” 这种方式来进行测试
|
||||
* 如果在执行前需要测试,它将以<ruby>试运行<rt>dry run></rt></ruby>和<ruby>预览<rt>preview</rt></ruby>模式来向用户展示软件将怎样运行
|
||||
* 如果使用静态代码分析工具,则通过集成到用户的软件开发环境中,而不是为每个脚本单独设置
|
||||
|
||||
相比之下,使用 Python 作为一个应用程序开发语言的开发者特征包括:
|
||||
|
||||
* 主要的工作单元是由 Python 和元数据文件组成的目录,而不是单个 Python 文件
|
||||
* 在发布之前有一个单独的构建步骤去预处理应用程序,哪怕是把它的这些文件一起打包进一个 Python sdist、wheel 或 zipapp 中
|
||||
* 应用程序是否有独立的安装步骤做预处理,取决于它是如何打包的,和支持的目标环境
|
||||
* 外部的依赖明确存在于项目目录下的一个元数据文件中,要么是直接在项目目录中(如 `pyproject.toml`、`requirements.txt`、`Pipfile`),要么是作为生成的发行包的一部分(如 `setup.py`、`flit.ini`)
|
||||
* 有独立的测试套件,或者作为一个 Python API 的一个单元测试,或者作为功能接口的集成测试,或者是两者都有
|
||||
* 静态分析工具的使用是在项目级配置的,并作为测试管理的一部分,而不是作为依赖
|
||||
|
||||
作为以上分类的一个结果,CPython 和标准库的主要用途是,在相应的 CPython 特性发布后,为教育和<ruby>临时<rt>ad hoc</rt></ruby>的 Python 脚本环境提供 3-5 年基础维护服务。
|
||||
|
||||
对于临时脚本使用的情况,这个 3-5 年的延迟是由于再分发者给用户开发新版本的延迟造成的,以及那些再分发版本的用户们花在修改他们的标准操作环境上的时间。
|
||||
|
||||
对于教育环境中的情况是,教育工作者需要一些时间去评估新特性,然后决定是否将它们包含进教学的课程中。
|
||||
|
||||
### 这些相关问题的原因是什么?
|
||||
|
||||
这篇文章很大程度上是受 Twitter 上对[我的这个评论][8]的讨论的启发,它援引了定义在 [PEP 411][9] 中<ruby>临时<rt>Provisional</rt></ruby> API 的情形,作为一个开源项目的例子,对用户发出事实上的邀请,请其作为共同开发者去积极参与设计和开发过程,而不是仅被动使用已准备好的最终设计。
|
||||
|
||||
这些回复包括一些在更高级别的库中支持临时 API 的困难程度的一些沮丧性表述,没有这些库做临时状态的传递,因此而被限制为只有临时 API 的最新版本才支持这些相关特性,而不是任何早期版本的迭代。
|
||||
|
||||
我的[主要回应][10]是,建议开源提供者应该强制实施有限支持,通过这种强制的有限支持可以让个人的维护努力变得可持续。这意味着,如果对临时 API 的老版本提供迭代支持是非常痛苦的,那么,只有在项目开发人员自己需要、或有人为此支付费用时,他们才会去提供支持。这与我的这个观点是类似的,那就是,志愿者提供的项目是否应该免费支持老的、商业性质的、长周期的 Python 版本,这对他们来说是非常麻烦的事,我[不认为他们应该这样做][11],正如我所期望的那样,大多数这样的需求都来自于管理差劲的惯性,而不是真正的需求(真正的需求,应该去支付费用来解决问题)。
|
||||
|
||||
而我的[第二个回应][12]是去实现这一点,尽管多年来一直在讨论这个问题(比如,在上面链接中最早在 2011 年的一篇的文章中,以及在 Python 3 问答的回复中的[这里][13]、[这里][14]、和[这里][15],以及去年的这篇文章 [Python 包生态系统][16]中也提到了一些),但我从来没有真实地尝试直接去解释它在标准库设计过程中的影响。
|
||||
|
||||
如果没有这些背景,设计过程中的一部分,比如临时 API 的引入,或者是<ruby>受启发而不同于它<rt>inspired-by-not-the-same-as</rt></ruby>的引入,看起来似乎是完全没有意义的,因为他们看起来似乎是在尝试对 API 进行标准化,而实际上并没有。
|
||||
|
||||
### 适合进入 PyPI 规划的方面有哪些?
|
||||
|
||||
任何提交给 python-ideas 或 python-dev 的提案所面临的第一个门槛就是清楚地回答这个问题:“为什么 PyPI 上的模块不够好?”。绝大多数的提案都在这一步失败了,为了通过这一步,这里有几个常见的话题:
|
||||
|
||||
* 比起下载一个合适的第三方库,新手一般可能更倾向于从互联网上 “复制粘贴” 错误的指导。(这就是为什么存在 `secrets` 库的原因:它使得人们很少去使用 `random` 模块,由于安全敏感的原因,它预期用于游戏和模拟统计)
|
||||
* 该模块旨在提供一个参考实现,并允许与其它的竞争实现之间提供互操作性,而不是对所有人的所有事物都是必要的。(如 `asyncio`、`wsgiref`、`unittest`、和 `logging` 都是这种情况)
|
||||
* 该模块是预期用于标准库的其它部分(如 `enum` 就是这种情况,像 `unittest` 一样)
|
||||
* 该模块是被设计用于支持语言之外的一些语法(如 `contextlib`、`asyncio` 和 `typing`)
|
||||
* 该模块只是普通的临时的脚本用途(如 `pathlib` 和 `ipaddress`)
|
||||
* 该模块被用于一个教育环境(例如,`statistics` 模块允许进行交互式地探索统计的概念,尽管你可能根本就不会用它来做完整的统计分析)
|
||||
|
||||
只通过了前面的 “PyPI 是不是明显不够好” 的检查,一个模块还不足以确保被纳入标准库中,但它已经足以将问题转变为 “在未来几年中,你所推荐的要包含的库能否对一般的入门级 Python 开发人员的经验有所提升?”
|
||||
|
||||
标准库中的 `ensurepip` 和 `venv` 模块的引入也明确地告诉再分发者,我们期望的 Python 级别的打包和安装工具在任何平台的特定分发机制中都予以支持。
|
||||
|
||||
### 当添加它们到标准库中时,为什么一些 API 会被修改?
|
||||
|
||||
现有的第三方模块有时候会被批量地采用到标准库中,在其它情况下,实际上添加的是吸收了用户对现有 API 体验之后进行重新设计和重新实现的 API,但是会根据另外的设计考虑和已经成为其中一部分的语言实现参考来进行一些删除或细节修改。
|
||||
|
||||
例如,与流行的第三方库 `path.py`、`pathlib` 的前身不同,它们并没有定义字符串子类,而是以独立的类型替代。作为解决文件互操作性问题的结果,定义了文件系统路径协议,它允许使用文件系统路径的接口去使用更多的对象。
|
||||
|
||||
为了在 “IP 地址” 这个概念的教学上提供一个更好的工具,`ipaddress` 模块设计调整为明确地将主机接口定义与地址和网络的定义区分开(IP 地址被关联到特定的 IP 网络),而最原始的 `ipaddr` 模块中,在网络术语的使用方式上不那么严格。
|
||||
|
||||
另外的情况是,标准库将综合多种现有的方法的来构建,以及为早已存在的库定义 API 时,还有可能依赖不存在的语法特性。比如,`asyncio` 和 `typing` 模块就全部考虑了这些因素,虽然在 PEP 557 中正在考虑将后者所考虑的因素应用到 `dataclasses` API 上。(它可以被总结为 “像属性一样,但是使用可变注释作为字段声明”)。
|
||||
|
||||
这类修改的原理是,这类库不会消失,并且它们的维护者对标准库维护相关的那些限制通常并不感兴趣(特别是相对缓慢的发布节奏)。在这种情况下,在标准库文档的更新版本中使用 “See Also” 链接指向原始模块的做法非常常见,尤其是在第三方版本额外提供了标准库模块中忽略的那些特性时。
|
||||
|
||||
### 为什么一些 API 是以临时的形式被添加的?
|
||||
|
||||
虽然 CPython 维护了 API 的弃用策略,但在没有正当理由的情况下,我们通常不会去使用该策略(在其他项目试图与 Python 2.7 保持兼容性时,尤其如此)。
|
||||
|
||||
然而在实践中,当添加这种受已有的第三方启发而不是直接精确拷贝第三方设计的新 API 时,所承担的风险要高于一些正常设计决定可能出现问题的风险。
|
||||
|
||||
当我们考虑到这种改变的风险比平常要高,我们将相关的 API 标记为临时,表示保守的终端用户要避免完全依赖它们,而共享抽象层的开发者可能希望对他们准备去支持的那个临时 API 的版本考虑实施比平时更严格的限制。
|
||||
|
||||
### 为什么只有一些标准库 API 被升级?
|
||||
|
||||
这里简短的回答得到升级的主要 API 有哪些:
|
||||
|
||||
* 不太可能有大量的外部因素干扰的附加更新的
|
||||
* 无论是对临时脚本用例还是对促进将来多个第三方解决方案之间的互操作性,都有明显好处的
|
||||
* 对这方面感兴趣的人提交了一个可接受的建议的
|
||||
|
||||
如果在将模块用于应用程序开发目的时(如 `datetime`),现有模块的限制主要是显而易见的,如果再分发者通过第三方方案很容易地实现了改进,(如 `requests`),或者如果标准库的发布节奏与所需要的包之间真的存在冲突,(如 `certifi`),那么,建议对标准库版本进行改变的因素将显著减少。
|
||||
|
||||
从本质上说,这和上面关于 PyPI 问题正好相反:因为从应用程序开发人员体验的角度来说,PyPI 的分发机制通常已经够好了,这种分发方式的改进是有意义的,允许再分发者和平台提供者自行决定将哪些内容作为他们缺省提供的一部分。
|
||||
|
||||
假设在 3-5 年时间内,缺省出现了被认为是改变带来的可感知的价值时,才会将这些改变纳入到 CPython 和标准库中。
|
||||
|
||||
### 标准库任何部分都有独立的版本吗?
|
||||
|
||||
是的,就像是 `ensurepip` 使用的捆绑模式(CPython 发行了一个 `pip` 的最新捆绑版本,而并没有把它放进标准库中),将来可能被应用到其它模块中。
|
||||
|
||||
最有可能的第一个候选者是 `distutils` 构建系统,因为切换到这种模式将允许构建系统在多个发行版本之间保持一致。
|
||||
|
||||
这种处理方式的其它可能候选者是 Tcl/Tk 图形套件和 IDLE 编辑器,它们已经被拆分,并且一些开发者将其改为可选安装项。
|
||||
|
||||
### 这些注意事项为什么很重要?
|
||||
|
||||
从本质上说,那些积极参与开源开发的人就是那些致力于开源应用程序和共享抽象层的人。
|
||||
|
||||
那些写一些临时脚本或为学生设计一些教学习题的人,通常不认为他们是软件开发人员 —— 他们是教师、系统管理员、数据分析人员、金融工程师、流行病学家、物理学家、生物学家、市场研究员、动画师、平面设计师等等。
|
||||
|
||||
对于一种语言,当我们全部的担心都是开发人员的经验时,那么我们就可以根据人们所知道的内容、他们使用的工具种类、他们所遵循的开发流程种类、构建和部署他们软件的方法等假定,来做大量的简化。
|
||||
|
||||
当应用程序运行时作为脚本引擎广泛流行时,事情会变得更加复杂。做好任何一项工作已经很困难,并且作为单个项目的一部分来平衡两个受众的需求会导致双方经常不理解和不相信。
|
||||
|
||||
这篇文章不是为了说明我们在开发 CPython 过程中从来没有做出过不正确的决定 —— 它只是去合理地回应那些对添加到 Python 标准库中的看上去很荒谬的特性的质疑,它将是 “我不是那个特性的预期目标受众的一部分”,而不是 “我对它没有兴趣,因此它对所有人都是毫无用处和没有价值的,添加它纯属骚扰我”。
|
||||
|
||||
---
|
||||
|
||||
via: http://www.curiousefficiency.org/posts/2017/10/considering-pythons-target-audience.html
|
||||
|
||||
作者:[Nick Coghlan][a]
|
||||
译者:[qhwdw](https://github.com/qhwdw)
|
||||
校对:[wxy](https://github.com/wxy)、[pityonline](https://github.com/pityonline)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: http://www.curiousefficiency.org/pages/about.html
|
||||
[1]: https://aca.edu.au/#home-unpack
|
||||
[2]: https://github.com/barbagroup/AeroPython
|
||||
[3]: https://nbviewer.jupyter.org/urls/bitbucket.org/ncoghlan/misc/raw/default/notebooks/Digital%20Blasphemy.ipynb
|
||||
[4]: https://github.com/pjf/rickastley
|
||||
[5]: https://github.com/python/core-workflow
|
||||
[6]: http://www.vfxplatform.com/
|
||||
[7]: http://www.curiousefficiency.org/posts/2015/10/languages-to-improve-your-python.html#broadening-our-horizons
|
||||
[8]: https://twitter.com/ncoghlan_dev/status/916994106819088384
|
||||
[9]: https://www.python.org/dev/peps/pep-0411/
|
||||
[10]: https://twitter.com/ncoghlan_dev/status/917092464355241984
|
||||
[11]: http://www.curiousefficiency.org/posts/2015/04/stop-supporting-python26.html
|
||||
[12]: https://twitter.com/ncoghlan_dev/status/917088410162012160
|
||||
[13]: http://python-notes.curiousefficiency.org/en/latest/python3/questions_and_answers.html#wouldn-t-a-python-2-8-release-help-ease-the-transition
|
||||
[14]: http://python-notes.curiousefficiency.org/en/latest/python3/questions_and_answers.html#doesn-t-this-make-python-look-like-an-immature-and-unstable-platform
|
||||
[15]: http://python-notes.curiousefficiency.org/en/latest/python3/questions_and_answers.html#what-about-insert-other-shiny-new-feature-here
|
||||
[16]: http://www.curiousefficiency.org/posts/2016/09/python-packaging-ecosystem.html
|
||||
[17]: http://www.curiousefficiency.org/posts/2011/04/musings-on-culture-of-python-dev.html
|
||||
[18]: http://community.redhat.com/blog/2015/02/the-quid-pro-quo-of-open-infrastructure/
|
||||
|
@ -1,516 +0,0 @@
|
||||
如何查看 Linux 中所有正在运行的服务
|
||||
======
|
||||
|
||||
|
||||
有许多方法和工具可以查看 Linux 中所有正在运行的服务。大多数管理员会在 sysVinit 系统中使用 `service service-name status` 或 `/etc/init.d/service-name status`,而在 systemd 系统中使用 `systemctl status service-name`。
|
||||
|
||||
以上命令可以清楚地显示该服务是否在服务器上运行,这也是每个 Linux 管理员都该知道的非常简单和基础的命令。
|
||||
|
||||
如果你对系统环境并不熟悉,也不清楚系统在运行哪些服务,你会如何检查?
|
||||
|
||||
是的,我们的确有必要这样检查一下。这将有助于我们了解系统上运行了什么服务,以及哪些是必要的、哪些需要被禁用。
|
||||
|
||||
### 什么是 SysVinit
|
||||
|
||||
init(初始化 initialization 的简称)是在系统启动期间运行的第一个进程。Init 是一个守护进程,它将持续运行直至关机。
|
||||
|
||||
SysVinit 是早期传统的 init 系统和系统管理器。由于 sysVinit 系统上一些长期悬而未决的问题,大多数最新的发行版都适用于 systemd 系统。
|
||||
|
||||
### 什么是 systemd
|
||||
|
||||
systemd 是一个新的 init 系统以及系统管理器,它已成为大多数 Linux 发行版中非常流行且广泛适应的新的标准 init 系统。Systemctl 是一个 systemd 管理工具,它可以帮助我们管理 systemd 系统。
|
||||
|
||||
### 方法一:如何在 sysVinit 系统中查看运行的服务
|
||||
|
||||
以下命令可以帮助我们列出 sysVinit 系统中所有正在运行的服务。
|
||||
|
||||
如果服务很多,我建议使用文件视图命令,如 less、more 等,以便得到清晰的结果。
|
||||
```
|
||||
# service --status-all
|
||||
or
|
||||
# service --status-all | more
|
||||
or
|
||||
# service --status-all | less
|
||||
|
||||
abrt-ccpp hook is installed
|
||||
abrtd (pid 2131) is running...
|
||||
abrt-dump-oops is stopped
|
||||
acpid (pid 1958) is running...
|
||||
atd (pid 2164) is running...
|
||||
auditd (pid 1731) is running...
|
||||
Frequency scaling enabled using ondemand governor
|
||||
crond (pid 2153) is running...
|
||||
hald (pid 1967) is running...
|
||||
htcacheclean is stopped
|
||||
httpd is stopped
|
||||
Table: filter
|
||||
Chain INPUT (policy ACCEPT)
|
||||
num target prot opt source destination
|
||||
1 ACCEPT all ::/0 ::/0 state RELATED,ESTABLISHED
|
||||
2 ACCEPT icmpv6 ::/0 ::/0
|
||||
3 ACCEPT all ::/0 ::/0
|
||||
4 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:80
|
||||
5 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:21
|
||||
6 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:22
|
||||
7 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:25
|
||||
8 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:2082
|
||||
9 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:2086
|
||||
10 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:2083
|
||||
11 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:2087
|
||||
12 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:10000
|
||||
13 REJECT all ::/0 ::/0 reject-with icmp6-adm-prohibited
|
||||
|
||||
Chain FORWARD (policy ACCEPT)
|
||||
num target prot opt source destination
|
||||
1 REJECT all ::/0 ::/0 reject-with icmp6-adm-prohibited
|
||||
|
||||
Chain OUTPUT (policy ACCEPT)
|
||||
num target prot opt source destination
|
||||
|
||||
iptables: Firewall is not running.
|
||||
irqbalance (pid 1826) is running...
|
||||
Kdump is operational
|
||||
lvmetad is stopped
|
||||
mdmonitor is stopped
|
||||
messagebus (pid 1929) is running...
|
||||
SUCCESS! MySQL running (24376)
|
||||
rndc: neither /etc/rndc.conf nor /etc/rndc.key was found
|
||||
named is stopped
|
||||
netconsole module not loaded
|
||||
Usage: startup.sh { start | stop }
|
||||
Configured devices:
|
||||
lo eth0 eth1
|
||||
Currently active devices:
|
||||
lo eth0
|
||||
ntpd is stopped
|
||||
portreserve (pid 1749) is running...
|
||||
master (pid 2107) is running...
|
||||
Process accounting is disabled.
|
||||
quota_nld is stopped
|
||||
rdisc is stopped
|
||||
rngd is stopped
|
||||
rpcbind (pid 1840) is running...
|
||||
rsyslogd (pid 1756) is running...
|
||||
sandbox is stopped
|
||||
saslauthd is stopped
|
||||
smartd is stopped
|
||||
openssh-daemon (pid 9859) is running...
|
||||
svnserve is stopped
|
||||
vsftpd (pid 4008) is running...
|
||||
xinetd (pid 2031) is running...
|
||||
zabbix_agentd (pid 2150 2149 2148 2147 2146 2140) is running...
|
||||
|
||||
```
|
||||
|
||||
执行以下命令,可以只查看正在运行的服务。
|
||||
```
|
||||
# service --status-all | grep running
|
||||
|
||||
crond (pid 535) is running...
|
||||
httpd (pid 627) is running...
|
||||
mysqld (pid 911) is running...
|
||||
rndc: neither /etc/rndc.conf nor /etc/rndc.key was found
|
||||
rsyslogd (pid 449) is running...
|
||||
saslauthd (pid 492) is running...
|
||||
sendmail (pid 509) is running...
|
||||
sm-client (pid 519) is running...
|
||||
openssh-daemon (pid 478) is running...
|
||||
xinetd (pid 485) is running...
|
||||
|
||||
```
|
||||
|
||||
运行以下命令以查看指定服务的状态。
|
||||
```
|
||||
# service --status-all | grep httpd
|
||||
httpd (pid 627) is running...
|
||||
|
||||
```
|
||||
|
||||
或者,使用以下命令也可以查看指定服务的状态。
|
||||
```
|
||||
# service httpd status
|
||||
|
||||
httpd (pid 627) is running...
|
||||
|
||||
```
|
||||
|
||||
使用以下命令查看系统启动时哪些服务会被启用。
|
||||
```
|
||||
# chkconfig --list
|
||||
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
htcacheclean 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
httpd 0:off 1:off 2:off 3:on 4:off 5:off 6:off
|
||||
ip6tables 0:off 1:off 2:on 3:off 4:on 5:on 6:off
|
||||
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
modules_dep 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
named 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
netfs 0:off 1:off 2:off 3:off 4:on 5:on 6:off
|
||||
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
nmb 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
nscd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
portreserve 0:off 1:off 2:on 3:off 4:on 5:on 6:off
|
||||
quota_nld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
restorecond 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
rpcbind 0:off 1:off 2:on 3:off 4:on 5:on 6:off
|
||||
rsyslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
saslauthd 0:off 1:off 2:off 3:on 4:off 5:off 6:off
|
||||
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
smb 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
snmpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
snmptrapd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
||||
udev-post 0:off 1:on 2:on 3:off 4:on 5:on 6:off
|
||||
winbind 0:off 1:off 2:off 3:off 4:off 5:off 6:off
|
||||
xinetd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
|
||||
|
||||
xinetd based services:
|
||||
chargen-dgram: off
|
||||
chargen-stream: off
|
||||
daytime-dgram: off
|
||||
daytime-stream: off
|
||||
discard-dgram: off
|
||||
discard-stream: off
|
||||
echo-dgram: off
|
||||
echo-stream: off
|
||||
finger: off
|
||||
ntalk: off
|
||||
rsync: off
|
||||
talk: off
|
||||
tcpmux-server: off
|
||||
time-dgram: off
|
||||
time-stream: off
|
||||
|
||||
```
|
||||
|
||||
### 方法二:如何在 systemd 系统中查看运行的服务
|
||||
|
||||
以下命令帮助我们列出 systemd 系统中所有服务。
|
||||
```
|
||||
# systemctl
|
||||
|
||||
UNIT LOAD ACTIVE SUB DESCRIPTION
|
||||
sys-devices-virtual-block-loop0.device loaded active plugged /sys/devices/virtual/block/loop0
|
||||
sys-devices-virtual-block-loop1.device loaded active plugged /sys/devices/virtual/block/loop1
|
||||
sys-devices-virtual-block-loop2.device loaded active plugged /sys/devices/virtual/block/loop2
|
||||
sys-devices-virtual-block-loop3.device loaded active plugged /sys/devices/virtual/block/loop3
|
||||
sys-devices-virtual-block-loop4.device loaded active plugged /sys/devices/virtual/block/loop4
|
||||
sys-devices-virtual-misc-rfkill.device loaded active plugged /sys/devices/virtual/misc/rfkill
|
||||
sys-devices-virtual-tty-ttyprintk.device loaded active plugged /sys/devices/virtual/tty/ttyprintk
|
||||
sys-module-fuse.device loaded active plugged /sys/module/fuse
|
||||
sys-subsystem-net-devices-enp0s3.device loaded active plugged 82540EM Gigabit Ethernet Controller (PRO/1000 MT Desktop Adapter)
|
||||
-.mount loaded active mounted Root Mount
|
||||
dev-hugepages.mount loaded active mounted Huge Pages File System
|
||||
dev-mqueue.mount loaded active mounted POSIX Message Queue File System
|
||||
run-user-1000-gvfs.mount loaded active mounted /run/user/1000/gvfs
|
||||
run-user-1000.mount loaded active mounted /run/user/1000
|
||||
snap-core-3887.mount loaded active mounted Mount unit for core
|
||||
snap-core-4017.mount loaded active mounted Mount unit for core
|
||||
snap-core-4110.mount loaded active mounted Mount unit for core
|
||||
snap-gping-13.mount loaded active mounted Mount unit for gping
|
||||
snap-termius\x2dapp-8.mount loaded active mounted Mount unit for termius-app
|
||||
sys-fs-fuse-connections.mount loaded active mounted FUSE Control File System
|
||||
sys-kernel-debug.mount loaded active mounted Debug File System
|
||||
acpid.path loaded active running ACPI Events Check
|
||||
cups.path loaded active running CUPS Scheduler
|
||||
systemd-ask-password-plymouth.path loaded active waiting Forward Password Requests to Plymouth Directory Watch
|
||||
systemd-ask-password-wall.path loaded active waiting Forward Password Requests to Wall Directory Watch
|
||||
init.scope loaded active running System and Service Manager
|
||||
session-c2.scope loaded active running Session c2 of user magi
|
||||
accounts-daemon.service loaded active running Accounts Service
|
||||
acpid.service loaded active running ACPI event daemon
|
||||
anacron.service loaded active running Run anacron jobs
|
||||
apache2.service loaded active running The Apache HTTP Server
|
||||
apparmor.service loaded active exited AppArmor initialization
|
||||
apport.service loaded active exited LSB: automatic crash report generation
|
||||
aptik-battery-monitor.service loaded active running LSB: start/stop the aptik battery monitor daemon
|
||||
atop.service loaded active running Atop advanced performance monitor
|
||||
atopacct.service loaded active running Atop process accounting daemon
|
||||
avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack
|
||||
colord.service loaded active running Manage, Install and Generate Color Profiles
|
||||
console-setup.service loaded active exited Set console font and keymap
|
||||
cron.service loaded active running Regular background program processing daemon
|
||||
cups-browsed.service loaded active running Make remote CUPS printers available locally
|
||||
cups.service loaded active running CUPS Scheduler
|
||||
dbus.service loaded active running D-Bus System Message Bus
|
||||
postfix.service loaded active exited Postfix Mail Transport Agent
|
||||
|
||||
```
|
||||
|
||||
* **`UNIT`** 相应的 systemd 单元名称
|
||||
* **`LOAD`** 相应的单元是否被加载到内存中
|
||||
* **`ACTIVE`** 该单元是否处于活动状态
|
||||
* **`SUB`** 该单元是否处于运行状态(LCTT 译者注:是较于 ACTIVE 更加详细的状态描述,不同的单元类型有不同的状态。)
|
||||
* **`DESCRIPTION`** 关于该单元的简短描述
|
||||
|
||||
|
||||
以下选项可根据类型列出单元。
|
||||
```
|
||||
# systemctl list-units --type service
|
||||
UNIT LOAD ACTIVE SUB DESCRIPTION
|
||||
accounts-daemon.service loaded active running Accounts Service
|
||||
acpid.service loaded active running ACPI event daemon
|
||||
anacron.service loaded active running Run anacron jobs
|
||||
apache2.service loaded active running The Apache HTTP Server
|
||||
apparmor.service loaded active exited AppArmor initialization
|
||||
apport.service loaded active exited LSB: automatic crash report generation
|
||||
aptik-battery-monitor.service loaded active running LSB: start/stop the aptik battery monitor daemon
|
||||
atop.service loaded active running Atop advanced performance monitor
|
||||
atopacct.service loaded active running Atop process accounting daemon
|
||||
avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack
|
||||
colord.service loaded active running Manage, Install and Generate Color Profiles
|
||||
console-setup.service loaded active exited Set console font and keymap
|
||||
cron.service loaded active running Regular background program processing daemon
|
||||
cups-browsed.service loaded active running Make remote CUPS printers available locally
|
||||
cups.service loaded active running CUPS Scheduler
|
||||
dbus.service loaded active running D-Bus System Message Bus
|
||||
fwupd.service loaded active running Firmware update daemon
|
||||
[email protected] loaded active running Getty on tty1
|
||||
grub-common.service loaded active exited LSB: Record successful boot for GRUB
|
||||
irqbalance.service loaded active running LSB: daemon to balance interrupts for SMP systems
|
||||
keyboard-setup.service loaded active exited Set the console keyboard layout
|
||||
kmod-static-nodes.service loaded active exited Create list of required static device nodes for the current kernel
|
||||
|
||||
```
|
||||
|
||||
以下选项可帮助您根据状态列出单位,输出与前例类似但更直截了当。
|
||||
```
|
||||
# systemctl list-unit-files --type service
|
||||
|
||||
UNIT FILE STATE
|
||||
accounts-daemon.service enabled
|
||||
acpid.service disabled
|
||||
alsa-restore.service static
|
||||
alsa-state.service static
|
||||
alsa-utils.service masked
|
||||
anacron-resume.service enabled
|
||||
anacron.service enabled
|
||||
apache-htcacheclean.service disabled
|
||||
[email protected] disabled
|
||||
apache2.service enabled
|
||||
[email protected] disabled
|
||||
apparmor.service enabled
|
||||
[email protected] static
|
||||
apport.service generated
|
||||
apt-daily-upgrade.service static
|
||||
apt-daily.service static
|
||||
aptik-battery-monitor.service generated
|
||||
atop.service enabled
|
||||
atopacct.service enabled
|
||||
[email protected] enabled
|
||||
avahi-daemon.service enabled
|
||||
bluetooth.service enabled
|
||||
|
||||
```
|
||||
|
||||
运行以下命令以查看指定服务的状态。
|
||||
```
|
||||
# systemctl | grep apache2
|
||||
apache2.service loaded active running The Apache HTTP Server
|
||||
|
||||
```
|
||||
|
||||
或者,使用以下命令也可查看指定服务的状态。
|
||||
```
|
||||
# systemctl status apache2
|
||||
● apache2.service - The Apache HTTP Server
|
||||
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
|
||||
Drop-In: /lib/systemd/system/apache2.service.d
|
||||
└─apache2-systemd.conf
|
||||
Active: active (running) since Tue 2018-03-06 12:34:09 IST; 8min ago
|
||||
Process: 2786 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
|
||||
Main PID: 1171 (apache2)
|
||||
Tasks: 55 (limit: 4915)
|
||||
CGroup: /system.slice/apache2.service
|
||||
├─1171 /usr/sbin/apache2 -k start
|
||||
├─2790 /usr/sbin/apache2 -k start
|
||||
└─2791 /usr/sbin/apache2 -k start
|
||||
|
||||
Mar 06 12:34:08 magi-VirtualBox systemd[1]: Starting The Apache HTTP Server...
|
||||
Mar 06 12:34:09 magi-VirtualBox apachectl[1089]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.0.2.15. Set the 'ServerName' directive globally to suppre
|
||||
Mar 06 12:34:09 magi-VirtualBox systemd[1]: Started The Apache HTTP Server.
|
||||
Mar 06 12:39:10 magi-VirtualBox systemd[1]: Reloading The Apache HTTP Server.
|
||||
Mar 06 12:39:10 magi-VirtualBox apachectl[2786]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using fe80::7929:4ed1:279f:4d65. Set the 'ServerName' directive gl
|
||||
Mar 06 12:39:10 magi-VirtualBox systemd[1]: Reloaded The Apache HTTP Server.
|
||||
|
||||
```
|
||||
|
||||
执行以下命令,只查看正在运行的服务。
|
||||
```
|
||||
# systemctl | grep running
|
||||
acpid.path loaded active running ACPI Events Check
|
||||
cups.path loaded active running CUPS Scheduler
|
||||
init.scope loaded active running System and Service Manager
|
||||
session-c2.scope loaded active running Session c2 of user magi
|
||||
accounts-daemon.service loaded active running Accounts Service
|
||||
acpid.service loaded active running ACPI event daemon
|
||||
apache2.service loaded active running The Apache HTTP Server
|
||||
aptik-battery-monitor.service loaded active running LSB: start/stop the aptik battery monitor daemon
|
||||
atop.service loaded active running Atop advanced performance monitor
|
||||
atopacct.service loaded active running Atop process accounting daemon
|
||||
avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack
|
||||
colord.service loaded active running Manage, Install and Generate Color Profiles
|
||||
cron.service loaded active running Regular background program processing daemon
|
||||
cups-browsed.service loaded active running Make remote CUPS printers available locally
|
||||
cups.service loaded active running CUPS Scheduler
|
||||
dbus.service loaded active running D-Bus System Message Bus
|
||||
fwupd.service loaded active running Firmware update daemon
|
||||
[email protected] loaded active running Getty on tty1
|
||||
irqbalance.service loaded active running LSB: daemon to balance interrupts for SMP systems
|
||||
lightdm.service loaded active running Light Display Manager
|
||||
ModemManager.service loaded active running Modem Manager
|
||||
NetworkManager.service loaded active running Network Manager
|
||||
polkit.service loaded active running Authorization Manager
|
||||
|
||||
```
|
||||
|
||||
使用以下命令查看系统启动时会被启用的服务列表。
|
||||
```
|
||||
# systemctl list-unit-files | grep enabled
|
||||
acpid.path enabled
|
||||
cups.path enabled
|
||||
accounts-daemon.service enabled
|
||||
anacron-resume.service enabled
|
||||
anacron.service enabled
|
||||
apache2.service enabled
|
||||
apparmor.service enabled
|
||||
atop.service enabled
|
||||
atopacct.service enabled
|
||||
[email protected] enabled
|
||||
avahi-daemon.service enabled
|
||||
bluetooth.service enabled
|
||||
console-setup.service enabled
|
||||
cron.service enabled
|
||||
cups-browsed.service enabled
|
||||
cups.service enabled
|
||||
display-manager.service enabled
|
||||
dns-clean.service enabled
|
||||
friendly-recovery.service enabled
|
||||
[email protected] enabled
|
||||
gpu-manager.service enabled
|
||||
keyboard-setup.service enabled
|
||||
lightdm.service enabled
|
||||
ModemManager.service enabled
|
||||
network-manager.service enabled
|
||||
networking.service enabled
|
||||
NetworkManager-dispatcher.service enabled
|
||||
NetworkManager-wait-online.service enabled
|
||||
NetworkManager.service enabled
|
||||
|
||||
```
|
||||
|
||||
systemd-cgtop 按资源使用情况(任务、CPU、内存、输入和输出)列出控制组。
|
||||
```
|
||||
# systemd-cgtop
|
||||
|
||||
Control Group Tasks %CPU Memory Input/s Output/s
|
||||
/ - - 1.5G - -
|
||||
/init.scope 1 - - - -
|
||||
/system.slice 153 - - - -
|
||||
/system.slice/ModemManager.service 3 - - - -
|
||||
/system.slice/NetworkManager.service 4 - - - -
|
||||
/system.slice/accounts-daemon.service 3 - - - -
|
||||
/system.slice/acpid.service 1 - - - -
|
||||
/system.slice/apache2.service 55 - - - -
|
||||
/system.slice/aptik-battery-monitor.service 1 - - - -
|
||||
/system.slice/atop.service 1 - - - -
|
||||
/system.slice/atopacct.service 1 - - - -
|
||||
/system.slice/avahi-daemon.service 2 - - - -
|
||||
/system.slice/colord.service 3 - - - -
|
||||
/system.slice/cron.service 1 - - - -
|
||||
/system.slice/cups-browsed.service 3 - - - -
|
||||
/system.slice/cups.service 2 - - - -
|
||||
/system.slice/dbus.service 6 - - - -
|
||||
/system.slice/fwupd.service 5 - - - -
|
||||
/system.slice/irqbalance.service 1 - - - -
|
||||
/system.slice/lightdm.service 7 - - - -
|
||||
/system.slice/polkit.service 3 - - - -
|
||||
/system.slice/repowerd.service 14 - - - -
|
||||
/system.slice/rsyslog.service 4 - - - -
|
||||
/system.slice/rtkit-daemon.service 3 - - - -
|
||||
/system.slice/snapd.service 8 - - - -
|
||||
/system.slice/system-getty.slice 1 - - - -
|
||||
|
||||
```
|
||||
|
||||
同时,我们可以使用 pstree 命令(输出来自 SysVinit 系统)查看正在运行的服务。
|
||||
```
|
||||
# pstree
|
||||
init-|-crond
|
||||
|-httpd---2*[httpd]
|
||||
|-kthreadd/99149---khelper/99149
|
||||
|-2*[mingetty]
|
||||
|-mysqld_safe---mysqld---9*[{mysqld}]
|
||||
|-rsyslogd---3*[{rsyslogd}]
|
||||
|-saslauthd---saslauthd
|
||||
|-2*[sendmail]
|
||||
|-sshd---sshd---bash---pstree
|
||||
|-udevd
|
||||
`-xinetd
|
||||
|
||||
```
|
||||
|
||||
我们还可以使用 pstree 命令(输出来自 systemd 系统)查看正在运行的服务。
|
||||
```
|
||||
# pstree
|
||||
systemd─┬─ModemManager─┬─{gdbus}
|
||||
│ └─{gmain}
|
||||
├─NetworkManager─┬─dhclient
|
||||
│ ├─{gdbus}
|
||||
│ └─{gmain}
|
||||
├─accounts-daemon─┬─{gdbus}
|
||||
│ └─{gmain}
|
||||
├─acpid
|
||||
├─agetty
|
||||
├─anacron
|
||||
├─apache2───2*[apache2───26*[{apache2}]]
|
||||
├─aptd───{gmain}
|
||||
├─aptik-battery-m
|
||||
├─atop
|
||||
├─atopacctd
|
||||
├─avahi-daemon───avahi-daemon
|
||||
├─colord─┬─{gdbus}
|
||||
│ └─{gmain}
|
||||
├─cron
|
||||
├─cups-browsed─┬─{gdbus}
|
||||
│ └─{gmain}
|
||||
├─cupsd
|
||||
├─dbus-daemon
|
||||
├─fwupd─┬─{GUsbEventThread}
|
||||
│ ├─{fwupd}
|
||||
│ ├─{gdbus}
|
||||
│ └─{gmain}
|
||||
├─gnome-keyring-d─┬─{gdbus}
|
||||
│ ├─{gmain}
|
||||
│ └─{timer}
|
||||
|
||||
```
|
||||
|
||||
### 方法三:如何使用 chkservice 在 systemd 系统中查看正在运行的服务
|
||||
|
||||
chkservice 是一个管理系统单元的终端工具,需要超级用户权限。
|
||||
```
|
||||
# chkservice
|
||||
|
||||
```
|
||||
|
||||
![][1]
|
||||
|
||||
要查看帮助页面,请单击 `?` 按钮,它将显示管理 systemd 服务的可用选项。
|
||||
![][2]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/how-to-check-all-running-services-in-linux/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
译者:[jessie-pang](https://github.com/jessie-pang)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://www.2daygeek.com/author/magesh/
|
||||
[1]:https://www.2daygeek.com/wp-content/uploads/2018/03/chkservice-1.png
|
||||
[2]:https://www.2daygeek.com/wp-content/uploads/2018/03/chkservice-2.png
|
@ -0,0 +1,199 @@
|
||||
不要安装 Yaourt!在 Arch 上使用以下这些替代品。
|
||||
======
|
||||
**前略:Yaourt 曾是最流行的 AUR 助手,但现已停止开发。在这篇文章中,我们会为 Arch 衍生发行版们列出 Yaourt 最佳的替代品。**
|
||||
|
||||
[Arch User Repository][1] 或者叫 AUR,是一个为 Arch 用户而生的社区驱动软件仓库。Debian/Ubuntu 用户的对应类比是 PPA。
|
||||
|
||||
AUR 包含了不直接被 [Arch Linux][2] 官方所背书的软件。如果有人想在 Arch 上发布软件或者包,他可以通过 AUR 提供给客户。这让末端用户们可以使用到比默认仓库里更多的软件。
|
||||
|
||||
所以你该如何使用 AUR 呢?简单来说,你需要不同的工具以从 AUR 中安装软件。Arch 的包管理器 [pacman][3] 不直接支持 AUR。那些支持 AUR 的特殊工具我们称之为 [AUR Helpers][4]。
|
||||
|
||||
Yaourt (Yet AnOther User Repository Tool) 曾是一个以便于用户从 AUR 下载软件的, pacman 的再包装。他基本上使用和 pacman 一样的语法。Yaourt 对于 AUR 的搜索,安装,乃至冲突解决和包依赖都有着良好的支持。
|
||||
|
||||
然而,Yaourt 的开发进度近来十分缓慢,甚至在 Arch Wiki 上已经被[列为][5]“停止或有问题”。[许多 Arch 用户认为它不安全][6] 进而开始寻找其他的 AUR 助手。
|
||||
|
||||
![Yaourt 以外的 AUR Helpers][7]
|
||||
|
||||
在这篇文章中,我们会介绍 Yaourt 最佳的替代品以便于你从 AUR 下载安装案件。
|
||||
|
||||
### AUR Helper 最好的选择
|
||||
|
||||
我刻意忽略掉了例如 Trizen 和 Packer 这样的选择,因为他们也被列为“停止或有问题”的了。
|
||||
|
||||
#### 1\. aurman
|
||||
|
||||
[aurman][8] 是最好的 AUR 助手之一,也能胜任 Yaourt 替代品。他对所有 pacman 的操作有着一样的语法。你可以搜索 AUR,解决包依赖,安装前检查 PKGBUILD 的内容等等。
|
||||
|
||||
##### aurman 的特性
|
||||
|
||||
* aurman 支持所有 pacman 操作并且引入了可靠的包依赖解决,冲突判定和分包(split package)支持
|
||||
* 分线程的 sudo 循环会在后来运行所以你每次安装只需要输入一次管理员密码
|
||||
* 提供开发者包支持并且可以区分显性安装和隐性安装的包
|
||||
* 支持搜索AUR
|
||||
* 你可以检视并编辑 PKGBUILD 的内容
|
||||
* 可以用作单独的 [包依赖解决][9]
|
||||
|
||||
|
||||
|
||||
##### 安装 aurman
|
||||
```
|
||||
git clone https://aur.archlinux.org/aurman.git
|
||||
cd aurman
|
||||
makepkg -si
|
||||
|
||||
```
|
||||
|
||||
##### 使用 aurman
|
||||
|
||||
用名字搜索:
|
||||
```
|
||||
aurman -Ss <package-name>
|
||||
|
||||
```
|
||||
安装:
|
||||
```
|
||||
aurman -S <package-name>
|
||||
|
||||
```
|
||||
|
||||
#### 2\. yay
|
||||
|
||||
[yay][10] 是我们列表上下一个选项。它使用 Go 语言写成,宗旨是提供 pacman 的界面并且让用户输入最少化,yay 自己几乎没有任何依赖软件。
|
||||
|
||||
##### yay 的特性
|
||||
|
||||
* yay 提供 AUR 表格补全并且从 ABS 或 AUR 下载 PKGBUILD
|
||||
* 支持收窄搜索,并且不需要引用 PKGBUILD 源
|
||||
* yay 的二进制文件除了 pacman 以外别无依赖
|
||||
* 提供先进的包依赖解决以及在编译安装之后移除编译时的依赖
|
||||
* 支持日色彩输出,使用 /etc/pacman.conf 文件配置
|
||||
* yay 可被配置成只支持 AUR 或者 repo 里的软件包
|
||||
|
||||
|
||||
|
||||
##### 安装 yay
|
||||
|
||||
你可以从 git 克隆并编译安装
|
||||
```
|
||||
git clone https://aur.archlinux.org/yay.git
|
||||
cd yay
|
||||
makepkg -si
|
||||
|
||||
```
|
||||
|
||||
##### 使用 yay
|
||||
|
||||
搜索:
|
||||
```
|
||||
yay -Ss <package-name>
|
||||
|
||||
```
|
||||
|
||||
安装:
|
||||
```
|
||||
yay -S <package-name>
|
||||
|
||||
```
|
||||
|
||||
#### 3\. pakku
|
||||
|
||||
[Pakku][11] 是另一个还在开发早期的 pacman 再包装,虽然它还处于开放早期,但这部说明它逊于其他任何 AUR 助手。Pakku 能良好地支持搜索和安安装,并且也可以在安装后移除不必要的编译依赖。
|
||||
|
||||
##### pakku 的特性
|
||||
|
||||
* 从 AUR 搜索安装软件
|
||||
* 检视不同 build 之间的文件变化
|
||||
* 从官方仓库编译并事后移除编译依赖
|
||||
* 获取 PKGBUILD 以及 pacman 整合
|
||||
* 类 pacman 的用户界面和选项支持
|
||||
* 支持pacman 配置文件以及无需 PKGBUILD soucing
|
||||
|
||||
|
||||
|
||||
##### 安装 pakku
|
||||
```
|
||||
git clone https://aur.archlinux.org/pakku.git
|
||||
cd pakku
|
||||
makepkg -si
|
||||
|
||||
```
|
||||
|
||||
##### 使用 pakku
|
||||
|
||||
搜索:
|
||||
```
|
||||
pakku -Ss spotify
|
||||
|
||||
```
|
||||
|
||||
安装:
|
||||
```
|
||||
pakku -S spotify
|
||||
|
||||
```
|
||||
|
||||
#### 4\. aurutils
|
||||
|
||||
[aurutils][12] 本质上是一堆自动化脚本的集合。他可以搜索 AUR,检查更新,并且解决包依赖。
|
||||
|
||||
##### aurutils 的特性
|
||||
|
||||
* 不同的任务可以有多个仓库
|
||||
* aursync -u 一键同步所有本地代码库
|
||||
* aursearch 搜索提供 pkgbase,long format 和 raw 支持
|
||||
* 能忽略指定包
|
||||
|
||||
|
||||
|
||||
##### 安装 aurutils
|
||||
```
|
||||
git clone https://aur.archlinux.org/aurutils.git
|
||||
cd aurutils
|
||||
makepkg -si
|
||||
|
||||
```
|
||||
|
||||
##### 使用 aurutils
|
||||
|
||||
搜索:
|
||||
```
|
||||
aurutils -Ss <package-name>
|
||||
|
||||
```
|
||||
|
||||
安装:
|
||||
```
|
||||
aurutils -S <package-name>
|
||||
|
||||
```
|
||||
|
||||
所有这些包,在有 Yaourt 或者其他 AUR 助手的情况下都可以直接安装。
|
||||
|
||||
#### 写在最后
|
||||
|
||||
Arch Linux 有着[很多 AUR 助手][4] 可以自动完成 AUR 各方面的日常任务。很多用户依然使用 Yaourt 来完成 AUR 相关任务,每个人都有自己不一样的偏好,欢迎留言告诉我们你在 Arch 里使用什么,又有什么心得?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/best-aur-helpers/
|
||||
|
||||
作者:[Ambarish Kumar][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[Moelf](https://github.com/Moelf)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://itsfoss.com/author/ambarish/
|
||||
[1]:https://wiki.archlinux.org/index.php/Arch_User_Repository
|
||||
[2]:https://www.archlinux.org/
|
||||
[3]:https://wiki.archlinux.org/index.php/pacman
|
||||
[4]:https://wiki.archlinux.org/index.php/AUR_helpers
|
||||
[5]:https://wiki.archlinux.org/index.php/AUR_helpers#Comparison_table
|
||||
[6]:https://www.reddit.com/r/archlinux/comments/4azqyb/whats_so_bad_with_yaourt/
|
||||
[7]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/06/no-yaourt-arch-800x450.jpeg
|
||||
[8]:https://github.com/polygamma/aurman
|
||||
[9]:https://github.com/polygamma/aurman/wiki/Using-aurman-as-dependency-solver
|
||||
[10]:https://github.com/Jguer/yay
|
||||
[11]:https://github.com/kitsunyan/pakku
|
||||
[12]:https://github.com/AladW/aurutils
|
@ -0,0 +1,75 @@
|
||||
使用 EduBlocks 轻松学习 Python 编程
|
||||
======
|
||||
|
||||

|
||||
|
||||
如果你正在寻找一种方法将你的学生(或你自己)从使用 [Scratch][1] 编程转移到学习 [Python][2],我建议你了解一下 [EduBlocks][3]。它为 Python 3 编程带来了熟悉的拖放式图形用户界面(GUI)。
|
||||
|
||||
从 Scratch 过渡到 Python 的一个障碍是缺少拖放式 GUI,它使得 Scratch 成为 K-12 学校的首选程序。EduBlocks 的拖放版的 Python 3 改变了这种范式。它的目的是“帮助教师在较早的时候向儿童介绍基于文本的编程语言,如 Python。”
|
||||
|
||||
EduBlocks 的硬件要求非常适中 - 一个 Raspberry Pi 和一条互联网连接 - 应该可以在许多教室中使用。
|
||||
|
||||
EduBlocks 是由来自英国的 14 岁 Python 开发人员 Joshua Lowe 开发的。我看到 Joshua 在 2018 年 5 月的 [PyCon 2018][4] 上展示了他的项目。
|
||||
|
||||
### 入门
|
||||
|
||||
安装 EduBlocks 很容易。该网站提供了清晰的安装说明,你可以在项目的 [GitHub][5] 仓库中找到详细的截图。
|
||||
|
||||
使用以下命令在 Raspberry Pi 命令行安装 EduBlocks:
|
||||
```
|
||||
curl -sSL get.edublocks.org | bash
|
||||
|
||||
```
|
||||
|
||||
### 在 EduBlocks 中编程
|
||||
|
||||
安装完成后,从桌面快捷方式或 Raspberry Pi 上的“编程”菜单启动 EduBlocks。
|
||||
|
||||

|
||||
|
||||
启动程序后,你可以使用 EduBlocks 的拖放界面开始创建 Python 3 代码。它的菜单有清晰的标签。你可以通过单击 **Samples** 菜单按钮使用示例代码。你还可以通过单击 **Theme** 为你的编程界面选择不同的配色方案。使用 **Save** 菜单,你可以保存你的作品,然后 **Download** 你的 Python 代码。单击 **Run** 来执行并测试你的代码。
|
||||
|
||||
你可以通过单击最右侧的 **Blockly** 按钮来查看代码。它让你在 ”Blockly” 界面和普通的 Python 代码视图之间切换(正如你在任何其他 Python 编辑器中看到的那样)。
|
||||
|
||||

|
||||
|
||||
EduBlocks 附带了一系列代码库,包括 [EduPython][6]、[Minecraft] [7]、[Sonic Pi] [8]、[GPIO Zero][9] 和 [Sense Hat][10]。
|
||||
|
||||
### 学习和支持
|
||||
|
||||
该项目维护了一个[学习门户网站][11],其中包含教程和其他资源,可以轻松地 [hack][12] Raspberry Pi 版本的 Minecraft,编写 GPIOZero 和 Sonic Pi,并使用 Micro:bit 代码编辑器控制 LED。可以在 Twitter [@edu_blocks][13] 和 [@all_about_code][14] 以及 [email][15] 提供对 EduBlocks 的支持。
|
||||
|
||||
为了更深入的了解,你可以在 [GitHub][16] 上访问 EduBlocks 的源代码。该程序在 GNU Affero Public License v3.0 下[许可][17]。EduBlocks 的创建者(项目负责人 [Joshua Lowe][18] 和开发人员 [Chris Dell][19] 和 [Les Pounder][20])希望它成为一个社区项目,并邀请人们提出问题,提供反馈,以及提交 pull request 以向项目添加功能或修复。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/8/edublocks
|
||||
|
||||
作者:[Don Watkins][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/don-watkins
|
||||
[1]:https://scratch.mit.edu/
|
||||
[2]:https://www.python.org/
|
||||
[3]:https://edublocks.org/
|
||||
[4]:https://us.pycon.org/2018/about/
|
||||
[5]:https://github.com/AllAboutCode/EduBlocks
|
||||
[6]:https://edupython.tuxfamily.org/
|
||||
[7]:https://minecraft.net/en-us/edition/pi/
|
||||
[8]:https://sonic-pi.net/
|
||||
[9]:https://gpiozero.readthedocs.io/en/stable/
|
||||
[10]:https://www.raspberrypi.org/products/sense-hat/
|
||||
[11]:https://edublocks.org/learn.html
|
||||
[12]:https://edublocks.org/resources/1.pdf
|
||||
[13]:https://twitter.com/edu_blocks?lang=en
|
||||
[14]:https://twitter.com/all_about_code
|
||||
[15]:mailto:support@edublocks.org
|
||||
[16]:https://github.com/allaboutcode/edublocks
|
||||
[17]:https://github.com/AllAboutCode/EduBlocks/blob/tarball-install/LICENSE
|
||||
[18]:https://github.com/JoshuaLowe1002
|
||||
[19]:https://twitter.com/cjdell?lang=en
|
||||
[20]:https://twitter.com/biglesp?lang=en
|
Loading…
Reference in New Issue
Block a user