Merge pull request #92 from LCTT/master

update
This commit is contained in:
MjSeven 2018-10-30 22:37:47 +08:00 committed by GitHub
commit f3e273481a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 2830 additions and 1363 deletions

View File

@ -0,0 +1,258 @@
24 个必备的 Linux 应用程序
======
![](https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2016/10/Essentials-applications-for-every-Linux-user.jpg)
> 提要Linux 上必备的应用程序是什么呢?这个答案具有主观性并取决于你使用 Linux 桌面的目的是什么。但确实存在一些必备的并且大部分 Linux 用户都会安装的应用程序。接下来我们会列举出那些在所有 Linux 发行版上你都会安装的最优秀的 Linux 应用程序。
在 Linux 的世界中,所有东西都由你选择。你要选择一个发行版?你能找到一大把。你想要找到一个称心的音乐播放器?同样会有许多选择。
但它们并非全部遵循相同的设计理念 —— 其中一些可能追求极致轻量化而另一些会提供数不清的特性。因此想要找到正中需求的应用程序会成为相当令人头疼的繁重任务。那就让我们来缓解你的头疼吧。
### 对于 Linux 用户来说最优秀的自由软件
接下来我将罗列一系列在不同应用场景下我偏爱的必备 Linux 自由软件。当然此处我并非在说它们是最好的,但确实是在特定类别下我尝试的一系列软件中最喜欢的。也同样欢迎你在评论区介绍你最喜欢的应用程序。
同时我们也制作了关于此次应用清单的[视频](https://youtu.be/awawJnkUbWs)。在 YouTube 上订阅我们的频道获取更多的 Linux 视频。
### 网页浏览器
![网页浏览器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Web-Browser-1024x512.jpg)
*网页浏览器*
#### Google Chrome
[Google Chrome][12] 是一个强大并且功能完善的浏览器解决方案,它拥有完美的同步功能以及丰富的扩展。如果你喜欢 Google 的生态系统那么 Google Chrome 毫无疑问会是你的菜。如果你想要更加开源的解决方案,你可以尝试 [Chromium][13],它是 Google Chrome 的上游项目。
#### Firefox
如果你不是 Google Chrome 的粉丝,你可以尝试 [Firefox][14]。它一直以来都是一个非常稳定并且健壮的网页浏览器。
#### Vivaldi
当然,如果你想要尝试点不同的新东西,你可以尝试 [Vivaldi][15]。Vivaldi 是一个完全重新设计的网页浏览器,它由 Opera 浏览器项目的前成员基于 Chromium 项目而创建。Vivaldi 轻量并且可定制,虽然它还非常年轻并且在某些特性上仍不完善,但它仍能让你眼前一亮并且优雅地工作。
- [推荐阅读:[回顾] Otter 浏览器为 Opera 爱好者带来了希望][40]
### 下载管理器
![下载管理器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Download-Manager-1024x512.jpg)
*下载管理器*
#### uGet
[uGet][16] 是我遇到过最棒的下载管理器它是开源的并且能满足你对于一款下载管理器的一切期许。uGet 提供一系列便于管理下载的高级设置。你能够管理下载队列并且断点续传,针对大文件使用多连接下载,根据不同列表将文件下载至不同路径,等等。
#### XDM
Xtreme 下载管理器([XDM][17])是一个 Java 开发的强大并且开源的下载工具。它拥有下载管理器的所有基本特性,包括视频抓取、智能计划任务以及浏览器集成。
- [推荐阅读Linux 下最好的 4 个下载管理器][41]
### BitTorrent 客户端
![BitTorrent 客户端](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-BitTorrent-Client-1024x512.jpg)
*BitTorrent 客户端*
#### Deluge
[Deluge][18] 是一个拥有漂亮用户界面的开源 BitTorrent 客户端。如果你习惯在 Windows 上使用 uTorrent那么 Deluge 的界面会让你倍感亲切。它拥有丰富的设置项和针对不同任务的插件支持。
#### Transmission
[Transmission][19] 力求精简,它是用户界面最精简的 BitTorrent 客户端之一。Transmission 是许多 Linux 发行版的预装软件。
- [推荐阅读Ubuntu Linux 上前 5 名的 Torrent 客户端][42]
### 云存储
![云存储](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Cloud-Storage-1024x512.jpg)
*云存储*
#### Dropbox
[Dropbox][20] 是目前最流行的云存储服务之一,它为新用户提供了 2GB 的免费存储空间,以及一个健壮并且易于使用的 Linux 客户端。
#### MEGA
[MEGA][21] 提供了 50GB 的免费存储但这还并不是它最大的优点MEGA 还为你的文件提供了端到端的加密支持。MEGA 提供一个名为 MEGAsync 的可靠的 Linux 客户端。
- [推荐阅读2017 年 Linux 上最优秀的免费云服务][43]
### 通讯工具
![通讯工具](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Communication-1024x512.jpg)
*通讯工具*
#### Pidgin
[Pidgin][22] 是一款开源的即时通讯工具,它支持许多聊天平台,包括 Google Talk、Yahoo 甚至 IRC。Pidgin 可通过第三方插件进行扩展,能提供许多附加功能。
你也可以使用 [Franz][23] 或 [Rambox][24] 来在一个应用中使用多个通讯服务。
#### Skype
我们都知道 [Skype][25] 是最流行的视频聊天平台之一,它[发布了全新的 Linux 桌面客户端][26]。
- [推荐阅读2017 年 Linux 平台上最优秀的 6 款消息应用][44]
### 办公套件
![办公套件](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Office-Suite-1024x512.jpg)
*办公套件*
#### LibreOffice
[LibreOffice][27] 是 Linux 平台上开发最为活跃的开源办公套件,主要包括 Writer、Calc、Impress、Draw、Math、Base 六个主要模块,并且每个模块都提供广泛的文件格式支持。同时 LibreOffice 也支持第三方的扩展,以上优势使它成为许多 Linux 发行版的默认办公套件。
#### WPS Office
如果你想要尝试除 LibreOffice 以外的办公套件,[WPS Office][28] 值得一试。WPS Office 套件包括了写作、演示和数据表格支持。
- [推荐阅读Linux 平台 6 款最优秀的 Microsoft Office 替代品][45]
### 音乐播放器
![音乐播放器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Music-Player-1024x512.jpg)
*音乐播放器*
#### Lollypop
[Lollypop][29] 是一款相对较新的开源音乐播放器,拥有漂亮又不失简洁的用户界面。它提供优秀的音乐管理、歌曲推荐、在线广播和派对模式支持。虽然它是一款不具有太多特性的简洁音乐播放器,但仍值得我们去尝试。
#### Rhythmbox
[Rhythmbox][30] 是一款主要为 GNOME 桌面环境开发的音乐播放器,当然它也可以在其他桌面环境运行。它能完成所有作为一款音乐播放器的基础功能,包括 CD 抓取和烧制、乱序播放,等等。它也提供了 iPod 支持。
#### cmus
如果你想要最轻量,并且喜欢命令行的话,[cmus][31] 适合你。个人来讲我是它的粉丝用户。cmus 是一款面向类 Unix 平台的小巧、快速并且强大的命令音乐播放器。它包含所有基础的音乐播放器特性,并且你能够通过扩展和脚本来增强它的功能。
- [推荐阅读:如何在 Ubuntu 14.04 和 Linux Mint 17 上安装 Tomahawk 播放器][46]
LCTT 译注:好了好了,大家不要提醒我了,我这次补充上深受国内 Linux 和开源爱好者喜爱的[网易云音乐](https://music.163.com/#/download)。:D
### 视频播放器
![视频播放器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Video-Player-1024x512.jpg)
*视频播放器*
#### VLC
[VLC][32] 是一款简洁、快速、轻量并且非常强大的开源媒体播放器,它能够直接播放几乎所有格式的媒体文件,同时也能够播放在线的流媒体。它也能够安装一些时髦的扩展来完成不同的任务,比如直接在播放器内下载字幕。
#### Kodi
[Kodi][33] 是一款成熟并且开源的媒体中心在它的用户群中非常受欢迎。它能够处理来自本地或者网络媒体存储的视频、音乐、图片、播客甚至游戏更强大的是你还能用它来录制电视节目。Kodi 可由附加组件和皮肤进行定制。
- [推荐阅读:Linux 平台上的 4 款格式工厂替代品][47]
### 照片编辑器
![照片编辑器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Photo-Editor-1024x512.jpg)
*照片编辑器*
#### GIMP
[GIMP][34] 是 Linux 平台上 Photoshop 的替代品,它是一款开源、全功能并且专业的照片编辑软件。它打包了各式各样的工具用来编辑图片,更强大的是,它包含丰富的自定义设置以及第三方插件来增强体验。
#### Krita
[Krita][35] 主要是作为一款绘图工具,但也可以作为照片编辑软件。它是开源的并且打包了非常多复杂的高级工具。
- [推荐阅读:Linux 平台最好的照片应用][48]
### 文字编辑器
每个 Linux 发行版都拥有自己的文字编缉器解决方案,当然大体上它们都非常简洁并且没有太多功能。但是也有一些文字编辑器具有更强大的功能。
![文字编辑器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Text-Editor-1024x512.jpg)
*文字编辑器*
#### Atom
[Atom][36] 是由 GitHub 开发的一款现代高度可配置的文字编辑器,它是完全开源的并且能够提供所有你能想到的文字编辑器功能。你可以开箱即用,也可以将其配置成你想要的样子。并且你可以从它的社区安装大量的扩展和主题。
#### Sublime Text
[Sublime Text][37] 是最受欢迎的文字编辑器之一虽然它并不是免费的但你可以无限地试用该款软件。Sublime Text 是一款特性丰富并且高度模块化的软件,当然它也提供插件和主题支持。
- [推荐阅读Linux 平台最优秀的 4 款现代开源代码编辑器][49]
LCTT 译注:当然,我知道你们也忘记不了 [VSCode](https://code.visualstudio.com/download)。)
### 启动器
![启动器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Launcher-1024x512.jpg)
*启动器*
#### Albert
[Albert][38] 是一款快速、可扩展、可定制的生产力工具,受 AlfredMac 平台上一个非常好的生产力工具)启发并且仍处于开发阶段,它的目标是“使所有触手可及”。它能够与你的 Linux 发行版非常好的集成,帮助你提高生产力。
#### Synapse
[Synapse][39] 已经有些年头了,它是一个能够搜索和运行程序的简单启动器。它也同时能够加速一些工作流,譬如音乐控制、文件搜索、路径切换、书签、运行命令,等等。
正如 Abhishek 所考虑的,我们将根据读者的(也就是你的)反馈更新最佳 Linux 应用程序清单。那么,你最爱的 Linux 应用程序是什么呢?分享给我们或者为这个清单增加新的软件分类吧。
---
via: https://itsfoss.com/essential-linux-applications/
作者:[Munif Tanjim][a]
译者:[cycoe](https://github.com/cycoe)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/munif/
[12]: https://www.google.com/chrome/browser
[13]: https://www.chromium.org/Home
[14]: https://www.mozilla.org/en-US/firefox
[15]: https://vivaldi.com
[16]: http://ugetdm.com/
[17]: http://xdman.sourceforge.net/
[18]: http://deluge-torrent.org/
[19]: https://transmissionbt.com/
[20]: https://www.dropbox.com
[21]: https://mega.nz/
[22]: https://www.pidgin.im/
[23]: https://itsfoss.com/franz-messaging-app/
[24]: http://rambox.pro/
[25]: https://www.skype.com
[26]: https://itsfoss.com/skpe-alpha-linux/
[27]: https://www.libreoffice.org
[28]: https://www.wps.com
[29]: http://gnumdk.github.io/lollypop-web/
[30]: https://wiki.gnome.org/Apps/Rhythmbox
[31]: https://cmus.github.io/
[32]: http://www.videolan.org
[33]: https://kodi.tv
[34]: https://www.gimp.org/
[35]: https://krita.org/en/
[36]: https://atom.io/
[37]: http://www.sublimetext.com/
[38]: https://github.com/ManuelSchneid3r/albert
[39]: https://launchpad.net/synapse-project
[40]: https://itsfoss.com/otter-browser-review/
[41]: https://itsfoss.com/4-best-download-managers-for-linux/
[42]: https://itsfoss.com/best-torrent-ubuntu/
[43]: https://itsfoss.com/cloud-services-linux/
[44]: https://itsfoss.com/best-messaging-apps-linux/
[45]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/
[46]: https://itsfoss.com/install-tomahawk-ubuntu-1404-linux-mint-17/
[47]: https://itsfoss.com/format-factory-alternative-linux/
[48]: https://itsfoss.com/image-applications-ubuntu-linux/
[49]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/

View File

@ -0,0 +1,143 @@
如何移除或禁用 Ubuntu Dock
======
![](https://1.bp.blogspot.com/-pClnjEJfPQc/W21nHNzU2DI/AAAAAAAABV0/HGXuQOYGzokyrGYQtRFeF_hT3_3BKHupQCLcBGAs/s640/ubuntu-dock.png)
> 如果你想用其它 dock例如 Plank dock或面板来替换 Ubuntu 18.04 中的 Dock或者你想要移除或禁用 Ubuntu Dock本文会告诉你如何做。
Ubuntu Dock - 屏幕左侧栏,可用于固定应用程序或访问已安装的应用程序。使用默认的 Ubuntu 会话时,[无法][1]使用 Gnome Tweaks 禁用它(禁用无效)。但是如果你需要,还是有几种方法来摆脱它的。下面我将列出 4 种方法可以移除或禁用 Ubuntu Dock以及每个方法的缺点如果有的话还有如何撤销每个方法的更改。本文还包括在没有 Ubuntu Dock 的情况下访问<ruby>活动概览<rt>Activities Overview</rt></ruby>和已安装应用程序列表的其它方法。
### 如何在没有 Ubuntu Dock 的情况下访问活动概览
如果没有 Ubuntu Dock你可能无法访问活动的或已安装的应用程序列表可以通过单击 Dock 底部的“显示应用程序”按钮从 Ubuntu Dock 访问)。例如,如果你想使用 Plank Dock 就是这样。
显然,如果你安装了 Dash to Panel 扩展来替代 Ubuntu Dock那么还好。因为 Dash to Panel 提供了一个按钮来访问活动概览或已安装的应用程序。
根据你计划用来替代 Ubuntu Dock 的软件,如果无法访问活动概览,那么你可以启用“活动概览热角”选项,只需将鼠标移动到屏幕的左上角即可打开活动概览。访问已安装的应用程序列表的另一种方法是使用快捷键:`Super + A`。
如果要启用“活动概览热角”,使用以下命令:
```
gsettings set org.gnome.shell enable-hot-corners true
```
如果以后要撤销此操作并禁用该热角,那么你需要使用以下命令:
```
gsettings set org.gnome.shell enable-hot-corners false
```
你可以使用 Gnome Tweaks 应用程序(该选项位于 Gnome Tweaks 的 “Top Bar” 部分)启用或禁用“活动概览热角” 选项,可以使用以下命令进行安装它:
```
sudo apt install gnome-tweaks
```
### 如何移除或禁用 Ubuntu Dock
下面你将找到 4 种摆脱 Ubuntu Dock 的方法,环境在 Ubuntu 18.04 下。
#### 方法 1: 移除 Gnome Shell Ubuntu Dock 包
摆脱 Ubuntu Dock 的最简单方法就是删除包。
这将会从你的系统中完全移除 Ubuntu Dock 扩展,但同时也移除了 `ubuntu-desktop` 元数据包。如果你移除 `ubuntu-desktop` 元数据包,不会马上出现问题,因为它本身没有任何作用。`ubuntu-desktop ` 元数据包依赖于组成 Ubuntu 桌面的大量包。它的依赖关系不会被删除,也不会被破坏。问题是如果你以后想升级到新的 Ubuntu 版本,那么将不会安装任何新的 `ubuntu-desktop` 依赖项。
为了解决这个问题,你可以在升级到较新的 Ubuntu 版本之前安装 `ubuntu-desktop` 元数据包(例如,如果你想从 Ubuntu 18.04 升级到 18.10)。
如果你对此没有意见,并且想要从系统中删除 Ubuntu Dock 扩展包,使用以下命令:
```
sudo apt remove gnome-shell-extension-ubuntu-dock
```
如果以后要撤消更改,只需使用以下命令安装扩展:
```
sudo apt install gnome-shell-extension-ubuntu-dock
```
或者重新安装 `ubuntu-desktop` 元数据包(这将会安装你可能已删除的任何 `ubuntu-desktop` 依赖项,包括 Ubuntu Dock你可以使用以下命令
```
sudo apt install ubuntu-desktop
```
#### 方法 2安装并使用 vanilla Gnome 会话而不是默认的 Ubuntu 会话
摆脱 Ubuntu Dock 的另一种方法是安装和使用原生 Gnome 会话。安装 原生 Gnome 会话还将安装此会话所依赖的其它软件包,如 Gnome 文档、地图、音乐、联系人、照片、跟踪器等。
通过安装原生 Gnome 会话,你还将获得默认 Gnome GDM 登录和锁定屏幕主题,而不是 Ubuntu 默认的 Adwaita Gtk 主题和图标。你可以使用 Gnome Tweaks 应用程序轻松更改 Gtk 和图标主题。
此外,默认情况下将禁用 AppIndicators 扩展(因此使用 AppIndicators 托盘的应用程序不会显示在顶部面板上),但你可以使用 Gnome Tweaks 启用此功能(在扩展中,启用 Ubuntu appindicators 扩展)。
同样,你也可以从原生 Gnome 会话启用或禁用 Ubuntu Dock这在 Ubuntu 会话中是不可能的(使用 Ubuntu 会话时无法从 Gnome Tweaks 禁用 Ubuntu Dock
如果你不想安装原生 Gnome 会话所需的这些额外软件包,那么这个移除 Ubuntu Dock 的这个方法不适合你,请查看其它方法。
如果你对此没有意见,以下是你需要做的事情。要在 Ubuntu 中安装原生的 Gnome 会话,使用以下命令:
```
sudo apt install vanilla-gnome-desktop
```
安装完成后,重启系统。在登录屏幕上,单击用户名,单击 “Sign in” 按钮旁边的齿轮图标,然后选择 “GNOME” 而不是 “Ubuntu”之后继续登录。
![](https://4.bp.blogspot.com/-mc-6H2MZ0VY/W21i_PIJ3pI/AAAAAAAABVo/96UvmRM1QJsbS2so1K8teMhsu7SdYh9zwCLcBGAs/s640/vanilla-gnome-session-ubuntu-login-screen.png)
如果要撤销此操作并移除原生 Gnome 会话,可以使用以下命令清除原生 Gnome 软件包,然后删除它安装的依赖项(第二条命令):
```
sudo apt purge vanilla-gnome-desktop
sudo apt autoremove
```
然后重新启动,并以相同的方式从 GDM 登录屏幕中选择 Ubuntu。
#### 方法 3从桌面上永久隐藏 Ubuntu Dock而不是将其移除
如果你希望永久隐藏 Ubuntu Dock不让它显示在桌面上但不移除它或使用原生 Gnome 会话,你可以使用 Dconf 编辑器轻松完成此操作。这样做的缺点是 Ubuntu Dock 仍然会使用一些系统资源,即使你没有在桌面上使用它,但你也可以轻松恢复它而无需安装或移除任何包。
Ubuntu Dock 只对你的桌面隐藏,当你进入叠加模式(活动)时,你仍然可以看到并从那里使用 Ubuntu Dock。
要永久隐藏 Ubuntu Dock使用 Dconf 编辑器导航到 `/org/gnome/shell/extensions/dash-to-dock` 并禁用以下选项(将它们设置为 `false``autohide`、`dock-fixed` 和 `intellihide`
如果你愿意,可以从命令行实现此目的,运行以下命令:
```
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
```
如果你改变主意了并想撤销此操作,你可以使用 Dconf 编辑器从 `/org/gnome/shell/extensions/dash-to-dock` 中启动 `autohide``dock-fixed``intellihide`(将它们设置为 `true`),或者你可以使用以下这些命令:
```
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
```
#### 方法 4使用 Dash to Panel 扩展
[Dash to Panel][2] 是 Gnome Shell 的一个高度可配置面板,是 Ubuntu Dock 或 Dash to Dock 的一个很好的替代品Ubuntu Dock 是从 Dash to Dock 分叉而来的)。安装和启动 Dash to Panel 扩展会禁用 Ubuntu Dock因此你无需执行其它任何操作。
你可以从 [extensions.gnome.org][3] 来安装 Dash to Panel。
如果你改变主意并希望重新使用 Ubuntu Dock那么你可以使用 Gnome Tweaks 应用程序禁用 Dash to Panel或者通过单击以下网址旁边的 X 按钮完全移除 Dash to Panel: https://extensions.gnome.org/local/ 。
--------------------------------------------------------------------------------
via: https://www.linuxuprising.com/2018/08/how-to-remove-or-disable-ubuntu-dock.html
作者:[Logix][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[MjSeven](https://github.com/MjSeven)
校对:[wxy](https://github.com/wxy)
本文由 [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/

View File

@ -7,7 +7,7 @@
### 怎么忽略我所做的命令行增强
通常情况下我会用别名将新的增强的命令行工具链接到原来的命令(如 `cat``ping`)。
通常情况下我会用别名将新的增强的命令行工具覆盖原来的命令(如 `cat``ping`)。
如果我需要运行原来的命令的话(有时我确实需要这么做),我会像下面这样来运行未加修改的原始命令。(我用的是 Mac你的用法可能不一样
@ -18,25 +18,25 @@ $ command cat # 忽略函数和别名
### bat > cat
`cat` 用于打印文件的内容,如果你平时用命令行很多的话,例如语法高亮之类的功能会非常有用。我首先发现了 [ccat][3] 这个有语法高亮功能的工具,然后我发现了 [bat][4],它的功能有语法高亮,分页,行号和 git 集成。
`cat` 用于打印文件的内容,如果你平时用命令行很多的话,例如语法高亮之类的功能会非常有用。我首先发现了 [ccat][3] 这个有语法高亮功能的工具,然后我发现了 [bat][4],它的功能有语法高亮、分页、行号和 git 集成。
`bat` 命令也能让我在输出里(多于一屏时)使用 `/` 搜索(和用 `less` 搜索功能一样)。
`bat` 命令也能让我在(多于一屏的)输出里使用 `/` 搜索(和用 `less` 搜索功能一样)。
![Simple bat output][5]
我将别名 `cat` 链接到了 `bat` 命令:
我将别名 `cat` 到了 `bat` 命令:
```
alias cat='bat'
```
💾 [安装指引][4]
- [安装指引][4]
### prettyping > ping
`ping` 非常有用,当我碰到“糟了,是不是 X 挂了?/我的网不通了?”这种情况下我最先想到的工具就是它了。但是 `prettyping`“prettyping” 可不是指“pre typing”`ping` 的基础上加了友好的输出,这可让我感觉命令行友好了很多呢。
![/images/cli-improved/ping.gif][6]
![prettyping][6]
我也将 `ping` 用别名链接到了 `prettyping` 命令:
@ -44,16 +44,20 @@ alias cat='bat'
alias ping='prettyping --nolegend'
```
💾 [安装指引][7]
- [安装指引][7]
### fzf > ctrl+r
命令行上使用 `ctrl+r` 将允许你在命令历史里[反向搜索][8]使用过的命令,这是个挺好的小技巧,但是它需要你给出非常精确的输入才能正常运行
终端里,使用 `ctrl+r` 将允许你在命令历史里[反向搜索][8]使用过的命令,这是个挺好的小技巧,尽管它有点麻烦
`fzf` 这个工具相比于 `ctrl+r` 有了**巨大的**进步。它能针对命令行历史进行模糊查询,并且提供了对可能的合格结果进行全面交互式预览。
![视频](https://player.vimeo.com/video/217497007)
除了搜索命令历史,`fzf` 还能预览和打开文件,我在下面的视频里展示了这些功能。
![视频](https://player.vimeo.com/video/286345188)
为了这个预览的效果,我创建了一个叫 `preview` 的别名,它将 `fzf` 和前文提到的 `bat` 组合起来完成预览功能,还给上面绑定了一个定制的热键 `ctrl+o` 来打开 VS Code
```
@ -62,7 +66,7 @@ alias preview="fzf --preview 'bat --color \"always\" {}'"
export FZF_DEFAULT_OPTS="--bind='ctrl-o:execute(code {})+abort'"
```
💾 [安装指引][9]
- [安装指引][9]
### htop > top
@ -72,10 +76,10 @@ export FZF_DEFAULT_OPTS="--bind='ctrl-o:execute(code {})+abort'"
一些很容易上手的热键:
* P - 按 CPU 使用率排序
* M - 按内存使用排序
* F4 - 用字符串过滤进程(例如只看包括 node 的进程)
* space - 锚定一个单独进程,这样我能观察它是否有尖峰状态
* `P` —— 按 CPU 使用率排序
* `M` —— 按内存使用排序
* `F4` —— 用字符串过滤进程(例如只看包括 node 的进程)
* `space` —— 锚定一个单独进程,这样我能观察它是否有尖峰状态
![htop output][10]
@ -85,7 +89,7 @@ export FZF_DEFAULT_OPTS="--bind='ctrl-o:execute(code {})+abort'"
alias top="sudo htop" # 给 top 加上别名并且绕过 Sierra 上的 bug
```
💾 [安装指引][11]
- [安装指引][11]
### diff-so-fancy > diff
@ -101,7 +105,7 @@ alias top="sudo htop" # 给 top 加上别名并且绕过 Sierra 上的 bug
show = diff-so-fancy | less --tabs=1,5 -RFX
```
💾 [安装指引][13]
- [安装指引][13]
### fd > find
@ -121,23 +125,23 @@ $ fd cli -x wc -w # 搜索 "cli" 并且在每个搜索结果上运行 `wc -w`
![fd output][15]
💾 [安装指引][16]
- [安装指引][16]
### ncdu > du
对我来说,知道当前磁盘空间被什么占用了非常重要。我用过 Mac 上的 [DaisyDisk][17],但是我觉得那个程序产生结果有点慢。
`du -sh` 命令是我经常会的命令(`-sh` 是指结果以“汇总”和“人类可读”的方式显示),我经常会想要深入挖掘那些占用了大量磁盘空间的目录,看看到底是什么在占用空间。
`du -sh` 命令是我经常会运行的命令(`-sh` 是指结果以“汇总”和“人类可读”的方式显示),我经常会想要深入挖掘那些占用了大量磁盘空间的目录,看看到底是什么在占用空间。
`ncdu` 是一个非常棒的替代品。它提供了一个交互式的界面并且允许快速的扫描那些占用了大量磁盘空间的目录和文件,它又快又准。(尽管不管在哪个工具的情况下,扫描我的 home 目录都要很长时间,它有 550G
一旦当我找到一个目录我想要“处理”一下(如删除,移动或压缩文件),我会使用 `commond+` 点击 [iTerm2][18] 上部的目录名字的方法在 Finder 中打开它。
一旦当我找到一个目录我想要“处理”一下(如删除,移动或压缩文件),我会使用 `cmd` + 点击 [iTerm2][18] 顶部的目录名字的方法在 Finder 中打开它。
![ncdu output][19]
还有另外一个选择[一个叫 nnn 的另外选择][20],它提供了一个更漂亮的界面,它也提供文件尺寸和使用情况,实际上它更像一个全功能的文件管理器。
还有另外[一个叫 nnn 的替代选择][20],它提供了一个更漂亮的界面,它也提供文件尺寸和使用情况,实际上它更像一个全功能的文件管理器。
我的 `ncdu` 使用下面的别名:
我的 `du` 是如下的别名:
```
alias du="ncdu --color dark -rr -x --exclude .git --exclude node_modules"
@ -146,16 +150,16 @@ alias du="ncdu --color dark -rr -x --exclude .git --exclude node_modules"
选项说明:
* `--color dark` 使用颜色方案
* `-rr` 只读模式(防止误删和运行新的登陆程序)
* `-rr` 只读模式(防止误删和运行新的 shell 程序)
* `--exclude` 忽略不想操作的目录
💾 [安装指引][21]
- [安装指引][21]
### tldr > man
几乎所有的命令行工具都有一个相伴的手册,它可以被 `man <命令名>` 来调出,但是在 `man` 的输出里找到东西可有点让人困惑,而且在一个包含了所有的技术细节的输出里找东西也挺可怕的。
这就是 TL;DR译注英文里“文档太长没空去读”的缩写项目创建的初衷。这是一个由社区驱动的文档系统,而且针对的是命令行。就我现在用下来,我还没碰到过一个命令没有它相应的文档,你[也可以做贡献][22]。
这就是 TL;DR 项目LCTT 译注:英文里“文档太长,没空去读”的缩写)创建的初衷。这是一个由社区驱动的文档系统,而且可以用在命令行上。就我现在使用的经验,我还没碰到过一个命令没有它相应的文档,你[也可以做贡献][22]。
![TLDR output for 'fd'][23]
@ -165,15 +169,15 @@ alias du="ncdu --color dark -rr -x --exclude .git --exclude node_modules"
alias help='tldr'
```
💾 [安装指引][24]
- [安装指引][24]
### ack || ag > grep
`grep` 毫无疑问是一个强力的命令行工具,但是这些年来它已经被一些工具超越了,其中两个叫 `ack``ag`
我个人对 `ack``ag` 都尝试过,而且没有非常明显的个人偏好,(也就是说它们都很棒,并且很相似)。我倾向于默认只使用 `ack`,因为这三个字符就在指尖,很好打。并且 `ack` 有大量的 `ack --` 参数可以使用!(你一定会体会到这一点。)
我个人对 `ack``ag` 都尝试过,而且没有非常明显的个人偏好,(也就是说它们都很棒,并且很相似)。我倾向于默认只使用 `ack`,因为这三个字符就在指尖,很好打。并且 `ack` 有大量的 `ack --bar` 参数可以使用!(你一定会体会到这一点。)
`ack``ag` 都使用正则表达式来搜索,这非常契合我的工作,我能指定文件类型搜索,类似于 `--js``--html` 这种文件标识。(尽管 `ag``ack` 在文件类型过滤器里包括了更多的文件类型。)
`ack``ag` 默认都使用正则表达式来搜索,这非常契合我的工作,我能使用类似于 `--js``--html` 这种标识指定文件类型搜索。(尽管 `ag``ack` 在文件类型过滤器里包括了更多的文件类型。)
两个工具都支持常见的 `grep` 选项,如 `-B``-A` 用于在搜索的上下文里指代“之前”和“之后”。
@ -186,9 +190,8 @@ alias help='tldr'
--pager=less -FRX
```
💾 安装指引: [ack][26], [ag][27]
[关于 ack & ag 的更多信息][28]
- 安装指引:[ack][26][ag][27]
- [关于 ack & ag 的更多信息][28]
### jq > grep 及其它
@ -224,7 +227,12 @@ $ npm i $(echo $(\
}
```
转换结果为:(译注:原文此处并未给出结果)
转换结果为:
```
node-jq@1.2.0
uuid@3.2.1
```
上面的结果会被作为 `npm install` 的输入,你瞧,我的升级就这样全部搞定了。(当然,这里有点小题大做了。)
@ -248,7 +256,7 @@ via: https://remysharp.com/2018/08/23/cli-improved
作者:[Remy Sharp][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[DavidChenLiang](https://github.com/DavidChenLiang)
校对:[pityonline](https://github.com/pityonline)
校对:[pityonline](https://github.com/pityonline), [wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,107 @@
使用开源同步工具 Syncthing 控制你的数据
======
> 决定如何存储和共享您的个人信息。
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus_cloud_database.png?itok=lhhU42fg)
如今,我们的一些最重要的财产 —— 从家人和朋友的照片和视频到财务和医疗文件 —— 都是数据。即便是云存储服务的迅猛发展,我们仍有对隐私和个人数据缺乏控制的担忧。从棱镜监控计划到谷歌[让 APP 开发者扫描你的个人邮件][1],这些新闻的报道应该会让我们对我们个人信息的安全性有所顾虑。
[Syncthing][2] 可以让你放下心来。它是一款开源的点对点文件同步工具,可以运行在 Linux、Windows、Mac、Android 和其他抱歉没有iOS。Syncthing 使用自定的协议,叫[块交换协议](3)。简而言之Syncting 能让你无需拥有服务器来跨设备同步数据。
在这篇文章中,我将解释如何在 Linux 电脑和安卓手机之间安装和同步文件。
### Linux
Syncting 在大多数流行的发行版都能下载。Fedora 28 包含其最新版本。
要在 Fedora 上安装 Syncthing你能在软件中心搜索或者执行以下命令
```
sudo dnf install syncthing syncthing-gtk
```
一旦安装好后,打开它。你将会看到一个助手帮你配置 Syncthing。点击 “Next” 直到它要求配置 WebUI。最安全的选项是选择“Listen on localhost”。那将会禁止 Web 界面并且阻止未经授权的用户。
![Syncthing in Setup WebUI dialog box][5]
*Syncthing 安装时的 WebUI 对话框*
关闭对话框。现在 Syncthing 安装好了。现在可以分享文件夹,连接一台设备开始同步了。但是,让我们用你其它的客户端继续。
### Android
Syncthing 在 Google Play 和 F-Droid 应用商店都能下载。
![](https://opensource.com/sites/default/files/uploads/syncthing2.png)
安装应用程序后,会显示欢迎界面。给 Syncthing 授予你设备存储的权限。你可能会被要求为了此应用程序而禁用电池优化。这样做是安全的,因为我们将优化应用程序,使其仅在插入电源并连接到无线网络时同步。
点击主菜单图标来到“Settings”然后是“Run Conditions”运行条件。点击“Always run in the background, Run only when charging”总是在后台运行仅在充电时运行和“Run only on wifi”仅在 WIFI 下运行)。现在你的安卓客户端已经准备好与你的设备交换文件。
Syncting 中有两个重要的概念需要记住:文件夹和设备。文件夹是你想要分享的,但是你必须有一台设备来分享。 Syncthing 允许你用不同的设备分享独立的文件夹。设备是通过交换设备的 ID 来添加的。设备 ID 是在 Syncting 首次启动时创建的一个唯一的密码安全标识符。
### 连接设备
现在让我们连接你的 Linux 机器和你的 Android 客户端。
在您的 Linux 计算机中,打开 Syncting单击“Settings”图标然后单击“Show ID”就会显示一个二维码。
在你的安卓手机上,打开 Syncthing。在主界面上点击“Devices”页后点击 “+” 。在第一个区域内点击二维码符号来启动二维码扫描。
将你手机的摄像头对准电脑上的二维码。设备 ID 字段将由您的桌面客户端设备 ID 填充。起一个适合的名字并保存。因为添加设备有两种方式现在你需要在电脑客户端上确认你想要添加安卓手机。你的电脑客户端可能会花上好几分钟来请求确认。当提示确认时点击“Add”。
![](https://opensource.com/sites/default/files/uploads/syncthing6.png)
在“New Device”窗口你能确认并配置一些关于你设备的选项像是“Device Name”和“Addresses”。如果你在地址那一栏选择 “dynamic” (动态),客户端将会自动探测设备的 IP 地址,但是你想要保持住某一个 IP 地址,你能将该地址填进这一栏里。如果你已经创建了文件夹(或者在这之后),你也能与新设备分享这个文件夹。
![](https://opensource.com/sites/default/files/uploads/syncthing7.png)
你的电脑和安卓设备已经配对,可以交换文件了。(如果你有多台电脑或手机,只需重复这些步骤。)
### 分享文件夹
既然您想要同步的设备之间已经连接,现在是时候共享一个文件夹了。您可以在电脑上共享文件夹,添加了该文件夹中的设备将获得一份副本。
若要共享文件夹请转至“Settings”并单击“Add Shared Folder”添加共享文件夹
![](https://opensource.com/sites/default/files/uploads/syncthing8.png)
在下一个窗口中,输入要共享的文件夹的信息:
![](https://opensource.com/sites/default/files/uploads/syncthing9.png)
你可以使用任何你想要的标签。“Folder ID”将随机生成用于识别客户端之间的文件夹。在“Path”里点击“Browse”就能定位到你想要分享的文件夹。如果你想 Syncthing 监控文件夹的变化例如删除、新建文件等点击“Monitor filesystem for changes”监控文件系统变化
记住当你分享一个文件夹在其他客户端的任何改动都将会反映到每一台设备上。这意味着如果你在其他电脑和手机设备之间分享了一个包含图片的文件夹在这些客户端上的改动都会同步到每一台设备。如果这不是你想要的你能让你的文件夹“Send Only”只是发送给其他客户端但是其他客户端的改动都不会被同步。
完成后转至“Share with Devices”与设备共享页并选择要与之同步文件夹的主机。
您选择的所有设备都需要接受共享请求;您将在设备上收到通知。
正如共享文件夹时一样,您必须配置新的共享文件夹:
![](https://opensource.com/sites/default/files/uploads/syncthing12.png)
同样,在这里您可以定义任何标签,但是 ID 必须匹配每个客户端。在文件夹选项中,选择文件夹及其文件的位置。请记住,此文件夹中所做的任何更改都将反映到文件夹所允许同步的每个设备上。
这些是连接设备和与 Syncting 共享文件夹的步骤。开始复制可能需要几分钟时间,这取决于您的网络设置或您是否不在同一网络上。
Syncting 提供了更多出色的功能和选项。试试看,并把握你数据的控制权。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/9/take-control-your-data-syncthing
作者:[Michael Zamot][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[ypingcn](https://github.com/ypingcn)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/mzamot
[1]: https://gizmodo.com/google-says-it-doesnt-go-through-your-inbox-anymore-bu-1827299695
[2]: https://syncthing.net/
[3]: https://docs.syncthing.net/specs/bep-v1.html
[4]: /file/410191
[5]: https://opensource.com/sites/default/files/uploads/syncthing1.png

View File

@ -1,6 +1,7 @@
用这个漂亮的工具将方程式截图迅速转换为 LaTeX
======
**Mathpix 是一个漂亮的小工具,它允许你截取复杂数学方程式的截图,并立即将其转换为 LaTeX 可编辑文本。**
> Mathpix 是一个漂亮的小工具,它允许你截取复杂数学方程式的截图,并立即将其转换为 LaTeX 可编辑文本。
![Mathpix converts math equations images into LaTeX][1]
@ -10,15 +11,11 @@
[Mathpix][3] 是一个在这方面可以帮助你的小工具。
假设你正在阅读带有数学方程式的文档。如果你想在[LaTeX 文档][4]中使用这些方程,你需要使用你的 LaTeX 技能有充足的时间。
假设你正在阅读带有数学方程式的文档。如果你想在 [LaTeX 文档][4]中使用这些方程,你需要使用你的 LaTeX 技能,并且得有充足的时间。
但是 Mathpix 为您解决了这个问题。使用 Mathpix你截取数学方程式的截图它会立即为你提供 LaTeX 代码。然后,你可以在你[最喜欢的 LaTeX 编辑器] [2]中使用此代码。
但是 Mathpix 为您解决了这个问题。使用 Mathpix可以截取数学方程式的截图,它会立即为你提供 LaTeX 代码。然后,你可以在你[最喜欢的 LaTeX 编辑器] [2]中使用此代码。
请参阅以下视频中的 Mathpix 使用:
<https://itsfoss.com/wp-content/uploads/2018/10/mathpix.mp4>
[视频来源][5]Reddit 用户 [kaitlinmcunningham][6]
请参阅[该视频](https://itsfoss.com/wp-content/uploads/2018/10/mathpix.mp4)中的 Mathpix 使用方式。([视频来源][5]Reddit 用户 [kaitlinmcunningham][6]
不是超酷吗?我想编写 LaTeX 文档最困难的部分是那些复杂的方程式。对于像我这样懒人Mathpix 是天赐之物。
@ -32,14 +29,13 @@ Mathpix 适用于 Linux、macOS、Windows 和 iOS。暂时还没有 Android 应
```
sudo snap install mathpix-snipping-tool
```
使用 Mathpix 很简单。安装后,打开该工具。你会在顶部面板中找到它。你可以使用键盘快捷键 Ctrl+Alt+M 开始使用 Mathpix 截图。
使用 Mathpix 很简单。安装后,打开该工具。你会在顶部面板中找到它。你可以使用键盘快捷键 `Ctrl+Alt+M` 开始使用 Mathpix 截图。
它会立即将方程图片转换为 LaTeX 代码。代码将被复制到剪贴板中,然后你可以将其粘贴到 LaTeX 编辑器中。
Mathpix 的光学字符识别技术[正在被][9]许多公司像 [WolframAlpha][10]、微软、谷歌等公司用于在处理数学符号时提升工具的图像识别能力。
Mathpix 的光学字符识别技术[正在被][9]像 [WolframAlpha][10]、微软、谷歌等许多公司用于在处理数学符号时提升工具的图像识别能力。
总而言之,它对学生和学者来说是一个很棒的工具。它是免费使用的,我非常希望它是一个开源工具。但我们无法在生活中得到一切,不是么?
@ -52,7 +48,7 @@ via: https://itsfoss.com/mathpix/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,13 +1,13 @@
设计更快的网页——第一部分:图片压缩
设计更快的网页(一):图片压缩
======
![](https://fedoramagazine.org/wp-content/uploads/2018/02/fasterwebsites1-816x345.jpg)
很多 Web 开发者都希望做出加载速度很快的网页。在移动设备浏览占比越来越大的背景下使用响应式设计使得网站在小屏幕下看起来更漂亮只是其中一个方面。Browser Calories 可以展示网页的加载时间——这不单单关系到用户,还会影响到通过加载速度来进行评级的搜索引擎。这个系列的文章介绍了如何使用 Fedora 提供的工具来给网页“瘦身”。
很多 Web 开发者都希望做出加载速度很快的网页。在移动设备浏览占比越来越大的背景下使用响应式设计使得网站在小屏幕下看起来更漂亮只是其中一个方面。Browser Calories 可以展示网页的加载时间 —— 这不单单关系到用户,还会影响到通过加载速度来进行评级的搜索引擎。这个系列的文章介绍了如何使用 Fedora 提供的工具来给网页“瘦身”。
### 准备工作
在你开始缩减网页之前,你需要明确核心问题所在。为此,你可以使用 [Browserdiet][1]. 这是一个浏览器插件,适用于 Firefox, Opera, Chrome 和其它浏览器。它会对打开的网页进行性能分析,这样你就可以知道应该从哪里入手来缩减网页。
在你开始缩减网页之前,你需要明确核心问题所在。为此,你可以使用 [Browserdiet][1]. 这是一个浏览器插件,适用于 Firefox、Opera、 Chrome 和其它浏览器。它会对打开的网页进行性能分析,这样你就可以知道应该从哪里入手来缩减网页。
然后,你需要一些用来处理的页面。下面的例子是针对 [getferoda.org][2] 的测试截图。一开始,它看起来非常简单,也符合响应式设计。
@ -17,43 +17,39 @@
### Web 优化
网页中包含 281 KB 的 JavaScript 文件203 KB 的 CSS 文件,还有 1.2 MB 的图片。我们先从最严重的问题——图片开始入手。为了解决问题,你需要的工具集有 GIMP, ImageMagick 和 optipng. 你可以使用如下命令轻松安装它们:
网页中包含 281 KB 的 JavaScript 文件203 KB 的 CSS 文件,还有 1.2 MB 的图片。我们先从最严重的问题 —— 图片开始入手。为了解决问题,你需要的工具集有 GIMPImageMagick 和 optipng. 你可以使用如下命令轻松安装它们:
```
sudo dnf install gimp imagemagick optipng
```
比如,我们先拿到这个 6.4 KB 的[文件][4]
![][4]
首先,使用 file 命令来获取这张图片的一些基本信息:
首先,使用 `file` 命令来获取这张图片的一些基本信息:
```
$ file cinnamon.png
cinnamon.png: PNG image data, 60 x 60, 8-bit/color RGBA, non-interlaced
```
这张只由白色和灰色构成的图片使用 8 位 / RGBA 模式来存储。这种方式并没有那么高效。
使用 GIMP你可以为这张图片设置一个更合适的颜色模式。在 GIMP 中打开 cinnamon.png. 然后,在“图片 > 模式”菜单中将其设置为“灰度模式”。将这张图片以 PNG 格式导出。导出时使用压缩因子 9导出对话框中的其它配置均使用默认选项。
使用 GIMP你可以为这张图片设置一个更合适的颜色模式。在 GIMP 中打开 `cinnamon.png`然后,在“图片 > 模式”菜单中将其设置为“灰度模式”。将这张图片以 PNG 格式导出。导出时使用压缩因子 9导出对话框中的其它配置均使用默认选项。
```
$ file cinnamon.png
cinnamon.png: PNG image data, 60 x 60, 8-bit gray+alpha, non-interlaced
```
输出显示,现在这个文件现在处于 8 位 / 灰阶+aplha 模式。文件大小从 6.4 KB 缩小到了 2.8 KB. 这已经是原来大小的 43.75% 了。但是,我们能做的还有很多!
输出显示,现在这个文件现在处于 8 位 / 灰阶 + aplha 模式。文件大小从 6.4 KB 缩小到了 2.8 KB. 这已经是原来大小的 43.75% 了。但是,我们能做的还有很多!
你可以使用 ImageMagick 工具来查看这张图片的更多信息。
```
$ identify cinnamon2.png
cinnamon.png PNG 60x60 60x60+0+0 8-bit Grayscale Gray 2831B 0.000u 0:00.000
```
它告诉你,这个文件的大小为 2831 字节。我们回到 GIMP重新导出文件。在导出对话框中取消存储时间戳和 alpha 通道色值,来让文件更小一点。现在文件输出显示:
@ -61,12 +57,11 @@ cinnamon.png PNG 60x60 60x60+0+0 8-bit Grayscale Gray 2831B 0.000u 0:00.000
```
$ identify cinnamon.png
cinnamon.png PNG 60x60 60x60+0+0 8-bit Grayscale Gray 2798B 0.000u 0:00.000
```
下面,用 optipng 来无损优化你的 PNG 图片。具有相似功能的工具有很多,包括 **advdef**(这是 advancecomp 的一部分),**pngquant** 和 **pngcrush**
下面,用 `optipng` 来无损优化你的 PNG 图片。具有相似功能的工具有很多,包括 `advdef`(这是 advancecomp 的一部分),`pngquant` 和 `pngcrush`
对你的文件运行 optipng. 注意,这个操作会覆盖你的原文件:
对你的文件运行 `optipng` 注意,这个操作会覆盖你的原文件:
```
$ optipng -o7 cinnamon.png
@ -85,25 +80,22 @@ Selecting parameters:
Output IDAT size = 1920 bytes (800 bytes decrease)
Output file size = 2012 bytes (800 bytes = 28.45% decrease)
```
-o7 选项处理起来最慢,但最终效果最好。于是你又将文件缩小了 800 字节,现在它只有 2012 字节了。
`-o7` 选项处理起来最慢,但最终效果最好。于是你又将文件缩小了 800 字节,现在它只有 2012 字节了。
要压缩文件夹下的所有 PNG可以使用这个命令
```
$ optipng -o7 -dir=<directory> *.png
```
-dir 选项用来指定输出文件夹。如果不加这个选项optipng 会覆盖原文件。
`-dir` 选项用来指定输出文件夹。如果不加这个选项,`optipng` 会覆盖原文件。
### 选择正确的文件格式
当涉及到在互联网中使用的图片时,你可以选择:
+ [JPG 或 JPEG][9]
+ [GIF][10]
+ [PNG][11]
@ -112,27 +104,24 @@ $ optipng -o7 -dir=<directory> *.png
+ [JPG 2000 或 JP2][14]
+ [SVG][15]
JPG-LS 和 JPG 2000 没有得到广泛使用。只有一部分数码相机支持这些格式所以我们可以忽略它们。aPNG 是动态的 PNG 格式,也没有广泛使用。
可以通过更改压缩率或者使用其它文件格式来节省下更多字节。我们无法在 GIMP 中应用第一种方法,因为现在的图片已经使用了最高的压缩率了。因为我们的图片中不再包含 [aplha 通道][5],你可以使用 JPG 类型来替代 PNG. 现在使用默认值90% 质量——你可以将它减小至 85%,但这样会导致可见的叠影。这样又省下一些字节:
可以通过更改压缩率或者使用其它文件格式来节省下更多字节。我们无法在 GIMP 中应用第一种方法,因为现在的图片已经使用了最高的压缩率了。因为我们的图片中不再包含 [aplha 通道][5],你可以使用 JPG 类型来替代 PNG。 现在使用默认值90% 质量 —— 你可以将它减小至 85%,但这样会导致可见的叠影。这样又省下一些字节:
```
$ identify cinnamon.jpg
cinnamon.jpg JPEG 60x60 60x60+0+0 8-bit sRGB 2676B 0.000u 0:00.000
```
只将这张图转成正确的色域,并使用 JPG 作为文件格式,就可以将它从 23 KB 缩小到 12.3 KB减少了近 50%.
#### PNG vs JPG: 质量和压缩率
那么,剩下的文件我们要怎么办呢?除了 Fedora “风味”图标和四个特性图标之外,此方法适用于所有其他图片。我们能够处理的图片都有一个白色的背景。
PNG 和 JPG 的一个主要区别在于JPG 没有 alpha 通道。所以,它没有透明度选项。如果你使用 JPG 并为它添加白色背景,你可以将文件从 40.7 KB 缩小至 28.3 KB.
现在又有了四个可以处理的图片:背景图。对于灰色背景,你可以再次使用灰阶模式。对更大的图片,我们就可以节省下更多的空间。它从 216.2 KB 缩小到了 51 KB——基本上只有原图的 25% 了。整体下来,你把这些图片从 481.1 KB 缩小到了 191.5 KB——只有一开始的 39.8%.
现在又有了四个可以处理的图片:背景图。对于灰色背景,你可以再次使用灰阶模式。对更大的图片,我们就可以节省下更多的空间。它从 216.2 KB 缩小到了 51 KB —— 基本上只有原图的 25% 了。整体下来,你把这些图片从 481.1 KB 缩小到了 191.5 KB —— 只有一开始的 39.8%.
#### 质量 vs 大小
@ -144,7 +133,7 @@ PNG 和 JPG 的另外一个区别在于质量。PNG 是一种无损压缩光栅
![][6]
你将一开始 1.2 MB 的图片体积缩小到了 488.9 KB. 只需通过 optipng 进行优化,就可以达到之前体积的三分之一。这可能使得页面更快地加载。不过,要是使用蜗牛到超音速来对比,这个速度还没到达赛车的速度呢!
你将一开始 1.2 MB 的图片体积缩小到了 488.9 KB. 只需通过 `optipng` 进行优化,就可以达到之前体积的三分之一。这可能使得页面更快地加载。不过,要是使用蜗牛到超音速来对比,这个速度还没到达赛车的速度呢!
最后,你可以在 [Google Insights][7] 中查看结果,例如:
@ -160,7 +149,7 @@ via: https://fedoramagazine.org/design-faster-web-pages-part-1-image-compression
作者:[Sirko Kemter][a]
选题:[lujun9972][b]
译者:[StdioA](https://github.com/StdioA)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,278 @@
如何列出在 Linux 上已启用/激活的仓库
======
有很多方法可以列出在 Linux 已启用的仓库。我们将在下面展示给你列出已激活仓库的简便方法。这有助于你知晓你的系统上都启用了哪些仓库。一旦你掌握了这些信息,你就可以添加任何之前还没有准备启用的仓库了。
举个例子,如果你想启用 epel 仓库,你需要先检查它是否已经启用了。这篇教程将会帮助你做这件事情。
### 什么是仓库?
存储特定程序软件包的中枢位置就是一个软件仓库。
所有的 Linux 发行版都在维护自己的仓库,而且允许用户下载并安装这些软件包到他们的机器上。
每个仓库提供者都提供了一套包管理工具,用以管理他们的仓库,比如搜索、安装、更新、升级、移除等等。
大多数 Linux 发行版都作为免费软件,除了 RHEL 和 SUSE要访问他们的仓库你需要先购买订阅。
**建议阅读:**
- [在 Linux 上,如何通过 DNF/YUM 设置管理命令添加、启用、关闭一个仓库][1]
- [在 Linux 上如何按大小列出已安装的包][2]
- [在 Linux 上如何列出升级的包][3]
- [在 Linux 上如何查看一个特定包安装/升级/更新/移除/清除的日期][4]
- [在 Linux 上如何查看一个包的详细信息][5]
- [在你的 Linux 发行版上如何查看一个包是否可用][6]
- [在 Linux 如何列出可用的软件包组][7]
- [Newbies corner —— 一个图形化的 Linux 包管理的前端工具][8]
- [Linux 专家须知,命令行包管理 & 使用列表][9]
### 在 RHEL/CentOS 上列出已启用的库
RHEL 和 CentOS 系统使用的是 RPM 包管理,所以我们可以使用 Yum 包管理器查看这些信息。
YUM 意即 “Yellowdog Updater,Modified”它是一个开源的包管理器的命令行前端用于基于 RPM 的系统上,例如 RHEL 和 CentOS。
YUM 是获取、安装、删除、查询和管理来自发行版仓库和其他第三方库的 RPM 包的主要工具。
**建议阅读:** [在 RHEL/CentOS 系统上用 YUM 命令管理包][10]
基于 RHEL 的系统主要提供以下三个主要的仓库。这些仓库是默认启用的。
* **base**:它包含了所有的核心包和基础包。
* **extras**:它向 CentOS 提供了不破坏上游兼容性或更新基本组件的额外功能。这是一个上游仓库,还有额外的 CentOS 包。
* **updates**:它提供了 bug 修复包、安全包和增强包。
```
# yum repolist
或者
# yum repolist enabled
```
```
Loaded plugins: fastestmirror
Determining fastest mirrors
* epel: ewr.edge.kernel.org
repo id repo name status
!base/7/x86_64 CentOS-7 - Base 9,911
!epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 12,687
!extras/7/x86_64 CentOS-7 - Extras 403
!updates/7/x86_64 CentOS-7 - Updates 1,348
repolist: 24,349
```
### 如何列出 Fedora 上已启用的包
DNF 意即 “Dandified yum”。我们可以说 DNF 是下一代的 yum 包管理器,使用了 hawkey/libsolv 作为后端。自从 Fedroa 18 开始Aleš Kozumplík 就开始开发 DNF最终在 Fedora 22 上实现/发布。
Fedora 22 及之后的系统上都使用 DNF 安装、升级、搜索和移除包。它可以自动解决依赖问题,并使包的安装过程平顺没有任何麻烦。
因为 Yum 许多长时间未解决的问题,现在 Yum 已经被 DNF 所替代。你问为什么他没有给 Yum 打补丁。Aleš Kozumplík 解释说修补在技术上太困难了,而 YUM 团队无法立即承受这些变更还有其他的问题YUM 是 56k 行代码,而 DNF 是 29k 行代码。因此,除了分叉之外,别无选择。
**建议阅读:** [在 Fedora 上使用 DNF 管理软件][11]
Fedora 主要提供下面两个主仓库。这些库将被默认启用。
* **fedora**:它包括所有的核心包和基础包。
* **updates**:它提供了来自稳定发行版的 bug 修复包、安全包和增强包。
```
# dnf repolist
或者
# dnf repolist enabled
```
```
Last metadata expiration check: 0:02:56 ago on Wed 10 Oct 2018 06:12:22 PM IST.
repo id repo name status
docker-ce-stable Docker CE Stable - x86_64 6
*fedora Fedora 26 - x86_64 53,912
home_mhogomchungu mhogomchungu's Home Project (Fedora_25) 19
home_moritzmolch_gencfsm Gnome Encfs Manager (Fedora_25) 5
mystro256-gnome-redshift Copr repo for gnome-redshift owned by mystro256 6
nodesource Node.js Packages for Fedora Linux 26 - x86_64 83
rabiny-albert Copr repo for albert owned by rabiny 3
*rpmfusion-free RPM Fusion for Fedora 26 - Free 536
*rpmfusion-free-updates RPM Fusion for Fedora 26 - Free - Updates 278
*rpmfusion-nonfree RPM Fusion for Fedora 26 - Nonfree 202
*rpmfusion-nonfree-updates RPM Fusion for Fedora 26 - Nonfree - Updates 95
*updates Fedora 26 - x86_64 - Updates
```
### 如何列出 Debian/Ubuntu 上已启用的仓库
基于 Debian 的系统使用的是 APT/APT-GET 包管理,因此我们可以使用 APT/APT-GET 包管理器去获取该信息。
APT 意即 “Advanced Packaging Tool”它取代了 `apt-get`,就像 DNF 取代 Yum 一样。 它具有丰富的命令行工具,在一个命令(`apt`)中包含了所有功能,如 `apt-cache`、`apt-search`、`dpkg`、`apt-cdrom`、`apt-config`、`apt-key` 等,还有其他几个独特的功能。 例如,我们可以通过 APT 轻松安装 .dpkg 软件包,而我们无法通过 APT-GET 获得和包含在 APT 命令中类似的功能。 由于 APT-GET 中未能解决的问题APT 取代了 APT-GET。
apt-get 是一个强大的命令行工具,它用以自动下载和安装新的软件包、升级已存在的软件包、更新包索引列表、还有升级整个基于 Debian 的系统。
```
# apt-cache policy
Package files:
100 /var/lib/dpkg/status
release a=now
500 http://ppa.launchpad.net/peek-developers/stable/ubuntu artful/main amd64 Packages
release v=17.10,o=LP-PPA-peek-developers-stable,a=artful,n=artful,l=Peek stable releases,c=main,b=amd64
origin ppa.launchpad.net
500 http://ppa.launchpad.net/notepadqq-team/notepadqq/ubuntu artful/main amd64 Packages
release v=17.10,o=LP-PPA-notepadqq-team-notepadqq,a=artful,n=artful,l=Notepadqq,c=main,b=amd64
origin ppa.launchpad.net
500 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages
release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main,b=amd64
origin dl.google.com
500 https://download.docker.com/linux/ubuntu artful/stable amd64 Packages
release o=Docker,a=artful,l=Docker CE,c=stable,b=amd64
origin download.docker.com
500 http://security.ubuntu.com/ubuntu artful-security/multiverse amd64 Packages
release v=17.10,o=Ubuntu,a=artful-security,n=artful,l=Ubuntu,c=multiverse,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu artful-security/universe amd64 Packages
release v=17.10,o=Ubuntu,a=artful-security,n=artful,l=Ubuntu,c=universe,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu artful-security/restricted i386 Packages
release v=17.10,o=Ubuntu,a=artful-security,n=artful,l=Ubuntu,c=restricted,b=i386
origin security.ubuntu.com
.
.
origin in.archive.ubuntu.com
500 http://in.archive.ubuntu.com/ubuntu artful/restricted amd64 Packages
release v=17.10,o=Ubuntu,a=artful,n=artful,l=Ubuntu,c=restricted,b=amd64
origin in.archive.ubuntu.com
500 http://in.archive.ubuntu.com/ubuntu artful/main i386 Packages
release v=17.10,o=Ubuntu,a=artful,n=artful,l=Ubuntu,c=main,b=i386
origin in.archive.ubuntu.com
500 http://in.archive.ubuntu.com/ubuntu artful/main amd64 Packages
release v=17.10,o=Ubuntu,a=artful,n=artful,l=Ubuntu,c=main,b=amd64
origin in.archive.ubuntu.com
Pinned packages:
```
### 如何在 openSUSE 上列出已启用的仓库
openSUSE 使用 zypper 包管理,因此我们可以使用 zypper 包管理获得更多信息。
Zypper 是 suse 和 openSUSE 发行版的命令行包管理。它用于安装、更新、搜索、移除包和管理仓库执行各种查询等。Zypper 以 ZYpp 系统管理库libzypp作为后端。
**建议阅读:** [在 openSUSE 和 suse 系统上使用 Zypper 命令管理包][12]
```
# zypper repos
# | Alias | Name | Enabled | GPG Check | Refresh
--+-----------------------+-----------------------------------------------------+---------+-----------+--------
1 | packman-repository | packman-repository | Yes | (r ) Yes | Yes
2 | google-chrome | google-chrome | Yes | (r ) Yes | Yes
3 | home_lazka0_ql-stable | Stable Quod Libet / Ex Falso Builds (openSUSE_42.1) | Yes | (r ) Yes | No
4 | repo-non-oss | openSUSE-leap/42.1-Non-Oss | Yes | (r ) Yes | Yes
5 | repo-oss | openSUSE-leap/42.1-Oss | Yes | (r ) Yes | Yes
6 | repo-update | openSUSE-42.1-Update | Yes | (r ) Yes | Yes
7 | repo-update-non-oss | openSUSE-42.1-Update-Non-Oss | Yes | (r ) Yes | Yes
```
列出仓库及 URI。
```
# zypper lr -u
# | Alias | Name | Enabled | GPG Check | Refresh | URI
--+-----------------------+-----------------------------------------------------+---------+-----------+---------+---------------------------------------------------------------------------------
1 | packman-repository | packman-repository | Yes | (r ) Yes | Yes | http://ftp.gwdg.de/pub/linux/packman/suse/openSUSE_Leap_42.1/
2 | google-chrome | google-chrome | Yes | (r ) Yes | Yes | http://dl.google.com/linux/chrome/rpm/stable/x86_64
3 | home_lazka0_ql-stable | Stable Quod Libet / Ex Falso Builds (openSUSE_42.1) | Yes | (r ) Yes | No | http://download.opensuse.org/repositories/home:/lazka0:/ql-stable/openSUSE_42.1/
4 | repo-non-oss | openSUSE-leap/42.1-Non-Oss | Yes | (r ) Yes | Yes | http://download.opensuse.org/distribution/leap/42.1/repo/non-oss/
5 | repo-oss | openSUSE-leap/42.1-Oss | Yes | (r ) Yes | Yes | http://download.opensuse.org/distribution/leap/42.1/repo/oss/
6 | repo-update | openSUSE-42.1-Update | Yes | (r ) Yes | Yes | http://download.opensuse.org/update/leap/42.1/oss/
7 | repo-update-non-oss | openSUSE-42.1-Update-Non-Oss | Yes | (r ) Yes | Yes | http://download.opensuse.org/update/leap/42.1/non-oss/
```
通过优先级列出仓库。
```
# zypper lr -p
# | Alias | Name | Enabled | GPG Check | Refresh | Priority
--+-----------------------+-----------------------------------------------------+---------+-----------+---------+---------
1 | packman-repository | packman-repository | Yes | (r ) Yes | Yes | 99
2 | google-chrome | google-chrome | Yes | (r ) Yes | Yes | 99
3 | home_lazka0_ql-stable | Stable Quod Libet / Ex Falso Builds (openSUSE_42.1) | Yes | (r ) Yes | No | 99
4 | repo-non-oss | openSUSE-leap/42.1-Non-Oss | Yes | (r ) Yes | Yes | 99
5 | repo-oss | openSUSE-leap/42.1-Oss | Yes | (r ) Yes | Yes | 99
6 | repo-update | openSUSE-42.1-Update | Yes | (r ) Yes | Yes | 99
7 | repo-update-non-oss | openSUSE-42.1-Update-Non-Oss | Yes | (r ) Yes | Yes | 99
```
### 如何列出 Arch Linux 上已启用的仓库
基于 Arch Linux 的系统使用 pacman 包管理,因此我们可以使用 pacman 包管理获取这些信息。
pacman 意即 “package manager utility”。pacman 是一个命令行实用程序,用以安装、构建、移除和管理 Arch Linux 包。pacman 使用 libalpm Arch Linux 包管理库)作为后端去进行这些操作。
**建议阅读:** [在基于 Arch Linux的系统上使用 Pacman命令管理包][13]
```
# pacman -Syy
:: Synchronizing package databases...
core 132.6 KiB 1524K/s 00:00 [############################################] 100%
extra 1859.0 KiB 750K/s 00:02 [############################################] 100%
community 3.5 MiB 149K/s 00:24 [############################################] 100%
multilib 182.7 KiB 1363K/s 00:00 [############################################] 100%
```
### 如何使用 INXI Utility 列出 Linux 上已启用的仓库
inix 是 Linux 上检查硬件信息非常有用的工具,还提供很多的选项去获取 Linux 上的所有硬件信息,我从未在 Linux 上发现其他有如此效用的程序。它由 locsmif 分叉自古老而古怪的 infobash。
inix 是一个可以快速显示硬件信息、CPU、硬盘、Xorg、桌面、内核、GCC 版本、进程、内存使用和很多其他有用信息的程序,还使用于论坛技术支持和调试工具上。
这个实用程序将会显示所有发行版仓库的数据信息,例如 RHEL、CentOS、Fedora、Debain、Ubuntu、LinuxMint、ArchLinux、openSUSE、Manjaro等。
**建议阅读:** [inxi 一个在 Linux 上检查硬件信息的好工具][14]
```
# inxi -r
Repos: Active apt sources in file: /etc/apt/sources.list
deb http://in.archive.ubuntu.com/ubuntu/ yakkety main restricted
deb http://in.archive.ubuntu.com/ubuntu/ yakkety-updates main restricted
deb http://in.archive.ubuntu.com/ubuntu/ yakkety universe
deb http://in.archive.ubuntu.com/ubuntu/ yakkety-updates universe
deb http://in.archive.ubuntu.com/ubuntu/ yakkety multiverse
deb http://in.archive.ubuntu.com/ubuntu/ yakkety-updates multiverse
deb http://in.archive.ubuntu.com/ubuntu/ yakkety-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu yakkety-security main restricted
deb http://security.ubuntu.com/ubuntu yakkety-security universe
deb http://security.ubuntu.com/ubuntu yakkety-security multiverse
Active apt sources in file: /etc/apt/sources.list.d/arc-theme.list
deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04/ /
Active apt sources in file: /etc/apt/sources.list.d/snwh-ubuntu-pulp-yakkety.list
deb http://ppa.launchpad.net/snwh/pulp/ubuntu yakkety main
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/how-to-list-the-enabled-active-repositories-in-linux/
作者:[Prakash Subramanian][a]
选题:[lujun9972][b]
译者:[dianbanjiu](https://github.com/dianbanjiu)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/prakash/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/how-to-add-enable-disable-a-repository-dnf-yum-config-manager-on-linux/
[2]: https://www.2daygeek.com/how-to-list-installed-packages-by-size-largest-on-linux/
[3]: https://www.2daygeek.com/how-to-view-list-the-available-packages-updates-in-linux/
[4]: https://www.2daygeek.com/how-to-view-a-particular-package-installed-updated-upgraded-removed-erased-date-on-linux/
[5]: https://www.2daygeek.com/how-to-view-detailed-information-about-a-package-in-linux/
[6]: https://www.2daygeek.com/how-to-search-if-a-package-is-available-on-your-linux-distribution-or-not/
[7]: https://www.2daygeek.com/how-to-list-an-available-package-groups-in-linux/
[8]: https://www.2daygeek.com/list-of-graphical-frontend-tool-for-linux-package-manager/
[9]: https://www.2daygeek.com/list-of-command-line-package-manager-for-linux/
[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
[11]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/
[12]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/
[13]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/
[14]: https://www.2daygeek.com/inxi-system-hardware-information-on-linux/

View File

@ -3,7 +3,7 @@
![](https://www.ostechnix.com/wp-content/uploads/2018/10/vlock-720x340.png)
当你在共享系统上工作时,你可能不希望其他用户在你的控制台中悄悄地看你在做什么。如果是这样,我知道有个简单的技巧来锁定自己的会话,同时仍然允许其他用户在其他虚拟控制台上使用该系统。要感谢 **Vlock****V** irtual Console **lock**),这是一个命令行程序,用于锁定 Linux 控制台上的一个或多个会话。如有必要你可以锁定整个控制台并完全禁用虚拟控制台切换功能。Vlock 对于有多个用户访问控制台的共享 Linux 系统特别有用。
当你在共享系统上工作时,你可能不希望其他用户偷窥你的控制台中看你在做什么。如果是这样,我知道有个简单的技巧来锁定自己的会话,同时仍然允许其他用户在其他虚拟控制台上使用该系统。要感谢 **Vlock****V**irtual Console **lock**),这是一个命令行程序,用于锁定 Linux 控制台上的一个或多个会话。如有必要你可以锁定整个控制台并完全禁用虚拟控制台切换功能。Vlock 对于有多个用户访问控制台的共享 Linux 系统特别有用。
### 安装 Vlock
@ -12,96 +12,94 @@
在 Debian、Ubuntu、Linux Mint 上,运行以下命令来安装 Vlock
```
$ sudo apt-get install vlock
$ sudo apt-get install vlock
```
在 Fedora 上:
```
$ sudo dnf install vlock
$ sudo dnf install vlock
```
在 RHEL、CentOS 上:
```
$ sudo yum install vlock
$ sudo yum install vlock
```
### 在Linux上锁定虚拟控制台会话
### 在 Linux 上锁定虚拟控制台会话
Vlock 的一般语法是:
```
vlock [ -acnshv ] [ -t <timeout> ] [ plugins... ]
vlock [ -acnshv ] [ -t <timeout> ] [ plugins... ]
```
这里:
* **a** 锁定所有虚拟控制台会话,
* **c** 锁定当前虚拟控制台会话,
* **n** 在锁定所有会话之前切换到新的空控制台,
* **s** 禁用 SysRq 键机制,
* **t** 指定屏保插件的超时时间,
* **h** 显示帮助,
* **v** 显示版本。
* `a` —— 锁定所有虚拟控制台会话,
* `c` —— 锁定当前虚拟控制台会话,
* `n` —— 在锁定所有会话之前切换到新的空控制台,
* `s` —— 禁用 SysRq 键机制,
* `t` —— 指定屏保插件的超时时间,
* `h` —— 显示帮助,
* `v` —— 显示版本。
让我举几个例子。
**1\. 锁定当前控制台会话**
#### 1、 锁定当前控制台会话
在没有任何参数的情况下运行 Vlock 时,它默认锁定当前控制台会话 TYY。要解锁会话你需要输入当前用户的密码或 root 密码。
```
$ vlock
$ vlock
```
![](https://www.ostechnix.com/wp-content/uploads/2018/10/vlock-1-1.gif)
你还可以使用 **-c** 标志来锁定当前的控制台会话。
你还可以使用 `-c` 标志来锁定当前的控制台会话。
```
$ vlock -c
$ vlock -c
```
请注意,此命令仅锁定当前控制台。你可以按 **ALT+F2** 切换到其他控制台。有关在 TTY 之间切换的更多详细信息,请参阅以下指南。
请注意,此命令仅锁定当前控制台。你可以按 `ALT+F2` 切换到其他控制台。有关在 TTY 之间切换的更多详细信息,请参阅以下指南。
此外,如果系统有多个用户,则其他用户仍可以访问其各自的 TTY。
**2\. 锁定所有控制台会话**
#### 2、 锁定所有控制台会话
要同时锁定所有 TTY 并禁用虚拟控制台切换功能,请运行:
```
$ vlock -a
$ vlock -a
```
同样,要解锁控制台会话,只需按下回车键并输入当前用户的密码或 root 用户密码。
请记住,**root 用户可以随时解锁任何 vlock 会话**,除非在编译时禁用。
**3\. 在锁定所有控制台之前切换到新的虚拟控制台**
#### 3、 在锁定所有控制台之前切换到新的虚拟控制台
在锁定所有控制台之前,还可以使 Vlock 从 X 会话切换到新的空虚拟控制台。为此,请使用 **-n** 标志。
在锁定所有控制台之前,还可以使 Vlock 从 X 会话切换到新的空虚拟控制台。为此,请使用 `-n` 标志。
```
$ vlock -n
$ vlock -n
```
**4\. 禁用 SysRq 机制**
#### 4、 禁用 SysRq 机制
你也许知道,魔术 SysRq 键机制允许用户在系统死机时执行某些操作。因此,用户可以使用 SysRq 解锁控制台。为了防止这种情况,请传递 **-s** 选项以禁用 SysRq 机制。请记住,这只适用于有 **-a** 选项的时候。
你也许知道,魔术 SysRq 键机制允许用户在系统死机时执行某些操作。因此,用户可以使用 SysRq 解锁控制台。为了防止这种情况,请传递 `-s` 选项以禁用 SysRq 机制。请记住,这个选项只适用于有 `-a` 选项的时候。
```
$ vlock -sa
$ vlock -sa
```
有关更多选项及其用法,请参阅帮助或手册页。
```
$ vlock -h
$ man vlock
$ vlock -h
$ man vlock
```
Vlock 可防止未经授权的用户获得控制台访问权限。如果你在为 Linux 寻找一个简单的控制台锁定机制,那么 Vlock 值得一试!
@ -111,7 +109,6 @@ Vlock 可防止未经授权的用户获得控制台访问权限。如果你在
干杯!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/how-to-lock-virtual-console-sessions-on-linux/
@ -119,7 +116,7 @@ via: https://www.ostechnix.com/how-to-lock-virtual-console-sessions-on-linux/
作者:[SK][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,4 +1,5 @@
20 questions DevOps job candidates should be prepared to answer Translating by FelixYFZ
Translating by Felix
20 questions DevOps job candidates should be prepared to answer
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/hire-job-career.png?itok=SrZo0QJ3)

View File

@ -1,3 +1,4 @@
Translating by FelixYFZ
5 steps to building a cloud that meets your users' needs
======

View File

@ -1,71 +0,0 @@
translating by belitex
What is an SRE and how does it relate to DevOps?
======
The SRE role is common in large enterprises, but smaller businesses need it, too.
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/toolbox-learn-draw-container-yearbook.png?itok=xDbwz1pP)
Even though the site reliability engineer (SRE) role has become prevalent in recent years, many people—even in the software industry—don't know what it is or does. This article aims to clear that up by explaining what an SRE is, how it relates to DevOps, and how an SRE works when your entire engineering organization can fit in a coffee shop.
### What is site reliability engineering?
[Site Reliability Engineering: How Google Runs Production Systems][1], written by a group of Google engineers, is considered the definitive book on site reliability engineering. Google vice president of engineering Ben Treynor Sloss [coined the term][2] back in the early 2000s. He defined it as: "It's what happens when you ask a software engineer to design an operations function."
Sysadmins have been writing code for a long time, but for many of those years, a team of sysadmins managed many machines manually. Back then, "many" may have been dozens or hundreds, but when you scale to thousands or hundreds of thousands of hosts, you simply can't continue to throw people at the problem. When the number of machines gets that large, the obvious solution is to use code to manage hosts (and the software that runs on them).
Also, until fairly recently, the operations team was completely separate from the developers. The skillsets for each job were considered completely different. The SRE role tries to bring both jobs together.
Before we dig deeper into what makes an SRE and how SREs work with the development team, we need to understand how site reliability engineering works within the DevOps paradigm.
### Site reliability engineering and DevOps
At its core, site reliability engineering is an implementation of the DevOps paradigm. There seems to be a wide array of ways to [define DevOps][3]. The traditional model, where the development ("devs") and operations ("ops") teams were separated, led to the team that writes the code not being responsible for how it works when customers start using it. The development team would "throw the code over the wall" to the operations team to install and support.
This situation can lead to a significant amount of dysfunction. The goals of the dev and ops teams are constantly at odds—a developer wants customers to use the "latest and greatest" piece of code, but the operations team wants a steady system with as little change as possible. Their premise is that any change can introduce instability, while a system with no changes should continue to behave in the same manner. (Noting that minimizing change on the software side is not the only factor in preventing instability is important. For example, if your web application stays exactly the same, but the number of customers grows by 10x, your application may break in many different ways.)
The premise of DevOps is that by merging these two distinct jobs into one, you eliminate contention. If the "dev" wants to deploy new code all the time, they have to deal with any fallout the new code creates. As Amazon's [Werner Vogels said][4], "you build it, you run it" (in production). But developers already have a lot to worry about. They are continually pushed to develop new features for their employer's products. Asking them to understand the infrastructure, including how to deploy, configure, and monitor their service, may be asking a little too much from them. This is where an SRE steps in.
When a web application is developed, there are often many people that contribute. There are user interface designers, graphic designers, frontend engineers, backend engineers, and a whole host of other specialties (depending on the technologies used). Requirements include how the code gets managed (e.g., deployed, configured, monitored)—which are the SRE's areas of specialty. But, just as an engineer developing a nice look and feel for an application benefits from knowledge of the backend-engineer's job (e.g., how data is fetched from a database), the SRE understands how the deployment system works and how to adapt it to the specific needs of that particular codebase or project.
So, an SRE is not just "an ops person who codes." Rather, the SRE is another member of the development team with a different set of skills particularly around deployment, configuration management, monitoring, metrics, etc. But, just as an engineer developing a nice look and feel for an application must know how data is fetched from a data store, an SRE is not singly responsible for these areas. The entire team works together to deliver a product that can be easily updated, managed, and monitored.
The need for an SRE naturally comes about when a team is implementing DevOps but realizes they are asking too much of the developers and need a specialist for what the ops team used to handle.
### How the SRE works at a startup
This is great when there are hundreds of employees (let alone when you are the size of Google or Facebook). Large companies have SRE teams that are split up and embedded into each development team. But a startup doesn't have those economies of scale, and engineers often wear many hats. So, where does the "SRE hat" sit in a small company? One approach is to fully adopt DevOps and have the developers be responsible for the typical tasks an SRE would perform at a larger company. On the other side of the spectrum, you hire specialists — a.k.a., SREs.
The most obvious advantage of trying to put the SRE hat on a developer's head is it scales well as your team grows. Also, the developer will understand all the quirks of the application. But many startups use a wide variety of SaaS products to power their infrastructure. The most obvious is the infrastructure platform itself. Then you add in metrics systems, site monitoring, log analysis, containers, and more. While these technologies solve some problems, they create an additional complexity cost. The developer would need to understand all those technologies and services in addition to the core technologies (e.g., languages) the application uses. In the end, keeping on top of all of that technology can be overwhelming.
The other option is to hire a specialist to handle the SRE job. Their responsibility would be to focus on deployment, configuration, monitoring, and metrics, freeing up the developer's time to write the application. The disadvantage is that the SRE would have to split their time between multiple, different applications (i.e., the SRE needs to support the breadth of applications throughout engineering). This likely means they may not have the time to gain any depth of knowledge of any of the applications; however, they would be in a position to see how all the different pieces fit together. This "30,000-foot view" can help prioritize the weak spots to fix in the system as a whole.
There is one key piece of information I am ignoring: your other engineers. They may have a deep desire to understand how deployment works and how to use the metrics system to the best of their ability. Also, hiring an SRE is not an easy task. You are looking for a mix of sysadmin skills and software engineering skills. (I am specific about software engineers, vs. just "being able to code," because software engineering involves more than just writing code [e.g., writing good tests or documentation].)
Therefore, in some cases, it may make more sense for the "SRE hat" to live on a developer's head. If so, keep an eye on the amount of complexity in both the code and the infrastructure (SaaS or internal). At some point, the complexity on either end will likely push toward more specialization.
### Conclusion
An SRE team is one of the most efficient ways to implement the DevOps paradigm in a startup. I have seen a couple of different approaches, but I believe that hiring a dedicated SRE (pretty early) at your startup will free up time for the developers to focus on their specific challenges. The SRE can focus on improving the tools (and processes) that make the developers more productive. Also, an SRE will focus on making sure your customers have a product that is reliable and secure.
Craig Sebenik will present [SRE (and DevOps) at a Startup][5] at [LISA18][6], October 29-31 in Nashville, Tennessee.
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/10/sre-startup
作者:[Craig Sebenik][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/craig5
[b]: https://github.com/lujun9972
[1]: http://shop.oreilly.com/product/0636920041528.do
[2]: https://landing.google.com/sre/interview/ben-treynor.html
[3]: https://opensource.com/resources/devops
[4]: https://queue.acm.org/detail.cfm?id=1142065
[5]: https://www.usenix.org/conference/lisa18/presentation/sebenik
[6]: https://www.usenix.org/conference/lisa18

View File

@ -0,0 +1,132 @@
What breaks our systems: A taxonomy of black swans
======
Find and fix outlier events that create issues before they trigger severe production problems.
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/black-swan-pair_0.png?itok=MkshwqVg)
Black swans are a metaphor for outlier events that are severe in impact (like the 2008 financial crash). In production systems, these are the incidents that trigger problems that you didn't know you had, cause major visible impact, and can't be fixed quickly and easily by a rollback or some other standard response from your on-call playbook. They are the events you tell new engineers about years after the fact.
Black swans, by definition, can't be predicted, but sometimes there are patterns we can find and use to create defenses against categories of related problems.
For example, a large proportion of failures are a direct result of changes (code, environment, or configuration). Each bug triggered in this way is distinctive and unpredictable, but the common practice of canarying all changes is somewhat effective against this class of problems, and automated rollbacks have become a standard mitigation.
As our profession continues to mature, other kinds of problems are becoming well-understood classes of hazards with generalized prevention strategies.
### Black swans observed in the wild
All technology organizations have production problems, but not all of them share their analyses. The organizations that publicly discuss incidents are doing us all a service. The following incidents describe one class of a problem and are by no means isolated instances. We all have black swans lurking in our systems; it's just some of us don't know it yet.
#### Hitting limits
Running headlong into any sort of limit can produce very severe incidents. A canonical example of this was [Instapaper's outage in February 2017][1] . I challenge any engineer who has carried a pager to read the outage report without a chill running up their spine. Instapaper's production database was on a filesystem that, unknown to the team running the service, had a 2TB limit. With no warning, it stopped accepting writes. Full recovery took days and required migrating its database.
Limits can strike in various ways. Sentry hit [limits on maximum transaction IDs in Postgres][2] . Platform.sh hit [size limits on a pipe buffer][3] . SparkPost [triggered AWS's DDoS protection][4] . Foursquare hit a performance cliff when one of its [datastores ran out of RAM][5]
One way to get advance knowledge of system limits is to test periodically. Good load testing (on a production replica) ought to involve write transactions and should involve growing each datastore beyond its current production size. It's easy to forget to test things that aren't your main datastores (such as Zookeeper). If you hit limits during testing, you have time to fix the problems. Given that resolution of limits-related issues can involve major changes (like splitting a datastore), time is invaluable.
When it comes to cloud services, if your service generates unusual loads or uses less widely used products or features (such as older or newer ones), you may be more at risk of hitting limits. It's worth load testing these, too. But warn your cloud provider first.
Finally, where limits are known, add monitoring (with associated documentation) so you will know when your systems are approaching those ceilings. Don't rely on people still being around to remember.
#### Spreading slowness
> "The world is much more correlated than we give credit to. And so we see more of what Nassim Taleb calls 'black swan events'—rare events happen more often than they should because the world is more correlated."
> —[Richard Thaler][6]
HostedGraphite's postmortem on how an [AWS outage took down its load balancers][7] (which are not hosted on AWS) is a good example of just how much correlation exists in distributed computing systems. In this case, the load-balancer connection pools were saturated by slow connections from customers that were hosted in AWS. The same kinds of saturation can happen with application threads, locks, and database connections—any kind of resource monopolized by slow operations.
HostedGraphite's incident is an example of externally imposed slowness, but often slowness can result from saturation somewhere in your own system creating a cascade and causing other parts of your system to slow down. An [incident at Spotify][8] demonstrates such spread—the streaming service's frontends became unhealthy due to saturation in a different microservice. Enforcing deadlines for all requests, as well as limiting the length of request queues, can prevent such spread. Your service will serve at least some traffic, and recovery will be easier because fewer parts of your system will be broken.
Retries should be limited with exponential backoff and some jitter. An outage at Square, in which its [Redis datastore became overloaded][9] due to a piece of code that retried failed transactions up to 500 times with no backoff, demonstrates the potential severity of excessive retries. The [Circuit Breaker][10] design pattern can be helpful here, too.
Dashboards should be designed to clearly show [utilization, saturation, and errors][11] for all resources so problems can be found quickly.
#### Thundering herds
Often, failure scenarios arise when a system is under unusually heavy load. This can arise organically from users, but often it arises from systems. A surge of cron jobs that starts at midnight is a venerable example. Mobile clients can also be a source of coordinated demand if they are programmed to fetch updates at the same time (of course, it is much better to jitter such requests).
Events occurring at pre-configured times aren't the only source of thundering herds. Slack experienced [multiple outages][12] over a short time due to large numbers of clients being disconnected and immediately reconnecting, causing large spikes of load. CircleCI saw a [severe outage][13] when a GitLab outage ended, leading to a surge of builds queued in its database, which became saturated and very slow.
Almost any service can be the target of a thundering herd. Planning for such eventualities—and testing that your plan works as intended—is therefore a must. Client backoff and [load shedding][14] are often core to such approaches.
If your systems must constantly ingest data that can't be dropped, it's key to have a scalable way to buffer this data in a queue for later processing.
#### Automation systems are complex systems
> "Complex systems are intrinsically hazardous systems."
> —[Richard Cook, MD][15]
If your systems must constantly ingest data that can't be dropped, it's key to have a scalable way to buffer this data in a queue for later processing.
The trend for the past several years has been strongly towards more automation of software operations. Automation of anything that can reduce your system's capacity (e.g., erasing disks, decommissioning devices, taking down serving jobs) needs to be done with care. Accidents (due to bugs or incorrect invocations) with this kind of automation can take down your system very efficiently, potentially in ways that are hard to recover from.
The trend for the past several years has been strongly towards more automation of software operations. Automation of anything that can reduce your system's capacity (e.g., erasing disks, decommissioning devices, taking down serving jobs) needs to be done with care. Accidents (due to bugs or incorrect invocations) with this kind of automation can take down your system very efficiently, potentially in ways that are hard to recover from.
Christina Schulman and Etienne Perot of Google describe some examples in their talk [Help Protect Your Data Centers with Safety Constraints][16]. One incident sent Google's entire in-house content delivery network (CDN) to disk-erase.
Schulman and Perot suggest using a central service to manage constraints, which limits the pace at which destructive automation can operate, and being aware of system conditions (for example, avoiding destructive operations if the service has recently had an alert).
Automation systems can also cause havoc when they interact with operators (or with other automated systems). [Reddit][17] experienced a major outage when its automation restarted a system that operators had stopped for maintenance. Once you have multiple automation systems, their potential interactions become extremely complex and impossible to predict.
It will help to deal with the inevitable surprises if all this automation writes logs to an easily searchable, central place. Automation systems should always have a mechanism to allow them to be quickly turned off (fully or only for a subset of operations or targets).
### Defense against the dark swans
These are not the only black swans that might be waiting to strike your systems. There are many other kinds of severe problem that can be avoided using techniques such as canarying, load testing, chaos engineering, disaster testing, and fuzz testing—and of course designing for redundancy and resiliency. Even with all that, at some point your system will fail.
To ensure your organization can respond effectively, make sure your key technical staff and your leadership have a way to coordinate during an outage. For example, one unpleasant issue you might have to deal with is a complete outage of your network. It's important to have a fail-safe communications channel completely independent of your own infrastructure and its dependencies. For instance, if you run on AWS, using a service that also runs on AWS as your fail-safe communication method is not a good idea. A phone bridge or an IRC server that runs somewhere separate from your main systems is good. Make sure everyone knows what the communications platform is and practices using it.
Another principle is to ensure that your monitoring and your operational tools rely on your production systems as little as possible. Separate your control and your data planes so you can make changes even when systems are not healthy. Don't use a single message queue for both data processing and config changes or monitoring, for example—use separate instances. In [SparkPost: The Day the DNS Died][4], Jeremy Blosser presents an example where critical tools relied on the production DNS setup, which failed.
### The psychology of battling the black swan
To ensure your organization can respond effectively, make sure your key technical staff and your leadership have a way to coordinate during an outage.
Dealing with major incidents in production can be stressful. It really helps to have a structured incident-management process in place for these situations. Many technology organizations (
Dealing with major incidents in production can be stressful. It really helps to have a structured incident-management process in place for these situations. Many technology organizations ( [including Google][18] ) successfully use a version of FEMA's Incident Command System. There should be a clear way for any on-call individual to call for assistance in the event of a major problem they can't resolve alone.
For long-running incidents, it's important to make sure people don't work for unreasonable lengths of time and get breaks to eat and sleep (uninterrupted by a pager). It's easy for exhausted engineers to make a mistake or overlook something that might resolve the incident faster.
### Learn more
There are many other things that could be said about black (or formerly black) swans and strategies for dealing with them. If you'd like to learn more, I highly recommend these two books dealing with resilience and stability in production: Susan Fowler's [Production-Ready Microservices][19] and Michael T. Nygard's [Release It!][20].
Laura Nolan will present [What Breaks Our Systems: A Taxonomy of Black Swans][21] at [LISA18][22], October 29-31 in Nashville, Tennessee, USA.
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/10/taxonomy-black-swans
作者:[Laura Nolan][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/lauranolan
[b]: https://github.com/lujun9972
[1]: https://medium.com/making-instapaper/instapaper-outage-cause-recovery-3c32a7e9cc5f
[2]: https://blog.sentry.io/2015/07/23/transaction-id-wraparound-in-postgres.html
[3]: https://medium.com/@florian_7764/technical-post-mortem-of-the-august-incident-82ab4c3d6547
[4]: https://www.usenix.org/conference/srecon18americas/presentation/blosser
[5]: https://groups.google.com/forum/#!topic/mongodb-user/UoqU8ofp134
[6]: https://en.wikipedia.org/wiki/Richard_Thaler
[7]: https://blog.hostedgraphite.com/2018/03/01/spooky-action-at-a-distance-how-an-aws-outage-ate-our-load-balancer/
[8]: https://labs.spotify.com/2013/06/04/incident-management-at-spotify/
[9]: https://medium.com/square-corner-blog/incident-summary-2017-03-16-2f65be39297
[10]: https://en.wikipedia.org/wiki/Circuit_breaker_design_pattern
[11]: http://www.brendangregg.com/usemethod.html
[12]: https://slackhq.com/this-was-not-normal-really
[13]: https://circleci.statuspage.io/incidents/hr0mm9xmm3x6
[14]: https://www.youtube.com/watch?v=XNEIkivvaV4
[15]: https://web.mit.edu/2.75/resources/random/How%20Complex%20Systems%20Fail.pdf
[16]: https://www.usenix.org/conference/srecon18americas/presentation/schulman
[17]: https://www.reddit.com/r/announcements/comments/4y0m56/why_reddit_was_down_on_aug_11/
[18]: https://landing.google.com/sre/book/chapters/managing-incidents.html
[19]: http://shop.oreilly.com/product/0636920053675.do
[20]: https://www.oreilly.com/library/view/release-it/9781680500264/
[21]: https://www.usenix.org/conference/lisa18/presentation/nolan
[22]: https://www.usenix.org/conference/lisa18

View File

@ -0,0 +1,108 @@
Directing traffic: Demystifying internet-scale load balancing
======
Common techniques used to balance network traffic come with advantages and trade-offs.
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/traffic-light-go.png?itok=nC_851ys)
Large, multi-site, internet-facing systems, including content-delivery networks (CDNs) and cloud providers, have several options for balancing traffic coming onto their networks. In this article, we'll describe common traffic-balancing designs, including techniques and trade-offs.
If you were an early cloud computing provider, you could take a single customer web server, assign it an IP address, configure a domain name system (DNS) record to associate it with a human-readable name, and advertise the IP address via the border gateway protocol (BGP), the standard way of exchanging routing information between networks.
It wasn't load balancing per se, but there probably was load distribution across redundant network paths and networking technologies to increase availability by routing around unavailable infrastructure (giving rise to phenomena like [asymmetric routing][1]).
### Doing simple DNS load balancing
As traffic to your customer's service grows, the business' owners want higher availability. You add a second web server with its own publicly accessible IP address and update the DNS record to direct users to both web servers (hopefully somewhat evenly). This is OK for a while until one web server unexpectedly goes offline. Assuming you detect the failure quickly, you can update the DNS configuration (either manually or with software) to stop referencing the broken server.
Unfortunately, because DNS records are cached, around 50% of requests to the service will likely fail until the record expires from the client caches and those of other nameservers in the DNS hierarchy. DNS records generally have a time to live (TTL) of several minutes or more, so this can create a significant impact on your system's availability.
Worse, some proportion of clients ignore TTL entirely, so some requests will be directed to your offline web server for some time. Setting very short DNS TTLs is not a great idea either; it means higher load on DNS services plus increased latency because clients will have to perform DNS lookups more often. If your DNS service is unavailable for any reason, access to your service will degrade more quickly with a shorter TTL because fewer clients will have your service's IP address cached.
### Adding network load balancing
To work around this problem, you can add a redundant pair of [Layer 4][2] (L4) network load balancers that serve the same virtual IP (VIP) address. They could be hardware appliances or software balancers like [HAProxy][3]. This means the DNS record points only at the VIP and no longer does load balancing.
![Layer 4 load balancers balance connections across webservers.][5]
Layer 4 load balancers balance connections from users across two webservers.
The L4 balancers load-balance traffic from the internet to the backend servers. This is generally done based on a hash (a mathematical function) of each IP packet's 5-tuple: the source and destination IP address and port plus the protocol (such as TCP or UDP). This is fast and efficient (and still maintains essential properties of TCP) and doesn't require the balancers to maintain state per connection. (For more information, [Google's paper on Maglev][6] discusses implementation of a software L4 balancer in significant detail.)
The L4 balancers can do health-checking and send traffic only to web servers that pass checks. Unlike in DNS balancing, there is minimal delay in redirecting traffic to another web server if one crashes, although existing connections will be reset.
L4 balancers can do weighted balancing, dealing with backends with varying capacity. L4 balancing gives significant power and flexibility to operators while being relatively inexpensive in terms of computing power.
### Going multi-site
The system continues to grow. Your customers want to stay up even if your data center goes down. You build a new data center with its own set of service backends and another cluster of L4 balancers, which serve the same VIP as before. The DNS setup doesn't change.
The edge routers in both sites advertise address space, including the service VIP. Requests sent to that VIP can reach either site, depending on how each network between the end user and the system is connected and how their routing policies are configured. This is known as anycast. Most of the time, this works fine. If one site isn't operating, you can stop advertising the VIP for the service via BGP, and traffic will quickly move to the alternative site.
![Serving from multiple sites using anycast][8]
Serving from multiple sites using anycast.
This setup has several problems. Its worst failing is that you can't control where traffic flows or limit how much traffic is sent to a given site. You also don't have an explicit way to route users to the nearest site (in terms of network latency), but the network protocols and configurations that determine the routes should, in most cases, route requests to the nearest site.
### Controlling inbound requests in a multi-site system
To maintain stability, you need to be able to control how much traffic is served to each site. You can get that control by assigning a different VIP to each site and use DNS to balance them using simple or weighted [round-robin][9].
![Serving from multiple sites using a primary VIP][11]
Serving from multiple sites using a primary VIP per site, backed up by secondary sites, with geo-aware DNS.
You now have two new problems.
First, using DNS balancing means you have cached records, which is not good if you need to redirect traffic quickly.
Second, whenever users do a fresh DNS lookup, a VIP connects them to the service at an arbitrary site, which may not be the closest site to them. If your service runs on widely separated sites, individual users will experience wide variations in your system's responsiveness, depending upon the network latency between them and the instance of your service they are using.
You can solve the first problem by having each site constantly advertise and serve the VIPs for all the other sites (and consequently the VIP for any faulty site). Networking tricks (such as advertising less-specific routes from the backups) can ensure that VIP's primary site is preferred, as long as it is available. This is done via BGP, so we should see traffic move within a minute or two of updating BGP.
There isn't an elegant solution to the problem of serving users from sites other than the nearest healthy site with capacity. Many large internet-facing services use DNS services that attempt to return different results to users in different locations, with some degree of success. This approach is always somewhat [complex and error-prone][12], given that internet-addressing schemes are not organized geographically, blocks of addresses can change locations (e.g., when a company reorganizes its network), and many end users can be served from a single caching nameserver.
### Adding Layer 7 load balancing
Over time, your customers begin to ask for more advanced features.
While L4 load balancers can efficiently distribute load among multiple web servers, they operate only on source and destination IP addresses, protocol, and ports. They don't know anything about the content of a request, so you can't implement many advanced features in an L4 balancer. Layer 7 (L7) load balancers are aware of the structure and contents of requests and can do far more.
Some things that can be implemented in L7 load balancers are caching, rate limiting, fault injection, and cost-aware load balancing (some requests require much more server time to process).
They can also balance based on a request's attributes (e.g., HTTP cookies), terminate SSL connections, and help defend against application layer denial-of-service (DoS) attacks. The downside of L7 balancers at scale is cost—they do more computation to process requests, and each active request consumes some system resources. Running L4 balancers in front of one or more pools of L7 balancers can help with scaling.
### Conclusion
Load balancing is a difficult and complex problem. In addition to the strategies described in this article, there are different [load-balancing algorithms][13], high-availability techniques used to implement load balancers, client load-balancing techniques, and the recent rise of service meshes.
Core load-balancing patterns have evolved alongside the growth of cloud computing, and they will continue to improve as large web services work to improve the control and flexibility that load-balancing techniques offer./p>
Laura Nolan and Murali Suriar will present [Keeping the Balance: Load Balancing Demystified][14] at [LISA18][15], October 29-31 in Nashville, Tennessee, USA.
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/10/internet-scale-load-balancing
作者:[Laura Nolan][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/lauranolan
[b]: https://github.com/lujun9972
[1]: https://www.noction.com/blog/bgp-and-asymmetric-routing
[2]: https://en.wikipedia.org/wiki/Transport_layer
[3]: https://www.haproxy.com/blog/failover-and-worst-case-management-with-haproxy/
[4]: /file/412596
[5]: https://opensource.com/sites/default/files/uploads/loadbalancing1_l4-network-loadbalancing.png (Layer 4 load balancers balance connections across webservers.)
[6]: https://ai.google/research/pubs/pub44824
[7]: /file/412601
[8]: https://opensource.com/sites/default/files/uploads/loadbalancing2_going-multisite.png (Serving from multiple sites using anycast)
[9]: https://en.wikipedia.org/wiki/Round-robin_scheduling
[10]: /file/412606
[11]: https://opensource.com/sites/default/files/uploads/loadbalancing3_controlling-inbound-requests.png (Serving from multiple sites using a primary VIP)
[12]: https://landing.google.com/sre/book/chapters/load-balancing-frontend.html
[13]: https://medium.com/netflix-techblog/netflix-edge-load-balancing-695308b5548c
[14]: https://www.usenix.org/conference/lisa18/presentation/suriar
[15]: https://www.usenix.org/conference/lisa18

View File

@ -1,3 +1,5 @@
Translating by cielllll
Three Alternatives for Enabling Two Factor Authentication For SSH On Ubuntu 16.04 And Debian Jessie
======
Security is now more important than ever and securing your SSH server is one of the most important things that you can do as a systems administrator. Traditionally this has meant disabling password authentication and instead using SSH keys. Whilst this is absolutely the first thing you should do that doesn't mean that SSH can't be made even more secure.

View File

@ -1,3 +1,5 @@
translating by Flowsnow
How to use a here documents to write data to a file in bash script
======

View File

@ -1,70 +0,0 @@
translating---geekpi
Simulating the Altair
======
The [Altair 8800][1] was a build-it-yourself home computer kit released in 1975. The Altair was basically the first personal computer, though it predated the advent of that term by several years. It is Adam (or Eve) to every Dell, HP, or Macbook out there.
Some people thought itd be awesome to write an emulator for the Z80—a processor closely related to the Altairs Intel 8080—and then thought it needed a simulation of the Altairs control panel on top of it. So if youve ever wondered what it was like to use a computer in 1975, you can run the Altair on your Macbook:
![Altair 8800][2]
### Installing it
You can download Z80 pack from the FTP server available [here][3]. Youre looking for the latest Z80 pack release, something like `z80pack-1.26.tgz`.
First unpack the file:
```
$ tar -xvf z80pack-1.26.tgz
```
Move into the unpacked directory:
```
$ cd z80pack-1.26
```
The control panel simulation is based on a library called `frontpanel`. Youll have to compile that library first. If you move into the `frontpanel` directory, you will find a `README` file listing the libraries own dependencies. Your experience here will almost certainly differ from mine, but perhaps my travails will be illustrative. I had the dependencies installed, but via [Homebrew][4]. To get the library to compile I just had to make sure that `/usr/local/include` was added to Clangs include path in `Makefile.osx`.
If youve satisfied the dependencies, you should be able to compile the library (were now in `z80pack-1.26/frontpanel`:
```
$ make -f Makefile.osx ...
$ make -f Makefile.osx clean
```
You should end up with `libfrontpanel.so`. I copied this to `/usr/local/lib`.
The Altair simulator is under `z80pack-1.26/altairsim`. You now need to compile the simulator itself. Move into `z80pack-1.26/altairsim/srcsim` and run `make` once more:
```
$ make -f Makefile.osx ...
$ make -f Makefile.osx clean
```
That process will create an executable called `altairsim` one level up in `z80pack-1.26/altairsim`. Run that executable and you should see that iconic Altair control panel!
And if you really want to nerd out, read through the original [Altair manual][5].
If you enjoyed this post, more like it come out every two weeks! Follow [@TwoBitHistory][6] on Twitter or subscribe to the [RSS feed][7] to make sure you know when a new post is out.
--------------------------------------------------------------------------------
via: https://twobithistory.org/2017/12/02/simulating-the-altair.html
作者:[Two-Bit History][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://twobithistory.org
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Altair_8800
[2]: https://www.autometer.de/unix4fun/z80pack/altair.png
[3]: http://www.autometer.de/unix4fun/z80pack/ftp/
[4]: http://brew.sh/
[5]: http://www.classiccmp.org/dunfield/altair/d/88opman.pdf
[6]: https://twitter.com/TwoBitHistory
[7]: https://twobithistory.org/feed.xml

View File

@ -1,3 +1,5 @@
translating by Flowsnow
Build an interactive CLI with Node.js
======

View File

@ -1,3 +1,5 @@
translating---geekpi
How To Quickly Serve Files And Folders Over HTTP In Linux
======

View File

@ -1,4 +1,4 @@
Test containers with Python and Conu
translating by GraveAccent Test containers with Python and Conu
======
![](https://fedoramagazine.org/wp-content/uploads/2018/08/conu-816x345.jpg)

View File

@ -1,3 +1,5 @@
Translating by way-ww
How To Run MS-DOS Games And Programs In Linux
======

View File

@ -1,3 +1,5 @@
translating---geekpi
6 open source tools for writing a book
======

View File

@ -1,4 +1,3 @@
【moria(knuth.fan at gmail.com)翻译中】
9 Easiest Ways To Find Out Process ID (PID) In Linux
======
Everybody knows about PID, Exactly what is PID? Why you want PID? What are you going to do using PID? Are you having the same questions on your mind? If so, you are in the right place to get all the details.

View File

@ -1,3 +1,5 @@
translating by cyleft
Taking notes with Laverna, a web-based information organizer
======

View File

@ -1,248 +0,0 @@
Translating by way-ww
How to Enable or Disable Services on Boot in Linux Using chkconfig and systemctl Command
======
Its a important topic for Linux admin (such a wonderful topic) so, everyone must be aware of this and practice how to use this in the efficient way.
In Linux, whenever we install any packages which has services or daemons. By default all the services “init & systemd” scripts will be added into it but it wont enabled.
Hence, we need to enable or disable the service manually if its required. There are three major init systems are available in Linux which are very famous and still in use.
### What is init System?
In Linux/Unix based operating systems, init (short for initialization) is the first process that started during the system boot up by the kernel.
Its holding a process id (PID) of 1. It will be running in the background continuously until the system is shut down.
Init looks at the `/etc/inittab` file to decide the Linux run level then it starts all other processes & applications in the background as per the run level.
BIOS, MBR, GRUB and Kernel processes were kicked up before hitting init process as part of Linux booting process.
Below are the available run levels for Linux (There are seven runlevels exist, from zero to six).
* **`0:`** halt
* **`1:`** Single user mode
* **`2:`** Multiuser, without NFS
* **`3:`** Full multiuser mode
* **`4:`** Unused
* **`5:`** X11 (GUI Graphical User Interface)
* **`:`** reboot
Below three init systems are widely used in Linux.
* System V (Sys V)
* Upstart
* systemd
### What is System V (Sys V)?
System V (Sys V) is one of the first and traditional init system for Unix like operating system. init is the first process that started during the system boot up by the kernel and its a parent process for everything.
Most of the Linux distributions started using traditional init system called System V (Sys V) first. Over the years, several replacement init systems were released to address design limitations in the standard versions such as launchd, the Service Management Facility, systemd and Upstart.
But systemd has been adopted by several major Linux distributions over the traditional SysV init systems.
### What is Upstart?
Upstart is an event-based replacement for the /sbin/init daemon which handles starting of tasks and services during boot, stopping them during shutdown and supervising them while the system is running.
It was originally developed for the Ubuntu distribution, but is intended to be suitable for deployment in all Linux distributions as a replacement for the venerable System-V init.
It was used in Ubuntu from 9.10 to Ubuntu 14.10 & RHEL 6 based systems after that they are replaced with systemd.
### What is systemd?
Systemd is a new init system and system manager which was implemented/adapted into all the major Linux distributions over the traditional SysV init systems.
systemd is compatible with SysV and LSB init scripts. It can work as a drop-in replacement for sysvinit system. systemd is the first process get started by kernel and holding PID 1.
Its a parant process for everything and Fedora 15 is the first distribution which was adapted systemd instead of upstart. systemctl is command line utility and primary tool to manage the systemd daemons/services such as (start, restart, stop, enable, disable, reload & status).
systemd uses .service files Instead of bash scripts (SysVinit uses). systemd sorts all daemons into their own Linux cgroups and you can see the system hierarchy by exploring `/cgroup/systemd` file.
### How to Enable or Disable Services on Boot Using chkconfig Commmand?
The chkconfig utility is a command-line tool that allows you to specify in which
runlevel to start a selected service, as well as to list all available services along with their current setting.
Also, it will allows us to enable or disable a services from the boot. Make sure you must have superuser privileges (either root or sudo) to use this command.
All the services script are located on `/etc/rd.d/init.d`.
### How to list All Services in run-level
The `-list` parameter displays all the services along with their current status (What run-level the services are enabled or disabled).
```
# chkconfig --list
NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off
abrt-ccpp 0:off 1:off 2:off 3:on 4:off 5:on 6:off
abrtd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off
atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
.
.
```
### How to check the Status of Specific Service
If you would like to see a particular service status in run-level then use the following format and grep the required service.
In this case, we are going to check the `auditd` service status in run-level.
```
# chkconfig --list| grep auditd
auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
```
### How to Enable a Particular Service on Run Levels
Use `--level` parameter to enable a service in the required run-level. In this case, we are going to enable `httpd` service on run-level 3 and 5.
```
# chkconfig --level 35 httpd on
```
### How to Disable a Particular Service on Run Levels
Use `--level` parameter to disable a service in the required run-level. In this case, we are going to enable `httpd` service on run-level 3 and 5.
```
# chkconfig --level 35 httpd off
```
### How to Add a new Service to the Startup List
The `-add` parameter allows us to add any new service to the startup. By default, it will turn on level 2, 3, 4 and 5 automatically for that service.
```
# chkconfig --add nagios
```
### How to Remove a Service from Startup List
Use `--del` parameter to remove the service from the startup list. Here, we are going to remove the Nagios service from the startup list.
```
# chkconfig --del nagios
```
### How to Enable or Disable Services on Boot Using systemctl Command?
systemctl is command line utility and primary tool to manage the systemd daemons/services such as (start, restart, stop, enable, disable, reload & status).
All the created systemd unit files are located on `/etc/systemd/system/`.
### How to list All Services
Use the following command to list all the services which included enabled and disabled.
```
# systemctl list-unit-files --type=service
UNIT FILE STATE
arp-ethers.service disabled
auditd.service enabled
[email protected] enabled
blk-availability.service disabled
brandbot.service static
[email protected] static
chrony-wait.service disabled
chronyd.service enabled
cloud-config.service enabled
cloud-final.service enabled
cloud-init-local.service enabled
cloud-init.service enabled
console-getty.service disabled
console-shell.service disabled
[email protected] static
cpupower.service disabled
crond.service enabled
.
.
150 unit files listed.
```
If you would like to see a particular service status then use the following format and grep the required service. In this case, we are going to check the `httpd` service status.
```
# systemctl list-unit-files --type=service | grep httpd
httpd.service disabled
```
### How to Enable a Particular Service on boot
Use the following systemctl command format to enable a particular service. To enable a service, it will create a symlink. The same can be found below.
```
# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
```
Run the following command to double check whether the services is enabled or not on boot.
```
# systemctl is-enabled httpd
enabled
```
### How to Disable a Particular Service on boot
Use the following systemctl command format to disable a particular service. When you run the command, it will remove a symlink which was created by you while enabling the service. The same can be found below.
```
# systemctl disable httpd
Removed symlink /etc/systemd/system/multi-user.target.wants/httpd.service.
```
Run the following command to double check whether the services is disabled or not on boot.
```
# systemctl is-enabled httpd
disabled
```
### How to Check the current run level
Use the following systemctl command to verify which run-level you are in. Still “runlevel” command works with systemd, however runlevels is a legacy concept in systemd so, i would advise you to use systemctl command for all activity.
We are in `run-level 3`, the same is showing below as `multi-user.target`.
```
# systemctl list-units --type=target
UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
cloud-config.target loaded active active Cloud-config availability
cryptsetup.target loaded active active Local Encrypted Volumes
getty.target loaded active active Login Prompts
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
network-online.target loaded active active Network is Online
network-pre.target loaded active active Network (Pre)
network.target loaded active active Network
paths.target loaded active active Paths
remote-fs.target loaded active active Remote File Systems
slices.target loaded active active Slices
sockets.target loaded active active Sockets
swap.target loaded active active Swap
sysinit.target loaded active active System Initialization
timers.target loaded active active Timers
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/how-to-enable-or-disable-services-on-boot-in-linux-using-chkconfig-and-systemctl-command/
作者:[Prakash Subramanian][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/prakash/
[b]: https://github.com/lujun9972

View File

@ -0,0 +1,178 @@
Translating by StdioA
Design faster web pages, part 2: Image replacement
======
![](https://fedoramagazine.org/wp-content/uploads/2018/03/fasterwebsites2-816x345.jpg)
Welcome back to this series on building faster web pages. The last [article][1] talked about what you can achieve just through image compression. The example started with 1.2MB of browser fat, and reduced down to a weight of 488.9KB. Thats still not fast enough! This article continues the browser diet to lose more fat. You might think that partway through this process things are a bit crazy, but once finished, youll understand why.
### Preparation
Once again this article starts with an analysis of the web pages. Use the built-in screenshot function of Firefox to make a screenshot of the entire page. Youll also want to install Inkscape [using sudo][2]:
```
$ sudo dnf install inkscape
```
If you want to know how to use Inkscape, there are already several [articles][3] in Fedora Magazine. This article will only explain some basic tasks for optimizing an SVG for web use.
### Analysis
Once again, this example uses the [getfedora.org][4] web page.
![Getfedora page with graphics marked][5]
This analysis is better done graphically, which is why it starts with a screenshot. The screenshot above marks all graphical elements of the page. In two cases or better in four cases, the Fedora websites team already used measures to replace images. The icons for social media are glyphs from a font and the language selector is an SVG.
There are several options for replacing:
+ CSS3
+ Fonts
+ SVG
+ HTML5 Canvas
#### HTML5 Canvas
Briefly, HTML5 Canvas is an HTML element that allows you to draw with the help of scripts, mostly JavaScript, although its not widely used yet. As you draw with the help of scripts, the element can also be animated. Some examples of what you can achieve with HTML Canvas include this [triangle pattern,][6] [animated wave][7], and [text animation][8]. In this case, though, it seems not to be the right choice.
#### CSS3
With Cascading Style Sheets you can draw shapes and even animate them. CSS is often used for drawing elements like buttons. However, more complicated graphics via CSS are usually only seen in technical demonstration pages. This is because graphics are still better done visually as with coding.
#### Fonts
The usage of fonts for styling web pages is another way, and [Fontawesome][9] is quiet popular. For instance, you could replace the Flavor and the Spin icons with a font in this example. There is a negative side to using this method, which will be covered in the next part of this series, but it can be done easily.
#### SVG
This graphics format has existed for a long time and was always supposed to be used in the browser. For a long time not all browsers supported it, but thats history. So the best way to replace pictures in this example is with SVG.
### Optimizing SVG for the web
To optimize an SVG for internet use requires several steps.
SVG is an XML dialect. Components like circle, rectangle, or text paths are described with nodes. Each node is an XML element. To keep the code clean, an SVG should use as few nodes as possible.
The SVG example is a circular icon with a coffee mug on it. You have 3 options to describe it with SVG.
#### Circle element with the mug on top
```
<circle
style="opacity:1;fill:#717d82;fill-opacity:1;stroke:none;stroke-width:9.51950836;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke"
id="path36"
cx="68.414307"
cy="130.71523"
r="3.7620001" />
```
#### Circular path with the mug on top
```
<path
style="opacity:1;fill:#717d82;fill-opacity:1;stroke:none;stroke-width:1.60968435;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke"
d="m 68.414044,126.95318 a 3.7618673,3.7618673 0 0 0 -3.76153,3.76204 3.7618673,3.7618673 0 0 0 3.76153,3.76205 3.7618673,3.7618673 0 0 0 3.76206,-3.76205 3.7618673,3.7618673 0 0 0 -3.76206,-3.76204 z"
id="path20" />
```
#### single path
```
<path
style="opacity:1;fill:#717d82;fill-opacity:1;stroke:none;stroke-width:1.60968435;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke"
d="m 68.414044,126.95318 a 3.7618673,3.7618673 0 0 0 -3.76153,3.76204 3.7618673,3.7618673 0 0 0 3.76153,3.76205 3.7618673,3.7618673 0 0 0 3.76206,-3.76205 3.7618673,3.7618673 0 0 0 -3.76206,-3.76204 z m -1.21542,0.92656 h 2.40554 c 0.0913,0.21025 0.18256,0.42071 0.27387,0.63097 h 0.47284 v 0.60099 h -0.17984 l -0.1664,1.05989 h 0.24961 l -0.34779,1.96267 -0.21238,-0.003 -0.22326,1.41955 h -2.12492 l -0.22429,-1.41955 -0.22479,0.003 -0.34829,-1.96267 h 0.26304 l -0.16692,-1.05989 h -0.1669 v -0.60099 h 0.44752 c 0.0913,-0.21026 0.18206,-0.42072 0.27336,-0.63097 z m 0.12608,0.19068 c -0.0614,0.14155 -0.12351,0.28323 -0.185,0.42478 h 2.52336 c -0.0614,-0.14155 -0.12248,-0.28323 -0.18397,-0.42478 z m -0.65524,0.63097 v 0.21911 l 0.0594,5.2e-4 h 3.35844 l 0.0724,-5.2e-4 v -0.21911 z m 0.16846,0.41083 0.1669,1.05937 h 2.80603 l 0.16693,-1.05937 -1.57046,0.008 z m -0.061,1.25057 0.27956,1.5782 1.34411,-0.0145 1.34567,0.0145 0.28059,-1.5782 z m 1.62367,1.75441 -1.08519,0.0124 0.19325,1.2299 h 1.79835 l 0.19328,-1.2299 z"
id="path2714"
inkscape:connector-curvature="0" />
```
You probably can see the code becomes more complex and needs more characters to describe it. More characters in a file result, of course, in a larger size.
#### Node cleaning
If you open an example SVG in Inkscape and press F2, that activates the Node tool. You should see something like this:
![Inkscape - Node tool activated][10]
There are 5 nodes that arent necessary in this example — the ones in the middle of the lines. To remove them, select them one by one with the activated Node tool and press the **Del** key. After this, select the nodes which define this lines and make them corners again using the toolbar tool.
![Inkscape - Node tool make node a corner][11]
Without fixing the corners, handles are used that define the curve, which gets saved and will increase file size. You have to do this node cleaning by hand, as it cant be effectively automated. Now youre ready for the next stage.
Use the Save as function and choose Optimized svg. A dialogue window opens where you can select what to remove or keep.
![Inkscape - Dialog window for save as optimized SVG][12]
Even the little SVG in this example got down from 3.2 KB to 920 bytes, less than a third of its original size.
Back to the getfedora page: The grey voronoi pattern used in the background of the main section, after our optimization from Part 1 of this series, is down to 164.1 KB versus the original 211.12 KB size.
The original SVG it was exported from is 1.9 MB in size. After these SVG optimization steps, its only 500.4KB. Too big? Well, the current blue background is 564.98 KB in size. But theres only a small difference between the SVG and the PNG.
#### Compressed files
```
$ ls -lh
insgesamt 928K
-rw-r--r--. 1 user user 161K 19. Feb 19:44 grey-pattern.png
-rw-rw-r--. 1 user user 160K 18. Feb 12:23 grey-pattern.png.gz
-rw-r--r--. 1 user user 489K 19. Feb 19:43 greyscale-pattern-opti.svg
-rw-rw-r--. 1 user user 112K 19. Feb 19:05 greyscale-pattern-opti.svg.gz
```
This is the output of a small test I did to visualize this topic. You should probably see that the raster graphic — the PNG — is already compressed and cant be anymore. The opposite is the SVG, an XML file. This is just text and can compressed, to less then a fourth of its size. As a result it is now around 50 KB smaller in size than the PNG.
Modern browsers can handle compressed files natively. Therefore, a lot of web servers have switched on mod_deflate (Apache) and gzip (nginx). Thats how we save space during delivery. Check out if its enabled at your server [here][13].
### Tooling for production
First of all, nobody wants to always optimize SVG in Inkscape. You can run Inkscape without a GUI in batch mode, but theres no option to convert from Inkscape SVG to optimized SVG. You can only export raster graphics this way. But there are alternatives:
* SVGO (which seems not actively developed)
* Scour
This example will use scour for optimization. To install it:
```
$ sudo dnf install scour
```
To automatically optimize an SVG file, run scour similarly to this:
```
[user@localhost ]$ scour INPUT.svg OUTPUT.svg -p 3 --create-groups --renderer-workaround --strip-xml-prolog --remove-descriptive-elements --enable-comment-stripping --disable-embed-rasters --no-line-breaks --enable-id-stripping --shorten-ids
```
This is the end of part two, in which you learned how to replace raster images with SVG and how to optimize it for usage. Stay tuned to the Fedora Magazine for part three, coming soon.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/design-faster-web-pages-part-2-image-replacement/
作者:[Sirko Kemter][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/gnokii/
[b]: https://github.com/lujun9972
[1]: https://wp.me/p3XX0v-5fJ
[2]: https://fedoramagazine.org/howto-use-sudo/
[3]: https://fedoramagazine.org/?s=Inkscape
[4]: https://getfedora.org
[5]: https://fedoramagazine.org/wp-content/uploads/2018/02/getfedora_mag.png
[6]: https://codepen.io/Cthulahoop/pen/umcvo
[7]: https://codepen.io/jackrugile/pen/BvLHg
[8]: https://codepen.io/tholman/pen/lDLhk
[9]: https://fontawesome.com/
[10]: https://fedoramagazine.org/wp-content/uploads/2018/02/svg-optimization-nodes.png
[11]: https://fedoramagazine.org/wp-content/uploads/2018/02/node_cleaning.png
[12]: https://fedoramagazine.org/wp-content/uploads/2018/02/svg-optimizing-dialog.png
[13]: https://checkgzipcompression.com/?url=http%3A%2F%2Fgetfedora.org

View File

@ -1,76 +0,0 @@
translating---geekpi
MidnightBSD Hits 1.0! Checkout Whats New
======
A couple days ago, Lucas Holt announced the release of MidnightBSD 1.0. Lets take a quick look at what is included in this new release.
### What is MidnightBSD?
![MidnightBSD][1]
[MidnightBSD][2] is a fork of FreeBSD. Lucas created MightnightBSD to be an option for desktop users and for BSD newbies. He wanted to create something that would allow people to quickly get a desktop experience on BSD. He believed that other options had too much of a focus on the server market.
### What is in MidnightBSD 1.0?
According to the [release notes][3], most of the work in 1.0 went towards updating the base system, improving the package manager and updating tools. The new release is compatible with FreeBSD 10-Stable.
Mports (MidnightBSDs package management system) has been upgraded to support installing multiple packages with one command. The `mport upgrade` command has been fixed. Mports now tracks deprecated and expired packages. A new package format was also introduced.
<https://www.youtube.com/embed/-rlk2wFsjJ4>
Other changes include:
* [ZFS][4] is now supported as a boot file system. Previously, ZFS could only be used for additional storage.
* Support for NVME SSDs
* AMD Ryzen and Radeon support have been improved.
* Intel, Broadcom, and other drivers updated.
* bhyve support has been ported from FreeBSD
* The sensors framework was removed because it was causing locking issues.
* Sudo was removed and replaced with [doas][5] from OpenBSD.
* Added support for Microsoft hyper-v
### Before you upgrade…
If you are a current MidnightBSD user or are thinking of trying out the new release, it would be a good idea to wait. Lucas is currently rebuilding packages to support the new package format and tooling. He also plans to upgrade packages and ports for the desktop environment over the next couple of months. He is currently working on porting Firefox 52 ESR because it is the last release that does not require Rust. He also hopes to get a newer version of Chromium ported to MidnightBSD. I would recommend keeping an eye on the MidnightBSD [Twi][6][t][6][ter][6] feed.
### What happened to 0.9?
You might notice that the previous release of MidnightBSD was 0.8.6. Now, you might be wondering “Why the jump to 1.0”? According to Lucas, he ran into several issues while developing 0.9. In fact, he restarted it several times. He ending up taking CURRENT in a different direction than the 0.9 branch and it became 1.0. Some packages also had an issue with the 0.* numbering system.
### Help Needed
Currently, the MidnightBSD project is the work of pretty much one guy, Lucas Holt. This is the main reason why development has been slow. If you are interested in helping out, you can contact him on [Twitter][6].
In the [release announcement video][7]. Lucas said that he had encountered problems with upstream projects accepting patches. They seem to think that MidnightBSD is too small. This often means that he has to port an application from scratch.
### Thoughts
I have a thing for the underdog. Of all the BSDs that I have interacted with, that monicker fits MidnightBSD the most. One guy trying to create an easy desktop experience. Currently, there is only one other BSD trying to do something similar: Project Trident. I think that this is a real barrier to BSDs success. Linux succeeds because people can quickly and easily install it. Hopefully, MidnightBSD does that for BSD, but right now it has a long way to go.
Have you ever used MidnightBSD? If not, what is your favorite BSD? What other BSD topics should we cover? Let us know in the comments below.
If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][8].
--------------------------------------------------------------------------------
via: https://itsfoss.com/midnightbsd-1-0-release/
作者:[John Paul][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[b]: https://github.com/lujun9972
[1]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/10/midnightbsd-wallpaper.jpeg
[2]: https://www.midnightbsd.org/
[3]: https://www.midnightbsd.org/notes/
[4]: https://itsfoss.com/what-is-zfs/
[5]: https://man.openbsd.org/doas
[6]: https://twitter.com/midnightbsd
[7]: https://www.youtube.com/watch?v=-rlk2wFsjJ4
[8]: http://reddit.com/r/linuxusersgroup

View File

@ -0,0 +1,153 @@
How to write your favorite R functions in Python
======
R or Python? This Python script mimics convenient R-style functions for doing statistics nice and easy.
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/search_find_code_issue_bug_programming.png?itok=XPrh7fa0)
One of the great modern battles of data science and machine learning is "Python vs. R." There is no doubt that both have gained enormous ground in recent years to become top programming languages for data science, predictive analytics, and machine learning. In fact, according to a recent IEEE article, Python overtook C++ as the [top programming language][1] and R firmly secured its spot in the top 10.
However, there are some fundamental differences between these two. [R was developed primarily][2] as a tool for statistical analysis and quick prototyping of a data analysis problem. Python, on the other hand, was developed as a general purpose, modern object-oriented language in the same vein as C++ or Java but with a simpler learning curve and more flexible demeanor. Consequently, R continues to be extremely popular among statisticians, quantitative biologists, physicists, and economists, whereas Python has slowly emerged as the top language for day-to-day scripting, automation, backend web development, analytics, and general machine learning frameworks and has an extensive support base and open source development community work.
### Mimicking functional programming in a Python environment
[R's nature as a functional programming language][3] provides users with an extremely simple and compact interface for quick calculations of probabilities and essential descriptive/inferential statistics for a data analysis problem. For example, wouldn't it be great to be able to solve the following problems with just a single, compact function call?
* How to calculate the mean/median/mode of a data vector.
* How to calculate the cumulative probability of some event following a normal distribution. What if the distribution is Poisson?
* How to calculate the inter-quartile range of a series of data points.
* How to generate a few random numbers following a Student's t-distribution.
The R programming environment can do all of these.
On the other hand, Python's scripting ability allows analysts to use those statistics in a wide variety of analytics pipelines with limitless sophistication and creativity.
To combine the advantages of both worlds, you just need a simple Python-based wrapper library that contains the most commonly used functions pertaining to probability distributions and descriptive statistics defined in R-style. This enables you to call those functions really fast without having to go to the proper Python statistical libraries and figure out the whole list of methods and arguments.
### Python wrapper script for most convenient R-functions
[I wrote a Python script][4] to define the most convenient and widely used R-functions in simple, statistical analysis—in Python. After importing this script, you will be able to use those R-functions naturally, just like in an R programming environment.
The goal of this script is to provide simple Python subroutines mimicking R-style statistical functions for quickly calculating density/point estimates, cumulative distributions, and quantiles and generating random variates for important probability distributions.
To maintain the spirit of R styling, the script uses no class hierarchy and only raw functions are defined in the file. Therefore, a user can import this one Python script and use all the functions whenever they're needed with a single name call.
Note that I use the word mimic. Under no circumstance am I claiming to emulate R's true functional programming paradigm, which consists of a deep environmental setup and complex relationships between those environments and objects. This script allows me (and I hope countless other Python users) to quickly fire up a Python program or Jupyter notebook, import the script, and start doing simple descriptive statistics in no time. That's the goal, nothing more, nothing less.
If you've coded in R (maybe in grad school) and are just starting to learn and use Python for data analysis, you will be happy to see and use some of the same well-known functions in your Jupyter notebook in a manner similar to how you use them in your R environment.
Whatever your reason, using this script is fun.
### Simple examples
To start, just import the script and start working with lists of numbers as if they were data vectors in R.
```
from R_functions import *
lst=[20,12,16,32,27,65,44,45,22,18]
<more code, more statistics...>
```
Say you want to calculate the [Tuckey five-number][5] summary from a vector of data points. You just call one simple function, **fivenum** , and pass on the vector. It will return the five-number summary in a NumPy array.
```
lst=[20,12,16,32,27,65,44,45,22,18]
fivenum(lst)
> array([12. , 18.5, 24.5, 41. , 65. ])
```
Maybe you want to know the answer to the following question:
Suppose a machine outputs 10 finished goods per hour on average with a standard deviation of 2. The output pattern follows a near normal distribution. What is the probability that the machine will output at least 7 but no more than 12 units in the next hour?
The answer is essentially this:
![](https://opensource.com/sites/default/files/uploads/r-functions-in-python_1.png)
You can obtain the answer with just one line of code using **pnorm** :
```
pnorm(12,10,2)-pnorm(7,10,2)
> 0.7745375447996848
```
Or maybe you need to answer the following:
Suppose you have a loaded coin with the probability of turning heads up 60% every time you toss it. You are playing a game of 10 tosses. How do you plot and map out the chances of all the possible number of wins (from 0 to 10) with this coin?
You can obtain a nice bar chart with just a few lines of code using just one function, **dbinom** :
```
probs=[]
import matplotlib.pyplot as plt
for i in range(11):
    probs.append(dbinom(i,10,0.6))
plt.bar(range(11),height=probs)
plt.grid(True)
plt.show()
```
![](https://opensource.com/sites/default/files/uploads/r-functions-in-python_2.png)
### Simple interface for probability calculations
R offers an extremely simple and intuitive interface for quick calculations from essential probability distributions. The interface goes like this:
* **d** {distribution} gives the density function value at a point **x**
* **p** {distribution} gives the cumulative value at a point **x**
* **q** {distribution} gives the quantile function value at a probability **p**
* **r** {distribution} generates one or multiple random variates
In our implementation, we stick to this interface and its associated argument list so you can execute these functions exactly like you would in an R environment.
### Currently implemented functions
The following R-style functions are implemented in the script for fast calling.
* Mean, median, variance, standard deviation
* Tuckey five-number summary, IQR
* Covariance of a matrix or between two vectors
* Density, cumulative probability, quantile function, and random variate generation for the following distributions: normal, uniform, binomial, Poisson, F, Student's t, Chi-square, beta, and gamma.
### Work in progress
Obviously, this is a work in progress, and I plan to add some other convenient R-functions to this script. For example, in R, a single line of command **lm** can get you an ordinary least-square fitted model to a numerical dataset with all the necessary inferential statistics (P-values, standard error, etc.). This is powerfully brief and compact! On the other hand, standard linear regression problems in Python are often tackled using [Scikit-learn][6], which needs a bit more scripting for this use, so I plan to incorporate this single function linear model fitting feature using Python's [statsmodels][7] backend.
If you like and use this script in your work, please help others find it by starring or forking its [GitHub repository][8]. Also, you can check my other [GitHub repos][9] for fun code snippets in Python, R, or MATLAB and some machine learning resources.
If you have any questions or ideas to share, please contact me at [tirthajyoti[AT]gmail.com][10]. If you are, like me, passionate about machine learning and data science, please [add me on LinkedIn][11] or [follow me on Twitter. ][12]
Originally published on [Towards Data Science][13]. Reposted under [CC BY-SA 4.0][14].
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/10/write-favorite-r-functions-python
作者:[Tirthajyoti Sarkar][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/tirthajyoti
[b]: https://github.com/lujun9972
[1]: https://spectrum.ieee.org/at-work/innovation/the-2018-top-programming-languages
[2]: https://www.coursera.org/lecture/r-programming/overview-and-history-of-r-pAbaE
[3]: http://adv-r.had.co.nz/Functional-programming.html
[4]: https://github.com/tirthajyoti/StatsUsingPython/blob/master/R_Functions.py
[5]: https://en.wikipedia.org/wiki/Five-number_summary
[6]: http://scikit-learn.org/stable/
[7]: https://www.statsmodels.org/stable/index.html
[8]: https://github.com/tirthajyoti/StatsUsingPython
[9]: https://github.com/tirthajyoti?tab=repositories
[10]: mailto:tirthajyoti@gmail.com
[11]: https://www.linkedin.com/in/tirthajyoti-sarkar-2127aa7/
[12]: https://twitter.com/tirthajyotiS
[13]: https://towardsdatascience.com/how-to-write-your-favorite-r-functions-in-python-11e1e9c29089
[14]: https://creativecommons.org/licenses/by-sa/4.0/

View File

@ -0,0 +1,98 @@
Understanding Linux Links: Part 2
======
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/links-fikri-rasyid-7853.jpg?itok=0jBT_1M2)
In the [first part of this series][1], we looked at hard links and soft links and discussed some of the various ways that linking can be useful. Linking may seem straightforward, but there are some non-obvious quirks you have to be aware of. Thats what well be looking at here. Consider, for example, at the way we created the link to _libblah_ in the previous article. Notice how we linked from within the destination folder:
```
cd /usr/local/lib
ln -s /usr/lib/libblah
```
That will work. But this:
```
cd /usr/lib
ln -s libblah /usr/local/lib
```
That is, linking from within the original folder to the destination folder, will not work.
The reason for that is that _ln_ will think you are linking from inside _/usr/local/lib_ to _/usr/local/lib_ and will create a linked file from _libblah_ in _/usr/local/lib_ to _libblah_ also in _/usr/local/lib_. This is because all the link file gets is the name of the file ( _libblah_ ) but not the path to the file. The end result is a very broken link.
However, this:
```
cd /usr/lib
ln -s /usr/lib/libblah /usr/local/lib
```
will work. Then again, it would work regardless of from where you executed the instruction within the filesystem. Using absolute paths, that is, spelling out the whole the path, from root (/) drilling down to to the file or directory itself, is just best practice.
Another thing to note is that, as long as both _/usr/lib_ and _/usr/local/lib_ are on the same partition, making a hard link like this:
```
cd /usr/lib
ln -s libblah /usr/local/lib
```
will also work because hard links don't rely on pointing to a file within the filesystem to work.
Where hard links will not work is if you want to link across partitions. Say you have _fileA_ on partition A and the partition is mounted at _/path/to/partitionA/directory_. If you want to link _fileA_ to _/path/to/partitionB/directory_ that is on partition B, this will not work:
```
ln /path/to/partitionA/directory/file /path/to/partitionB/directory
```
As we saw previously, hard links are entries in a partition table that point to data on the *same partition*. You can't have an entry in the table of one partition pointing to data on another partition. Your only choice here would be to us a soft link:
```
ln -s /path/to/partitionA/directory/file /path/to/partitionB/directory
```
Another thing that soft links can do and hard links cannot is link to whole directories:
```
ln -s /path/to/some/directory /path/to/some/other/directory
```
will create a link to _/path/to/some/directory_ within _/path/to/some/other/directory_ without a hitch.
Trying to do the same by hard linking will show you an error saying that you are not allowed to do that. And the reason for that is unending recursiveness: if you have directory B inside directory A, and then you link A inside B, you have situation, because then A contains B within A inside B that incorporates A that encloses B, and so on ad-infinitum.
You can have recursive using soft links, but why would you do that to yourself?
### Should I use a hard or a soft link?
In general you can use soft links everywhere and for everything. In fact, there are situations in which you can only use soft links. That said, hard links are slightly more efficient: they take up less space on disk and are faster to access. On most machines you will not notice the difference, though: the difference in space and speed will be negligible given today's massive and speedy hard disks. However, if you are using Linux on an embedded system with a small storage and a low-powered processor, you may want to give hard links some consideration.
Another reason to use hard links is that a hard link is much more difficult to break. If you have a soft link and you accidentally move or delete the file it is pointing to, your soft link will be broken and point to... nothing. There is no danger of this happening with a hard link, since the hard link points directly to the data on the disk. Indeed, the space on the disk will not be flagged as free until the last hard link pointing to it is erased from the file system.
Soft links, on the other hand can do more than hard links and point to anything, be it file or directory. They can also point to items that are on different partitions. These two things alone often make them the only choice.
### Next Time
Now we have covered files and directories and the basic tools to manipulate them, you are ready to move onto the tools that let you explore the directory hierarchy, find data within files, and examine the contents. That's what we'll be dealing with in the next installment. See you then!
Learn more about Linux through the free ["Introduction to Linux" ][2]course from The Linux Foundation and edX.
--------------------------------------------------------------------------------
via: https://www.linux.com/blog/2018/10/understanding-linux-links-part-2
作者:[Paul Brown][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linux.com/users/bro66
[b]: https://github.com/lujun9972
[1]: https://www.linux.com/blog/intro-to-linux/2018/10/linux-links-part-1
[2]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux

View File

@ -0,0 +1,138 @@
An Overview of Android Pie
======
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/android-pie.jpg?itok=Sx4rbOWY)
Lets talk about Android for a moment. Yes, I know its only Linux by way of a modified kernel, but what isnt these days? And seeing as how the developers of Android have released what many (including yours truly) believe to be the most significant evolution of the platform to date, theres plenty to talk about. Of course, before we get into that, it does need to be mentioned (and most of you will already know this) that the whole of Android isnt open source. Although much of it is, when you get into the bits that connect to Google services, things start to close up. One major service is the Google Play Store, a functionality that is very much proprietary. But this isnt about how much of Android is open or closed, this is about Pie.
Delicious, nutritious … efficient and battery-saving Pie.
Ive been working with Android Pie on my Essential PH-1 daily driver (a phone that I really love, but understand how shaky the ground is under the company). After using Android Pie for a while now, I can safely say you want it. Its that good. But what about the ninth release of Android makes it so special? Lets dig in and find out. Our focus will be on the aspects that affect users, not developers, so I wont dive deep into the underlying works.
### Gesture-Based Navigation
Much has been made about Androids new gesture-based navigation—much of it not good. To be honest, this was a feature that aroused all of my curiosity. When it was first announced, no one really had much of an idea what it would be like. Would users be working with multi touch gestures to navigate around the Android interface? Or would this be something completely different.
![Android Pie][2]
Figure 1: The Android Pie recent apps overview.
[Used with permission][3]
The reality is, gesture-based navigation is much more subtle and simple than what most assumed. And it all boils down to the Home button. With gesture-based navigation enabled, the Home button and the Recents button have been combined into a single feature. This means, in order to gain access to your recent apps, you cant simply tap that square Recents button. Instead, the Recent apps overview (Figure 1) is opened with a short swipe up from the home button.
Another change is how the App Drawer is accessed. In similar fashion to opening the Recents overview, the App Drawer is opened via a long swipe up from the Home button.
As for the back button? Its not been removed. Instead, what youll find is it appears (in the left side of the home screen dock) when an app calls for it. Sometimes that back button will appear, even if an app includes its own back button.
Thing is, however, if you dont like gesture-based navigation, you can disable it. To do so, follow these steps:
1. Open Settings
2. Scroll down and tap System > Gestures
3. Tap Swipe up on Home button
4. Tap the On/Off slider (Figure 2) until its in the Off position
### Battery Life
AI has become a crucial factor in Android. In fact, it is AI that has helped to greatly improve battery life in Android. This new feature is called Adaptive Battery and works by prioritizing battery power for the apps and services you use most. By using AI, Android learns how you use your Apps and, after a short period, can then shut down unused apps, so they arent draining your battery while waiting in memory.
The only caveat to Adaptive Battery is, should the AI pick up “bad habits” and your battery start to prematurely drain, the only way to reset the function is by way of a factory reset. Even with that small oversight, the improvement in battery life from Android Oreo to Pie is significant.
### Changes to Split Screen
Split Screen has been available to Android for some time. However, with Android Pie, how its used has slightly changed. This change only affects those who have gesture-based navigation enabled (otherwise, it remains the same). In order to work with Split Screen on Android 9.0, follow these steps:
![Adding an app][5]
Figure 3: Adding an app to split screen mode in Android Pie.
[Used with permission][3]
1. Swipe upward from the Home button to open the Recent apps overview.
2. Locate the app you want to place in the top portion of the screen.
3. Long press the apps circle icon (located at the top of the app card) to reveal a new popup menu (Figure 3)
4. Tap Split Screen and the app will open in the top half of the screen.
5. Locate the second app you want to open and, tap it to add it to the bottom half of the screen.
Using Split Screen and closing apps with the feature remains the same as it was.
###
![Actions][7]
Figure 4: Android App Actions in action.
[Used with permission][3]
### App Actions
This is another feature that was introduced some time ago, but was given some serious attention for the release of Android Pie. App Actions make it such that you can do certain things with an app, directly from the apps launcher.
For instance, if you long-press the GMail launcher, you can select to reply to a recent email, or compose a new email. Back in Android Oreo, that feature came in the form of a popup list of actions. With Android Pie, the feature now better fits with the Material Design scheme of things (Figure 4).
![Sound control][9]
Figure 5: Sound control in Android Pie.
[Used with permission][3]
### Sound Controls
Ah, the ever-changing world of sound controls on Android. Android Oreo had an outstanding method of controlling your sound, by way of minor tweaks to the Do Not Disturb feature. With Android Pie, that feature finds itself in a continued state of evolution.
What Android Pie nailed is the quick access buttons to controlling sound on a device. Now, if you press either the volume up or down button, youll see a new popup menu that allows you to control if your device is silenced and/or vibrations are muted. By tapping the top icon in that popup menu (Figure 5), you can cycle through silence, mute, or full sound.
### Screenshots
Because I write about Android, I tend to take a lot of screenshots. With Android Pie came one of my favorite improvements: sharing screenshots. Instead of having to open Google Photos, locate the screenshot to be shared, open the image, and share the image, Pie gives you a pop-up menu (after you take a screenshot) that allows you to share, edit, or delete the image in question.
![Sharing ][11]
Figure 6: Sharing screenshots just got a whole lot easier.
[Used with permission][3]
If you want to share the screenshot, take it, wait for the menu to pop up, tap Share (Figure 6), and then share it from the standard Android sharing menu.
### A More Satisfying Android Experience
The ninth iteration of Android has brought about a far more satisfying user experience. What Ive illustrated only scratches the surface of what Android Pie brings to the table. For more information, check out Googles official [Android Pie website][12]. And if your device has yet to receive the upgrade, have a bit of patience. Pie is well worth the wait.
--------------------------------------------------------------------------------
via: https://www.linux.com/learn/2018/10/overview-android-pie
作者:[Jack Wallen][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linux.com/users/jlwallen
[b]: https://github.com/lujun9972
[1]: /files/images/pie1png
[2]: https://www.linux.com/sites/lcom/files/styles/floated_images/public/pie_1.png?itok=BsSe8kqS (Android Pie)
[3]: /licenses/category/used-permission
[4]: /files/images/pie3png
[5]: https://www.linux.com/sites/lcom/files/styles/floated_images/public/pie_3.png?itok=F-NB1dqI (Adding an app)
[6]: /files/images/pie4png
[7]: https://www.linux.com/sites/lcom/files/styles/floated_images/public/pie_4.png?itok=Ex-NzYSo (Actions)
[8]: /files/images/pie5png
[9]: https://www.linux.com/sites/lcom/files/styles/floated_images/public/pie_5.png?itok=NMW2vIlL (Sound control)
[10]: /files/images/pie6png
[11]: https://www.linux.com/sites/lcom/files/styles/floated_images/public/pie_6.png?itok=7Ik8_4jC (Sharing )
[12]: https://www.android.com/versions/pie-9-0/

View File

@ -0,0 +1,84 @@
Ultimate Plumber Writing Linux Pipes With Instant Live Preview
======
![](https://www.ostechnix.com/wp-content/uploads/2018/10/Ultimate-Plumber-720x340.jpg)
As you may already know, **Pipe** command is used to send the output of one command/program/process to another command/program/process for further processing in Unix-like operating systems. Using the Pipe command, we can combine two or more commands and redirect the standard input or output of one command to another easily and quickly. A pipe is represented by a vertical bar character ( **|** ) between two or more Linux commands. The general syntax of a pipe command is given below.
```
Command-1 | Command-2 | Command-3 | …| Command-N
```
If you use Pipe command often, I have a good news for you. Now, you can preview the Linux pipes results instantly while writing them. Say hello to **“Ultimate Plumber”** , shortly **UP** , a command line tool for writing Linux pipes with instant live preview. It is used to build complex Pipelines quickly, easily with instant, scrollable preview of the command results. The UP tool is quite handy if you often need to repeat piped commands to get the desired result.
In this brief guide, I will show you how to install UP and build complex Linux pipelines easily.
**Important warning:**
Please be careful when using this tool in production! It could be dangerous and you might inadvertently delete any important data. You must particularly be careful when using “rm” or “dd” commands with UP tool. You have been warned!
### Writing Linux Pipes With Instant Live Preview Using Ultimate Plumber
Here is a simple example to understand the underlying concept of UP. For example, let us pipe the output of **lshw** command into UP. To do so, type the following command in your Terminal and press ENTER:
```
$ lshw |& up
```
You will see an input box at the top of the screen as shown in the below screenshot.
![](https://www.ostechnix.com/wp-content/uploads/2018/10/Ultimate-Plumber.png)
In the input box, start typing any pipelines and press ENTER key to execute the command you just typed. Now, the Ultimate Plumber utility will immediately show you the output of the pipeline in the **scrollable window** below. You can browse through the results using **PgUp/PgDn** or **Ctrl+ <left arrow)/Ctrl+<right arrow>** keys.
Once youre satisfied with the result, press **Ctrl-X** to exit the UP. The Linux pipe command you just built will be saved in a file named **up1.sh** in the current working directory. If this file is already exists, an additional file named **up2.sh** will be created to save the result. This will go on until 1000 files. If you dont want to save the output, just press **Ctrl-C**.
You can view the contents of the upX.sh file with cat command. Here is the output of my **up2.sh** file:
```
$ cat up2.sh
#!/bin/bash
grep network -A5 | grep : | cut -d: -f2- | paste - -
```
If the command you piped into UP is long running, you will see a **~** (tilde) character in the top-left corner of the window. It means that UP is still waiting for the inputs. In such cases, you may need to freeze the Ups input buffer size temporarily by pressing **Ctrl-S**. To unfreeze UP back, simply press **Ctrl-Q**. The current input buffer size of Ultimate Plumber is **40 MB**. Once you reached this limit, you will see a **+** (plus) sign on the top-left corner of the screen.
Here is the short demo of UP tool in action:
![](https://www.ostechnix.com/wp-content/uploads/2018/10/up.gif)
### Installing Ultimate Plumber
Liked it? Great! Go ahead and install it on your Linux system and start using it. Installing UP is quite easy! All you have to do is open your Terminal and run the following two commands to install UP.
Download the latest Ultimate Plumber binary file from the [**releases page**][1] and put it in your path, for example **/usr/local/bin/**.
```
$ sudo wget -O /usr/local/bin/up wget https://github.com/akavel/up/releases/download/v0.2.1/up
```
Then, make the UP binary as executable using command:
```
$ sudo chmod a+x /usr/local/bin/up
```
Done! Start building Linux pipelines as described above!!
And, thats all for now. Hope this was useful. More good stuffs to come. Stay tuned!
Cheers!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/ultimate-plumber-writing-linux-pipes-with-instant-live-preview/
作者:[SK][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972
[1]: https://github.com/akavel/up/releases

View File

@ -0,0 +1,75 @@
Translating by StdioA
Design faster web pages, part 3: Font and CSS tweaks
======
![](https://fedoramagazine.org/wp-content/uploads/2018/10/designfaster3-816x345.jpg)
Welcome back to this series of articles on designing faster web pages. [Part 1][1] and [part 2][2] of this series covered how to lose browser fat through optimizing and replacing images. This part looks at how to lose additional fat in CSS ([Cascading Style Sheets][3]) and fonts.
### Tweaking CSS
First things first: lets look at where the problem originates. CSS was once a huge step forward. You can use it to style several pages from a central style sheet. Nowadays, many web developers use frameworks like Bootstrap.
While these frameworks are certainly helpful, many people simply copy and paste the whole framework. Bootstrap is huge; the “minimal” version of 4.0 is currently 144.9 KB. Perhaps in the era of terabytes of data, this isnt much. But as they say, even small cattle makes a mess.
Look back at the [getfedora.org][4] example. Recall in [part 1][1], the first analysis showed the CSS files used nearly ten times more space than the HTML itself. Heres a display of the stylesheets used:
![][5]
Thats nine different stylesheets. Many styles in them that are also unused on the page.
#### Remove, merge, and compress/minify
The font-awesome CSS inhabits the extreme end of included, unused styles. There are only three glyphs of the font used on the page. To make that up in KB, the font-awesome CSS used at getfedora.org is originally 25.2 KB. After cleaning out all unused styles, its only 1.3 KB. This is only about 4% of its original size! For Bootstrap CSS, the difference is 118.3 KB original, and 13.2 KB after removing unused styles.
The next question is, must there be a bootstrap.css and a font-awesome.css? Or can they be combined? Yes, they can. That doesnt save much file space, but the browser now requests fewer files to succesfully render the page.
Finally, after merging the CSS files, try to remove unused styles and minify them. In this way, you save 10.1 KB for a final size of 4.3 KB.
Unfortunately, theres no packaged “minifier” tool in Fedoras repositories yet. However, there are hundreds of online services to do that for you. Or you can use [CSS-HTML-JS Minify][6], which is Python, and therefore easy to isntall. Theres not an available tool to purify CSS, but there are web services like [UnCSS][7].
### Font improvement
[CSS3][8] came with something a lot of web developer like. They could define fonts the browser downloads in the background to render the page. Since then, a lot of web designers are very happy, especially after they discovered the usage of icon fonts for web design. Font sets like [Font Awesome][9] are quiet popular today and widely used. Heres the size of that content:
```
current free version 912 glyphs/icons, smallest set ttf 30.9KB, woff 14.7KB, woff2 12.2KB, svg 107.2KB, eot 31.2
```
So the question is, do you need all the glyphs? In all probability, no. You can get rid of them with [FontForge][10], but thats a lot of work. You could also use [Fontello][11]. Use the public instance, or set up your own, as its free software and available on [Github][12].
The downside of such customized font sets is you must host the font by yourself. You cant use other online font services to provide updates. But this may not really be a downside, compared to faster performance.
### Conclusion
Now youve done everything you can to the content itself, to minimize what the browser loads and interprets. From now on, only tricks with the administration of the server can help.
One easy to do, but which many people do wrong, is decide on some intelligent caching. For instance, a CSS or picture file can be cached for a week. Whatever you do, if you use a proxy service like Cloudflare or build your own proxy, minimze the pages first. Users like fast loading pages. Theyll (silently) thank you for it, and the server will have a smaller load, too.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/design-faster-web-pages-part-3-font-css-tweaks/
作者:[Sirko Kemter][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/gnokii/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/design-faster-web-pages-part-1-image-compression/
[2]: https://fedoramagazine.org/design-faster-web-pages-part-2-image-replacement/
[3]: https://en.wikipedia.org/wiki/Cascading_Style_Sheets
[4]: https://getfedora.org
[5]: https://fedoramagazine.org/wp-content/uploads/2018/02/CSS_delivery_tool_-_Examine_how_a_page_uses_CSS_-_2018-02-24_15.00.46.png
[6]: https://github.com/juancarlospaco/css-html-js-minify
[7]: https://uncss-online.com/
[8]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS3
[9]: https://fontawesome.com/
[10]: https://fontforge.github.io/en-US/
[11]: http://fontello.com/
[12]: https://github.com/fontello/fontello

View File

@ -0,0 +1,162 @@
DF-SHOW A Terminal File Manager Based On An Old DOS Application
======
![](https://www.ostechnix.com/wp-content/uploads/2018/10/dfshow-720x340.png)
If you have worked on good-old MS-DOS, you might have used or heard about **DF-EDIT**. The DF-EDIT, stands for **D** irectory **F** ile **Edit** or, is an obscure DOS file manager, originally written by **Larry Kroeker** for MS-DOS and PC-DOS systems. It is used to display the contents of a given directory or file in MS-DOS and PC-DOS systems. Today, I stumbled upon a similar utility named **DF-SHOW** ( **D** irectory **F** ile **S** how), a terminal file manager for Unix-like operating systems. It is an Unix rewrite of obscure DF-EDIT file manager and is based on DF-EDIT 2.3d release from 1986. DF-SHOW is completely free, open source and released under GPLv3.
DF-SHOW can be able to,
* List contents of a directory,
* View files,
* Edit files using your default file editor,
* Copy files to/from different locations,
* Rename files,
* Delete files,
* Create new directories from within the DF-SHOW interface,
* Update file permissions, owners and groups,
* Search files matching a search term,
* Launch executable files.
### DF-SHOW Usage
DF-SHOW consists of two programs, namely **“show”** and **“sf”**.
**Show command**
The “show” program (similar to the `ls` command) is used to display the contents of a directory, create new directories, rename, delete files/folders, update permissions, search files and so on.
To view the list of contents in a directory, use the following command:
```
$ show <directory path>
```
Example:
```
$ show dfshow
```
Here, dfshow is a directory. If you invoke the “show” command without specifying a directory path, it will display the contents of current directory.
Here is how DF-SHOW default interface looks like.
![](https://www.ostechnix.com/wp-content/uploads/2018/10/dfshow-1.png)
As you can see, DF-SHOW interface is self-explanatory.
On the top bar, you see the list of available options such as Copy, Delete, Edit, Modify etc.
Complete list of available options are given below:
* **C** opy,
* **D** elete,
* **E** dit,
* **H** idden,
* **M** odify,
* **Q** uit,
* **R** ename,
* **S** how,
* h **U** nt,
* e **X** ec,
* **R** un command,
* **E** dit file,
* **H** elp,
* **M** ake dir,
* **Q** uit,
* **S** how dir
In each option, one letter has been capitalized and marked as bold. Just press the capitalized letter to perform the respective operation. For example, to rename a file, just press **R** and type the new name and hit ENTER to rename the selected item.
![](https://www.ostechnix.com/wp-content/uploads/2018/10/dfshow-2.png)
To display all options or cancel an operation, just press **ESC** key.
Also, you will see a bunch of function keys at the bottom of DF-SHOW interface to navigate through the contents of a directory.
* **UP/DOWN** arrows or **F1/F2** Move up and down (one line at time),
* **PgUp/Pg/Dn** Move one page at a time,
* **F3/F4** Instantly go to Top and bottom of the list,
* **F5** Refresh,
* **F6** Mark/Unmark files (Files marked will be indicated with an ***** in front of them),
* **F7/F8** Mark/Unmark all files at once,
* **F9** Sort the list by Date & time, Name, Size.,
Press **h** to learn more details about **show** command and its options.
To exit DF-SHOW, simply press **q**.
**SF Command**
The “sf” (show files) is used to display the contents of a file.
```
$ sf <file>
```
![](https://www.ostechnix.com/wp-content/uploads/2018/10/dfshow-3.png)
Press **h** to learn more “sf” command and its options. To quit, press **q**.
Want to give it a try? Great! Go ahead and install DF-SHOW on your Linux system as described below.
### Installing DF-SHOW
DF-SHOW is available in [**AUR**][1], so you can install it on any Arch-based system using AUR programs such as [**Yay**][2].
```
$ yay -S dfshow
```
On Ubuntu and its derivatives:
```
$ sudo add-apt-repository ppa:ian-hawdon/dfshow
$ sudo apt-get update
$ sudo apt-get install dfshow
```
On other Linux distributions, you can compile and build it from the source as shown below.
```
$ git clone https://github.com/roberthawdon/dfshow
$ cd dfshow
$ ./bootstrap
$ ./configure
$ make
$ sudo make install
```
The author of DF-SHOW project has only rewritten some of the applications of DF-EDIT utility. Since the source code is freely available on GitHub, you can add more features, improve the code and submit or fix the bugs (if there are any). It is still in alpha stage, but fully functional.
Have you tried it already? If so, howd go? Tell us your experience in the comments section below.
And, thats all for now. Hope this was useful.More good stuffs to come.
Stay tuned!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/df-show-a-terminal-file-manager-based-on-an-old-dos-application/
作者:[SK][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972
[1]: https://aur.archlinux.org/packages/dfshow/
[2]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/

View File

@ -0,0 +1,112 @@
Machine learning with Python: Essential hacks and tricks
======
Master machine learning, AI, and deep learning with Python.
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop.png?itok=pGfEfu2S)
It's never been easier to get started with machine learning. In addition to structured massive open online courses (MOOCs), there are a huge number of incredible, free resources available around the web. Here are a few that have helped me.
2. Learn to clearly differentiate between the buzzwords—for example, machine learning, artificial intelligence, deep learning, data science, computer vision, and robotics. Read or listen to talks by experts on each of them. Watch this [amazing video by Brandon Rohrer][1], an influential data scientist. Or this video about the [clear differences between various roles][2] associated with data science.
3. Clearly set a goal for what you want to learn. Then go and take [that Coursera course][3]. Or take the one [from the University of Washington][4], which is pretty good too.
5. If you are enthusiastic about taking online courses, check out this article for guidance on [choosing the right MOOC][5].
6. Most of all, develop a feel for it. Join some good social forums, but resist the temptation to latch onto sensationalized headlines and news. Do your own reading to understand what it is and what it is not, where it might go, and what possibilities it can open up. Then sit back and think about how you can apply machine learning or imbue data science principles into your daily work. Build a simple regression model to predict the cost of your next lunch or download your electricity usage data from your energy provider and do a simple time-series plot in Excel to discover some pattern of usage. And after you are thoroughly enamored with machine learning, you can watch this video.
<https://www.youtube.com/embed/IpGxLWOIZy4>
### Is Python a good language for machine learning/AI?
Familiarity and moderate expertise in at least one high-level programming language is useful for beginners in machine learning. Unless you are a Ph.D. researcher working on a purely theoretical proof of some complex algorithm, you are expected to mostly use the existing machine learning algorithms and apply them in solving novel problems. This requires you to put on a programming hat.
There's a lot of talk about the best language for data science. While the debate rages, grab a coffee and read this insightful FreeCodeCamp article to learn about [data science languages][6] . Or, check out this post on KDnuggets to dive directly into the [Python vs. R debate][7]
For now, it's widely believed that Python helps developers be more productive from development to deployment and maintenance. Python's syntax is simpler and at a higher level when compared to Java, C, and C++. It has a vibrant community, open source culture, hundreds of high-quality libraries focused on machine learning, and a huge support base from big names in the industry (e.g., Google, Dropbox, Airbnb, etc.).
### Fundamental Python libraries
Assuming you go with the widespread opinion that Python is the best language for machine learning, there are a few core Python packages and libraries you need to master.
#### NumPy
Short for [Numerical Python][8], NumPy is the fundamental package required for high-performance scientific computing and data analysis in the Python ecosystem. It's the foundation on which nearly all of the higher-level tools, such as [Pandas][9] and [scikit-learn][10], are built. [TensorFlow][11] uses NumPy arrays as the fundamental building blocks underpinning Tensor objects and graphflow for deep learning tasks. Many NumPy operations are implemented in C, making them super fast. For data science and modern machine learning tasks, this is an invaluable advantage.
![](https://opensource.com/sites/default/files/uploads/machine-learning-python_numpy-cheat-sheet.jpeg)
#### Pandas
Pandas is the most popular library in the scientific Python ecosystem for doing general-purpose data analysis. Pandas is built upon a NumPy array, thereby preserving fast execution speed and offering many data engineering features, including:
* Reading/writing many different data formats
* Selecting subsets of data
* Calculating across rows and down columns
* Finding and filling missing data
* Applying operations to independent groups within the data
* Reshaping data into different forms
* Combing multiple datasets together
* Advanced time-series functionality
* Visualization through Matplotlib and Seaborn
![](https://opensource.com/sites/default/files/uploads/pandas_cheat_sheet_github.png)
#### Matplotlib and Seaborn
Data visualization and storytelling with data are essential skills for every data scientist because it's crtitical to be able to communicate insights from analyses to any audience effectively. This is an equally critical part of your machine learning pipeline, as you often have to perform an exploratory analysis of a dataset before deciding to apply a particular machine learning algorithm.
[Matplotlib][12] is the most widely used 2D Python visualization library. It's equipped with a dazzling array of commands and interfaces for producing publication-quality graphics from your data. This amazingly detailed and rich article will help you [get started with Matplotlib][13].
![](https://opensource.com/sites/default/files/uploads/matplotlib_gallery_-1.png)
[Seaborn][14] is another great visualization library focused on statistical plotting. It provides an API (with flexible choices for plot style and color defaults) on top of Matplotlib, defines simple high-level functions for common statistical plot types, and integrates with functionality provided by Pandas. You can start with this great tutorial on [Seaborn for beginners][15].
![](https://opensource.com/sites/default/files/uploads/machine-learning-python_seaborn.png)
#### Scikit-learn
Scikit-learn is the most important general machine learning Python package to master. It features various [classification][16], [regression][17], and [clustering][18] algorithms, including [support vector machines][19], [random forests][20], [gradient boosting][21], [k-means][22], and [DBSCAN][23], and is designed to interoperate with the Python numerical and scientific libraries NumPy and [SciPy][24]. It provides a range of supervised and unsupervised learning algorithms via a consistent interface. The library has a level of robustness and support required for use in production systems. This means it has a deep focus on concerns such as ease of use, code quality, collaboration, documentation, and performance. Look at this [gentle introduction to machine learning vocabulary][25] used in the Scikit-learn universe or this article demonstrating [a simple machine learning pipeline][26] method using Scikit-learn.
This article was originally published on [Heartbeat][27] under [CC BY-SA 4.0][28].
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/10/machine-learning-python-essential-hacks-and-tricks
作者:[Tirthajyoti Sarkar][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/tirthajyoti
[b]: https://github.com/lujun9972
[1]: https://www.youtube.com/watch?v=tKa0zDDDaQk
[2]: https://www.youtube.com/watch?v=Ura_ioOcpQI
[3]: https://www.coursera.org/learn/machine-learning
[4]: https://www.coursera.org/specializations/machine-learning
[5]: https://towardsdatascience.com/how-to-choose-effective-moocs-for-machine-learning-and-data-science-8681700ed83f
[6]: https://medium.freecodecamp.org/which-languages-should-you-learn-for-data-science-e806ba55a81f
[7]: https://www.kdnuggets.com/2017/09/python-vs-r-data-science-machine-learning.html
[8]: http://numpy.org/
[9]: https://pandas.pydata.org/
[10]: http://scikit-learn.org/
[11]: https://www.tensorflow.org/
[12]: https://matplotlib.org/
[13]: https://realpython.com/python-matplotlib-guide/
[14]: https://seaborn.pydata.org/
[15]: https://www.datacamp.com/community/tutorials/seaborn-python-tutorial
[16]: https://en.wikipedia.org/wiki/Statistical_classification
[17]: https://en.wikipedia.org/wiki/Regression_analysis
[18]: https://en.wikipedia.org/wiki/Cluster_analysis
[19]: https://en.wikipedia.org/wiki/Support_vector_machine
[20]: https://en.wikipedia.org/wiki/Random_forests
[21]: https://en.wikipedia.org/wiki/Gradient_boosting
[22]: https://en.wikipedia.org/wiki/K-means_clustering
[23]: https://en.wikipedia.org/wiki/DBSCAN
[24]: https://en.wikipedia.org/wiki/SciPy
[25]: http://scikit-learn.org/stable/tutorial/basic/tutorial.html
[26]: https://towardsdatascience.com/machine-learning-with-python-easy-and-robust-method-to-fit-nonlinear-data-19e8a1ddbd49
[27]: https://heartbeat.fritz.ai/some-essential-hacks-and-tricks-for-machine-learning-with-python-5478bc6593f2
[28]: https://creativecommons.org/licenses/by-sa/4.0/

View File

@ -1,251 +0,0 @@
2017 年必备的 24 个 Linux 应用程序
======
前情提要Linux 上必备的应用程序是什么呢?这个答案具有主观性并取决于你使用 Linux 桌面的目的是什么。但确实存在一些必备的并且大部分 Linux 用户都会安装的应用程序。接下来我们会列举出那些在所有 Linux 发行版上你都会安装的最优秀的 Linux 应用程序。
在 Linux 的世界中,所有东西都由你选择。听说你要选择一个发行版?你能找到一大把。你想要找到一个称心的音乐播放器?同样会有许多选择。
但他们并非全部遵循相同的设计哲学——其中一些可能追求极致轻量化而另一些会提供数不清的特性。因此想要找到正中需求的应用程序会成为相当令人头疼的繁重任务。那就让我们来缓解你的头疼吧。
### 对于 Linux 用户来说最优秀的自由软件
接下来我将罗列一系列在不同应用场景下我偏爱的必备 Linux 自由软件。当然此处我并非在说它们是最好的,但确实是在特定类别下我尝试的一系列软件中最喜欢的。也同样欢迎你在评论区介绍你最喜欢的应用程序。
同时我们也制作了关于此次应用清单的视频。在油管译者注YouTube上订阅我们的频道获取更多的 Linux 视频。
### 网页浏览器
![网页浏览器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Web-Browser-1024x512.jpg)
[Save][1]网页浏览器
#### [Google Chrome][12]
Google Chrome 是一个强大并且功能完善的浏览器解决方案,它拥有完美的同步功能以及丰富的扩展。如果你喜欢 Google 的生态系统那么 Google Chrome 毫无疑问会是你的菜。如果你想要更加开源的解决方案,你可以尝试 [Chromium][13],它是 Google Chrome 的上游项目。
#### [Firefox][14]
如果你不是 Google Chrome 的粉丝,你可以尝试 Firefox。它一直以来都是一个非常稳定并且健壮的网页浏览器。
#### [Vivaldi][15]
当然,如果你想要尝试点不同的新东西,你可以尝试 Vivaldi。Vivaldi 是一个完全重新设计的网页浏览器,它由 Opera 浏览器项目的前成员基于 Chromium 项目创建。Vivaldi 轻量并且可定制,虽然它还非常年轻并且在某些特性上仍不完善,但它仍能让你眼前一亮并且优雅地工作。
[推荐阅读[回顾] Otter 浏览器为 Opera 爱好者带来了希望][40]
### 下载管理器
![下载管理器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Download-Manager-1024x512.jpg)
[Save][2]下载管理器
#### [uGet][16]
uGet 是我遇到过最棒的下载管理器它是开源的并且能满足所有你对于一款下载管理器的期许。uGet 提供一系列高级设置便于管理下载。你能够管理下载队列并且断点续传,针对大文件使用多连接下载,根据不同列表将文件下载至不同路径,等等。
#### [XDM][17]
Xtreme 下载管理器XDM是一个 Java 开发的强大并且开源的下载工具。它拥有下载管理器的所有基本特性,包括视频抓取、智能计划任务以及浏览器集成。
[推荐阅读 Linux 下最好的 4 个下载管理器][41]
### BitTorrent 客户端
![BitTorrent 客户端](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-BitTorrent-Client-1024x512.jpg)
[Save][3]BitTorrent 客户端
#### [Deluge][18]
Deluge 是一个拥有漂亮用户界面的开源 BitTorrent 客户端。如果你习惯在 Windows 上使用 uTorrent那么 Deluge 的界面会让你倍感亲切。它拥有丰富的设置项和针对不同任务的插件支持。
#### [Transmission][19]
Transmission 力求精简,它是用户界面最精简的 BitTorrent 客户端之一。Transmission 是许多 Linux 发行版的预装软件。
[推荐阅读 Ubuntu Linux 上前 5 名的 Torrent 客户端][42]
### 云存储
![云存储](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Cloud-Storage-1024x512.jpg)
[Save][4]云存储
#### [Dropbox][20]
Dropbox 是目前最流行的云存储服务之一,它为新用户提供了 2GB 的免费存储空间,以及一个健壮并且易于使用的 Linux 客户端。
#### [MEGA][21]
MEGA 提供了 50GB 的免费存储但这还并不是它最大的优点MEGA 还为你的文件提供了端到端的加密支持。MEGA 提供一个名为 MEGAsync 的 Linux 客户端。
[推荐阅读 2017 年 Linux 上最优秀的免费云服务][43]
### 通讯工具
![通讯工具](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Communication-1024x512.jpg)
[Save][5]通讯工具
#### [Pidgin][22]
Pidgin 是一款开源的即时通讯工具,它支持许多聊天平台,包括 Google Talk、Yahoo 甚至 IRC。Pidgin 可通过第三方插件进行扩展,能提供许多附加功能。
你也可以使用 [Franz][23] 或 [Rambox][24] 来在一个应用中使用多个通讯服务。
#### [Skype][25]
我们都知道 Skype 是最流行的视频聊天平台之一,最近它[发布了全新的 Linux 桌面客户端][26]。
[推荐阅读 2017 年 Linux 平台上最优秀的 6 款消息应用][44]
### 办公套件
![办公套件](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Office-Suite-1024x512.jpg)
[Save][6]办公套件
#### [LibreOffice][27]
LibreOffice 是 Linux 平台上开发最为活跃的开源办公套件,主要包括 Writer、Calc、Impress、Draw、Math、Base 六个主要模块,并且每个模块都提供广泛的文件格式支持。同时 LibreOffice 也支持第三方的扩展,以上优势使它成为许多 Linux 发行版的默认办公套件。
#### [WPS Office][28]
如果你想要尝试除 LibreOffice 以外的办公套件WPS Office 值得一试。WPS Office 套件包括了写作、演示和数据表格支持。
[推荐阅读 Linux 平台 6 款最优秀的 Microsoft Office 替代品][45]
### 音乐播放器
![音乐播放器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Music-Player-1024x512.jpg)
[Save][7]音乐播放器
#### [Lollypop][29]
Lollypop 是一款相对较新的开源音乐播放器,拥有漂亮又不失简洁的用户界面。它提供优秀的音乐管理、歌曲推荐、在线广播和派对模式支持。虽然它是一款不具有太多特性的简洁音乐播放器,但仍值得我们去尝试。
#### [Rhythmbox][30]
Rhythmbox 是一款主要为 GNOME 桌面环境开发的音乐播放器,当然它也可以在其他桌面环境运行。它能完成所有作为一款音乐播放器的基础功能,包括 CD 抓取和烧制、乱序播放,等等。它也提供了 iPod 支持。
#### [cmus][31]
如果你想要最轻量并且喜欢命令行的话cmus 适合你。个人来讲我是它的粉丝用户。cmus 是一款类 Unix 平台上,小巧、快速并且强大的命令音乐播放器。它包含所有基础的音乐播放器特性,并且你能够通过扩展和脚本来增强它的功能。
[推荐阅读 如何在 Ubuntu 14.04 和 Linux Mint 17 上安装 Tomahawk 播放器][46]
### 视频播放器
![视频播放器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Video-Player-1024x512.jpg)
[Save][8]视频播放器
#### [VLC][32]
VLC 是一款简洁、快速、轻量并且非常强大的开源媒体播放器,它能够直接播放几乎所有格式的媒体文件,同时也能够播放在线的流媒体。它也能够安装一些时髦的扩展来完成不同的任务,比如直接在播放器内下载字幕。
#### [Kodi][33]
Kodi 是一款成熟并且开源的媒体中心在它的用户群中非常受欢迎。它能够处理来自本地或者网络媒体存储的视频、音乐、图片、播客甚至游戏更强大的是你还能用它来录制电视节目。Kodi 可由附加组件和皮肤进行定制。
[推荐阅读 Linux 平台上的 4 款格式工厂替代品][47]
### 照片编辑器
![照片编辑器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Photo-Editor-1024x512.jpg)
[Save][9]照片编辑器
#### [GIMP][34]
GIMP 是 Linux 平台上 Photoshop 的替代品,它是一款开源、全功能并且专业的照片编辑软件。它打包了各式各样的工具用来编辑图片,更强大的是,它包含丰富的自定义设置以及第三方插件来增强体验。
#### [Krita][35]
Krita 主要是作为一款绘图工具,但也可以作为照片编辑软件。它是开源的并且打包了非常多复杂的高级工具。
[推荐阅读 Linux 平台最好的照片应用][48]
### 文字编辑器
每个 Linux 发行版都拥有自己的文字编缉器解决方案,当然大体上它们都非常简洁并且没有太多功能。但是也有一些文字编辑器具有更强大的功能。
![文字编辑器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Text-Editor-1024x512.jpg)
[Save][10]文字编辑器
#### [Atom][36]
Atom 是由 GitHub 开发的一款现代高度可配置的文字编辑器,它是完全开源的并且能够提供所有你能想到的文字编辑器功能。你可以开箱即用,也可以将其配置成你想要的样子。并且你可以从它的社区安装大量的扩展和主题。
#### [Sublime Text][37]
Sublime Text 是最受欢迎的文字编辑器之一虽然它并不是免费的但你可以无限地试用该款软件。Sublime Text 是一款特性丰富并且高度模块化的软件,当然它也提供插件和主题支持。
[推荐阅读 Linux 平台最优秀的 4 款现代开源代码编辑器][49]
### 启动器
![启动器](https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Launcher-1024x512.jpg)
[Save][11]启动器
#### [Albert][38]
Albert 是一款快速、可扩展、可定制的生产力工具,受 AlfredMac 平台上一个非常好的生产力工具)启发并且仍处于开发阶段,它的目标是“使所有触手可及”。它能够与你的 Linux 发行版非常好的集成,帮助你提高生产力。
#### [Synapse][39]
Synapse 已经有些年头了,它是一个能够搜索和运行程序的简单启动器。它也同时能够加速一些工作流,譬如音乐控制、文件搜索、路径切换、书签、运行命令,等等。
正如 Abhishek 所考虑的,我们将根据读者的(也就是你的)反馈更新最佳 Linux 应用程序清单。那么,你最爱的 Linux 应用程序是什么呢?分享给我们或者为这个清单增加新的软件分类吧。
---
via: https://itsfoss.com/essential-linux-applications/
作者:[Munif Tanjim][a]
译者:[cycoe](https://github.com/cycoe)
校对:[校对者 ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux 中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/munif/
[1]: http://pinterest.com/pin/create/bookmarklet/?media=https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Web-Browser-1024x512.jpg&url=https://itsfoss.com/essential-linux-applications/&is_video=false&description=Web%20Browsers
[2]: http://pinterest.com/pin/create/bookmarklet/?media=https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Download-Manager-1024x512.jpg&url=https://itsfoss.com/essential-linux-applications/&is_video=false&description=Download%20Managers
[3]: http://pinterest.com/pin/create/bookmarklet/?media=https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-BitTorrent-Client-1024x512.jpg&url=https://itsfoss.com/essential-linux-applications/&is_video=false&description=BitTorrent%20Clients
[4]: http://pinterest.com/pin/create/bookmarklet/?media=https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Cloud-Storage-1024x512.jpg&url=https://itsfoss.com/essential-linux-applications/&is_video=false&description=Cloud%20Storages
[5]: http://pinterest.com/pin/create/bookmarklet/?media=https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Communication-1024x512.jpg&url=https://itsfoss.com/essential-linux-applications/&is_video=false&description=Communication%20Apps
[6]: http://pinterest.com/pin/create/bookmarklet/?media=https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Office-Suite-1024x512.jpg&url=https://itsfoss.com/essential-linux-applications/&is_video=false&description=Office%20Suites
[7]: http://pinterest.com/pin/create/bookmarklet/?media=https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Music-Player-1024x512.jpg&url=https://itsfoss.com/essential-linux-applications/&is_video=false&description=Music%20Players
[8]: http://pinterest.com/pin/create/bookmarklet/?media=https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Video-Player-1024x512.jpg&url=https://itsfoss.com/essential-linux-applications/&is_video=false&description=Video%20Player
[9]: http://pinterest.com/pin/create/bookmarklet/?media=https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Photo-Editor-1024x512.jpg&url=https://itsfoss.com/essential-linux-applications/&is_video=false&description=Photo%20Editors
[10]: http://pinterest.com/pin/create/bookmarklet/?media=https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Text-Editor-1024x512.jpg&url=https://itsfoss.com/essential-linux-applications/&is_video=false&description=Text%20Editors
[11]: http://pinterest.com/pin/create/bookmarklet/?media=https://itsfoss.com/wp-content/uploads/2016/10/Essential-Linux-Apps-Launcher-1024x512.jpg&url=https://itsfoss.com/essential-linux-applications/&is_video=false&description=Launchers
[12]: https://www.google.com/chrome/browser
[13]: https://www.chromium.org/Home
[14]: https://www.mozilla.org/en-US/firefox
[15]: https://vivaldi.com
[16]: http://ugetdm.com/
[17]: http://xdman.sourceforge.net/
[18]: http://deluge-torrent.org/
[19]: https://transmissionbt.com/
[20]: https://www.dropbox.com
[21]: https://mega.nz/
[22]: https://www.pidgin.im/
[23]: https://itsfoss.com/franz-messaging-app/
[24]: http://rambox.pro/
[25]: https://www.skype.com
[26]: https://itsfoss.com/skpe-alpha-linux/
[27]: https://www.libreoffice.org
[28]: https://www.wps.com
[29]: http://gnumdk.github.io/lollypop-web/
[30]: https://wiki.gnome.org/Apps/Rhythmbox
[31]: https://cmus.github.io/
[32]: http://www.videolan.org
[33]: https://kodi.tv
[34]: https://www.gimp.org/
[35]: https://krita.org/en/
[36]: https://atom.io/
[37]: http://www.sublimetext.com/
[38]: https://github.com/ManuelSchneid3r/albert
[39]: https://launchpad.net/synapse-project
[40]: https://itsfoss.com/otter-browser-review/
[41]: https://itsfoss.com/4-best-download-managers-for-linux/
[42]: https://itsfoss.com/best-torrent-ubuntu/
[43]: https://itsfoss.com/cloud-services-linux/
[44]: https://itsfoss.com/best-messaging-apps-linux/
[45]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/
[46]: https://itsfoss.com/install-tomahawk-ubuntu-1404-linux-mint-17/
[47]: https://itsfoss.com/format-factory-alternative-linux/
[48]: https://itsfoss.com/image-applications-ubuntu-linux/
[49]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/

View File

@ -0,0 +1,68 @@
什么是 SRE它和 DevOps 是怎么关联的?
=====
大型企业里 SRE 角色比较常见,不过小公司也需要 SRE。
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/toolbox-learn-draw-container-yearbook.png?itok=xDbwz1pP)
虽然站点可靠性工程师SRE角色在近几年变得流行起来但是很多人 —— 甚至是软件行业里的 —— 还不知道 SRE 是什么或者 SRE 都干些什么。为了搞清楚这些问题,这篇文章解释了 SRE 的含义,还有 SRE 怎样关联 DevOps以及在工程师团队规模不大的组织里 SRE 该如何工作。
### 什么是站点可靠性工程?
谷歌的几个工程师写的《 [SRE谷歌运维解密][1]》被认为是站点可靠性工程的权威书籍。谷歌的工程副总裁 Ben Treynor Sloss 在二十一世纪初[创造了这个术语][2]。他是这样定义的“当你让软件工程师设计运维功能时SRE 就产生了。”
虽然系统管理员从很久之前就在写代码,但是过去的很多时候系统管理团队是手动管理机器的。当时他们管理的机器可能有几十台或者上百台,不过当这个数字涨到了几千甚至几十万的时候,就不能简单的靠人去解决问题了。规模如此大的情况下,很明显应该用代码去管理机器(以及机器上运行的软件)。
另外一直到近几年运维团队和开发团队都还是完全独立的。两个岗位的技能要求也被认为是完全不同的。SRE 的角色想尝试把这两份工作结合起来。
在深入探讨什么是 SRE 以及 SRE 如何和开发团队协作之前,我们需要先了解一下 SRE 在 DevOps 范例中是怎么工作的。
### SRE 和 DevOps
站点可靠性工程的核心,就是对 DevOps 范例的实践。[DevOps 的定义][3]有很多种方式。开发团队“devs”和运维“ops”团队相互分离的传统模式下写代码的团队在服务交付给用户使用之后就不再对服务状态负责了。开发团队“把代码扔到墙那边”让运维团队去部署和支持。
这种情况会导致大量失衡。开发和运维的目标总是不一致 —— 开发希望用户体验到“最新最棒”的代码,但是运维想要的是变更尽量少的稳定系统。运维是这样假定的,任何变更都可能引发不稳定,而不做任何变更的系统可以一直保持稳定。(减少软件的变更次数并不是避免故障的唯一因素,认识到这一点很重要。例如,虽然你的 web 应用保持不变,但是当用户数量涨到十倍时,服务可能就会以各种方式出问题。)
DevOps 理念认为通过合并这两个岗位就能够消灭争论。如果开发团队时刻都想把新代码部署上线,那么他们也必须对新代码引起的故障负责。就像亚马逊的 [Werner Vogels 说的][4]那样,“谁开发,谁运维”(生产环境)。但是开发人员已经有一大堆问题了。他们不断的被推动着去开发老板要的产品功能。再让他们去了解基础设施,包括如何部署、配置还有监控服务,这对他们的要求有点太多了。所以就需要 SRE 了。
开发一个 web 应用的时候经常是很多人一起参与。有用户界面设计师,图形设计师,前端工程师,后端工程师,还有许多其他工种(视技术选型的具体情况而定)。如何管理写好的代码也是需求之一(例如部署,配置,监控)—— 这是 SRE 的专业领域。但是就像前端工程师受益于后端领域的知识一样例如从数据库获取数据的方法SRE 理解部署系统的工作原理,知道如何满足特定的代码或者项目的具体需求。
所以 SRE 不仅仅是“写代码的运维工程师”。相反SRE 是开发团队的成员他们有着不同的技能特别是在发布部署、配置管理、监控、指标等方面。但是就像前端工程师必须知道如何从数据库中获取数据一样SRE 也不是只负责这些领域。为了提供更容易升级、管理和监控的产品,整个团队共同努力。
当一个团队在做 DevOps 实践,但是他们意识到对开发的要求太多了,过去由运维团队做的事情,现在需要一个专家来专门处理。这个时候,对 SRE 的需求很自然地就出现了。
### SRE 在初创公司怎么工作
如果你们公司有好几百位员工,那是非常好的(如果到了 Google 和 Facebook 的规模就更不用说了)。大公司的 SRE 团队分散在各个开发团队里。但是一个初创公司没有这种规模经济,工程师经常身兼数职。那么小公司该让谁做 SRE 呢?其中一种方案是完全践行 DevOps那些大公司里属于 SRE 的典型任务,在小公司就让开发者去负责。另一种方案,则是聘请专家 —— 也就是 SRE。
让开发人员做 SRE 最显著的优点是,团队规模变大的时候也能很好的扩展。而且,开发人员将会全面地了解应用的特性。但是,许多初创公司的基础设施包含了各种各样的 SaaS 产品,这种多样性在基础设施上体现的最明显,因为连基础设施本身也是多种多样。然后你们在某个基础设施上引入指标系统、站点监控、日志分析、容器等等。这些技术解决了一部分问题,也增加了复杂度。开发人员除了要了解应用程序的核心技术(比如开发语言),还要了解上述所有技术和服务。最终,掌握所有的这些技术让人无法承受。
另一种方案是聘请专家专职做 SRE。他们专注于发布部署、配置管理、监控和指标可以节省开发人员的时间。这种方案的缺点是SRE 的时间必须分配给多个不同的应用(就是说 SRE 需要贯穿整个工程部门)。 这可能意味着 SRE 没时间对任何应用深入学习,然而他们可以站在一个能看到服务全貌的高度,知道各个部分是怎么组合在一起的。 这个“ 三万英尺高的视角”可以帮助 SRE 从系统整体上考虑,哪些薄弱环节需要优先修复。
有一个关键信息我还没提到:其他的工程师。他们可能很渴望了解发布部署的原理,也很想尽全力学会使用指标系统。而且,雇一个 SRE 可不是一件简单的事儿。因为你要找的是一个既懂系统管理又懂软件工程的人。(我之所以明确地说软件工程而不是说“能写代码”,是因为除了写代码之外软件工程还包括很多东西,比如编写良好的测试或文档。)
因此,在某些情况下让开发人员做 SRE 可能更合理一些。如果这样做了,得同时关注代码和基础设施(购买 SaaS 或内部自建)的复杂程度。这两边的复杂性,有时候能促进专业化。
### 总结
在初创公司做 DevOps 实践最有效的方式是组建 SRE 小组。我见过一些不同的方案,但是我相信初创公司(尽早)招聘专职 SRE 可以解放开发人员让开发人员专注于特定的挑战。SRE 可以把精力放在改善工具流程以提高开发人员的生产力。不仅如此SRE 还专注于确保交付给客户的产品是可靠且安全的。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/10/sre-startup
作者:[Craig Sebenik][a]
选题:[lujun9972][b]
译者:[BeliteX](https://github.com/belitex)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/craig5
[b]: https://github.com/lujun9972
[1]: http://shop.oreilly.com/product/0636920041528.do
[2]: https://landing.google.com/sre/interview/ben-treynor.html
[3]: https://opensource.com/resources/devops
[4]: https://queue.acm.org/detail.cfm?id=1142065
[5]: https://www.usenix.org/conference/lisa18/presentation/sebenik
[6]: https://www.usenix.org/conference/lisa18

View File

@ -0,0 +1,68 @@
模拟 Altair
======
[Altair 8800][1] 是 1975 年发布的自建家用电脑套件。Altair 基本上是第一台个人电脑,虽然这个名词好几年前就出现了。对 Dell、HP 或者 Macbook 而言它是亚当(或者夏娃)。
有些人认为为 Z80与 Altair 的 Intel 8080 密切相关的处理器)编写仿真器真是太棒了,并认为它需要模拟 Altair 的控制面板。所以如果你想知道 1975 年使用电脑是什么感觉,你可以在你的 Macbook 上运行 Altair
![Altair 8800][2]
### 安装它
你可以从[这里][3]的 FTP 服务器下载 Z80 包。你要查找最新的 Z80 包版本,例如 `z80pack-1.26.tgz`
首先解压文件:
```
$ tar -xvf z80pack-1.26.tgz
```
进入解压目录:
```
$ cd z80pack-1.26
```
控制面板模拟基于名为 `frontpanel` 的库。你必须先编译该库。如果你进入 `frontpanel` 目录,你会发现 `README` 文件列出了库自己的依赖项。你在这里的体会几乎肯定会与我的不同,但也许我的痛苦可以作为例子。我安装了依赖项,但是是通过 [Homebrew][4] 安装的。为了让库能够编译,我必须确保在 `Makefile.osx` 中将 `/usr/local/include `添加到 Clang 的 include 路径中。
如果你觉得依赖没有问题,那么你应该就能编译库(我们现在位于 `z80pack-1.26/frontpanel`
```
$ make -f Makefile.osx ...
$ make -f Makefile.osx clean
```
你应该会得到 `libfrontpanel.so`。我把它拷贝到 `libfrontpanel.so`
Altair 模拟器位于 `z80pack-1.26/altairsim` 下。你现在需要编译模拟器本身。进入 `z80pack-1.26/altairsim/srcsim` 并再次运行 `make`
```
$ make -f Makefile.osx ...
$ make -f Makefile.osx clean
```
该过程将在 `z80pack-1.26/altairsim` 中创建一个名为 `altairsim` 的可执行文件。运行该可执行文件,你应该会看到标志性的 Altair 控制面板!
如果你想要探究,请阅读原始的[Altair 手册][5]
如果你喜欢这篇文章,我们每两周更新一次!在 Twitter 上关注 [@TwoBitHistory][6] 或订阅 [RSS 源][7]了解什么时候有新文章。
--------------------------------------------------------------------------------
via: https://twobithistory.org/2017/12/02/simulating-the-altair.html
作者:[Two-Bit History][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://twobithistory.org
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Altair_8800
[2]: https://www.autometer.de/unix4fun/z80pack/altair.png
[3]: http://www.autometer.de/unix4fun/z80pack/ftp/
[4]: http://brew.sh/
[5]: http://www.classiccmp.org/dunfield/altair/d/88opman.pdf
[6]: https://twitter.com/TwoBitHistory
[7]: https://twobithistory.org/feed.xml

View File

@ -1,143 +0,0 @@
如何移除或禁用 Ubuntu Dock
======
![](https://1.bp.blogspot.com/-pClnjEJfPQc/W21nHNzU2DI/AAAAAAAABV0/HGXuQOYGzokyrGYQtRFeF_hT3_3BKHupQCLcBGAs/s640/ubuntu-dock.png)
**如果你想用其它 dock例如 Plank dock或面板来替换 Ubuntu 18.04 中的 Dock或者你想要移除或禁用 Ubuntu Dock本文会告诉你如何做。**
Ubuntu Dock - 屏幕左侧栏,可用于固定应用程序或访问已安装的应用程序。使用默认的 Ubuntu 会话时,[无法][1]使用 Gnome Tweaks 禁用它。如果你需要,还是有几种方法来摆脱它的。下面我将列出 4 种方法可以移除或禁用 Ubuntu Dock以及每个方法的缺点如果有的话还有如何撤销每个方法的更改。本文还包括在没有 Ubuntu Dock 的情况下访问多任务视图和已安装应用程序列表的其它方法。
to 校正Activities Overview 在本文翻译为多任务视图,如有不妥,请改正)
### 如何在没有 Ubuntu Dock 的情况下访问多任务试图
如果没有 Ubuntu Dock你可能无法访问活动的或已安装的应用程序列表但是可以通过单击 Dock 底部的“显示应用程序”按钮从 Ubuntu Dock 访问)。例如,如果你想使用 Plank Dock。to 校正:这里是什么意思呢)
显然,如果你安装了 Dash to Panel 扩展来使用它而不是 Ubuntu Dock那么情况并非如此。因为 Dash to Panel 提供了一个按钮来访问多任务视图或已安装的应用程序。
根据你计划使用的 Dock 而不是 Ubuntu Dock如果无法访问多任务视图那么你可以启用 Activities Overview Hot Corner 选项,只需将鼠标移动到屏幕的左上角即可打开 Activities。访问已安装的应用程序列表的另一种方法是使用快捷键`Super + A`。
如果要启用 Activities Overview hot corner使用以下命令
```
gsettings set org.gnome.shell enable-hot-corners true
```
如果以后要撤销此操作并禁用 hot corners那么你需要使用以下命令
```
gsettings set org.gnome.shell enable-hot-corners false
```
你可以使用 Gnome Tweaks 应用程序(该选项位于 Gnome Tweaks 的 `Top Bar` 部分)启用或禁用 Activities Overview Hot Corner 选项,可以使用以下命令进行安装:
```
sudo apt install gnome-tweaks
```
### 如何移除或禁用 Ubuntu Dock
下面你将找到 4 种摆脱 Ubuntu Dock 的方法,环境在 Ubuntu 18.04 下。
**方法 1: 移除 Gnome Shell Ubuntu Dock 包。**
摆脱 Ubuntu Dock 的最简单方法就是删除包。
这将会从你的系统中完全移除 Ubuntu Dock 扩展,但同时也移除了 `ubuntu-desktop` 元数据包。如果你移除 `ubuntu-desktop` 元数据包,不会马上出现问题,因为它本身没有任何作用。`ubuntu-meta` 包依赖于组成 Ubuntu 桌面的大量包。它的依赖关系不会被删除,也不会被破坏。问题是如果你以后想升级到新的 Ubuntu 版本,那么将不会安装任何新的 `ubuntu-desktop` 依赖项。
为了解决这个问题,你可以在升级到较新的 Ubuntu 版本之前安装 `ubuntu-desktop` 元包(例如,如果你想从 Ubuntu 18.04 升级到 18.10)。
如果你对此没有意见,并且想要从系统中删除 Ubuntu Dock 扩展包,使用以下命令:
```
sudo apt remove gnome-shell-extension-ubuntu-dock
```
如果以后要撤消更改,只需使用以下命令安装扩展:
```
sudo apt install gnome-shell-extension-ubuntu-dock
```
或者重新安装 `ubuntu-desktop` 元数据包(这将会安装你可能已删除的任何 ubuntu-desktop 依赖项,包括 Ubuntu Dock你可以使用以下命令
```
sudo apt install ubuntu-desktop
```
**选项2安装并使用 vanilla Gnome 会话而不是默认的 Ubuntu 会话。**
摆脱 Ubuntu Dock 的另一种方法是安装和使用 vanilla Gnome 会话。安装 vanilla Gnome 会话还将安装此会话所依赖的其它软件包,如 Gnome 文档,地图,音乐,联系人,照片,跟踪器等。
通过安装 vanilla Gnome 会话,你还将获得默认 Gnome GDM 登录和锁定屏幕主题,而不是 Ubuntu 默认值,另外还有 Adwaita Gtk 主题和图标。你可以使用 Gnome Tweaks 应用程序轻松更改 Gtk 和图标主题。
此外,默认情况下将禁用 AppIndicators 扩展(因此使用 AppIndicators 托盘的应用程序不会显示在顶部面板上),但你可以使用 Gnome Tweaks 启用此功能(在扩展中,启用 Ubuntu appindicators 扩展)。
同样,你也可以从 vanilla Gnome 会话启用或禁用 Ubuntu Dock这在 Ubuntu 会话中是不可能的(使用 Ubuntu 会话时无法从 Gnome Tweaks 禁用 Ubuntu Dock
如果你不想安装 vanilla Gnome 会话所需的这些额外软件包,那么这个移除 Ubuntu Dock 的这个选项不适合你,请查看其它选项。
如果你对此没有意见,以下是你需要做的事情。要在 Ubuntu 中安装普通的 Gnome 会话,使用以下命令:
```
sudo apt install vanilla-gnome-desktop
```
安装完成后,重启系统。在登录屏幕上,单击用户名,单击 `Sign in` 按钮旁边的齿轮图标,然后选择 `GNOME` 而不是 `Ubuntu`,之后继续登录。
![](https://4.bp.blogspot.com/-mc-6H2MZ0VY/W21i_PIJ3pI/AAAAAAAABVo/96UvmRM1QJsbS2so1K8teMhsu7SdYh9zwCLcBGAs/s640/vanilla-gnome-session-ubuntu-login-screen.png)
如果要撤销此操作并移除 vanilla Gnome 会话,可以使用以下命令清除 vanilla Gnome 软件包,然后删除它安装的依赖项(第二条命令):
```
sudo apt purge vanilla-gnome-desktop
sudo apt autoremove
```
然后重新启动,并以相同的方式从 GDM 登录屏幕中选择 Ubuntu。
**选项 3从桌面上永久隐藏 Ubuntu Dock而不是将其移除。**
如果你希望永久隐藏 Ubuntu Dock不让它显示在桌面上但不移除它或使用 vanilla Gnome 会话,你可以使用 Dconf 编辑器轻松完成此操作。这样做的缺点是 Ubuntu Dock 仍然会使用一些系统资源,即使你没有在桌面上使用它,但你也可以轻松恢复它而无需安装或移除任何包。
Ubuntu Dock 只对你的桌面隐藏当你进入叠加模式Activities你仍然可以看到并从那里使用 Ubuntu Dock。
要永久隐藏 Ubuntu Dock使用 Dconf 编辑器导航到 `/org/gnome/shell/extensions/dash-to-dock` 并禁用以下选项(将它们设置为 false`autohide`, `dock-fixed``intellihide`
如果你愿意,可以从命令行实现此目的,运行以下命令:
```
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
```
如果你改变主意了并想撤销此操作,你可以使用 Dconf 编辑器从 `/org/gnome/shell/extensions/dash-to-dock` 中启动 `autohide`, `dock-fixed``intellihide`(将它们设置为 true或者你可以使用以下这些命令
```
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
```
**选项 4使用 Dash to Panel 扩展。**
[Dash to Panel][2] 是 Gnome Shell 的一个高度可配置面板,是 Ubuntu Dock 或 Dash to Dock 的一个很好的替代品Ubuntu Dock 是从 Dash to Dock 克隆而来的)。安装和启动 Dash to Panel 扩展会禁用 Ubuntu Dock因此你无需执行其它任何操作。
你可以从 [extensions.gnome.org][3] 来安装 Dash to Panel。
如果你改变主意并希望重新使用 Ubuntu Dock那么你可以使用 Gnome Tweaks 应用程序禁用 Dash to Panel或者通过单击以下网址旁边的 X 按钮完全移除 Dash to Panel: https://extensions.gnome.org/local/。
--------------------------------------------------------------------------------
via: https://www.linuxuprising.com/2018/08/how-to-remove-or-disable-ubuntu-dock.html
作者:[Logix][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[MjSeven](https://github.com/MjSeven)
校对:[校对者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/

View File

@ -1,111 +0,0 @@
使用 Syncthing —— 一个开源同步工具来把握你数据的控制权
决定如何存储和共享您的个人信息。
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus_cloud_database.png?itok=lhhU42fg)
如今,我们的一些最重要的财产——从家人和朋友的照片和视频到财务和医疗文件——都是数据。
即便是云存储服务的迅猛发展,我们仍有对隐私和个人数据缺乏控制的担忧。从 PRISM 的监控计划到谷歌[让 APP 开发者扫描你的个人邮件][1],这些新闻的报道应该会让我们对我们个人信息的安全性有所顾虑。
[Syncthing][2] 可以让你放下心来。它是一款开源点对点的文件同步工具可以运行在Linux、Windows、Mac、Android和其他 抱歉没有iOS。Syncthing 使用自定的协议,叫[块交换协议](3)。简而言之Syncting 能让你无需拥有服务器来跨设备同步数据,。
### Linux
在这篇文章中,我将解释如何在 Linux 电脑和安卓手机之间安装和同步文件。
Syncting 在大多数流行的发行版都能下载。Fedora 28 包含其最新版本。
要在 Fedora 上安装 Syncthing你能在软件中心搜索或者执行以下命令
```
sudo dnf install syncthing syncthing-gtk
```
一旦安装好后,打开它。你将会看到一个助手帮你配置 Syncthing。点击 **下一步** 直到它要求配置 WebUI。最安全的选项是选择**监听本地地址**。那将会禁止 Web 接口并且阻止未经授权的用户。
![Syncthing in Setup WebUI dialog box][5]
Syncthing 安装时的 WebUI 对话框
关闭对话框。现在 Syncthing 安装好了。是时间分享一个文件夹,连接一台设备开始同步了。但是,让我们用你其他的客户端继续。
### Android
Syncthing 在 Google Play 和 F-Droid 应用商店都能下载
![](https://opensource.com/sites/default/files/uploads/syncthing2.png)
安装应用程序后,会显示欢迎界面。给 Syncthing 授予你设备存储的权限。
你可能会被要求为了此应用程序而禁用电池优化。这样做是安全的,因为我们将优化应用程序,使其仅在插入并连接到无线网络时同步。
点击主菜单图标来到**设置**,然后是**运行条件**。点击**总是在后台运行** **仅在充电时运行**和**仅在 WIFI 下运行**。现在你的安卓客户端已经准备好与你的设备交换文件。
Syncting 中有两个重要的概念需要记住:文件夹和设备。文件夹是你想要分享的,但是你必须有一台设备来分享。 Syncthing 允许你用不同的设备分享独立的文件夹。设备是通过交换设备 ID 来添加的。设备ID是在 Syncting 首次启动时创建的一个唯一的密码安全标识符。
### 连接设备
现在让我们连接你的Linux机器和你的Android客户端。
在您的Linux计算机中打开 Syncting单击 **设置** 图标,然后单击 **显示ID** ,就会显示一个二维码。
在你的安卓手机上,打开 Syncthing。在主界面上点击 **设备** 页后点击 **+** 。在第一个区域内点击二维码符号来启动二维码扫描。
将你手机的摄像头对准电脑上的二维码。设备ID字段将由您的桌面客户端设备 ID 填充。起一个适合的名字并保存。因为添加设备有两种方式,现在你需要在电脑客户端上确认你想要添加安卓手机。你的电脑客户端可能会花上好几分钟来请求确认。当提示确认时,点击**添加**。
![](https://opensource.com/sites/default/files/uploads/syncthing6.png)
**新设备** 窗口,你能确认并配置一些关于你设备的选项,像是**设备名** 和 **地址**。如果你在地址那一栏选择 dynamic (动态),客户端将会自动探测设备的 IP 地址,但是你想要保持住某一个 IP 地址,你能将该地址填进这一栏里。如果你已经创建了文件夹(或者在这之后),你也能与新设备分享这个文件夹。
![](https://opensource.com/sites/default/files/uploads/syncthing7.png)
你的电脑和安卓设备已经配对,可以交换文件了。(如果你有多台电脑或手机,只需重复这些步骤。)
### 分享文件夹
既然您想要同步的设备之间已经连接,现在是时候共享一个文件夹了。您可以在电脑上共享文件夹,添加了该文件夹中的设备将获得一份副本。
若要共享文件夹,请转至**设置**并单击**添加共享文件夹**:
![](https://opensource.com/sites/default/files/uploads/syncthing8.png)
在下一个窗口中,输入要共享的文件夹的信息:
![](https://opensource.com/sites/default/files/uploads/syncthing9.png)
你可以使用任何你想要的标签。**文件夹ID **将随机生成,用于识别客户端之间的文件夹。在**路径**里,点击**浏览**就能定位到你想要分享的文件夹。如果你想 Syncthing 监控文件夹的变化(例如删除,新建文件等),点击** 监控文件系统变化**
记住,当你分享一个文件夹,在其他客户端的任何改动都将会反映到每一台设备上。这意味着如果你在其他电脑和手机设备之间分享了一个包含图片的文件夹,在这些客户端上的改动都会同步到每一台设备。如果这不是你想要的,你能让你的文件夹“只是发送"给其他客户端,但是其他客户端的改动都不会被同步。
完成后,转至**与设备共享**页并选择要与之同步文件夹的主机:
您选择的所有设备都需要接受共享请求;您将在设备上收到通知。
正如共享文件夹时一样,您必须配置新的共享文件夹:
![](https://opensource.com/sites/default/files/uploads/syncthing12.png)
同样,在这里您可以定义任何标签,但是 ID 必须匹配每个客户端。在文件夹选项中,选择文件夹及其文件的位置。请记住,此文件夹中所做的任何更改都将反映到文件夹所允许同步的每个设备上。
这些是连接设备和与 Syncting 共享文件夹的步骤。开始复制可能需要几分钟时间,这取决于您的网络设置或您是否不在同一网络上。
Syncting 提供了更多出色的功能和选项。试试看,并把握你数据的控制权。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/9/take-control-your-data-syncthing
作者:[Michael Zamot][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[ypingcn](https://github.com/ypingcn)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/mzamot
[1]: https://gizmodo.com/google-says-it-doesnt-go-through-your-inbox-anymore-bu-1827299695
[2]: https://syncthing.net/
[3]: https://docs.syncthing.net/specs/bep-v1.html
[4]: /file/410191
[5]: https://opensource.com/sites/default/files/uploads/syncthing1.png "Syncthing in Setup WebUI dialog box"

View File

@ -1,289 +0,0 @@
列出在 Linux 上已开启/激活的仓库
======
这里有很多方法可以列出在 Linux 已开启的仓库。
我们将在下面展示给你列出已激活仓库的简便方法。
这有助于你知晓你的系统上都开启了哪些仓库。
一旦你掌握了这些信息,你就可以添加任何之前还没有准备开启的仓库了。
举个例子,如果你想开启 `epel repository` ,你需要先检查 epel repository 是否已经开启了。这篇教程将会帮助你做这件事情。
### 什么是仓库?
存储特定程序软件包的中枢位置就是一个软件仓库。
所有的 Linux 发行版都开发了他们自己的仓库,而且允许用户下载并安装这些软件包到他们的机器上。
每个供应商都提供了一套包管理工具,用以管理他们的仓库,比如搜索、安装、更新、升级、移除等等。
大多数 Linux 发行版都作为免费软件,除了 RHEL 和 SUSE。接收他们的仓库你需要先购买订阅。
**建议阅读:**
**(#)** [在 Linux 上,如何通过 DNF/YUM 设置管理命令添加、开启、关闭一个仓库][1]
**(#)** [在 Linux 上如何以尺寸列出已安装的包][2]
**(#)** [在 Linux 上如何列出升级的包][3]
**(#)** [在 Linux 上如何查看一个特定包已安装/已升级/已更新/已移除/已清除的数据][4]
**(#)** [在 Linux 上如何查看一个包的详细信息][5]
**(#)** [在你的 Linux 发行版上如何查看一个包是否可用][6]
**(#)** [在 Linux 如何列出可用的软件包组][7]
**(#)** [Newbies corner - 一个图形化的 Linux 包管理的前端工具][8]
**(#)** [Linux 专家须知,命令行包管理 & 使用列表][9]
### 在 RHEL/CentOS上列出已开启的库
RHEL 和 CentOS 系统使用的是 RPM 包管理,所以我们可以使用 `Yum 包管理` 查看这些信息。
YUM 代表的是 `Yellowdog Updater,Modified`,它是一个包管理的开源前端,作用在基于 RPM 的系统上,例如 RHEL 和 CentOS。
YUM 是获取、安装、删除、查询和管理来自发行版仓库和其他第三方库的 RPM 包的主要工具。
**建议阅读Suggested Read :** [在 RHEL/CentOS 系统上用 YUM 命令管理包][10]
基于 RHEL 的系统主要提供以下三个主要的仓库。这些仓库是默认开启的。
* **`base:`** 它包含了所有的核心包和基础包。
* **`extras:`** 它向 CentOS 提供不破坏上游兼容性或更新基本组件的额外功能。这是一个上游仓库,还有额外的 CentOS 包。
* **`updates:`** 它提供了 bug 修复包、安全性包和增强包。
```
# yum repolist
或者
# yum repolist enabled
Loaded plugins: fastestmirror
Determining fastest mirrors
epel: ewr.edge.kernel.org
repo id repo name status
!base/7/x86_64 CentOS-7 - Base 9,911
!epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 12,687
!extras/7/x86_64 CentOS-7 - Extras 403
!updates/7/x86_64 CentOS-7 - Updates 1,348
repolist: 24,349
```
### 如何列出 Fedora 上已开启的包
DNF 代表 Dandified yum。我们可以说 DNF 是下一代的 yum 包管理,使用了 hawkey/libsolv 作为后端。自从 Fedroa 18 开始Aleš Kozumplík 就开始研究 DNF 最终在 Fedora 22 上实现。
Fedora 22 及之后的系统上都使用 Dnf 安装、升级、搜索和移除包。它可以自动解决依赖问题,并使包的安装过程平顺没有任何麻烦。
因为 Yum 许多未解决的问题,现在 Yum 已经被 DNF 所替代。你问为什么?他没有给 Yum 打补丁。Aleš Kozumplík 解释说修补在技术上太困难了YUM 团队无法立即承受这些变更还有其他的问题YUM 是 56k 行,而 DNF 是 29k 行。因此,除了 fork 之外,别无选择。
**建议阅读:** [在 Fedora 上使用 DNFFork 自 YUM管理软件][11]
Fedora 主要提供下面两个主仓库。这些库将被默认开启。
* **`fedora:`** 它包括所有的核心包和基础包。
* **`updates:`** 它提供了来自稳定发行版的 bug 修复包、安全性包和增强包
```
# dnf repolist
或者
# dnf repolist enabled
Last metadata expiration check: 0:02:56 ago on Wed 10 Oct 2018 06:12:22 PM IST.
repo id repo name status
docker-ce-stable Docker CE Stable - x86_64 6
*fedora Fedora 26 - x86_64 53,912
home_mhogomchungu mhogomchungu's Home Project (Fedora_25) 19
home_moritzmolch_gencfsm Gnome Encfs Manager (Fedora_25) 5
mystro256-gnome-redshift Copr repo for gnome-redshift owned by mystro256 6
nodesource Node.js Packages for Fedora Linux 26 - x86_64 83
rabiny-albert Copr repo for albert owned by rabiny 3
*rpmfusion-free RPM Fusion for Fedora 26 - Free 536
*rpmfusion-free-updates RPM Fusion for Fedora 26 - Free - Updates 278
*rpmfusion-nonfree RPM Fusion for Fedora 26 - Nonfree 202
*rpmfusion-nonfree-updates RPM Fusion for Fedora 26 - Nonfree - Updates 95
*updates Fedora 26 - x86_64 - Updates 14,595
```
### 如何列出 Debian/Ubuntu 上已开启的仓库
基于 Debian 的系统使用的是 APT/APT-GET 包管理,因此我们可以使用 `APT/APT-GET 包管理` 去获取更多的信息。
APT 代表 Advanced Packaging Tool它取代了 apt-get就像 DNF 取代 Yum一样。 它具有丰富的命令行工具在一个命令APT中包含了所有如 apt-cacheapt-searchdpkgapt-cdromapt-configapt-key等。 还有其他几个独特的功能。 例如,我们可以通过 APT 轻松安装 .dpkg 软件包,而我们无法通过 Apt-Get 获得和包含在 APT 命令中类似的更多功能。 由于未能解决的 apt-get 问题,用 APT 取代了 APT-GET 的锁定。
APT_GET 代表 Advanced Packaging Tool。apt-get 是一个强大的命令行工具,它用以自动下载和安装新的软件包、升级已存在的软件包、更新包索引列表、还有升级整个基于 Debian 的系统。
```
# apt-cache policy
Package files:
100 /var/lib/dpkg/status
release a=now
500 http://ppa.launchpad.net/peek-developers/stable/ubuntu artful/main amd64 Packages
release v=17.10,o=LP-PPA-peek-developers-stable,a=artful,n=artful,l=Peek stable releases,c=main,b=amd64
origin ppa.launchpad.net
500 http://ppa.launchpad.net/notepadqq-team/notepadqq/ubuntu artful/main amd64 Packages
release v=17.10,o=LP-PPA-notepadqq-team-notepadqq,a=artful,n=artful,l=Notepadqq,c=main,b=amd64
origin ppa.launchpad.net
500 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages
release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main,b=amd64
origin dl.google.com
500 https://download.docker.com/linux/ubuntu artful/stable amd64 Packages
release o=Docker,a=artful,l=Docker CE,c=stable,b=amd64
origin download.docker.com
500 http://security.ubuntu.com/ubuntu artful-security/multiverse amd64 Packages
release v=17.10,o=Ubuntu,a=artful-security,n=artful,l=Ubuntu,c=multiverse,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu artful-security/universe amd64 Packages
release v=17.10,o=Ubuntu,a=artful-security,n=artful,l=Ubuntu,c=universe,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu artful-security/restricted i386 Packages
release v=17.10,o=Ubuntu,a=artful-security,n=artful,l=Ubuntu,c=restricted,b=i386
origin security.ubuntu.com
.
.
origin in.archive.ubuntu.com
500 http://in.archive.ubuntu.com/ubuntu artful/restricted amd64 Packages
release v=17.10,o=Ubuntu,a=artful,n=artful,l=Ubuntu,c=restricted,b=amd64
origin in.archive.ubuntu.com
500 http://in.archive.ubuntu.com/ubuntu artful/main i386 Packages
release v=17.10,o=Ubuntu,a=artful,n=artful,l=Ubuntu,c=main,b=i386
origin in.archive.ubuntu.com
500 http://in.archive.ubuntu.com/ubuntu artful/main amd64 Packages
release v=17.10,o=Ubuntu,a=artful,n=artful,l=Ubuntu,c=main,b=amd64
origin in.archive.ubuntu.com
Pinned packages:
```
### 如何在 openSUSE 上列出已开启的仓库
openSUSE 使用 zypper 包管理,因此我们可以使用 zypper 包管理获得更多信息。
Zypper 是 suse 和 openSUSE 发行版的命令行包管理。它用于安装、更新、搜索、移除包和管理仓库执行各种查询等。Zypper 以 libzyppZYpp 系统管理库)作为后端。
**建议阅读:** [在 openSUSE 和 suse 系统上使用 Zypper 命令管理包][12]
```
# zypper repos
# | Alias | Name | Enabled | GPG Check | Refresh
--+-----------------------+-----------------------------------------------------+---------+-----------+--------
1 | packman-repository | packman-repository | Yes | (r ) Yes | Yes
2 | google-chrome | google-chrome | Yes | (r ) Yes | Yes
3 | home_lazka0_ql-stable | Stable Quod Libet / Ex Falso Builds (openSUSE_42.1) | Yes | (r ) Yes | No
4 | repo-non-oss | openSUSE-leap/42.1-Non-Oss | Yes | (r ) Yes | Yes
5 | repo-oss | openSUSE-leap/42.1-Oss | Yes | (r ) Yes | Yes
6 | repo-update | openSUSE-42.1-Update | Yes | (r ) Yes | Yes
7 | repo-update-non-oss | openSUSE-42.1-Update-Non-Oss | Yes | (r ) Yes | Yes
```
以 URI 列出仓库。
```
# zypper lr -u
# | Alias | Name | Enabled | GPG Check | Refresh | URI
--+-----------------------+-----------------------------------------------------+---------+-----------+---------+---------------------------------------------------------------------------------
1 | packman-repository | packman-repository | Yes | (r ) Yes | Yes | http://ftp.gwdg.de/pub/linux/packman/suse/openSUSE_Leap_42.1/
2 | google-chrome | google-chrome | Yes | (r ) Yes | Yes | http://dl.google.com/linux/chrome/rpm/stable/x86_64
3 | home_lazka0_ql-stable | Stable Quod Libet / Ex Falso Builds (openSUSE_42.1) | Yes | (r ) Yes | No | http://download.opensuse.org/repositories/home:/lazka0:/ql-stable/openSUSE_42.1/
4 | repo-non-oss | openSUSE-leap/42.1-Non-Oss | Yes | (r ) Yes | Yes | http://download.opensuse.org/distribution/leap/42.1/repo/non-oss/
5 | repo-oss | openSUSE-leap/42.1-Oss | Yes | (r ) Yes | Yes | http://download.opensuse.org/distribution/leap/42.1/repo/oss/
6 | repo-update | openSUSE-42.1-Update | Yes | (r ) Yes | Yes | http://download.opensuse.org/update/leap/42.1/oss/
7 | repo-update-non-oss | openSUSE-42.1-Update-Non-Oss | Yes | (r ) Yes | Yes | http://download.opensuse.org/update/leap/42.1/non-oss/
```
通过优先级列出仓库。
```
# zypper lr -p
# | Alias | Name | Enabled | GPG Check | Refresh | Priority
--+-----------------------+-----------------------------------------------------+---------+-----------+---------+---------
1 | packman-repository | packman-repository | Yes | (r ) Yes | Yes | 99
2 | google-chrome | google-chrome | Yes | (r ) Yes | Yes | 99
3 | home_lazka0_ql-stable | Stable Quod Libet / Ex Falso Builds (openSUSE_42.1) | Yes | (r ) Yes | No | 99
4 | repo-non-oss | openSUSE-leap/42.1-Non-Oss | Yes | (r ) Yes | Yes | 99
5 | repo-oss | openSUSE-leap/42.1-Oss | Yes | (r ) Yes | Yes | 99
6 | repo-update | openSUSE-42.1-Update | Yes | (r ) Yes | Yes | 99
7 | repo-update-non-oss | openSUSE-42.1-Update-Non-Oss | Yes | (r ) Yes | Yes | 99
```
### 如何列出 Arch Linux 上已开启的仓库
基于 Arch Linux 的系统使用 pacman 包管理,因此我们可以使用 pacman 包管理获取这些信息。
pacman 代表 package manager utility。pacman 是一个命令行实用程序,用以安装、构建、移除和管理 Arch Linux 包。pacman 使用 libalpm Arch Linux包管理库作为后端去进行这些操作。
**建议阅读:** [在基于 Arch Linux的系统上使用 Pacman命令管理包][13]
```
# pacman -Syy
:: Synchronizing package databases...
core 132.6 KiB 1524K/s 00:00 [############################################] 100%
extra 1859.0 KiB 750K/s 00:02 [############################################] 100%
community 3.5 MiB 149K/s 00:24 [############################################] 100%
multilib 182.7 KiB 1363K/s 00:00 [############################################] 100%
```
### 如何使用 INXI Utility 列出 Linux 上已开启的仓库
inix 是 Linux 上检查硬件信息非常有用的工具,还提供很多的选项去获取 Linux 上的所有硬件信息,我从未在 Linux 上发现其他有如此效用的程序。它由 locsmif fork 自 ingenius infobash。
inix 是一个可以快速显示硬件信息、CPU、硬盘、Xorg、桌面、内核、GCC 版本、进程、内存使用和很多其他有用信息的程序,还使用于论坛技术支持和调试工具上。
这个实用程序将会显示所有发行版仓库的数据信息,例如 RHEL、CentOS、Fedora、Debain、Ubuntu、LinuxMint、ArchLinux、openSUSE、Manjaro等。
**建议阅读:** [inxi 一个在 Linux 上检查硬件信息的好工具][14]
```
# inxi -r
Repos: Active apt sources in file: /etc/apt/sources.list
deb http://in.archive.ubuntu.com/ubuntu/ yakkety main restricted
deb http://in.archive.ubuntu.com/ubuntu/ yakkety-updates main restricted
deb http://in.archive.ubuntu.com/ubuntu/ yakkety universe
deb http://in.archive.ubuntu.com/ubuntu/ yakkety-updates universe
deb http://in.archive.ubuntu.com/ubuntu/ yakkety multiverse
deb http://in.archive.ubuntu.com/ubuntu/ yakkety-updates multiverse
deb http://in.archive.ubuntu.com/ubuntu/ yakkety-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu yakkety-security main restricted
deb http://security.ubuntu.com/ubuntu yakkety-security universe
deb http://security.ubuntu.com/ubuntu yakkety-security multiverse
Active apt sources in file: /etc/apt/sources.list.d/arc-theme.list
deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04/ /
Active apt sources in file: /etc/apt/sources.list.d/snwh-ubuntu-pulp-yakkety.list
deb http://ppa.launchpad.net/snwh/pulp/ubuntu yakkety main
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/how-to-list-the-enabled-active-repositories-in-linux/
作者:[Prakash Subramanian][a]
选题:[lujun9972][b]
译者:[dianbanjiu](https://github.com/dianbanjiu)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/prakash/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/how-to-add-enable-disable-a-repository-dnf-yum-config-manager-on-linux/
[2]: https://www.2daygeek.com/how-to-list-installed-packages-by-size-largest-on-linux/
[3]: https://www.2daygeek.com/how-to-view-list-the-available-packages-updates-in-linux/
[4]: https://www.2daygeek.com/how-to-view-a-particular-package-installed-updated-upgraded-removed-erased-date-on-linux/
[5]: https://www.2daygeek.com/how-to-view-detailed-information-about-a-package-in-linux/
[6]: https://www.2daygeek.com/how-to-search-if-a-package-is-available-on-your-linux-distribution-or-not/
[7]: https://www.2daygeek.com/how-to-list-an-available-package-groups-in-linux/
[8]: https://www.2daygeek.com/list-of-graphical-frontend-tool-for-linux-package-manager/
[9]: https://www.2daygeek.com/list-of-command-line-package-manager-for-linux/
[10]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
[11]: https://www.2daygeek.com/dnf-command-examples-manage-packages-fedora-system/
[12]: https://www.2daygeek.com/zypper-command-examples-manage-packages-opensuse-system/
[13]: https://www.2daygeek.com/pacman-command-examples-manage-packages-arch-linux-system/
[14]: https://www.2daygeek.com/inxi-system-hardware-information-on-linux/

View File

@ -0,0 +1,485 @@
如何使用chkconfig和systemctl命令启用或禁用linux服务
======
对于Linux管理员来说这是一个重要美妙的话题所以每个人都必须知道并练习怎样才能更高效的使用它们。
在Linux中无论何时当你安装任何带有服务和守护进程的包系统默认会把这些进程添加到 “init & systemd” 脚本中,不过此时它们并没有被启动 。
我们需要手动的开启或者关闭那些服务。Linux中有三个著名的且一直在被使用的init系统。
### 什么是init系统
在以Linux/Unix 为基础的操作系统上init (初始化的简称) 是内核引导系统启动过程中第一个启动的进程。
init的进程id(pid)是1除非系统关机否则它将会一直在后台运行。
Init 首先根据 `/etc/inittab` 文件决定Linux运行的级别然后根据运行级别在后台启动所有其他进程和应用程序。
BIOS, MBR, GRUB 和内核程序在启动init之前就作为linux的引导程序的一部分开始工作了。
下面是Linux中可以使用的运行级别从06总共七个运行级别
* **`0:`** 关机
* **`1:`** 单用户模式
* **`2:`** 多用户模式没有NFS
* **`3:`** 完全的多用户模式
* **`4:`** 系统未使用
* **`5:`** 图形界面模式
* **`:`** 重启
下面是Linux系统中最常用的三个init系统
* System V (Sys V)
* Upstart
* systemd
### 什么是 System V (Sys V)?
System V (Sys V)是类Unix系统第一个传统的init系统之一。init是内核引导系统启动过程中第一支启动的程序 ,它是所有程序的父进程。
大部分Linux发行版最开始使用的是叫作System VSys V的传统的init系统。在过去的几年中已经有好几个init系统被发布用来解决标准版本中的设计限制例如launchd, the Service Management Facility, systemd 和 Upstart。
与传统的 SysV init系统相比systemd已经被几个主要的Linux发行版所采用。
### 什么是 Upstart?
Upstart 是一个基于事件的/sbin/init守护进程的替代品它在系统启动过程中处理任务和服务的启动在系统运行期间监视它们在系统关机的时候关闭它们。
它最初是为Ubuntu而设计但是它也能够完美的部署在其他所有Linux系统中用来代替古老的System-V。
Upstart被用于Ubuntu 从 9.10 到 Ubuntu 14.10和基于RHEL 6的系统之后它被systemd取代。
### 什么是 systemd?
Systemd是一个新的init系统和系统管理器 和传统的SysV相比它可以用于所有主要的Linux发行版。
systemd 兼容 SysV 和 LSB init脚本。 它可以直接替代Sys V init系统。systemd是被内核启动的第一支程序它的PID 是1。
systemd是所有程序的父进程Fedora 15 是第一个用systemd取代upstart的发行版。systemctl用于命令行它是管理systemd的守护进程/服务的主要工具,例如:(开启,重启,关闭,启用,禁用,重载和状态)
systemd 使用.service 文件而不是bash脚本 (SysVinit 使用的). systemd将所有守护进程添加到cgroups中排序你可以通过浏览`/cgroup/systemd` 文件查看系统等级。
### 如何使用chkconfig命令启用或禁用引导服务?
chkconfig实用程序是一个命令行工具允许你在指定运行级别下启动所选服务以及列出所有可用服务及其当前设置。
此外它还允许我们从启动中启用或禁用服务。前提是你有超级管理员权限root或者sudo运行这个命令。
所有的服务脚本位于 `/etc/rd.d/init.d`文件中
### 如何列出运行级别中所有的服务
`--list` 参数会展示所有的服务及其当前状态 (启用或禁用服务的运行级别)
```
# chkconfig --list
NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off
abrt-ccpp 0:off 1:off 2:off 3:on 4:off 5:on 6:off
abrtd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off
atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
.
.
```
### 如何查看指定服务的状态
如果你想查看运行级别下某个服务的状态,你可以使用下面的格式匹配出需要的服务。
比如说我想查看运行级别中`auditd`服务的状态
```
# chkconfig --list| grep auditd
auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
```
### 如何在指定运行级别中启用服务
使用`--level`参数启用指定运行级别下的某个服务下面展示如何在运行级别3和运行级别5下启用 `httpd` 服务。
```
# chkconfig --level 35 httpd on
```
### 如何在指定运行级别下禁用服务
同样使用 `--level`参数禁用指定运行级别下的服务下面展示的是在运行级别3和运行级别5中禁用`httpd`服务。
```
# chkconfig --level 35 httpd off
```
### 如何将一个新服务添加到启动列表中
`-add`参数允许我们添加任何信服务到启动列表中, 默认情况下新添加的服务会在运行级别2345下自动开启。
```
# chkconfig --add nagios
```
### 如何从启动列表中删除服务
可以使用 `--del` 参数从启动列表中删除服务下面展示的事如何从启动列表中删除Nagios服务。
```
# chkconfig --del nagios
```
### 如何使用systemctl命令启用或禁用开机自启服务
systemctl用于命令行它是一个基础工具用来管理systemd的守护进程/服务,例如:(开启,重启,关闭,启用,禁用,重载和状态)
所有服务创建的unit文件位与`/etc/systemd/system/`.
### 如何列出全部的服务
使用下面的命令列出全部的服务(包括启用的和禁用的)
```
# systemctl list-unit-files --type=service
UNIT FILE STATE
arp-ethers.service disabled
auditd.service enabled
[email protected] enabled
blk-availability.service disabled
brandbot.service static
[email protected] static
chrony-wait.service disabled
chronyd.service enabled
cloud-config.service enabled
cloud-final.service enabled
cloud-init-local.service enabled
cloud-init.service enabled
console-getty.service disabled
console-shell.service disabled
[email protected] static
cpupower.service disabled
crond.service enabled
.
.
150 unit files listed.
```
使用下面的格式通过正则表达式匹配出你想要查看的服务的当前状态。下面是使用systemctl命令查看`httpd` 服务的状态。
```
# systemctl list-unit-files --type=service | grep httpd
httpd.service disabled
```
### 如何让指定的服务开机自启
使用下面格式的systemctl命令启用一个指定的服务。启用服务将会创建一个符号链接如下可见
```
# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
```
运行下列命令再次确认服务是否被启用。
```
# systemctl is-enabled httpd
enabled
```
### 如何禁用指定的服务
运行下面的命令禁用服务将会移除你启用服务时所创建的
```
# systemctl disable httpd
Removed symlink /etc/systemd/system/multi-user.target.wants/httpd.service.
```
运行下面的命令再次确认服务是否被禁用
```
# systemctl is-enabled httpd
disabled
```
### 如何查看系统当前的运行级别
使用systemctl命令确认你系统当前的运行级别'运行级'别仍然由systemd管理不过运行级别对于systemd来说是一个历史遗留的概念。所以我建议你全部使用systemctl命令。
我们当前处于`运行级别3`, 下面显示的是`multi-user.target`。
```
# systemctl list-units --type=target
UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
cloud-config.target loaded active active Cloud-config availability
cryptsetup.target loaded active active Local Encrypted Volumes
getty.target loaded active active Login Prompts
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
network-online.target loaded active active Network is Online
network-pre.target loaded active active Network (Pre)
network.target loaded active active Network
paths.target loaded active active Paths
remote-fs.target loaded active active Remote File Systems
slices.target loaded active active Slices
sockets.target loaded active active Sockets
swap.target loaded active active Swap
sysinit.target loaded active active System Initialization
timers.target loaded active active Timers
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/how-to-enable-or-disable-services-on-boot-in-linux-using-chkconfig-and-systemctl-command/
作者:[Prakash Subramanian][a]
选题:[lujun9972][b]
译者:[way-ww](https://github.com/way-ww)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/prakash/
[b]: https://github.com/lujun9972

View File

@ -0,0 +1,74 @@
MidnightBSD 发布 1.0!看看有哪些新的东西
======
几天前Lucas Holt 宣布发布 MidnightBSD 1.0。让我们快速看一下这个新版本中包含的内容。
### 什么是 MidnightBSD
![MidnightBSD][1]
[MidnightBSD][2] 是 FreeBSD 的一个分支。Lucas 创建了 MightnightBSD这成为桌面用户和 BSD 新手的一个选择。他想创造一个能让人们快速体验 BSD 桌面的东西。他认为其他发行版过于关注服务器市场。
### MidnightBSD 1.0 中有什么?
根据[发布说明][3]1.0 中的大部分工作都是更新基础系统,改进包管理器和更新工具。新版本与 FreeBSD 10-Stable 兼容。
MportsMidnightBSD 的包管理系统)已经升级支持使用一个命令安装多个包。`mport upgrade` 命令已经修复。Mports 现在会跟踪已弃用和过期的包。它还引入了新的包格式。
<https://www.youtube.com/embed/-rlk2wFsjJ4>
其他变化包括:
* 现在支持 [ZFS][4] 作为启动文件系统。以前ZFS 只能用于额外存储。
  * 支持 NVME SSD。
  * AMD Ryzen 和 Radeon 的支持得到了改善。
  * Intel、Broadcom 和其他驱动程序已更新。
  * 已从 FreeBSD 移植 bhyve 支持。
  * 传感器框架已被删除,因为它导致锁定问题。
  * 删除了 Sudo 并用 OpenBSD 中的 [doas][5] 替换。
  * 增加了对 Microsoft hyper-v 的支持。
### 升级之前
如果你当前是 MidnightBSD 的用户或正在考虑尝试新版本那么还是再等一会。Lucas 目前正在重建软件包以支持新的软件包格式和工具。他还计划在未来几个月内升级软件包和移植桌面环境。他目前正致力于移植 Firefox 52 ESR因为它是最后一个不需要 Rust 的版本。他还希望将更新版本的 Chromium 移植到 MidnightBSD。我建议关注 MidnightBSD 的 [Twitter][6]。
### 0.9怎么回事?
你可能注意到 MidnightBSD 的先前版本是 0.8.6。你现在可能想知道“为什么跳到 1.0”?根据 Lucas 的说法,他在开发 0.9 时遇到了几个问题。事实上,他重试好几次。他最终采用与 0.9 分支不同的方式,并变成了 1.0。有些软件包也存在 0.* 编号系统的问题。
### 需要帮助
目前MidnightBSD 项目几乎是 Lucas Holt 一个人的作品。这是其发展缓慢的主要原因。如果你有兴趣帮忙,可以通过 [Twitter][6] 与他联系。
在[发布公告视频][7]中。Lucas 说他遇到了上游项目接受补丁的问题。他们似乎认为 MidnightBSD 太小了。这通常意味着他必须从头开始移植应用。
### 想法
我对劣势者有一个想法。在我接触的所有 BSD 中,这个外号最适合 MidnightBSD。一个人想要创建一个轻松的桌面体验。当前只有一个其他的 BSD 在尝试做相似的事情Project Trident。我想这是 BSD 成功的真正的阻碍。Linux 成功是因为人们可以快速容易地安装它。希望 MidnightBSD 为 BSD 做到这一点,但是还有很长的路要走。
你有没有用过 MidnightBSD如果没有你最喜欢的 BSD 是什么?我们应该涵盖哪些其他 BSD 主题?请在下面的评论中告诉我们。
如果你觉得这篇文章有趣请花一点时间在社交媒体Hacker News 或 [Reddit][8] 上分享它。
--------------------------------------------------------------------------------
via: https://itsfoss.com/midnightbsd-1-0-release/
作者:[John Paul][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[b]: https://github.com/lujun9972
[1]: https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/10/midnightbsd-wallpaper.jpeg
[2]: https://www.midnightbsd.org/
[3]: https://www.midnightbsd.org/notes/
[4]: https://itsfoss.com/what-is-zfs/
[5]: https://man.openbsd.org/doas
[6]: https://twitter.com/midnightbsd
[7]: https://www.youtube.com/watch?v=-rlk2wFsjJ4
[8]: http://reddit.com/r/linuxusersgroup