Merge pull request #5 from LCTT/master

update 2017 03 16 23:58
This commit is contained in:
cinlen_0x05 2017-03-16 23:58:02 +08:00 committed by GitHub
commit 064c2af3a2
29 changed files with 1537 additions and 1213 deletions

View File

@ -56,7 +56,9 @@ LCTT 的组成
* 2016/02/29 选题 DeadFire 病逝。
* 2016/05/09 提升 PurlingNayuki 为校对。
* 2016/09/10 LCTT 三周年。
* 2016/12/24 拟定 LCTT [Core 规则](core.md),并增加新的 Core 成员: @ucasFL、@martin2011qi及调整一些组。
* 2016/12/24 拟定 LCTT [Core 规则](core.md),并增加新的 Core 成员: ucasFL、martin2011qi及调整一些组。
* 2017/03/13 制作了 LCTT 主页、成员列表和成员主页LCTT 主页将移动至 https://linux.cn/lctt 。
* 2017/03/16 提升 GHLandy、bestony、rusking 为新的 Core 成员。创建 Comic 小组。
活跃成员
-------------------------------
@ -69,7 +71,7 @@ LCTT 的组成
- CORE @GOLinux,
- CORE @ictlyh,
- CORE @strugglingyouth,
- CORE @FSSlc
- CORE @FSSlc,
- CORE @zpl1025,
- CORE @runningwater,
- CORE @bazz2,
@ -77,8 +79,11 @@ LCTT 的组成
- CORE @alim0x,
- CORE @tinyeyeser,
- CORE @Locez,
- CORE @ucasFL
- CORE @martin2011qi
- CORE @ucasFL,
- CORE @martin2011qi,
- CORE @GHLandy,
- CORE @bestony,
- CORE @rusking,
- Senior @DeadFire,
- Senior @reinoir222,
- Senior @vito-L,
@ -87,85 +92,8 @@ LCTT 的组成
- Senior @dongfengweixiao,
- Senior @PurlingNayuki,
- Senior @carolinewuyan,
- cposture,
- ZTinoZ,
- theo-l,
- Luoxcat,
- GHLandy,
- wi-cuckoo,
- StdioA,
- disylee,
- wwy-hust,
- felixonmars,
- KayGuoWhu,
- mr-ping,
- wyangsun,
- su-kaiyao,
- ivo-wang,
- cvsher,
- OneNewLife
- DongShuaike,
- flsf,
- SPccman,
- Stevearzh,
- bestony,
- Linchenguang,
- Linux-pdz,
- 2q1w2007,
- NearTan,
- H-mudcup,
- GitFuture,
- MikeCoder,
- xiqingongzi,
- goreliu,
- rusking,
- jiajia9linuxer,
- name1e5s,
- TxmszLou,
- ZhouJ-sh,
- wangjiezhe,
- icybreaker,
- zky001,
- vim-kakali,
- shipsw,
- LinuxBars,
- Moelf,
- Chao-zhi
- johnhoow,
- soooogreen,
- kokialoves,
- linuhap,
- ChrisLeeGit,
- blueabysm,
- yangmingming,
- boredivan,
- yechunxiao19,
- XLCYun,
- KevinSJ,
- l3b2w1,
- tenght,
- firstadream,
- coloka,
- luoyutiantang,
- sonofelice,
- scusjs,
- woodboow,
- 1w2b3l,
- JonathanKang,
- crowner,
- dingdongnigetou,
- mtunique,
- hyaocuk,
- szrlee,
- nd0104,
- chenzhijun,
- frankatlingingdigital,
- willcoderwang,
- liuaiping,
- rogetfan,
- JeffDing,
按增加行数排名前百更新于2016/12/24
全部成员列表请参见: https://linux.cn/lctt-list/ 。
谢谢大家的支持!

View File

@ -1,4 +1,4 @@
Odoo提速指南
Odoo 提速指南
============================================================
![speed up odoo](https://www.rosehosting.com/blog/wp-content/uploads/2016/12/speed-up-odoo.jpg)
@ -9,19 +9,19 @@ Odoo 是最流行的 ERP企业资源计划软件它由 Python 编写,
* 使用一个快速磁盘驱动器来存储(最好是 SSD
* 使用[内存充足的 Linux VPS][1]。
* 在 Odoo 中激活多重处理模式
*   在 Odoo 中激活<ruby>多处理器模式<rt>multiprocessing mode</rt></ruby>
* 正确配置并优化 PostgreSQL 服务。
### 获得一台有着更多内存的 SSD VPS
正如我们先前提到的,随机磁盘访问速度时 Odoo 的主要瓶颈之一。因此,要确保 Odoo 部署在一台[基于 SSD 的 VPS][2] 上。由于 Odoo 是一个对资源十分敏感的应用,因此始终要把它安装在一台有着更多 RAM 的 VPS 上,如果可能,将整个 Odoo 实例及其数据库加载到 RAM 中。固态磁盘驱动器尤其以随机存取见长,而且由于 SSD 没有任何活动部件,它们能够取得数百倍于传统机械硬盘驱动器的随机存取 IOPS。如果服务器没有采用 SSD 来驱动或提速,那么不管你对 Odoo 做多少优化和配置都无济于事,它仍然会很慢。所以,获得正确的主机来部署 Odoo 是提升其性能的最重要因素。
跟大家提过 Odoo 是一个资源饥渴的应用有没有貌似说过吧。但是不要担心RoseHosting 将为你们提供一个终极解决方案——一台为性能而量身定做的 [Odoo SSD VPS][3],为匹配你的最大需求而优化。来,从我们这搞一台 SSD VPS 吧,你会发现什么才真的叫 Odoo 破纪录的速度。
正如我们先前提到的,随机磁盘访问速度是 Odoo 的主要瓶颈之一。因此,要确保 Odoo 部署在一台[基于 SSD 的 VPS][2] 上。由于 Odoo 是一个对资源十分敏感的应用,因此始终要把它安装在一台有着更多 RAM 的 VPS 上,如果可能,将整个 Odoo 实例及其数据库加载到 RAM 中。固态磁盘驱动器尤其以随机存取见长,而且由于 SSD 没有任何活动部件,它们能够取得数百倍于传统机械硬盘驱动器的随机存取 IOPSLCTT译注即每秒读写操作的次数。如果服务器没有采用 SSD 来驱动或提速,那么不管你对 Odoo 做多少优化和配置都无济于事,它仍然会很慢。所以,获得正确的主机来部署 Odoo 是提升其性能的最重要因素。
其它 Odoo 优化包括:
### 在 Odoo 配置中启用多重处理选项
### 在 Odoo 配置中启用多处理器选项
要实现此功能,请定位到 openerp 服务器二进制文件:
```
#updatedb
#locate openerp-server
@ -64,11 +64,11 @@ Options:
(default 8192).
```
工作进程的数量应该和分配到 VPS 的 CPU 核心数一样,或者,如果你想为 PostgreSQL 数据库cron 任务,或者其它和 Odoo 实例安装在同一台 VPS 上的其它应用预留出一些 CPU 核心,那么你可以将工作进程数设置为一个比 VPS 上可用 CPU 核心更低的值,以避免资源耗尽。
工作进程的数量应该和分配到 VPS 的 CPU 核心数一样,或者,如果你想为 PostgreSQL 数据库、cron 任务、或者其它和 Odoo 实例安装在同一台 VPS 上的其它应用预留出一些 CPU 核心,那么你可以将工作进程数设置为一个比 VPS 上可用 CPU 核心更低的值,以避免资源耗尽。
limit-memory-soft 和 limit-memory-hard 参数不言自明,你可以使用默认值,也可以根据 VPS 上的实际可用 RAM 来进行修改。
例如,如果你的 VPS 有 8 个 CPU 核心,以及 16 GB 内存,那么你可以将工作进程数设置为 17CPU 核心数 x 2 + 1limit-memory-soft 总值设置为 be 640 x 17 = 10880 MB而 limit-memory-hard 总数设置为 68MB x 17 = 13056 MB这样Odoo 就会有总计达 12.75 GB 的 RAM。
例如,如果你的 VPS 有 8 个 CPU 核心,以及 16 GB 内存,那么你可以将工作进程数设置为 17CPU 核心数 x 2 + 1limit-memory-soft 总值设置为 640 x 17 = 10880 MB而 limit-memory-hard 总数设置为 68MB x 17 = 13056 MB这样Odoo 就会有总计达 12.75 GB 的 RAM。
例如,在一台拥有 16 GB RAM 和 8 个 CPU 核心的 VPS 上,编辑 Odoo 配置文件(如 /etc/odoo-server.conf并添加以下行
```
@ -94,9 +94,10 @@ max_cron_threads = 2
### 正确配置并优化 PostgreSQL
对于 PostgreSQL 优化,时将它更新到最新版本是一个不错的主意。在 PostgreSQL 配置文件pg_hba.conf有两个设置需要修改shared_buffers 和 effective_cache_size。将 shared_buffers 设置为可用内存的 20%effective_cache_size 设置为可用内存的 50%。
对于 PostgreSQL 优化,时将它更新到最新版本是一个不错的主意。在 PostgreSQL 配置文件pg_hba.conf有两个设置需要修改shared_buffers 和 effective_cache_size。将 shared_buffers 设置为可用内存的 20%effective_cache_size 设置为可用内存的 50%。
例如,如果 Odoo 安装到了一台 16 GB RAM 的 SSD VPS 上,那么在 pg_hba.conf 中使用如下设置:
```
vi /var/lib/postgresql/data/pg_hba.conf
```
@ -105,9 +106,11 @@ vi /var/lib/postgresql/data/pg_hba.conf
shared_buffers = 3072MB
effective_cache_size = 8192MB
```
重启 PostgreSQL 服务来让修改生效。
同时,也别忘了周期性手动执行‘[VACUUM][4]Vacuuming会将陈旧或临时数据清理干净但请牢记它会大量占用 CPU 和磁盘使用。
同时,也别忘了周期性手动执行 **[VACUUM][4]**’。此操作会将陈旧或临时数据清理干净,但请牢记,它会大量占用 CPU 和磁盘使用。
--------------------------------------------------------------------------------
@ -115,12 +118,11 @@ via: https://www.rosehosting.com/blog/how-to-speed-up-odoo/
作者:[rosehosting.com][a]
译者:[GOLinux](https://github.com/GOLinux)
校对:[校对者ID](https://github.com/校对者ID)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.rosehosting.com/
[1]:https://www.rosehosting.com/linux-vps-hosting.html
[2]:https://www.rosehosting.com/linux-vps-hosting.html
[3]:https://www.rosehosting.com/odoo-hosting.html
[4]:https://wiki.postgresql.org/wiki/Introduction_to_VACUUM,_ANALYZE,_EXPLAIN,_and_COUNT

View File

@ -1,26 +1,25 @@
如何获取并运行 Orange Pi
Orange Pi 新手起步指南
===========================
![如何获取并运行 Orange Pi](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/the_orange_pi_zero.jpg?itok=00T8KODN "How to get up and running with sweet Orange Pi")
![如何获取并运行 Orange Pi](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/the_orange_pi_zero.jpg?itok=00T8KODN "How to get up and running with sweet Orange Pi")
图片来源Dave Egts, CC BY-SA 4.0
随着开源驱动的硬件越来越成为主流,比如 [Arduino][2] 和 [Raspberry Pi][3],这些开源硬件的成本不断下降,给那些全新且具有创新性的[物联网][4]和[STEM][5](LCTT译注STEM 代表科学 Science技术 Technology工程 Engineering数学 Mathematics)类软件打开了大门。我对两者都比较感兴趣,始终保持关注,以便能找到一些可以应用到教育产业的创新点,比如课堂教育和我女儿的[机器人小组][6]。当听说 [Orange Pi 比 Raspberry Pi 更优秀][7]时我便开始关注Orange Pi了。
随着开源驱动的硬件越来越成为主流,比如 [Arduino][2] 和 [Raspberry Pi][3],这些开源硬件的成本不断下降,给那些全新且具有创新性的[物联网][4]和[STEM][5]LCTT译注STEM 代表科学 Science技术 Technology工程 Engineering数学 Mathematics类软件打开了大门。我对两者都比较感兴趣,始终保持关注,以便能找到一些可以应用到教育产业的创新点,比如课堂教育和我女儿的[机器人小组][6]。当听说 [Orange Pi 比 Raspberry Pi 更优秀][7]时,我便开始关注 Orange Pi了。
尽管 Orange Pi 是个略带酸味儿的名字,但是我仍然被 Orange Pi Zero 迷住了。我最近刚购买了一个 Orange Pi Zero 并将在本文中分享我的第一体验。真情提示:我是真的着迷了。
### 为什么是Orange Pi?
### 为什么是 Orange Pi?
Orange Pi 是由 Linux 驱动的单板计算机家族的一员,由[深圳迅龙软件有限公司][8]生产并在 [AliExpress][9] 上售卖。在 AliExpress 上买东西需要有耐心,提前计划预留出 2 到 4 周的运输时间,因为这些产品都是从中国大陆直接发往全世界其它地方的。
Orange Pi 是由 Linux 驱动的单板计算机家族的一员,由[深圳迅龙软件有限公司][8]生产并在 [全球速卖通AliExpress][9] 上售卖。在全球速卖通AliExpress上买东西需要有耐心,提前计划预留出 2 到 4 周的运输时间,因为这些产品都是从中国大陆直接发往全世界其它地方的。
与 Raspberry Pi 不同Raspberry Pi 家族型号比较少,不过在逐步增加,为单板计算机家族添加了几个具有不同价位及功能特色的型号,但是相对而言 Orange Pi 的型号更丰富。好消息是可以在巨大的软件库中选择你需要的东西,但是坏消息就是选择数量实在太大了。以我的经验来看,使用 [Orange Pi Zero][10] 的 512 MB 版本足矣,因为该版本很好的平衡了功能与价格,适合中学及学术环境使用。
与 Raspberry Pi 不同Raspberry Pi 家族型号比较少,不过在逐步增加,为单板计算机家族添加了几个具有不同价位及功能特色的型号,但是相对而言 Orange Pi 的型号更丰富。好消息是可以在巨大的软件库中选择你需要的东西,但是坏消息就是选择范围实在太大了。以我的经验来看,使用 [Orange Pi Zero][10] 的 512 MB 版本足矣,因为该版本很好的平衡了功能与价格,适合中学及学术环境使用。
可以到 [Orange Pi Zero 网站][11] ,查看高清图及所有规格。
很明确的问题是,我希望这种设备的价格越便宜越好,但是要能做到开箱即用,并且能够直接联网以便 SSH 及物联网应用能正常使用。Orange Pi Zero 拥有板载的10/100 M 以太网及 802.11 b/g/n Wi-Fi 模块可以连接网络以满足需求。它还有 26 个与 Raspberry Pi 兼容的 [GPIO 端口][12],用于连接物联网应用传感器。我使用的是 512 MB 版本的 Orange Pi Zero 而不是 256MB 版本,因为内存大带来的好处很多,并且这两个版本只相差了 2 美元。除此之外,运费还需要 $12.30,这笔花费对于那些鼓励积极实验及创造魔法烟雾的课堂特别划算。(LCTT 译注:“创造魔法烟雾”是幽默的说法,意即因未知原因设备停止工作,原多用于电气工程师和技术员,最近常被程序员们采用)。
与 $5 的 [Raspberry Pi Zero][14] 相比Orange Pi Zero 只贵了几元钱,但是这个开箱后更容易上手使用,因为它拥有板载的 Internet 连接模块及 4 核 CPU而不是单核。这个板载网口使得 Orange Pi Zero 比 Raspberry Pi Zero 更容易使用,因为 Raspberry Pi Zero 还需要一个 Micro-USB-to-USB 转换器及一个 USB Wi-Fi 才能连上网。当赠送别人一个物联网设备作为礼物时,你当然希望对方能够尽快且容易的使用该产品,而不是送一个不完整的产品,那么这个礼物就只能躺在阁楼吃灰了。
与 $5 的 [Raspberry Pi Zero][14] 相比Orange Pi Zero 只贵了几元钱,但是这个开箱后更容易上手使用,因为它拥有板载的 Internet 连接模块及 4 核 CPU而不是单核。这个板载网口使得 Orange Pi Zero 比 Raspberry Pi Zero 更容易使用,因为 Raspberry Pi Zero 还需要一个 Micro-USB 转 USB 的转换器及一个 USB Wi-Fi 才能连上网。当赠送别人一个物联网设备作为礼物时,你当然希望对方能够尽快且容易的使用该产品,而不是送一个不完整的产品,那么这个礼物就只能躺在阁楼吃灰了。
### 开箱经验
@ -32,7 +31,7 @@ Orange Pi 是由 Linux 驱动的单板计算机家族的一员,由[深圳迅
*SSH 登录进 Orange Pi Zero*
通过以太网 SSH 连上后,我可以使用 [nmtui-connect][18] 轻松连上我的无线接入点。然后执行 **apt-get update && apt-get upgrade** 命令,这个命令执行速度比 Raspberry Pi Zero 快,基本接近 [Raspberry Pi 3][19] 的表现了,其他人也[观察到类似的结果][20]。虽然 Orange Pi Zero 执行速度可能比不过Raspberry Pi 3但是我也没有打算用它来计算基因排序或者挖比特币矿。Armbian 会自动调整 root 分区来使用整个 microSD 卡空间,而使用 Raspbian 的时候这是手动且很容易忘记的步骤。最后,和价值 $35 的 Raspberry Pi 3 相比,购买 $12 的 Orange Pi Zero 可以使得三倍多的学生有自己的学习工具,也可以将 Orange Pi Zero 作为礼物分享给三倍数量的朋友。
通过以太网 SSH 连上后,我可以使用 [nmtui-connect][18] 轻松连上我的无线接入点。然后执行 `apt-get update && apt-get upgrade` 命令,这个命令执行速度比 Raspberry Pi Zero 快,基本接近 [Raspberry Pi 3][19] 的表现了,其他人也[观察到类似的结果][20]。虽然 Orange Pi Zero 执行速度可能比不过Raspberry Pi 3但是我也没有打算用它来计算基因排序或者挖比特币矿。Armbian 会自动调整 root 分区来使用整个 microSD 卡空间,而使用 Raspbian 的时候这是手动且很容易忘记的步骤。最后,和价值 $35 的 Raspberry Pi 3 相比,购买 $12 的 Orange Pi Zero 可以使得三倍多的学生有自己的学习工具,也可以将 Orange Pi Zero 作为礼物分享给三倍数量的朋友。
![Orange Pi Form Factor](https://opensource.com/sites/default/files/the_orange_pi_zero_form_factor.jpg "Orange Pi Form Factor")

View File

@ -0,0 +1,172 @@
如何定制 SSH 来简化远程访问
===================
SSH (指 SSH 客户端)是一个用于访问远程主机的程序,它使得用户能够 [在远程主机上执行命令][2]。这是在登录远程主机中的最受推崇的方法之一,因为其设计目的就是在非安全网络环境上为两台非受信主机的通信提供安全加密。
SSH 使用系统全局以及用户指定(用户自定义)的配置文件。在本文中,我们将介绍如何创建一个自定义的 ssh 配置文件,并且通过特定的选项来连接到远程主机。
### 先决条件:
1. 你必须 [在你的桌面 Linux 上安装好 OpenSSH 客户端][1]。
2. 了解通过 ssh 进行远程连接的常用选项。
### SSH 客户端配置文件
以下为 ssh 客户端配置文件:
1. `/etc/ssh/ssh_config` 为默认的配置文件,属于系统全局配置文件,包含应用到所有用户的 ssh 客户端的设置。
2. `~/.ssh/config` 或者 `$HOME/.ssh/config` 为用户指定/自定义配置文件,这个文件中的配置只对指定的用户有效,因此,它会覆盖掉默认的系统全局配置文件中的设置。这也是我们要创建和使用的文件。
默认情况下,用户是通过在 ssh 中输入密码来获取验证的,你可以以一个简单的步骤来 [使用 Keygen 来设置 ssh 无密码登录][3]。
注:如果你的系统上不存在 `~/.ssh` 目录,那就手动创建它,并设置如下权限:
```
$ mkdir -p ~/.ssh
$ chmod 0700 ~/.ssh
```
以上的 `chmod` 命令表明,只有目录属主对该目录有读取、写入和执行权限,这也是 ssh 所要求的设置。
### 如何创建用户指定的 SSH 配置文件
该文件并不会被默认创建的,所以你需要使用具有读取/写入权限的用户来创建它。
```
$ touch ~/.ssh/config
$ chmod 0700 ~/.ssh/config
```
上述文件包含由特定主机定义的各个部分,并且每个部分只应用到主机定义中相匹配的部分。
`~/.ssh/config` 文件的常见格式如下,其中所有的空行和以 `#` 开头的行为注释:
```
Host host1
ssh_option1=value1
ssh_option2=value1 value2
ssh_option3=value1
Host host2
ssh_option1=value1
ssh_option2=value1 value2
Host *
ssh_option1=value1
ssh_option2=value1 value2
```
如上格式详解:
1. `Host host1` 为关于 host1 的头部定义,主机相关的设置就从此处开始,直到下一个头部定义 `Host host2` 出现,这样形成一个完整的定义。
2. host1 和 host2 是在命令行中使用的主机别名,并非实际的远程主机名。
3. 其中,如 ssh_option1=value1、ssh_option2=value1 value2 等配置选项将应用到相匹配的主机,可以缩进以看起来更整齐些。
4. 对于 ssh_option2=value1 value2 这样的选项ssh 执行时会按照顺序优先使用 value1 的值。
5. 头部定义 `Host *` (其中 `*` 为匹配模式/通配符,匹配零个或多个字符) 会匹配零个或者多个主机。
仍旧以上述的格式为例ssh 也是也这样的形式类读取配置文件的。如果你执行 ssh 命令来访问远程主机 host1如下
```
$ ssh host1
```
以上 ssh 命令会进行一下动作:
1. 匹配配置文件中主机别名 host1并使用头部定义中的各个设置项。
2. 继续匹配下一个主机定义,然后发现命令行中提供的主机名没有匹配的了,所以接下来的各个设置项会被略过。
3. 最后执行到最后一个主机定义 `Host *` 这会匹配所有的主机。这里,会将接下来的所有设置选项应用到所有的主机连接中。但是它不会覆写之前已经有主机定义的那些选项。
4. ssh host2 与此类似。
### 如何使用用户指定的 shh 配置文件
在你理解了 ssh 客户端配置文件的工作方式之后,你可以通过如下方式来创建它。记得使用你的服务器环境中对应的选项、值 (主机别名、端口号、用户名等)。
通过你最喜欢的编辑器来打开配置文件:
```
$ vi ~/.ssh/config
```
并定义必要的部分:
```
Host fedora25
HostName 192.168.56.15
Port 22
ForwardX11 no
Host centos7
HostName 192.168.56.10
Port 22
ForwardX11 no
Host ubuntu
HostName 192.168.56.5
Port 2222
ForwardX11 yes
Host *
User tecmint
IdentityFile ~/.ssh/id_rsa
Protocol 2
Compression yes
ServerAliveInterval 60
ServerAliveCountMax 20
LogLevel INFO
```
以上 ssh 配置文件的详细解释:
1. `HostName` - 定义真正要登录的主机名,此外,你也可以使用数字 IP 地址,不管是在命令行或是 HostName 定义中都允许使用其中任一种。
2. `User`  指定以哪一个用户来登录。
3. `Port`  设置连接远程主机的端口,默认是 22 端口。但必须是远程主机的 sshd 配置文件中定义的端口号。
4. `Protocol`  这个选项定义了优先使用 ssh 支持的协议版本。常用的值为 1  2同时使用两个协议版本则必须使用英文逗号隔开。
5. `IdentityFile`  指定一个用于读取用户 DSA、Ed25519、ECDSA 等授权验证信息的文件。
6. `ForwardX11`  定义 X11 连接是否自动重定向到安全通道和 DISPLAY 设置。有两个可以设置的值,即 `yes` 或 `no`
7. `Compression`  默认值为 `no`,如果设置为 `yes`,则在连接远程主机过程中使用压缩进行传输。
8. `ServerAliveInterval`  设置当没有收到服务器响应 (或者数据)时的超时时间单位为秒ssh 会通过加密信道发送信息,请求服务器响应。默认值为 `0`,这意味着 ssh 不会向服务器发送响应请求;如果定义了 BatchMode 选项,则默认是 300 秒。
9. `ServerAliveCountMax`  设置服务器在没有接收到服务器的任何响应时,由服务器发送的活动信息数量。
10. `LogLevel`  定义 ssh 登录信息的的日志冗余级别。允许的值为:`QUIET`、`FATAL`、`ERROR`、`INFO`、`VERBOSE`、`DEBUG`、`DEBUG1`、`DEBUG2` 和 `DEBUG3`,默认为 `INFO`
连接任意远程主机的标准方法是在上述两个文件中定义第二个部分(我连接的是 CentOS 7。一般情况下我们这样输入命令
```
$ ssh -i ~/.ssh/id_rsa -p 22 tecmint@192.168.56.10
```
然而,使用了 ssh 客户端配置文件之后,我们还可以这样:
```
$ ssh centos7
```
你也可以在 man 帮助页面寻找更多的设置选项和使用实例:
```
$man ssh_config
```
至此,文毕。我们在文中向你介绍了在 Linux 中如何使用用户指定 (自定义) 的 ssh 客户端配置文件。通过下方的反馈表单来写一些与本文的相关的想法吧。
------------------------------------------------
作者简介:
Aaron Kili 是一名 Linux 和 F.O.S.S 忠实拥护者、高级 Linux 系统管理员、Web 开发者,目前在 TecMint 是一名活跃的博主,热衷于计算机并有着强烈的只是分享意愿。
-------------------------------------------------
译者简介:
[GHLandy](http://GHLandy.com) —— 生活中所有欢乐与苦闷都应藏在心中,有些事儿注定无人知晓,自己也无从说起。
-------------------------------------------------
via: http://www.tecmint.com/configure-custom-ssh-connection-in-linux/
作者:[Aaron Kili][a]
译者:[GHLandy](https://github.com/GHLandy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/install-openssh-server-in-linux/
[2]:http://www.tecmint.com/execute-commands-on-multiple-linux-servers-using-pssh/
[3]:http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/

View File

@ -1,13 +1,13 @@
如何编写和使用自定义的 Shell 函数和函数库
============================================================
在 Linux 系统下Shell 脚本在各种不同的情形下给予我们帮助,例如展示信息,甚至 [自动执行特定的系统管理任务][1],创建简单的命令行工具等等。
在 Linux 系统下Shell 脚本可以在各种不同的情形下帮到我们,例如展示信息,甚至 [自动执行特定的系统管理任务][1],创建简单的命令行工具等等。
在本指南中,我们将向 Linux 新手展示如何可靠地存储自定义的 shell 脚本,解释如何编写 shell 函数和函数库,以及如何在其它的脚本中使用函数库中的函数。
### Shell 脚本要存储在何处
为了在执行你自己的脚本时不必输入脚本所在位置的完整或绝对路径,脚本必须被存储在 `$PATH`环境变量所定义的路径里的其中一个。
为了在执行你自己的脚本时不必输入脚本所在位置的完整或绝对路径,脚本必须被存储在 `$PATH` 环境变量所定义的路径里的其中一个。
使用下面的命令可以查看你系统中的 `$PATH` 环境变量:
@ -16,7 +16,7 @@ $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
```
通常来说,如果在用户的家目录下存在名为 `bin` 的目录,你就可以将 shell 脚本存储在那个目录下,因为那个目录会自动地被包含在用户的 `$PATH` 环境变量中(译者注:在 Centos6/7 下是这样的,在 Debian8 下不是这样的,在 Ubuntu16.04 下又是这样的)。
通常来说,如果在用户的家目录下存在名为 `bin` 的目录,你就可以将 shell 脚本存储在那个目录下,因为那个目录会自动地被包含在用户的 `$PATH` 环境变量中LCTT 译注:在 Centos 6/7 下是这样的,在 Debian 8 下不是这样的,在 Ubuntu 16.04 下又是这样的)。
因此,在你的主目录下创建 `bin` 目录吧(当然这里也可以用来存储 Perl、[Awk][2] 或 Python 的脚本,或者其它程序):
@ -32,14 +32,15 @@ $ mkdir -p ~/lib/sh
### 创建你自己的 Shell 函数和函数库
一个 `shell 函数` 就是在脚本中能够完成特定任务的一组命令。它们的工作原理与其他编程语言中的过程(译可能指的是类似SQL中的存储过程之类的吧、子例程、函数类似。
一个 `shell 函数` 就是在脚本中能够完成特定任务的一组命令。它们的工作原理与其他编程语言中的过程(LCTT 译注:可能指的是类似 SQL 中的存储过程之类的吧)、子例程、函数类似。
编写一个函数的语法如下:
```
函数名() { 一系列的命令 } (校对注:在函数名前可以加上 function 关键字,但也可省略不写)
函数名() { 一系列的命令 }
```
( LCTT 校注:在函数名前可以加上 `function` 关键字,但也可省略不写)
例如,你可以像下面那样在一个脚本中写一个用来显示日期的函数:
```
@ -96,12 +97,13 @@ IFS="$oldifs" #store old internal field separator
要使用某个 `lib` 目录下的函数,首先你需要按照下面的形式 将包含该函数的函数库导入到需要执行的 shell 脚本中:
```
$ . /path/to/lib (译者注:这里的 . 和路径间应该是有空格的)
$ . /path/to/lib
$ source /path/to/lib
```
LCTT 译注:第一行的 `.` 和路径间**必须**是有空格的)
这样你就可以像下面演示的那样,在其它的脚本中使用来自 `~/lib/sh/libMYFUNCS.sh``printUSERDETS` 函数。
这样你就可以像下面演示的那样,在其它的脚本中使用来自 `~/lib/sh/libMYFUNCS.sh``printUSERDETS` 函数
在下面的脚本中,如果要打印出某个特定用户的详细信息,你不必再一一编写代码,而只需要简单地调用已存在的函数即可。
@ -123,15 +125,16 @@ exit 0
$ chmod 755 test.sh
$ ./test.sh
```
[
![Write Shell Functions](http://www.tecmint.com/wp-content/uploads/2017/02/Write-Shell-Functions.png)
][3]
编写 shell 函数
*编写 shell 函数*
在本文中,我们介绍了在哪里可靠地存储 shell 脚本,如何编写自己的 shell 函数和函数库,以及如何在一个普通的 shell 脚本中从函数库中调用库中的某些函数。
在之后,我们还会介绍一种相当简单直接的方式来将 Vim 配置为一个编写 Bash 脚本的 IDE集成开发环境。在那之前记得要经常关注 TecMint ,如果能和我们分享你对这份指南的想法就更好了。
在之后,我们还会介绍一种相当简单直接的方式来将 Vim 配置为一个编写 Bash 脚本的 IDE集成开发环境。在那之前记得要经常关注我们 ,如果能和我们分享你对这份指南的想法就更好了。
--------------------------------------------------------------------------------

View File

@ -0,0 +1,75 @@
5 款值得尝试的 Linux 音乐播放器
============================================================
![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/02/linux-music-players.jpg "5 Linux Music Players You Should Consider Switching Tos")
目前 Linux 上有几十个音乐播放器,这使得找到一个最好用的变成很困难。之前我们已经回顾了其中的一些播放器,如 [Cantata][10][Exaile][11],甚至不那么出名的 ClementineNightingale 和 Quod Libet。
在本篇文章中我将涵盖更多的 Linux 音乐播放器,在某些方面甚至比之前介绍过的那些播放器表现更好。
### 1、 Qmmp
[Qmmp][13] 并不是特性最丰富的(或最稳定的) Linux 音乐播放器,但却是我最喜欢的一款,这也是为什么我把它放在第一个。我知道有更好的播放器,但我就是喜欢这款并且最常使用它。它确实会崩溃,并且也有许多它不能播放的文件,但不管怎样我依然最爱它。上图!
![linux-players-01-qmmp](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/02/Linux-players-01-Qmmp.jpg "linux-players-01-qmmp")
Qmmp 是 Linux 上的 WinAMP。它相对轻量并且具有一个像样的特性集。因为 WinAMP 伴随着我的成长,并且我很喜欢它的键盘快捷键,当在 Linux 上有一个像 WinAMP 的播放器对我来说是个惊喜。对于音频格式Qmmp 能够播放大部分流行的格式,如 MPEG1 layer 2/3、Ogg Vorbis 和 Opus、原生的 FLAC/Ogg FLAC、Musepack、WavePack、音轨模块mod、s3m、it、xm 等等、ADTS AAC、CD 音频、WMA、Monkeys Audio以及 FFmpeg 库提供的其他格式、Midi、SID 和 Chiptune 格式AY、GBS、GYM、HES、KSS、NSF、NSFE、SAP、SPC、VGM、VGZ 和 VTX
### 2、 Amarok
[Amarok][14] 是 KDE 的音乐播放器,当然你也可以把它用在其他的桌面环境。它是 Linux 上最古老的音乐播放器之一。这也许是它很流行的原因,虽然我个人并不是非常喜欢它。
![linux-players-02-amarok](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/02/Linux-players-02-Amarok.jpg "linux-players-02-amarok")
Amarok 能播放大量的音频格式但它的主要优势是丰富的插件。这个软件附带大量文档不过它最近没有更新。Amarok 也由于与各种 Web 服务,如 Ampache、Jamendo Service、Last.fm、Librivox、MP3tunes、Magnatune 以及 OPML 播客目录的整合而闻名。
### 3、 Rhythmbox
既然我刚刚提到了 Amarok 和 KDE 音乐播放器,那接下来让我们转向 Gnome 的默认音乐播放器, [Rhythmbox][15] 。因为它与 Gnome 一起提供,所以你能猜到它是一款流行的软件。它不仅是一款音乐播放器,同时也是一款音乐管理软件。它支持 MP3 和 OGG以及十几种其他的文件格式也包括网络收音机、iPod 服务整合、音频文件播放、音频 CD 刻录和回放、音乐分享以及播客。总而言之,它是款不赖的播放器,但这不意味着你会最喜欢它。试用一下,看看自己是否喜欢。如果不喜欢,就往下看看吧。
![linux-players-03-rhythmbox](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/02/Linux-players-03-Rhythmbox.jpg "linux-players-03-rhythmbox")
### 4、 VLC
虽然 [VLC][16] 是以视频播放器而闻名但单从它支持最多的解码器这一点来看它也是一款非常棒的音乐播放器。它无法播放的文件你也不太可能能用其他播放器打开。VLC 具有高度定制性,并且拥有很多扩展。它能够在 WindowsLinuxMac OS XUnixiOSAndroid 等等平台运行。
![linux-players-04-vlc](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/02/Linux-players-04-VLC.jpg "linux-players-04-vlc")
我个人不喜欢 VLC 的一点是它占用太多资源。并且我曾用它打开过一些文件,但回放质量离一流水准还差的很远。这个软件在播放一些其他播放器不难应付的文件时,经常会无故关闭。但很可能与播放器没多大关系,可能是文件本身的问题。尽管 VLC 不属于我常用的程序,我仍然由衷的推荐它。
### 5、 Cmus
如果你钟爱命令行程序,那么 [Cmus][17] 会是你的菜。你能用它来播放 Ogg Vorbis、MP3、FLAC、Opus、Musepack、WavPack、WAV、AAC、MP4、音频 CD 以及 ffmpeg 支持的所有格式WMA、APE、MKA、TTA、SHN 等等)和 libmodplug。你也可以用它来播放 Shoutcast 或者 Icecast 的音频流。它不是特性最丰富的音乐播放器,但它拥有所有的基础及进阶功能。它的主要优势是非常轻量,并且它的内存需求真的很小。
![linux-players-05-cmus](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/02/Linux-players-05-Cmus.jpg "linux-players-05-cmus")
所有的这些音乐播放器都很棒,都有擅长的方面。我没办法说出哪一款是最好的,这更多取决于个人喜好和需要。这些播放器大多要么做为发行版的默认选项安装,要么可以在包管理器中轻松找到。只要打开新立得、软件中心或你的发行版中使用的任意包管理器,搜索并安装它们。你也可以使用命令行,或只要双击从网站上下载的安装文件。使用何种方法取决于你。
--------------------------------------------------------------------------------
via: https://www.maketecheasier.com/linux-music-players-to-check-out/
作者:[Ada Ivanova][a]
译者:[cycoe](https://github.com/cycoe)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.maketecheasier.com/author/adaivanoff/
[1]:https://www.maketecheasier.com/author/adaivanoff/
[2]:https://www.maketecheasier.com/linux-music-players-to-check-out/#comments
[3]:https://www.maketecheasier.com/category/linux-tips/
[4]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Flinux-music-players-to-check-out%2F
[5]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Flinux-music-players-to-check-out%2F&text=5+Linux+Music+Players+You+Should+Consider+Switching+To
[6]:mailto:?subject=5%20Linux%20Music%20Players%20You%20Should%20Consider%20Switching%20To&body=https%3A%2F%2Fwww.maketecheasier.com%2Flinux-music-players-to-check-out%2F
[7]:https://www.maketecheasier.com/mastering-disk-utility-mac/
[8]:https://www.maketecheasier.com/airy-youtube-video-downloader/
[9]:https://support.google.com/adsense/troubleshooter/1631343
[10]:https://www.maketecheasier.com/cantata-new-music-player-for-linux/
[11]:https://www.maketecheasier.com/exaile-the-first-media-player-i-dont-hate/
[12]:https://www.maketecheasier.com/the-lesser-known-music-players-for-linux/
[13]:http://qmmp.ylsoftware.com/
[14]:https://amarok.kde.org/
[15]:https://wiki.gnome.org/Apps/Rhythmbox
[16]:http://www.videolan.org/vlc/
[17]:https://cmus.github.io/

View File

@ -1,11 +1,11 @@
# [Best Windows Like Linux Distributions For New Linux Users][12]
[给新手的最佳类 Windows 界面的 Linux 发行版][12]
给新手的最佳类 Windows 界面的 Linux 发行版
=========
[
![Best Windows Like Linux Distributions](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/best-windows-like-linux-distributions_1_orig.jpg)
][5]
Linux 世界的新同学们,大家好,当你看到这么多基于 Linux 内核的发行版后,是不是在选择的过程中无从下手呢。很多同学都是刚刚从熟悉的 Windows 系统来到陌生的 Linux 世界里,都希望使用一款简单易用,又跟 Windows 长得很像的 Linux 发行版,因此我今天将给大家介绍几款这样的 Linux 发行版,它们的桌面环境跟 Windows 系统界面十分相似,咱们开始吧!
Linux 世界的新同学们,大家好,当你看到这么多基于 Linux 内核的发行版后,是不是在选择的过程中无从下手呢。很多同学都是刚刚从熟悉的 Windows 系统来到陌生的 Linux 世界里,都希望使用一款简单易用,又跟 Windows 长得很像的 Linux 发行版,因此我今天将给大家介绍几款这样的 Linux 发行版,它们的桌面环境跟 Windows 系统界面十分相似,咱们开始吧!
### Linux Mint
@ -13,7 +13,9 @@ Linux 世界的新同学们,大家好,当你看到这么多基于 Linux 内
![linux mint for new linux users](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/published/linux-mint-for-new-linux-users.jpg?1487173522)
][6]
我给大家介绍的第一款非常流行的 Linux 发行版就是 “[Linux Mint 操作系统”][14] 。当你决定使用 Linux 系统来代替 Windows 系统时,你应该在某些地方听说过 Linux Mint 这个发行版吧。 Linux Mint 和 Ubuntu 系统一样被公认为是最好用的 Linux 发行版之一 Linux Mint 系统因其简洁易用、功能强大的 Cinnamon 桌面环境而出名。 [Cinnamon][15] 使用起来非常简单,而且你还可以使用各种[桌面主题][16]、图标库、桌面小工具和应用组件来把 Linux Mint 系统配置得跟 Windows XP 、 Windows 7 、 Winows 8 或者 Windows 10 系统的界面一样。 [Cinnamon][17] 也是 Linux 系统中非常流行的桌面环境之一。你一定会对这个简单易用、功能强大的桌面环境爱不释手。同时你也可以阅读这两篇文章 [Linux Mint 18.1 "Serena" —— 最幽雅的 Linux 发行版之一​][1] 以及 [Cinnamon ——给新手的最佳 Linux 桌面环境][2] 来进一步了解 Linux Mint 操作系统和 Cinnamon 桌面环境。
我给大家介绍的第一款非常流行的 Linux 发行版就是 “[Linux Mint 操作系统”][14] 。当你决定使用 Linux 系统来代替 Windows 系统时,你应该在某些地方听说过 Linux Mint 这个发行版吧。 Linux Mint 和 Ubuntu 系统一样被公认为是最好用的 Linux 发行版之一, Linux Mint 系统因其简洁易用、功能强大的 Cinnamon 桌面环境而出名。 [Cinnamon][15] 使用起来非常简单,而且你还可以使用各种[桌面主题][16]、图标库、桌面小工具和应用组件来把 Linux Mint 系统配置得跟 Windows XP 、 Windows 7 、 Winows 8 或者 Windows 10 系统的界面一样。 [Cinnamon][17] 也是 Linux 系统中非常流行的桌面环境之一。你一定会对这个简单易用、功能强大的桌面环境爱不释手。
同时,你也可以阅读这两篇文章 [Linux Mint 18.1 "Serena" —— 最幽雅的 Linux 发行版之一​][1] 以及 [Cinnamon ——给新手的最佳 Linux 桌面环境][2] 来进一步了解 Linux Mint 操作系统和 Cinnamon 桌面环境。
### Zorin OS
@ -21,7 +23,9 @@ Linux 世界的新同学们,大家好,当你看到这么多基于 Linux 内
![zorin os for windows users](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/editor/zorin-os-for-windows-users.jpg?1487174149)
][7]
[Zorin OS 操作系统][18] 也是可以用来替代 Windows 7\ 系统的一款非常流行的 Linux 发行版。其开始菜单和任务栏非常漂亮,整体界面美观充满活力,而且在速度和稳定性方面也相当出色。如果你喜欢的是 Windows 7 而不是 Windows 10\ 系统,那么 Zorin OS 将会是你最好的选择。 Zorin OS 同样预安装了很多软件,因此你再也不用费尽周折的去找软件来安装了。其华丽的仿 Windows 7 系统的界面风格更是让人一见如故。大胆去尝试吧。你还可以阅读[Zorin OS 12 评测 | 本周 Linux 和 Ubuntu 发行版评测][3]这篇文章来进一步了解 Zorin OS 系统。
[Zorin OS 操作系统][18] 也是可以用来替代 Windows 7 系统的一款非常流行的 Linux 发行版。其开始菜单和任务栏非常漂亮,整体界面美观充满活力,而且在速度和稳定性方面也相当出色。如果你喜欢的是 Windows 7 而不是 Windows 10 系统,那么 Zorin OS 将会是你最好的选择。 Zorin OS 同样预安装了很多软件,因此你再也不用费尽周折的去找软件来安装了。其华丽的仿 Windows 7 系统的界面风格更是让人一见如故。大胆去尝试吧。
你还可以阅读[Zorin OS 12 评测 | 本周 Linux 和 Ubuntu 发行版评测][3]这篇文章来进一步了解 Zorin OS 系统。
### Robolinux
@ -29,7 +33,7 @@ Linux 世界的新同学们,大家好,当你看到这么多基于 Linux 内
![robolinux for new users](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/editor/robolinux-for-new-users.jpg?1487174455)
][8]
[Robolinux 操作系统][9] 是一个内嵌了 Windows 运行环境的 Linux 发行版。它支持用户在 Linux 系统中运行 Windows 应用程序,因此,你再也不用担心自己喜欢的 Windows 应用程序在 Linux 系统中无法使用的问题了。在 Robolinux 系统中,这个特性被称为“[隐形虚拟机][10]”。我对这个新颖独特的功能非常感兴趣。同时, Rololinux 系统还包括其它几个桌面环境,你可以根据自己的喜好选择某一个桌面环境。这个系统中还有一个用于完全备份 C 盘的工具,不会让你丢失任何文件。很独特吧,对不对?
[Robolinux 操作系统][9] 是一个内嵌了 Windows 运行环境Wine的 Linux 发行版。它支持用户在 Linux 系统中运行 Windows 应用程序,因此,你再也不用担心自己喜欢的 Windows 应用程序在 Linux 系统中无法使用的问题了。在 Robolinux 系统中,这个特性被称为“[隐形虚拟机Stealth VM][10]”。我对这个新颖独特的功能非常感兴趣。同时, Rololinux 系统还包括其它几个桌面环境,你可以根据自己的喜好选择某一个桌面环境。这个系统中还有一个用于完全备份 C 盘的工具,不会让你丢失任何文件。很独特吧,对不对?
### ChaletOS
@ -37,13 +41,14 @@ Linux 世界的新同学们,大家好,当你看到这么多基于 Linux 内
![chalet os for new users](http://www.linuxandubuntu.com/uploads/2/1/1/5/21152474/editor/chalet-os-for-new-users.jpg?1487174713)
][11]
大家有谁用过 [ChaletOS 操作系统][19] 吗?这是一款在界面外观和使用感觉上最接近于 Windows 的 [Linux 发行版][20] 之一。上面的截图是在我使用了 Windows 10 图标和主题包后的效果,使用这个主题包后,可以让 ChaletOS 的桌面变得和 Windows 10 界面一样。一些预安装的应用程序也可以帮助你更好的使用 ChaletOS 系统。在使用的过程中你仿佛又回到了熟悉的 Windows 世界里。上面的截图竟然让我的朋友们信以为真了。去试一试吧,你肯定会喜欢这个发行版。你还可以通过 [ChaletOS —— Linux 发行版中的新秀][4] 这篇文章来进一步了解 ChaletOS 系统。
大家有谁用过 [ChaletOS 操作系统][19] 吗?这是一款在界面外观和使用感觉上最接近于 Windows 的 [Linux 发行版][20] 之一。上面的截图是在我使用了 Windows 10 图标和主题包后的效果,使用这个主题包后,可以让 ChaletOS 的桌面变得和 Windows 10 界面一样。一些预安装的应用程序也可以帮助你更好的使用 ChaletOS 系统。在使用的过程中你仿佛又回到了熟悉的 Windows 世界里。上面的截图竟然让我的朋友们信以为真了。去试一试吧,你肯定会喜欢这个发行版。
你还可以通过 [ChaletOS —— Linux 发行版中的新秀][4] 这篇文章来进一步了解 ChaletOS 系统。
### 总结
这篇文章中列出的发行版我尽量写得简短一些,否则会给新手们在选择的过程中造成太多的困惑,无从下手。还有一些大家正在使用的 Linux 发行版在本文中并未提及。希望你们在下面的评论中提出来,以帮助我们的新朋友们在选择 Linux 发行版的过程中作出正确的选择。
好吧,到此为止吧,这 4 款操作系统都是从 Windows 转向 Linux 的新用户在学习过程中使用最广泛的 **Linux 发行版** ,当然 Kubuntu 和 Elementary OS 系统也不甘示弱。想安装哪个版本,完全由你自己决定。大多数情况下 [Linux Mint 操作系统][21] 一直独占鳌头。如果你刚踏入 Linux 的世界,我建议你从 Linux Mint 系统开始。行动起来吧,现在就安装一个自己喜欢的 Linux 系统,勇往直前,成为改变 Linux 开源世界的一员。|
--------------------------------------------------------------------------------
@ -52,7 +57,7 @@ via: http://www.linuxandubuntu.com/home/best-windows-like-linux-distributions-fo
作者:[linuxandubuntu.com][a]
译者:[rusking](https://github.com/rusking)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,52 +1,46 @@
如何修改 Linux 启动 Splash 背景
如何修改 Linux 的 GRUB 启动背景
====================
### 本文导航
**何为 GRUB 背景( Splash **
1. [开始前需要哪些准备工作][1]
2. [使用 GUI 修改 Grub 的 Splash 背景][2]
3. [使用命令行修改 Grub 的 Splash 背景][3]
GRUB 背景( Splash )只不过是一张图像,在 Linux 系统启动的时候显示为背景。你可能知道 Grub (**GR**and **U**nified **B**ootloader 的简写) 是主流 Linux 发行版中广泛使用的启动装载程序 (bootloader)。以 RedHat 为例,你会发现它在系统启动之时显示为空白或者是一个黑色背景。
**何为 Splash 背景?**
Splash 只不过是一张图像,在 Linux 系统启动的时候显示为背景。你可能知道 Grub (**GR**and **U**nified **B**ootloader 的简写) 是主流 Linux 发行版中广泛使用的启动装载程序 (bootloader)。以 RedHat 为例,你会发现它在系统启动之时显示为空白或者是一个黑色背景。
Splash 背景的相关定义在 grub.conf 文件中,并且 splash 背景图像应该存储在 /boot 分区中。如果说你觉得默认的空白屏相当无趣,同时又想按照自己的意愿来修改它,那么赶紧阅读下方的每个步骤吧。
GRUB 背景( Splash )的相关定义在 `grub.conf` 文件中,并且 splash 背景图像应该存储在 `/boot` 分区中。如果你觉得默认的空白屏相当无趣,同时又想按照自己的意愿来修改它,那么赶紧阅读下方的每个步骤吧。
### 开始前需要哪些准备工作
1. ImageMagick (仅在命令行中使用) 或者 GIMP (GUI 中使用)
2. 一样例图像
2. 一样例图像
### 使用 GUI 修改 Grub 的 Splash 背景
首先然我们来使用 GUI 来进行操作吧,这里我们使用 GIMP 来作为图像编辑器。
**步骤 1**. 使用 GIMP 打开图像 (路径为_应用 (Applications)_ --> _图像 (Graphics)_ --> _GIMP 程序 (GNU Image Manipulation Program)_)
**步骤 1** 使用 GIMP 打开图像 (路径为_应用 (Applications)_ --> _图像 (Graphics)_ --> _GIMP 程序 (GNU Image Manipulation Program)_)
**步骤 2**. 现在我们需要按实际情况将图像缩放到 640x480 大小。为此,需要点击 _图像 (Image)_ --> _缩放图像 (Scale Image)_。记住,要如下图参数进行设置。修改宽度为 640高度为 480。其他保持不变。
**步骤 2** 现在我们需要按实际情况将图像缩放到 640x480 大小。为此,需要点击 _图像 (Image)_ --> _缩放图像 (Scale Image)_。记住,要如下图参数进行设置。修改宽度为 640高度为 480。其他保持不变。
[![缩放 image](https://www.howtoforge.com/images/how_to_change_the_linux_splash_screen/scale.JPG)][4]
点击 **缩放 (Scale)** 按钮
**步骤 3**. 然后,我们需要索引图像,让它仅使用 14 色。为此,点击 _图像 (Image)_ --> 模式 (Mode) --> 索引 (Indexed)。点选 "生成最优调色板 (generate optimum palette)" 选项,并设置颜色最大值 (maximum number of colors) 为 14 (如下)。
**步骤 3** 然后,我们需要索引图像,让它仅使用 14 色。为此,点击 _图像 (Image)_ --> 模式 (Mode) --> 索引 (Indexed)。点选 "生成最优调色板 (generate optimum palette)" 选项,并设置颜色最大值 (maximum number of colors) 为 14 (如下)。
[![最优调色板限制为 14 色](https://www.howtoforge.com/images/how_to_change_the_linux_splash_screen/index.JPG)][5] 
点击 _转换 (convert)_ 按钮
**步骤 4** 保存文件。这里以文件名为 "UxTechno.xpm" 来保存。
**步骤 4** 保存文件。这里以文件名为 "UxTechno.xpm" 来保存。
[![保存图像文件](https://www.howtoforge.com/images/how_to_change_the_linux_splash_screen/save.JPG)][6]
**步骤 5**. 以 Zip 压缩文件。为此,转到文件的保存位置 --> 右击并选择 "压缩 (Compress)" 选项,选择 "gzip" 方法来压缩。
**步骤 5**、 以 Zip 方式压缩文件。为此,转到文件的保存位置 --> 右击并选择 "压缩 (Compress)" 选项,选择 "gzip" 方法来压缩。
[![](https://www.howtoforge.com/images/how_to_change_the_linux_splash_screen/compress.JPG)][7]
**步骤 6**. 现在复制或移动 "UxTechno.xpm.gz" 到 /boot/grub/UxTechno.xpm.gz。
**步骤 6** 现在复制或移动 "UxTechno.xpm.gz" 到 `/boot/grub/UxTechno.xpm.gz`
**步骤 7**. 这一步,打开 /boot/grub/grub.conf 文件编辑 splashimage 参数如下,并保存文件。
**步骤 7**、 这一步,打开 `/boot/grub/grub.conf` 文件编辑 `splashimage` 参数如下,并保存文件。
最后,文件的内容应该是像这样的:
@ -76,9 +70,7 @@ generated by anaconda
如果说你是命令行的超级粉丝,那就使用如下方法吧。
**步骤 1**
开始之前,我们需要修改图像的像素分辨率。为此,我们还需要在 Linux 系统上安装好 ImageMagick。在 CentOS / RHEL 上使用如下命令来进行交叉检查。
**步骤 1**、 开始之前,我们需要修改图像的像素分辨率。为此,我们还需要在 Linux 系统上安装好 ImageMagick。在 CentOS / RHEL 上使用如下命令来进行交叉检查。
```
# rpm -qa|grep -i ImageMagick
@ -90,7 +82,7 @@ generated by anaconda
# yum install ImageMagick
```
安装好了重新复核,你会得到类似如下的输出:
安装好了重新复核一下,你会得到类似如下的输出:
```
# rpm -qa|grep -i ImageMagick
@ -100,7 +92,7 @@ ImageMagick-6.5.4.7-5.el6.x86_64
然后,继续接下来的配置。这里我使用 UxTechno 的 logo 来做 splash 背景图像。
**步骤 2** 使用如下命令来转换像素深度
**步骤 2** 使用如下命令来转换像素深度
```
# convert -depth 8 -colors 14 -resize 640x480 uxtechno_logo.jpg uxtechno_logo.xpm
@ -112,25 +104,25 @@ ImageMagick-6.5.4.7-5.el6.x86_64
2. 分辨率为 640x480
3. 使用 xpm 格式
**步骤 3** 以 Zip 压缩文件
**步骤 3** 以 Zip 压缩文件
```
# gzip uxtechno_logo.xpm
```
**步骤 4** 复制文件到 /boot 分区
**步骤 4** 复制文件到 `/boot` 分区
```
# cp uxtechno_logo.xpm.gz /boot/grub/
```
**步骤 5** 在 /boot/grub/grub.conf 文件中修改 splashimage 参数如下,并保存文件。
**步骤 5**`/boot/grub/grub.conf` 文件中修改 `splashimage` 参数如下,并保存文件。
```
splashimage=(hd0,0)/grub/uxtechno_logo.xpm
```
**步骤 6** 最后,使用 reboot 命令重启服务器。启动界面将显示使用 GUI 方式第 7 步中的图像。
**步骤 6** 最后,使用 `reboot` 命令重启服务器。启动界面将显示使用 GUI 方式第 7 步中的图像。
-------------------------------
@ -146,7 +138,7 @@ via: https://www.howtoforge.com/tutorial/how-to-change-the-linux-splash-screen/
作者:[MANMOHAN MIRKAR][a]
译者:[GHLandy](https://github.com/GHLandy)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -3,13 +3,13 @@
FTP文件传输协议是一个较老且最常用的标准网络协议用于在两台计算机之间通过网络上传/下载文件。然而, FTP 最初的时候并不安全,因为它仅通过用户凭证(用户名和密码)传输数据,没有进行加密。
警告:如果你打算使用 FTP 考虑通过 SSL/TLS将在下篇文章中讨论配置 FTP 连接。否则,使用安全 FTP比如 [SFTP][1] 会更好一些。
警告:如果你打算使用 FTP 需要考虑通过 SSL/TLS将在下篇文章中讨论配置 FTP 连接。否则,使用安全 FTP比如 [SFTP][1] 会更好一些。
**推荐阅读:**[如何在 CentOS 7 中安装并保护 FTP 服务器][2]
在这个教程中,我将向你们展示如何在 Ubuntu 中安装、配置并保护 FTP 服务器VSFTPD 的全称是 “Very Secure FTP Deamon”从而拥有强大的安全性能够防范 FTP 漏洞。
### 第一步:在 Ubuntu 中安装 VsFTP 服务器
### 第一步:在 Ubuntu 中安装 VSFTPD 服务器
1、首先我们需要更新系统安装包列表然后像下面这样安装 VSFTPD 二进制包:
@ -29,7 +29,7 @@ $ sudo apt-get install vsftpd
# chkconfig --level 35 vsftpd on
```
3、接下来如果你在服务器上启用了 [UFW 防火墙][3](默认情况下不启用),那么需要打开端口 20 和 21FTP daemons 正在监听它们,从而才能允许从远程机器访问 FTP 服务,然后,像下面这样添加新的防火墙规则:
3、接下来如果你在服务器上启用了 [UFW 防火墙][3](默认情况下不启用),那么需要打开端口 20 和 21 —— FTP 守护进程正在监听它们——从而才能允许从远程机器访问 FTP 服务,然后,像下面这样添加新的防火墙规则:
```
$ sudo ufw allow 20/tcp
@ -37,7 +37,7 @@ $ sudo ufw allow 21/tcp
$ sudo ufw status
```
### 第二步:在 Ubuntu 中配置并保护 VsFTP 服务器
### 第二步:在 Ubuntu 中配置并保护 VSFTPD 服务器
4、让我们进行一些配置来设置和保护 FTP 服务器。首先,我们像下面这样创建一个原始配置文件 `/etc/vsftpd/vsftpd.conf` 的备份文件:
@ -57,46 +57,46 @@ $ sudo nano /etc/vsftpd.conf
```
anonymous_enable=NO # 关闭匿名登录
local_enable=YES # 允许本地登录
write_enable=YES # 启用改文件系统的 FTP 命令
local_enable=YES # 允许本地用户登录
write_enable=YES # 启用可以修改文件的 FTP 命令
local_umask=022 # 本地用户创建文件的 umask 值
dirmessage_enable=YES # 启用从而当用户第一次进入新目录时显示消息
dirmessage_enable=YES # 当用户第一次进入新目录时显示提示消息
xferlog_enable=YES # 一个存有详细的上传和下载信息的日志文件
connect_from_port_20=YES # 在服务器上针对端口类型连接使用端口 20FTP 数据)
connect_from_port_20=YES # 在服务器上针对 PORT 类型的连接使用端口 20FTP 数据)
xferlog_std_format=YES # 保持标准日志文件格式
listen=NO # 阻止 vsftpd 在独立模式下运行
listen_ipv6=YES # vsftpd 将监听 ipv6 而不是 IPv4
pam_service_name=vsftpd # vsftpd 将使用的 PAM 设备的名字
userlist_enable=YES # enable vsftpd to load a list of usernames启用 vsftpd 加载用户名字列表
listen_ipv6=YES # vsftpd 将监听 ipv6 而不是 IPv4,你可以根据你的网络情况设置
pam_service_name=vsftpd # vsftpd 将使用的 PAM 验证设备的名字
userlist_enable=YES # 允许 vsftpd 加载用户名字列表
tcp_wrappers=YES # 打开 tcp 包装器
```
5、现在配置 VSFTPD 从而允许/拒绝 FTP 访问基于用户列表文件 `/etc/vsftpd.userlist` 的用户
5、现在配置 VSFTPD ,基于用户列表文件 `/etc/vsftpd.userlist` 来允许或拒绝用户访问 FTP
注意,在默认情况下,如果 `userlist_enable=YES``userlist_deny=YES` ,那么,用户列表文件 `/etc/vsftpd.userlist` 中的用户是不能登录访问的。
注意,在默认情况下,如果通过 `userlist_enable=YES` 启用了用户列表,且设置 `userlist_deny=YES`,那么,用户列表文件 `/etc/vsftpd.userlist` 中的用户是不能登录访问的。
但是,选项 ` userlist_deny =NO` 则改变了默认设置,所以只有用户名被明确列出在用户列表文件 `/ etc / vsftpd` 中的用户才允许登录到FTP服务器。
但是,选项 `userlist_deny=NO` 则反转了默认设置,这种情况下只有用户名被明确列出在 `/etc/vsftpd.userlist` 中的用户才允许登录到 FTP 服务器。
```
userlist_enable=YES # vsftpd 将会从所给的用户列表文件中加载用户名字列表
userlist_file=/etc/vsftpd.userlist # 存储用户名字
userlist_deny=NO
userlist_file=/etc/vsftpd.userlist # 存储用户名字的列表
userlist_deny=NO
```
重要的是,当用户登录 FTP 服务器以后,他们将进入 chrooted 环境,这是因为本地 root 目录将作为 FTP 会话唯一的 home 目录。
重要的是,当用户登录 FTP 服务器以后,他们将进入 chrooted 环境,即当在 FTP 会话时,其 root 目录将是其 home 目录。
接下来,我们来看一看两种可能的途径来设置 chrooted本地 root目录正如下面所展示的。
6、这时让我们添加/修改/取消这两个选项来[阻止 FTP 用户进入 home 目录][4]
6、这时让我们添加/修改/取消这两个选项来[将 FTP 用户限制在其 home 目录][4]
```
chroot_local_user=YES
allow_writeable_chroot=YES
```
选项 `chroot_local_user=YES` 意味着本地用户将进入 chroot 环境,当登录以后 root 目录成为默认的 home 目录。
选项 `chroot_local_user=YES` 意味着本地用户将进入 chroot 环境,当登录以后默认情况下是其 home 目录。
并且我们要理解默认情况下出于安全原因VSFTPD 不允许 chroot 目录具有可写权限。然而,我们可以通过选项 `allow_writeable_chroot=YES` 来改变这个设置
并且我们要知道默认情况下出于安全原因VSFTPD 不允许 chroot 目录具有可写权限。然而,我们可以通过选项 `allow_writeable_chroot=YES` 来改变这个设置
保存文件然后关闭。现在我们需要重启 VSFTPD 服务从而使上面的这些更改生效:
@ -109,15 +109,14 @@ allow_writeable_chroot=YES
### 第三步:在 Ubuntu 上测试 VsFTP 服务器
7、现在我们通过使用下面展示的[ useradd 命令][5]创建一个 FTP 用户来测试 FTP 服务器:
7、现在我们通过使用下面展示的 [useradd 命令][5]创建一个 FTP 用户来测试 FTP 服务器:
```
$ sudo useradd -m -c "Aaron Kili, Contributor" -s /bin/bash aaronkilik
$ sudo passwd aaronkilik
```
然后,我们需要像下面这样使用[ echo 命令][6]和 tee 命令来明确地列出文件 `/etc/vsftpd.userlist` 中的用户 aaronkilik
然后,我们需要像下面这样使用 [echo 命令][6]和 tee 命令来明确地列出文件 `/etc/vsftpd.userlist` 中的用户 aaronkilik
```
$ echo "aaronkilik" | sudo tee -a /etc/vsftpd.userlist
@ -131,10 +130,10 @@ $ cat /etc/vsftpd.userlist
Connected to 192.168.56.102 (192.168.56.102).
220 Welcome to TecMint.com FTP service.
Name (192.168.56.102:aaronkilik) : anonymous
530 权限拒绝.
登录失败.
530 Permission denied.
Login failed.
ftp> bye
221 再见.
221 Goodbye.
```
9、接下来我们将测试如果用户的名字没有在文件 `/etc/vsftpd.userlist` 中,是否能够登录。从下面的输出中,我们看到,这是不可以的:
@ -144,26 +143,27 @@ ftp> bye
Connected to 192.168.56.102 (192.168.56.102).
220 Welcome to TecMint.com FTP service.
Name (192.168.56.10:root) : user1
530 权限拒绝.
登录失败.
530 Permission denied.
Login failed.
ftp> bye
221 再见.
221 Goodbye.
```
10、现在我们将进行最后一项测试来确定列在文件 `/etc/vsftpd.userlist` 文件中的用户登录以后,是否进入 home 目录。从下面的输出中可知,是这样的:
10、现在我们将进行最后一项测试来确定列在文件 `/etc/vsftpd.userlist` 文件中的用户登录以后,是否实际处于 home 目录。从下面的输出中可知,是这样的:
```
# ftp 192.168.56.102
Connected to 192.168.56.102 (192.168.56.102).
220 Welcome to TecMint.com FTP service.
Name (192.168.56.102:aaronkilik) : aaronkilik
331 请输入密码.
331 Please specify the password.
Password:
230 登录成功.
远程系统类型为 UNIX.
使用二进制模式来传输文件.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
```
[
![Verify FTP Login in Ubuntu](http://www.tecmint.com/wp-content/uploads/2017/02/Verify-FTP-Login-in-Ubuntu.png)
][7]
@ -192,7 +192,7 @@ $ sudo nano /etc/vsftpd.conf
#allow_writeable_chroot=YES
```
接下来,创建一个可供用户选择的本地 root 目录aaronkilik你的可能和这不一样然后通过取消其他所有用户对此目录的写入权限来设置目录权限:
接下来,为用户创建一个替代的本地 root 目录aaronkilik你的可能和这不一样然后设置目录权限,取消其他所有用户对此目录的写入权限:
```
$ sudo mkdir /home/aaronkilik/ftp
@ -211,8 +211,8 @@ $ sudo chmod -R 0770 /home/aaronkilik/ftp/files/
之后,将 VSFTPD 配置文件中的下面这些选项添加/修改为相应的值:
```
user_sub_token=$USER # inserts the username in the local root directory
local_root=/home/$USER/ftp # defines any users local root directory
user_sub_token=$USER # 在本地 root 目录中插入用户名
local_root=/home/$USER/ftp # 定义各个用户的本地 root 目录
```
保存文件并关闭。然后重启 VSFTPD 服务来使上面的设置生效:
@ -231,11 +231,11 @@ local_root=/home/$USER/ftp # defines any users local root directory
Connected to 192.168.56.102 (192.168.56.102).
220 Welcome to TecMint.com FTP service.
Name (192.168.56.10:aaronkilik) : aaronkilik
331 请输入密码.
331 Please specify the password.
Password:
230 登录成功.
远程系统类型为 UNIX.
使用二进制模式来传输文件.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
```
[
@ -246,11 +246,10 @@ ftp> ls
就是这样的!记得通过下面的评论栏来分享你关于这篇指导的想法,或者你也可以提供关于这一话题的任何重要信息。
最后但不是不重要,请不要错过我的下一篇文章,在下一篇文章中,我将阐述如何[使用 SSL/TLS 来保护连接到 Ubuntu 16.04/16.10 的 FTP 服务器][9],在那之前,请始终关注 TecMint
最后但不是不重要,请不要错过我的下一篇文章,在下一篇文章中,我将阐述如何[使用 SSL/TLS 来保护连接到 Ubuntu 16.04/16.10 的 FTP 服务器][9],在那之前,请始终关注我们
--------------------------------------------------------------------------------
作者简介:
Aaron Kili 是 Linux 和 F.O.S.S 爱好者,即将成为 Linux SysAdmin 和网络开发人员,目前是 TecMint 的内容创作者,他喜欢在电脑上工作,并坚信分享知识。
@ -261,7 +260,7 @@ via: http://www.tecmint.com/install-ftp-server-in-ubuntu/
作者:[Aaron Kili][a]
译者:[ucasFL](https://github.com/ucasFL)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,96 +1,75 @@
How to install Arch Linux on VirtualBox
============================================================
在 VirtualBox 虚拟机中安装 Arch Linux 系统指南
============================================================
### 本文导航
Arch Linux 是专门为 i386 和 x86-64 架构的计算机而设计的基于 Linux 内核的操作系统。其特有的软件包管理器使用 `pacman` 进行完整追踪来将系统应用软件升级到最新版本。 Pacman 是一个用于安装、升级和卸载软件包的管理器。这是一款完全自由而开源的软件,由 Linux 开源社区提供支持。
1、[Arch Linux 软件仓库][8]
2、[在 VirtualBox 虚拟机中安装 Arch Linux 系统][9]
1、[下载 Arch Linux 系统][1]
2、[在 Oracle VirtualBox 管理界面初始化安装][2]
3、[磁盘分区][3]
4、[引导 Arch Linux 启动][4]
5、[设置主机名和网络][5]
6、[安装引导加载程序][6]
7、[启动进入 Arch Linux 系统][7]
Arch Linux 是专门为 i689 和 86-64 架构的计算机而设计的基于 Linux 内核的操作系统。其特有的软件包管理器使用 “pacman" 命令的完整追踪方式来将系统应用软件升级到最新版本。 Pacman 是一个用于安装、升级和卸载软件包的管理器。这是一款完全免费和开源的软件,由 Linux 开源社区提供支持。
Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于二进制的软件包,这些软件包主要是为 i832、64 位和 32 位的系统而开发的,同时也为现代的硬件系统提供最佳的性能优化。
Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于二进制的软件包,这些软件包主要是为 i386 的 64 位和 32 位的系统而开发的,同时也为现代的硬件系统提供最佳的性能优化。
你可以参考这篇教程直接在你的本地电脑上安装 Arch Linux 系统,或者你也可以使用你的 Windows 电脑中的 VirtualBox 虚拟机来安装。
### Arch Linux 软件仓库
要在 VirtualBox 中安装 Arch Linux 系统,你得知道该系统的基础软件仓库。软件仓库用于在安装的过程中获取软件包。对于 Arch Linux 系统来说,有很多可用的软件仓库,可以使用 pacman 工具来进行维护。下面列出的是在 VirtualBox 中安装 Arch Linux 系统时用到的一些基础软件仓库列表:
要在 VirtualBox 中安装 Arch Linux 系统,你得了解该系统的基础软件仓库。软件仓库用于在安装的过程中获取软件包。对于 Arch Linux 系统来说,有很多可用的软件仓库,可以使用 pacman 工具来进行维护。下面列出的是在 VirtualBox 中安装 Arch Linux 系统时用到的一些基础软件仓库列表:
* **core ** 软件仓库包括所有的用于对系统进行基本设置的一些软件包,比如启动 Arch Linux 系统和编译软件包。
*  **extra ** 软件仓库包括 core 软件仓库以外的其它软件包以及与桌面环境相关的软件包。
* **community ** 软件仓库包含的是受信任的 Linux 社区用户采用的软件包其中的大多数的软件包都会被迁移到核心软件仓库或者额外软件仓库中。
* **Multilib ** 软件仓库包括 32 位的软件包以及在 64 位操作系统中安装 32 位应用程序的类库。
* **testing ** 软件仓库包括那些即将成为核心或额外的软件包。
* **community-testing** 软件仓库主要用于 Linux 社区测试。
* **multilib testing ** 软件仓库跟测试软件仓库类似,但是它包含多种类型的类库。
* **gnome-unstable ** 软件仓库包括最新的 GNOME 桌面环境。
* **kde-unstable ** 软件仓库包括 KDE 最新的发布前的软件包。
* **core ** 软件仓库包括所有的用于对系统进行基本设置的一些软件包,比如启动 Arch Linux 系统和编译软件包。
* **extra ** 软件仓库包括 core 软件仓库以外的其它软件包以及与桌面环境相关的软件包。
* **community ** 软件仓库包含的是由可信任的 Linux 社区用户维护的软件包其中的大多数的软件包都会被迁移到核心软件仓库或者额外软件仓库中。
* **Multilib ** 软件仓库包括 32 位的软件包以及用于在 64 位操作系统中安装 32 位应用程序的类库。
* **testing ** 软件仓库包括那些即将成为 core 或 extra 的软件包。
* **community-testing** 软件仓库主要用于 community 类的测试。
* **multilib testing ** 软件仓库跟 testing 软件仓库类似,但是它包含 Multilib 类。
* **gnome-unstable ** 软件仓库包括最新的 GNOME 桌面环境。
* **kde-unstable ** 软件仓库包括 KDE 最新的发布前软件包。
### 在 VirtualBox 虚拟机中安装 Arch Linux 系统
### 下载 Arch Linux 系统
#### 下载 Arch Linux 系统
要在 VirtualBox 虚拟机中安装 Arch Linux 系统,你最好使用[官网][10]下载的新版 Arch Linux 系统。你可以选择直接下载或是种子方式下载系统文件,这是一个很安全的下载方式。在安装之前,确保你系统中有 20 MB 的剩余空间和 1 GB 的内存。
要在 VirtualBox 虚拟机中安装 Arch Linux 系统,你最好使用[官网][10]下载的新版 Arch Linux 系统。你可以选择直接下载或是种子方式下载系统文件,这是一个很安全的下载方式。在安装之前,确保你系统中有 20 GB 的剩余空间和 1 GB 的内存。
[
![Download Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/1212.png)
][11]
### 在 Oracle VirtualBox 虚拟机管理界面初始化系统安装
#### 在 Oracle VirtualBox 虚拟机管理界面初始化系统安装
打开 Oracle VirtualBox 虚拟机管理界面,点击新建,输入你想创建的新系统的名称;这里输入的是 Arch Linux 。系统会自动选择 Arch Linux 的版本和类型这取决于你的系统配置。单击_下一步_。
打开 Oracle VirtualBox 虚拟机管理界面,点击新建new,输入你想创建的新系统的名称;这里输入的是 Arch Linux 。系统会自动选择 Arch Linux 的版本和类型这取决于你的系统配置。单击_下一步_。
[
![Open VirtualBox](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12121.png)
][12]
为你的新系统分配内存,最好是 1024 MB 。单击_下一步_然后点击_新建_来创建一个虚拟磁盘。
为你的新系统分配内存,最好是 1024 MB 。单击_下一步_然后点击创建create来创建一个虚拟磁盘。
[
![Set RAM size](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12122.png)
][13]
在下一步中,你将会被询问为新系统选择磁盘类型。通常选择 VirtualBox 磁盘镜像。
在下一步中,你将会被询问为新系统选择磁盘类型。通常选择 VirtualBox 磁盘镜像VirtualBox Disk ImageVDI类型
[
![Select disk file type](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12123.png)
][14]
选择动态分配单击_下一步_。
选择动态分配dynamically allocated单击_下一步_。
[
![Allocate disk space dynamically](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12124.png)
][15]
分配 20 GB 的硬盘大小及位置
分配 20 GB 的硬盘大小及存放位置
[
![Choose a hard disk size of 20GB](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12125.png)
][16]
现在你可以看到 Arch Linux 系统已创建完成了。点击_开始_
现在你可以看到 Arch Linux 系统已创建完成了。点击开始start按钮
[
![Start the Virtual Machine](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12126.png)
][17]
单击 ‘浏览’ 然后选择你从官网下载的启动磁盘。
单击浏览browser然后选择你从官网下载的启动磁盘。
[
![Choose Arch Linux Disk image](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12127.png)
@ -100,7 +79,7 @@ Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于
![Browse for disk image file](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12128.png)
][19]
点击_启动_,然后打开全屏模式。
点击启动start,然后打开全屏模式。
[
![Open the full-screen view](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/12129.png)
@ -110,25 +89,27 @@ Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于
![Start the Arch Linux VM](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121210.png)
][21]
### **在 VirtualBox 中启动并安装 Arch Linux 系统**
#### 在 VirtualBox 中启动并安装 Arch Linux 系统
你将会看到 Arch Linux 系统第一个打开界面。单击 “启动 Arch Linux (x86_64)”,用于 64 位系统,或者单击”Boot Arch Linux (i686)”,用于 32 位系统。
你将会看到 Arch Linux 系统第一个打开界面。单击 “Boot Arch Linux (x86_64)”, 它用于 64 位系统,或者单击 “Boot Arch Linux (i686)”,用于 32 位系统。
[
![Choose to boot Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121211.png)
][22]
当你单击第一选项后,系统将开始启动。实际上只是进入到一个临时启动状态,即进入到 Arch Linux 的自生系统,并以 root 帐号登录了。
当你单击第一选项后,系统将开始启动。实际上只是进入到一个临时启动状态,即进入到 Arch Linux 的 Live 系统,并以 root 帐号登录了。
[
![Booting into Arch Linux live version](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121212.png)
][23]
输入下面的命令来检查网络连接。
```
ping google.com
```
_ping google.com_
这个单词 Ping 表示网路封包搜寻。你将会看到下面的返回信息,表明 Arch Linux 已经连接到外网了。这是执行安装过程中的很关键的一点。
这个单词 ping 表示网路封包搜寻。你将会看到下面的返回信息,表明 Arch Linux 已经连接到外网了。这是执行安装过程中的很关键的一点。LCTT 译注:或许你 ping 不到那个不存在的网站,你选个存在的吧。)
[
![Test internet connectivity with ping](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121213.png)
@ -136,15 +117,17 @@ Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于
输入如下命令清屏:
_clear_
```
clear
```
在开始安装之前,你得先为硬盘分区。输入 _# fdisk 1 _ ,你将会看到当前系统的磁盘分区情况。注意一开始你给 Arch Linux 系统分配的 20 GB 存储空间。
在开始安装之前,你得先为硬盘分区。输入 `fdisk -l` ,你将会看到当前系统的磁盘分区情况。注意一开始你给 Arch Linux 系统分配的 20 GB 存储空间。
[
![Partition the harddisk](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121214.png)
][25]
### 硬盘分区
#### 硬盘分区
我们打算把这个 20 GB 的磁盘分成三个分区。第一个主分区为 root 分区,大小为 10 GB 。第二个分区为 swap 分区,大小为内存的两倍,为 2048 MB 。第三个是逻辑分区,大小为 8 GB 。
@ -154,53 +137,57 @@ Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于
输入下面的命令:
_cfdisk_
```
cfdisk
```
你将看到 gpt dos sgi 和 sun 类型,选择 _dos _ 选项,然后按 _enter_
你将看到 `gpt`、`dos`、`sgi` 和 `sun` 类型,选择 `dos` 选项,然后按回车
[
![Create a partition of type DOS](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121216.png)
][27]
这里你将看到主磁盘空间,大小为 20 GB 。在剩余空间外按 <enter> 来修改分区大小,输入 10 GB 。
这里你将看到主磁盘空间,大小为 20 GB 。在剩余空间free space按回车来修改分区大小,输入 10 GB 。
[
![Choose 10GB partition size](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121217.png)
][28]
 _enter _ 并单击 “主分区” 。
回车并单击 “主分区primary” 。
[
![](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121218.png)
][29]
在可引导选项按 Enter 键选择 ”可引导“类型。
在可引导选项按回车选择“可引导bootable类型。
[
![Make partition bootable.](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121219.png)
][30]
_写入_ 选项按 Enter 键将分区信息写入磁盘。
“写入write选项按回车键将分区信息写入磁盘。
[
![Write partition to disk](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121220.png)
][31]
之后输入 _yes_ 来应用更改。
之后输入 `yes` 来应用更改。
[
![Confirm changes](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121221.png)
][32]
现在已经创建完成 10 GB 的分区。单击 _剩余空间_ ,输入分区大小 2048 M 。
现在已经创建完成 10 GB 分区。单击“剩余空间free space,输入分区大小 2048 M 。
[
![Create the 2GB swap partition](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121222.png)
][33]
以同样的方式创建逻辑方式。在 _退出_ 选项按 Enter 键,然后输入下面的命令来清屏:
以同样的方式创建逻辑分区。在“退出quit”选项按回车键,然后输入下面的命令来清屏:
_clear_ .
```
clear
```
[
![quit cfdisk](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121223.png)
@ -208,15 +195,21 @@ Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于
输入下面的命令来格式化新建的分区:
_mkfs.ext4 /dev/sda1_
```
mkfs.ext4 /dev/sda1
```
这里的 _sda1 _ 是分区名。使用同样的命令来格式化第二个分区 sda3 :
这里的 `sda1` 是分区名。使用同样的命令来格式化第二个分区 `sda3` :
_mkfs.ext4 /dev/sda3_
```
mkfs.ext4 /dev/sda3
```
格式化 swap 分区:
_mkswap/dev/sda2_ .
```
mkswap /dev/sda2
```
[
![Format the swap partition with mkswap](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121224.png)
@ -224,11 +217,15 @@ Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于
使用下面的命令来激活 swap 分区:
_swapon/ dev/ sda2_
```
swapon /dev/sda2
```
输入 clear 命令清屏:
_clear_ .
```
clear
```
[
![Enable swap](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121225.png)
@ -236,17 +233,21 @@ Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于
输入下面的命令来挂载主分区以开始系统安装:
_mount /dev/ sda1 / mnt._
```
mount /dev/sda1 / mnt
```
[
![Mount the partitions](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121226.png)
][37]
### 引导 Arch Linux 启动
#### 引导 Arch Linux 启动
输入下面的命令来引导系统启动:
_pacstrap /mnt base base-devel_
```
pacstrap /mnt base base-devel
```
可以看到系统正在同步数据包。
@ -254,7 +255,7 @@ Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于
![Bootstrap Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121227.png)
][38]
几分钟后将会开始安装系统
安装将会开始,需要几分钟
[
![Arch Linux installation has been started](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121228.png)
@ -262,7 +263,9 @@ Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于
系统基本软件安装完成后,输入下面的命令来创建 fstab 文件:
_genfstab /mnt>> /mnt/etc/fstab_
```
genfstab /mnt>> /mnt/etc/fstab
```
[
![Generating /etc/fstab](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121229.png)
@ -272,53 +275,63 @@ Arch Linux 也因其丰富的 Wiki 帮助文档而大受推崇。该系统基于
输入下面的命令来更改系统的根目录为 Arch Linux 的安装目录:
_arch-chroot /mnt /bin /bash_
```
arch-chroot /mnt /bin/bash
```
 现在来更改语言配置:
_nano /etc / local.gen_
```
nano /etc/local.gen
```
[
![Set language in Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121230.png)
][41]
通过删除 # 以及按 _control + x ,按 _y_ ,然后再按 _enter_来选择下面的语言配置:
通过删除 `#` 以及按 `control + x` ,按 `y` ,然后再按回车来选择下面的语言配置:
[
![select language](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121231.png)
][42]
输入下面的命令来激活:
输入下面的命令来激活
_locale-gen_
```
locale-gen
```
按 _enter_ 键。
回车
[
![Generate the locales in Arch Linux](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/121232.png)
][43]
使用下面的命令来创建 /etc/locale.conf 配置文件:
使用下面的命令来创建 `/etc/locale.conf` 配置文件:
_nano /etc/locale.conf_
```
nano /etc/locale.conf
```
然后按 _enter_ 。现在你就可以在配置文件中输入下面一行内容来为系统添加语言:
然后按回车。现在你就可以在配置文件中输入下面一行内容来为系统添加语言:
```
LANG=en_US.UTF-8
```
 然后按 _control + x ,按 _y_ ,再按 _enter_
 然后按 `control + x` ,按 `y` ,再按回车
[
![Set default language](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/1.png)
][44]
输入下面的命令来同步时区:
```
ls user/share/zoneinfo
```
ls user/share/zoneinfo_
下面你将整个世界的时区列表。
下面你将看到整个世界的时区列表。
[
![Set System language default](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/11.png)
@ -326,7 +339,9 @@ ls user/share/zoneinfo_
输入下面的命令来选择你所在的时区:
_ln s /usr/share/zoneinfo/Asia/Kolkata/etc/localtime_
```
ln s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
```
或者你可以从下面的列表中选择其它名称。
@ -336,7 +351,9 @@ ls user/share/zoneinfo_
使用下面的命令来设置标准时间:
_hwclock --systohc utc_
```
hwclock --systohc utc
```
硬件时钟已同步。
@ -346,21 +363,25 @@ ls user/share/zoneinfo_
设置 root 帐号密码:
_passwd_
```
passwd
```
按  _enter_ 。 然而输入你想设置的密码,按 enter 键确认。
回车。 然而输入你想设置的密码,按回车确认。
[
![Set the root password](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/14.png)
][48]
### 设置主机名和网络
#### 设置主机名和网络
使用下面的命令来设置主机名:
_nano /etc/hostname_
```
nano /etc/hostname
```
然后按 _enter_ 。输入你想设置的主机名称,按 _control + x ,按 _y_ ,再按 _enter_
然后按回车。输入你想设置的主机名称,按 `control + x` ,按 `y` ,再按回车
[
![Set the hostname](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/15.png)
@ -368,21 +389,25 @@ ls user/share/zoneinfo_
启用 dhcpcd
_systemctl enable dhcpcd_
```
systemctl enable dhcpcd
```
这样在下一次系统启动时, dhcpcd 将会自动启动,并自动获取一个 IP 地址:
[
![Enable dhcpd](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/16.png)
![Enable dhcpcd](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/16.png)
][50]
### 安装引导加载程序
#### 安装引导加载程序
最后一步,输入以下命令来初始化 grub 安装。输入以下命令:
_pacman S grub os-rober_
```
pacman S grub os-rober
```
然后按 _y _ ,将会下载相关程序。
然后按 `y` ,将会下载相关程序。
[
![Configure grub](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/17.png)
@ -390,11 +415,15 @@ ls user/share/zoneinfo_
使用下面的命令来将启动加载程序安装到硬盘上:
_grub-install /dev/sd_
```
grub-install /dev/sda
```
然后进行配置:
_grub-mkconfig o/ boot/ grub/ grub.cfg_
```
grub-mkconfig -o /boot/grub/grub.cfg
```
[
![Install and configure grub boot loader](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/18.png)
@ -402,15 +431,17 @@ ls user/share/zoneinfo_
最后重启系统:
_reboot_
```
reboot
```
然后按 _enter 。_
然后按回车 。
[
![Reboot the system](https://www.howtoforge.com/images/install_arch_linux_on_virtual_box/19.png)
][53]
### 启动进入到已安装完成的 Arch Linux 系统
#### 启动进入到已安装完成的 Arch Linux 系统
选择“启动已存在的操作系统”选项来启动 Virtual Box 虚拟机中的 Arch Linux 系统。
@ -428,12 +459,13 @@ ls user/share/zoneinfo_
via: https://www.howtoforge.com/tutorial/install-arch-linux-on-virtualbox/
译者简介:
春城初春/春水初生/春林初盛/春風十裏不如妳
译者简介:
rusking春城初春/春水初生/春林初盛/春風十裏不如妳
作者:[Dimitris][a]
译者:[rusking](https://github.com/rusking)
校对:[校对者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,173 @@
如何在 CentOS 7 中安装或升级最新的内核
============================================================
虽然有些人使用 Linux 来表示整个操作系统但要注意的是严格地来说Linux 只是个内核。另一方面,发行版是一个完整功能的系统,它建立在内核之上,具有各种各样的应用程序工具和库。
在正常操作期间,内核负责执行两个重要任务:
1. 作为硬件和系统上运行的软件之间的接口。
2. 尽可能高效地管理系统资源。
为此,内核通过内置的驱动程序或以后可作为模块安装的驱动程序与硬件通信。
例如,当你计算机上运行的程序想要连接到无线网络时,它会将该请求提交给内核,后者又会使用正确的驱动程序连接到网络。
- **建议阅读:** [如何在 Ubuntu 中升级内核][1]
随着新的设备和技术定期出来,如果我们想充分利用它们,保持最新的内核就很重要。此外,更新内核将帮助我们利用新的内核函数,并保护自己免受先前版本中发现的漏洞的攻击。
准备好了在 CentOS 7 或其衍生产品(如 RHEL 7和 Fedora上更新内核了么如果是这样请继续阅读
### 步骤 1检查已安装的内核版本
让我们安装了一个发行版,它包含了一个特定版本的内核。为了展示当前系统中已安装的版本,我们可以:
```
# uname -sr
```
下面的图片展示了在一台 CentOS 7 服务器上的输出信息:
[
![Check Kernel Version in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/03/Check-Kernel-Version-in-CentOS-7.png)
][2]
*在 CentOS 7 上检查内核版本*
如果我们现在进入 [https://www.kernel.org/][3]在撰写本文时我们看到最新的内核版本是4.10.1(其他版本可以从同一网站获得)。
还要考虑的一个重要的事情是内核版本的生命周期 - 如果你当前使用的版本接近它的生命周期结束,那么在该日期后将不会提供更多的 bug 修复。关于更多信息,请参阅[内核发布][4]页。
### 步骤 2在 CentOS 7 中升级内核
大多数现代发行版提供了一种使用 [yum 等包管理系统][5]和官方支持的仓库升级内核的方法。
但是,这只会升级内核到仓库中可用的最新版本 - 而不是在 [https://www.kernel.org/][6] 中可用的最新版本。不幸的是Red Hat 只允许使用前者升级内核。
与 Red Hat 不同CentOS 允许使用 ELRepo这是一个第三方仓库可以将内核升级到最新版本。
要在 CentOS 7 上启用 ELRepo 仓库,请运行:
```
# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
```
[
![Enable ELRepo in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/03/Enable-ELRepo-in-CentOS-7.png)
][7]
*在 CentOS 7 启用 ELRepo*
仓库启用后,你可以使用下面的命令列出可用的内核相关包:
```
# yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
```
[
![Yum - Find Available Kernel Versions](http://www.tecmint.com/wp-content/uploads/2017/03/Yum-Find-Available-Kernel-Versions.png)
][8]
*yum - 找出可用的内核版本*
接下来,安装最新的主线稳定内核:
```
# yum --enablerepo=elrepo-kernel install kernel-ml
```
[
![Install Latest Kernel Version in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/03/Install-Latest-Kernel-Version-in-CentOS-7.png)
][9]
*在 CentOS 7 中安装最新的内核版本*
最后,重启机器并应用最新内核,接着运行下面的命令检查最新内核版本:
```
uname -sr
```
[
![Verify Kernel Version](http://www.tecmint.com/wp-content/uploads/2017/03/Verify-Kernel-Version.png)
][10]
*验证内核版本*
### 步骤 3设置 GRUB 默认的内核版本
为了让新安装的内核成为默认启动选项,你需要如下修改 GRUB 配置:
打开并编辑 `/etc/default/grub` 并设置 `GRUB_DEFAULT=0`。意思是 GRUB 初始化页面的第一个内核将作为默认内核。
```
GRUB_TIMEOUT=5
GRUB_DEFAULT=0
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
```
接下来运行下面的命令来重新创建内核配置。
```
# grub2-mkconfig -o /boot/grub2/grub.cfg
```
[
![Set Kernel in GRUB](http://www.tecmint.com/wp-content/uploads/2017/03/Set-Kernel-in-GRUB.png)
][11]
*在 GRUB 中设置内核*
重启并验证最新的内核已作为默认内核。
[
![Booting Default Kernel Version in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/03/Booting-Default-Kernel-Version.png)
][12]
在 CentOS 7 中启动默认内核版本
恭喜你!你已经在 CentOS 7 中升级内核了!
##### 总结
在本文中,我们解释了如何轻松升级系统上的 Linux 内核。我们还没讲到另外一个方法,因为它涉及从源代码编译内核,这可以写成一本书,并且不推荐在生产系统上这么做。
虽然它是最好的学习体验之一,并且允许细粒度配置内核,但是你可能会让你的系统不可用,并且可能必须从头重新安装它。
如果你仍然有兴趣构建内核作为学习经验,你可以在 [Kernel Newbies][13]页面中获得指导。
一如既往,如果你对本文有任何问题或意见,请随时使用下面的评论栏。
--------------------------------------------------------------------------------
作者简介:
我是一个计算机上瘾的家伙,并且是开源和 Linux 系统软件的粉丝,有大约 4 年的 Linux 发行版桌面、服务器和 bash 脚本的经验。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/install-upgrade-kernel-version-in-centos-7/
作者:[Matei Cezar][a]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/cezarmatei/
[1]:https://linux.cn/article-8284-1.html
[2]:http://www.tecmint.com/wp-content/uploads/2017/03/Check-Kernel-Version-in-CentOS-7.png
[3]:https://www.kernel.org/
[4]:https://www.kernel.org/category/releases.html
[5]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/
[6]:https://www.kernel.org/
[7]:http://www.tecmint.com/wp-content/uploads/2017/03/Enable-ELRepo-in-CentOS-7.png
[8]:http://www.tecmint.com/wp-content/uploads/2017/03/Yum-Find-Available-Kernel-Versions.png
[9]:http://www.tecmint.com/wp-content/uploads/2017/03/Install-Latest-Kernel-Version-in-CentOS-7.png
[10]:http://www.tecmint.com/wp-content/uploads/2017/03/Verify-Kernel-Version.png
[11]:http://www.tecmint.com/wp-content/uploads/2017/03/Set-Kernel-in-GRUB.png
[12]:http://www.tecmint.com/wp-content/uploads/2017/03/Booting-Default-Kernel-Version.png
[13]:https://kernelnewbies.org/KernelBuild
[14]:http://www.tecmint.com/author/gacanepa/
[15]:http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/
[16]:http://www.tecmint.com/free-linux-shell-scripting-books/

View File

@ -1,23 +1,23 @@
Restrict SSH User Access to Certain Directory Using Chrooted Jail
使用 chroot 监狱限制 SSH 用户访问指定目录
============================================================
There are several reasons to [restrict a SSH user session][1] to a particular directory, especially on web servers, but the obvious one is a system security. In order to lock SSH users in a certain directory, we can use chroot mechanism.
将 [SSH 用户会话限制][1]访问到特定的目录内,特别是在 web 服务器上,这样做有多个原因,但最显而易见的是为了系统安全。为了锁定 SSH 用户在某个目录,我们可以使用 **chroot** 机制。
change root (chroot) in Unix-like systems such as Linux, is a means of separating specific user operations from the rest of the Linux system; changes the apparent root directory for the current running user process and its child process with new root directory called a chrooted jail.
在诸如 Linux 之类的类 Unix 系统中更改 root**chroot**)是将特定用户操作与其他 Linux 系统分离的一种手段;使用称为 **chrooted 监狱** 的新根目录更改当前运行的用户进程及其子进程的明显根目录。
In this tutorial, well show you how to restrict a SSH user access to a given directory in Linux. Note that well run the all the commands as root, use the [sudo command][2] if you are logged into server as a normal user.
在本教程中,我们将向你展示如何限制 SSH 用户访问 Linux 中指定的目录。注意,我们将以 root 用户身份运行所有命令,如果你以普通用户身份登录服务器,请使用 [sudo 命令][2]。
### Step 1: Create SSH Chroot Jail
### 步骤 1创建 SSH chroot 监狱
1. Start by creating the chroot jail using the mkdir command below:
1、 使用 mkdir 命令开始创建 chroot 监狱:
```
# mkdir -p /home/test
```
2. Next, identify required files, according to the sshd_config man page, the `ChrootDirectory` option specifies the pathname of the directory to chroot to after authentication. The directory must contain the necessary files and directories to support a users session.
2、 接下来,根据 `sshd_config` 手册找到所需的文件,`ChrootDirectory` 选项指定在身份验证后要 chroot 到的目录的路径名。该目录必须包含支持用户会话所必需的文件和目录。
For an interactive session, this requires at least a shell, commonly `sh`, and basic `/dev` nodes such as null, zero, stdin, stdout, stderr, and tty devices:
对于交互式会话,这需要至少一个 shell通常为 `sh` 和基本的 `/dev` 节点,例如 `null`、`zero`、`stdin`、`stdout`、`stderr` 和 `tty` 设备:
```
# ls -l /dev/{null,zero,stdin,stdout,stderr,random,tty}
@ -26,9 +26,9 @@ For an interactive session, this requires at least a shell, commonly `sh`, and
![Listing Required Files](http://www.tecmint.com/wp-content/uploads/2017/03/Listing-Required-Files.png)
][3]
Listing Required Files
*列出所需文件*
3. Now, create the `/dev` files as follows using the mknod command. In the command below, the `-m` flag is used to specify the file permissions bits, `c` means character file and the two numbers are major and minor numbers that the files point to.
3、 现在,使用 `mknod` 命令创建 `/dev` 下的文件。在下面的命令中,`-m` 标志用来指定文件权限位,`c` 意思是字符文件,两个数字分别是文件指向的主要号和次要号。
```
# mkdir -p /home/test/dev/
@ -42,9 +42,9 @@ Listing Required Files
![Create /dev and Required Files](http://www.tecmint.com/wp-content/uploads/2017/03/Create-Required-Files.png)
][4]
Create /dev and Required Files
*创建 /dev 和所需文件*
4. Afterwards, set the appropriate permission on the chroot jail. Note that the chroot jail and its subdirectories and subfiles must be owned by root user, and not writable by any normal user or group:
4、 在此之后,在 chroot 监狱中设置合适的权限。注意 chroot 监狱和它的子目录以及子文件必须被 `root` 用户所有,并且对普通用户或用户组不可写:
```
# chown root:root /home/test
@ -55,11 +55,11 @@ Create /dev and Required Files
![Set Permissions on Directory](http://www.tecmint.com/wp-content/uploads/2017/03/Set-Permission-on-Directory.png)
][5]
Set Permissions on Directory
*设置目录权限*
### Step 2: Setup Interactive Shell for SSH Chroot Jail
### 步骤 2为 SSH chroot 监狱设置交互式 shell
5. First, create the `bin` directory and then copy the `/bin/bash` files into the `bin` directory as follows:
5、 首先,创建 `bin` 目录并复制 `/bin/bash``bin` 中:
```
# mkdir -p /home/test/bin
@ -69,9 +69,9 @@ Set Permissions on Directory
![Copy Files to bin Directory](http://www.tecmint.com/wp-content/uploads/2017/03/Copy-Bin-Files.png)
][6]
Copy Files to bin Directory
*复制文件到 bin 目录中*
6. Now, identify bash required shared `libs`, as below and copy them into the `lib` directory:
6、 现在,识别 bash 所需的共享库,如下所示复制它们到 `lib64` 中:
```
# ldd /bin/bash
@ -82,18 +82,18 @@ Copy Files to bin Directory
![Copy Shared Library Files](http://www.tecmint.com/wp-content/uploads/2017/03/Copy-Shared-Library-Files.png)
][7]
Copy Shared Library Files
*复制共享库文件*
### Step 3: Create and Configure SSH User
### 步骤 3创建并配置 SSH 用户
7. Now, create the SSH user with the [useradd command][8] and set a secure password for the user:
7、 现在,使用 [useradd 命令][8]创建 SSH 用户,并设置安全密码:
```
# useradd tecmint
# passwd tecmint
```
8. Create the chroot jail general configurations directory, `/home/test/etc` and copy the updated account files (/etc/passwd and /etc/group) into this directory as follows:
8、 创建 chroot 监狱通用配置目录 `/home/test/etc` 并复制已更新的账号文件(`/etc/passwd` 和 `/etc/group`)到这个目录中:
```
# mkdir /home/test/etc
@ -103,43 +103,43 @@ Copy Shared Library Files
![Copy Password Files](http://www.tecmint.com/wp-content/uploads/2017/03/Copy-Password-Files.png)
][9]
Copy Password Files
*复制密码文件*
Note: Each time you add more SSH users to the system, you will need to copy the updated account files into the `/home/test/etc` directory.
注意:每次向系统添加更多 SSH 用户时,都需要将更新的帐户文件复制到 `/home/test/etc` 目录中。
### Step 4: Configure SSH to Use Chroot Jail
### 步骤 4配置 SSH 来使用 chroot 监狱
9. Now, open the `sshd_config` file.
9、 现在打开 `sshd_config` 文件。
```
# vi /etc/ssh/sshd_config
```
and add/modify the lines below in the file.
在此文件中添加或修改下面这些行。
```
#define username to apply chroot jail to
# 定义要使用 chroot 监狱的用户
Match User tecmint
#specify chroot jail
# 指定 chroot 监狱
ChrootDirectory /home/test
```
[
![Configure SSH Chroot Jail](http://www.tecmint.com/wp-content/uploads/2017/03/Configure-SSH-Chroot-Jail.png)
][10]
Configure SSH Chroot Jail
*配置 SSH chroot 监狱*
Save the file and exit, and restart the SSHD services:
保存文件并退出,重启 sshd 服务:
```
# systemctl restart sshd
OR
或者
# service sshd restart
```
### Step 5: Testing SSH with Chroot Jail
### 步骤 5测试 SSH 的 chroot 监狱
10. At this point, test if the chroot jail setup is working as expected:
10、 这次,测试 chroot 监狱的设置是否如希望的那样成功了:
```
# ssh tecmint@192.168.0.10
@ -151,11 +151,11 @@ OR
![Testing SSH User Chroot Jail](http://www.tecmint.com/wp-content/uploads/2017/03/Testing-SSH-User-Chroot-Jail.png)
][11]
Testing SSH User Chroot Jail
*测试 SSH 用户 chroot 监狱*
From the screenshot above, we can see that the SSH user is locked in the chrooted jail, and cant run any external commands (ls, date, uname etc).
从上面的截图上来看,我们可以看到 SSH 用户被锁定在了 chroot 监狱中,并且不能使用任何外部命令如(`ls`、`date`、`uname` 等等)。
The user can only execute bash and its builtin commands such as(pwd, history, echo etc) as seen below:
用户只可以执行 `bash` 以及它内置的命令(比如:`pwd`、`history`、`echo` 等等):
```
# ssh tecmint@192.168.0.10
@ -167,11 +167,11 @@ The user can only execute bash and its builtin commands such as(pwd, history, ec
![SSH Built-in Commands](http://www.tecmint.com/wp-content/uploads/2017/03/SSH-Builtin-Commands.png)
][12]
SSH Built-in Commands
*SSH 内置命令*
### Step 6\. Create SSH Users Home Directory and Add Linux Commands
### 步骤6 创建用户的主目录并添加 Linux 命令
11. From the previous step, we can notice that the user is locked in the root directory, we can create a home directory for the the SSH user like so (do this for all future users):
11、 从前面的步骤中,我们可以看到用户被锁定在了 root 目录,我们可以为 SSH 用户创建一个主目录(以及为所有将来的用户这么做):
```
# mkdir -p /home/test/home/tecmint
@ -182,9 +182,9 @@ SSH Built-in Commands
![Create SSH User Home Directory](http://www.tecmint.com/wp-content/uploads/2017/03/Create-SSH-User-Home-Directory.png)
][13]
Create SSH User Home Directory
*创建 SSH 用户主目录*
12. Next, install a few user commands such as ls, date, mkdir in the `bin` directory:
12、 接下来,在 `bin` 目录中安装几个用户命令,如 `ls`、`date`、`mkdir`
```
# cp -v /bin/ls /home/test/bin/
@ -195,9 +195,9 @@ Create SSH User Home Directory
![Add Commands to SSH User](http://www.tecmint.com/wp-content/uploads/2017/03/Add-Commands-to-SSH-User.png)
][14]
Add Commands to SSH User
*向 SSH 用户添加命令*
13. Next, check the shared libraries for the commands above and move them into the chrooted jail libraries directory:
13、 接下来,检查上面命令的共享库并将它们移到 chroot 监狱的库目录中:
```
# ldd /bin/ls
@ -207,28 +207,28 @@ Add Commands to SSH User
![Copy Shared Libraries](http://www.tecmint.com/wp-content/uploads/2017/03/Copy-Shared-Libraries.png)
][15]
Copy Shared Libraries
*复制共享库*
### Step 7\. Testing SFTP with Chroot Jail
### 步骤 7测试 sftp 的 用 chroot 监狱
14. Do a final test using sftp; check if the commands you have just installed are working.
14、 最后用 sftp 做一个测试;测试你先前安装的命令是否可用。
Add the line below in the `/etc/ssh/sshd_config` file:
`/etc/ssh/sshd_config` 中添加下面的行:
```
#Enable sftp to chrooted jail
# 启用 sftp 的 chrooted 监狱
ForceCommand internal-sftp
```
Save the file and exit. Then restart the SSHD services:
保存并退出文件。接下来重启 sshd 服务:
```
# systemctl restart sshd
OR
或者
# service sshd restart
```
15. Now, test using SSH, youll get the following error:
15、 现在使用 ssh 测试,你会得到下面的错误:
```
# ssh tecmint@192.168.0.10
@ -237,9 +237,9 @@ OR
![Test SSH Chroot Jail](http://www.tecmint.com/wp-content/uploads/2017/03/Test-SSH-Chroot-Jail.png)
][16]
Test SSH Chroot Jail
*测试 SSH Chroot 监狱*
Try using SFTP as follows:
试下使用 sftp
```
# sftp tecmint@192.168.0.10
@ -248,26 +248,25 @@ Try using SFTP as follows:
![Testing sFTP SSH User](http://www.tecmint.com/wp-content/uploads/2017/03/Testing-sFTP-SSH-User.png)
][17]
Testing sFTP SSH User
*测试 sFTP SSH 用户*
**Suggested Read:** [Restrict SFTP Users to Home Directories Using chroot Jail][18]
**建议阅读:** [使用 chroot 监狱将 sftp 用户限制在主目录中][18]。
Thats it for now!. In this article, we showed you how to restrict a SSH user in a given directory (chrooted jail) in Linux. Use the comment section below to offer us your thoughts about this guide.
就是这样了!在文本中,我们向你展示了如何在 Linux 中限制 ssh 用户到指定的目录中( chroot 监狱)。请在评论栏中给我们提供你的想法。
--------------------------------------------------------------------------------
作者简介:
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.
Aaron Kili 是一个 Linux 及 F.O.S.S 热衷者,即将成为 Linux 系统管理员、web 开发者,目前是 TecMint 的内容创作者,他喜欢用电脑工作,并坚信分享知识。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/restrict-ssh-user-to-directory-using-chrooted-jail/
作者:[Aaron Kili][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[geekpi](https://github.com/geekpi)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,14 @@
Programmer Levels
=======
![programmer-levels.png](https://ooo.0o0.ooo/2017/03/14/58c7dac6d0de2.png)
via: http://turnoff.us/geek/programmer-leves/
作者:[Daniel Stori][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: http://turnoff.us/about/

View File

@ -0,0 +1,277 @@
Index of turnoff.us
====================
* ### [Ode To My Family][1]
* ### [The Depressed Developer 11][2]
* ### [The Jealous Process][3]
* ### [#!S][4]
* ### [The Depressed Developer 10][5]
* ### [User Space Election][6]
* ### [The Depressed Developer 7][7]
* ### [The War for Port 80][8]
* ### [The Depressed Developer 6][9]
* ### [Adopt a good cause, DON'T SIGKILL][10]
* ### [Happy 0b11111100001][11]
* ### [Bash History][12]
* ### [My (Dev) Morning Routine][13]
* ### [The Depressed Developer 5][14]
* ### [The Real Reason Not To Share a Mutable State][15]
* ### [Any Given Day][16]
* ### [One Last Question][17]
* ### [The Depressed Developer 3][18]
* ### [The Depressed Developer 4][19]
* ### [The Depressed Developer 2][20]
* ### [The Depressed Developer][21]
* ### [Protocols][22]
* ### [The Lord of The Matrix][23]
* ### [Inheritance versus Composition][24]
* ### [Coding From Anthill][25]
* ### [Life of Embedded Processes][26]
* ### [Deadline][27]
* ### [Ubuntu Core][28]
* ### [The Truth About Google][29]
* ### [Inside the Linux Kernel][30]
* ### [Programmer Levels][31]
* ### [Microservices][32]
* ### [Binary Tree][33]
* ### [Annoying Software 4 - Checkbox vs Radio Button][34]
* ### [Zombie Processes][35]
* ### [Poprocks and Coke][36]
* ### [jhamlet][37]
* ### [Java Thread Life][38]
* ### [Stranger Things - In The SysAdmin's World][39]
* ### [Who Killed MySQL? - Epilogue][40]
* ### [Sometimes They Are][41]
* ### [Dotnet on Linux][42]
* ### [Who Killed MySQL?][43]
* ### [To VI Or Not To VI][44]
* ### [Brothers Conflict (at linux kernel)][45]
* ### [Big Numbers][46]
* ### [The Codeless Developer][47]
* ### [Introducing the OOM Killer][48]
* ### [Reactive and Boring][49]
* ### [Hype Detected][50]
* ### [3rd World Daily News][51]
* ### [Java Evolution Parade][52]
* ### [The Opposite of RIP][53]
* ### [How I Met Your Mother][54]
* ### [Schrödinger's Cat Last Declarations][55]
* ### [Bash on Windows][56]
* ### [Ubuntu Updates][57]
* ### [SQL Server on Linux Part 2][58]
* ### [About JavaScript Developers][59]
* ### [The Real Reason to Not Use SIGKILL][60]
* ### [Java 20 - Predictions][61]
* ### [Do the Evolution, Baby!][62]
* ### [SQL Server on Linux][63]
* ### [When Just-In-Time Is Justin Time][64]
* ### [The Agile Restaurant][65]
* ### [I Love Windows PowerShell][66]
* ### [Linux Master Hero][67]
* ### [Doing a Great Job Together][68]
* ### [Geek Rivalries][69]
* ### [A Java Nightmare][70]
* ### [Java Family Crisis][71]
* ### [Annoying Software 3 - The Date Situation][72]
* ### [The (Sometimes Hard) Cloud Journey][73]
* ### [Thread.Sleep Room][74]
* ### [Web Server Upgrade Training][75]
* ### [Life in a Web Server][76]
* ### [Mastering RegExp][77]
* ### [Java Collections in Duck Life][78]
* ### [Java Garbage Collection Explained][79]
* ### [Waze vs Battery][80]
* ### [Masks][81]
* ### [Big Data Marriage][82]
* ### [Annoying Software 2][83]
* ### [Annoying Software][84]
* ### [Advanced Species][85]
* ### [The Modern Evil][86]
* ### [Software Testing][87]
* ### [Arduino Project][88]
* ### [Tales of DOS][89]
* ### [Developers][90]
* ### [TCP Buddies][91]
[1]:https://turnoff.us/geek/ode-to-my-family
[2]:https://turnoff.us/geek/the-depressed-developer-11
[3]:https://turnoff.us/geek/the-jealous-process
[4]:https://turnoff.us/geek/shebang
[5]:https://turnoff.us/geek/the-depressed-developer-10
[6]:https://turnoff.us/geek/user-space-election
[7]:https://turnoff.us/geek/the-depressed-developer-7
[8]:https://turnoff.us/geek/apache-vs-nginx
[9]:https://turnoff.us/geek/the-depressed-developer-6
[10]:https://turnoff.us/geek/dont-sigkill-2
[11]:https://turnoff.us/geek/2016-2017
[12]:https://turnoff.us/geek/bash-history
[13]:https://turnoff.us/geek/my-morning-routine
[14]:https://turnoff.us/geek/the-depressed-developer-5
[15]:https://turnoff.us/geek/dont-share-mutable-state
[16]:https://turnoff.us/geek/sql-injection
[17]:https://turnoff.us/geek/one-last-question
[18]:https://turnoff.us/geek/the-depressed-developer-3
[19]:https://turnoff.us/geek/the-depressed-developer-4
[20]:https://turnoff.us/geek/the-depressed-developer-2
[21]:https://turnoff.us/geek/the-depressed-developer
[22]:https://turnoff.us/geek/protocols
[23]:https://turnoff.us/geek/the-lord-of-the-matrix
[24]:https://turnoff.us/geek/inheritance-versus-composition
[25]:https://turnoff.us/geek/ant
[26]:https://turnoff.us/geek/ubuntu-core-2
[27]:https://turnoff.us/geek/deadline
[28]:https://turnoff.us/geek/ubuntu-core
[29]:https://turnoff.us/geek/the-truth-about-google
[30]:https://turnoff.us/geek/inside-the-linux-kernel
[31]:https://turnoff.us/geek/programmer-leves
[32]:https://turnoff.us/geek/microservices
[33]:https://turnoff.us/geek/binary-tree
[34]:https://turnoff.us/geek/annoying-software-4
[35]:https://turnoff.us/geek/zombie-processes
[36]:https://turnoff.us/geek/poprocks-and-coke
[37]:https://turnoff.us/geek/jhamlet
[38]:https://turnoff.us/geek/java-thread-life
[39]:https://turnoff.us/geek/stranger-things-sysadmin-world
[40]:https://turnoff.us/geek/who-killed-mysql-epilogue
[41]:https://turnoff.us/geek/sad-robot
[42]:https://turnoff.us/geek/dotnet-on-linux
[43]:https://turnoff.us/geek/who-killed-mysql
[44]:https://turnoff.us/geek/to-vi-or-not-to-vi
[45]:https://turnoff.us/geek/brothers-conflict
[46]:https://turnoff.us/geek/big-numbers
[47]:https://turnoff.us/geek/codeless
[48]:https://turnoff.us/geek/oom-killer
[49]:https://turnoff.us/geek/reactive-and-boring
[50]:https://turnoff.us/geek/tech-adoption
[51]:https://turnoff.us/geek/3rd-world-news
[52]:https://turnoff.us/geek/java-evolution-parade
[53]:https://turnoff.us/geek/opposite-of-rip
[54]:https://turnoff.us/geek/how-i-met-your-mother
[55]:https://turnoff.us/geek/schrodinger-cat
[56]:https://turnoff.us/geek/bash-on-windows
[57]:https://turnoff.us/geek/ubuntu-updates
[58]:https://turnoff.us/geek/sql-server-on-linux-2
[59]:https://turnoff.us/geek/love-ecma6
[60]:https://turnoff.us/geek/dont-sigkill
[61]:https://turnoff.us/geek/java20-predictions
[62]:https://turnoff.us/geek/its-evolution-baby
[63]:https://turnoff.us/geek/sql-server-on-linux
[64]:https://turnoff.us/geek/lazy-justin-is-late-again
[65]:https://turnoff.us/geek/agile-restaurant
[66]:https://turnoff.us/geek/love-powershell
[67]:https://turnoff.us/geek/linux-master-hero
[68]:https://turnoff.us/geek/duke-tux
[69]:https://turnoff.us/geek/geek-rivalries
[70]:https://turnoff.us/geek/a-java-nightmare
[71]:https://turnoff.us/geek/java-family-crisis
[72]:https://turnoff.us/geek/annoying-software-3
[73]:https://turnoff.us/geek/cloud-sometimes-hard-journey
[74]:https://turnoff.us/geek/thread-sleep-room
[75]:https://turnoff.us/geek/webserver-upgrade-training
[76]:https://turnoff.us/geek/life-in-a-web-server
[77]:https://turnoff.us/geek/mastering-regexp
[78]:https://turnoff.us/geek/java-collections
[79]:https://turnoff.us/geek/java-gc-explained
[80]:https://turnoff.us/geek/waze-vs-battery
[81]:https://turnoff.us/geek/masks
[82]:https://turnoff.us/geek/bigdata-marriage
[83]:https://turnoff.us/geek/annoying-software-2
[84]:https://turnoff.us/geek/annoying-software
[85]:https://turnoff.us/geek/advanced-species
[86]:https://turnoff.us/geek/modern-evil
[87]:https://turnoff.us/geek/software-test
[88]:https://turnoff.us/geek/arduino-project
[89]:https://turnoff.us/geek/tales-of-dos
[90]:https://turnoff.us/geek/developers
[91]:https://turnoff.us/geek/tcp-buddies

View File

@ -1,3 +1,5 @@
Translating by SysTick
The impact GitHub is having on your software career
============================================================

View File

@ -1,153 +0,0 @@
vim-kakali translating
How to record a region of your desktop as animated GIF on Linux
============================================================
### On this page
1. [Gifine][1]
2. [Gifine Download/Installation/Setup][2]
3. [Gifine Usage][3]
4. [Conclusion][4]
It won't be a stretch to say - and you'll likely agree - that animated gifs have become a rage in the past few years. While one of the most popular uses of animated gifs is to add humor to the text-based conversation that people usually have online, there are many other areas where these animations prove to be really useful.
Those in technical spheres usually use animated gifs to quickly describe how a problem or an error gets triggered. It's also a useful way of explaining how a particular feature in a software application works. You can easily use gifs in online forums, your company presentations, and more. 
Now, suppose you have various applications opened on your Linux desktop, and for whatever purpose, you want to create an animated gif out of your activity with a particular application that's occupying only a small area of your desktop. What would you do? Obviously, look for a tool that lets you do the same.
If you've been looking for one such tool that lets you record a particular region of you desktop and then automatically convert the recording into an animated gif, then look no further, as in this tutorial, we will discuss a Linux command line utility that lets you do just that.
Before we proceed, keep in mind that all the examples in this tutorial have been tested on Ubuntu 14.04 with Bash version 4.3.11(1).
### Gifine
The tool in question is [Gifine][5]. It is is basically a GTK application implemented in MoonScript using lgi. Gifine not only lets you record your desktop screen and create animated gifs or video, but also lets you stitch together short gifs or videos.
According to the application's developer: "You can either load a directory of frames, or select a region of your desktop to record. After loading some frames, you can scroll through them and trim out what isn't necessary. When you've finalized the video you can export to gif or mp4.".
### Gifine Download/Installation/Setup
Before we go ahead and tell you the steps to download and install Gifine, it's worth mentioning that the tool has several dependencies that you need to install before installing the tool itself.
The first dependency that you need to install is FFmpeg, which is basically a cross-platform solution to record, convert and stream audio and video. Following is the command that should install the tool:
```
sudo apt-get install ffmpeg
```
Next up is GraphicsMagick, which is basically an image processing system. "It provides a robust and efficient collection of tools and libraries which support reading, writing, and manipulating an image in over 88 major formats including important formats like DPX, GIF, JPEG, JPEG-2000, PNG, PDF, PNM, and TIFF," the tool's official website says.
Following is the command to download and install it:
```
sudo apt-get install graphicsmagick
```
Next up is a tool dubbed XrectSel. It's basically an application that tells you the geometry of a rectangular screen region which you have selected by dragging the mouse/pointer. The only way to install XrectSel is from source, which you can download by heading [here][6].
Once you've downloaded theXrectSel source code on your system, the next step is extract the downloaded archive and enter the top-level directory on a command line terminal. Once there, run the following commands:
```
./bootstrap
```
The above command is required if ./configure is not present
```
./configure --prefix /usr
make
make DESTDIR="$directory" install
```
Moving on, the last dependency is Gifsicle. It's a command-line tool for creating, editing, and getting information about GIF images and animations. Downloading and installing Gifsicle is quite easy - all you need to do is to run the following command:
```
sudo apt-get install gifsicle
```
So that was all about the dependencies. Now, let us come to the installation of Gifine. The following two commands will do the needful:
```
sudo apt-get install luarocks
sudo luarocks install --server=http://luarocks.org/dev gifine
```
Please note that the second command above may give you the following error:
```
No package 'gobject-introspection-1.0' found
```
In that case, you need to install the package using the following command:
```
sudo apt-get install libgirepository1.0-dev
```
And then run the 'luarocks install' command again.
### Gifine Usage
Once you're done with the installation part, you can launch the tool using the following command:
```
gifine
```
The application's UI looks like this:
[
![Gifine UI](https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/gifine-ui.png)
][7]
So you have a couple of options here: record frames and load frames. If you click the Record rectangle button, then your mouse pointer gets converted into a +, allowing you to select a rectangular area on your screen. As soon as you are done selecting an area, the recording begins, and the 'Record rectangle' button is replaced by a 'Stop recording' button.
[
![Gifine screen recording](https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/gifine-stop-rec.png)
][8]
As soon as you are done with the recording, click the 'Stop recording' button and you'll see that the Gifine window shows several buttons.
[
![Gifine preview](https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/gifine-post-rec.png)
][9]
The upper part of the UI contains the recording, which you can see frame by frame using the slider below it. Suppose you want to delete all the frames before frame 5 or after frame 50, then this can be done using the Trim left of and Trim right of buttons. Then there are also buttons to delete a particular frame, half the number of frames, as well as reset any frame cuts that you've made.
Once you are done with all the editing part, use the Save GIF... or Save MP4... buttons to save the recording as an animated gif or a video. There are options to set frame delay, frame rate, and number of loops as well.
Please keep in mind that "the recorded frames recorded aren't automatically cleaned up. You can find them in your `/tmp` dir if you want to reload a session. Use the load directory button on the initial screen.".
### Conclusion
There's not much of a learning curve associated with Gifine - all the features are available in the form of buttons, and the text on them makes their functionality self explanatory.
The only issue for me was the installation part - installing so many dependencies one by one and then dealing with errors that may pop up could be a big no no for many. But otherwise, on the whole, Gifine is a nice tool that does what it promises, and if that's what you were looking for, do give it a try. 
Already a Gifine user? How has your experience been so far? Let us known in comments below.
--------------------------------------------------------------------------------
via: https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/
作者:[Ansh][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/
[1]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/#gifine
[2]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/#gifine-downloadinstallationsetup
[3]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/#gifine-usage
[4]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/#conclusion
[5]:https://github.com/leafo/gifine
[6]:https://github.com/lolilolicon/xrectsel
[7]:https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/big/gifine-ui.png
[8]:https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/big/gifine-stop-rec.png
[9]:https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/big/gifine-post-rec.png

View File

@ -1,99 +0,0 @@
# Fedora 25: Wayland vs Xorg
Almost as good as Alien vs Predator only much better. Anyhow, as you probably know, I have recently tested [Fedora 25][1]. It was an okay experience. Overall, the distro behaved reasonably well. Not the fastest, but stable enough, usable enough, with some neat improvements here and there. Most importantly, apart from some performance and responsiveness loss, Wayland did not cause my system to melt. But that's just a beginning.
Wayland is in its infancy as a consumer technology, or at least that thing that people take for granted when they do desktop stuff. Therefore, I must continue testing. Never surrender. In the past few weeks of actively using Fedora 25, I did come across a few other issues and problems, some less worrying, some quite disturbing, some odd, some meaningless. Let us elaborate.
![Teaser](http://www.dedoimedo.com/images/computers-years/2016-2/fedora-wayland-xorg-teaser.jpg)
Note: Image taken from [Wikimedia][2] and modified, licensed under [CC BY-SA 3.0][3].
### Wayland does not support everything
Nope. 'Tis a fact. If you go about a Web, doing some reading, you will have learned that all sorts of things are not yet Wayland-ready. Still, we all know Fedora is the state-of-art bleeding-edge distro, and so it's a testbed for pain and discovery. Fair enough. For a while, things were quite all right, no fuss, no errors, but then, I suddenly needed to use GParted. I was in a hurry, troubleshooting a big issue, and now I had to sidetrack myself with pointless extra work. GParted would just not launch under Wayland. Exploring in a bit more detail, I learned that this partitioning software was not supported yet.
![GParted does not run under Wayland](http://www.dedoimedo.com/images/computers-years/2016-2/fedora-wayland-xorg-gparted.jpg)
And the thing is, I do not really know what other applications do not work under Wayland, and I am not really keen to discover that in a moment of true reckoning. Searching online, I wasn't able to find a quick, easy list that details the current incompatibilities. Maybe it's me, and I suck at searching, but something as trivial as "Wayland + compatibility" should be obvious.
What I did find is a [self-argument][4] telling us why Wayland is good, a list of [Gnome][5] applications currently supported under this new thingie, several nerdy pages on ArchWiki, a super-nerdy slit-my-wrists topic on [Nvidia][6]devtalk, and a few other ambiguous discussions.
### Performance, again
On the Fedora 25 box, I changed the login session from Gnome (Wayland) to Gnome Xorg, to see how this affects the system. I didpreviously mention the performance benchmarks and comparison to [Fedora 24][7] on the same laptop - [Lenovo G50][8], but this should give us even more accurate results.
Wayland (screenshot 1) gives us 1.4GB memory use without anything else running, and the CPU averages about 4-5%. Xorg (screenshot 2) tolls the same amount of RAM, and the processor eats 3-4% of its full power. Marginally less in sheer numbers. But then, the experience in the Xorg session is just so much better. It's milliseconds alright, but you can feel it. The legacy session seems to be ever so slightly sprightlier, faster, fresher. The lag is less noticeable. If you are sensitive as to how your desktop responds, you will not be happy with this penalty. Sure, this may only be a bit of sub-optimized beginner's luck, and Wayland may improve over time. But it's also something we cannot ignore.
![Wayland resources](http://www.dedoimedo.com/images/computers-years/2016-2/fedora-wayland-xorg-resources-wayland.jpg)
![Xorg resources](http://www.dedoimedo.com/images/computers-years/2016-2/fedora-wayland-xorg-resources-xorg.jpg)
### Let's rant
I am not happy with this. Not massively angry, but I don't like that I actually need to login into the classic X session to be able to fully enjoy my desktop experience. Because X gives me 100%. Wayland does not. That means, at the end of the day, I will not be using Wayland. I like exploring technology, but I am not a zealot on some holy big-endian pilgrimage. I just want to use my desktop, and sometimes, I might even need things fast. Logging out and back in can be an annoying hassle in a moment of need. And the reason why we have this issue is because Wayland is not there to make life easier for Linux desktop users. Quite the opposite. Quote:
Wayland is intended as a simpler replacement for X, easier to develop and maintain. GNOME and KDE are expected to be ported to it.
And you see, that's part of the problem. Stuff should not be designed to be easier to developer or maintain. That can be a beneficial by-product provided all other customer requirements are met. But if they are not, then it does not matter how hard or simple it is for programmers to hammer code. That's their job. The whole purpose of technology is to support the end state - in this case, a seamless and smooth user experience.
Unfortunately, a large number of products today are being re-invented and re-developed for the sake of making it easier for software people and not for the users. To a large extent, Gnome 3, PulseAudio, [Systemd][9], and Wayland, they all serve no higher user experience purpose. They are quite intrusive in that sense, and they do not contribute to the stability and simplicity of the Linux desktop ecosystem.
This is one of primary reasons why Linux desktop is a relatively immature product - it is designed to self-support the people developing it, almost like a living organism. It's not there to be the slave to the whims and wishes of the user. And that's how great things are done. You satisfy the primary need, and only then worry about the details. Great user experience does not depend - and should never depend - on the choice of programming language, compiler or any nonsense like that. If it does, that whoever designed the product has not done the abstraction piece well enough, and we have a failed thing that needs to be removed from existence.
And so, from my perspective, I don't care if it takes 10 liters of blood to compile one version of X or whatever. I'm a user. All I care is that my desktop works as robustly as did it yesterday or 5 years ago. If that's not happening, I'm not interested in macros, classes, variables, declarations, structs, or any other geeky CS technobabble. That's irrelevant. And a product that advertises itself as being created to be convenient for the people developing it is a paradox. Don't develop it, then. Makes things even easier.
Now, the reality is, Wayland is largely ok - but it is still not as good as X, and as such it should not be offered as a production-ready item on any desktop. Once it can replace the old technology so seamlessly no one ever knows about it, only then will it have succeeded in what it needs to achieve, and then, it can be written in C or D or K language, and it can have anything the developers want. Until then, it's a parasite that eats on the resources and peoples' nerves.
Don't get me wrong. We need progress. We need change. But it has to serve an evolutionary purpose. Does X handle the user needs well today? Can it do graphics support for 3rd party blobs? Can it support HD and UHD and DPI and whatnot? Can you play the latest games on it? Yes? No? If not, then it needs to be fixed. Those are the evolutionary drivers. Not the difficulty of writing and compiling code. Software developers are the coal miners of the digital industry, and they need to work hard to make users happy. As a phrase 'easier to develop' should be outlawed, and people who like it need to be electrocuted by old radio batteries and then exiled to Mars in non-A/C spaceships. If you can't write smart code, it's your problem. The user should not suffer because developers think they're princesses.
### Conclusion
Here we are. In general, Wayland is not bad. It's okay. But that's like saying you are earning 83% today compared to 100% yesterday only because someone decided to change the layout of your payslip. Not acceptable in that sense, even if Wayland works fairly well. It's the stuff that does not work that makes all the difference. Ignoring the whole rant side of it, Wayland introduced reduced usability, performance and app wise, and this is something Fedora will have to sort out fast.
Other distros will follow, and we will be seeing a recurring pattern. The same happened with Gnome 3\. The same happened with Systemd. Less than fully ready technologies are unleashed into the open, and then we spend a year or two fixing things that needed no fixing, and eventually, we will have the same functionality we already have, only created in a different programming language. Not interested. CS used to be all glamor in 1999, when Excel users were making USD50/hour. Today, programming is the undeserving oar galley, and people don't care for the sweat and blister under the deck.
Performance is probably less of an issue, because you can give up on 1-2% change, especially since it can randomly come from any which factor. You will know this if you've used Linux for more than a year or two. But not being able to launch programs is a big deal. At the very least, Fedora graciously offers the legacy platform, too. But then, it may be gone before Wayland reaches 100% maturity. Here we go again. So no, there's no disaster. My original Fedora 25 claim stands in this regard. What we have is annoyance. Unnecessary annoyance. Ah well. The story of Linux, part 9000.
And so, at the end of the day, with everything said and done, what we learned here is: KNEEL BEFORE XORG! OMG. That's so good, I will now fade into the background while the chuckles off your merriment carry off into the frosty night. So long.
Cheers.
--------------------------------------------------------------------------------
作者简介:
My name is Igor Ljubuncic. I'm more or less 38 of age, married with no known offspring. I am currently working as a Principal Engineer with a cloud technology company, a bold new frontier. Until roughly early 2015, I worked as the OS Architect with an engineering computing team in one of the largest IT companies in the world, developing new Linux-based solutions, optimizing the kernel and hacking the living daylights out of Linux. Before that, I was a tech lead of a team designing new, innovative solutions for high-performance computing environments. Some other fancy titles include Systems Expert and System Programmer and such. All of this used to be my hobby, but since 2008, it's a paying job. What can be more satisfying than that?
From 2004 until 2008, I used to earn my bread by working as a physicist in the medical imaging industry. My work expertise focused on problem solving and algorithm development. To this end, I used Matlab extensively, mainly for signal and image processing. Furthermore, I'm certified in several major engineering methodologies, including MEDIC Six Sigma Green Belt, Design of Experiment, and Statistical Engineering.
I also happen to write books, including high fantasy and technical work on Linux; mutually inclusive.
Please see my full list of open-source projects, publications and patents, just scroll down.
For a complete list of my awards, nominations and IT-related certifications, hop yonder and yonder please.
-------------
via: http://www.dedoimedo.com/computers/fedora-25-wayland-vs-xorg.html
作者:[Igor Ljubuncic][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.dedoimedo.com/faq.html
[1]:http://www.dedoimedo.com/computers/fedora-25-gnome.html
[2]:https://commons.wikimedia.org/wiki/File:DragonCon-AlienVsPredator.jpg
[3]:https://creativecommons.org/licenses/by-sa/3.0/deed.en
[4]:https://wayland.freedesktop.org/faq.html
[5]:https://wiki.gnome.org/Initiatives/Wayland/Applications
[6]:https://devtalk.nvidia.com/default/topic/925605/linux/nvidia-364-12-release-vulkan-glvnd-drm-kms-and-eglstreams/
[7]:http://www.dedoimedo.com/computers/fedora-24-gnome.html
[8]:http://www.dedoimedo.com/computers/lenovo-g50-distros-second-round.html
[9]:http://www.ocsmag.com/2016/10/19/systemd-progress-through-complexity/

View File

@ -1,3 +1,4 @@
ucasFL translating
How to Install Ubuntu with Separate Root and Home Hard Drives
============================================================

View File

@ -1,177 +0,0 @@
How to Install or Upgrade to Latest Kernel Version in CentOS 7
============================================================
by [Gabriel Cánepa][14] | Published: March 1, 2017 | Last Updated: March 6, 2017
 Download Your Free eBooks NOW - [10 Free Linux eBooks for Administrators][15] | [4 Free Shell Scripting eBooks][16]
Although some people use the word Linux to represent the operating system as a whole, it is important to note that, strictly speaking, Linux is only the kernel. On the other hand, a distribution is a fully-functional system built on top of the kernel with a wide variety of application tools and libraries.
During normal operations, the kernel is responsible for performing two important tasks:
1. Acting as an interface between the hardware and the software running on the system.
2. Managing system resources as efficiently as possible.
To do this, the kernel communicates with the hardware through the drivers that are built into it or those that can be later installed as a module.
For example, when an application running on your machine wants to connect to a wireless network, it submits that request to the kernel, which in turns uses the right driver to connect to the network.
**Suggested Read:** [How to Upgrade Kernel in Ubuntu][1]
With new devices and technology coming out periodically, it is important to keep our kernel up to date if we want to make the most of out them. Additionally, updating our kernel will help us to leverage new kernel functions and to protect ourselves from vulnerabilities that have been discovered in previous versions.
Ready to update your kernel on CentOS 7 or one of their derivatives such as RHEL 7 and Fedora? If so, keep reading!
### Step 1: Checking Installed Kernel Version
When we install a distribution it includes a certain version of the Linux kernel. To show the current version installed on our system we can do:
```
# uname -sr
```
The following image shows the output of the above command in a CentOS 7 server:
[
![Check Kernel Version in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/03/Check-Kernel-Version-in-CentOS-7.png)
][2]
Check Kernel Version in CentOS 7
If we now go to [https://www.kernel.org/][3], we will see that the latest kernel version is 4.10.1 at the time of this writing (other versions are available from the same site).
One important thing to consider is the life cycle of a kernel version if the version you are currently using is approaching its end of life, no more bug fixes will be provided after that date. For more info, refer to the [kernel Releases][4] page.
### Step 2: Upgrading Kernel in CentOS 7
Most modern distributions provide a way to upgrade the kernel using a [package management system such as yum][5] and an officially-supported repository.
However, this will only perform the upgrade to the most recent version available from the distributions repositories not the latest one available in the [https://www.kernel.org/][6]. Unfortunately, Red Hat only allows to upgrade the kernel using the former option.
As opposed to Red Hat, CentOS allows the use of ELRepo, a third-party repository that makes the upgrade to a recent version a kernel.
To enable the ELRepo repository on CentOS 7, do:
```
# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
```
[
![Enable ELRepo in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/03/Enable-ELRepo-in-CentOS-7.png)
][7]
Enable ELRepo in CentOS 7
Once the repository has been enabled, you can use the following command to list the available kernel.related packages:
```
# yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
```
[
![Yum - Find Available Kernel Versions](http://www.tecmint.com/wp-content/uploads/2017/03/Yum-Find-Available-Kernel-Versions.png)
][8]
Yum Find Available Kernel Versions
Next, install the latest mainline stable kernel:
```
# yum --enablerepo=elrepo-kernel install kernel-ml
```
[
![Install Latest Kernel Version in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/03/Install-Latest-Kernel-Version-in-CentOS-7.png)
][9]
Install Latest Kernel Version in CentOS 7
Finally, reboot your machine to apply the latest kernel, and then run following command to check the kernel version:
```
uname -sr
```
[
![Verify Kernel Version](http://www.tecmint.com/wp-content/uploads/2017/03/Verify-Kernel-Version.png)
][10]
Verify Kernel Version
### Step 3: Set Default Kernel Version in GRUB
To make the newly-installed version the default boot option, you will have to modify the GRUB configuration as follows:
Open and edit the file /etc/default/grub and set `GRUB_DEFAULT=0`. This means that the first kernel in the GRUB initial screen will be used as default.
```
GRUB_TIMEOUT=5
GRUB_DEFAULT=0
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
```
Next, run the following command to recreate the kernel configuration.
```
# grub2-mkconfig -o /boot/grub2/grub.cfg
```
[
![Set Kernel in GRUB](http://www.tecmint.com/wp-content/uploads/2017/03/Set-Kernel-in-GRUB.png)
][11]
Set Kernel in GRUB
Reboot and verify that the latest kernel is now being used by default.
[
![Booting Default Kernel Version in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/03/Booting-Default-Kernel-Version.png)
][12]
Booting Default Kernel Version in CentOS 7
Congratulations! You have upgraded your kernel in CentOS 7!
##### Summary
In this article we have explained how to easily upgrade the Linux kernel on your system. There is yet another method which we havent covered as it involves compiling the kernel from source, which would deserve an entire book and is not recommended on production systems.
Although it represents one of the best learning experiences and allows for a fine-grained configuration of the kernel, you may render your system unusable and may have to reinstall it from scratch.
If you are still interested in building the kernel as a learning experience, you will find instructions on how to do it at the [Kernel Newbies][13] page.
As always, feel free to use the form below if you have any questions or comments about this article.
--------------------------------------------------------------------------------
作者简介:
I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/install-upgrade-kernel-version-in-centos-7/
作者:[Matei Cezar][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/cezarmatei/
[1]:http://www.tecmint.com/upgrade-kernel-in-ubuntu/
[2]:http://www.tecmint.com/wp-content/uploads/2017/03/Check-Kernel-Version-in-CentOS-7.png
[3]:https://www.kernel.org/
[4]:https://www.kernel.org/category/releases.html
[5]:http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/
[6]:https://www.kernel.org/
[7]:http://www.tecmint.com/wp-content/uploads/2017/03/Enable-ELRepo-in-CentOS-7.png
[8]:http://www.tecmint.com/wp-content/uploads/2017/03/Yum-Find-Available-Kernel-Versions.png
[9]:http://www.tecmint.com/wp-content/uploads/2017/03/Install-Latest-Kernel-Version-in-CentOS-7.png
[10]:http://www.tecmint.com/wp-content/uploads/2017/03/Verify-Kernel-Version.png
[11]:http://www.tecmint.com/wp-content/uploads/2017/03/Set-Kernel-in-GRUB.png
[12]:http://www.tecmint.com/wp-content/uploads/2017/03/Booting-Default-Kernel-Version.png
[13]:https://kernelnewbies.org/KernelBuild
[14]:http://www.tecmint.com/author/gacanepa/
[15]:http://www.tecmint.com/10-useful-free-linux-ebooks-for-newbies-and-administrators/
[16]:http://www.tecmint.com/free-linux-shell-scripting-books/

View File

@ -1,129 +0,0 @@
How to install Fedora 25 on your Raspberry Pi
============================================================
### Check out this step-by-step tutorial.
![How to install Fedora 25 on your Raspberry Pi](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/gnome_raspberry_pi_fedora.jpg?itok=Efm6IKxP "How to install Fedora 25 on your Raspberry Pi")
>Image by : opensource.com
In October 2016, the release of Fedora 25 Beta was announced, along with initial [support for the Raspberry Pi 2 and 3][6]. The final "general availability" version of Fedora 25 was released a month later, and since then I have been playing around with the many different Fedora spins available for the latest versions of the Raspberry Pi.
This article is not as much a review of Fedora 25 on the Raspberry Pi 3 as a collection of tips, screenshots, and my own personal thoughts on the very first officially supported version of Fedora for the Pi.
More on Raspberry Pi
* [Our latest on Raspberry Pi][1]
* [What is Raspberry Pi?][2]
* [Getting started with Raspberry Pi][3]
* [Send us your Raspberry Pi projects and tutorials][4]
Before I start, it is worth mentioning that all of the work I have done to write this article was done on my personal laptop, which is running Fedora 25\. I used a microSD to SD adapter to copy and edit all of the Fedora images into a 32GB microSD card, which I used to boot up my Raspberry Pi 3 on a Samsung TV. The Raspberry Pi 3 used an Ethernet cable connection for network connectivity because the built-in Wi-Fi is not yet supported by Fedora 25\. Finally, I used a Logitech K410 wireless keyboard and touchpad for input.
If you don't have the opportunity to use an Ethernet wire connection to play around with Fedora 25 on your Raspberry Pi, I was able to get an Edimax Wi-Fi USB adapter to work on Fedora 25 as well, but for the purposes of this article, I only used the Ethernet connection.
### Before you install Fedora 25 on your Raspberry Pi
Read over the [Raspberry Pi support documentation][7] on the Fedora Project wiki. You can download the Fedora 25 images you need for installation from the wiki, and everything that is supported and not supported is listed there. 
Also, be mindful that this is an initially supported version and a lot of new work and support will be coming out with the release of Fedora 26, so feel free to report bugs and share feedback of your own experience with Fedora 25 on the Raspberry Pi via [Bugzilla][8], Fedora's [ARM mailing list][9], or on the Freenode IRC channel #fedora-arm.
### Installation
I downloaded and installed five different Fedora 25 spins: GNOME (Workstation default), KDE, Minimal, LXDE, and Xfce. For the most part, they all had pretty consistent and easy-to-follow steps to ensure my Raspberry Pi 3 would boot up properly. Some have known bugs that people are working on, and some followed standard operating procedure via the Fedora wiki.
![GNOME on Raspberry Pi](https://opensource.com/sites/default/files/gnome_on_rpi.png "GNOME on Raspberry Pi")
Fedora 25 workstation, GNOME on Raspberry Pi 3.
### Steps for installation
1\. On your laptop, download one of the Fedora 25 images for the Raspberry Pi from the links on the support documentation page.
2\. On your laptop, copy the image onto your microSD using either **fedora-arm-installer** or the command line:
**xzcat Fedora-Workstation-armhfp-25-1.3-sda.raw.xz | dd bs=4M status=progress of=/dev/mmcblk0**
Note: **/dev/mmclk0** was the device that my microSD to SD adapter mounted on my laptop, and even though I am using Fedora on my laptop and I could have used the **fedora-arm-installer**, I preferred the command line.
3\. Once you've copied the image,  _don't boot up your system yet_ . I know it is tempting to just go for it, but you still need to make a couple of tweaks.
4\. To keep the image file as small as possible for download convenience, the root file system on the image was kept to a minimum, so you must grow your root filesystem. If you don't, your Pi will still boot up, but if you run **dnf update** to upgrade your system, it will fill up the file system and bad things will happen, so with the microSD still on your laptop grow the partition:
**growpart /dev/mmcblk0 4
resize2fs /dev/mmcblk0p4**
Note: In Fedora, the **growpart** command is provided by **cloud-utils-growpart.noarch** RPM.
5\. Once the file system is updated, you will need to blacklist the **vc4** module. [Read more about this bug.][10]
I recommend doing this before you boot up the Raspberry Pi because different spins will behave in different ways. For example, (at least for me) GNOME came up first after I booted, without blacklisting **vc4**, but after doing a system update, it no longer came up. The KDE spin wouldn't come up at all during the first initial boot. We might as well blacklist **vc4** even before our first boot until the bug is resolved.
Blacklisting should happen in two different places. First, on your microSD root partition, create a **vc4.conf** under **etc/modprode.d/** with content: **blacklist vc4**. Second, on your microSD boot partition add **rd.driver.blacklist=vc4** to the end of the append line in the **extlinux/extlinux.conf** file.
6. Now, you are ready to boot up your Raspberry Pi.
### Booting Up
Be patient, especially for the GNOME and KDE distributions to come up. In the age of SSDs (Solid-State Drives), and almost instant bootups, it's easy to become impatient with write speeds for the Pi, especially the first time you boot. Before the Window Manager comes up for the first time, an initial configuration screen will pop up, which will allow you to configure root password, a regular user, time zones, and networking. Once you get that configured, you should be able to SSH into your Raspberry Pi, which can be very handy for debugging display issues.
### System updates
Once you have Fedora 25 up and running on your Raspberry Pi, you will eventually (or immediately) want to apply system updates.
First, when doing kernel upgrades, become familiar with your **/boot/extlinux/extlinux.conf** file. If you upgrade your kernel, the next time you boot, unless you manually pick the right kernel, you will most likely boot into Rescue mode. The best way to avoid that is to take the five lines that define the Rescue image on your **extlinux.conf** and move them to the bottom of the file, so the latest kernel will automatically boot up next time. You can edit the **/boot/extlinux/extlinux.conf** directly on the Pi or by mounting on your laptop:
**label Fedora 25 Rescue fdcb76d0032447209f782a184f35eebc (4.9.9-200.fc25.armv7hl)
            kernel /vmlinuz-0-rescue-fdcb76d0032447209f782a184f35eebc
            append ro root=UUID=c19816a7-cbb8-4cbb-8608-7fec6d4994d0 rd.driver.blacklist=vc4
            fdtdir /dtb-4.9.9-200.fc25.armv7hl/
            initrd /initramfs-0-rescue-fdcb76d0032447209f782a184f35eebc.img**
Second, if for whatever reason your display goes dark again after an upgrade and you are sure that **vc4** is blacklisted, run **lsmod | grep vc4**. You can always boot into multiuser mode, instead of graphical mode, and run **startx**from the command line. Read the content of **/etc/inittab** for directions on how to switch targets. 
![KDE on Raspberry Pi 3](https://opensource.com/sites/default/files/kde_on_rpi.png "KDE on Raspberry Pi 3")
A Fedora 25 workstation, KDE on Raspberry Pi 3.
### The Fedora spins
Out of all of the Fedora spins I have tried, the only one that gave me a problem was the XFCE spin, and I believe it was due to this [known bug][11].
GNOME, KDE, LXDE, and minimal spins worked pretty well when I followed the steps I've shared here. Given that KDE and GNOME are a bit more resource heavy, I would recommend LXDE and Minimal for anyone who wants to just start playing with Fedora 25 on the Raspberry Pi. If you are a sysadmin who wants a cheap server backed by SELinux to cover your security concerns and all you want is to run your Raspberry Pi as some sort of server and you are happy with an IP address and port 22 open and vi, go with the Minimal spin. For developers or people starting to learn Linux, the LXDE may be the better way to go because it will give quick and easy access to all the GUI-based tools like browsers, IDEs, and clients you may need.
![LXDE on Raspberry Pi 3](https://opensource.com/sites/default/files/lxde_on_rpi.png "LXDE on Raspberry Pi 3")
Fedora 25 workstation, LXDE on Raspberry Pi 3.
It is fantastic to see more and more Linux distributions become available on ARM-based Raspberry Pi computers. For its very first supported version, the Fedora team has provided a polished experience for the everyday Linux user. I will certainly be looking forward to the improvements and bug fixes for Fedora 26.
--------------------------------------------------------------------------------
作者简介:
Anderson Silva - Anderson started using Linux back in 1996. Red Hat Linux, to be more precise. In 2007, his main professional dream became reality when he joined Red Hat as a Release Engineer in IT. Since then he has worked in several different roles at Red Hat from Release Engineer to System Administrator to Senior Manager and Information System Engineer. He is a RHCE and RHCA and an active Fedora Package maintainer.
----------------
via: https://opensource.com/article/17/3/how-install-fedora-on-raspberry-pi
作者:[Anderson Silva][a]
译者:[译者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/ansilva
[1]:https://opensource.com/tags/raspberry-pi?src=raspberry_pi_resource_menu
[2]:https://opensource.com/resources/what-raspberry-pi?src=raspberry_pi_resource_menu
[3]:https://opensource.com/article/16/12/getting-started-raspberry-pi?src=raspberry_pi_resource_menu
[4]:https://opensource.com/article/17/2/raspberry-pi-submit-your-article?src=raspberry_pi_resource_menu
[5]:https://opensource.com/article/17/3/how-install-fedora-on-raspberry-pi?rate=gIIRltTrnOlwo4h81uDvdAjAE3V2rnwoqH0s_Dx44mE
[6]:https://fedoramagazine.org/raspberry-pi-support-fedora-25-beta/
[7]:https://fedoraproject.org/wiki/Raspberry_Pi
[8]:https://bugzilla.redhat.com/show_bug.cgi?id=245418
[9]:https://lists.fedoraproject.org/admin/lists/arm%40lists.fedoraproject.org/
[10]:https://bugzilla.redhat.com/show_bug.cgi?id=1387733
[11]:https://bugzilla.redhat.com/show_bug.cgi?id=1389163
[12]:https://opensource.com/user/26502/feed
[13]:https://opensource.com/article/17/3/how-install-fedora-on-raspberry-pi#comments
[14]:https://opensource.com/users/ansilva

View File

@ -0,0 +1,88 @@
消沉的程序员系列漫画
=========================
### 消沉的程序员 1
![depressed-developer](https://github.com/GHLandy/comic/raw/master/depressed-developer-series/depressed-developer.png)
很有意思吧很多看到这样的漫画对话的程序员应该感觉似曾相识吧。Bug 出现了?
### 消沉的程序员 2
![depressed-developer](https://github.com/GHLandy/comic/raw/master/depressed-developer-series/depressed-developer-2.png)
有点疑惑,有好像有点眉目,好像是感觉到哪里错了,是不是要重构。
### 消沉的程序员 3
![depressed-developer](https://github.com/GHLandy/comic/raw/master/depressed-developer-series/depressed-developer-3.png)
哎,终于发现错误了,感觉有点可笑,自己居然犯这样的错误,原来是那次急于提交代码造成的。
### 消沉的程序员 4
![depressed-developer](https://github.com/GHLandy/comic/raw/master/depressed-developer-series/depressed-developer-4.png)
是啊,在编程里一生戎马,代码编写无数,各种平台、规范等等,到头来也是满身的错误啊。该是技术不行吧!
### 消沉的程序员 5
![depressed-developer](https://github.com/GHLandy/comic/raw/master/depressed-developer-series/depressed-developer-5.png)
呀,快要消除错误了,可是,不对。相信事后的 Bug 和 Debug 会是程序员生活中的一个部分。
### 消沉的程序员 6
![depressed-developer](https://github.com/GHLandy/comic/raw/master/depressed-developer-series/depressed-developer-6.png)
每个新建的工程都是有美好的设想吧,可后来为什么总是渐行渐远?大多时候的自言自语,总是是有人认为是在和代码对话吧?可没有身在其中,别人有这么懂得!
### 消沉的程序员 7
![depressed-developer](https://github.com/GHLandy/comic/raw/master/depressed-developer-series/depressed-developer-7.png)
好吧产品的上线总是要经过无数次的创建分支Bug 和 Debug 总还是程序员的永恒话题。其中,有些东西总免不了自己推翻自己,感觉要从头再来一样。
### 消沉的程序员 10
![depressed-developer](https://github.com/GHLandy/comic/raw/master/depressed-developer-series/depressed-developer-10.png)
为了某项专门的研究,学习一门相关的语言,不知道是不是值得?是不是先要思考其必要性呢?最后发现自己并不喜欢这么语言,导致怀疑自己的专业技能,这样大概不好吧!
### 消沉的程序员 11
![depressed-developer](https://github.com/GHLandy/comic/raw/master/depressed-developer-series/depressed-developer-11.png)
其实,本来是愉快的蹲个坑,却不自觉的陷入编码的思考。想想,不仅是程序员,很多人有都有类似此景的情况吧,明明在做着某事,却想着另外一件事。
### 后记
看至此处,各位朋友是不是感觉少了系列的第 8 和第 9 篇?起初,译者也这么想,后来问了作者 Daniel Stori 之后,才恍然,原来序号采用了八进制,按照作者说的,一个隐式的玩笑。明白了吗,朋友们?
大伙儿都习惯了日常的十进制。当常态处于优先级的时候,日常一些非常态就如同细枝末节,也就往往容易被人们忽略。大概就是这样吧。
-------------------------------
译者简介:
[GHLandy](http://GHLandy.com) —— 生活中所有欢乐与苦闷都应藏在心中,有些事儿注定无人知晓,自己也无从说起。
-------------------------------
via:
- http://turnoff.us/geek/the-depressed-developer/
- http://turnoff.us/geek/the-depressed-developer-2/
- http://turnoff.us/geek/the-depressed-developer-3/
- http://turnoff.us/geek/the-depressed-developer-4/
- http://turnoff.us/geek/the-depressed-developer-5/
- http://turnoff.us/geek/the-depressed-developer-6/
- http://turnoff.us/geek/the-depressed-developer-7/
- http://turnoff.us/geek/the-depressed-developer-10/
- http://turnoff.us/geek/the-depressed-developer-11/
作者:[Daniel Stori][a]
译者:[GHLandy](https://github.com/GHLandy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://turnoff.us/about/

View File

@ -0,0 +1,153 @@
如何在 Linux 上录制你的桌面 GIF 动画 ?
============================================================
### 本文导航
1. [Gifine][1]
2. [Gifine 下载/安装/配置][2]
3. [Gifine 使用][3]
4. [总结][4]
不用我说,你也知道 GIF 动画在过去几年发展迅速。人们经常在线上文字交流时使用动画增添趣味,同时这些动画在很多其他地方也显得非常有用。
在技术领域使用动画能够很快的描述出现的问题或者返回的错误。它也能很好的展现出一个软件应用产品的特性。你可以在进行线上座谈会或者在进行公司展示时使用 GIF 动画,当然,你可以在更多的地方用到它。
现在,假设你的电脑桌面上打开了多个应用程序,或者无论出于什么目的,你想制作一个 GIF 动画来记录桌面上一个应用程序窗口的操作过程。你应该怎么做呢?显然,你需要一个工具来完成这件事。
如果你正在寻找了这样一个可以记录桌面上部分区域的工具,并且它可以自动把录屏转化成 GIF 动画; 现在,本教程会介绍一个 Linux 命令行工具来实现你的需求。
开始之前,你必须知道在本教程中所有的例子都是在 Ubuntu 14.04 上测试过的,它的 Bash 版本是 4.3.11(1) 。
### Gifine
这个工具的主页是 [Gifine][5] 。它基于 GTK 工具包,并且由 MoonScript 使用 lgi 库编写。Gifine 不仅能够录屏、创建动画或视频,而且能够用它来把几个小型动画或视频拼接在一起。
引述这个工具的开发者的话:“你可以加载一个视频目录或者选择一个桌面的区域进行录屏。你加载了一些视频后,可以不用裁剪通过滑动滑块查看视频帧。最终完成录屏后可以导出为 gif 或者 mp4 文件。”
### Gifine 下载/安装/配置
在指引你下载和安装 Gifine 之前,应该指出安装这个工具时需要安装的依赖包。
首先需要安装的依赖包是 FFmpeg , 这个包是一种记录、转化音频流以及视频的跨平台解决方案。使用下列命令安装这个工具;
```
sudo apt-get install ffmpeg
```
接下来是基于图像处理系统的 GraphicsMagick . 这个工具的官网说:"它提供了一个稳健且高效的工具和库的集合,支持读写并且可以操作超过 88 种主要的图像格式,比如: DPX、 GIF、 JPEG、 JPEG-2000、 PNG、 PDF、 PNM 以及 TIFF 等"
通过下面的命令安装:
```
sudo apt-get install graphicsmagick
```
接下来的需要的工具是 XrectSel 。在你移动鼠标选择区域的时候,它会显示矩形区域的坐标位置。我们只能通过源码安装 XrectSel ,你可以从 [这里][6] 下载它。
如果你下载了源码,接下来就可以解压下载的文件,进入解压后的目录中。然后,运行下列命令:
```
./bootstrap
```
如果 configure 文件不存在,就需要使用上面的命令
```
./configure --prefix /usr
make
make DESTDIR="$directory" install
```
最后的依赖包是 Gifsicle 。这是一个命令行工具,可以创建、编辑、查看 GIF 图像和动画的属性信息。下载和安装 Gifsicle 相当容易,你只需要运行下列命令:
```
sudo apt-get install gifsicle
```
这些是所有的依赖包。现在,我们开始安装 Gifine 。使用下面的命令完成安装。
```
sudo apt-get install luarocks
sudo luarocks install --server=http://luarocks.org/dev gifine
```
请注意第二个命令可能会返回下列错误:
```
No package 'gobject-introspection-1.0' found
```
你可以用下列命令安装这个包:
```
sudo apt-get install libgirepository1.0-dev
```
然后,再一次运行 'luarocks install' 命令。
.
### Gifine 使用
完成安装之后可以使用下面的命令运行这个工具:
```
gifine
```
这个应用程序的 UI 是这样的:
[
![Gifine UI](https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/gifine-ui.png)
][7]
这里你可以进行两种操作:录视频帧或者加载视频帧。如果你单击了 Record rectange 按钮,你的鼠标指针处会变成一个 + 这样便可以在你的屏幕上选择一个矩形区域。一旦你选择了一个区域录屏就开始了Record rectangule 按钮就会变成 'Stop recording' 按钮。
[
![Gifine screen recording](https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/gifine-stop-rec.png)
][8]
单击 'Stop recording' 完成录屏,会在 Gifine 窗口出现一些按钮。
[
![Gifine preview](https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/gifine-post-rec.png)
][9]
用户界面的上半部分显示已经录制的视频帧,你可以使用它下面的滑块进行帧到帧的浏览。如果你想要删除第 5 帧之前或第 50 帧之后的所有帧数,你可以使用 Trim left of 和 Trim rigth of 按钮进行裁剪。也有可以删除特定帧数和删除一半帧数的按钮,当然,你可以重置所有的裁剪操作。
完成了所有的裁剪后,可以使用 Save GIF... 或 Save MP4... 按钮将录屏保存为动画或者视频;你会看到可以设置帧延迟、帧率以及循环次数的选项。
记住,“录屏帧数不会自动清除。如果你想重新加载,可以在初始屏幕中使用 load directory 按钮在 '/tmp' 目录中找到它们。“
### 总结
Gifine 的学习曲线并不陡峭 —— 所有的功能都会以按钮、文本的形式体现出来。
对我来说,最大的问题是安装 —— 需要一个个安装它的依赖包还要处理可能出现的错误这会困扰很多人。否则从整体上看Gifine 绝对称得上是一个不错的工具,如果你正在寻找这样的工具,不妨一试。
已经是 Gifine 用户?到目前为止你得到了什么经验?在评论区告诉我们。
--------------------------------------------------------------------------------
via: https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/
作者:[Ansh][a]
译者:[vim-kakali](https://github.com/vim-kakali)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/
[1]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/#gifine
[2]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/#gifine-downloadinstallationsetup
[3]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/#gifine-usage
[4]:https://www.howtoforge.com/tutorial/record-screen-to-animated-gif-on-linux/#conclusion
[5]:https://github.com/leafo/gifine
[6]:https://github.com/lolilolicon/xrectsel
[7]:https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/big/gifine-ui.png
[8]:https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/big/gifine-stop-rec.png
[9]:https://www.howtoforge.com/images/record-screen-to-animated-gif-on-linux/big/gifine-post-rec.png

View File

@ -1,12 +1,7 @@
Linux 命令行工具使用小贴士及技巧 ——(一)
============================================================
### 相关内容
- [Linux 命令行工具使用的一些小技巧][3]
- [轻松切换目录 —— 快捷方式][1]
- [轻松切换目录 —— 相关细节][2]
- [总结][4]
### 相关内容
如果你刚开始在 Linux 系统中使用命令行工具,那么应该了解它是 Linux 操作系统中功能最强大和有用的工具之一。学习的难易程度跟你想研究的深度有关。但是,无论你的技术能力水平怎么样,这篇文章中的一些小贴士和技巧都会对你有所帮助。
@ -14,11 +9,11 @@ Linux 命令行工具使用小贴士及技巧 ——(一)
**但是在开始下一步之前,我得强调一点,这篇文章中的测试实例都是在 Ubuntu 14.04LTS 系统下测试通过的。我们使用命令行 Shell 版本是 bash 4.3.11 。**
### Linux 命令行小技巧
### Linux 命令行工具使用的一些小技巧
我们假设你已经掌握了一些 Linux 命令行的基础知识,比如什么是 root 账号及 home 目录,什么是环境变量,如何查看目录内容等等。说明这些小技巧的同时也会介绍涉及到的概念,如果有的话。
### 轻松切换目录 —— 快捷方式
#### 轻松切换目录 —— 快捷方式
假设你正在命令行下做一些操作,并且你需要经常在两个目录间来回切换。而且这两个目录在完全不同的两个路径下,比如说,分别在 /home/ 和 /usr/ 下。你会怎么做呢?
@ -55,7 +50,7 @@ cd -
有一点我得跟大家强调下,如果你在操作的过程中使用 cd 加路径的方式切换到第三个目录下,那么 **cd -** 命令将应用于当前目录及第三个目录之间进行切换。
### 轻松切换目录 —— 相关细节
#### 轻松切换目录 —— 相关细节
对于那些有强烈好奇心的用户,他们想搞懂 **cd -** 的工作原理,解释如下:如大家所知道的那样, cd 命令需要加上一个路径作为它的参数。现在,当 - 符号作为参数传输给 cd 命令时,它将被 OLDPWD 环境变量的值所替代。
@ -136,10 +131,6 @@ via: https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/
[1]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/#easily-switch-between-two-directories-the-quick-tip
[2]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/#easily-switch-between-two-directories-related-details
[3]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/#linux-command-line-tipstricks
[4]:https://www.howtoforge.com/tutorial/linux-command-line-navigation-tips-and-tricks-part-1/#conclusion
[5]:https://www.howtoforge.com/images/linux-command-line-tips-for-beginners/big/cmd-line-tips.png
[6]:https://www.howtoforge.com/images/linux-command-line-tips-for-beginners/big/cmd-line-tips-oldpwd.png
[7]:https://www.howtoforge.com/images/linux-command-line-tips-for-beginners/big/cmd-line-tips-no-oldpwd.png

View File

@ -1,172 +0,0 @@
如何配合自定义的 SSH 来简化远程访问
===================
SSH (SSH 客户端) 是一个用于访问远程主机的程序,它使得用户能够 [在远程主机上执行命令][2]。这是在登录远程主机中的最受推崇的方法之一,因为其设计目的就是为两台不可信任主机通过不安全网络环境的通信提供安全加密。
SSH 使用系统全局以及用户指定 (用户自定义) 的配置文件。在本文中,我们将介绍如何创建一个自定义的 ssh 配置文件,并且通过确切的选项来链接到远程主机。
#### 先决条件:
1. 你必须 [在你的桌面 Linux 上安装好 OpenSSH 客户端][1]。
2. 理解通过 ssh 进行远程连接的常用选项
#### SSH 客户端配置文件
以下为 ssh 客户端配置文件:
1. `/etc/ssh/ssh_config` 为默认的配置文件,属于系统全局配置文件,包含应用到所有用户的 ssh 客户端的设置。
2. `~/.ssh/config` 或者 `$HOME/.ssh/config` 为用户指定/自定义配置文件,这个文件中的配置只对至指定的用户有效,因此,它是会覆盖掉默认的系统全局配置文件中的设置的。这也是我们要创建和使用的文件。
默认情况下,用户是是通过在 ssh 中输入密码来获取验证的,你可以以一个简单的步骤来 [使用 Keygen 来设置 ssh 无密码登录][3]。
注:如果你的系统上不存在 `~/.ssh`,那就手动创建它,并设置如下权限:
```
$ mkdir -p ~/.ssh
$ chmod 0700 ~/.ssh
```
以上的 chmod 命令表明,只有目录属主对该目录有读取、写入和执行权限,这也是 ssh 所要求的设置。
### 如何创建用户指定的 SSH 配置文件
该文件并不会被默认创建的,所以你需要使用具有读取/写入权限的用来来创建它。
```
$ touch ~/.ssh/config
$ chmod 0700 ~/.ssh/config
```
上述文件包含由特定主机定义的各个部分,并且每个部分只应用到主机定义中相匹配的部分。
`~/.ssh/config` 文件的常见格式如下,其中所有的空行和以 `#` 开头的行为注释:
```
Host host1
ssh_option1=value1
ssh_option2=value1 value2
ssh_option3=value1
Host host2
ssh_option1=value1
ssh_option2=value1 value2
Host *
ssh_option1=value1
ssh_option2=value1 value2
```
如上格式详解:
1. Host host1 为关于 host1 定义的头部,主机定义就从此处开始,直到下一个定义头部 Host host2 出现,这样形成一个完整的定义。
2. host1 和 host2 是再命令行中使用的主机别名,并非实际的远程主机名。
3. 其中,如 ssh_option1=value1、ssh_option2=value1 value2 等配置选项将应用到相匹配和想要以一定格式组织的主机。
4. 对于 ssh_option2=value1 value2 这样的选项ssh 执行时会按照顺序优先使用 value1 的值。
5. Host * (其中 `*` 为匹配模式/通配符,匹配零个或多个字符) 定义头部会匹配零个或者多个主机。
仍旧以上述的格式为例ssh 也是也这样的形式类读取配置文件的。如果你执行 shh 命令来访问远程主机 host1如下
```
$ ssh host1
```
以上 ssh 命令会进行一下动作:
1. 匹配配置文件中主机别名 host1并使用定义头部中的各个设置项。
2. 继续匹配下一个 host 定义,通过查找命令行中的名称发现不匹配,所有接下来的各个设置项会被略过。
3. 最后执行到最后一个 host 定义,这会匹配所有的主机。这里,会将接下来的所有设置选项应用到所有的主机连接中。但是它不会覆写之前已经有 host 定义的那些选项。
4. ssh host2 与此类似。
### 如何使用用户指定的 shh 配置文件
在你理解了 ssh 客户端配置文件的工作方式之后,你可以通过如下方式来创建它。记得使用你的服务器环境中对应的选项、值 (主机别名、端口号、用户名等)。
通过你最喜欢的编辑器来打开配置文件:
```
$ vi ~/.ssh/config
```
并定于必要的部分:
```
Host fedora25
HostName 192.168.56.15
Port 22
ForwardX11 no
Host centos7
HostName 192.168.56.10
Port 22
ForwardX11 no
Host ubuntu
HostName 192.168.56.5
Port 2222
ForwardX11 yes
Host *
User tecmint
IdentityFile ~/.ssh/id_rsa
Protocol 2
Compression yes
ServerAliveInterval 60
ServerAliveCountMax 20
LogLevel INFO
```
以上 ssh 配置文件的详细解释:
1. HostName - 定义真正要登录的主机名,此外,你也可以使用数字 IP 地址,不管是在命令行或是 HostName 定义中都运行使用其中任一种。
2. User  指定以哪一个用户来登录。
3. Port  设置连接远程主机的端口,默认是 22 端口。但必须是远程主机的 sshd 配置文件中定义的端口号。
4. Protocol  这个选项定义了优先使用 ssh 支持的协议版本。常用的值为 1  2同时使用两个协议版本则必须使用都厚隔开。
5. IdentityFile  指定读取用户 DSA、Ed25519、ECDSA 等授权验证信息的文件。
6. ForwardX11  定义 X11 链接是否自动重定向到安全通道和 DISPLAY 设置。这两个可以设置的值,即 “yes”  “no”。
7. Compression  默认值为 “no”如果设置为 “yes”则在连接远程主机过程中使用压缩进程传输。
8. ServerAliveInterval  设置当不在收到服务器响应 (或者数据) 时的过期时间单位为秒ssh 会通过加密信道向发送信息,请求服务器响应。默认值为 0这意味着 ssh 不会向服务器发送响应请求,如果 Batch 选项有定义,则默认是 300s。
9. ServerAliveCountMax  设置服务器活动信息的数值,以便在 ssh 在没有收到服务器响应的情况下发送信息。
10. LogLevel  定义 ssh 登录信息的的日志冗余级别。允许的值为QUIET、 FATAL、ERROR、INFO、VERBOSE、DEBUG、DEBUG1、DEBUG2 和 DEBUG3默认为 INFO。
以上,连接任意远程主机的标准方法, 我连接的是 CentOS 7即定义的第二部分我们可以简单的输入如下命令
```
$ ssh -i ~/.ssh/id_rsa -p 22 tecmint@192.168.56.10
```
然而,使用了 ssh 客户端配置文件之后,我们还可以这样:
```
$ ssh centos7
```
你也可以在 man 帮助页面寻找更多的设置选项和使用实例:
```
$man ssh_config
```
至此,文毕。我们在文中想你介绍了在 Linux 中如何如何使用用户指定 (自定义) 的 ssh 客户端配置文件。通过下方的反馈表单来写一些与本文的相关的想法吧。
------------------------------------------------
作者简介:
Aaron Kili 是一名 Linux 和 F.O.S.S 忠实拥护者、高级 Linux 系统管理员、Web 开发者,目前在 TecMint 是一名活跃的博主,热衷于计算机并有着强烈的只是分享意愿。
-------------------------------------------------
译者简介:
[GHLandy](http://GHLandy.com) —— 生活中所有欢乐与苦闷都应藏在心中,有些事儿注定无人知晓,自己也无从说起。
-------------------------------------------------
via: http://www.tecmint.com/configure-custom-ssh-connection-in-linux/
作者:[Aaron Kili][a]
译者:[GHLandy](https://github.com/GHLandy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/aaronkili/
[1]:http://www.tecmint.com/install-openssh-server-in-linux/
[2]:http://www.tecmint.com/execute-commands-on-multiple-linux-servers-using-pssh/
[3]:http://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/

View File

@ -1,74 +0,0 @@
你应该考虑尝试的5款 Linux 音乐播放器
============================================================
![](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/02/linux-music-players.jpg "5 Linux Music Players You Should Consider Switching Tos")
目前 Linux 有几十个音乐播放器,这使得想要找到一个最好的来使用变成很困难。之前我们已经回顾了其中的一些播放器,如 [Cantata][10] [Exaile][11] ,甚至是不那么出名的 ClementineNightingale和 Quod Libet。
在本篇文章中我将涵盖更多的,在某些方面甚至比之前我们向你介绍的那些更好的 Linux 音乐播放器。
### 1\. Qmmp
[Qmmp][13] 并不是特性最丰富的(或最稳定的) Linux 音乐播放器,但却是我最喜欢的一款,这也是为什么我把它放在第一个。我知道有许多更优秀的播放器,但我却就喜欢这款并且最常使用它。它确实会崩溃,并且也有许多它不能播放的文件,但不管怎样我依然最爱它。上图!
![linux-players-01-qmmp](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/02/Linux-players-01-Qmmp.jpg "linux-players-01-qmmp")
Qmmp 是 Linux 上是 Winamp 的前端。它(相对地)轻量并且具有一个像样的特性集。因为 Winamp 伴随着我的成长并且我很喜欢它的键盘快捷键,当它推出 Linux 版本时对我来说是个惊喜。对于音频格式Qmmp 能够播放大部分流行的格式,如 MPEG1 layer 2/3、Ogg Vorbis 和 Opus、原生的 FLAC/Ogg FLAC、Musepack、WavePack、音轨模块mod、s3m、it、xm 等等、ADTS AAC、CD 音频、WMA、Monkeys Audio以及 FFmpeg 库提供的其他格式、Midi、SID 和 Chiptune 格式AY、GBS、GYM、HES、KSS、NSF、NSFE、SAP、SPC、VGM、VGZ 和 VTX
### 2\. Amarok
[Amarok][14] 是 KDE 的音乐播放器,当然你也可以把它用在其他的桌面环境。它是 Linux 上最古老的音乐播放器之一。这也许是为什么它是如此流行的播放器的一个原因,虽然我个人并不是非常喜欢它。
![linux-players-02-amarok](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/02/Linux-players-02-Amarok.jpg "linux-players-02-amarok")
Amarok 能播放大量的音频格式但它的主要优势是丰富的插件。这个软件附带大量文档虽然它最近没有更新。Amarok 也由于与多样的网页服务,如 Ampache、Jamendo Service、Last.fm、Librivox、MP3tunes、Magnatune 以及 OPML 播客目录的整合而闻名。
### 3\. Rhythmbox
既然我刚刚提到了 Amarok 和 KDE 音乐播放器,那接下来让我们转向 Gnome 的默认音乐播放器, [Rhythmbox][15] 。因为它与 Gnome 一起,你能猜到它是一款流行的软件。它不仅是一款音乐播放器,同时也是一款音乐管理软件。它支持 MP3 和 OGG以及十几种其他的文件格式也包括网络收音机、iPod 服务整合、音频文件播放、音频 CD 刻录和回放、音乐分享以及播客。总而言之,它是款不赖的播放器,但这不意味着你将最喜欢它。如果你安装了它,你可以尝试看看。如果你不喜欢它,尽管看看下个选择。
![linux-players-03-rhythmbox](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/02/Linux-players-03-Rhythmbox.jpg "linux-players-03-rhythmbox")
### 4\. VLC
虽然 [VLC][16] 是作为视频播放器最为出名但单从它支持最多的解码器这一点来看它也同样是一款非常棒的音乐播放器。如果连它都无法播放的一个文件你也不太可能能用其他播放器打开。VLC 具有高度定制性,并且拥有很多扩展。它能够在 WindowsLinuxMac OS XUnixiOSAndroid 等等平台运行。
![linux-players-04-vlc](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/02/Linux-players-04-VLC.jpg "linux-players-04-vlc")
我个人不喜欢 VLC 的一点是它占用太多资源。并且我曾用它打开过一些文件,但回放质量离一流水准还差的很远。这个软件在播放一些其他播放器不难应付的文件时,经常会无故关闭。但很可能与播放器没多大关系,可能是文件本身的问题。尽管 VLC 不属于我常用的程序,我仍然由衷的推荐它。
### 5\. Cmus
如果你钟爱命令行程序,那么 [Cmus][17] 会是你的菜。你能用它来播放 Ogg Vorbis、MP3、FLAC、Opus、Musepack、WavPack、WAV、AAC、MP4、音频 CD 以及 ffmpeg 支持的所有格式WMA、APE、MKA、TTA、SHN 等等)和 libmodplug。你也可以用它来播放 Shoutcast 或者 Icecast 的音频流。他不是特性最丰富的音乐播放器,但它拥有所有的基础及进阶功能。它的主要优势是非常轻量,并且它的内存需求真的很小。
![linux-players-05-cmus](https://maketecheasier-2d0f.kxcdn.com/assets/uploads/2017/02/Linux-players-05-Cmus.jpg "linux-players-05-cmus")
所有的这些音乐播放器在某一方面或另一方面都很棒。我没办法说出哪一款是最好的,这更多取决于个人喜好和需要。所有这些播放器要么是作为发行版的默认选项安装,或者是能在包管理器中被轻松找到。只要打开 新立德包管理器、软件中心或其他任意你的发行版的包管理器,然后搜索并安装它们。你也能使用命令行,或只要双击你从其网站上下载的安装文件。使用何种方法取决于你。
--------------------------------------------------------------------------------
via: https://www.maketecheasier.com/linux-music-players-to-check-out/
作者:[Ada Ivanova][a]
译者:[cycoe](https://github.com/cycoe)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.maketecheasier.com/author/adaivanoff/
[1]:https://www.maketecheasier.com/author/adaivanoff/
[2]:https://www.maketecheasier.com/linux-music-players-to-check-out/#comments
[3]:https://www.maketecheasier.com/category/linux-tips/
[4]:http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.maketecheasier.com%2Flinux-music-players-to-check-out%2F
[5]:http://twitter.com/share?url=https%3A%2F%2Fwww.maketecheasier.com%2Flinux-music-players-to-check-out%2F&text=5+Linux+Music+Players+You+Should+Consider+Switching+To
[6]:mailto:?subject=5%20Linux%20Music%20Players%20You%20Should%20Consider%20Switching%20To&body=https%3A%2F%2Fwww.maketecheasier.com%2Flinux-music-players-to-check-out%2F
[7]:https://www.maketecheasier.com/mastering-disk-utility-mac/
[8]:https://www.maketecheasier.com/airy-youtube-video-downloader/
[9]:https://support.google.com/adsense/troubleshooter/1631343
[10]:https://www.maketecheasier.com/cantata-new-music-player-for-linux/
[11]:https://www.maketecheasier.com/exaile-the-first-media-player-i-dont-hate/
[12]:https://www.maketecheasier.com/the-lesser-known-music-players-for-linux/
[13]:http://qmmp.ylsoftware.com/
[14]:https://amarok.kde.org/
[15]:https://wiki.gnome.org/Apps/Rhythmbox
[16]:http://www.videolan.org/vlc/
[17]:https://cmus.github.io/

View File

@ -0,0 +1,98 @@
# Fedora 25: Wayland 大战 Xorg
就像异形大战铁血战士一样,后者略胜一筹。不管怎样,你可能知道,我最近测试了 [Fedora 25][1]体验还可以。总的来说这个发行版表现的相当不错。它不是最快速的但随着一系列的改进变得足够稳定也足够可用。最重要的是除了一些性能以及响应性的损失Wayland 并没有造成我的系统瘫痪。但这还仅仅是个开始。
Wayland 作为一种消费者技术还处在它的襁褓期,或者至少是当人们在处理桌面事物时应理所当然的这么认为。因此,我必须继续测试,绝不弃坑。在过去的积极地使用 Fedora 25 的几个星期里,我确实碰到了几个其他的问题,有些不用太担心,有些确实很恼人,有些很奇怪,有些却无意义。让我们来讲述一下吧!
![Teaser](http://www.dedoimedo.com/images/computers-years/2016-2/fedora-wayland-xorg-teaser.jpg)
注: 图片来自 [Wikimedia][2] 并做了些修改, 证书为 [CC BY-SA 3.0][3].
### Wayland 并不支持所有软件
当然不,这是一个事实。如果你去网站上阅读相关的信息,你会发现各种各样的软件都还没为 Wayland 做好准备。但是,我们都知道 Fedora 是一个激进的高端发行版,所以它是为了探索新功能的测试床。这很公平。有一段时间,所有东西都很正常,没有瞎忙活,没有错误。但接下来,我突然需要使用 GParted。我当时很着急正在排除一个大故障然后我不得不让自己侧重于无意义的额外工作。 GParted 没办法在 Wayland 下直接启动。在探索了更多一些细节之后,我知道了分区软件目前还没有被支持。
![GParted 无法运行于 Wayland](http://www.dedoimedo.com/images/computers-years/2016-2/fedora-wayland-xorg-gparted.jpg)
问题就在于我并不太清楚其他哪些应用不能在 Wayland 下运行,并且我不能在一个正确估计的时间敏锐地发现。通过在线搜索,我还是不能找到一个目前的简要的不兼容列表。可能只是我,在搜索中遇到了困难,但显然的是一定有什么东西和 "Wayland + 兼容性" 一样琐碎。
我已经找到的是一个告诉我们 Wayland 很棒的[自我评论][4],一个目前已被这个新玩意儿支持的 [Gnome][5] 应用程序列表,一些 ArchWiki 上的死板的资料,一个在 [英伟达][6] 开发论坛上的呆板得让我后悔点进去的主题,以及一些其他含糊的讨论。
### 再次提到性能
在 Fedora 25 上,我把登录会话从 GnomeWayland切换到 Gnome Xorg观察会对系统产生什么影响。我之前已经提到过在同一个笔记本[联想 G50][8])上的性能跑分和与 [Fedora 24][7] 的比较,但这次会给我们提供更加准确的结果。
Wayland截图 1空闲时的内存占用为 1.4GB CPU 的平均负载约为 4-5%。Xorg截图 2占用了同样大小的内存处理器消耗了全部性能的 3-4%,单纯从数字上来看少了一小点。但是 Xorg 会话的体验却好得多。虽然只是毫秒级但你感受的到差距。传统的会话看起来更加的灵动、快速、清新一点。但Wayland落后并不明显。如果你对你的电脑响应速度很敏感你可能不会对这点延迟满意。当然这可能只会成为新手的一点点优化措施Wayland 会随时间进步。但它也是我们所不能忽视的。
![Wayland resources](http://www.dedoimedo.com/images/computers-years/2016-2/fedora-wayland-xorg-resources-wayland.jpg)
![Xorg resources](http://www.dedoimedo.com/images/computers-years/2016-2/fedora-wayland-xorg-resources-xorg.jpg)
### 杂谈
我对此并不高兴。并不是很愤怒,但我不喜欢为了能完全享受我的桌面体验,我却需要登录到传统的 X 会话。因为 X 给了我 100%,但 Wayland 没有。这意味着在一天结束的时候,我不是在用着 Wayland。我喜欢探索科技但我不是一个盲目的狂热追随者。我只是想用我的桌面有时我可能需要它快速响应。注销然后重新登录在急需使用的时候会成为恼人的麻烦。我们遇到这个问题的原因就是 Wayland 没有让 Linux 桌面用户的生活变得更简单,而恰恰相反。引用:
> Wayland 是为了成为 X 的更加简单的替代品,更加容易开发和维护。建议 GNOME 和 KDE 都使用它。
你能看到,这就是问题的一方面原因。东西不应该被设计成容易开发或维护。它能成为所有其他消费需求碰撞后提供的有益的副产品。但如果它们不是,那么不管它对于程序员敲代码来说多么困难或简单都将不重要。那是他们的工作。科技的所有目的都是为了达到一种无缝并且流畅的用户体验。
不幸的是现在很大数量的产品都被重新设计或者开发只是为了使软件人员更加轻松而不是用户。在很大程度上Gnome 3、PulseAudio、[Systemd][9] 和 Wayland 都没有遵循提高用户体验的宗旨。在这个意义上来说,它们更像是一种侵略,而没有为 Linux 桌面生态的稳定性和易用性作出贡献。
这也是为什么 Linux 桌面是一个相对不成熟产品的一个主要原因————它被设计成开发人员的自我支持产品,更像一个活生生的生物。而不是依附于用户各种怪念头和想法的奴隶。这也是伟大事物是如何形成的。你满足于主要需求,接下来只是担心细节方面。优秀的用户体验不依赖于(也永远不依赖于)编程语言、编译器的选择,或任何其他无意义的东西。如果依赖了,那么不管谁来设计这个抽象层做的不够好的产品,我们都会得到一个失败的作品,需要把它的存在抹去。
那么在我的展望中,我不在乎是否要花费 10 升心血,或其他的什么,去编译一个版本。我是一个用户,我所在乎的只是我的桌面能否像它昨天或者 5 年前一样健壮地工作。如果没发生那种事,我不会对宏、类、变量、声明、结构体,或其他任何极客的计算机科技感兴趣。那是不着边际的。一个产品宣传自己是被创造出来为人们的开发提供方便的,那是个悖论。接下来也不用去开发它了。这样反而会使事情更简单。
现在,事实是 Wayland 大体上可用,但它仍然不像 X 那么好。并且它也不应该在任何的桌面上作为就绪的产品被提供。一但它能够无缝取代那人们没听说过的过时技术,到那时,它能够在它需要去实现的目标取得成功。然后,它能够用 C、D 或者 K 语言重写,拥有开发者需要的任何东西。在那之前,它都是一个蚕食资源和人们思想的寄生虫。
不要误会,我们需要进步,需要改变。但它不得不为了进化的目而服务。现在 X 能很好地掌握用户需求了吗?它能为第三方库提供图形支持吗?它能支持 HD、UHD、DPI 或其他的什么吗?你能用它玩最新的游戏吗?是或否?如果不能,那么它需要被修复。这些就是进化的驱动力。而不是写代码或者编译代码的困难程度。软件开发者是数字工业的矿工,他们需要努力工作来使用户开心。就像短语“更加易于开发”应该被取缔一样,那些崇尚于此的人也应该用老式收音机的电池处以电刑,然后用没有空调的飞船流放到火星上去。如果你不能写出高明的代码,那是你的问题。用户不能因为开发者认为自己是公主而遭受折磨。
### 结语
说到这里。大体上说Wayland 还可以,并不差。但这说的就像是某人决定修改你工资单上的布局,导致你从昨天能赚 100% 到今天只能赚 83% 一样。讲道理这是不能接受的,即使 Wayland 工作的相当好。正是那些不能运作的东西导致如此大的不同。忽略所有数落它的一方, Wayland 被认为的降低了可用性、性能以及软件的知名度,正是 Fedora 亟待解决的问题。
其他的发行版会跟进,然后我们会看到一个循环的模式,就像 Gnome 3 和 Systemd 所发生的一样。没有完全准备好的东西被放到开放环境中,然后我们花费一两年时间修复无需修复的东西,最终我们将拥有我们已经拥有的相同功能,只是用不同的编程语言来实现。我并不感兴趣。计算机科学曾在 1999 年非常受欢迎,当时 Excel 用户每小时能赚 50 美元。现在,编程就像是躲在平底船下划桨,人们并不会在乎你在甲板下流下的汗水与磨出的水泡。
性能可能已经不是一个问题,因为你可以放弃 1-2% 的变化,尤其是它会受随机的来自任何一个因素的影响。如果你已经用 Linux 超过一、两年你就会知道的。但是无法启动应用是个大问题。至少 Fedora 也友好地提供了传统的平台。但是,它可能会在 Wayland 100% 成熟前就消失了。我们再来看看,不,不会有灾难。我原本的 Fedora 25 宣称支持这种看法。我们有的就是烦恼,不必要的烦恼。啊,这是 Linux 故事中的第 9000 部。
那么,在今天结束之际,我们已经讨论了所有事情。从中我们学到:臣伏于 Xorg天呐真棒现在我将淡入背景而笑声会将你的欢乐带给寒冷的夜晚。再见
干杯。
--------------------------------------------------------------------------------
作者简介:
我是 Igor Ljubuncic。现在大约 38 岁,已婚但还没有孩子。我现在在一个大胆创新的云科技公司做首席工程师。直到大约 2015 年初,我还在一个全世界最大的 IT 公司之一中做系统架构工程师,和一个工程计算团队开发新的基于 Linux 的解决方案,优化内核以及攻克 Linux 的问题。在那之前,我是一个为高性能计算环境设计创新解决方案的团队的技术领导。还有一些其他花哨的头衔,包括系统专家、系统程序员等等。所有这些都曾是我的爱好,但从 2008 年开始成为了我的有偿的工作。还有什么比这更令人满意的呢?
从 2004 年到 2008 年间我曾通过作为医学影像行业的物理学家来糊口。我的工作专长集中在解决问题和算法开发。为此我广泛地使用了Matlab主要用于信号和图像处理。另外我得到了几个主要的工程方法学的认证包括 MEDIC 六西格玛绿带、试验设计以及统计工程学。
我也写过书包括《Linux 上的高幻想和技术工作》和《相互包容》。
请参阅我的完整开源项目,出版物和专利列表,只需向下滚动。
有关我的奖项、提名和 IT 相关认证的完整列表,请进行跳转。
-------------
via: http://www.dedoimedo.com/computers/fedora-25-wayland-vs-xorg.html
作者:[Igor Ljubuncic][a]
译者:[cycoe](https://github.com/cycoe)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.dedoimedo.com/faq.html
[1]:http://www.dedoimedo.com/computers/fedora-25-gnome.html
[2]:https://commons.wikimedia.org/wiki/File:DragonCon-AlienVsPredator.jpg
[3]:https://creativecommons.org/licenses/by-sa/3.0/deed.en
[4]:https://wayland.freedesktop.org/faq.html
[5]:https://wiki.gnome.org/Initiatives/Wayland/Applications
[6]:https://devtalk.nvidia.com/default/topic/925605/linux/nvidia-364-12-release-vulkan-glvnd-drm-kms-and-eglstreams/
[7]:http://www.dedoimedo.com/computers/fedora-24-gnome.html
[8]:http://www.dedoimedo.com/computers/lenovo-g50-distros-second-round.html
[9]:http://www.ocsmag.com/2016/10/19/systemd-progress-through-complexity/

View File

@ -1,29 +1,26 @@
beyondworld translating
如何在 CentOS 7 上安装和安全配置 MariaDB 10
===========================================
How to Install and Secure MariaDB 10 in CentOS 7
============================================================
**MariaDB** 是 MySQL 数据库的自由开源分支,与 MySQL 在思想上同出一源,在未来仍将是自由且开源的。
在这篇博文中,我将会介绍如何在当前使用最广的 RHEL/CentOS 和 Fedora 发行版上安装 **MariaDB 10.1** 稳定版。
MariaDB is a free and open source fork of well known MySQL database management server software, developed by the brains behind MySQL, its envisioned to remain free/open source.
目前了解到的情况是Red Hat Enterprise Linux/CentOS 7.0 发行版已将默认的数据库从 MySQL 切换到 MariaDB。
In this tutorial, we will show you how to install MariaDB 10.1 stable version in the most widely used versions of RHEL/CentOS and Fedora distributions.
在本文中需要注意的是,我们假定您能够在服务器中使用 root 帐号工作,或者可以使用 [sudo command][7] 运行任何命令。
For your information, Red Hat Enterprise Linux/CentOS 7.0 switched from supporting MySQL to MariaDB as the default database management system.
### 第一步:添加 MariaDB yum 仓库
Note that in this tutorial, well assume your working on the server as root, otherwise, use the [sudo command][7] to run all the commands.
### Step 1: Add MariaDB Yum Repository
1. Start by adding the MariaDB YUM repository file `MariaDB.repo` for RHEL/CentOS and Fedora systems.
1、首先在 RHEL/CentOS 和 Fedora 操作系统中添加 MariaDB 的 YUM 配置文件 `MariaDB.repo` 文件。
```
# vi /etc/yum.repos.d/MariaDB.repo
```
Now add the following lines to your respective Linux distribution version as shown.
根据您操作系统版本,选择下面的相应内容添加到文件的末尾。
#### On CentOS 7
#### 在 CentOS 7 中安装
```
[mariadb]
@ -33,7 +30,7 @@ gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
```
#### On RHEL 7
#### 在 RHEL 7 中安装
```
[mariadb]
@ -46,11 +43,11 @@ gpgcheck=1
![Add MariaDB Yum Repo](http://www.tecmint.com/wp-content/uploads/2017/02/Add-MariaDB-Repo.png)
][8]
Add MariaDB Yum Repo
*添加 MariaDB YUM 仓库*
### Step 2: Install MariaDB in CentOS 7
### 第二步:在 CentOS 7 中安装 MariaDB
2. Once MariaDB repository has been added, you can easily install it with just one single command.
2、当 MariaDB 仓库地址添加好后,你可以通过下面的一行命令轻松安装 MariaDB。
```
# yum install MariaDB-server MariaDB-client -y
@ -59,9 +56,9 @@ Add MariaDB Yum Repo
![Install MariaDB in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/02/Install-MariaDB-in-CentOS-7.png)
][9]
Install MariaDB in CentOS 7
*在 CentOS 7 中安装 MariaDB*
3. As soon as the installation of MariaDB packages completes, start the database server daemon for the time being, and also enable it to start automatically at the next boot like so:
3. MariaDB 包安装完毕后,立即启动数据库服务守护进程,并可以通过下面的操作设置,在操作系统重启后自动启动服务。
```
# systemctl start mariadb
@ -72,11 +69,11 @@ Install MariaDB in CentOS 7
![Start MariaDB Service in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/02/Start-MariaDB-Service-in-CentOS-7.png)
][10]
Start MariaDB Service in CentOS 7
*在 CentOS 7 中启动 MariaDB 服务*
### Step 3: Secure MariaDB in CentOS 7
### 第三步:在 CentOS 7 中对 MariaDB 进行安全配置
4. Now its time to secure your MariaDB by setting root password, disabling remote root login, removing the test database as well as anonymous users and finally reload privileges as shown in the screen shot below:
4. 现在可以通过以下操作进行安全配置:设置 MariaDB 的 root 账户密码,禁用 root 远程登录,删除测试数据库以及测试帐号,最后需要使用下面的命令重新加载权限。
```
# mysql_secure_installation
@ -85,9 +82,9 @@ Start MariaDB Service in CentOS 7
![Secure MySQL in CentOS 7](http://www.tecmint.com/wp-content/uploads/2017/02/Secure-MySQL-in-CentOS-7.png)
][11]
Secure MySQL in CentOS 7
*CentOS 7 中的 MySQL 安全配置*
5. After securing the database server, you may want to check certain MariaDB features such as: installed version, default program argument list, and also login to the MariaDB command shell as follows:
5. 在配置完数据库的安全配置后,你可能想检查下 MariaDB 的特性,比如:版本号,默认参数列表,以及通过 MariaDB 命令行登录。如下所示:
```
# mysql -V
@ -98,37 +95,36 @@ Secure MySQL in CentOS 7
![Verify MySQL Version](http://www.tecmint.com/wp-content/uploads/2017/02/Verify-MySQL-Version.png)
][12]
Verify MySQL Version
*检查 MySQL 版本信息*
### Step 4: Learn MariaDB Administration
### 第四步:学习 MariaDB 管理
If you are new to MySQL/MariaDB, start off by going through these guides:
如果你刚开始学习使用 MySQL/MariaDB可以通过以下指南学习
1. [Learn MySQL / MariaDB for Beginners Part 1][1]
2. [Learn MySQL / MariaDB for Beginners Part 2][2]
3. [MySQL Basic Database Administration Commands Part III][3]
4. [20 MySQL (Mysqladmin) Commands for Database Administration Part IV][4]
Also check out these following articles to fine tune your MySQL/MariaDB performance and use the tools to monitor the activity of your databases.
同样查看下面的文档学习如何优化你的 MySQL/MariaDB 服务,并使用工具监控数据库的活动情况。
1. [15 Tips to Tune and Optimize Your MySQL/MariaDB Performance][5]
2. [4 Useful Tools to Monitor MySQL/MariaDB Database Activities][6]
Thats it for now! In this simple tutorial, we showed you how to install MariaDB 10.1 stable version in various RHEL/CentOS and Fedora. Use the feedback form below to send us any questions or any thoughts concerning this guide.
文章到此就结束了,本文内容比较浅显,文中主要展示了如何在 RHEL/CentOS 和 Fefora 操作系统中安装 **MariaDB 10.1** 稳定版。您可以通过下面的联系方式将您遇到的任何问题或者想法发给我们。
--------------------------------------------------------------------------------
作者简介:
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.
Aaron Kill 是 Linux 和开源软件的狂热爱好者,即将成为一名 Linux 系统管理员和网站开发工程师,现在是 TecMint 的原创作者,喜欢使用电脑工作并且热衷分享知识。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/install-mariadb-in-centos-7/
作者:[Aaron Kili][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
译者:[beyondworld](https://github.com/beyondworld)
校对:[jasminepeng](https://github.com/jasminepeng)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,129 @@
如何在树莓派上安装 Fedora 25
============================================================
### 看看这个分布的教程。
![How to install Fedora 25 on your Raspberry Pi](https://opensource.com/sites/default/files/styles/image-full-size/public/images/life/gnome_raspberry_pi_fedora.jpg?itok=Efm6IKxP "How to install Fedora 25 on your Raspberry Pi")
>图片提供 opensource.com
2016 年 10 月Fedora 25 Beta 发布了,随之而来的还有对[ Raspberry Pi 2 和 3 的初步支持][6]。Fedora 25 的最终“通用”版将在一个月后发布,从那时起,我一直在树莓派上尝试不同的 Fedora 版本。
这篇文章不仅是一篇 Raspberry Pi 3 上的 Fedora 25 的评论,还集合了提示、截图、以及我对官方初步对 Pi 支持的 Fedora 的一些个人想法。
更多关于树莓派的
* [我们最新的树莓派信息][1]
* [什么是树莓派?][2]
* [树莓派入门][3]
* [给我们发送你的树莓派项目和教程][4]
在我开始之前,需要说一下的是,我为写这篇文章所做的所有工作都是在我的个人笔记本电脑上运行 Fedora 25 。我使用一张 microSD 插到 SD 适配器中复制和编辑所有的 Fedora 镜像到 32GB 的 microSD 卡中,我在连接到一台三星电视后启动了 Raspberry Pi 3。 因为 Fedora 25 还尚不支持内置Wi-Fi所以 Raspberry Pi 3 还使用以太网线缆进行网络连接。最后,我使用了 Logitech K410 无线键盘和触摸板进行输入。
如果你没有机会使用以太网线连接你的树莓派上玩 Fedora 25我有一个 Edimax Wi-Fi USB 适配器,它可以在 Fedora 25 上工作,但在本文中,我只使用了以太网连接。
### 在你开始在树莓派上安装 Fedora 25 之前
阅读 Fedora 项目 wiki上 的[树莓派支持文档][7]。你可以从 wiki 下载 Fedora 25 安装所需的镜像,并且列出了所有支持和不支持的内容。
此外,请注意,这是初始支持版本,并且还有许多新的工作和支持将随着 Fedora 26 的发布而出现,所以请随时报告 bug并通过[Bugzilla][8],这个 Fedora的[ ARM 邮件列表][9],或者在 或 Freenode IRC 频道fedora-arm 上分享你在树莓派上使用 Fedora 25 的体验反馈。
### 安装
我下载并安装了五个不同的 Fedora 25 版本GNOME工作站默认、KDE、Minimal、LXDE 和 Xfce。在多数情况下它们都有一致和易于遵循的步骤以确保我的 Raspberry Pi 3 上启动正常。有些已知 bug 是人们正在解决的有些通过Fedora wik 遵循标准操作程序。
![GNOME on Raspberry Pi](https://opensource.com/sites/default/files/gnome_on_rpi.png "GNOME on Raspberry Pi")
Raspberry Pi 3 上的 Fedora 25 workstation、 GNOME 版本
### 安装步骤
1\. 在你的笔记本上,从支持文档页面的链接下载树莓派的 Fedora 25 镜像。
2\. 在笔记本上,使用 **fedora-arm-installer**或命令行将镜像复制到 microSD
**xzcat Fedora-Workstation-armhfp-25-1.3-sda.raw.xz | dd bs=4M status=progress of=/dev/mmcblk0**
注意:**/dev/mmclk0**是我的 microSD 插到 SD 适配器后安装在我的笔记本电脑上的设备,即使我在笔记本上使用 Fedora我可以使用 **fedora-arm-installer**,但是我喜欢命令行。
3\. 复制完镜像后_先不要启动你的系统_。我知道你很想这么做但你仍然需要进行几个调整。
4\. 为了使镜像文件尽可能小以便下载,镜像上的根文件系统是很小的,因此你必须增加根文件系统的大小。如果你不这么做,你仍然可以启动你的派,但如果你一旦运行 **dnf** 来升级你的系统,它就会填满文件系统,还会有糟糕的事情会发生,所以乘着 microSD 还在你的笔记本上进行分区:
**growpart /dev/mmcblk0 4
resize2fs /dev/mmcblk0p4**
注意:在 Fedora 中,** growpart** 命令由 **cloud-utils-growpart.noarch** 这个 RPM 提供。
5\.文件系统更新后,您需要将 **vc4** 模块列入黑名单。[有关此 bug 的详细信息。][10]
我建议在启动树莓派之前这样做,因为不同的版本将以不同的方式表现。例如,(至少对我来说)在没有黑名单 **vc4** 的情况下GNOME 会在我启动后首先出现,但在系统更新后,它将不再出现。 KDE 的版本在第一次启动时根本不会出现。因此我们可能需要在我们的第一次启动之前将 **vc4** 加入黑名单,直到错误解决。
黑名单应该出现在两个不同的地方。首先,在你的 microSD根 分区上,在 **etc/modprode.d/** 下创建一个 **vc4.conf**,内容是:**blacklist vc4**。第二,在你的 microSD 启动分区添加 **rd.driver.blacklist=vc4****extlinux/extlinux.conf** 的末尾。
6\. 现在,你可以启动你的树莓派了。
### 启动
你要有耐心,特别是对于 GNOME 和 KDE 发行版来说。在 SSD固态驱动器和几乎即时启动的时代特别是第一次启动时你很容易就对派的启动速度感到不耐烦。在第一次启动 Window Manager 之前,它将弹出一个初始配置页面,它允许你配置 root 密码、常规用户、时区和网络。一旦你得到配置,你应该能够 SSH 到你的树莓派上,这样你就可以方便调试显示问题了。
### 系统更新
一旦你在树莓派上运行了 Fedora 25你就会最终或立即想要系统更新。
首先,当进行内核升级时,先熟悉你的 **/boot/extlinux/extlinux.conf** 文件。如果升级内核,下次启动时,除非手动选择正确的内核,否则很可能会启动进入 Rescue 模式。避免这种情况发生最好方法是,在你的 **extlinux.conf**中将定义 Rescue 镜像的那五行移动到文件的底部,这样最新的内核将在下次自动启动。你可以直接在派上或通过在笔记本挂载来编辑 **/boot/extlinux/extlinux.conf** directly
**label Fedora 25 Rescue fdcb76d0032447209f782a184f35eebc (4.9.9-200.fc25.armv7hl)
            kernel /vmlinuz-0-rescue-fdcb76d0032447209f782a184f35eebc
            append ro root=UUID=c19816a7-cbb8-4cbb-8608-7fec6d4994d0 rd.driver.blacklist=vc4
            fdtdir /dtb-4.9.9-200.fc25.armv7hl/
            initrd /initramfs-0-rescue-fdcb76d0032447209f782a184f35eebc.img**
第二点,如果无论什么原因,如果你的显示器在升级后再次变暗,并且你确定已经将 **vc4** 加入黑名单,请运行 **lsmod | grep vc4**。你可以先启动到多用户模式而不是图形模式,并从命令行中运行 **startx**。 请阅读 **/etc/inittab** 中的内容,了解如何切换目标的说明。
![KDE on Raspberry Pi 3](https://opensource.com/sites/default/files/kde_on_rpi.png "KDE on Raspberry Pi 3")
Raspberry Pi 3 上的 Fedora 25 workstation、 KDE 版本
### Fedora 版本
所有的 Fedora 版本我都试过,唯一一个有问题是 XFCE我相信这是由于这个[已知的 bug][11]。
当我按照我在这里分享的步骤来时GNOME、KDE、LXDE 和 minimal 都运行得很好。考虑到 KDE 和 GNOME 会占用更多资源,我会推荐想要在树莓派上使用 Fedora 25 的人 使用 LXDE 和 Minimal。如果你是一个想要一台廉价的支持 SELinux 的服务器来覆盖你的安全考虑的系统管理员,你想要使用树莓派作为你的服务器,并需要支持 22 端口和 vi那就用 Minimal 版本。对于开发人员或开始学习 Linux 的人来说LXDE 可能是更好的方式,因为它可以快速方便地访问所有基于 GUI 的工具如浏览器、IDE 和你可能需要的客户端。
 [LXES on Raspberry Pi 3]https://opensource.com/sites/default/files/lxde_on_rpi.png“LXDE on Raspberry Pi 3”
Raspberry Pi 3 上的 Fedora 25 workstation、LXDE。
看到越来越多的 Linux 发行版在基于 ARM 的树莓派上可用那真是太棒了。对于其第一个支持的版本Fedora 团队为日常 Linux 用户提供了更好的体验。我一定会期待 Fedora 26 的改进和 bug 修复。
--------------------------------------------------------------------------------
作者简介:
Anderson Silva - Anderson 于 1996 年开始使用 Linux。更精确地说是 Red Hat Linux。 2007 年,当他作为 IT 部门的发布工程师时加入红帽时,他的主要梦想成为了现实。此后,他在红帽担任过多个不同角色,从发布工程师到系统管理员、高级经理和信息系统工程师。他是一名 RHCE 和 RHCA 以及一名活跃的 Fedora 包维护者。
----------------
via: https://opensource.com/article/17/3/how-install-fedora-on-raspberry-pi
作者:[Anderson Silva][a]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/ansilva
[1]:https://opensource.com/tags/raspberry-pi?src=raspberry_pi_resource_menu
[2]:https://opensource.com/resources/what-raspberry-pi?src=raspberry_pi_resource_menu
[3]:https://opensource.com/article/16/12/getting-started-raspberry-pi?src=raspberry_pi_resource_menu
[4]:https://opensource.com/article/17/2/raspberry-pi-submit-your-article?src=raspberry_pi_resource_menu
[5]:https://opensource.com/article/17/3/how-install-fedora-on-raspberry-pi?rate=gIIRltTrnOlwo4h81uDvdAjAE3V2rnwoqH0s_Dx44mE
[6]:https://fedoramagazine.org/raspberry-pi-support-fedora-25-beta/
[7]:https://fedoraproject.org/wiki/Raspberry_Pi
[8]:https://bugzilla.redhat.com/show_bug.cgi?id=245418
[9]:https://lists.fedoraproject.org/admin/lists/arm%40lists.fedoraproject.org/
[10]:https://bugzilla.redhat.com/show_bug.cgi?id=1387733
[11]:https://bugzilla.redhat.com/show_bug.cgi?id=1389163
[12]:https://opensource.com/user/26502/feed
[13]:https://opensource.com/article/17/3/how-install-fedora-on-raspberry-pi#comments
[14]:https://opensource.com/users/ansilva