mirror of
https://github.com/LCTT/TranslateProject.git
synced 2026-08-26 04:13:30 +08:00
Merge branch 'master' of https://github.com/LCTT/TranslateProject
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
‘Sysstat’工具包中20个实用的Linux性能监控工具(包括mpstat, pidstat, iostat 和sar)
|
||||
Sysstat性能监控工具包中20个实用命令
|
||||
===============================================================
|
||||
在我们上一篇文章中,我们已经学习了如何去安装和更新**sysstat**,并且了解了包中的一些实用工具。
|
||||
|
||||
注:此文一并附上,在同一个原文中更新
|
||||
- [Sysstat – Performance and Usage Activity Monitoring Tool For Linux][1]
|
||||
在我们[上一篇文章][1]中,我们已经学习了如何去安装和更新**sysstat**,并且了解了包中的一些实用工具。
|
||||
|
||||

|
||||
|
||||
Linux系统监控的20个Sysstat命令
|
||||
今天,我们将会通过一些有趣的实例来学习**mpstat**, **pidstat**, **iostat**和**sar**等工具,这些工具可以帮组我们找出系统中的问题。这些工具都包含了不同的选项,这意味着你可以根据不同的工作使用不同的选项,或者根据你的需求来自定义脚本。我们都知道,系统管理员都会有点懒,他们经常去寻找一些更简单的方法来完成他们的工作。
|
||||
|
||||
### mpstat - 处理器统计信息 ###
|
||||
@@ -21,7 +17,7 @@ Linux系统监控的20个Sysstat命令
|
||||
12:23:57 IST CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
|
||||
12:23:57 IST all 37.35 0.01 4.72 2.96 0.00 0.07 0.00 0.00 0.00 54.88
|
||||
|
||||
2.使用‘**-p**’(处理器编码)和‘ALL’参数将会从0开始独立的输出每个CPU的统计信息,0表示第一个cpu。
|
||||
2.使用‘**-p**’ (处理器编号)和‘ALL’参数将会从0开始独立的输出每个CPU的统计信息,0表示第一个cpu。
|
||||
|
||||
tecmint@tecmint ~ $ mpstat -P ALL
|
||||
|
||||
@@ -151,7 +147,7 @@ Linux系统监控的20个Sysstat命令
|
||||
12:51:55 IST 0 19 0.00 0.00 0.00 0.00 0 writeback
|
||||
12:51:55 IST 0 20 0.00 0.00 0.00 0.00 1 kintegrityd
|
||||
|
||||
8.使用‘**-d 2**’参数,我们可以看到I/O统计信息,2表示以秒为单位对统计信息进行刷新。这个参数可以方便的知道当系统在进行繁重的I/O时,那些进行占用大量的资源。
|
||||
8.使用‘**-d 2**’参数,我们可以看到I/O统计信息,2表示以秒为单位对统计信息进行刷新。这个参数可以方便的知道当系统在进行繁重的I/O时,那些进行占用大量的资源的进程。
|
||||
|
||||
tecmint@tecmint ~ $ pidstat -d 2
|
||||
|
||||
@@ -171,7 +167,6 @@ Linux系统监控的20个Sysstat命令
|
||||
|
||||
9.想要每间隔**2**秒对进程**4164**的cpu统计信息输出**3**次,则使用如下带参数‘**-t**’(输出某个选定进程的统计信息)的命令。
|
||||
|
||||
|
||||
tecmint@tecmint ~ $ pidstat -t -p 4164 2 3
|
||||
|
||||
Linux 3.11.0-23-generic (tecmint.com) Thursday 04 September 2014 _i686_ (2 CPU)
|
||||
@@ -250,13 +245,13 @@ Linux系统监控的20个Sysstat命令
|
||||
01:09:08 IST 1000 5 99 FIFO migration/0
|
||||
01:09:08 IST 1000 6 99 FIFO watchdog/0
|
||||
|
||||
因为我们已经学习过Iostat命令了,因此在本文中不在对其进行赘述。若想查看Iostat命令的详细信息,请参看“[使用Iostat和Vmstat进行Linux性能监控][2]注:此文也一并附上在同一个原文更新中”
|
||||
因为我们已经学习过iostat命令了,因此在本文中不在对其进行赘述。若想查看iostat命令的详细信息,请参看“[使用Iostat和Vmstat进行Linux性能监控][2]”
|
||||
|
||||
###sar - 系统活动报告###
|
||||
|
||||
我们可以使用‘**sar**’命令来获得整个系统性能的报告。这有助于我们定位系统性能的瓶颈,并且有助于我们找出这些烦人的性能问题的解决方法。
|
||||
|
||||
Linux内核维护者一些内部计数器,这些计数器包含了所有的请求及其完成时间和I/O块数等信息,sar命令从所有的这些信息中计算出请求的利用率和比例,以便找出瓶颈所在。
|
||||
Linux内核维护着一些内部计数器,这些计数器包含了所有的请求及其完成时间和I/O块数等信息,sar命令从所有的这些信息中计算出请求的利用率和比例,以便找出瓶颈所在。
|
||||
|
||||
sar命令主要的用途是生成某段时间内所有活动的报告,因此,必需确保sar命令在适当的时间进行数据采集(而不是在午餐时间或者周末。)
|
||||
|
||||
@@ -274,7 +269,7 @@ sar命令主要的用途是生成某段时间内所有活动的报告,因此
|
||||
01:42:38 IST all 50.75 0.00 3.75 0.00 0.00 45.50
|
||||
Average: all 46.30 0.00 3.93 0.00 0.00 49.77
|
||||
|
||||
14.在上面的例子中,我们交互的执行sar命令。sar命令提供了使用cron进行非交互的执行sar命令的方法,使用**/usr/local/lib/sa1**和**/usr/local/lib/sa2**脚本(如果你在安装时使用了**/usr/local**作为前缀)
|
||||
14.在上面的例子中,我们交互的执行sar命令。sar命令也提供了使用cron进行非交互的执行sar命令的方法,使用**/usr/local/lib/sa1**和**/usr/local/lib/sa2**脚本(如果你在安装时使用了**/usr/local**作为前缀的话)
|
||||
|
||||
- **/usr/local/lib/sa1**是一个可以使用cron进行调度生成二进制日志文件的shell脚本。
|
||||
- **/usr/local/lib/sa2**是一个可以将二进制日志文件转换为用户可读的编码方式。
|
||||
@@ -287,7 +282,7 @@ sar命令主要的用途是生成某段时间内所有活动的报告,因此
|
||||
#在每天23:53时生成一个用户可读的日常报告
|
||||
53 23 * * * /usr/local/lib/sa/sa2 -A
|
||||
|
||||
在sa1脚本执行后期,sa1脚本会调用**sabc**(系统活动数据收集器,System Activity Data Collector)工具采集特定时间间隔内的数据。**sa2**脚本会调用sar来将二进制日志文件转换为用户可读的形式。
|
||||
在sa1脚本的后端,sa1脚本会调用**sabc**(系统活动数据收集器,System Activity Data Collector)工具采集特定时间间隔内的数据。**sa2**脚本会调用sar来将二进制日志文件转换为用户可读的形式。
|
||||
|
||||
15.使用‘**-q**’参数来检查运行队列的长度,所有进程的数量和平均负载
|
||||
|
||||
@@ -303,7 +298,7 @@ sar命令主要的用途是生成某段时间内所有活动的报告,因此
|
||||
02:00:54 IST 0 431 1.64 1.23 0.97 0
|
||||
Average: 2 431 1.68 1.23 0.97 0
|
||||
|
||||
16.使用‘**-F**’参数查看当前挂载的文件系统统计信息
|
||||
16.使用‘**-F**’参数查看当前挂载的文件系统的使用统计信息
|
||||
|
||||
tecmint@tecmint ~ $ sar -F 2 4
|
||||
|
||||
@@ -387,7 +382,7 @@ sar命令主要的用途是生成某段时间内所有活动的报告,因此
|
||||
|
||||

|
||||
|
||||
网络信息图表
|
||||
*网络信息图表*
|
||||
|
||||
现在,你可以参考man手册来后去每个参数的更多详细信息,并且请在文章下留下你宝贵的评论。
|
||||
|
||||
@@ -397,10 +392,10 @@ via: http://www.tecmint.com/sysstat-commands-to-monitor-linux/
|
||||
|
||||
作者:[Kuldeep Sharma][a]
|
||||
译者:[cvsher](https://github.com/cvsher)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/kuldeepsharma47/
|
||||
[1]:http://www.tecmint.com/install-sysstat-in-linux/
|
||||
[2]:http://www.tecmint.com/linux-performance-monitoring-with-vmstat-and-iostat-commands/
|
||||
[1]:http://linux.cn/article-4025-1.html
|
||||
[2]:http://linux.cn/article-4024-1.html
|
||||
@@ -1,12 +1,12 @@
|
||||
在命令行中管理 Wifi 连接
|
||||
================================================================================
|
||||
无论何时要安装一款新的 Linux 发行系统,一般的建议都是让您通过有线连接来接到互联网的。这主要的原因有两条:第一,您的无线网卡也许安装的驱动不正确而不能用;第二,如果您是从命令行中来安装系统的,管理 WiFi 就非常可怕。我总是试图避免在命令行中处理 WiFi 。但 Linux 的世界,应具有无所畏惧的精神。如果您不知道怎样操作,您需要继续往下来学习之,这就是写这篇文章的唯一原因。所以我强迫自己学习如何在命令行中管理 WiFi 连接。
|
||||
无论何时要安装一款新的 Linux 发行系统,一般的建议都是让您通过有线连接来接到互联网的。这主要的原因有两条:第一,您的无线网卡也许安装的驱动不正确而不能用;第二,如果您是从命令行中来安装系统的,管理 WiFi 就非常可怕。我总是试图避免在命令行中处理 WiFi 。但 Linux 的世界,应具有无所畏惧的精神。如果您不知道怎样操作,您需要继续往下来学习之,这就是写这篇文章的唯一原因。所以我迫使自己学习如何在命令行中管理 WiFi 连接。
|
||||
|
||||
通过命令行来设置连接到 WiFi 当然有很多种方法,但在这篇文章里,也是一个建议,我将会作用最基本的方法:那就是使用在任何发布版本中都有的包含在“默认包”里的程序和工具。或者我偏向于使用这一种方法。使用此方法显而易见的好处是这个操作过程能在任意有 Linux 系统的机器上复用。不好的一点是它相对来说比较复杂。
|
||||
通过命令行来设置连接到 WiFi 当然有很多种方法,但在这篇文章里,同时也是一个建议,我使用最基本的方法:那就是使用在任何发布版本中都有的包含在“默认包”里的程序和工具。或者说我偏向于使用这一种方法。使用此方法显而易见的好处是这个操作过程能在任意有 Linux 系统的机器上复用。不好的一点是它相对来说比较复杂。
|
||||
|
||||
首先,我假设您们都已经正确安装了无线网卡的驱动程序。没有这前提,后续的一切都如镜花水月。如果您你机器确实没有正确安装上,您应该看看关于您的发布版本的维基和文档。
|
||||
|
||||
然后您就可以用如下命令来检查是哪一个接口来支持无线连接的
|
||||
然后您就可以用如下命令来检查是哪一个接口来支持无线连接的:
|
||||
|
||||
$ iwconfig
|
||||
|
||||
@@ -24,21 +24,21 @@
|
||||
|
||||

|
||||
|
||||
根据扫描出的结果,可以得到网络的名字(它的 SSID),它的信息强度,以及它使用的是哪个安全加密的(如:WEP、WPA/WPA2)。从此时起,将会分成两条路线:情况很好的和容易的以及情况稍微复杂的。
|
||||
根据扫描出的结果,可以得到网络的名字(它的 SSID),它的信息强度,以及它使用的是哪个安全加密的(如:WEP、WPA/WPA2)。从此时起,将会分成两条路线:情况很好、很容易的以及情况稍微复杂的。
|
||||
|
||||
如果您想连接的网络是没有加密的,您可以用下面的命令直接连接:
|
||||
|
||||
$ sudo iw dev wlan0 connect [network SSID]
|
||||
$ sudo iw dev wlan0 connect [网络 SSID]
|
||||
|
||||
如果网络是用 WEP 加密的,也非常容易:
|
||||
|
||||
$ sudo iw dev wlan0 connect [network SSID] key 0:[WEP key]
|
||||
$ sudo iw dev wlan0 connect [网络 SSID] key 0:[WEP 密钥]
|
||||
|
||||
但网络使用的是 WPA 或 WPA2 协议的话,事情就不好办了。这种情况,您就得使用叫做 wpa_supplicant 的工具,它默认是没有启用的。需要修改 /etc/wpa_supplicant/wpa_supplicant.conf 文件,增加如下行:
|
||||
但网络使用的是 WPA 或 WPA2 协议的话,事情就不好办了。这种情况,您就得使用叫做 wpa_supplicant 的工具,它默认是没有的。然后需要修改 /etc/wpa_supplicant/wpa_supplicant.conf 文件,增加如下行:
|
||||
|
||||
network={
|
||||
ssid="[network ssid]"
|
||||
psk="[the passphrase]"
|
||||
ssid="[网络 ssid]"
|
||||
psk="[密码]"
|
||||
priority=1
|
||||
}
|
||||
|
||||
@@ -1,67 +1,70 @@
|
||||
|
||||
Ubunto可以实现这功能吗?-回答4个新用户最常问的问题
|
||||
Ubuntu 有这功能吗?-回答4个新用户最常问的问题
|
||||
================================================================================
|
||||

|
||||
|
||||
**在谷歌输入‘Can Ubunt[u]’,一系列的自动建议会展现在你面前。这些建议都是根据最近搜索用户最频繁检索而形成的。
|
||||
|
||||
对于Linux老用户来说,他们都胸有成竹的回答这些问题。但是对于新用户或者那些还在探索类似Ubuntu是否是值得分配的人,他们不是十分清楚这些答案。这都是中肯,真实而且是基本的问题。
|
||||
对于Linux老用户来说,他们都胸有成竹的回答这些问题。但是对于新用户或者那些还在探索类似Ubuntu这样的发行版是否适合的人来说,他们不是十分清楚这些答案。这都是中肯,真实而且是基本的问题。
|
||||
|
||||
所以,在这片文章,我将会去回答4个最常会被搜索到的"Can Ubuntu...?"问题。
|
||||
|
||||
### Ubuntu可以取代Windows吗?###
|
||||
|
||||

|
||||
Windows 并不是每个人都喜欢 - 或者说是必须的。
|
||||
|
||||
是的。Ubutu(和其他Linux发行版)是可以安装到任何一台有能力运行微软系统的电脑。
|
||||
*Windows 并不是每个人都喜欢或都必须的*
|
||||
|
||||
无论你觉得 **应不应该** 取代它,不变的是,这取决于你自己的需求。
|
||||
是的。Ubuntu(和其他Linux发行版)是可以安装到任何一台有能力运行微软系统的电脑。
|
||||
|
||||
无论你觉得**应不应该**取代它,要不要替换只取决于你自己的需求。
|
||||
|
||||
例如,你在上大学,所需的软件都只是Windows而已。暂时而言,你是不需要完全更换你的系统。对于工作也是同样的道理。如果你工作所用到的软件只是微软Office, Adobe Creative Suite 或者是一个AutoCAD应用程序,不是很建议你更换系统,坚持你现在所用的软件就足够了。
|
||||
|
||||
但是对于那些用Ubuntu完全取代微软的我们,Ubuntu 提供一个安全的桌面工作环境。这个桌面工作环境可以运行与支持很广的硬件环境。基本上,每个东西都有软件的支持,从办公套件到网页浏览器,视频应用程序,音乐应用程序到游戏。
|
||||
但是对于那些用Ubuntu完全取代微软系统的我们,Ubuntu 提供了一个安全的桌面工作环境。这个桌面工作环境可以运行与支持很广的硬件环境。基本上,每个东西都有软件的支持,从办公套件到网页浏览器,视频应用程序,音乐应用程序到游戏。
|
||||
|
||||
### Ubuntu 可以运行 .exe文件吗?###
|
||||
|
||||

|
||||
你可以在Ubuntu运行一些Windows应用程序
|
||||
|
||||
是可以的,尽管这些程序不是一步安装到位,或者不能保证安装成功。这是因为这些软件版本本来就是在Windows下运行的。 这些程序本来就与其他桌面操作系统不兼容,包括Mac OS X 或者 Android (安卓系统)。
|
||||
*你可以在Ubuntu运行一些Windows应用程序*
|
||||
|
||||
那些专门为Ubuntu(和其他Linux发行版本)的软件安装包都是带有“.deb”的文件后缀名。它们的安装过程与安装 .exe 的程序是一样的 -双击安装包,然后根据屏幕提示完成安装。
|
||||
是可以的,尽管这些程序不是一步到位,或者不能保证运行成功。这是因为这些软件原本就是在Windows下运行的,本来就与其他桌面操作系统不兼容,包括Mac OS X 或者 Android (安卓系统)。
|
||||
|
||||
但是Linux是很多样化的。 使用一个名为"Wine"的兼容层,可以运行许多当下很流行的应用程序。 (Wine不是一个模拟器,但是简单来讲是一个速记本。)这些程序不会像在Windows下运行得那么顺畅,或者有着出色的用户界面。然而,它足以满足日常的工作要求。
|
||||
那些专门为Ubuntu(和其他 Debian 系列的 Linux 发行版本)的软件安装包都是带有“.deb”的文件后缀名。它们的安装过程与安装 .exe 的程序是一样的 -双击安装包,然后根据屏幕提示完成安装。 (LCTT 译注:RedHat 系统采用.rpm 文件,其它的也有各种不同的安装包格式,等等,作为初学者,你可以当成是各种压缩包格式来理解)
|
||||
|
||||
一些很出名的Windows软件是可以通过Wine来运行在Ubuntu操作系统上,这包括老版本的Photoshop和微软办公室软件。 有关兼容软件的列表 [参照Wine应用程序数据库][1].
|
||||
但是Linux是很多样化的。它使用一个名为"Wine"的兼容层,可以运行许多当下很流行的应用程序。 (Wine不是一个模拟器,但是简单来看可以当成一个快捷方式。)这些程序不会像在Windows下运行得那么顺畅,或者有着出色的用户界面。然而,它足以满足日常的工作要求。
|
||||
|
||||
一些很出名的Windows软件是可以通过Wine来运行在Ubuntu操作系统上,这包括老版本的Photoshop和微软办公室软件。 有关兼容软件的列表,[参照Wine应用程序数据库][1]。
|
||||
|
||||
### Ubuntu会有病毒吗?###
|
||||
|
||||

|
||||
它可能有错误,但是它并有病毒
|
||||
|
||||
*它可能有错误,但是它并有病毒*
|
||||
|
||||
理论上,它会有病毒。但是,实际上它没有。
|
||||
|
||||
Linux发行版本是建立在一个病毒,蠕虫,隐匿程序都很难被安装,运行或者造成很大影响的环境之下的。
|
||||
|
||||
例如,很多应用程序都是在没有特别管理权限要求,以普通用户权限运行的。病毒的访问系统关键部分的请求也是需要用户管理权限的。很多软件的提供都是从那些维护良好的而且集中的资源库,例如Ubuntu软件中心,而不是一些不知名的网站。 由于这样的管理使得安装一些受感染的软件的几率可以忽略不计。
|
||||
例如,很多应用程序都是在没有特别管理权限要求,以普通用户权限运行的。病毒要访问系统关键部分的请求也是需要用户管理权限的。很多软件的提供都是从那些维护良好的而且集中的资源库,例如Ubuntu软件中心,而不是一些不知名的网站。 由于这样的管理使得安装一些受感染的软件的几率可以忽略不计。
|
||||
|
||||
你应不应该在Ubuntu系统安装杀毒软件?这取决于你自己。为了自己的安心,或者如果你经常通过Wine来使用Windows软件,或者双系统,你可以安装ClamAV。它是一个免费的开源的病毒扫描应用程序。你可以在Ubuntu软件中心找到它。
|
||||
|
||||
你可以在Ubuntu维基百科了解更多关于病毒在Linux或者Ubuntu的信息。 [Ubuntu 维基百科][2].
|
||||
你可以在Ubuntu维基百科了解更多关于病毒在Linux或者Ubuntu的信息。 [Ubuntu 维基百科][2]。
|
||||
|
||||
### 在Ubuntu上可以玩游戏吗?###
|
||||
|
||||

|
||||
Steam有着上百个专门为Linux设计的高质量游戏。
|
||||
|
||||
当然可以!Ubuntu有着多样化的游戏,从传统简单的2D象棋,拼字游戏和扫雷游戏,到很现代化AAA级别的对显卡要求强的游戏。
|
||||
*Steam有着上百个专门为Linux设计的高质量游戏*
|
||||
|
||||
你首先去到 **Ubuntu 软件中心**。这里你会找到很多免费的,开源的和付钱的游戏,包括广受好评的独立制作游戏,像World of Goo 和Braid。当然也有其他传统游戏的提供,例如,Pychess(国际象棋),four-in-a-row和Scrabble clones(猜字拼字游戏)。
|
||||
当然可以!Ubuntu有着多样化的游戏,从传统简单的2D象棋,拼字游戏和扫雷游戏,到很现代化的AAA级别的要求显卡很强的游戏。
|
||||
|
||||
对于游戏狂热爱好者,你可以点击**Steam for Linux**. 在这里你可以找到各种这样最新最好玩的游戏。
|
||||
你首先可以去 **Ubuntu 软件中心**。这里你会找到很多免费的,开源的和收费的游戏,包括广受好评的独立制作游戏,像World of Goo 和Braid。当然也有其他传统游戏的提供,例如,Pychess(国际象棋),four-in-a-row(四子棋)和Scrabble clones(猜字拼字游戏)。
|
||||
|
||||
另外,记得留意这个网站 [Humble Bundle][3]。这些“只买你想要的”的套餐只会持续每个月里面的两周。作为游戏平台,它是Linux特别友好的支持者。因为每当一些新游戏出来的时候,它都保证可以在Linux下搜索到。
|
||||
对于游戏狂热爱好者,你可以安装**Steam for Linux**。在这里你可以找到各种这样最新最好玩的游戏。
|
||||
|
||||
另外,记得留意这个网站:[Humble Bundle][3]。每个月都会有两周的这种“只买你想要的”的套餐。作为游戏平台,它是对Linux特别友好的支持者。因为每当一些新游戏出来的时候,它都保证可以在Linux下搜索到。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@@ -69,7 +72,7 @@ via: http://www.omgubuntu.co.uk/2014/08/ubuntu-can-play-games-replace-windows-qu
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[Shaohao Lin](https://github.com/shaohaolin)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Linux FAQ -- 如何修复“X11 forwarding request failed on channel 0”错误
|
||||
Linux有问必答:如何修复“X11 forwarding request failed on channel 0”错误
|
||||
================================================================================
|
||||
> **问题**: 当我尝试使用SSH的X11转发选项连接到远程主机时, 我在登录时遇到了一个 "X11 forwarding request failed on channel 0" (X11 转发请求在通道0上失败)的错误。 我为什么会遇到这个错误,并且该如何修复它
|
||||
|
||||
@@ -26,9 +26,9 @@ X11客户端不能正确处理X11转发,这会导致报告中的错误。要
|
||||
$ sudo systemctl restart ssh.service (Debian 7, CentOS/RHEL 7, Fedora)
|
||||
$ sudo service sshd restart (CentOS/RHEL 6)
|
||||
|
||||
### 方案而 ###
|
||||
### 方案二 ###
|
||||
|
||||
如果远程主机的SSH服务禁止了IPv6,那么X11转发失败的错误也有可能发生。要解决这个情况下的错误。打开/etc/ssh/sshd配置文件,打开"AddressFamily all" (如果有的话)的注释。接着加入下面这行。这会强制SSH服务只使用IPv4而不是IPv6。
|
||||
如果远程主机的SSH服务禁止了IPv6,那么X11转发失败的错误也有可能发生。要解决这个情况下的错误。打开/etc/ssh/sshd配置文件,取消对"AddressFamily all" (如果有这条的话)的注释。接着加入下面这行。这会强制SSH服务只使用IPv4而不是IPv6。(LCTT 译注:此处恐有误,AddressFamily 没有 all 这个参数,而 any 代表同时支持 IPv6和 IPv4,以此处的场景而言,应该是关闭IPv6支持,只支持 IPv4,所以此处应该是“注释掉 AddressFamily any”才对。)
|
||||
|
||||
$ sudo vi /etc/ssh/sshd_config
|
||||
|
||||
@@ -43,7 +43,7 @@ X11客户端不能正确处理X11转发,这会导致报告中的错误。要
|
||||
via: http://ask.xmodulo.com/fix-broken-x11-forwarding-ssh.html
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
如何开始一个开源项目
|
||||
================================================================================
|
||||
> 循序渐进的指导
|
||||
|
||||
**你有这个问题**:你已经权衡了[开源代码的优劣势][1],你也已经知道[你的软件需要成为一个开源项目][2],但是,你不知道怎么做好的开源项目。
|
||||
|
||||
当然,你也许已经知道[如何创建Github帐号并开始][3],但是这些事实上是做开源比较简单的部分。而真真正正难的部分是如何让足够多的人,关注你的项目并给你的项目做贡献。
|
||||
|
||||

|
||||
|
||||
接下来的原则是会指导你构建和发布其他人愿意关注的代码。
|
||||
|
||||
### 基本原则 ###
|
||||
|
||||
选择开源可能有许多原因。也许你希望吸引一个社区来帮助编写你的代码。也许,[总所周知][4],你明白“开源 —— 一个开发小团队内部编写代码的倍增器。”
|
||||
|
||||
或者你只是认为这是必须做的事,[如同英国政府一样][5]。
|
||||
|
||||
无论何种原因,为了开源能够成功,是必须要做很多的计划去给将来使用这个软件的人们。如同[我在2005写道][6],如果你“需要大量的人做贡献(bug修复,扩展等等)”,那么你需要“写一个好的文档,使用易于接受的编程语言,和使用模型架构”。
|
||||
|
||||
对了,你也需要写人们在乎的软件。
|
||||
|
||||
每天思考你依靠的技术:操作系统,web应用框架,数据库,等等。远离像航天这样,特殊行业的小生态技术,让开源拥有更多的可能性以便外部的(人的)产生兴趣和做出贡献。更广泛的应用技术,找到更多的贡献者和用户。
|
||||
|
||||
总的来说,任何成功的开源项目有以下共同点:
|
||||
|
||||
1.最佳的时间时机(解决市场实际需求)
|
||||
|
||||
2.一个健壮,包括开发者和非开发者的团队
|
||||
|
||||
3.一个易于参与的结构(更多详见下文)
|
||||
|
||||
4.模块化编码,使新贡献者更容易找到一个项目损坏的部分去贡献,比强迫他们理解巨大的代码的每一部分要好
|
||||
|
||||
5.代码可以广泛应用(或者达到一个狭窄的流行都比一个“自生自灭的”小生态更吸引人)
|
||||
|
||||
6.很好初始源码(如果你放垃圾在Github,你也只会得到垃圾回报)
|
||||
|
||||
7.一个自由的许可证-我[个人更爱Apache型的许可证][7],因为它让开发者采用时障碍最低,当然许多成功的项目(如Linux和MySQL)使用GPL许可证也有很棒的效果。
|
||||
|
||||
上述几项,是一个项目成功邀请参与者最难的部分。这是因为他们不是关于代码而是关于人。
|
||||
|
||||
### 开源不单是一个许可证 ###
|
||||
|
||||
今年,最棒的一件事是我读到是来自 Vitorio Miliano ([@vitor_io][8])的文章,他是用户体验交互设计师,来自德州的奥斯丁。[Miliano][9]指出,那些不在你的项目上工作的人才是“外行”,从本质上说无论他们技术能力的级别,他们仅仅懂一点代码(也没关系)。
|
||||
|
||||
所以你的工作,他认为,是使人加入,为你贡献你的代码变得简单。当阐述如何涉及非程序员到开源项目中,他指出项目的一些事项,项目领导应需要有效地得加入一些任何技术或不懂技术的人到开源项目。
|
||||
|
||||
> 1. 一种方法去了解你的项目价值
|
||||
>
|
||||
> 2. 一种方法去了解他们可以为项目提供的价值
|
||||
>
|
||||
> 3. 一种方法去了解他们可以从贡献代码获得的价值
|
||||
>
|
||||
> 4. 一种方法去了解贡献流程,端到端
|
||||
>
|
||||
> 5. 贡献机制适用于现有的工作流
|
||||
|
||||
经常,项目领导者想要集中于上述的第五步,却不提供理解1到4的路径。如果潜在的贡献者不欣赏“为什么”,“如何”共享就变得不重要了。
|
||||
|
||||
注意,至关重要的,Miliano写道,建立拥有一个通俗易懂的简介的项目很有价值,如同任何时候通过简介给每一个人演示可访问性和包容性。他断言道,这增加了额外的好处,文档和其他的版本介绍的内容变得通俗易懂。
|
||||
|
||||
关于第二点,程序员或非程序员同样地需要能够明白到底你需要什么,这样他们就可以认识到他们的贡献(方向)。有时就像MongoDB解决方案架构师[Henrik Ingo告诉我][10]那样,"一个聪明的人可以贡献很棒的代码,但是项目成员不能理解它(代码)",如果在组织内承认这个贡献并且研究后理解,那么这就不是一个糟糕的问题。
|
||||
|
||||
但是不会经常发生。
|
||||
|
||||
### 你真的想领导一个开源项目吗? ###
|
||||
|
||||
许多开源项目的领导提倡包容性,但是他们拥有任何事除了包容。如果你不想要人们做贡献,不要假装开源。
|
||||
|
||||
是的,有时这是老生常谈的话题。就像HackerNews最近的报道[一个开发者的开发工作][11]。
|
||||
|
||||
> 小项目可以得到很多,基本不需要很多人合作来完成。我看到了他们的进步,但是我没有看到我自己的进步:如果我帮助了他们,显然,如果我花费了有限的时间在与那些计算机科学的硕士管理合作上,而没有参与编码,这不是我想要的。所以我忽略了他们。
|
||||
|
||||
这是一个保持理智的的好方法,但这个态度并不能预示着这个项目会被广阔的分享。
|
||||
|
||||
如果你确实很少关心非程序员设计的贡献、文档,或者无论其他什么,那么请首先了解那些。再次强调,如果这是实情,你的项目就不能成为一个开源项目。
|
||||
|
||||
当然,排除感觉不总是可靠的。 就像ActiveState的副总裁Bernard Golden告诉过我,“一些将会成为开发人员将会对现有的“小集团”开发团体这种感觉感到恐惧,虽然这不一定正确。”
|
||||
|
||||
现在,若使了解开发人员为什么要贡献并邀请做开发,意味着更多的开源项目投资,更长久地生存。
|
||||
|
||||
图片由[Shutterstock][12]提供
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://readwrite.com/2014/08/20/open-source-project-how-to
|
||||
|
||||
作者:[Matt Asay][a]
|
||||
译者:[Vic___/VicYu](http://www.vicyu.net)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://readwrite.com/author/matt-asay
|
||||
[1]:http://readwrite.com/2014/07/07/open-source-software-pros-cons
|
||||
[2]:http://readwrite.com/2014/08/15/open-source-software-business-zulily-erp-wall-street-journal
|
||||
[3]:http://www.cocoanetics.com/2011/01/starting-an-opensource-project-on-github/
|
||||
[4]:http://werd.io/2014/the-roi-of-building-open-source-software
|
||||
[5]:https://www.gov.uk/design-principles
|
||||
[6]:http://asay.blogspot.com/2005/09/so-you-want-to-build-open-source.html
|
||||
[7]:http://www.cnet.com/news/apache-better-than-gpl-for-open-source-business/
|
||||
[8]:https://twitter.com/vitor_io
|
||||
[9]:http://opensourcedesign.is/blogging_about/import-designers/
|
||||
[10]:https://twitter.com/h_ingo/status/501323333301190656
|
||||
[11]:https://news.ycombinator.com/item?id=8122814
|
||||
[12]:http://www.shutterstock.com/
|
||||
@@ -1,8 +1,8 @@
|
||||
Linux有问必答——如何扩展XFS文件系统
|
||||
Linux有问必答:如何扩展XFS文件系统
|
||||
================================================================================
|
||||
> **问题**:我的磁盘上有额外的空间,所以我想要扩展其上创建的现存的XFS文件系统,以完全使用额外空间。怎样才是扩展XFS文件系统的正确途径?
|
||||
|
||||
XFS是一个开源的(GPL)日子文件系统,最初由硅谷图形开发,现在被大多数的Linux发行版都支持。事实上,XFS已经被最新的CentOS/RHEL 7采用,成为其默认的文件系统。在其众多的特性中,包含了“在线调整大小”这一特性,使得现存的XFS文件系统在被挂载时可以进行扩展。然而,对于XFS文件系统的缩减确实不被支持的。
|
||||
XFS是一个开源的(GPL)日志文件系统,最初由硅谷图形(SGI)开发,现在大多数的Linux发行版都支持。事实上,XFS已被最新的CentOS/RHEL 7采用,成为其默认的文件系统。在其众多的特性中,包含了“在线调整大小”这一特性,使得现存的XFS文件系统在已经挂载的情况下可以进行扩展。然而,对于XFS文件系统的**缩减**却还没有支持。
|
||||
|
||||
要扩展一个现存的XFS文件系统,你可以使用命令行工具xfs_growfs,这在大多数Linux发行版上都默认可用。由于XFS支持在线调整大小,目标文件系统可以挂在,也可以不挂载。
|
||||
|
||||
@@ -24,7 +24,7 @@ XFS是一个开源的(GPL)日子文件系统,最初由硅谷图形开发
|
||||
|
||||

|
||||
|
||||
注意,当你扩展一个现存的XFS文件系统时,必须准备事先添加用于XFS文件系统扩展的空间。这虽然是十分明了的事,但是如果在潜在的分区或磁盘卷上没有空闲空间可用的话,xfs_growfs不会做任何事情。同时,如果你尝试扩展XFS文件系统大小到超过磁盘分区或卷的大小,xfs_growfs将会失败。
|
||||
注意,当你扩展一个现存的XFS文件系统时,必须准备好事先添加用于XFS文件系统扩展的空间。这虽然是很显然的事,但是如果在所在的分区或磁盘卷上没有空闲空间可用的话,xfs_growfs就没有办法了。同时,如果你尝试扩展XFS文件系统大小到超过磁盘分区或卷的大小,xfs_growfs将会失败。
|
||||
|
||||

|
||||
|
||||
@@ -33,6 +33,6 @@ XFS是一个开源的(GPL)日子文件系统,最初由硅谷图形开发
|
||||
via: http://ask.xmodulo.com/expand-xfs-file-system.html
|
||||
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
@@ -1,4 +1,4 @@
|
||||
在Ubuntu 14.04中重置Unity和Compiz设置【小贴士】
|
||||
小技巧:在Ubuntu 14.04中重置Unity和Compiz设置
|
||||
================================================================================
|
||||
如果你一直在试验你的Ubuntu系统,你可能最终以Unity和Compiz的一片混乱收场。在此贴士中,我们将看看怎样来重置Ubuntu 14.04中的Unity和Compiz。事实上,全部要做的事,仅仅是运行几个命令而已。
|
||||
|
||||
@@ -34,7 +34,7 @@ via: http://itsfoss.com/reset-unity-compiz-settings-ubuntu-1404/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
在CentOS 7上安装Vmware 10
|
||||
技巧:在CentOS 7上安装Vmware 10
|
||||
================================================================================
|
||||
在CentOS 7上安装Vmware 10.0.3,我将给你们我的经验。通常,这个版本上不能在CentOS 7工作的,因为它只能运行在比较低的内核版本3.10上。
|
||||
在CentOS 7上安装Vmware 10.0.3,我来介绍下我的经验。通常,这个版本是不能在CentOS 7工作的,因为它只能运行在比较低的内核版本3.10上。
|
||||
|
||||
1 - 以正常方式下载并安装(没有问题)。唯一的问题是在后来体验vmware程序的时候。
|
||||
首先,以正常方式下载并安装(没有问题)。唯一的问题是在后来运行vmware程序的时候。
|
||||
|
||||
### 如何修复? ###
|
||||
|
||||
**1 – 进入/usr/lib/vmware/modules/source。**
|
||||
**1 – 进入 /usr/lib/vmware/modules/source。**
|
||||
|
||||
cd /usr/lib/vmware/modules/source
|
||||
|
||||
**2 – 解压vmnet.tar.**
|
||||
**2 – 解压 vmnet.tar.**
|
||||
|
||||
tar -xvf vmnet.tar
|
||||
|
||||
**3 – 进入vmnet-only目录。**
|
||||
**3 – 进入 vmnet-only 目录。**
|
||||
|
||||
cd vmnet-only
|
||||
|
||||
@@ -54,6 +54,6 @@ via: http://www.unixmen.com/install-vmware-10-centos-7/
|
||||
|
||||
作者: M.el Khamlichi
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
@@ -1,4 +1,4 @@
|
||||
Ubuntu 14.04历史文件清理
|
||||
如何清理 Ubuntu 14.04 的最近打开文件历史列表
|
||||
================================================================================
|
||||
这个简明教程对Ubuntu 14.04历史文件清理进行了说明,它用于初学者。
|
||||
|
||||
@@ -21,6 +21,6 @@ Ubuntu 14.04历史文件清理
|
||||
via: http://www.ubuntugeek.com/how-to-delete-recently-opened-files-history-in-ubuntu-14-04.html
|
||||
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
@@ -1,4 +1,4 @@
|
||||
Linux有问必答-- 如何在PDF中嵌入LaTex中的所有字体
|
||||
Linux有问必答:如何在PDF中嵌入LaTex中的所有字体
|
||||
================================================================================
|
||||
> **提问**: 我通过编译LaTex源文件生成了一份PDF文档。然而,我注意到,并不是所有字体都嵌入到了PDF文档中。我怎样才能确保所有的字体嵌入在由LaTex生成的PDF文档中?
|
||||
|
||||
@@ -32,7 +32,7 @@ Linux有问必答-- 如何在PDF中嵌入LaTex中的所有字体
|
||||
via: http://ask.xmodulo.com/embed-all-fonts-pdf-document-latex.html
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
如何使用系统定时器
|
||||
如何使用 systemd 中的定时器
|
||||
================================================================================
|
||||
我最近在写一些运行备份的脚本,我决定使用[systemd timers][1]而不是对我而已更熟悉的[cron jobs][2]来管理它们。
|
||||
我最近在写一些执行备份工作的脚本,我决定使用[systemd timers][1]而不是对我而已更熟悉的[cron jobs][2]来管理它们。
|
||||
|
||||
在我使用时,出现了很多问题需要我去各个地方找资料,这个过程非常麻烦。因此,我想要把我目前所做的记录下来,方便自己的记忆,也方便读者不必像我这样,满世界的找资料了。
|
||||
|
||||
在我下面提到的步骤中有其他的选择,但是这边是最简单的方法。在此之前,查看**systemd.service**, **systemd.timer**,和**systemd.target**的帮助页面(man),学习你能用它们做些什么。
|
||||
在我下面提到的步骤中有其他的选择,但是这里是最简单的方法。在此之前,请查看**systemd.service**, **systemd.timer**,和**systemd.target**的帮助页面(man),学习你能用它们做些什么。
|
||||
|
||||
### 运行一个简单的脚本 ###
|
||||
|
||||
@@ -35,9 +35,9 @@ myscript.timer
|
||||
Description=Runs myscript every hour
|
||||
|
||||
[Timer]
|
||||
# Time to wait after booting before we run first time
|
||||
# 首次运行要在启动后10分钟后
|
||||
OnBootSec=10min
|
||||
# Time between running each consecutive time
|
||||
# 每次运行间隔时间
|
||||
OnUnitActiveSec=1h
|
||||
Unit=myscript.service
|
||||
|
||||
@@ -48,14 +48,14 @@ myscript.timer
|
||||
|
||||
授权并运行的是timer文件,而不是service文件。
|
||||
|
||||
# Start timer, as root
|
||||
# 以 root 身份启动定时器
|
||||
systemctl start myscript.timer
|
||||
# Enable timer to start at boot
|
||||
# 在系统引导起来后就启用该定时器
|
||||
systemctl enable myscript.timer
|
||||
|
||||
### 在同一个Timer上运行多个脚本 ###
|
||||
|
||||
现在我们假设你在相同时间想要运行多个脚本。这种情况,你需要在上面的文件中做适当的修改。
|
||||
现在我们假设你在相同时间想要运行多个脚本。这种情况,**你需要在上面的文件中做适当的修改**。
|
||||
|
||||
#### Service 文件 ####
|
||||
|
||||
@@ -64,9 +64,9 @@ myscript.timer
|
||||
[Install]
|
||||
WantedBy=mytimer.target
|
||||
|
||||
如果在你的service 文件中有一些规则,确保你使用**Description**字段中的值具体化**After=something.service**和**Before=whatever.service**中的参数。
|
||||
如果在你的service 文件中有一些依赖顺序,确保你使用**Description**字段中的值具体指定**After=something.service**和**Before=whatever.service**中的参数。
|
||||
|
||||
另外的一种选择是(或许更加简单),创建一个包装者脚本来使用正确的规则运行合理的命令,并在你的service文件中使用这个脚本。
|
||||
另外的一种选择是(或许更加简单),创建一个包装脚本来使用正确的顺序来运行命令,并在你的service文件中使用这个脚本。
|
||||
|
||||
#### Timer 文件 ####
|
||||
|
||||
@@ -97,11 +97,11 @@ Good luck.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://jason.the-graham.com/2013/03/06/how-to-use-systemd-timers/#enable--start-1
|
||||
via: http://jason.the-graham.com/2013/03/06/how-to-use-systemd-timers/
|
||||
|
||||
作者:Jason Graham
|
||||
译者:[译者ID](https://github.com/johnhoow)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[johnhoow](https://github.com/johnhoow)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
学习VIM之2014
|
||||
================================================================================
|
||||
|
||||
作为一名开发者,你不应该把时间花费在考虑如何去找你所要编辑的代码上。在我转移到完全使用 VIM 的过程中,感到最痛苦的就是它处理文件的方式。从之前主要使用 Eclipse 和 Sublime Text 过渡到 VIM,它没有捆绑一个常驻的文件系统查看器对我造成了不少阻碍,而其内建的打开和切换文件的方式总是让我泪流满面。
|
||||
|
||||
就这一点而言,我非常欣赏VIM文件管理功能的深度。在工作环境上我已经装配了这些工具,甚至比起那些视觉编辑器好很多。因为这个是纯键盘操作,可以让我更快地在代码里面穿梭。搭建环境需要花费一些时间,安装几个插件。首先第一步是我明白vim内建功能只是处理文件的一种选择。在这篇文章里我会带你去认识vim文件管理功能与使用更高级的插件。
|
||||
|
||||
### 基础篇:打开新文件 ###
|
||||
|
||||
学习vim其中最大的一个障碍是缺少可视提示,不像现在的GUI图形编辑器,当你在终端打开一个新的vim是没有明显的提示去提醒你去走什么,所有事情都是靠键盘输入,同时也没有更多更好的界面交互,vim新手需要习惯如何靠自己去查找一些基本的操作指令。好吧,让我开始学习基础吧。
|
||||
|
||||
创建新文件的命令是**:e <filename>或:e** 打开一个新缓冲区保存文件内容。如果文件不存在它会开辟一个缓冲区去保存与修改你指定文件。缓冲区是vim是术语,意为"保存文本块到内存"。文本是否能够与存在的文件关联,要看是否每个你打开的文件都对应一个缓冲区。
|
||||
|
||||
打开文件与修改文件之后,你可以使用**:w**命令来保存在缓冲区的文件内容到文件里面,如果缓冲区不能关联你的文件或者你想保存到另外一个地方,你需要使用**:w <filename>**来保存指定地方。
|
||||
|
||||
这些是vim处理文件的基本知识,很多的开发者都掌握了这些命令,这些技巧你都需要掌握。vim提供了很多技巧让人去深挖。
|
||||
|
||||
### 缓冲区管理 ###
|
||||
|
||||
基础掌握了,就让我来说更多关于缓冲区的东西,vim处理打开文件与其他编辑器有一点不同,打开的文件不会作为一个标签留在一个可见的地方,而是只允许你同时只有一个文件在缓冲区打开,vim允许你打开多个缓存区。一些会显示出来,另外一些就不会,你需要用**:ls**来查看已经打开的缓存,这个命令会显示每个打开的缓存区,同时会有它们的序号,你可以通过这些序号使用**:b <buffer-number>**来切换或者使用循序移动命令 **:bnext** 和 **:bprevious** 也可以使用它们的缩写**:bn**和**:bp**。
|
||||
|
||||
这些命令是vim管理文件缓冲区的一个基础,我发现他们不会按照我的想法映射出来。我不想关心缓冲区的顺序,我只想按照我的想法去到那个文件或者想在当前这个文件.因此必需了解vim更深入的缓存模式,我不是推荐你必须用内部命令来作为主要的文件管理方案。但这些的确是很强大可行的选择。
|
||||
|
||||

|
||||
|
||||
### 分屏 ###
|
||||
|
||||
分屏是vim其中一个最好用的管理文件功能,在vim中你可以将当前窗口同时分开为2个窗口,可以按照你喜欢的配置去重设大小和分配,个别时候,我可以在同时打开6文件每个文件,每个都拥有不同大小。
|
||||
|
||||
你可以通过命令**:sp <filename>**来新建水平分割窗口或者 **:vs <filename>**垂直分割窗口。你可以使用这些关键命令去调整你想要的窗口大小,老实说,我喜欢用鼠标处理vim任务,因为鼠标能够给我更加准确的两列的宽度而不需要猜大概的宽度。
|
||||
|
||||
创建新的分屏后,你需要使用**ctrl-w [h|j|k|l]**来向后向前切换。这个有一点笨拙,但这个却是很重要、很普遍、很容易、很高效的操作。如果你经常使用分屏,我建议你去.vimrc使用以下代码去设置别名为**ctrl-h** **ctrl-j** 等等。
|
||||
|
||||
nnoremap <C-J> <C-W><C-J> "Ctrl-j to move down a split
|
||||
nnoremap <C-K> <C-W><C-K> "Ctrl-k to move up a split
|
||||
nnoremap <C-L> <C-W><C-L> "Ctrl-l to move right a split
|
||||
nnoremap <C-H> <C-W><C-H> "Ctrl-h to move left a split
|
||||
|
||||
### 跳转表 ###
|
||||
|
||||
分屏是解决多个关联文件同时查看问题,但我们仍然不能解决已打开文件与隐藏文件之间快速移动问题。这时跳转表是一个能够解决的工具。
|
||||
|
||||
跳转表是众多插件中看起来奇怪而且很少使用的一个。vim能够追踪每一步命令还有切换你正在修改的文件。每次从一个分屏窗口跳到另外一个,vim都会添加记录到跳转表里面。它记录你去过的地方,这样就不需要担心之前的文件在哪里,你可以使用快捷键去快速追溯你的踪迹。**Ctrl-o**允许你返回你上一次地方。重复操作几次就能够返回到你最先编写的代码段地方。你可以使用**ctrl-i**来向前返回。当你在调试多个文件或在两个文件之间切换时,它能够发挥极大的快速移动功能。
|
||||
|
||||
### 插件 ###
|
||||
|
||||
如果你想vim像Sublime Text 或者Atom一样,我就让你认清一下,这里有很好的机会让你看清一些难懂,可怕和低效的事情。例如大家会发出"当Sublime有了模糊查找功能,为什么我一定要输入全路径才能够打开文件" "没有侧边栏显示目录树我怎样查看项目结构" 等等。但vim有了解决方案。这些方案不需要破坏vim的核心。我只需要经常修改vim配置与添加一些最新的插件,这里有3个有用的插件可以让你像Sublime管理文件
|
||||
|
||||
- [CtrlP][1] 是一个跟Sublime的"Go to Anything"栏一样模糊查找文件.它快如闪电并且非常可配置性。我使用它主要用来打开文件。我只需知道部分的文件名字不需要记住整个项目结构就可以查找了。
|
||||
|
||||
- [The NERDTree][2] 这个一个文件管理夹插件,它重复了很多编辑器都有的侧边文件管理夹功能。我实际上很少用它,对于我而言模糊查找会更加快。对于你接手一个项目,尝试学习项目结构与了解什么可以用是非常方便的,NERDTree是可以自己定制配置,安装它能够代替vim内置的目录工具。
|
||||
|
||||
- [Ack.vim][3] 是一个专为vim的代码搜索插件,它允许你跨项目搜索文本。它封装了Ack 或 Ag 这[两个极其好用的搜索工具][4],允许你在任何时候在你项目之间快速搜索跳转。
|
||||
|
||||
在vim核心与它的插件生态系统之间,vim 提供足够的工具允许你构建你想要得工作环境。文件管理是软件开发系统的最核心部分并且你值得拥有体验的权利。
|
||||
|
||||
开始时需要通过很长的时间去理解它们,然后在找到你感觉舒服的工作流程之后再开始在上面添加工具。但依然值得你去使用,你不用爆头就可以理解如何去使用,能够轻易编写你的代码。
|
||||
|
||||
### 更多插件资源 ###
|
||||
|
||||
- [Seamlessly Navigate Vim & Tmux Splits][5] 这个插件需要每一个想使用它的人都要懂得使用[tmux][6],这个跟vim的splits 一样简单好用。
|
||||
|
||||
- [Using Tab Pages][7] 它是一个vim的标签功能插件,虽然它的名字用起来有一点疑惑,但它不是文件管理器。对如何在有多个工作可视区使用"tab pages" 在vim wiki 网站上有更好的概述。
|
||||
|
||||
- [Vimcasts: The edit command][8] 一般来说 Vimcasts 是大家学习vim的一个好资源。这个屏幕截图与一些内置工作流程很好地描述了之前说的文件操作方面的知识。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://benmccormick.org/2014/07/07/learning-vim-in-2014-working-with-files/
|
||||
|
||||
作者:[Ben McCormick][a]
|
||||
译者:[haimingfg](https://github.com/haimingfg)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://benmccormick.org/2014/07/07/learning-vim-in-2014-working-with-files/
|
||||
[1]:https://github.com/kien/ctrlp.vim
|
||||
[2]:https://github.com/scrooloose/nerdtree
|
||||
[3]:https://github.com/mileszs/ack.vim
|
||||
[4]:http://benmccormick.org/2013/11/25/a-look-at-ack/
|
||||
[5]:http://robots.thoughtbot.com/seamlessly-navigate-vim-and-tmux-splits
|
||||
[6]:http://tmux.sourceforge.net/
|
||||
[7]:http://vim.wikia.com/wiki/Using_tab_pages
|
||||
[8]:http://vimcasts.org/episodes/the-edit-command/
|
||||
[9]:http://feedpress.me/benmccormick
|
||||
[10]:http://eepurl.com/WFYon
|
||||
[11]:http://benmccormick.org/2014/07/14/learning-vim-in-2014-configuring-vim/
|
||||
[12]:http://benmccormick.org/2014/06/30/learning-vim-in-2014-the-basics/
|
||||
[13]:http://benmccormick.org/2014/07/02/learning-vim-in-2014-vim-as-language/
|
||||
@@ -1,10 +1,10 @@
|
||||
使用 GIT 备份 linux 上的网页
|
||||
使用 GIT 备份 linux 上的网页文件
|
||||
================================================================================
|
||||

|
||||
|
||||
BUP 并不单纯是 Git, 而是一款基于 Git 的软件. 一般情况下, 我使用 rsync 来备份我的文件, 而且迄今为止一直工作的很好. 唯一的不足就是无法把文件恢复到某个特定的时间点. 因此, 我开始寻找替代品, 结果发现了 BUP, 一款基于 git 的软件, 它将数据存储在一个仓库中, 并且有将数据恢复到特定时间点的选项.
|
||||
|
||||
要使用 BUP, 你先要初始化一个空的仓库, 然后备份所有文件. 当 BUP 完成一次备份是, 它会创建一个还原点, 你可以过后还原到这里. 它还会创建所有文件的索引, 包括文件的属性和验校和. 当要进行下一个备份是, BUP 会对比文件的属性和验校和, 只保存发生变化的数据. 这样可以节省很多空间.
|
||||
要使用 BUP, 你先要初始化一个空的仓库, 然后备份所有文件. 当 BUP 完成一次备份是, 它会创建一个还原点, 你可以过后还原到这里. 它还会创建所有文件的索引, 包括文件的属性和验校和. 当要进行下一个备份时, BUP 会对比文件的属性和验校和, 只保存发生变化的数据. 这样可以节省很多空间.
|
||||
|
||||
### 安装 BUP (在 Centos 6 & 7 上测试通过) ###
|
||||
|
||||
@@ -20,7 +20,8 @@ BUP 并不单纯是 Git, 而是一款基于 Git 的软件. 一般情况下, 我
|
||||
[techarena51@vps ~]$ make test
|
||||
[techarena51@vps ~]$ sudo make install
|
||||
|
||||
对于 debian/ubuntu 用户, 你可以使用 "apt-get build-dep bup". 要获得更多的信心, 可以查看 https://github.com/bup/bup
|
||||
对于 debian/ubuntu 用户, 你可以使用 "apt-get build-dep bup". 要获得更多的信息, 可以查看 https://github.com/bup/bup
|
||||
|
||||
在 CentOS 7 上, 当你运行 "make test" 时可能会出错, 但你可以继续运行 "make install".
|
||||
|
||||
第一步时初始化一个空的仓库, 就像 git 一样.
|
||||
@@ -49,7 +50,7 @@ BUP 并不单纯是 Git, 而是一款基于 Git 的软件. 一般情况下, 我
|
||||
|
||||
"BUP save" 会把所有内容分块, 然后把它们作为对象储存. "-n" 选项指定备份名.
|
||||
|
||||
你可以查看一系列备份和已备份文件.
|
||||
你可以查看备份列表和已备份文件.
|
||||
|
||||
[techarena51@vps ~]$ bup ls
|
||||
local-etc techarena51 test
|
||||
@@ -88,13 +89,13 @@ BUP 并不单纯是 Git, 而是一款基于 Git 的软件. 一般情况下, 我
|
||||
|
||||
唯一的缺点是你不能把文件恢复到另一个服务器, 你必须通过 SCP 或者 rsync 手动复制文件.
|
||||
|
||||
通过集成的 web 服务器查看备份
|
||||
通过集成的 web 服务器查看备份.
|
||||
|
||||
bup web
|
||||
#specific port
|
||||
bup web :8181
|
||||
|
||||
你可以使用 shell 脚本来运行 bup, 并建立一个每日运行的定时任务
|
||||
你可以使用 shell 脚本来运行 bup, 并建立一个每日运行的定时任务.
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
@@ -103,7 +104,7 @@ BUP 并不单纯是 Git, 而是一款基于 Git 的软件. 一般情况下, 我
|
||||
|
||||
BUP 并不完美, 但它的确能够很好地完成任务. 我当然非常愿意看到这个项目的进一步开发, 希望以后能够增加远程恢复的功能.
|
||||
|
||||
你也许喜欢阅读 使用[inotify-tools][1], 一篇关于实时文件同步的文章.
|
||||
你也许喜欢阅读这篇——使用[inotify-tools][1]实时文件同步.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@@ -111,7 +112,7 @@ via: http://techarena51.com/index.php/using-git-backup-website-files-on-linux/
|
||||
|
||||
作者:[Leo G][a]
|
||||
译者:[wangjiezhe](https://github.com/wangjiezhe)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
Linux日历程序California 0.2 发布了
|
||||
================================================================================
|
||||
**随着[上月的Geary和Shotwell的更新][1],非盈利软件套装Yobra又回来了,这次带来的是新的[California][2]日历程序的发布。**
|
||||
**随着[上月的Geary和Shotwell的更新][1],非盈利软件套装Yobra又回来了,同时带来了是新的[California][2]日历程序。**
|
||||
|
||||
一个合格的桌面日历是工作井井有条(和想要井井有条)的必备工具。[广受欢迎Chrome Web Store上的Sunrise应用][3]的发布意味着选择并不像以前那么少了。California又为这个撑腰了。
|
||||
一个合格的桌面日历是工作井井有条(以及想要井井有条)的必备工具。[Chrome Web Store上广受欢迎的Sunrise应用][3]的发布让我们的选择比以前更丰富了,而California又为之增添了新的生力军!
|
||||
|
||||
Yorba的Jim Nelson在Yorba博客上写道:“发生了很多变化“,接着写道:“初次发布比我想的加入了更多的特性。”
|
||||
Yorba的Jim Nelson在Yorba博客上写道:“发生了很多变化“,接着写道:“...很高兴的告诉大家,初次发布比我预想的加入了更多的特性。”
|
||||
|
||||

|
||||
|
||||
California 0.2在GNOME上看上去棒极了。
|
||||
*California 0.2在GNOME上看上去棒极了。*
|
||||
|
||||
最突出的是添加了“自然语言”解析器。这使得添加事件更容易。相反,你可以直接输入“**在下午2点就Nachos会见Sam”接着California就会自动把它安排下接下来的星期一的下午两点,而不必你手动输入位的信息(日期,时间等等)。
|
||||
最突出变化的是添加了“自然语言”解析器。这使得添加事件更容易。你可以直接输入“**在下午2点就Nachos会见Sam**”接着California就会自动把它安排下接下来的星期一的下午两点,而不必你手动输入位的信息(日期,时间等等)。(LCTT 译注:显然你只能输入英文才行)
|
||||
|
||||
|
||||

|
||||
|
||||
当我们在5月份回顾开发版本时这个特性也能工作了,甚至修复了一个问题:重复事件。
|
||||
这个功能和我们我们在5月份评估开发版本时一样好用,甚至还修复了一个bug:事件重复。
|
||||
|
||||
要创建一个重复时间(比如:“每个星期四搜索自己的名字”),你需要在日期前包含文字“every”(每个)。要确保地点也在内(比如:中午12点和Samba De Amigo在Boston Tea Party喝咖啡)。条目中需要有“at”或者“@”。
|
||||
|
||||
至于详细信息,我们可以见[GNOME Wiki上的快速添加页面][4]
|
||||
至于详细信息,我们可以见[GNOME Wiki上的快速添加页面][4]:
|
||||
|
||||
其他的改变包括:
|
||||
|
||||
- 通过‘月’和‘周’查看事件
|
||||
-以‘月’和‘周’视图查看事件
|
||||
-添加/删除 Google,CalDAV和web(.ics)日历
|
||||
- 改进数据服务器整合
|
||||
-添加/编辑/啥是拿出远程事件(包括重复事件)
|
||||
-自然语言计划
|
||||
-F1在线帮助快捷键
|
||||
- 新的动画和弹出窗口
|
||||
-改进数据服务器整合
|
||||
-添加/编辑/删除远程事件(包括重复事件)
|
||||
-用自然语言安排计划
|
||||
-按下F1获取在线帮助
|
||||
-新的动画和弹出窗口
|
||||
|
||||
### 在Ubuntu 14.10上安装 California 0.2 ###
|
||||
|
||||
由于是GNOME 3的程序,可以说这下面程序看起来和感受上更好。
|
||||
作为一个GNOME 3的程序,它在 Gnome 3下运行的外观和体验会更好。
|
||||
|
||||
Yorba没有忽略Ubuntu用户。他们已经努力(也可以说是耐心地)地解决导致Ubuntu需要同时安装GTK+和GNOME的主题问题。结果就是在Ubuntu上程序可能看上去有点错位,但是同样工作的很好。
|
||||
不过,Yorba也没有忽略Ubuntu用户。他们已经努力(也可以说是耐心地)地解决导致Ubuntu需要同时安装GTK+和GNOME的主题问题。结果就是在Ubuntu上程序可能看上去有点错位,但是同样工作的很好。
|
||||
|
||||
California 0.2在[Yorba稳定版软件PPA][5]中可以下载,且只针对Ubuntu 14.10。
|
||||
California 0.2在[Yorba稳定版软件PPA][5]中可以下载,只用于Ubuntu 14.10。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@@ -45,7 +45,7 @@ via: http://www.omgubuntu.co.uk/2014/10/california-calendar-natural-language-par
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
Linux Kernel 3.17 带来了很多新特性
|
||||
================================================================================
|
||||
Linus Torvalds已经发布了最新的稳定版内核3.17。
|
||||
|
||||

|
||||
|
||||
Torvalds以他典型的[放任式][1]的口吻在Linux内核邮件列表中解释说:
|
||||
|
||||
> “过去的一周很平静,我对3.17的如期发布没有疑虑(相对于乐观的“我应该早一周发布么”的计划而言)。”
|
||||
|
||||
由于假期,Linux说他还没有开始合并3.18的改变:
|
||||
|
||||
>“我马上要去旅行了- 在我期盼早点发布的时候我希望避免一些事情。这意味着在3.17发布后,我不会在下周非常活跃地合并新的东西,并且下下周是LinuxCon EU”
|
||||
|
||||
### Linux 3.17有哪些新的? ###
|
||||
|
||||
最新版本的 Linux 3.17 加入了最新的改进,硬件支持,修复等等。范围从不明觉厉的 - 比如:[memfd 和 文件密封补丁][2] - 到大多数人感兴趣的,比如最新硬件的支持。
|
||||
|
||||
下面是这次发布的一些亮点的列表,但它们并不详尽:
|
||||
|
||||
- Microsoft Xbox One 控制器支持 (没有震动反馈)
|
||||
- 额外的Sony SIXAXIS支持改进
|
||||
- 东芝 “主动防护感应器” 支持
|
||||
- 新的包括Rockchip RK3288和AllWinner A23 SoC的ARM芯片支持
|
||||
- 安全计算设备上的“跨线程过滤设置”
|
||||
- 基于Broadcom BCM7XXX板卡的支持(用在不同的机顶盒上)
|
||||
- 增强的AMD Radeon R9 290支持
|
||||
- Nouveau 驱动改进,包括Kepler GPU修复
|
||||
- 包含Intel Broadwell超级本上的Wildcatpoint Audio DSP音频支持
|
||||
|
||||
### 在Ubuntu上安装 Linux 3.17 ###
|
||||
|
||||
虽然被列为稳定版,但是目前对于大多数人而言只有很少的功能需要我们“现在去安装”。
|
||||
|
||||
但是如果你很耐心——**更重要的是**——有足够的技能去处理从中导致的问题,你可以通过在由Canonical维护的主线内核存档中找到一系列合适的包安装在你的Ubuntu 14.10中,升级到Linux 3.17。
|
||||
|
||||
**警告:除非你知道你正在做什么,不要尝试从下面的链接中安装任何东西。**
|
||||
|
||||
- [访问Ubuntu内核主线存档][3]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/10/linux-kernel-3-17-whats-new-improved
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:http://lkml.iu.edu/hypermail/linux/kernel/1410.0/02818.html
|
||||
[2]:http://lwn.net/Articles/607627/
|
||||
[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D
|
||||
@@ -0,0 +1,45 @@
|
||||
慕尼黑市市长透露重返 Windows 的费用
|
||||
================================================================================
|
||||
> **摘要**: 慕尼黑市市长透露了在该市摆脱微软十年之后再次放弃 Linux 重返 Windows 的费用,大约需要数以百万计的欧元。
|
||||
|
||||
慕尼黑市市长透露,重返 Windows 将需要花费上百万欧元购买新的硬件。
|
||||
|
||||
今年早些时候,该市新当选的市长提出慕尼黑可能重返 Windows,尽管市当局[用了若干年才迁移到基于 Linux 的操作系统和开源软件][1](摘要译文:http://linux.cn/article-2294-1.html)。
|
||||
|
||||
作为最著名的从微软迁移到 Linux 桌面系统的案例,慕尼黑投向开源软件的做法一直引发各种争议和讨论。慕尼黑的迁移始于2004年,还有一些德国的地方当局也[追随它的脚步转向开源][2]。
|
||||
|
||||
目前还没有[制定好返回 Windows 桌面的计划][3],但是当局正在调研哪种操作系统和软件包(包括专有软件和开源软件)更适合他们的需求。调研报告也将统计迁移到开源软件所花费的费用。
|
||||
|
||||
Dieter Reiter市长在[回应慕尼黑的绿党的问询][4]时透露了重返 Windows 的费用。
|
||||
|
||||
Reiter 说,迁移到 Windows 7 需要替换它14000名以上的职员的所有个人电脑,此举将花费 315万欧元。这还没有包括软件许可证费用和基础设施的投入,Reiter 说由于没有进一步计划,所以还没办法测算。他说,如果迁移到 Windows 8 将花费更多。
|
||||
|
||||
Reiter 说,返回微软将导致迁移到 [Limux][5]、OpenOffice 及其它开源开源所花费的1400万欧元打了水漂。而部署 Limux 并从微软 Office 迁移的项目实施、支持、培训、修改系统以及 Limux 相关软件的授权等工作都将被搁置,他补充道。
|
||||
|
||||
他还透露说,(之前)迁移到 Limux 为市政府节约了大概1100万欧元的许可证和硬件费用,因为基于 Ubuntu 的 Limux 操作系统要比升级较新版本的 Windows 对硬件的需要要低。
|
||||
|
||||
在这个回应中 Reiter 告诉 Stadtbild 杂志说,他是微软的粉丝,但是这并不会影响到这份 IT 审计报告。
|
||||
|
||||
“在接受 Stadtbild 杂志的采访中我透露我是微软粉丝后,我就收到了大量的信件,询问我们的 IT 团队是否能令人满意的满足用户在任何时候的需求,以及是否有足够的能力为一个现代化大都市的政府服务。”
|
||||
|
||||
“这件事有许多方面,用户满意度是其中之一。这和我个人偏好无关,也和我在开源方面的经验无关。”
|
||||
|
||||
在他的回应中,并不是由于职员们的对迁移到开源的抱怨而导致本次审计的决定。他说,这是来自对职员在 IT 方面的调查而产生的审计,并不独是 Limux OS。
|
||||
|
||||
他还提到了一个 Windows 和基于 Linux 的操作系统的相对安全的问题。他指出,根据德国国家安全局 BSI 的信息,发现 Linux 要比 Windows 漏洞更多,不过只是使用量较少罢了。然而他也补充说,这种比较也许有不同的解释。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.zdnet.com/munich-sheds-light-on-the-cost-of-dropping-linux-and-returning-to-windows-7000034718/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.zdnet.com/meet-the-team/uk/nick-heath/
|
||||
[1]:http://www.techrepublic.com/article/how-munich-rejected-steve-ballmer-and-kicked-microsoft-out-of-the-city/
|
||||
[2]:http://www.techrepublic.com/blog/european-technology/its-not-just-munich-open-source-gains-new-ground-in-germany/
|
||||
[3]:http://www.techrepublic.com/article/no-munich-isnt-about-to-ditch-free-software-and-move-back-to-windows/
|
||||
[4]:http://www.ris-muenchen.de/RII2/RII/DOK/ANTRAG/3456728.pdf
|
||||
[5]:http://en.wikipedia.org/wiki/LiMux
|
||||
@@ -1,11 +1,12 @@
|
||||
使用Vmstat和Iostat命令进行Linux性能监控
|
||||
使用vmstat和iostat命令进行Linux性能监控
|
||||
================================================================
|
||||
这是我们正在进行的**Linux**命令和性能监控系列的一部分。**Vmstat**和**Iostat**两个命令都适用于所有主要的类**unix**系统(**Linux/unix/FreeBSD/Solaris**)。
|
||||
如果**vmstat**和**iostat**命令在你的系统中不可用,请安装**sysstat**软件包。**vmstat**,**sar**和**iostat**命令都包含在**sysstat**(系统监控工具)软件包中。iostat命令生成**CPU**和所有设备的统计信息。你可以从连接[sysstat][1]中下载源代码包编译安装sysstat,但是我们建议通过**YUM**命令进行安装。
|
||||
这是我们正在进行的**Linux**命令和性能监控系列的一部分。**vmstat**和**iostat**两个命令都适用于所有主要的类**unix**系统(**Linux/unix/FreeBSD/Solaris**)。
|
||||
|
||||
如果**vmstat**和**iostat**命令在你的系统中不可用,请安装**sysstat**软件包。**vmstat**,**sar**和**iostat**命令都包含在**sysstat**(系统监控工具)软件包中。iostat命令生成**CPU**和所有设备的统计信息。你可以从[这个连接][1]中下载源代码包编译安装sysstat,但是我们建议通过**YUM**命令进行安装。
|
||||
|
||||

|
||||
|
||||
使用Vmstat和Iostat命令进行Linux性能监控
|
||||
*使用Vmstat和Iostat命令进行Linux性能监控*
|
||||
|
||||
###在Linux系统中安装sysstat###
|
||||
|
||||
@@ -18,7 +19,7 @@
|
||||
|
||||
####1. 列出活动和非活动的内存####
|
||||
|
||||
如下范例中输出6列。**vmstat**的man页面中解析的每一列的意义。最重要的是内存中的**free**属性和交换分区中是**si**和**so**属性。
|
||||
如下范例中输出6列。**vmstat**的man页面中解析的每一列的意义。最重要的是内存中的**free**属性和交换分区中的**si**和**so**属性。
|
||||
|
||||
[root@tecmint ~]# vmstat -a
|
||||
|
||||
@@ -33,6 +34,7 @@
|
||||
**注意**:如果你不带参数的执行**vmstat**命令,它会输出自系统启动以来的总结报告。
|
||||
|
||||
####2. 每X秒执行vmstat,共执行N次####
|
||||
|
||||
下面命令将会每2秒中执行一次**vmstat**,执行6次后自动停止执行。
|
||||
|
||||
[root@tecmint ~]# vmstat 2 6
|
||||
@@ -65,7 +67,6 @@
|
||||
|
||||
**vmstat**命令的**-s**参数,将输出各种事件计数器和内存的统计信息。
|
||||
|
||||
|
||||
[tecmint@tecmint ~]$ vmstat -s
|
||||
|
||||
1030800 total memory
|
||||
@@ -237,7 +238,7 @@ via: http://www.tecmint.com/linux-performance-monitoring-with-vmstat-and-iostat-
|
||||
|
||||
作者:[Ravi Saive][a]
|
||||
译者:[cvsher](https://github.com/cvsher)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
集所有功能与一身的Linux系统性能和使用活动监控工具-Sysstat
|
||||
全能冠军:Linux系统性能和使用活动监控工具 sysstat
|
||||
===========================================================================
|
||||
**Sysstat**是一个非常方便的工具,它带有众多的系统资源监控工具,用于监控系统的性能和使用情况。我们在日常使用的工具中有相当一部分是来自sysstat工具包的。同时,它还提供了一种使用cron表达式来制定性能和活动数据的收集计划。
|
||||
|
||||

|
||||
|
||||
在Linux系统中安装Sysstat
|
||||
|
||||
下表是包含在sysstat包中的工具
|
||||
|
||||
- [**isstat**][1]: 输出CPU的统计信息和所有I/O设备的输入输出(I/O)统计信息。
|
||||
- **mpstat**: 关于多有CPU的详细信息(单独输出或者分组输出)。
|
||||
- [**iostat**][1]: 输出CPU的统计信息和所有I/O设备的输入输出(I/O)统计信息。
|
||||
- **mpstat**: 关于CPU的详细信息(单独输出或者分组输出)。
|
||||
- **pidstat**: 关于运行中的进程/任务、CPU、内存等的统计信息。
|
||||
- **sar**: 保存并输出不同系统资源(CPU、内存、IO、网络、内核、等。。。)的详细信息。
|
||||
- **sadc**: 系统活动数据收集器,用于手机sar工具的后端数据。
|
||||
- **sa1**: 系统手机并存储sadc数据文件的二进制数据,与sadc工具配合使用
|
||||
- **sar**: 保存并输出不同系统资源(CPU、内存、IO、网络、内核等。。。)的详细信息。
|
||||
- **sadc**: 系统活动数据收集器,用于收集sar工具的后端数据。
|
||||
- **sa1**: 系统收集并存储sadc数据文件的二进制数据,与sadc工具配合使用
|
||||
- **sa2**: 配合sar工具使用,产生每日的摘要报告。
|
||||
- **sadf**: 用于以不同的数据格式(CVS或者XML)来格式化sar工具的输出。
|
||||
- **Sysstat**: sysstat工具的man帮助页面。
|
||||
@@ -26,9 +24,9 @@ pidstat命令新增了一些新的选项:首先是“-R”选项,该选项
|
||||
|
||||
sar、sadc和sadf命令在数据文件方面同样带来了一些功能上的增强。与以往只能使用“**saDD**”来命名数据文件。现在使用**-D**选项可以用“**saYYYYMMDD**”来重命名数据文件,同样的,现在的数据文件不必放在“**var/log/sa**”目录中,我们可以使用“SA_DIR”变量来定义新的目录,该变量将应用与sa1和sa2命令。
|
||||
|
||||
###在Linux系统中安装Sysstat####
|
||||
###在Linux系统中安装sysstat####
|
||||
|
||||
在主要的linux发行版中,‘**Sysstat**’工具包可以在默认的程序库中安装。然而,在默认程序库中的版本通常有点旧,因此,我们将会下载源代码包,编译安装最新版本(**11.0.0**版本)。
|
||||
在主要的linux发行版中,‘**sysstat**’工具包可以在默认的程序库中安装。然而,在默认程序库中的版本通常有点旧,因此,我们将会下载源代码包,编译安装最新版本(**11.0.0**版本)。
|
||||
|
||||
首先,使用下面的连接下载最新版本的sysstat包,或者你可以使用**wget**命令直接在终端中下载。
|
||||
|
||||
@@ -38,7 +36,7 @@ sar、sadc和sadf命令在数据文件方面同样带来了一些功能上的增
|
||||
|
||||

|
||||
|
||||
下载Sysstat包
|
||||
*下载sysstat包*
|
||||
|
||||
然后解压缩下载下来的包,进去该目录,开始编译安装
|
||||
|
||||
@@ -47,21 +45,25 @@ sar、sadc和sadf命令在数据文件方面同样带来了一些功能上的增
|
||||
|
||||
这里,你有两种编译安装的方法:
|
||||
|
||||
a).第一,你可以使用**iconfig**(这将会给予你很大的灵活性,你可以选择/输入每个参数的自定义值)
|
||||
####a)####
|
||||
|
||||
第一,你可以使用**iconfig**(这将会给予你很大的灵活性,你可以选择/输入每个参数的自定义值)
|
||||
|
||||
# ./iconfig
|
||||
|
||||

|
||||
|
||||
Sysstat的iconfig命令
|
||||
*sysstat的iconfig命令*
|
||||
|
||||
b).第二,你可以使用标准的**configure**命令在当行中定义所有选项。你可以运行 **./configure –help 命令**来列出该命令所支持的所有限选项。
|
||||
####b)####
|
||||
|
||||
第二,你可以使用标准的**configure**,在命令行中定义所有选项。你可以运行 **./configure –help 命令**来列出该命令所支持的所有限选项。
|
||||
|
||||
# ./configure --help
|
||||
|
||||

|
||||
|
||||
Stsstat的cofigure -help
|
||||
*stsstat的cofigure -help*
|
||||
|
||||
在这里,我们使用标准的**./configure**命令来编译安装sysstat工具包。
|
||||
|
||||
@@ -71,7 +73,7 @@ Stsstat的cofigure -help
|
||||
|
||||

|
||||
|
||||
在Linux系统中配置sysstat
|
||||
*在Linux系统中配置sysstat*
|
||||
|
||||
在编译完成后,我们将会看到一些类似于上图的输出。现在运行如下命令来查看sysstat的版本。
|
||||
|
||||
@@ -80,7 +82,7 @@ Stsstat的cofigure -help
|
||||
sysstat version 11.0.0
|
||||
(C) Sebastien Godard (sysstat <at> orange.fr)
|
||||
|
||||
###在Linux 系统中更新sysstat###
|
||||
###更新Linux 系统中的sysstat###
|
||||
|
||||
默认的,sysstat使用“**/usr/local**”作为其目录前缀。因此,所有的二进制数据/工具都会安装在“**/usr/local/bin**”目录中。如果你的系统已经安装了sysstat 工具包,则上面提到的二进制数据/工具有可能在“**/usr/bin**”目录中。
|
||||
|
||||
@@ -112,11 +114,11 @@ via: http://www.tecmint.com/install-sysstat-in-linux/
|
||||
|
||||
作者:[Kuldeep Sharma][a]
|
||||
译者:[cvsher](https://github.com/cvsher)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/kuldeepsharma47/
|
||||
[1]:http://www.tecmint.com/linux-performance-monitoring-with-vmstat-and-iostat-commands/
|
||||
[1]:http://linux.cn/article-4024-1.html
|
||||
[2]:http://sebastien.godard.pagesperso-orange.fr/download.html
|
||||
[3]:http://sebastien.godard.pagesperso-orange.fr/documentation.html
|
||||
@@ -1,54 +0,0 @@
|
||||
Linux Kernel 3.17 Is Out With Plenty of New Features
|
||||
================================================================================
|
||||
Linus Torvalds has announced the latest stable release of the Linux kernel, version 3.17.
|
||||
|
||||

|
||||
|
||||
Announced in his typical [laissez-faire style][1] in a post on the Linux Kernel Mailing List Torvalds explained:
|
||||
|
||||
> “So the past week was fairly calm, and so I have no qualms about releasing 3.17 on the normal schedule (as opposed to the optimistic “maybe I can release it one week early” schedule that was not to be).”
|
||||
|
||||
Due to travel Linus says he won’t start merging changes for Linux 3.18 just yet:
|
||||
|
||||
> “I now have travel coming up – something I hoped to avoid when I was hoping for releasing early. Which means that while 3.17 is out, I’m not going to be merging stuff very actively next week, and the week after that is LinuxCon EU…”
|
||||
|
||||
### What’s New In Linux 3.17? ###
|
||||
|
||||
As with every new release, Linux 3.17 sees the kernel loaded up on the latest improvements, hardware support, fixes and so on. These range from the bamboozling – e.g., [memfd and file sealing patches][2] – to the sort of things most of us appreciate, such as support for new hardware.
|
||||
|
||||
Below is a short list compiling some notable highlights of this release. It’s by no means exhaustive.
|
||||
|
||||
- Microsoft Xbox One controller support (without vibration)
|
||||
- Additional improvements to Sony SIXAXIS support
|
||||
- Toshiba “Active Protection Sensor” support
|
||||
- New ARM support includes Rockchip RK3288 and AllWinner A23 SoCs
|
||||
- “Cross-thread filter setting” for secure computing facility
|
||||
- Broadcom BCM7XXX-based board support (used in various set-top boxes)
|
||||
- Enhanced AMD Radeon R9 290 support
|
||||
- Misc. Nouveau driver improvements, including Kepler GPU fixes
|
||||
- Audio support includes Wildcatpoint Audio DSP on Intel Broadwell Ultrabooks.
|
||||
|
||||
### Installing Linux 3.17 on Ubuntu ###
|
||||
|
||||
Although classed as stable there is, at present, little need for most of us to “have it now”.
|
||||
|
||||
But if you’re impatient and — **more importantly** — skilled enough to handle issues resulting from it, you can install Linux 3.17 in Ubuntu 14.10 by installing the appropriate set of packages for your system from the mainline kernel archive maintained by Canonical.
|
||||
|
||||
**Do not attempt to install anything from this link unless you know what you’re doing.**
|
||||
|
||||
- [Visit the Ubuntu Kernel Mainline Archive][3]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/10/linux-kernel-3-17-whats-new-improved
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:http://lkml.iu.edu/hypermail/linux/kernel/1410.0/02818.html
|
||||
[2]:http://lwn.net/Articles/607627/
|
||||
[3]:http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D
|
||||
@@ -0,0 +1,35 @@
|
||||
Linus Torvalds Regrets Alienating Developers with Strong Language
|
||||
================================================================================
|
||||
> He didn't name anyone, but this sounds like an apology
|
||||
|
||||
**Linus Torvalds talked today at LinuxCon and CloudOpen Europe, a conference organized by the Linux Foundation that reunites all the big names in the open source world. He answered a lot of questions and he also talked about the effects of the strong language he uses in the mailing list.**
|
||||
|
||||
Linus Torvalds is recognized as the creator of the Linux kernel and the maintainer of the latest development version. He makes sure that we get a new RC almost every week and he is very involved in the discussions that take place in the mailing list. He doesn't really choose his words and has been blamed for using strong language with some of the developers.
|
||||
|
||||
The latest problem of this kind, which surfaced in the news as well, was when [he decided to block code from a particular developer][1], after making some very harsh remarks. He is known to be very abrasive, especially when kernel developers break user space to fix something in the kernel. The same happened in this case and he basically went mental on the guy.
|
||||
|
||||
### This is the closest he's been to an apology ###
|
||||
|
||||
Linus Torvalds never really talked about that particular discussion since and people moved on, but recently a systemd developer talked about the strong language in the open source community and he mentioned Linus Torvalds by name. He's not known to apologize, so this admission of guilt during LinuxCon is a big step forward. The moderator asked him what single decision in the last 23 years he would change.
|
||||
|
||||
"From a technical standpoint, no single decision has ever been that important... The problems tend to be around alienating users or developers and I'm pretty good at that. I use strong language. But again there's not a single instance I'd like to fix. There's a metric [expletive]load of those."
|
||||
|
||||
"One of the reasons we have this culture of strong language, that admittedly many people find off-putting, is that when it comes to technical people with strong opinions and with a strong drive to do something technically superior, you end up having these opinions show up as sometimes pretty strong language," [said][2] Linus Torvalds.
|
||||
|
||||
He didn't mention anyone by name or any specific incident, but the proximity to the complaints issued by Leonart Pottering, the systemd developer, seems to point towards that issue.
|
||||
|
||||
It also looks like Linux kernel 3.18 RC1 will arrive later this week and we'll soon have something new to play with.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://news.softpedia.com/news/Linus-Torvalds-Regrets-Alienating-Developers-with-Strong-Language-462191.shtml
|
||||
|
||||
作者:[Silviu Stahie][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://news.softpedia.com/editors/browse/silviu-stahie
|
||||
[1]:http://news.softpedia.com/news/Linus-Torvalds-Block-All-Code-from-Systemd-Developer-for-the-Linux-Kernel-435714.shtml
|
||||
[2]:http://www.linux.com/news/featured-blogs/200-libby-clark/791788-linus-torvalds-best-quotes-from-linuxcon-europe-2014
|
||||
@@ -0,0 +1,60 @@
|
||||
Linus Torvalds' Best Quotes from LinuxCon Europe 2014
|
||||
================================================================================
|
||||

|
||||
|
||||
Linux creator Linus Torvalds answered questions from Dirk Hohndel, Intel's chief Linux and open source technologist, on Wednesday, Oct. 15, 2014 at LinuxCon and CloudOpen Europe.
|
||||
|
||||
Linus Torvalds doesn't regret any of the technical decisions he's made over the past 23 years since he first created Linux, he said Wednesday at [LinuxCon and CloudOpen Europe][1].
|
||||
|
||||
“Technical issues, even when they're completely wrong, and they have been, you can fix them later,” said Torvalds, a Linux Foundation fellow.
|
||||
|
||||

|
||||
|
||||
Despite these personal issues and disagreements the community has thrived, and created the best technology they possibly can, said Linus Torvalds at LinuxCon Europe 2014.
|
||||
|
||||
He does, however, regret the times he has alienated developers and users with his use of strong language on the kernel mailing list, he said. Relationships can't be so easily fixed.
|
||||
|
||||
Despite these personal issues and disagreements the community has thrived, and created the best technology they possibly can. This is, Torvalds said, the ultimate goal.
|
||||
|
||||
In a Q&A on stage with Dirk Hohndel, Intel's chief Linux and open source technologist, Torvalds spoke about the state of the community, the kernel development process, what it takes to be a kernel developer, and the future of Linux. Here are some highlights of the discussion.
|
||||
|
||||
**1.** “The speed of development has not really slowed down the last few years. We have had around 10,000 patches every release from more than 1,000 people and the end result has been very good.”
|
||||
|
||||
**2.** Dirk Hohndel: “You said you wanted subsystem maintainers to consider following the x86 model and have more than one maintainer share the role. How about applying your own advice at the top?
|
||||
|
||||
Torvalds: “I'll probably have to do that someday. Right now I'm not getting a lot of complaints for not being responsive. Being responsive is one of the most important things a kernel developer at any level can be... So far, partly thanks to Git, I've been able to keep up.”
|
||||
|
||||
**3.** “A lot of people want to have market share numbers, lots of users, because that's how they view their self worth. For me, one of the most important things for Linux is having a big community that is actively testing new kernels; it's the only way to support the absolute insane amount of different hardware we deal with.”
|
||||
|
||||
**4.** Hohndel: “If you could change a single decision you've made in the last 23 years, what would you do differently?”
|
||||
|
||||
Torvalds: “From a technical standpoint, no single decision has ever been that important... The problems tend to be around alienating users or developers and I'm pretty good at that. I use strong language. But again there's not a single instance I'd like to fix. There's a metric shitload of those.”
|
||||
|
||||
**5.** “Most people even if though they don't always necessarily like each other, do tend to respect the code they generate. For Linux that's the important part. What really matters is people are very involved in generating the best technology we can.”
|
||||
|
||||
**6.** “On the internet nobody can hear you being subtle.”
|
||||
|
||||
**7.** “One of the reasons we have this culture of strong language, that admittedly many people find off-putting, is that when it comes to technical people with strong opinions and with a strong drive to do something technically superior, you end up having these opinions show up as sometimes pretty strong language.”
|
||||
|
||||
**8.** Hohndel: What will you tell a student who wants to become the next Linus?
|
||||
|
||||
Torvalds: “Find something that you're passionate about and just do it.”
|
||||
|
||||
**9.** “Becoming a maintainer is easy; you just need an infinite amount of time and respond to email from random people.”
|
||||
|
||||
**10.** Hohndel: “Make a bold prediction about the future of Linux.”
|
||||
|
||||
Torvalds: “The boldest prediction I can say is, I will probably release rc1 in about a week.”
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linux.com/news/featured-blogs/200-libby-clark/791788-linus-torvalds-best-quotes-from-linuxcon-europe-2014
|
||||
|
||||
作者:[Libby Clark][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linux.com/community/forums/person/41373/catid/200-libby-clark
|
||||
[1]:http://events.linuxfoundation.org/events/linuxcon-europe
|
||||
@@ -0,0 +1,219 @@
|
||||
Compact Text Editors Great for Remote Editing and Much More
|
||||
================================================================================
|
||||
A text editor is software used for editing plain text files. This type of software has many different uses including modifying configuration files, writing programming language source code, jotting down thoughts, or even making a grocery list. Given that editors can be used for such a diverse range of activities, it is worth spending the time finding an editor that best suites your preferences.
|
||||
|
||||
Whatever the level of sophistication of the editor, they typically have a common set of functionality, such as searching/replacing text, formatting text, importing files, as well as moving text within the file.
|
||||
|
||||
All of these text editors are console based applications which make them ideal for editing files on remote machines. Textadept also provides a graphical user interface, but remains fast and minimalist.
|
||||
|
||||
Console based applications are also light on system resources (very useful on low spec machines), can be faster and more efficient than their graphical counterparts, they do not stop working when X needs to be restarted, and are great for scripting purposes.
|
||||
|
||||
I have selected my favorite open source text editors that are frugal on system resources.
|
||||
|
||||
----------
|
||||
|
||||
### Textadept ###
|
||||
|
||||

|
||||
|
||||
Textadept is a fast, minimalist, and extensible cross-platform open source text editor for programmers. This open source application is written in a mixture of C and Lua and has been optimized for speed and minimalism over the years.
|
||||
|
||||
Textadept is an ideal editor for programmers who want endless extensibility options without sacrificing speed or succumbing to code bloat and featuritis.
|
||||
|
||||
There is also a version available for the terminal, which only depends on ncurses; great for editing on remote machines.
|
||||
|
||||
#### Features include: ####
|
||||
|
||||
|
||||
- Lightweight
|
||||
- Minimal design maximizes screen real estate
|
||||
- Self-contained executable – no installation necessary
|
||||
- Entirely keyboard driven
|
||||
- Unlimited split views (GUI version) split the editor window as many times as you like either horizontally or vertically. Please note that Textadept is not a tabbed editor
|
||||
- Support for over 80 programming languages
|
||||
- Powerful snippets and key commands
|
||||
- Code autocompletion and API lookup
|
||||
- Unparalleled extensibility
|
||||
- Bookmarks
|
||||
- Find and Replace
|
||||
- Find in Files
|
||||
- Buffer-based word completion
|
||||
- Adeptsense autocomplete symbols for programming languages and display API documentation
|
||||
- Themes: light, dark, and term
|
||||
- Uses lexers to assign names to buffer elements like comments, strings, and keywords
|
||||
- Sessions
|
||||
- Snapopen
|
||||
- Available modules include support for Java, Python, Ruby and recent file lists
|
||||
- Conforms with the Gnome HIG Human Interface Guidelines
|
||||
- Modules include support for Java, Python, Ruby and recent file lists
|
||||
- Support for editing Lua code. Syntax autocomplete and LuaDoc is available for many Textadept objects as well as Lua’s standard libraries
|
||||
|
||||
- Website: [foicica.com/textadept][1]
|
||||
- Developer: Mitchell and contributors
|
||||
- License: MIT License
|
||||
- Version Number: 7.7
|
||||
|
||||
----------
|
||||
|
||||
### Vim ###
|
||||
|
||||

|
||||
|
||||
Vim is an advanced text editor that seeks to provide the power of the editor 'Vi', with a more complete feature set.
|
||||
|
||||
This editor is very useful for editing programs and other plain ASCII files. All commands are given with normal keyboard characters, so those who can type with ten fingers can work very fast. Additionally, function keys can be defined by the user, and the mouse can be used.
|
||||
|
||||
Vim is often called a "programmer's editor," and is so useful for programming that many consider it to be an entire Integrated Development Environment. However, this application is not only intended for programmers. Vim is highly regarded for all kinds of text editing, from composing email to editing configuration files.
|
||||
|
||||
Vim's interface is based on commands given in a text user interface. Although its graphical user interface, gVim, adds menus and toolbars for commonly used commands, the software's entire functionality is still reliant on its command line mode.
|
||||
|
||||
#### Features include: ####
|
||||
|
||||
|
||||
- 3 modes:
|
||||
- - Command mode
|
||||
- - Insert mode
|
||||
- - Command line mode
|
||||
- Unlimited undo
|
||||
- Multiple windows and buffers
|
||||
- Flexible insert mode
|
||||
- Syntax highlighting highlight portions of the buffer in different colors or styles, based on the type of file being edited
|
||||
- Interactive commands
|
||||
- - Marking a line
|
||||
- - vi line buffers
|
||||
- - Shift a block of code
|
||||
- Block operators
|
||||
- Command line history
|
||||
- Extended regular expressions
|
||||
- Edit compressed/archive files (gzip, bzip2, zip, tar)
|
||||
- Filename completion
|
||||
- Block operations
|
||||
- Jump tags
|
||||
- Folding text
|
||||
- Indenting
|
||||
- ctags and cscope intergration
|
||||
- 100% vi compatibility mode
|
||||
- Plugins to add/extend functionality
|
||||
- Macros
|
||||
- vimscript, Vim's internal scripting language
|
||||
- Unicode support
|
||||
- Multi-language support
|
||||
- Integrated On-line help
|
||||
|
||||
- Website: [www.vim.org][2]
|
||||
- Developer: Bram Moolenaar
|
||||
- License: GNU GPL compatible (charityware)
|
||||
- Version Number: 7.4
|
||||
|
||||
----------
|
||||
|
||||
### ne ###
|
||||
|
||||

|
||||
|
||||
ne is a full screen open source text editor. It is intended to be an easier to learn alternative to vi, yet still portable across POSIX-compliant operating systems.
|
||||
|
||||
ne is easy to use for the beginner, but powerful and fully configurable for the wizard, and most sparing in its resource usage.
|
||||
|
||||
#### Features include: ####
|
||||
|
||||
|
||||
- Three user interfaces: control keystrokes, command line, and menus; keystrokes and menus are completely configurable
|
||||
- Syntax highlighting
|
||||
- Full support for UTF-8 files, including multiple-column characters
|
||||
- The number of documents and clips, the dimensions of the display, and the file/line lengths are limited only by the integer size of the machine
|
||||
- Simple scripting language where scripts can be generated via an idiotproof record/play method
|
||||
- Unlimited undo/redo capability (can be disabled with a command)
|
||||
- Automatic preferences system based on the extension of the file name being edited
|
||||
- Automatic completion of prefixes using words in your documents as dictionary
|
||||
- File requester with completion features for easy file retrieval;
|
||||
- Extended regular expression search and replace à la emacs and vi
|
||||
- A very compact memory model easily load and modify very large files
|
||||
- Editing of binary files
|
||||
|
||||
- Website: [ne.di.unimi.it][3]
|
||||
- Developer: Sebastiano Vigna (original developer). Additional features added by Todd M. Lewis
|
||||
- License: GNU GPL v3
|
||||
- Version Number: 2.5
|
||||
|
||||
----------
|
||||
|
||||
### Zile ###
|
||||
|
||||

|
||||
|
||||
Zile Is Lossy Emacs (Zile) is a small Emacs clone. Zile is a customizable, self-documenting real-time display editor. Zile was written to be as similar as possible to Emacs; every Emacs user should feel comfortable with Zile.
|
||||
|
||||
Zile is distinguished by a very small RAM memory footprint, of approximately 130kB, and quick editing sessions. It is 8-bit clean, allowing it to be used on any sort of file.
|
||||
|
||||
#### Features include: ####
|
||||
|
||||
- Small but fast and powerful
|
||||
- Multi buffer editing with multi level undo
|
||||
- Multi window
|
||||
- Killing, yanking and registers
|
||||
- Minibuffer completion
|
||||
- Auto fill (word wrap)
|
||||
- Registers
|
||||
- Looks like Emacs. Key sequences, function and variable names are identical with Emacs's
|
||||
- Killing
|
||||
- Yanking
|
||||
- Auto line ending detection
|
||||
|
||||
- Website: [www.gnu.org/software/zile][4]
|
||||
- Developer: Reuben Thomas, Sandro Sigala, David A. Capello
|
||||
- License: GNU GPL v2
|
||||
- Version Number: 2.4.11
|
||||
|
||||
----------
|
||||
|
||||
### nano ###
|
||||
|
||||

|
||||
|
||||
nano is a curses-based text editor. It is a clone of Pico, the editor of the Pine email client.
|
||||
|
||||
The nano project was started in 1999 due to licensing issues with the Pine suite (Pine was not distributed under a free software license), and also because Pico lacked some essential features.
|
||||
|
||||
nano aims to emulate the functionality and easy-to-use interface of Pico, while offering additional functionality, but without the tight mailer integration of the Pine/Pico package.
|
||||
|
||||
nano, like Pico, is keyboard-oriented, controlled with control keys.
|
||||
|
||||
#### Features include: ####
|
||||
|
||||
- Interactive search and replace
|
||||
- Color syntax highlighting
|
||||
- Go to line and column number
|
||||
- Auto-indentation
|
||||
- Feature toggles
|
||||
- UTF-8 support
|
||||
- Mixed file format auto-conversion
|
||||
- Verbatim input mode
|
||||
- Multiple file buffers
|
||||
- Smooth scrolling
|
||||
- Bracket matching
|
||||
- Customizable quoting string
|
||||
- Backup files
|
||||
- Internationalization support
|
||||
- Filename tab completion
|
||||
|
||||
- Website: [nano-editor.org][5]
|
||||
- Developer: Chris Allegretta, David Lawrence, Jordi Mallach, Adam Rogoyski, Robert Siemborski, Rocco Corsi, David Benbennick, Mike Frysinger
|
||||
- License: GNU GPL v3
|
||||
- Version Number: 2.2.6
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxlinks.com/article/20141011073917230/TextEditors.html
|
||||
|
||||
作者:Frazer Kline
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://foicica.com/textadept/
|
||||
[2]:http://www.vim.org/
|
||||
[3]:http://ne.di.unimi.it/
|
||||
[4]:http://www.gnu.org/software/zile/
|
||||
[5]:http://nano-editor.org/
|
||||
55
sources/share/20141013 UbuTricks 14.10.08.md
Normal file
55
sources/share/20141013 UbuTricks 14.10.08.md
Normal file
@@ -0,0 +1,55 @@
|
||||
UbuTricks 14.10.08
|
||||
================================================================================
|
||||
> An Ubuntu utility that allows you to install the latest versions of popular apps and games
|
||||
|
||||
UbuTricks is a freely distributed script written in Bash and designed from the ground up to help you install the latest version of the most acclaimed games and graphical applications on your Ubuntu Linux operating system, as well as on various other Ubuntu derivatives.
|
||||
|
||||

|
||||
|
||||
### What apps can I install with UbuTricks? ###
|
||||
|
||||
Currently, the latest versions of the Calibre, Fotoxx, Geary, GIMP, Google Earth, HexChat, jAlbum, Kdenlive, LibreOffice, PCManFM, Qmmp, QuiteRSS, QupZilla, Shutter, SMPlayer, Ubuntu Tweak, Wine and XBMC (Kodi), PlayOnLinux, Red Notebook, NeonView, Sunflower, Pale Moon, QupZilla Next, FrostWire and RSSOwl applications can be installed with UbuTricks.
|
||||
|
||||
### What games can I install with UbuTricks? ###
|
||||
|
||||
In addition, the latest versions of the 0 A.D., Battle for Wesnoth, Transmageddon, Unvanquished and VCMI (Heroes III Engine) games can be installed with the UbuTricks program. Users can also install the latest version of the Cinnamon and LXQt desktop environments.
|
||||
|
||||
### Getting started with UbuTricks ###
|
||||
|
||||
The program is distributed as a .sh file (shell script) that can be run from the command-line using the “sh ubutricks.sh” command (without quotes) or make it executable and double-click it from your Home folder or desktop. All you have to do is to select and app or game and click the OK button to install it.
|
||||
|
||||
### How does it work? ###
|
||||
|
||||
When accessed for the first time, the program will display a welcome screen from the get-to, notifying users about how it actually works. There are three methods to install an app or game, via PPA, DEB file or source tarball. Please note that apps and games will be automatically downloaded and installed.
|
||||
|
||||
### What distributions are supported? ###
|
||||
|
||||
Several versions of the Ubuntu Linux operating systems are supported, but if not specified, it will default to the current stable version, Ubuntu 14.04 LTS (Trusty Tahr). At the moment, the program will not work if you don’t have the gksu package installed on your Ubuntu box. It is based on Zenity, which should be installed too.
|
||||
|
||||

|
||||
|
||||
- last updated on:October 9th, 2014, 11:29 GMT
|
||||
- price:FREE!
|
||||
- developed by:Dan Craciun
|
||||
- homepage:[www.tuxarena.com][1]
|
||||
- license type:[GPL (GNU General Public License)][3]
|
||||
- category:ROOT \ Desktop Environment \ Tools
|
||||
|
||||
### Download for UbuTricks: ###
|
||||
|
||||
- [ubutricks.sh][2]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linux.softpedia.com/get/Desktop-Environment/Tools/UbuTricks-103626.shtml
|
||||
|
||||
作者:[Marius Nestor][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.softpedia.com/editors/browse/marius-nestor
|
||||
[1]:http://www.tuxarena.com/apps/ubutricks/
|
||||
[2]:http://www.tuxarena.com/intro/files/ubutricks.sh
|
||||
[3]:http://www.gnu.org/licenses/gpl-2.0.html
|
||||
@@ -0,0 +1,62 @@
|
||||
barney-ro translating
|
||||
|
||||
What is good reference management software on Linux
|
||||
================================================================================
|
||||
Have you ever written a paper so long that you thought you would never see the end of it? If so, you know that the worst part is not dedicating hours on it, but rather that once you are done, you still have to order and format your references into a structured convention-following bibliography. Hopefully for you, Linux has the solution: bibliography/reference management tools. Using the power of BibTex, these programs can help you import your citation sources, and spit out a structured bibliography. Here is a non-exhaustive list of open-source reference management software on Linux.
|
||||
|
||||
### 1. Zotero ###
|
||||
|
||||

|
||||
|
||||
Surely the most famous tool for collecting references, [Zotero][1] is known for being a browser extension. However, there also exists a convenient Linux stand alone program. Among its biggest advantages, Zotero is easy to use, and can be coupled with LibreOffice or other text editors to manage the bibliography of documents. I personally appreciate the interface and the plugin manager. However, Zotero is quickly limited if you have a lot of needs about your bibliography.
|
||||
|
||||
### 2. JabRef ###
|
||||
|
||||

|
||||
|
||||
[JabRef][2] is one of the most advanced tools out there for citation management. You can import from a plethora of format, lookup entries from external databases (like Google Scholar), and export straight to your favorite editor. JabRef integrates your environment nicely, and can even support plugins. And as a final touch, JabRef can connect to your own SQL database. The only downside to all of this is of course the learning curve.
|
||||
|
||||
### 3. KBibTex ###
|
||||
|
||||

|
||||
|
||||
For KDE adepts, the desktop environment has its own dedicated bibliography manager called [KBibTex][3]. And as you might expect from a program of this caliber, the promised quality is delivered. The software is highly customizable, from the shortcuts to the behavior and appearance. It is easy to find duplicates, to preview the results, and to export directly to a LaTeX editor. But the best feature in my opinion is the integration of Bibsonomy, Google Scholar, and even your Zotero account. The only downside is that the interface seems a bit cluttered at first. Hopefully spending enough time in the settings should fix that.
|
||||
|
||||
### 4. Bibfilex ###
|
||||
|
||||

|
||||
|
||||
Capable of running in both Gtk and Qt environment, [Bibfilex][4] is a user friendly bibliography management tool based on Biblatex. Less advanced than JabRef or KBibTex, it is fast and lightweight. Definitely a smart choice for making a bibliography quickly without thinking too much. The interface is slick and reflects just the necessary functions. I give it extra credits for the complete manual that you can get from the official [download page][5]
|
||||
|
||||
5. Pybliographer
|
||||
|
||||

|
||||
|
||||
As indicated by its name, [Pybliographer][6] is a non-graphical tool for bibliography management written in Python. I personally like to use Pybliographic as the graphical front-end. The interface is extremely clear and minimalist. If you just have a few references to export and don't really have time to learn how to use an extensive piece of software, Pybliographer is the place to go. A bit like Bibfilex, the intent is on user-friendliness and quick use.
|
||||
|
||||
### 6. Referencer ###
|
||||
|
||||

|
||||
|
||||
Probably my biggest surprise when doing this list, [Referencer][7] is really appealing to the eye. Capable of integrating itself perfectly with Gnome, it can find and import your documents, look up their reference on the web, and export to LyX, while being sexy and really well designed. The few shortcuts and plugins are a good bonus along with the library style interface.
|
||||
|
||||
To conclude, thanks to these tools, you will not have to worry about long papers anymore, or at least not about the reference section. What did we miss? Is there a bibliography management tool that you prefer? Let us know in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/reference-management-software-linux.html
|
||||
|
||||
作者:[Adrien Brochard][a]
|
||||
译者:[barney-ro](https://github.com/barney-ro)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/adrien
|
||||
[1]:https://www.zotero.org/
|
||||
[2]:http://jabref.sourceforge.net/
|
||||
[3]:http://home.gna.org/kbibtex/
|
||||
[4]:https://sites.google.com/site/bibfilex/
|
||||
[5]:https://sites.google.com/site/bibfilex/download
|
||||
[6]:http://pybliographer.org/
|
||||
[7]:https://launchpad.net/referencer
|
||||
@@ -0,0 +1,94 @@
|
||||
UbuTricks – Script to install the latest versions of several games and applications in Ubuntu
|
||||
================================================================================
|
||||
UbuTricks is a program that helps you install the latest versions of several games and applications in Ubuntu.
|
||||
|
||||
UbuTricks is a Zenity-based, graphical script with a simple interface. Although early in development, its aim is to create a simple, graphical way of installing updated applications in Ubuntu 14.04 and future releases.
|
||||
|
||||
Apps will be downloaded and installed automatically. Some will require a PPA to be added to the repositories. Others will be compiled from source if no PPA is available. The compilation process can take a long time, while installing from a PPA or DEB file should be quick, depending on your download speed.
|
||||
|
||||
### The install methods are as follows: ###
|
||||
|
||||
- PPA – the program will be downloaded and installed from a PPA
|
||||
- DEB – the program will be installed from a DEB package
|
||||
- Source – the program will be compiled (may take a long time)
|
||||
- Script – the program will be installed using a script provided by the developer
|
||||
- Archive – the program will be installed from a compressed archive
|
||||
- Repository – the program will be installed from a repository (not PPA)
|
||||
|
||||
### List of applications you can install ###
|
||||
|
||||
The latest versions of the following applications can be installed via UbuTricks:
|
||||
|
||||
### Games ###
|
||||
|
||||
- 0 A.D.
|
||||
- Battle for Wesnoth (Dev)
|
||||
- VCMI (Heroes III Engine)
|
||||
|
||||
### File Managers ###
|
||||
|
||||
- PCManFM
|
||||
|
||||
### Internet ###
|
||||
|
||||
- Geary
|
||||
- HexChat
|
||||
- QupZilla
|
||||
- QuiteRSS
|
||||
|
||||
### Multimedia ###
|
||||
|
||||
- SMPlayer
|
||||
- Transmageddon
|
||||
- Kdenlive
|
||||
- Fotoxx
|
||||
- jAlbum
|
||||
- GIMP
|
||||
- Shutter
|
||||
- Qmmp
|
||||
- XBMC
|
||||
|
||||
### Office/Ebooks/Documents ###
|
||||
|
||||
- Calibre
|
||||
- LibreOffice
|
||||
|
||||
### Tools ###
|
||||
|
||||
- Ubuntu Tweak
|
||||
|
||||
### Desktop Environments ###
|
||||
|
||||
- Cinnamon
|
||||
|
||||
### Other ###
|
||||
|
||||
- Google Earth
|
||||
- Wine
|
||||
|
||||
### Download and install Ubuntutricks script ###
|
||||
|
||||
You can download ubuntutricks script from [here][1] Once downloaded, make it executable and either double-click the script or run it from the terminal.
|
||||
|
||||
### Screenshots ###
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/ubutricks-script-to-install-the-latest-versions-of-several-games-and-applications-in-ubuntu.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
||||
[1]:http://www.tuxarena.com/intro/files/ubutricks.sh
|
||||
@@ -1,48 +0,0 @@
|
||||
Red Hat designs RHEL for a decade-long run
|
||||
================================================================================
|
||||
> The newly released RHEL 7 includes Docker containers and the new terabyte-scaled XFS file system
|
||||
|
||||
IDG News Service - Knowing how system administrators enjoy continuity, Red Hat has designed the latest release of its flagship Linux distribution to be run, with support, until 2024.
|
||||
|
||||
Red Hat Enterprise Linux 7 (RHEL 7), the completed version of which was shipped Tuesday, also features a number of new technologies that the company sees as instrumental for the next decade, including the Docker Linux Container system and the advanced XFS file system.
|
||||
|
||||
"XFS opens the door for a new class of business analytics, big data and data analytics," said Mark Coggin, Red Hat senior director of product marketing.
|
||||
|
||||
The last major update to RHEL, RHEL 6, was released in November 2010. Since then, server software has been used in an increasingly wide variety of operational scenarios, including providing the basis for bare metal servers, virtual machines, IaaS (infrastructure-as-a-service) and PaaS (platform-as-a-service) cloud packages.
|
||||
|
||||
Red Hat will support RHEL 7 with bug fixes and commercial support for up to 10 years. The company generally releases a major version of RHEL every three years.
|
||||
|
||||
In contrast, Canonical's Ubuntu LTS (long-term support) distributions are supported for five years. Suse Enterprise Linux [is also supported][1], in most aspects, for up to 10 years,
|
||||
|
||||
This is the first edition to include Docker, a container technology [that could act as a nimbler replacement][2] to full virtual machines used in cloud operations. Docker provides a way to package an application in a virtual container so that it can be run across different Linux servers.
|
||||
|
||||
Red Hat expects that containers will be widely deployed over the next few years as a way to package and run applications, thanks to their portable nature.
|
||||
|
||||
"Customers have told us they are looking for a lighter weight version of developing applications. The applications themselves don't need a full operating system or a virtual machine," Coggin said. The system calls are answered by the server's OS and the container includes only the necessary support libraries and the application. "We only put into that container what we need," he said.
|
||||
|
||||
Containers are also easier to maintain because users don't have to worry about updating or patching the full OS within a virtual machine, Coggin said.
|
||||
|
||||
Red Hat is also planning a special stripped-down release of RHEL, now code-named RHEL Atomic, which will be a distribution for just running containers. Containers that run on the regular RHEL can easily be transferred to RHEL Atomic, once that OS is available. They will also run on Red Hat OpenShift PaaS.
|
||||
|
||||
Red Hat is also supporting Docker through its switch in RHEL 7 to the systemd process manager, replacing Linux's long used init process manager. Systemd "gives the administrator a lot of additional flexibility in managing the underlying processes inside of RHEL. It also has a tie back to the container initiative and is very integral to the way the processes are stood up and managed in containers," Coggin said.
|
||||
|
||||
Red Hat has switched the default file system in RHEL 7 to XFS, which is able to keep track of up to 500TBs on a single partition. The previous default file system, ext4, was only able to support 50TBs. Ext4 is still available as an option, as well as another of other file systems such as GFS2 and Btrfs (under technology preview).
|
||||
|
||||
Red Hat has added greater interoperability with the Microsoft Windows environment. Organizations can now use Microsoft Active Directory to securely authenticate users on Red Hat systems. Tools are also included in RHEL 7 to offer Red Hat credentials for Windows servers.
|
||||
|
||||
"Customers have thousands of Windows servers and thousands of RHEL servers, and they to need ways to integrate the two," Coggin said.
|
||||
|
||||
The installation process has been sped up as well, thanks to an update to the Anaconda installer, which now allows administrators to preselect server configurations on the start of the installation process. The inclusion of the industry standard OpenLMI (Open Linux Management Infrastructure), which allows the administrator to manage services at a granular level through a standardized API (application programming interface).
|
||||
|
||||
"OpenLMI is another important way of improving stability and efficiency by helping to manage systems better," Coggin said.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.computerworld.com/s/article/9248988/Red_Hat_designs_RHEL_for_a_decade_long_run?taxonomyId=122
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:https://www.suse.com/support/policy.html
|
||||
[2]:http://www.infoworld.com/d/virtualization/docker-all-geared-the-enterprise-244020
|
||||
@@ -1,99 +0,0 @@
|
||||
What will your business look like in 2030?
|
||||
================================================================================
|
||||

|
||||
|
||||
lya Pozin is a serial entrepreneur, writer, and investor. He is the founder of online video entertainment platform [Pluto.TV][1], social greeting card company [Open Me][2], and digital marketing agency [Ciplex][3].
|
||||
|
||||
The year is 2030, and you’re walking into the front doors of your company. What will it look like, what functions will your employees be performing and how will you stack up against the competition?
|
||||
|
||||
You might not be considering the future, but remember that [25 years ago][4], only 15 percent of US households had a personal computer. While 73 percent of online adults currently have a social media account, social media barely existed 15 years ago.
|
||||
|
||||
Technology is always changing, and with it come disruptions to industries, companies and the employment marketplace. The future is closing in, but is your company ready?
|
||||
|
||||
### Why should you be worried? ###
|
||||
|
||||
In business, to stop moving forward means your company is stagnating; for many companies, stagnation equates to eventual death. Companies clinging to outmoded and outdated business practices eventually run into major problems. There are examples everywhere in the marketplace, from struggling BlackBerry phones to Kodak slowly shuttering its film business.
|
||||
|
||||
According to [futurist and TED talk speaker Thomas Frey][5], two billion jobs will disappear by 2030 thanks to shifting technologies and changing needs. You can’t afford to be behind the pack when the future comes calling.
|
||||
|
||||
### What will 2030 look like? ###
|
||||
|
||||

|
||||
|
||||
Recently, the [Canadian Scholarship Trust][6], as part of its Inspired Minds campaign, [put together a list of the jobs][7] we might all be hiring for in 2030. These jobs range from “Company Culture Ambassador” to – get this! – “Nostalgist.”
|
||||
|
||||
Taking CST’s lead, I spoke to some entrepreneurs and innovators in different fields, from medicine to marketing, to see their predictions for how businesses will be run in the future. Hopping in our time travel machine, here’s a glimpse at what 2030 might look like:
|
||||
|
||||
### Cloud-based ###
|
||||
|
||||
“Everything will be cloud-based with faster speeds,” said Marjorie Adams, [AQB][8] CEO and President. “The technologies coming out now will be better defined and connected. While innovation from the business side could be a lot slower-going than the consumer side, we will have a lot more data to understand real needs.”
|
||||
|
||||
### Automated ###
|
||||
|
||||
Google is already leading the way with the self-driving car, but automation might creep into other aspects of our lives in the future.
|
||||
|
||||
“Home automation will be very different in 2030,” said Andrew Thomas, co-founder of [SkyBell Technologies, Inc][9] .“We’ll all have brain-sensing headbands and glasses and we’ll just ‘think’ about locking the door or turning off the lights. Our fridge will email the store when we’re low on food and our self-driving cars will go pick up the groceries for us!”
|
||||
|
||||
### Human curated ###
|
||||
|
||||
As more and more options become available to consumers, we’ll all become overwhelmed by choice. Human curation will come back into vogue for everything from music to online video.
|
||||
|
||||
We’re already seeing the trend start now with [Apple’s acquisition][10] of human curated music service Beats. After all, do you really think apps are [smarter than you][11]?
|
||||
|
||||
### Socially-connected ###
|
||||
|
||||
If you can’t watch the latest episode of Scandal or Game of Thrones, it’s common sense to stay off your Facebook and Twitter feeds.
|
||||
|
||||
“Imagine a media environment 15 years into the future where no object or entertainment venue is out of reach for second-screen integration with social media,” said Jared Feldman, CEO and founder of [Mashwork][12]. “Social platforms like Facebook and Twitter might as well be agnostic at this point in time since consumers will have aggregated all of their digital social life into consolidated user profiles designed to curate multiple feeds and allow for single-source user engagement.”
|
||||
|
||||
### Targeted ###
|
||||
|
||||
Already advertising is becoming more and more targeted to consumers needs thanks to big data and algorithms. Don’t expect this trend to move backwards, at least according to [FlexOne][13] CEO Matthijs Keij.
|
||||
|
||||
“Advertisers will know more about you than you yourself. Which products you like, how to improve your personal and work life, and even how to be more healthy. Sounds a little like Huxley’s Brave New World? Maybe…but consumers might actually like it.”
|
||||
|
||||
### How do your prepare? ###
|
||||
|
||||

|
||||
|
||||
Preparing for the future might seem impossible, but you don’t need a crystal ball to keep abreast of changes. It’s important to always keep up with trends and emerging technology, both in the economy in general and within your industry in particular.
|
||||
|
||||
Go to conferences, attend industry talks, and make time for industry trade shows. Pay attention to the new technology entering your sector, and don’t turn your nose up at something new just because it’s different than the way things have always been.
|
||||
|
||||
Understand your customers and know what they need, because the future is looking more consumer-focused than ever before, even in segments like healthcare. “The paradigm is shifting to a more “consumer-centric” model,” said Robert Grajewski, CEO of [Edison Nation Medical][14]. “Healthcare as a whole will shift to this individual care focus.”
|
||||
|
||||
Companies that understand their core competencies and their consumer needs will have a leg up on the competition.
|
||||
|
||||
As more digital natives come of age and flock into the economy, some highly skilled fields will see consumers picking up additional skills.
|
||||
|
||||
“By 2030 virtually everyone will be a designer, equipped with knowledge of the hottest mega trends and ripe and ready to replace those who can’t keep up with the latest software,” said Ashley Mady, CEO of [Brandberry][15].
|
||||
|
||||
“The best way to prepare for this inevitable shift in the design world is to focus on creative, big picture thinking over production, which will soon become a commodity. Designers should remain innovative by developing their own adaptable brands and technology that will grow alongside the quickly evolving world we live in.”
|
||||
|
||||
Finally, it’s important to be open, curious, and willing to pivot. New technologies are going to come along to improve, and sometimes complicate, your business. You need to be willing to embrace these new paradigms, or you risk your company becoming obsolete.
|
||||
|
||||
What do you think? How do you plan to prepare for the future? Share in the comments!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://thenextweb.com/entrepreneur/2014/06/18/will-business-look-like-2030/?utm_campaign=share%20button&utm_content=What%20will%20your%20business%20look%20like%20in%202030?&awesm=tnw.to_q3L0P&utm_source=copypaste&utm_medium=referral
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://pluto.tv/
|
||||
[2]:http://www.openme.com/
|
||||
[3]:http://www.ciplex.com/
|
||||
[4]:http://www.cnbc.com/id/101611509
|
||||
[5]:http://www.futuristspeaker.com/2012/02/2-billion-jobs-to-disappear-by-2030/
|
||||
[6]:http://www.cst.org/
|
||||
[7]:http://careers2030.cst.org/jobs/
|
||||
[8]:http://www.aqb.com/
|
||||
[9]:http://www.skybell.com/
|
||||
[10]:http://thenextweb.com/apple/2014/05/28/apple-confirms-acquisition-beats/
|
||||
[11]:http://thenextweb.com/apps/2013/10/19/i-let-apps-tell-me-how-to-live-for-a-day/
|
||||
[12]:http://mashwork.com/
|
||||
[13]:http://www.flxone.com/
|
||||
[14]:http://www.edisonnationmedical.com/
|
||||
[15]:http://www.brandberry.com/
|
||||
@@ -1,109 +0,0 @@
|
||||
Vic020
|
||||
|
||||
Want To Start An Open Source Project? Here's How
|
||||
================================================================================
|
||||
> Our step-by-step guide.
|
||||
|
||||
**You have a problem. You've weighed the** [pros and cons of open sourcing your code][1], and you know [you need to start an open-source project][2] for your software. But you have no idea how to do this.
|
||||
|
||||
Oh, sure. You may know how to set up a GitHub account and get started, but such [mechanics][3] are actually the easy part of open source. The hard part is making anyone care enough to use or contribute to your project.
|
||||
|
||||

|
||||
|
||||
Here are some principles to guide you in building and releasing code that others will care about.
|
||||
|
||||
### First, The Basics ###
|
||||
|
||||
You may choose to open source code for a variety of reasons. Perhaps you're looking to engage a community to help write your code. Perhaps, [like Known][4], you see "open source distribution ... as a multiplier for the small teams of developers writing the code in-house."
|
||||
|
||||
Or maybe you just think it's the right thing to do, [as the UK government believes][5].
|
||||
|
||||
Regardless of the reason, this isn't about you. Not really. For open source to succeed, much of the planning has to be about those who will use the software. As [I wrote in 2005][6], if you "want lots of people to contribute (bug fixes, extensions, etc.," then you need to "write good documentation, use an accessible programming language ... [and] have a modular framework."
|
||||
|
||||
Oh, and you also need to be writing software that people care about.
|
||||
|
||||
Think about the technology you depend on every day: operating systems, web application frameworks, databases, and so on. These are far more likely to generate outside interest and contributions than a niche technology for a particular industry like aviation. The broader the application of the technology, the more likely you are to find willing contributors and/or users.
|
||||
|
||||
In summary, any successful open-source project needs these things:
|
||||
|
||||
1. Optimal market timing (solving a real need in the market);
|
||||
|
||||
2. A strong, inclusive team of developers and non-developers;
|
||||
|
||||
3. An architecture of participation (more on that below);
|
||||
|
||||
4. Modular code to make it easier for new contributors to find a discrete chunk of the program to work on, rather than forcing them to scale an Everest of monolithic code;
|
||||
|
||||
5. Code that is broadly applicable (or a way to reach the narrower population more niche-y code appeals to);
|
||||
|
||||
6. Great initial source code (if you put garbage into GitHub, you'll get garbage out);
|
||||
|
||||
7. A permissive license—I [personally prefer Apache-style licensing][7] as it introduces the lowest barriers to developer adoption, but many successful projects (like Linux and MySQL) have used GPL licensing to great effect.
|
||||
|
||||
Of the items above, it's sometimes hardest for projects to actively invite participation. That's usually because this is less about code and more about people.
|
||||
|
||||
### "Open" Is More Than A License ###
|
||||
|
||||
One of the best things I've read in years on this subject comes from Vitorio Miliano ([@vitor_io][8]), a user experience and interaction designer from Austin, Texas. [Miliano points out][9] that anyone who doesn't already work on your project is a "layperson," in the sense that no matter their level of technical competence, they know little about your code.
|
||||
|
||||
So your job, he argues, is to make it easy to get involved in contributing to your code base. While he focuses on how to involve non-programmers in open-source projects, he identifies a few things project leads need to do to effectively involve anyone—technical or non-technical—in open source:
|
||||
|
||||
> 1. a way to understand the value of your project
|
||||
>
|
||||
> 2. a way to understand the value they could provide to the project
|
||||
>
|
||||
> 3. a way to understand the value they could receive from contributing to the project
|
||||
>
|
||||
> 4. a way to understand the contribution process, end-to-end
|
||||
>
|
||||
> 5. a contribution mechanism suitable for their existing workflows
|
||||
|
||||
Too often, project leads want to focus on the fifth step without providing an easy path to understand items 1 through 4. "How" to contribute doesn't matter very much if would-be contributors don't appreciate the "why."
|
||||
|
||||
On that note, it's critical, Miliano writes, to establish the value of the project with a "jargon-free description" so as to "demonstrate your accessibility and inclusiveness by writing your descriptions to be useful to everyone at all times." This has the added benefit, he avers, of signaling that documentation and other code-related content will be similarly clear.
|
||||
|
||||
On the second item, programmers and non-programmers alike need to be able to see exactly what you'd like from them, and then they need to be recognized for their contributions. Sometimes, as MongoDB solution architect [Henrik Ingo told me][10], "A smart person [may] come[] by with great code, but project members fail to understand it." That's not a terrible problem if the "in" group acknowledges the contribution and reaches out to understand.
|
||||
|
||||
But that doesn't always happen.
|
||||
|
||||
### Do You Really Want To Lead An Open Source Project? ###
|
||||
|
||||
Too many open-source project leads advertise inclusiveness but then are anything but inclusive. If you don't want people contributing code, don't pretend to be open source.
|
||||
|
||||
Yes, this is sometimes a function of newbie fatigue. As [one developer wrote][11] recently on HackerNews,
|
||||
|
||||
> Small projects get lots of, well, basically useless people who need tons of handholding to get anything accomplished. I see the upside for them, but I don't see the upside for me: if I where[sic] to help them out, I'd spend my limited available time on handholding people who apparently managed to get ms degrees in cs without being able to code instead of doing what I enjoy. So I ignore them.
|
||||
|
||||
While that may be a good way to maintain sanity, the attitude doesn't bode well for a project if it's widely shared.
|
||||
|
||||
And if you really couldn't care less about non-programmers contributing design input, or documentation, or whatever, then make that clear. Again, if this is the case, you really shouldn't be an open-source project.
|
||||
|
||||
Of course, the perception of exclusion is not always reality. As ActiveState vice president Bernard Golden told me over IM, "many would-be developers are intimidated by the perception of an existing 'in-crowd' dev group, even though it may not really be true."
|
||||
|
||||
Still, the more open source projects invest in making it easy to understand why developers should contribute, and make it inviting to do so, the how largely takes care of itself.
|
||||
|
||||
Lead image courtesy of [Shutterstock][12]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://readwrite.com/2014/08/20/open-source-project-how-to
|
||||
|
||||
作者:[Matt Asay][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://readwrite.com/author/matt-asay
|
||||
[1]:http://readwrite.com/2014/07/07/open-source-software-pros-cons
|
||||
[2]:http://readwrite.com/2014/08/15/open-source-software-business-zulily-erp-wall-street-journal
|
||||
[3]:http://www.cocoanetics.com/2011/01/starting-an-opensource-project-on-github/
|
||||
[4]:http://werd.io/2014/the-roi-of-building-open-source-software
|
||||
[5]:https://www.gov.uk/design-principles
|
||||
[6]:http://asay.blogspot.com/2005/09/so-you-want-to-build-open-source.html
|
||||
[7]:http://www.cnet.com/news/apache-better-than-gpl-for-open-source-business/
|
||||
[8]:https://twitter.com/vitor_io
|
||||
[9]:http://opensourcedesign.is/blogging_about/import-designers/
|
||||
[10]:https://twitter.com/h_ingo/status/501323333301190656
|
||||
[11]:https://news.ycombinator.com/item?id=8122814
|
||||
[12]:http://www.shutterstock.com/
|
||||
@@ -1,89 +0,0 @@
|
||||
[felixonmars translating...]
|
||||
|
||||
10 Open Source Cloning Software For Linux Users
|
||||
================================================================================
|
||||
> These cloning software take all disk data, convert them into a single .img file and you can copy it to another hard drive.
|
||||
|
||||

|
||||
|
||||
Disk cloning means copying data from a hard disk to another one and you can do this by simple copy & paste. But you cannot copy the hidden files and folders and not the in-use files too. That's when you need a cloning software which can also help you in saving a back-up image from your files and folders. The cloning software takes all disk data, convert them into a single .img file and you can copy it to another hard drive. Here we give you the best 10 Open Source Cloning software:
|
||||
|
||||
### 1. [Clonezilla][1]: ###
|
||||
|
||||
Clonezilla is a Live CD based on Ubuntu and Debian. It clones all your hard drive data and take a backup just like Norton Ghost on Windows but in a more effective way. Clonezilla support many filesystems like ext2, ext3, ext4, btrfs, xfs and others. It also supports BIOS, UEFI, MPR and GPT partitions.
|
||||
|
||||

|
||||
|
||||
### 2. [Redo Backup][2]: ###
|
||||
|
||||
Redo Bakcup is another Live CD tool which clones your drivers easily. It is free and Open Source Live System which has its licence under GPL 3. Its main features include easy GUI boots from CD, no installation, restoration of Linux and Windows systems, access to files with out any log-in, recovery of deleted files and more.
|
||||
|
||||

|
||||
|
||||
### 3. [Mondo Rescue][3]: ###
|
||||
|
||||
Mondo doesn't work like other software. It doesn’t convert your hard drivers into an .img file. It converts them into an .iso image and with Mondo you can also create a custom Live CD using “mindi” which is a special tool developed by Mondo Rescue to clone your data from the Live CD. It supports most Linux distributions, FreeBSD, and it is licensed under GPL.
|
||||
|
||||

|
||||
|
||||
### 4. [Partimage][4]: ###
|
||||
|
||||
This is an open-source software backup, which works under Linux system, by default. It's also available to install from the package manager for most Linux distributions and if you don’t have a Linux system then you can use “SystemRescueCd”. It is a Live CD which includes Partimage by default to do the cloning process that you want. Partimage is very fast in cloning hard drivers.
|
||||
|
||||

|
||||
|
||||
### 5. [FSArchiver][5]: ###
|
||||
|
||||
FSArchiver is a follow-up to Partimage, and it is again a good tool to clone hard disks. It supports cloning Ext4 partitions and NTFS partitions, basic file attributes like owner, permissions, extended attributes like those used by SELinux, basic file system attributes for all Linux file systems and so on.
|
||||
|
||||
### 6. [Partclone][6]: ###
|
||||
|
||||
Partclone is a free tool which clones and restores partitions. Written in C it first appeared in 2007 and it supports many filesystems like ext2, ext3, ext4, xfs, nfs, reiserfs, reiser4, hfs+, btrfs. It is very simple to use and it's licensed under GPL.
|
||||
|
||||
### 7. [doClone][7]: ###
|
||||
|
||||
doClone is a free software project which is developed to clone Linux system partitions easily. It's written in C++ and it supports up to 12 different filesystems. It can preform Grub bootloader restoration and can also transform the clone image to another computer via LAN. It also provides support to live cloning which means you will eb able to clone from the system even if it's running.
|
||||
|
||||

|
||||
|
||||
### 8. [Macrium Reflect Free Edition][8]: ###
|
||||
|
||||
Macrium Reflect Free Edition is claimed to be one of the fastest disk cloning utilities which supports only Windows file systems. It is a fairly straightforward user interface. This software does disk imaging and disk cloning and also allows you to access images from the file manager. It allows you to create a Linux rescue CD and it is compatible with Windows Vista and 7.
|
||||
|
||||

|
||||
|
||||
### 9. [DriveImage XML][9]: ###
|
||||
|
||||
DriveImage XML uses Microsoft VSS for creation of images, quite reliably. With this software you can create "hot" images from a disk, which is still running. XML files store images, which means you can access them from any supporting third-party software. DriveImage XML also allows restoring an image to a machine without any reboot. This software is also compatible with Windows XP, Windows Server 2003, Vista, and 7.
|
||||
|
||||

|
||||
|
||||
### 10. [Paragon Backup & Recovery Free][10]: ###
|
||||
|
||||
Paragon Backup & Recovery Free does a great job when it comes to managing scheduled imaging. This is a free software but it's for personal use only.
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.efytimes.com/e1/fullnews.asp?edid=148039
|
||||
|
||||
作者:Sanchari Banerjee
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://clonezilla.org/
|
||||
[2]:http://redobackup.org/
|
||||
[3]:http://www.mondorescue.org/
|
||||
[4]:http://www.partimage.org/Main_Page
|
||||
[5]:http://www.fsarchiver.org/Main_Page
|
||||
[6]:http://www.partclone.org/
|
||||
[7]:http://doclone.nongnu.org/
|
||||
[8]:http://www.macrium.com/reflectfree.aspx
|
||||
[9]:http://www.runtime.org/driveimage-xml.htm
|
||||
[10]:http://www.paragon-software.com/home/br-free/
|
||||
@@ -1,66 +0,0 @@
|
||||
zpl1025
|
||||
What Linux Users Should Know About Open Hardware
|
||||
================================================================================
|
||||
> What Linux users don't know about manufacturing open hardware can lead them to disappointment.
|
||||
|
||||
Business and free software have been intertwined for years, but the two often misunderstand one another. That's not surprising -- what is just a business to one is way of life for the other. But the misunderstanding can be painful, which is why debunking it is a worth the effort.
|
||||
|
||||
An increasingly common case in point: the growing attempts at open hardware, whether from Canonical, Jolla, MakePlayLive, or any of half a dozen others. Whether pundit or end-user, the average free software user reacts with exaggerated enthusiasm when a new piece of hardware is announced, then retreats into disillusionment as delay follows delay, often ending in the cancellation of the entire product.
|
||||
|
||||
It's a cycle that does no one any good, and often breeds distrust – and all because the average Linux user has no idea what's happening behind the news.
|
||||
|
||||
My own experience with bringing products to market is long behind me. However, nothing I have heard suggests that anything has changed. Bringing open hardware or any other product to market remains not just a brutal business, but one heavily stacked against newcomers.
|
||||
|
||||
### Searching for Partners ###
|
||||
|
||||
Both the manufacturing and distribution of digital products is controlled by a relatively small number of companies, whose time can sometimes be booked months in advance. Profit margins can be tight, so like movie studios that buy the rights to an ancient sit-com, the manufacturers usually hope to clone the success of the latest hot product. As Aaron Seigo told me when talking about his efforts to develop the Vivaldi tablet, the manufacturers would much rather prefer someone else take the risk of doing anything new.
|
||||
|
||||
Not only that, but they would prefer to deal with someone with an existing sales record who is likely to bring repeat business.
|
||||
|
||||
Besides, the average newcomer is looking at a product run of a few thousand units. A chip manufacturer would much rather deal with Apple or Samsung, whose order is more likely in the hundreds of thousands.
|
||||
|
||||
Faced with this situation, the makers of open hardware are likely to find themselves cascading down into the list of manufacturers until they can find a second or third tier manufacturer that is willing to take a chance on a small run of something new.
|
||||
|
||||
They might be reduced to buying off-the-shelf components and assembling units themselves, as Seigo tried with Vivaldi. Alternatively, they might do as Canonical did, and find established partners that encourage the industry to take a gamble. Even if they succeed, they have usually taken months longer than they expected in their initial naivety.
|
||||
|
||||
### Staggering to Market ###
|
||||
|
||||
However, finding a manufacturer is only the first obstacle. As Raspberry Pi found out, even if the open hardware producers want only free software in their product, the manufacturers will probably insist that firmware or drivers stay proprietary in the name of protecting trade secrets.
|
||||
|
||||
This situation is guaranteed to set off criticism from potential users, but the open hardware producers have no choice except to compromise their vision. Looking for another manufacturer is not a solution, partly because to do so means more delays, but largely because completely free-licensed hardware does not exist. The industry giants like Samsung have no interest in free hardware, and, being new, the open hardware producers have no clout to demand any.
|
||||
|
||||
Besides, even if free hardware was available, manufacturers could probably not guarantee that it would be used in the next production run. The producers might easily find themselves re-fighting the same battle every time they needed more units.
|
||||
|
||||
As if all this is not enough, at this point the open hardware producer has probably spent 6-12 months haggling. The chances are, the industry standards have shifted, and they may have to start from the beginning again by upgrading specs.
|
||||
|
||||
### A Short and Brutal Shelf Life ###
|
||||
|
||||
Despite these obstacles, hardware with some degree of openness does sometimes get released. But remember the challenges of finding a manufacturer? They have to be repeated all over again with the distributors -- and not just once, but region by region.
|
||||
|
||||
Typically, the distributors are just as conservative as the manufacturers, and just as cautious about dealing with newcomers and new ideas. Even if they agree to add a product to their catalog, the distributors can easily decide not to encourage their representatives to promote it, which means that in a few months they have effectively removed it from the shelves.
|
||||
|
||||
Of course, online sales are a possibility. But meanwhile, the hardware has to be stored somewhere, adding to the cost. Production runs on demand are expensive even in the unlikely event that they are available, and even unassembled units need storage.
|
||||
|
||||
### Weighing the Odds ###
|
||||
|
||||
I have been generalizing wildly here, but anyone who has ever been involved in producing anything will recognize what I am describing as the norm. And just to make matters worse, open hardware producers typically discover the situation as they are going through it. Inevitably, they make mistakes, which adds still more delays.
|
||||
|
||||
But the point is, if you have any sense of the process at all, your knowledge is going to change how you react to news of another attempt at hardware. The process means that, unless a company has been in serious stealth mode, an announcement that a product will be out in six months will rapidly prove to be an outdate guestimate. 12-18 months is more likely, and the obstacles I describe may mean that the product will never actually be released.
|
||||
|
||||
For example, as I write, people are waiting for the emergence of the first Steam Machines, the Linux-based gaming consoles. They are convinced that the Steam Machines will utterly transform both Linux and gaming.
|
||||
|
||||
As a market category, Steam Machines may do better than other new products, because those who are developing them at least have experience developing software products. However, none of the dozen or so Steam Machines in development have produced more than a prototype after almost a year, and none are likely to be available for buying until halfway through 2015. Given the realities of hardware manufacturing, we will be lucky if half of them see daylight. In fact, a release of 2-4 might be more realistic.
|
||||
|
||||
I make that prediction with next to no knowledge of any of the individual efforts. But, having some sense of how hardware manufacturing works, I suspect that it is likely to be closer to what happens next year than all the predictions of a new Golden Age for Linux and gaming. I would be entirely happy being wrong, but the fact remains: what is surprising is not that so many Linux-associated hardware products fail, but that any succeed even briefly.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.datamation.com/open-source/what-linux-users-should-know-about-open-hardware-1.html
|
||||
|
||||
作者:[Bruce Byfield][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.datamation.com/author/Bruce-Byfield-6030.html
|
||||
@@ -1,201 +0,0 @@
|
||||
诗诗来翻译!disylee
|
||||
How to configure a network printer and scanner on Ubuntu desktop
|
||||
================================================================================
|
||||
In a [previous article][1](注:这篇文章在2014年8月12号的原文里做过,不知道翻译了没有,如果翻译发布了,发布此文章的时候可改成翻译后的链接), we discussed how to install several kinds of printers (and also a network scanner) in a Linux server. Today we will deal with the other end of the line: how to access the network printer/scanner devices from a desktop client.
|
||||
|
||||
### Network Environment ###
|
||||
|
||||
For this setup, our server's (Debian Wheezy 7.2) IP address is 192.168.0.10, and our client's (Ubuntu 12.04) IP address is 192.168.0.105. Note that both boxes are on the same network (192.168.0.0/24). If we want to allow printing from other networks, we need to modify the following section in the cupsd.conf file on the sever:
|
||||
|
||||
<Location />
|
||||
Order allow,deny
|
||||
Allow localhost
|
||||
Allow from XXX.YYY.ZZZ.*
|
||||
</Location>
|
||||
|
||||
(in the above example, we grant access to the printer from localhost and from any system whose IPv4 address starts with XXX.YYY.ZZZ)
|
||||
|
||||
To verify which printers are available on our server, we can either use lpstat command on the server, or browse to the https://192.168.0.10:631/printers page.
|
||||
|
||||
root@debian:~# lpstat -a
|
||||
|
||||
----------
|
||||
|
||||
EPSON_Stylus_CX3900 accepting requests since Mon 18 Aug 2014 10:49:33 AM WARST
|
||||
PDF accepting requests since Mon 06 May 2013 04:46:11 PM WARST
|
||||
SamsungML1640Series accepting requests since Wed 13 Aug 2014 10:13:47 PM WARST
|
||||
|
||||

|
||||
|
||||
### Installing Network Printers in Ubuntu Desktop ###
|
||||
|
||||
In our Ubuntu 12.04 client, we will open the "Printing" menu (Dash -> Printing). Note that in other distributions the name may differ a little (such as "Printers" or "Print & Fax", for example):
|
||||
|
||||

|
||||
|
||||
No printers have been added to our Ubuntu client yet:
|
||||
|
||||

|
||||
|
||||
Here are the steps to install a network printer on Ubuntu desktop client.
|
||||
|
||||
**1)** The "Add" button will fire up the "New Printer" menu. We will choose "Network printer" -> "Find Network Printer" and enter the IP address of our server, then click "Find":
|
||||
|
||||

|
||||
|
||||
**2)** At the bottom we will see the names of the available printers. Let's choose the Samsung printer and press "Forward":
|
||||
|
||||

|
||||
|
||||
**3)** We will be asked to fill in some information about our printer. When we're done, we'll click on "Apply":
|
||||
|
||||

|
||||
|
||||
**4)** We will then be asked whether we want to print a test page. Let’s click on "Print test page":
|
||||
|
||||

|
||||
|
||||
The print job was created with local id 2:
|
||||
|
||||

|
||||
|
||||
5) Using our server's CUPS web interface, we can observe that the print job has been submitted successfully (Printers -> SamsungML1640Series -> Show completed jobs):
|
||||
|
||||

|
||||
|
||||
We can also display this same information by running the following command on the printer server:
|
||||
|
||||
root@debian:~# cat /var/log/cups/page_log | grep -i samsung
|
||||
|
||||
----------
|
||||
|
||||
SamsungML1640Series root 27 [13/Aug/2014:22:15:34 -0300] 1 1 - localhost Test Page - -
|
||||
SamsungML1640Series gacanepa 28 [18/Aug/2014:11:28:50 -0300] 1 1 - 192.168.0.105 Test Page - -
|
||||
SamsungML1640Series gacanepa 29 [18/Aug/2014:11:45:57 -0300] 1 1 - 192.168.0.105 Test Page - -
|
||||
|
||||
The page_log log file shows every page that has been printed, along with the user who sent the print job, the date & time, and the client's IPv4 address.
|
||||
|
||||
To install the Epson inkjet and PDF printers, we need to repeat steps 1 through 5, and choose the right print queue each time. For example, in the image below we are selecting the PDF printer:
|
||||
|
||||

|
||||
|
||||
However, please note that according to the [CUPS-PDF documentation][2], by default:
|
||||
|
||||
> PDF files will be placed in subdirectories named after the owner of the print job. In case the owner cannot be identified (i.e. does not exist on the server) the output is placed in the directory for anonymous operation (if not disabled in cups-pdf.conf - defaults to /var/spool/cups-pdf/ANONYMOUS/).
|
||||
|
||||
These default directories can be modified by changing the value of the **Out** and **AnonDirName** variables in the /etc/cups/cups-pdf.conf file. Here, ${HOME} is expanded to the user's home directory:
|
||||
|
||||
Out ${HOME}/PDF
|
||||
AnonDirName /var/spool/cups-pdf/ANONYMOUS
|
||||
|
||||
### Network Printing Examples ###
|
||||
|
||||
#### Example #1 ####
|
||||
|
||||
Printing from Ubuntu 12.04, logged on locally as gacanepa (an account with the same name exists on the printer server).
|
||||
|
||||

|
||||
|
||||
After printing to the PDF printer, let's check the contents of the /home/gacanepa/PDF directory on the printer server:
|
||||
|
||||
root@debian:~# ls -l /home/gacanepa/PDF
|
||||
|
||||
----------
|
||||
|
||||
total 368
|
||||
-rw------- 1 gacanepa gacanepa 279176 Aug 18 13:49 Test_Page.pdf
|
||||
-rw------- 1 gacanepa gacanepa 7994 Aug 18 13:50 Untitled1.pdf
|
||||
-rw------- 1 gacanepa gacanepa 74911 Aug 18 14:36 Welcome_to_Conference_-_Thomas_S__Monson.pdf
|
||||
|
||||
The PDF files are created with permissions set to 600 (-rw-------), which means that only the owner (gacanepa in this case) can have access to them. We can change this behavior by editing the value of the **UserUMask** variable in the /etc/cups/cups-pdf.conf file. For example, a umask of 0033 will cause the PDF printer to create files with all permissions for the owner, but read-only privileges to all others.
|
||||
|
||||
root@debian:~# grep -i UserUMask /etc/cups/cups-pdf.conf
|
||||
|
||||
----------
|
||||
|
||||
### Key: UserUMask
|
||||
UserUMask 0033
|
||||
|
||||
For those unfamiliar with umask (aka user file-creation mode mask), it acts as a set of permissions that can be used to control the default file permissions that are set for new files when they are created. Given a certain umask, the final file permissions are calculated by performing a bitwise boolean AND operation between the file base permissions (0666) and the unary bitwise complement of the umask. Thus, for a umask set to 0033, the default permissions for new files will be NOT (0033) AND 0666 = 644 (read / write / execute privileges for the owner, read-only for all others.
|
||||
|
||||
### Example #2 ###
|
||||
|
||||
Printing from Ubuntu 12.04, logged on locally as jdoe (an account with the same name doesn't exist on the server).
|
||||
|
||||

|
||||
|
||||
root@debian:~# ls -l /var/spool/cups-pdf/ANONYMOUS
|
||||
|
||||
----------
|
||||
|
||||
total 5428
|
||||
-rw-rw-rw- 1 nobody nogroup 5543070 Aug 18 15:57 Linux_-_Wikipedia__the_free_encyclopedia.pdf
|
||||
|
||||
The PDF files are created with permissions set to 666 (-rw-rw-rw-), which means that everyone has access to them. We can change this behavior by editing the value of the **AnonUMask** variable in the /etc/cups/cups-pdf.conf file.
|
||||
|
||||
At this point, you may be wondering about this: Why bother to install a network PDF printer when most (if not all) current Linux desktop distributions come with a built-in "Print to file" utility that allows users to create PDF files on-the-fly?
|
||||
|
||||
There are a couple of benefits of using a network PDF printer:
|
||||
|
||||
- A network printer (of whatever kind) lets you print directly from the command line without having to open the file first.
|
||||
- In a network with other operating system installed on the clients, a PDF network printer spares the system administrator from having to install a PDF creator utility on each individual machine (and also the danger of allowing end-users to install such tools).
|
||||
- The network PDF printer allows to print directly to a network share with configurable permissions, as we have seen.
|
||||
|
||||
### Installing a Network Scanner in Ubuntu Desktop ###
|
||||
|
||||
Here are the steps to installing and accessing a network scanner from Ubuntu desktop client. It is assumed that the network scanner server is already up and running as described [here][3].
|
||||
|
||||
**1)** Let us first check whether there is a scanner available on our Ubuntu client host. Without any prior setup, you will see the message saying that "No scanners were identified."
|
||||
|
||||
$ scanimage -L
|
||||
|
||||

|
||||
|
||||
**2)** Now we need to enable saned daemon which comes pre-installed on Ubuntu desktop. To enable it, we need to edit the /etc/default/saned file, and set the RUN variable to yes:
|
||||
|
||||
$ sudo vim /etc/default/saned
|
||||
|
||||
----------
|
||||
|
||||
# Set to yes to start saned
|
||||
RUN=yes
|
||||
|
||||
**3)** Let's edit the /etc/sane.d/net.conf file, and add the IP address of the server where the scanner is installed:
|
||||
|
||||

|
||||
|
||||
**4)** Restart saned:
|
||||
|
||||
$ sudo service saned restart
|
||||
|
||||
**5)** Let's see if the scanner is available now:
|
||||
|
||||

|
||||
|
||||
Now we can open "Simple Scan" (or other scanning utility) and start scanning documents. We can rotate, crop, and save the resulting image:
|
||||
|
||||

|
||||
|
||||
### Summary ###
|
||||
|
||||
Having one or more network printers and scanner is a nice convenience in any office or home network, and offers several advantages at the same time. To name a few:
|
||||
|
||||
- Multiple users (connecting from different platforms / places) are able to send print jobs to the printer's queue.
|
||||
- Cost and maintenance savings can be achieved due to hardware sharing.
|
||||
|
||||
I hope this article helps you make use of those advantages.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/2014/08/configure-network-printer-scanner-ubuntu-desktop.html
|
||||
|
||||
作者:[Gabriel Cánepa][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/gabriel
|
||||
[1]:http://xmodulo.com/2014/08/usb-network-printer-and-scanner-server-debian.html
|
||||
[2]:http://www.cups-pdf.de/documentation.shtml
|
||||
[3]:http://xmodulo.com/2014/08/usb-network-printer-and-scanner-server-debian.html#scanner
|
||||
@@ -1,138 +0,0 @@
|
||||
johnhoow translating...
|
||||
# Practical Lessons in Peer Code Review #
|
||||
|
||||
Millions of years ago, apes descended from the trees, evolved opposable thumbs and—eventually—turned into human beings.
|
||||
|
||||
We see mandatory code reviews in a similar light: something that separates human from beast on the rolling grasslands of the software
|
||||
development savanna.
|
||||
|
||||
Nonetheless, I sometimes hear comments like these from our team members:
|
||||
|
||||
"Code reviews on this project are a waste of time."
|
||||
"I don't have time to do code reviews."
|
||||
"My release is delayed because my dastardly colleague hasn't done my review yet."
|
||||
"Can you believe my colleague wants me to change something in my code? Please explain to them that the delicate balance of the universe will
|
||||
be disrupted if my pristine, elegant code is altered in any way."
|
||||
|
||||
### Why do we do code reviews? ###
|
||||
|
||||
Let us remember, first of all, why we do code reviews. One of the most important goals of any professional software developer is to
|
||||
continually improve the quality of their work. Even if your team is packed with talented programmers, you aren't going to distinguish
|
||||
yourselves from a capable freelancer unless you work as a team. Code reviews are one of the most important ways to achieve this. In
|
||||
particular, they:
|
||||
|
||||
provide a second pair of eyes to find defects and better ways of doing something.
|
||||
ensure that at least one other person is familiar with your code.
|
||||
help train new staff by exposing them to the code of more experienced developers.
|
||||
promote knowledge sharing by exposing both the reviewer and reviewee to the good ideas and practices of the other.
|
||||
encourage developers to be more thorough in their work since they know it will be reviewed by one of their colleagues.
|
||||
|
||||
### Doing thorough reviews ###
|
||||
|
||||
However, these goals cannot be achieved unless appropriate time and care are devoted to reviews. Just scrolling through a patch, making sure
|
||||
that the indentation is correct and that all the variables use lower camel case, does not constitute a thorough code review. It is
|
||||
instructive to consider pair programming, which is a fairly popular practice and adds an overhead of 100% to all development time, as the
|
||||
baseline for code review effort. You can spend a lot of time on code reviews and still use much less overall engineer time than pair
|
||||
programming.
|
||||
|
||||
My feeling is that something around 25% of the original development time should be spent on code reviews. For example, if a developer takes
|
||||
two days to implement a story, the reviewer should spend roughly four hours reviewing it.
|
||||
|
||||
Of course, it isn't primarily important how much time you spend on a review as long as the review is done correctly. Specifically, you must
|
||||
understand the code you are reviewing. This doesn't just mean that you know the syntax of the language it is written in. It means that you
|
||||
must understand how the code fits into the larger context of the application, component or library it is part of. If you don't grasp all the
|
||||
implications of every line of code, then your reviews are not going to be very valuable. This is why good reviews cannot be done quickly: it
|
||||
takes time to investigate the various code paths that can trigger a given function, to ensure that third-party APIs are used correctly
|
||||
(including any edge cases) and so forth.
|
||||
|
||||
In addition to looking for defects or other problems in the code you are reviewing, you should ensure that:
|
||||
|
||||
All necessary tests are included.
|
||||
Appropriate design documentation has been written.
|
||||
Even developers who are good about writing tests and documentation don't always remember to update them when they change their code. A
|
||||
gentle nudge from the code reviewer when appropriate is vital to ensure that they don't go stale over time.
|
||||
|
||||
### Preventing code review overload ###
|
||||
|
||||
If your team does mandatory code reviews, there is the danger that your code review backlog will build up to the point where it is
|
||||
unmanageable. If you don't do any reviews for two weeks, you can easily have several days of reviews to catch up on. This means that your
|
||||
own development work will take a large and unexpected hit when you finally decide to deal with them. It also makes it a lot harder to do
|
||||
good reviews since proper code reviews require intense and sustained mental effort. It is difficult to keep this up for days on end.
|
||||
|
||||
For this reason, developers should strive to empty their review backlog every day. One approach is to tackle reviews first thing in the
|
||||
morning. By doing all outstanding reviews before you start your own development work, you can keep the review situation from getting out of
|
||||
hand. Some might prefer to do reviews before or after the midday break or at the end of the day. Whenever you do them, by considering code
|
||||
reviews as part of your regular daily work and not a distraction, you avoid:
|
||||
|
||||
Not having time to deal with your review backlog.
|
||||
Delaying a release because your reviews aren't done yet.
|
||||
Posting reviews that are no longer relevant since the code has changed so much in the meantime.
|
||||
Doing poor reviews since you have to rush through them at the last minute.
|
||||
|
||||
### Writing reviewable code ###
|
||||
|
||||
The reviewer is not always the one responsible for out-of-control review backlogs. If my colleague spends a week adding code willy-nilly
|
||||
across a large project then the patch they post is going to be really hard to review. There will be too much to get through in one session.
|
||||
It will be difficult to understand the purpose and underlying architecture of the code.
|
||||
|
||||
This is one of many reasons why it is important to split your work into manageable units. We use scrum methodology so the appropriate unit
|
||||
for us is the story. By making an effort to organize our work by story and submit reviews that pertain only to the specific story we are
|
||||
working on, we write code that is much easier to review. Your team may use another methodology but the principle is the same.
|
||||
|
||||
There are other prerequisites to writing reviewable code. If there are tricky architectural decisions to be made, it makes sense to meet
|
||||
with the reviewer beforehand to discuss them. This will make it much easier for the reviewer to understand your code, since they will know
|
||||
what you are trying to achieve and how you plan to achieve it. This also helps avoid the situation where you have to rewrite large swathes
|
||||
of code after the reviewer suggests a different and better approach.
|
||||
|
||||
Project architecture should be described in detail in your design documentation. This is important anyway since it enables a new project
|
||||
member to get up to speed and understand the existing code base. It has the further advantage of helping a reviewer to do their job
|
||||
properly. Unit tests are also helpful in illustrating to the reviewer how components should be used.
|
||||
|
||||
If you are including third-party code in your patch, commit it separately. It is much harder to review code properly when 9000 lines of
|
||||
jQuery are dropped into the middle.
|
||||
|
||||
One of the most important steps for creating reviewable code is to annotate your code reviews. This means that you go through the review
|
||||
yourself and add comments anywhere you feel that this will help the reviewer to understand what is going on. I have found that annotating
|
||||
code takes relatively little time (often just a few minutes) and makes a massive difference in how quickly and well the code can be
|
||||
reviewed. Of course, code comments have many of the same advantages and should be used where appropriate, but often a review annotation
|
||||
makes more sense. As a bonus, studies have shown that developers find many defects in their own code while rereading and annotating it.
|
||||
|
||||
### Large code refactorings ###
|
||||
|
||||
Sometimes it is necessary to refactor a code base in a way that affects many components. In the case of a large application, this can take
|
||||
several days (or more) and result in a huge patch. In these cases a standard code review may be impractical.
|
||||
|
||||
The best solution is to refactor code incrementally. Figure out a partial change of reasonable scope that results in a working code base and
|
||||
brings you in the direction you want to go. Once that change has been completed and a review posted, proceed to a second incremental change
|
||||
and so forth until the full refactoring has been completed. This might not always be possible, but with thought and planning it is usually
|
||||
realistic to avoid massive monolithic patches when refactoring. It might take more time for the developer to refactor in this way, but it
|
||||
also leads to better quality code as well as making reviews much easier.
|
||||
|
||||
If it really isn't possible to refactor code incrementally (which probably says something about how well the original code was written and
|
||||
organized), one solution might be to do pair programming instead of code reviews while working on the refactoring.
|
||||
|
||||
### Resolving disputes ###
|
||||
|
||||
Your team is doubtless made up of intelligent professionals, and in almost all cases it should be possible to come an agreement when
|
||||
opinions about a specific coding question differ. As a developer, keep an open mind and be prepared to compromise if your reviewer prefers a
|
||||
different approach. Don't take a proprietary attitude to your code and don't take review comments personally. Just because someone feels
|
||||
that you should refactor some duplicated code into a reusable function, it doesn't mean that you are any less of an attractive, brilliant
|
||||
and charming individual.
|
||||
|
||||
As a reviewer, be tactful. Before suggesting changes, consider whether your proposal is really better or just a matter of taste. You will
|
||||
have more success if you choose your battles and concentrate on areas where the original code clearly requires improvement. Say things like
|
||||
"it might be worth considering..." or "some people recommend..." instead of "my pet hamster could write a more efficient sorting algorithm
|
||||
than this."
|
||||
|
||||
If you really can't find middle ground, ask a third developer who both of you respect to take a look and give their opinion.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://blog.salsitasoft.com/practical-lessons-in-peer-code-review/
|
||||
作者:[Matt][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
惊现译者~CHINAANSHE 翻译!!
|
||||
How to configure HTTP load balancer with HAProxy on Linux
|
||||
================================================================================
|
||||
Increased demand on web based applications and services are putting more and more weight on the shoulders of IT administrators. When faced with unexpected traffic spikes, organic traffic growth, or internal challenges such as hardware failures and urgent maintenance, your web application must remain available, no matter what. Even modern devops and continuous delivery practices can threaten the reliability and consistent performance of your web service.
|
||||
@@ -270,4 +271,4 @@ via: http://xmodulo.com/haproxy-http-load-balancer-linux.html
|
||||
[a]:http://xmodulo.com/author/jaroslav
|
||||
[1]:http://www.haproxy.org/
|
||||
[2]:http://www.haproxy.org/10g.html
|
||||
[3]:http://xmodulo.com/how-to-install-lamp-server-on-ubuntu.html
|
||||
[3]:http://xmodulo.com/how-to-install-lamp-server-on-ubuntu.html
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
su-kaiyao translating
|
||||
|
||||
How to speed up slow apt-get install on Debian or Ubuntu
|
||||
================================================================================
|
||||
If you feel that package installation by **apt-get** or **aptitude** is often too slow on your Debian or Ubuntu system, there are several ways to improve the situation. Have you considered switching default mirror sites being used? Have you checked the upstream bandwidth of your Internet connection to see if that is the bottleneck?
|
||||
|
||||
Nothing else, you can try this third option: use [apt-fast][1] tool. apt-fast is actually a shell script wrapper written around apt-get and aptitude, which can accelerate package download speed. Internally, apt-fast uses [aria2][2] download utility which can download a file in "chunked" forms from multiple mirrors simultaneously (like in BitTorrent download).
|
||||
|
||||
### Install apt-fast on Debian or Ubuntu ###
|
||||
|
||||
Here are the steps to install apt-fast on Debian-based Linux.
|
||||
|
||||
#### Debian ####
|
||||
|
||||
$ sudo apt-get install aria2
|
||||
$ wget https://github.com/ilikenwf/apt-fast/archive/master.zip
|
||||
$ unzip master.zip
|
||||
$ cd apt-fast-master
|
||||
$ sudo cp apt-fast /usr/bin
|
||||
$ sudo cp apt-fast.conf /etc
|
||||
$ sudo cp ./man/apt-fast.8 /usr/share/man/man8
|
||||
$ sudo gzip /usr/share/man/man8/apt-fast.8
|
||||
$ sudo cp ./man/apt-fast.conf.5 /usr/share/man/man5
|
||||
$ sudo gzip /usr/share/man/man5/apt-fast.conf.5
|
||||
|
||||
#### Ubuntu 14.04 and higher ####
|
||||
|
||||
$ sudo add-apt-repository ppa:saiarcot895/myppa
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install apt-fast
|
||||
|
||||
#### Ubuntu 11.04 to 13.10 ####
|
||||
|
||||
$ sudo add-apt-repository ppa:apt-fast/stable
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install apt-fast
|
||||
|
||||
During installation on Ubuntu, you will be asked to choose a default package manager (e.g., apt-get, aptitude), and other settings. You can always change the settings later by editing a configuration file /etc/apt-fast.conf.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### Configure apt-fast ###
|
||||
|
||||
After installation, you need to configure a list of mirrors used by **apt-fast** in /etc/apt-fast.conf.
|
||||
|
||||
You can find a list of Debian/Ubuntu mirrors to choose from at the following URLs.
|
||||
|
||||
- **Debian**: [http://www.debian.org/mirror/list][3]
|
||||
- **Ubuntu**: [https://launchpad.net/ubuntu/+archivemirrors][4]
|
||||
|
||||
After choosing mirrors which are geographically close to your location, add those chosen mirrors to /etc/apt-fast.conf in the following format.
|
||||
|
||||
$ sudo vi /etc/apt-fast.conf
|
||||
|
||||
Debian:
|
||||
|
||||
MIRRORS=('http://ftp.us.debian.org/debian/,http://carroll.aset.psu.edu/pub/linux/distributions/debian/,http://debian.gtisc.gatech.edu/debian/,http://debian.lcs.mit.edu/debian/,http://mirror.cc.columbia.edu/debian/')
|
||||
|
||||
Ubuntu/Mint:
|
||||
|
||||
MIRRORS=('http://us.archive.ubuntu.com/ubuntu,http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/,http://mirror.cc.vt.edu/pub2/ubuntu/,http://mirror.umd.edu/ubuntu/,http://mirrors.mit.edu/ubuntu/')
|
||||
|
||||
As shown above, individual mirrors for a particular archive should be separated by commas. It is recommended that you include the default mirror site specified in /etc/apt/sources.list in the MIRRORS string.
|
||||
|
||||
### Install a Package with apt-fast ###
|
||||
|
||||
Now you are ready to test the power of apt-fast. Here is the command-line usage of **apt-fast**:
|
||||
|
||||
apt-fast [apt-get options and arguments]
|
||||
apt-fast [aptitude options and arguments]
|
||||
apt-fast { { install | upgrade | dist-upgrade | build-dep | download | source } [ -y | --yes | --assume-yes | --assume-no ] ... | clean }
|
||||
|
||||
To install a package with **apt-fast**:
|
||||
|
||||
$ sudo apt-fast install texlive-full
|
||||
|
||||
To download a package in the current directory without installing it:
|
||||
|
||||
$ sudo apt-fast download texlive-full
|
||||
|
||||

|
||||
|
||||
As mentioned earlier, parallel downloading of apt-fast is done by aria2. You can verify parallel downloads from multiple mirrors as follows.
|
||||
|
||||
$ sudo netstat -nap | grep aria2c
|
||||
|
||||

|
||||
|
||||
Note that **apt-fast** does not make "apt-get update" faster. Parallel downloading gets triggered only for "install", "upgrade", "dist-upgrade" and "build-dep" operations. For other operations, apt-fast simply falls back to the default package manager **apt-get** or **aptitude**.
|
||||
|
||||
### How Fast is apt-fast? ###
|
||||
|
||||
To compare apt-fast and apt-get, I tried installing several packages using two methods on two identical Ubuntu instances. The following graph shows total package installation time (in seconds).
|
||||
|
||||

|
||||
|
||||
As you can see, **apt-fast** is substantially faster (e.g., 3--4 times faster) than **apt-get**, especially when a bulky package is installed.
|
||||
|
||||
Be aware that performance improvement will of course vary, depending on your upstream Internet connectivity. In my case, I had ample spare bandwidth to leverage in my upstream connection, and that's why I see dramatic improvement by using parallel download.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/speed-slow-apt-get-install-debian-ubuntu.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
||||
[1]:https://github.com/ilikenwf/apt-fast
|
||||
[2]:http://aria2.sourceforge.net/
|
||||
[3]:http://www.debian.org/mirror/list
|
||||
[4]:https://launchpad.net/ubuntu/+archivemirrors
|
||||
@@ -1,3 +1,4 @@
|
||||
[bazz222222222222222222222]
|
||||
The Why and How of Ansible and Docker
|
||||
================================================================================
|
||||
There is a lot of interest from the tech community in both [Docker][1] and [Ansible][2], I am hoping that after reading this article you will share our enthusiasm. You will also gain a practical insight into using Ansible and Docker for setting up a complete server environment for a Rails application.
|
||||
@@ -100,4 +101,4 @@ via: http://thechangelog.com/ansible-docker/
|
||||
[6]:http://blog.docker.io/2013/10/docker-0-6-5-links-container-naming-advanced-port-redirects-host-integration/
|
||||
[7]:https://speakerdeck.com/gerhardlazu/ansible-and-docker-the-path-to-continuous-delivery-part-1
|
||||
[8]:http://thechangelog.com/weekly/
|
||||
[9]:https://github.com/thechangelog/draft
|
||||
[9]:https://github.com/thechangelog/draft
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
2q1w2007翻译中
|
||||
How to convert image, audio and video formats on Ubuntu
|
||||
================================================================================
|
||||
If you need to work with a variety of image, audio and video files encoded in all sorts of different formats, you are probably using more than one tools to convert among all those heterogeneous media formats. If there is a versatile all-in-one media conversion tool that is capable of dealing with all different image/audio/video formats, that will be awesome.
|
||||
@@ -83,4 +84,4 @@ via: http://xmodulo.com/how-to-convert-image-audio-and-video-formats-on-ubuntu.h
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
||||
[1]:https://launchpad.net/format-junkie
|
||||
[2]:http://xmodulo.com/how-to-install-deb-file-with-dependencies.html
|
||||
[2]:http://xmodulo.com/how-to-install-deb-file-with-dependencies.html
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
[felixonmars translating...]
|
||||
|
||||
How to configure peer-to-peer VPN on Linux
|
||||
================================================================================
|
||||
A traditional VPN (e.g., OpenVPN, PPTP) is composed of a VPN server and one or more VPN clients connected to the server. When any two VPN clients talk to each other, the VPN server needs to relay VPN traffic between them. The problem of such a hub-and-spoke type of VPN topology is that the VPN server can easily become a performance bottleneck as the number of connected clients increases. The centralized VPN server is also a single point of failure in a sense that if the VPN server goes down, the entire VPN is no longer accessible to any VPN client.
|
||||
|
||||
Peer-to-peer VPN (or P2P VPN) is an alternative VPN model that addresses these problems of the traditional server-client based VPN. In a P2P VPN, there is no longer a centralized VPN server. Any node with a public IP address can bootstrap other nodes into a VPN. Once connected to a VPN, each node can communicate with any other node in the VPN directly, without going through an intermediary server node. When any one node goes down, the rest of nodes in the VPN are not affected. Inter-node latency/bandwidth and VPN scalability naturally improve in such a setting, which is desirable if you want to use a VPN for multi-player gaming or file sharing among many friends.
|
||||
|
||||
There are several open-source implementations of P2P VPN, such as [Tinc][1], peerVPN, and [n2n][2]. In this tutorial, I am going to demonstrate **how to configure a peer-to-peer VPN using** n2n **on Linux**.
|
||||
|
||||
n2n is an open-source (GPLv3) software allowing you to construct an encrypted layer-2/3 peer-to-peer VPN among users. The VPN created by n2n is "NAT-friendly," which means that two users behind different NAT routers can directly talk to each other over the VPN. n2n supports symmetric NAT type which is the most restrictive form of NAT. For that, the VPN traffic of n2n is encapsulated by UDP.
|
||||
|
||||
A n2n VPN is composed of two kinds of nodes: edge node and super node. An edge node is a computer which is connected to a VPN, potentially from behind a NAT router. A super node is a computer with a publicly reachable IP address, which assists with initial signaling for NATed edges. To create a P2P VPN among users, we need at least one super node.
|
||||
|
||||

|
||||
|
||||
### Preparation ###
|
||||
|
||||
In this tutorial, I am going to set up a P2P VPN using three nodes: one super node, and two edge nodes. The only requirement is that edge nodes be able to ping the IP address of the super node. It does not matter whether the edge nodes are behind NAT routers or not.
|
||||
|
||||
### Install n2n on Linux ###
|
||||
|
||||
To construct a P2P VPN using n2n, you need to install n2n on every edge node as well as super node.
|
||||
|
||||
Due to its minimal dependency requirements, n2n can be built easily on most Linux platforms.
|
||||
|
||||
To install n2n on Debian-based system:
|
||||
|
||||
$ sudo apt-get install subversion build-essential libssl-dev
|
||||
$ svn co https://svn.ntop.org/svn/ntop/trunk/n2n
|
||||
$ cd n2n/n2n_v2
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
||||
To install n2n on Red Hat-based system:
|
||||
|
||||
$ sudo yum install subversion gcc-c++ openssl-devel
|
||||
$ svn co https://svn.ntop.org/svn/ntop/trunk/n2n
|
||||
$ cd n2n/n2n_v2
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
||||
### Configure a P2P VPN with n2n ###
|
||||
|
||||
As mentioned before, we need to set up at least one super node which acts as an initial bootstraping server. We assume that the IP address of the super node is 1.1.1.1.
|
||||
|
||||
#### Super node: ####
|
||||
|
||||
On a computer which acts as a super node, run the following command. The "-l <port>" specifies the listening port of the super node. No root privilege is required to run supernode.
|
||||
|
||||
$ supernode -l 5000
|
||||
|
||||
#### Edge node: ####
|
||||
|
||||
On each edge node, use the following command to connect to a P2P VPN. The edge daemon will be running in the background.
|
||||
|
||||
Edge node #1:
|
||||
|
||||
$ sudo edge -d edge0 -a 10.0.0.10 -c mynetwork -u 1000 -g 1000 -k password -l 1.1.1.1:5000 -m ae:e0:4f:e7:47:5b
|
||||
|
||||
Edge node #2:
|
||||
|
||||
$ sudo edge -d edge0 -a 10.0.0.11 -c mynetwork -u 1000 -g 1000 -k password -l 1.1.1.1:5000 -m ae:e0:4f:e7:47:5c
|
||||
|
||||
Here are some explanations on the command-line.
|
||||
|
||||
- The "-d <name>" option specifies the name of a TAP interface being created by edge command.
|
||||
- The "-a <IP-address>" option defines (statically) the VPN IP address to be assigned to the TAP interface. If you want to use DHCP, you need to set up a DHCP server on one of edge nodes, and use "-a dhcp:0.0.0.0" option instead.
|
||||
- The "-c <community-name>" option specifies the name of a VPN group (with a length of up to 16 bytes). This option is used to create multiple VPNs among the same group of nodes.
|
||||
- The "-u" and "-g" options are used to drop root priviledge after creating a TAP interface. The edge daemon will run as the specified user/group ID.
|
||||
- The "-k <key-string>" option specifies a twofish encryption key string to be used. If you want to hide a key-string from the command-line, you can define the key in N2N_KEY environment variable.
|
||||
- The "-l <IP-address:port>" option specifies super node's listening IP address and port number. For redundancy, you can specify up to two different super nodes (e.g., -l <supernode A> -l <supernode B>).
|
||||
- The "-m <mac-address> assigns a static MAC address to a TAP interface. Without this, edge command will randomly generate a MAC address. In fact, hardcoding a static MAC address for a VPN interface is highly recommended. Otherwise, in case you restart edge daemon on a node, ARP cache of other peers will be polluted due to a newly generated MAC addess, and they will not send traffic to the node until the polluted ARP entry is evicted.
|
||||
|
||||

|
||||
|
||||
At this point, you should be able to ping from one edge node to the other using their VPN IP addresses.
|
||||
|
||||
### Troubleshooting ###
|
||||
|
||||
1. You are getting the following error while invoking edge daemon.
|
||||
|
||||
n2n[4405]: ERROR: ioctl() [Operation not permitted][-1]
|
||||
|
||||
Be aware that edge daemon requires superuser privilege when creating a TAP interface. Thus make sure to use root privilege or set SUID for edge command. You can always use "-u" and "-g" option to drop root privilege afterwards.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
n2n can be a quite practical free VPN solution for you. You can easily configure a super node from your own home network or by grabbing a publicly addressable VPS instance from [cloud hosting][3]. Instead of placing sensitive credentials and encryption keys in the hands of a third-party VPN provider, you can use n2n to set up your own low-latency, high bandwidth, scalable P2P VPN among your friends.
|
||||
|
||||
What is your thought on n2n? Share your opinion in the comment.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/configure-peer-to-peer-vpn-linux.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
||||
[1]:http://xmodulo.com/how-to-install-and-configure-tinc-vpn.html
|
||||
[2]:http://www.ntop.org/products/n2n/
|
||||
[3]:http://xmodulo.com/go/digitalocean
|
||||
@@ -0,0 +1,86 @@
|
||||
wangjiezhe translating...
|
||||
|
||||
Linux FAQs with Answers--How to change date and time from the command line on Linux
|
||||
================================================================================
|
||||
> **Question**: In Linux, how can I change date and time from the command line?
|
||||
|
||||
Keeping the date and time up-to-date in a Linux system is an important responsibility of every Linux user and system administrator. Many applications rely on accurate timing information to operate properly. Besides, inaccurate date and time render timestamp information in log files meaningless, diminishing their usefulness for system inspection and troubleshooting. For production systems, accurate date and time are even more critical. For example, the production in a retail company must be accounted precisely at all times (and stored in a database server) so that the finance department can calculate the expenses and net income of the day, current week, month, and year.
|
||||
|
||||
We must note that there are two kinds of clocks in a Linux machine: the software clock (aka system clock), which is maintained by the kernel, and the (battery-driven) hardware clock, which is used to keep track of time when the machine is powered down. During boot, the kernel sets the system clock to the same time as the hardware clock. Afterwards, both clocks run independent from each other.
|
||||
|
||||
### Method One: Date Command ###
|
||||
|
||||
In Linux, you can use the date command to change the date and time of your system:
|
||||
|
||||
# date --set='NEW_DATE'
|
||||
|
||||
where NEW_DATE is a mostly free format human readable date string such as "Sun, 28 Sep 2014 16:21:42" or "2014-09-29 16:21:42".
|
||||
|
||||
The date format can also be specified to obtain more accurate results:
|
||||
|
||||
# date +FORMAT --set='NEW_DATE'
|
||||
|
||||
For example:
|
||||
|
||||
# date +’%Y%m%d %H%m’ --set='20140928 1518'
|
||||
|
||||

|
||||
|
||||
You can also increment or decrement date or time by a number of days, weeks, months or years, and seconds, minutes or hours, respectively. You may combine date and time parameters in one command as well.
|
||||
|
||||
# date --set='+5 minutes'
|
||||
# date --set='-2 weeks'
|
||||
# date --set='+3 months'
|
||||
# date --set='-3 months +2 weeks -5 minutes'
|
||||
|
||||

|
||||
|
||||
Finally, set the hardware clock to the current system time:
|
||||
|
||||
# hwclock --systohc
|
||||
|
||||
The purpose of running **hwclock --systohc** is to update the hardware clock with the software clock. This is to correct the systematic drift of the hardware clock, where it consistently gains or loses time at a certain rate.
|
||||
|
||||
On the other hand, if the hardware clock shows correct date and time, but the system clock does not, the latter can be updated as follows:
|
||||
|
||||
# hwclock --hctosys
|
||||
|
||||
In either case, hwclock command synchronizes both clocks. Otherwise, the time will be wrong after the next reboot, since the hardware clock keeps the time when power is turned off. However, keep in mind that this is not applicable to virtual machines, as they cannot access the hardware clock of the host machine directly.
|
||||
|
||||
If the default timezone is not correct on your Linux system, you can change it by following [this guideline][1].
|
||||
|
||||
### Method Two: NTP ###
|
||||
|
||||
Another way to keep your system's date and time accurate is using NTP (network time protocol). On Linux, ntpdate command can synchronize system clock against [public NTP servers][2] using NTP.
|
||||
|
||||
You can install **ntpdate** as follows:
|
||||
|
||||
On Debian and derivatives:
|
||||
|
||||
# aptitude install ntpdate
|
||||
|
||||
On Red Hat-based distributions:
|
||||
|
||||
# yum install ntpdate
|
||||
|
||||
To synchronize system clock using NTP:
|
||||
|
||||
# ntpdate -u <NTP server name or IP address>
|
||||
# hwclock --systohc
|
||||
|
||||

|
||||
|
||||
As opposed to one-time clock sync using ntpdate, you can also set up NTP daemon (ntpd) on your system, so that ntpd always runs in the background, continuously adjusting system clock via NTP. Refer to [this guideline][3] to set up **ntpd**.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/change-date-time-command-line-linux.html
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[wangjiezhe](https://github.com/wangjiezhe)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://ask.xmodulo.com/change-timezone-linux.html
|
||||
[2]:http://www.pool.ntp.org/
|
||||
[3]:http://xmodulo.com/how-to-synchronize-time-with-ntp.html
|
||||
@@ -0,0 +1,70 @@
|
||||
Vic020
|
||||
|
||||
Linux FAQs with Answers--How to create and mount an XFS file system on Linux
|
||||
================================================================================
|
||||
> **Question**: I heard good things about XFS, and would like to create an XFS file system on my disk partition. What are the Linux commands to format and mount an XFS file system?
|
||||
|
||||
[XFS][1] is a high-performance file system which was designed by SGI for their IRIX platform. Since XFS was ported to the Linux kernel in 2001, XFS has remained a preferred choice for many enterprise systems especially with massive amount of data, due to its [high performance][2], architectural scalability and robustness. For example, RHEL/CentOS 7 and Oracle Linux have adopted XFS as their default file system, and SUSE/openSUSE have long been an avid supporter of XFS.
|
||||
|
||||
XFS has a number of unique features that make it stand out among the file system crowd, such as scalable/parallel I/O, journaling for metadata operations, online defragmentation, suspend/resume I/O, delayed allocation for performance, etc.
|
||||
|
||||
If you want to create and mount an XFS file system on your Linux platform, here is how to do it.
|
||||
|
||||
### Install XFS System Utilities ###
|
||||
|
||||
First, you need to install XFS system utilities, which allow you to perform various XFS related administration tasks (e.g., format, [expand][3], repair, setting up quota, change parameters, etc).
|
||||
|
||||
On Debian, Ubuntu or Linux Mint:
|
||||
|
||||
$ sudo apt-get install xfsprogs
|
||||
|
||||
On Fedora, CentOS or RHEL:
|
||||
|
||||
$ sudo yum install xfsprogs
|
||||
|
||||
On Arch Linux:
|
||||
|
||||
$ sudo pacman -S xfsprogs
|
||||
|
||||
### Create an XFS-Formatted Disk Partition ###
|
||||
|
||||
Now let's first prepare a disk partition to create XFS on. Assuming that your disk is located at /dev/sdb, create a partition by:
|
||||
|
||||
$ sudo fdisk /dev/sdb
|
||||
|
||||

|
||||
|
||||
Let's say the created partition is assigned /dev/sdb1 device name.
|
||||
|
||||
Next, format the partition as XFS using mkfs.xfs command. The "-f" option is needed if the partition has any other file system created on it, and you want to overwrite it.
|
||||
|
||||
$ sudo mkfs.xfs -f /dev/sdb1
|
||||
|
||||

|
||||
|
||||
Now you are ready to mount the formatted partition. Let's assume that /storage is a local mount point for XFS. Go ahead and mount the partition by running:
|
||||
|
||||
$ sudo mount -t xfs /dev/sdb1 /storage
|
||||
|
||||
Verify that XFS mount is succesful by running:
|
||||
|
||||
$ df -Th /storage
|
||||
|
||||

|
||||
|
||||
If you want the XFS partition to be mounted at /storage automatically upon boot, add the following line to /etc/fstab.
|
||||
|
||||
/dev/sdb1 /storage xfs defaults 0 0
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/create-mount-xfs-file-system-linux.html
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://xfs.org/
|
||||
[2]:http://lwn.net/Articles/476263/
|
||||
[3]:http://ask.xmodulo.com/expand-xfs-file-system.html
|
||||
@@ -0,0 +1,109 @@
|
||||
Linux FAQs with Answers--How to detect DVD writer’s device name and its writing speed from the command line on Linux
|
||||
================================================================================
|
||||
> **Question**: I want to know the device name assigned to my DVD writer, and also find out how fast I can burn a DVD using the DVD writer. What is a Linux command-line tool to detect the device name of a DVD writer and its writing speed?
|
||||
|
||||
Most consumer PCs and laptops nowadays come with a DVD writer. In Linux, optical drives such as CD/DVD drives are assigned device names by the kernel based on udev rules at the time of booting. There are several ways to detect the writer's device name and its writing speed.
|
||||
|
||||
### Method One ###
|
||||
|
||||
The simplest way to find out the device name associated with a DVD writer is to use dmesg command-line tool, which prints out the message buffer of the kernel. In dmesg output, look for a potential DVD writer:
|
||||
$ dmesg | egrep -i --color 'dvd|cd/rw|writer'
|
||||
|
||||

|
||||
|
||||
The output of the above command will tell you whether a DVD writer is detected on your Linux system, and what the device name assigned to the writer is. In this example, the device name of a DVD writer is "/dev/sr0". This method does not tell you about writing speed, though.
|
||||
|
||||
### Method Two ###
|
||||
|
||||
The second method to get information about your DVD writer is to use lsscsi command, which simply lists all available SCSI devices.
|
||||
|
||||
To install **lsscsi** on Debian-based Linux:
|
||||
|
||||
$ sudo apt-get install lsscsi
|
||||
|
||||
To install lsscsi on Red Hat-based Linux:
|
||||
|
||||
$ sudo yum install lsscsi
|
||||
|
||||
The output of lsscsi command will tell you the name of a DVD writer if successfully detected:
|
||||
|
||||
$ lsscsi
|
||||
|
||||

|
||||
|
||||
This again does not tell you more details about the writer, such as writing speed.
|
||||
|
||||
### Method Three ###
|
||||
|
||||
The third method to obtain information about your DVD writer is to refer to /proc/sys/dev/cdrom/info.
|
||||
|
||||
$ cat /proc/sys/dev/cdrom/info
|
||||
|
||||
----------
|
||||
|
||||
CD-ROM information, Id: cdrom.c 3.20 2003/12/17
|
||||
|
||||
drive name: sr0
|
||||
drive speed: 24
|
||||
drive # of slots: 1
|
||||
Can close tray: 1
|
||||
Can open tray: 1
|
||||
Can lock tray: 1
|
||||
Can change speed: 1
|
||||
Can select disk: 0
|
||||
Can read multisession: 1
|
||||
Can read MCN: 1
|
||||
Reports media changed: 1
|
||||
Can play audio: 1
|
||||
Can write CD-R: 1
|
||||
Can write CD-RW: 1
|
||||
Can read DVD: 1
|
||||
Can write DVD-R: 1
|
||||
Can write DVD-RAM: 1
|
||||
Can read MRW: 1
|
||||
Can write MRW: 1
|
||||
Can write RAM: 1
|
||||
|
||||
In this example, the output tells you that the DVD writer (/dev/sr0) is compatible with x24 CD writing speed (i.e., 24x153.6 KBps), which is equivalent to x3 DVD writing speed (i.e., 3x1385 KBps). The writing speed here is maximum possible speed, and actual writing speed of course depends on the type of media being used (e.g., DVD-RW, DVD+RW, DVD-RAM, etc).
|
||||
|
||||
### Method Four ###
|
||||
|
||||
Another way is to use a command-line utility called wodim. On most Linux distros, this tool, as well as its symbolic link cdrecord, is pre-installed by default.
|
||||
|
||||
# wodim -prcap
|
||||
(or cdrecord -prcap)
|
||||
|
||||

|
||||
|
||||
When invoked without any argument, the wodim command automatically detects a DVD writer, and shows detailed capabilities and maximum read/write speed of the writer. For example, you can find out what media (e.g., CD-R, CD-RW, DVD-RW, DVD-ROM, DVD-R, DVD-RAM, audio CD) are supported by the writer, and what read/write speeds are available. The example output above shows that the DVD writer has maximum x24 writing speed for CDs and maximum x3 writing speed for DVDs.
|
||||
|
||||
Note that the writing speed reported by wodim command will automatically change depending on which CD/DVD media you insert to a DVD burner, reflecting the media specification.
|
||||
|
||||
### Method Five ###
|
||||
|
||||
A yet another way to check DVD burner's writing speed is a tool called dvd+rw-mediainfo, which is part of dvd+rw-tools package (toolchain for DVD+-RW/R media).
|
||||
|
||||
To install **dvd+rw-tools** on Debian-based distros:
|
||||
|
||||
$ sudo apt-get install dvd+rw-tools
|
||||
|
||||
To install dvd+rw-tools on Red Hat-based distros:
|
||||
|
||||
$ sudo yum install dvd+rw-tools
|
||||
|
||||
Unlike other tools, dvd+rw-mediainfo command will not produce any output unless you insert a DVD media to the burner. So after you insert a DVD media, run the following command. Replace "/dev/sr0" with your own device name.
|
||||
|
||||
$ sudo dvd+rw-mediainfo /dev/sr0
|
||||
|
||||

|
||||
|
||||
The **dvd+rw-mediainfo** tool probes the inserted media ("DVD-R" in this example) to find out actual writing speed against the media.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/detect-dvd-writer-device-name-writing-speed-command-line-linux.html
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
@@ -0,0 +1,146 @@
|
||||
How to check hard disk health on Linux using smartmontools
|
||||
================================================================================
|
||||
If there is something that you never want to happen on your Linux system, that is having hard drives die on you without any warning. [Backups][1] and storage technologies such as [RAID][2] can get you back on your feet in no time, but the cost associated with a sudden loss of a hardware device can take a considerable toll on your budget, especially if you haven't planned ahead of time what to do in such circumstances.
|
||||
|
||||
To avoid running into this kind of setbacks, you can try [smartmontools][3] which is a software package that manages and monitors storage hardware by using Self-Monitoring, Analysis and Reporting Technology (S.M.A.R.T. or just SMART). Most modern ATA/SATA, SCSI/SAS, and solid-state hard disks nowadays come with the SMART system built-in. The purpose of SMART is to monitor the reliability of the hard drive, to predict drive failures, and to carry out different types of drive self-tests. The smartmontools consists of two utility programs called smartctl and smartd. Together, they will provide advanced warnings of disk degradation and failure on Linux platforms.
|
||||
|
||||
This tutorial will provide installation and configuration guide for smartmontools on Linux.
|
||||
|
||||
### Installing Smartmontools ###
|
||||
|
||||
Installation of smartmontools is straightforward as it available in base repositories of most Linux distros.
|
||||
|
||||
#### Debian and derivatives: ####
|
||||
|
||||
# aptitude install smartmontools
|
||||
|
||||
#### Red Hat-based distributions: ####
|
||||
|
||||
# yum install smartmontools
|
||||
|
||||
### Checking Hard Drive Health with Smartctl ###
|
||||
|
||||
First off, list the hard drives connected to your system with the following command:
|
||||
|
||||
# ls -l /dev | grep -E 'sd|hd'
|
||||
|
||||
The output should be similar to:
|
||||
|
||||

|
||||
|
||||
where sdx indicate device names assigned to the hard drives installed on your machine.
|
||||
|
||||
To display information about a particular hard disk (e.g., device model, S/N, firmware version, size, ATA version/revision, availability and status of SMART capability), run smartctl with "--info" flag, and specify the hard drive's device name as follows.
|
||||
|
||||
In this example, we will choose /dev/sda.
|
||||
|
||||
# smartctl --info /dev/sda
|
||||
|
||||

|
||||
|
||||
Although the ATA version information may seem to go unnoticed at first, it is one of the most important factors when looking for a replacement part. Each ATA version is backward compatible with the previous versions. For example, older ATA-1 or ATA-2 devices work fine on ATA-6 and ATA-7 interfaces, but unfortunately, that is not true for the other way around. In cases where the device version and interface version don't match, they work together at the capabilities of the lesser of the two. That being said, an ATA-7 hard drive is the safest choice for a replacement part in this case.
|
||||
|
||||
You can examine the health status of a particular hard drive with:
|
||||
|
||||
# smartctl -s on -a /dev/sda
|
||||
|
||||
In this command, "-s on" flag enables SMART on the specified device. You can ommit it if SMART support is already enabled for /dev/sda.
|
||||
|
||||
The SMART information for a disk consists of several sections. Among other things, "READ SMART DATA" section shows the overall health status of the drive.
|
||||
|
||||
=== START OF READ SMART DATA SECTION ===
|
||||
SMART overall-health self-assessment rest result: PASSED
|
||||
|
||||
The result of this test can be either PASSED or FAILED. In the latter case, a hardware failure is imminent, so you may want to start backing up your important data from that drive!
|
||||
|
||||
The next thing you will want to look at is the [SMART attribute][4] table, as shown below.
|
||||
|
||||

|
||||
|
||||
Basically, SMART attribute table lists values of a number of attributes defined for a particular drive by its manufacturer, as well as failure threshold for these attributes. This table is automatically populated and updated by drive firmware.
|
||||
|
||||
- **ID#**: attribute ID, usually a decimal (or hex) number between 1 and 255.
|
||||
- **ATTRIBUTE_NAME**: attribute names defined by a drive manufacturer.
|
||||
- **FLAG**: attribute handling flag (we can ignore it).
|
||||
- **VALUE**: this is one of the most important information in the table, indicating a "normalized" value of a given attribute, whose range is between 1 and 253. 253 means the best condition, while 1 means the worse condition. Depending on attributes and manufacturers, an initial VALUE can be set to either 100 or 200.
|
||||
- **WORST**: the lowest VALUE ever recorded.
|
||||
- **THRESH**: the lowest value that WORST should ever be allowed to fall to, before reporting a given hard drive as FAILED.
|
||||
- **TYPE**: the type of attribute (either Pre-fail or Old_age). A Pre-fail attribute is considered a critical attribute; one that participates in the overall SMART health assessment (PASSED/FAILED) of the drive. If any Pre-fail attribute fails, then the drive is considered "about to fail." On the other hand, an Old_age attribute is considered (for SMART purposes) a non-critical attribute (e.g., normal wear and tear); one that does not fail the drive per se.
|
||||
- **UPDATED**: indicates how often an attribute is updated. Offline represents the case when offline tests are being performed on the drive.
|
||||
- **WHEN_FAILED**: this will be set to "FAILING_NOW" (if VALUE is less than or equal to THRESH), or "In_the_past" (if WORST is less than equal to THRESH), or "-" (if none of the above). In case of "FAILING_NOW", back up your important files ASAP, especially if the attribute is of TYPE Pre-fail. "In_the_past" means that the attribute has failed before, but that it's OK at the time of running the test. "-" indicates that this attribute has never failed.
|
||||
- **RAW_VALUE**: a manufacturer-defined raw value, from which VALUE is derived.
|
||||
|
||||
At this point you may be thinking, "Yes, smartctl seems like a nice tool. but I would like to avoid the hassle of having to run it manually." Wouldn't it be nice if it could be run at specified intervals, and at the same time inform me of the testsresults?
|
||||
|
||||
Fortunately, the answer is yes. And that's when smartd comes in.
|
||||
|
||||
### Configuring Smartctl and Smartd for Live Monitoring ###
|
||||
|
||||
First, edit smartctl's configuration file (/etc/default/smartmontools) to tell it to start smartd at system startup, and to specify check intervals in seconds (e.g., 7200 = 2 hours).
|
||||
|
||||
start_smartd=yes
|
||||
smartd_opts="--interval=7200"
|
||||
|
||||
Next, edit smartd's configuration file (/etc/smartd.conf) to add the followign line.
|
||||
|
||||
/dev/sda -m myemail@mydomain.com -M test
|
||||
|
||||
|
||||
- **-m <email-address>**: specifies an email address to send test reports to. This can be a system user such as root, or an email address such as myemail@mydomain.com if the server is configured to relay emails to the outside of your system.
|
||||
- **-M <delivery-type>**: specifies the desired type of delivery for an email report.
|
||||
- **once**: sends only one warning email for each type of disk problem detected.
|
||||
- **daily**: sends additional warning reminder emails, once per day, for each type of disk problem detected.
|
||||
- **diminishing**: sends additional warning reminder emails, after a one-day interval, then a two-day interval, then a four-day interval, and so on for each type of disk problem detected. Each interval is twice as long as the previous interval.
|
||||
- **test**: sends a single test email immediately upon smartd startup.
|
||||
- **exec PATH**: runs the executable PATH instead of the default mail command. PATH must point to an executable binary file or script. This allows to specify a desired action (beep the console, shutdown the system, and so on) when a problem is detected.
|
||||
|
||||
Save the changes and restart smartd.
|
||||
|
||||
You should expect this kind of email sent by smartd.
|
||||
|
||||

|
||||
|
||||
Luckily for us, no error was detected. Had it not been so, the errors would have appeared below the line "The following warning/error was logged by the smartd daemon."
|
||||
|
||||
Finally, you can schedule tests at your preferred schedule using the "-s" flag and the regular expression in the form of "T/MM/DD/d/HH", where:
|
||||
|
||||
T in the regular expression indicates the kind of test:
|
||||
|
||||
- L: long test
|
||||
- S: short test
|
||||
- C: Conveyance test (ATA only)
|
||||
- O: Offline (ATA only)
|
||||
|
||||
and the remaining characters represent the date and time when the test should be performed:
|
||||
|
||||
- MM is the month of the year.
|
||||
- DD is the day of the month.
|
||||
- HH is the hour of day.
|
||||
- d is the day of the week (ranging from 1=Monday through 7=Sunday).
|
||||
- MM, DD, and HH are expressed with two decimal digits.
|
||||
|
||||
A dot in any of these places indicates all possible values. An expression inside parentheses such as ‘(A|B|C)’ denotes any one of the three possibilities A, B, or C. An expression inside square brackets such as [1-5] denotes a range (1 through 5 inclusive).
|
||||
|
||||
For example, to perform a long test every business day at 1 pm for all disks, add the following line to /etc/smartd.conf. Make sure to restart smartd.
|
||||
|
||||
DEVICESCAN -s (L/../../[1-5]/13)
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
Whether you want to quickly check the electrical and mechanical performance of a disk, or perform a longer and more thorough test scans the entire disk surface, do not let yourself get so caught up in your day-to-day responsibilities as to forget to regularly check on the health of your disks. You will thank yourself later!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/check-hard-disk-health-linux-smartmontools.html
|
||||
|
||||
作者:[Gabriel Cánepa][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/gabriel
|
||||
[1]:http://xmodulo.com/how-to-create-secure-incremental-offsite-backup-in-linux.html
|
||||
[2]:http://xmodulo.com/create-software-raid1-array-mdadm-linux.html
|
||||
[3]:http://www.smartmontools.org/
|
||||
[4]:http://en.wikipedia.org/wiki/S.M.A.R.T.
|
||||
@@ -0,0 +1,147 @@
|
||||
How to verify the authenticity and integrity of a downloaded file on Linux
|
||||
================================================================================
|
||||
When you download a file (e.g., an installer, an ISO image, or a compressed archive) from the web, the file can be corrupted under a variety of error conditions, e.g., due to transmission errors on the wire, interrupted download, faulty storage hardware, file system errors, etc. Such failure cases aside, a file can also be deliberately tampered with by determined attackers during or before download. For example, an attacker with a compromised certificate authority could mount a man-in-the-middle (MITM) attack, tricking you into downloading a malware-ridden file from a bogus HTTPS website.
|
||||
|
||||
To protect yourself against these kinds of problems, it is often recommended that you verify the authenticity and integrity of a file when you download it from the web. Especially when you downloaded rather sensitive files (e.g., OS images, application binaries, executable installers, etc), blindly trusting downloaded files is not a good habit.
|
||||
|
||||
One quick and easy way to verify the integrity of a downloaded file is to use various checksum tools (e.g., md5sum, sha256sum, cksum) to compute and compare checksums (e.g., MD5, SHA or CRC). However, checksums are vulnerable to [collision attacks][1], and also cannot be used to verify the authenticity (i.e., owner) of a file.
|
||||
|
||||
If you would like to verify both authenticity (owner) and integrity (content) of a downloaded file, you need to rely on cryptographic signatures instead. In this tutorial, I am going to describe how to check file authenticity and integrity by using GnuPG (GNU Privacy Guard).
|
||||
|
||||
In this example, I am going to verify a disk image file available for download from https://onionshare.org. In this website, the publisher offers their official public key, as well as its fingerprint for key verification purpose.
|
||||
|
||||

|
||||
|
||||
As for a file to download, the publisher offers its corresponding PGP signature as well.
|
||||
|
||||

|
||||
|
||||
### Install GnuPG and Generate a Key Pair ###
|
||||
|
||||
Let's start by installing GnuPG on your Linux system.
|
||||
|
||||
On Debian, Ubuntu, and other Debian-derivatives:
|
||||
|
||||
$ sudo apt-get install gnupg
|
||||
|
||||
On Fedora, CentOS or RHEL:
|
||||
|
||||
$ sudo yum install gnupg
|
||||
|
||||
After installation, generate a key pair which you will be using in this tutorial.
|
||||
|
||||
$ gpg --gen-key
|
||||
|
||||

|
||||
|
||||
During key generation, you will be asked to provide your name and email address, as well as a passphrase to protect your private key. You can also choose when the key pair will expire (no expiration by default). Depending on keysize you choose (between 1024 to 4096 bits), the key generation process can take a couple of minutes or more, as it requires collecting a sufficient amount of random data, which come from your desktop activities (e.g., keyboard typing, mouse movement, disk access).
|
||||
|
||||
After key generation is finished, a public and a private key will be stored in ~/.gnupg directory for use.
|
||||
|
||||

|
||||
|
||||
### Establish Trust with a File Owner ###
|
||||
|
||||
The first step in verifying a downloaded file is to establish trust with whoever is offering the file for download. For this purpose, we download the public key of a file owner, and verify that the owner of the public key is who he or she claims to be.
|
||||
|
||||
After downloading the public key of a file owner:
|
||||
|
||||
$ wget https://onionshare.org/signing-key.asc
|
||||
|
||||
go ahead and import the public key into your keyring with gpg command:
|
||||
|
||||
$ gpg --import signing-key.asc
|
||||
|
||||

|
||||
|
||||
Once the public key of the owner is imported, it will print out a key ID (e.g., "EBA34B1C") as shown above. Make a note of this key ID.
|
||||
|
||||
Now, check the fingerprint of the imported public key by running:
|
||||
|
||||
$ gpg --fingerprint EBA34B1C
|
||||
|
||||

|
||||
|
||||
You will see the fingerprint string of the key. Compare this string with the fingerprint displayed in the website. If they match, you may choose to trust the file owner's public key.
|
||||
|
||||
Once you decided to trust the public key, you can mark that so explicitly, by editing the key:
|
||||
|
||||
$ gpg --edit-key EBA34B1C
|
||||
|
||||
This command will show you GPG prompt:
|
||||
|
||||

|
||||
|
||||
Type "trust" at GPG prompt, which will allow you to choose the trust level of this key from 1 to 5.
|
||||
|
||||

|
||||
|
||||
In this case, I decided to assign trust "4". After that, sign it with your own private key by typing "sign", and then finalize by typing "save" at GPG prompt:
|
||||
|
||||

|
||||
|
||||
Note that this way of explicitly assigning a trust to a public key is not required, and implicit trust by simply importing the key is often sufficient.
|
||||
|
||||
The implication of assigning a "full" trust to the key is that if another key X is signed with this fully trusted key, the key X will be also considered valid by you. In general, key validation relies on a sophisticated mechanism known as "[web of trust][2]".
|
||||
|
||||
Coming back to the tutorial, now let's check a list of imported keys.
|
||||
|
||||
$ gpg --list-keys
|
||||
|
||||

|
||||
|
||||
You should see at least two keys: one key with depth 0 and ultimate trust ("1u"), which is your own key, and the other key with depth 1 and full trust ("1f"), which is the key signed by yourself earlier.
|
||||
|
||||
### Verify the Authenticity/Integrity of a File ###
|
||||
|
||||
Once you have established a trust relationship with a file owner using his/her public key, we are now ready to verify the authenticity and integrity of a file that you downloaded from the owner.
|
||||
|
||||
In our example, the file owner publishes a file and a corresponding PGP signature (*.asc) separately. The role of the signature is to certify and put a timestamp on the file.
|
||||
|
||||
A typical signature (*.asc) looks like the following.
|
||||
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQIcBAABCgAGBQJUJGhsAAoJEP1yCtnro0sc1jUP/ixNY/lKdrcMIAUoqlWKNE8f
|
||||
sj4SFiwREMew76w66GASDF03fa5zPX6EsS2kucgx8ZsfEiSmN5T0y2P/aSaXwZqF
|
||||
kywZVEzirKtca5AJ4DBzu6qrt9GgSw6JBJVv1oBJCMNyO+eAj341paR3MudvnyQz
|
||||
H/N5tc4Qcilzy6M184opGIzy4ipEmMXfLHsd7WJpAyn+tO/z3uhh9NkNuygZpaFr
|
||||
olpSWPE8revdDJyfMfSmb3ZrFmhLn7FCEltOi+a7SluvrMclizfnbec9rgLJtjo0
|
||||
CPDZY7tsWmmL0DA3VvpMVqGvkg/Dyhpn2IIDrNaLAlvGQ5aovf+4tjad5IHvyaWx
|
||||
4Gds93G6Hqvv5RwGx7OR3hgt2o0Y+qFsVDxVnPxerGhXeJXHzSDwLQMpdj9IoSU
|
||||
Ae/53XXnxqSN6POZcwHiHvbsv0pdlg0Ea0dDAAN0ZeINNyZf1R0tLjWkcgpvGCtv
|
||||
qkJuYFF9W9cWHraPY2ov5Hs/JZzPcG0eVpnDdzfOOH1gDKADq9A5D2X5QJCulsh9
|
||||
WwU3X+E43OqIsoRzBucItD9HhZbEH7t8Q0xAqnAkgU3hriZp3dN4cnMfhM6I9hli
|
||||
EmpSpLKCceMexu2o9QgzGXVm+AGZJe4QkuwAhRIccp5JDMVny61UlKTasjy6co8h
|
||||
5GBhhYybPEFM+G1BODMd
|
||||
=c9wo
|
||||
-----END PGP SIGNATURE-----
|
||||
|
||||
Let's download both the file and its signature:
|
||||
|
||||
$ wget https://onionshare.org/files/0.6/OnionShare.dmg
|
||||
$ wget https://onionshare.org/files/0.6/OnionShare.dmg.asc
|
||||
|
||||
Now verify the PGP signature of the downloaded file.
|
||||
|
||||
$ gpg --verify OnionShare.dmg.asc OnionShare.dmg
|
||||
|
||||

|
||||
|
||||
If the output of the command contains "Good signature from <file owner>", the downloaded .dmg file has been successfully authenticated and verified. If the downloaded file were tampered with in any way after the signature has been generated, the verification would fail.
|
||||
|
||||
At this point you can be rest assured and trust the downloaded file.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/verify-authenticity-integrity-downloaded-file.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
||||
[1]:http://en.wikipedia.org/wiki/Collision_attack
|
||||
[2]:https://www.gnupg.org/gph/en/manual/x334.html
|
||||
@@ -0,0 +1,78 @@
|
||||
How to create a video DVD on Linux desktop
|
||||
================================================================================
|
||||
> **Question**: I want to create a video DVD from MP4 movie files. Is there an open-source DVD authoring tool that I can use to create a video DVD in the Linux desktop environment?
|
||||
|
||||
[DeVeDe][1] is an open-source (GPLv3) DVD authoring software that allows you to create video DVD, VCD, SVCD or DivX from any number of video files. DeVeDe relies on other software such as Mplayer, FFMpeg, MEncoder, DVDAuthor, VCDImager and MKisofs for format conversion. As such, it supports a variety of popular input video/audio formats (e.g., .mp4, .avi, .mpg, .mkv). You can choose between PAL and NTSC video formats, and can add menus or subtitles.
|
||||
|
||||
DeVeDe can come in handy if you want to preserve or give away a copy of your vacation, family or entertainment videos.
|
||||
|
||||
### Installing Devede ###
|
||||
|
||||
#### Debian, Ubuntu and derivatives: ####
|
||||
|
||||
# aptitude install devede
|
||||
|
||||
#### RHEL or CentOS: ####
|
||||
|
||||
Enable [EPEL][2] and [Nux Dextop][3] repositories, and then run:
|
||||
|
||||
# yum install devede
|
||||
|
||||
#### Fedora: ####
|
||||
|
||||
Enable [RPM Fusion][4] repository, and then run:
|
||||
|
||||
# yum install devede
|
||||
|
||||
### Creating a Video DVD with DeVeDe ###
|
||||
|
||||
Launch DeVeDe and choose Video DVD from the menu.
|
||||
|
||||

|
||||
|
||||
On the next screen, a title is automatically added to the collection by DeVeDe. You can edit its caption (1), add a file (2), and then add another title. Repeat this process as many times as needed.
|
||||
|
||||

|
||||
|
||||
The "Title properties" box allows you to choose between six actions to be performed when the current title ends. Click OK when you're done:
|
||||
|
||||

|
||||
|
||||
The "File properties" box is used to add a file to the current title. Click on the folder icon (upper right corner), and browse your computer for a desired file. You can also add a subtitle file by clicking the Add button right next to the subtitles box. Once you have selected a video file (and alternatively a subtitle file as well), click on OK at the bottom right corner.
|
||||
|
||||

|
||||
|
||||
You can add as many files as needed (only limited by the DVD capacity).
|
||||
|
||||

|
||||
|
||||
Next, edit the menu options. You can choose a background image and audio file to play while the main menu is displayed (which is as soon as the DVD is inserted into the player).
|
||||
|
||||

|
||||
|
||||
Finally, click on OK in the Menu options box to go back to the main disk structure, where you will need to click Forward in order to begin creating an .iso image with a video DVD structure.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
When DeVeDe is done creating a video DVD, we will be presented with the following box:
|
||||
|
||||

|
||||
|
||||
Now we can burn the .iso file (which contains a video DVD) to a disk, using [growisofs][5] or another DVD burning tool.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/create-video-dvd-linux-desktop.html
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.rastersoft.com/programas/devede.html
|
||||
[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
|
||||
[3]:http://ask.xmodulo.com/enable-nux-dextop-repository-centos-rhel.html
|
||||
[4]:http://xmodulo.com/how-to-install-rpm-fusion-on-fedora.html
|
||||
[5]:http://ask.xmodulo.com/burn-iso-nrg-image-dvd-command-line.html
|
||||
@@ -0,0 +1,89 @@
|
||||
johnhoow translating...
|
||||
pidstat - Monitor and Find Statistics for Linux Procesess
|
||||
================================================================================
|
||||
The **pidstat** command is used for monitoring individual tasks currently being managed by the Linux kernel. It writes to standard output activities for every task managed by the Linux kernel. The pidstat command can also be used for monitoring the child processes of selected tasks. The interval parameter specifies the amount of time in seconds between each report. A value of 0 (or no parameters at all) indicates that tasks statistics are to be reported for the time since system startup (boot).
|
||||
|
||||
### How to Install pidstat ###
|
||||
|
||||
pidstat is part of the sysstat suite that contains various system performance tools for Linux, it's available on the repository of most Linux distributions.
|
||||
|
||||
To install it on Debian / Ubuntu Linux systems you can use the following command:
|
||||
|
||||
# apt-get install sysstat
|
||||
|
||||
If you are using CentOS / Fedora / RHEL Linux you can install the packages like this:
|
||||
|
||||
# yum install sysstat
|
||||
|
||||
### Using pidstat ###
|
||||
|
||||
Running pidstat without any argument is equivalent to specifying -p ALL but only active tasks (tasks with non-zero statistics values) will appear in the report.
|
||||
|
||||
# pidstat
|
||||
|
||||

|
||||
|
||||
In the output you can see:
|
||||
|
||||
- **PID** - The identification number of the task being monitored.
|
||||
- **%usr** - Percentage of CPU used by the task while executing at the user level (application), with or without nice priority. Note that this field does NOT include time spent running a virtual processor.
|
||||
- **%system** - Percentage of CPU used by the task while executing at the system level.
|
||||
- **%guest** - Percentage of CPU spent by the task in virtual machine (running a virtual processor).
|
||||
- **%CPU** - Total percentage of CPU time used by the task. In an SMP environment, the task's CPU usage will be divided by the total number of CPU's if option -I has been entered on the command line.
|
||||
- **CPU** - Processor number to which the task is attached.
|
||||
- **Command** - The command name of the task.
|
||||
|
||||
### I/O Statistics ###
|
||||
|
||||
We can use pidstat to get I/O statistics about a process using the -d flag. For example:
|
||||
|
||||
# pidstat -d -p 8472
|
||||
|
||||

|
||||
|
||||
The IO output will display a few new columns:
|
||||
|
||||
- **kB_rd/s** - Number of kilobytes the task has caused to be read from disk per second.
|
||||
- **kB_wr/s** - Number of kilobytes the task has caused, or shall cause to be written to disk per second.
|
||||
- **kB_ccwr/s** - Number of kilobytes whose writing to disk has been cancelled by the task.
|
||||
|
||||
### Page faults and memory usage ###
|
||||
|
||||
Using the -r flag you can get information about memory usage and page faults.
|
||||
|
||||

|
||||
|
||||
Important columns:
|
||||
|
||||
- **minflt/s** - Total number of minor faults the task has made per second, those which have not required loading a memory page from disk.
|
||||
- **majflt/s** - Total number of major faults the task has made per second, those which have required loading a memory page from disk.
|
||||
- **VSZ** - Virtual Size: The virtual memory usage of entire task in kilobytes.
|
||||
- **RSS** - Resident Set Size: The non-swapped physical memory used by the task in kilobytes.
|
||||
|
||||
### Examples ###
|
||||
|
||||
**1.** You can use pidstat to find a memory leek using the following command:
|
||||
|
||||
# pidstat -r 2 5
|
||||
|
||||
This will give you 5 reports, one every 2 seconds, about the current page faults statistics, it should be easy to spot the problem process.
|
||||
|
||||
**2.** To show all children of the mysql server you can use the following command
|
||||
|
||||
# pidstat -T CHILD -C mysql
|
||||
|
||||
**3.** To combine all statistics in a single report you can use:
|
||||
|
||||
# pidstat -urd -h
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-command/linux-pidstat-monitor-statistics-procesess/
|
||||
|
||||
作者:[Adrian Dinu][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/adriand/
|
||||
@@ -0,0 +1,37 @@
|
||||
Ubuntu Unity 4岁了,生日快乐!
|
||||
================================================================================
|
||||
> Unity桌面环境在Ubuntu 10.04 Netbook Remix版本中加入,这是一个不再存在的版本。
|
||||
|
||||
**Canonical开发着以及Ubuntu社区这些天有一个很好的理由来庆祝,因为Unity桌面环境已经4岁了**
|
||||
|
||||
Unity是Ubuntu的默认桌面环境,并且已经有4年了,虽然这并不是发行版的桌面版本。它首次用于Ubuntu Netbook Remix,是专为笔记本使用的版本。实际上Ubuntu Netbook Remix 10.10 Maverick市场首次接受Unity桌面。
|
||||
|
||||
常规的Ubuntu 10.10 发行版桌面仍旧使用GNOME 2.x,这也是为什么有用户说10.10 仍是Canonical做的最好的版本。
|
||||
|
||||
### Unity 是没人想要的替代品 ###
|
||||
|
||||
Canonical决定用他们自己的软件替代GNOME 2.x桌面环境,但是它的设计对用户而言很陌生。一些人喜欢它,但是许多人并不这样并且还被不同的用户在他们决定放弃Ubuntu的时候还时不时地提到这个。
|
||||
|
||||
Unit设计视角上和GNOME不同,但是Ubuntu开发者并没有替换GNOME所有的包,并且还保留了很多(他们现在仍旧这样)。之前不喜欢Unity方向的Ubuntu的粉丝一定对GNOME 2.x被很快抛弃且被完全不同的同样引发相同质疑的GNOME 3.0替换感到很失望。
|
||||
|
||||
### 为什么Unity替换GNOME ###
|
||||
|
||||
回到还在Ubuntu 10.10 的时光,Canonical和GNOME团队习惯与非常紧密地一起工作,但是事情在Ubuntu变得越来越流行后发生了改变。其中一个驱使Canonical构建Unity的理由是GNOME团队的是叫不再和他们一致了。
|
||||
|
||||
用户在抱怨GMOME的问题或者他们想要特定的功能。Ubuntu团队会发给上游一些补丁,对于GNOME,它不会接受或者会花很长的时间去实现。在同时,Canonical和Ubuntu被一下额他们不能解决的问题受到了很多的批评,但是用户并不知道这些。
|
||||
|
||||
因此,一个与GNOME捆绑不太紧的桌面环境的需求变得非常清晰了。Unity最终在Ubuntu 11.10中引入。因此官方的发布日期是 2010年10月10日,这让Unity已经4岁了。
|
||||
|
||||
Unity还没有被全社区的拥抱,虽然有很多用户已经接受了这是一个有用且是一个生产桌面环境。虽然桌面的大修已经逾期了很久且势必会在一两年内完成,但是它在每个新的发行后都会获得了更多的支持和停留。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://news.softpedia.com/news/Ubuntu-s-Unity-Turns-4-Happy-Birthday--461840.shtml
|
||||
|
||||
作者:[Silviu Stahie][a]
|
||||
译者:[gekepi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://news.softpedia.com/editors/browse/silviu-stahie
|
||||
@@ -0,0 +1,87 @@
|
||||
为 Linux 用户准备的 10 个开源克隆软件
|
||||
================================================================================
|
||||
> 这些克隆软件会读取整个磁盘的数据,将它们转换成一个 .img 文件,之后你可以将它复制到其他硬盘上。
|
||||
|
||||

|
||||
|
||||
磁盘克隆意味着从一个硬盘复制数据到另一个硬盘上,而且你可以通过简单的复制粘贴来做到。但是你却不能复制隐藏文件和文件夹,以及正在使用中的文件。这便是一个克隆软件可以通过保存一份文件和文件夹的镜像来帮助你的地方。克隆软件会读取整个磁盘的数据,将它们转换成一个 .img 文件,之后你可以将它复制到其他硬盘上。现在我们将要向你介绍最优秀的 10 个开源的克隆软件:
|
||||
|
||||
### 1. [Clonezilla][1]:###
|
||||
|
||||
Clonezilla 是一个基于 Ubuntu 和 Debian 的 Live CD。它可以像 Windows 里的诺顿 Ghost 一样克隆你的磁盘数据和做备份,不过它更有效率。Clonezilla 支持包括 ext2、ext3、ext4、btrfs 和 xfs 在内的很多文件系统。它还支持 BIOS、UEFI、MBR 和 GPT 分区。
|
||||
|
||||

|
||||
|
||||
### 2. [Redo Backup][2]:###
|
||||
|
||||
Redo Backup 是另一个用来方便地克隆磁盘的 Live CD。它是自由和开源的软件,使用 GPL 3 许可协议授权。它的主要功能和特点包括从 CD 引导的简单易用的 GUI、无需安装,可以恢复 Linux 和 Windows 等系统、无需登陆访问文件,以及已删除的文件等。
|
||||
|
||||

|
||||
|
||||
### 3. [Mondo Rescue][3]:###
|
||||
|
||||
Mondo 和其他的软件不大一样,它并不将你的磁盘数据转换为一个 .img 文件,而是将它们转换为一个 .iso 镜像。使用 Mondo,你还可以使用“mindi”——一个由 Mondo Rescue 开发的特别工具——来创建一个自定义的 Live CD,这样你的数据就可以从 Live CD 克隆出来了。它支持大多数 Linux 发行版和 FreeBSD,并使用 GPL 许可协议授权。
|
||||
|
||||

|
||||
|
||||
### 4. [Partimage][4]:###
|
||||
|
||||
这是一个开源的备份软件,默认情况下在 Linux 系统里工作。在大多数发行版中,你都可以从发行版自带的软件包管理工具中安装。如果你没有 Linux 系统,你也可以使用“SystemRescueCd”。它是一个默认包括 Partimage 的 Live CD,可以为你完成备份工作。Partimage 在克隆硬盘方面的性能非常出色。
|
||||
|
||||

|
||||
|
||||
### 5. [FSArchiver][5]:###
|
||||
|
||||
FSArchiver 是 Partimage 的后续产品,而且它也是一个很好的硬盘克隆工具。它支持克隆 Ext4 和 NTFS 分区、基本的文件属性如所有人、权限、SELinux 之类的扩展属性,以及所有 Linux 文件系统的文件系统属性等。
|
||||
|
||||
### 6. [Partclone][6]:###
|
||||
|
||||
Partclone 是一个可以克隆和恢复分区的免费工具。它用 C 语言编写,最早在 2007 年出现,而且支持很多文件系统,包括:ext2、ext3、ext4、xfs、nfs、reiserfs、reiser4、hfs+、btrfs。它的使用十分简便,并且使用 GPL 许可协议授权。
|
||||
|
||||
### 7. [doClone][7]:###
|
||||
|
||||
doClone 是一个免费软件项目,被开发用于轻松地克隆 Linux 系统分区。它由 C++ 编写而成,支持多达 12 种不同的文件系统。它能够修复 Grub 引导器,还能通过局域网传输镜像到另一台计算机。它还提供了热同步功能,这意味着你可以在系统正在运行的时候对它进行克隆操作。
|
||||
|
||||

|
||||
|
||||
### 8. [Macrium Reflect 免费版][8]:###
|
||||
|
||||
Macrium Reflect 免费版被形容为最快的磁盘克隆工具之一,它只支持 Windows 文件系统。它有一个很直观的用户界面。该软件提供了磁盘镜像和克隆操作,还能让你在文件管理器中访问镜像。它允许你创建一个 Linux 应急 CD,并且它与 Windows Vista 和 Windows 7 兼容。
|
||||
|
||||

|
||||
|
||||
### 9. [DriveImage XML][9]:###
|
||||
|
||||
DriveImage XML 使用 Microsoft VSS 来创建镜像,十分可靠。使用这个软件,你可以从一个正在使用的磁盘创建“热”镜像。镜像使用 XML 文件保存,这意味着你可以从任何支持的第三方软件访问它们。DriveImage XML 还允许在不重启的情况下从镜像恢复到机器。这个软件与 Windows XP、Windows Server 2003、Vista 以及 7 兼容。
|
||||
|
||||

|
||||
|
||||
### 10. [Paragon Backup & Recovery 免费版][10]:###
|
||||
|
||||
Paragon Backup & Recovery 免费版在管理镜像计划任务方面十分出色。它是一个免费软件,但是仅能用于个人用途。
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.efytimes.com/e1/fullnews.asp?edid=148039
|
||||
|
||||
作者:Sanchari Banerjee
|
||||
译者:[felixonmars](https://github.com/felixonmars)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://clonezilla.org/
|
||||
[2]:http://redobackup.org/
|
||||
[3]:http://www.mondorescue.org/
|
||||
[4]:http://www.partimage.org/Main_Page
|
||||
[5]:http://www.fsarchiver.org/Main_Page
|
||||
[6]:http://www.partclone.org/
|
||||
[7]:http://doclone.nongnu.org/
|
||||
[8]:http://www.macrium.com/reflectfree.aspx
|
||||
[9]:http://www.runtime.org/driveimage-xml.htm
|
||||
[10]:http://www.paragon-software.com/home/br-free/
|
||||
@@ -0,0 +1,65 @@
|
||||
Linux用户应该了解一下开源硬件
|
||||
================================================================================
|
||||
> Linux用户不了解一点开源硬件制造相关的事情,他们将会很失望。
|
||||
|
||||
商业软件和免费软件已经互相纠缠很多年了,但是这俩经常误解对方。这并不奇怪 -- 对一方来说是生意,而另一方只是一种生活方式。但是,这种误解会给人带来痛苦,这也是为什么值得花精力去揭露这里面的内幕。
|
||||
|
||||
一个逐渐普遍的现象:对开源硬件的不断尝试,不管是Canonical,Jolla,MakePlayLive,或者其他几个。不管是评论员或终端用户,一般的免费软件用户会为新的硬件平台发布表现出过分的狂热,然后因为不断延期有所醒悟,最终放弃整个产品。
|
||||
|
||||
这是一个没有人获益的怪圈,而且滋生出不信任 - 都是因为一般的Linux用户根本不知道这些新闻背后发生的事情。
|
||||
|
||||
我个人对于把产品推向市场的经验很有限。但是,我还不知道谁能有所突破。推出一个开源硬件或其他产品到市场仍然不仅仅是个残酷的生意,而且严重不利于新加入的厂商。
|
||||
|
||||
### 寻找合作伙伴 ###
|
||||
|
||||
不管是数码产品的生产还是分销都被相对较少的一些公司控制着,有时需要数月的预订。利润率也会很低,所以就像那些购买古老情景喜剧的电影工作室一样,生成商一般也希望复制当前热销产品的成功。像Aaron Seigo在谈到他花精力开发Vivaldi平板时告诉我的,生产商更希望能由其他人去承担开发新产品的风险。
|
||||
|
||||
不仅如此,他们更希望和那些有现成销售记录的有可能带来可复制生意的人合作。
|
||||
|
||||
而且,一般新加入的厂商所关心的产品只有几千的量。芯片制造商更愿意和苹果或三星合作,因为它们的订单很可能是几百K。
|
||||
|
||||
面对这种情形,开源硬件制造者们可能会发现他们在工厂的列表中被淹没了,除非能找到二线或三线厂愿意尝试一下小批量生产新产品。
|
||||
|
||||
他们也许还会沦为采购成品组件再自己组装,就像Seigo尝试Vivaldi时那样做的。或者,他们也许可以像Canonical那样做,寻找一些愿意为这个产业冒险的合作伙伴。而就算他们成功了,一般也会比最初天真的预期延迟数个月。
|
||||
|
||||
### 磕磕碰碰走向市场 ###
|
||||
|
||||
然而,寻找生产商只是第一关。根据树莓派项目的经验,就算开源硬件制造者们只想在他们的产品上运行免费软件,生产商们很可能会以保护商业机密的名义坚持使用专有固件或驱动。
|
||||
|
||||
这样必然会引起潜在用户的批评,但是开源硬件制造者没得选,只能折中他们的愿景。寻找其他生产商也不能解决问题,有一个原因是这样做意味着更多延迟,但是更多的是因为完全免授权费的硬件是不存在的。像三星这样的业内巨头对免费硬件没有任何兴趣,而作为新人,开源硬件制造者也没有影响力去要求什么。
|
||||
|
||||
更何况,就算有免费硬件,生产商也不能保证会用在下一批生产中。制造者们会轻易地发现他们每次需要生产的时候都要重打一样的仗。
|
||||
|
||||
这些都还不够,这个时候开源硬件制造者们也许已经花了6-12个月时间来讨价还价。机会来了,产业标准已经变更,他们也许为了升级产品规格又要从头来过。
|
||||
|
||||
### 短暂而且残忍的货架期 ###
|
||||
|
||||
尽管面对这么多困难,一定程度上开放的硬件也终于推出了。还记得寻找生产商时的挑战吗?对于分销商也会有同样的问题 -- 还不只是一次,而是每个地区都要解决。
|
||||
|
||||
通常,分销商和生成商一样保守,对于和新人或新点子打交道也很谨慎。就算他们同意一个产品上架,他们也轻易能够决定不鼓励自己的销售代表们做推广,这意味着这个产品会在几个月后很有效率地下架。
|
||||
|
||||
当然,在线销售也是可以的。但是同时,硬件还是需要被存放在某个地方,这也会增加成本。而按需生产就算可能的话也将非常昂贵,而且没有组装的元件也需要存放。
|
||||
|
||||
### 衡量整件怪事 ###
|
||||
|
||||
在这里我只是粗略地概括了一下,但是任何涉足过制造的人会认出我形容成标准的东西。而更糟糕的是,开源硬件制造者们通常在这个过程中才会有所觉悟。不可避免,他们也会犯错,从而带来更多的延迟。
|
||||
|
||||
但重点是,一旦你对整个过程有所了解,你对另一个开源硬件进行尝试的消息的反应就会改变。这个过程意味着,除非哪家公司处于严格的保密模式,对于产品将于六个月内发布的声明会很快会被证实是过期的推测。很可能是12-18个月,而且面对之前提过的那些困难很可能意味着这个产品永远不会真正发布。
|
||||
|
||||
举个例子,就像我写的,人们等待第一代Steam Machines面世,它是一台基于Linux的游戏主机。他们相信Steam Machines能彻底改变Linux和游戏。
|
||||
|
||||
作为一个市场分类,Steam Machines也许比其他新产品更有优势,因为参与开发的人员至少有开发软件产品的经验。然而,整整一年过去了Steam Machines的开发成果都还只有原型机,而且直到2015年中都不一定能买到。面对硬件生产的实际情况,就算有一半能见到阳光都是很幸运了。而实际上,能发布2-4台也许更实际。
|
||||
|
||||
我做出这个预测并没有考虑个体努力。但是,对硬件生产的理解,比起那些Linux和游戏的黄金年代之类的预言,我估计这个更靠谱。如果我错了也会很开心,但是事实不会改变:让人吃惊的不是如此多的Linux相关硬件产品失败了,而是那些即使是短暂的成功的产品。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.datamation.com/open-source/what-linux-users-should-know-about-open-hardware-1.html
|
||||
|
||||
作者:[Bruce Byfield][a]
|
||||
译者:[zpl1025](https://github.com/zpl1025)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.datamation.com/author/Bruce-Byfield-6030.html
|
||||
@@ -1,6 +1,6 @@
|
||||
6个有趣的命令行工具(终端中的乐趣) - 第二部分
|
||||
6个有趣的Linux命令行工具(终端中的乐趣)—— 第二部分
|
||||
================================================================================
|
||||
在之前, 我们给出类一些有关有趣的 Linux 命令行命令的文章, 这些文章告诉我们, Linux 并不像看起来那样复杂, 如果我们知道如何使用的话, 反而会非常有趣. Linux 命令行可以简洁而完美地执行一些复杂的任务, 并且十分有趣.
|
||||
之前, 我们展示了一些有关有趣的 Linux 命令行命令的文章, 这些文章告诉我们, Linux 并不像看起来那样复杂, 如果我们知道如何使用的话, 反而会非常有趣. Linux 命令行可以简洁而完美地执行一些复杂的任务, 并且十分有趣.
|
||||
|
||||
- [Linux命令及Linux终端的20个趣事][3]
|
||||
- [Fun in Linux Terminal – Play with Word and Character Counts][2]
|
||||
@@ -8,32 +8,32 @@
|
||||

|
||||
有趣的 Linux 命令
|
||||
|
||||
之前的一篇文章包含了 20 个有趣的 Linux 命令/脚本(和子命令), 得到了读者的高度赞扬. 而另一篇文章则包含了一些处理文字文件, 单词和字符串的命令/脚本和改进, 虽然没有之前那篇文章那么受欢迎.
|
||||
前者包含了20个有趣的 Linux 命令/脚本(和子命令), 得到了读者的高度赞扬. 而另一篇文章虽然没有之前那篇文章那么受欢迎,包含了一些命令/脚本和改进,让你能够玩儿转文本文件、单词和字符串.
|
||||
|
||||
这篇文章介绍了一些新的有趣的命令和单行脚本.
|
||||
这篇文章介绍了一些新的有趣命令和单行脚本,一定会让你感到欣喜.
|
||||
|
||||
### 1. pv 命令 ###
|
||||
|
||||
你也许曾经看见电影里的模仿文字, 它们好像是被实时打出来的. 如果我么能在终端里实现这样的效果, 那不是很好?
|
||||
你也许曾经看到过电影里的模拟字幕, 它们好像是被实时敲打出来的. 如果我么能在终端里实现这样的效果, 那不是很好?
|
||||
|
||||
这是可以做到的. 我们可以安装通过 '**apt**' 或者 '**yum**' 工具在 Linux 系统上安装 '**pv**' 命令. 安装命令如下?
|
||||
这是可以做到的. 我们可以安装通过 '**apt**' 或者 '**yum**' 工具在 Linux 系统上安装 '**pv**' 命令. 安装命令如下.
|
||||
|
||||
# yum install pv [在基于 RedHat 的系统上]
|
||||
|
||||
# sudo apt-get install pv [在基于 Debian 的系统上]
|
||||
|
||||
'**pv**' 命令安装成功之后, 我们尝试输入下面的命令来在终端查看实时文字输出的效果.
|
||||
'**pv**' 命令安装成功之后, 我们尝试运行下面的单行命令在终端查看实时文字输出的效果.
|
||||
|
||||
$ echo "Tecmint[dot]com is a community of Linux Nerds and Geeks" | pv -qL 10
|
||||
|
||||

|
||||
正在运行的 pv 命令
|
||||
|
||||
**注意**: '**q**' 选项表示'安静'(没有其他输出信息), '**L**' 选项表示每秒转化的字节数上限. 数字变量(必须是整数)用来调整预设的文本模拟.(To be fixed: 这里翻译有问题)
|
||||
**注意**: '**q**' 选项表示'安静',没有其他输出信息, '**L**' 选项表示每秒转化的字节数上限. 数字变量可以调整任何一个方向(必须是整数) 来获得所需的模拟文本.
|
||||
|
||||
### 2. toilet 命令 ###
|
||||
|
||||
用单行命令 '**toilet**' 在终端里显示有边框的文字值一个不错的主意. 同样, 你必须保证 '**toilet**' 已经安装在你的电脑上. 如果没有的话, 请使用 apt 或 yum 安装. (译者注: 'toilet' 并不在 Fedora 的官方仓库里, 你可以从 github 上下载源代码来安装)
|
||||
用单行脚本命令 '**toilet**' 在终端里显示一个添加边框的文本怎么样呢?同样, 你必须保证 '**toilet**' 已经安装在你的电脑上. 如果没有的话, 请使用 apt 或 yum 安装. (译者注: 'toilet' 并不在 Fedora 的官方仓库里, 你可以从 github 上下载源代码来安装)
|
||||
|
||||
$ while true; do echo “$(date | toilet -f term -F border –Tecmint)”; sleep 1; done
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
### 4. aview 命令 ###
|
||||
|
||||
你认为在终端用 ASCII 格式显示图片怎么样? 我们必须用 apt 或 yum 安装软件包 '**aview**'. (译者注: 'avieww' 不在 Fedora 的官方仓库中, 可以从 aview 的[项目主页][4]上下载源代码来安装. ) 在当前文件夹下有一个名为 '**elephant.jpg**' 的图片, 我想用 ASCII 模式在终端查看.
|
||||
你觉得在终端用 ASCII 格式显示图片怎么样? 我们必须用 apt 或 yum 安装软件包 '**aview**'. (译者注: 'avieww' 不在 Fedora 的官方仓库中, 可以从 aview 的[项目主页][4]上下载源代码来安装. ) 在当前工作目录下有一个名为 '**elephant.jpg**' 的图片, 我想用 ASCII 模式在终端查看.
|
||||
|
||||
$ asciiview elephant.jpg -driver curses
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
### 5. xeyes 命令 ###
|
||||
|
||||
在上一篇文章中, 我们介绍了 '**oneko**' 命令, 它可以显示一个追随鼠标指针运动的小老鼠. '**xeyes**' 是一个类似的程序, 当你运行程序时, 你可以看见两个怪物的眼球追随鼠标的运动.
|
||||
在上一篇文章中, 我们介绍了 '**oneko**' 命令, 它可以显示一个追随鼠标指针运动的小老鼠. '**xeyes**' 是一个类似的图形程序, 当你运行它, 你可以看见小怪物的两个眼球追随你的鼠标运动.
|
||||
|
||||
$ xeyes
|
||||
|
||||
@@ -75,29 +75,29 @@
|
||||
|
||||
$ cowsay -l
|
||||
|
||||
蟒蛇吃大象怎么样?
|
||||
如何用ASCII描绘蛇吞象?
|
||||
|
||||
$ cowsay -f elephant-in-snake Tecmint is Best
|
||||
|
||||

|
||||
正在运行的 cowsay 命令
|
||||
|
||||
山羊怎么样?
|
||||
换作山羊又会怎样?
|
||||
|
||||
$ cowsay -f gnu Tecmint is Best
|
||||
|
||||

|
||||
正在运行的 山羊cowsay 命令
|
||||
|
||||
今天就到这里吧. 我将带着另一篇有趣的文章回来. 跟踪 Tecmint 来获得最新消息. 不要忘记在下面的评论里留下你的有价值的回复.
|
||||
今天就到这里吧. 我将带着另一篇有趣的文章回来. 不要忘记在下面留下您的评论.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/linux-funny-commands/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[wangjiezhe](https://github.com/wangjiezhe)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
你需要在你想要使用 NRPE 监控的每一台远程主机上安装 NRPE 服务。每一台远程主机上的 NRPE 服务守护进程将会与一台 Nagios 监控服务器进行通信。
|
||||
|
||||
取决于所在的平台, NRPE 服务所需要的软件包可以很容易地用 apt-get 或者 yum 来安装。对于 CentOS 来说,由于 NRPE 并不在 CentOS 的仓库中,我们需要[添加 Repoforge 仓库][3]。
|
||||
NRPE 服务所需要的软件包可以很容易地用 apt-get 或者 yum 来安装,取决于所在的平台。对于 CentOS 来说,由于 NRPE 并不在 CentOS 的仓库中,我们需要[添加 Repoforge 仓库][3]。
|
||||
|
||||
**对于 Debian、Ubuntu 或者 Linux Mint:**
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
#### 第三步:初始化 NRPE 服务 ####
|
||||
|
||||
对于基于 RedHat 的系统,NRPE 服务需要被添加为启动服务。
|
||||
对于基于 RedHat 的系统,NRPE 服务需要被添加为启动服务。
|
||||
|
||||
**对于 Debian、Ubuntu、Linux Mint:**
|
||||
|
||||
@@ -88,7 +88,7 @@ NRPE 守护进程的状态信息可以在系统日志中找到。对于基于 De
|
||||
|
||||
#### 第一步:安装 NRPE 插件 ####
|
||||
|
||||
当 Nagios 服务器运行在基于 Debian 的系统(Debian、Ubuntu 或者 Linux Mint)上时,需要的软件宝可以通过 apt-get 安装。
|
||||
当 Nagios 服务器运行在基于 Debian 的系统(Debian、Ubuntu 或者 Linux Mint)上时,需要的软件包可以通过 apt-get 安装。
|
||||
|
||||
# apt-get install nagios-nrpe-plugin
|
||||
|
||||
@@ -175,7 +175,7 @@ NRPE 守护进程的状态信息可以在系统日志中找到。对于基于 De
|
||||
|
||||
### 为 NRPE 配置自定义命令 ###
|
||||
|
||||
#### 远程服务器上的配置 ####
|
||||
#### 远程服务器上安装 ####
|
||||
|
||||
下面列出了一些可以用于 NRPE 的自定义命令。这些命令在远程服务器的 /etc/nagios/nrpe.cfg 文件中定义。
|
||||
|
||||
@@ -193,9 +193,9 @@ NRPE 守护进程的状态信息可以在系统日志中找到。对于基于 De
|
||||
## 当 process_ABC 的实例数量跌到 1 以下时严重警告 ##
|
||||
command[check_process_XYZ]=/usr/lib/nagios/plugins/check_procs -w 1: -c 1: -C process_XYZ
|
||||
|
||||
#### Nagios 监控服务器上的配置 ####
|
||||
#### Nagios 监控服务器上安装 ####
|
||||
|
||||
我们通过修改 Nagios 监控服务器里的服务定义来应用上面定义的自定义命令。服务定义可以写在所有服务被定义的地方(比如 /etc/nagios/objects/nrpe.cfg 或 /etc/nagios3/conf.d/nrpe.cfg)
|
||||
我们通过如下命令来修改 Nagios 监控服务器里的服务定义来应用上面定义的自定义命令。服务定义可以写在所有服务被定义的地方(比如 /etc/nagios/objects/nrpe.cfg 或 /etc/nagios3/conf.d/nrpe.cfg)
|
||||
|
||||
## 示例 1:检查进程 XYZ ##
|
||||
define service {
|
||||
@@ -215,7 +215,7 @@ NRPE 守护进程的状态信息可以在系统日志中找到。对于基于 De
|
||||
use generic-service
|
||||
}
|
||||
|
||||
总而言之,NRPE 是 Nagios 的一个强大的扩展,它提供了高度可定制的远程服务器监控方案。使用 NRPE,我们可以监控系统的负载、运行的进程、已登录的用户、磁盘状态,以及其它的指标。
|
||||
总而言之,NRPE 是 Nagios 的一个强大的扩展,它提供了高度可定制的远程服务器监控方案。使用 NRPE,我们可以监控系统的负载、运行的进程、已登录的用户、磁盘状态,以及其它参数。
|
||||
|
||||
希望这些可以帮到你。
|
||||
|
||||
@@ -225,7 +225,7 @@ via: http://xmodulo.com/2014/03/nagios-remote-plugin-executor-nrpe-linux.html
|
||||
|
||||
作者:[Sarmed Rahman][a]
|
||||
译者:[felixonmars](https://github.com/felixonmars)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
# Peer Code Review的实战经验 #
|
||||
|
||||
(译者:Code Review中文可以翻译成代码复查,一般由开发待review的代码的成员以外的团队成员来进行这样的工作。由于是专业术语,没有将Code review用中文代替。)
|
||||
|
||||
我有时候会听到我们的团队成员这样议论:
|
||||
|
||||
"项目的Code review 只是浪费时间。"
|
||||
"我没有时间做Code review。"
|
||||
"我的发布时间延迟了,因为我的同时还没有完成我代码的Code review。"
|
||||
"你相信我的同事居然要求我对我的代码做修改吗?请跟他们说代码中的一些联系会被打断如果在我原来代码的基础之上做修改的话。"
|
||||
|
||||
### 为什么要做Code review? ###
|
||||
|
||||
每个专业软件开发者都有一个重要的目标:持续的提高它们的工作质量。即使你团队中都是一些优秀的程序员,你依然不能将你自己与一个有能力的自由职业者区分开来,除非你从团队的角度来工作。Code review是团队工作的一个重要的方面。尤其是:
|
||||
|
||||
代码复查者(reviewer)能从他们的角度来发现问题并且提出更好的解决方案。
|
||||
|
||||
确保至少你团队的另一个其他成员熟悉你的代码,通过给新员工看有经验的开发者的代码能够某种程度上提高他们的水平。
|
||||
|
||||
公开code reviewer和reviewee的想法和经验能够促进团队间的知识的分享。
|
||||
|
||||
能够鼓励开发者将他们的工作进行的更彻底,因为他们知道他们的代码将被其他的人阅读。
|
||||
|
||||
### 在review的过程中的注意点 ###
|
||||
|
||||
但是,由于Code review的时间有限,上面所说的目标未必能全部达到。就算只是想要打一个补丁,都要确保意图是正确的。如果只是将变量名改成骆驼拼写法(camelCase),不算是code review。在开发过程中进行结对编程是有益处的,它能够使两个人得到公平的锻炼。你能够在code review上花许多时间,并且仍然能够比在结对编程中使用更少的时间。
|
||||
|
||||
我的感受是,在项目开发的过程中,25%的时间应该花费在code review上。也就是说,如果开发者用两天的时间来开发一个东西,那么复查者应该使用至少四个小时来审查。
|
||||
|
||||
当然,只要你的review结果准确的话,具体花了多少时间就显得不是那么的重要。重要的是,你能够理解你看的那些代码。这里的理解并不是指你看懂了这些代码书写的语法,而是你要知道这段代码在整个庞大的应用程序,组件或者库中起着什么样的作用。如果你不理解每一行代码的作用,那么换句话说,你的code review就是没有价值的。这就是为什么好的code review不能很快完成的原因。需要时间来探讨各种各样的代码路径,让它们触发一个特定的函数,来确保第三方的API得到了正确的使用(包括一些边缘测试)。
|
||||
|
||||
为了查阅你所审查的代码的缺陷或者是其他问题,你应该确保:
|
||||
|
||||
所有有必要的测试都已经被包含进去。
|
||||
|
||||
合理的设计文档已经被编写。
|
||||
|
||||
再熟练的开发者也不是每次都会记得在他们对代码改动的时候把测试程序和文档更新上去。来自reviewer的一个提醒能够使得测试用例和开发文档不会一直忘了更新。
|
||||
|
||||
### 避免code review负担太大 ###
|
||||
|
||||
如果你的团队没有强制性的code review,当你的code review记录停留在无法管理的节点上时会很危险。如果你已经两周没有进行code review了,你可以花几天的时间来跟上项目的进度。这意味着你自己的开发工作会被阻断,当你想要处理之前遗留下来的code review的时候。这也会使得你很难再确保code review的质量,因为合理的code review需要长期认真的努力。最终会很难持续几天都保持这样的状态。
|
||||
|
||||
由于这个原因,开发者应当每天都完成他们的review任务。一种好办法就是将code review作为你每天的第一件事。在你开始自己的开发工作之前完成所有的code review工作,能够使你从头到尾都集中注意力。有些人可能更喜欢在午休前或午休后或者在傍晚下班前做review。无论你在哪个时间做,都要将code review看作你的工作之一并且不能分心,你要避免:
|
||||
|
||||
没有足够的时间来处理你的review任务。
|
||||
|
||||
由于你的code review工作没有做完导致版本的推迟发布。
|
||||
|
||||
提交不在相关的review由于代码在你review期间已经改动太大。
|
||||
|
||||
因为你要在最后一分钟完成他们一直于review质量太差。
|
||||
|
||||
### 书写易于review的代码 ###
|
||||
|
||||
有时候review没有按时完成并不都是因为代码审查者(reviewer)。如果我的同事使用一周时间在一个大工程中添加了一些乱七八糟的代码,且他们提交的补丁实在是太难以阅读。在一段中有太多的东西要浏览。这样会让人难以理解它的作用,自然会拖慢review的进度。
|
||||
|
||||
为什么将你的工作划分成一些易于管理的片段很重要有很多原因。我们使用scrum方法论(一种软件开发过程方法),因此对我们来说一个合理的单元就是一个story。通过努力将我们的工作使用story组织起来并且只是将review提交到我们正在工作的story上,这样,我们写的代码就会更加易于review。你们的可以使用其他的软件开发方法,但是目的是一样的。
|
||||
|
||||
书写易于review的代码还有其他先决条件。如果要做一些复杂的架构决策,应该让reviewer事先知道并参与讨论。这会让他们之后review你们的代码更加容易,因为他们知道你们正在试图实现什么功能并且知道你们打算如何来实现。这也避免了开发者需要在reviewer提了一个不同的或者更好的解决方案后大片的重写代码。
|
||||
|
||||
项目需要应当在设计文档中详细的描述。这对于一个项目新成员想要快速上手并且理解现有的代码来说非常重要。这从长远角度对于一个reviewer来说也非常有好处。单元测试也有助于reviewer知道一些组件是怎么使用的。
|
||||
|
||||
如果你在你的补丁中包含的第三方的代码,记得单独的提交它。当jQuery的9000行代码被插入到了项目代码的中间,毫无疑问会造成难以阅读。
|
||||
|
||||
创建易读的review代码的另一个非常重要的措施是添加相应的注释代码。这就要求你事先自己做一下review并且在一些你认为会帮助reviewer进行review的地方加上相应的注释。我发现加上注释相对与你来说往往只需要很短的时间(通常是几分钟),但是对于review来说会节约很多的时间。当然,代码注释还有其他相似的好处,应该在合理的地方使用,但往往对code review来说更重要。事实上,有研究表明,开发者在重读并注释他们代码的过程中,通常会发现很多问题。
|
||||
|
||||
### 代码大范围重构的情况 ###
|
||||
|
||||
有时候,有必要重构一段代码使其能够作用于多个其他组件。若是一个大型的应用要这样做,会花费几天甚至是更多的时间,结果是生成一个诺大的补丁包。在这种情况下,进行一个标准的code review可能是不切实际的。
|
||||
|
||||
最好的方法是增量重构你的代码。找出合理范围内的一部分改变,以此为基础来重构。一旦修改和review完成,进入第二个增量。以此类推,直到整个重构完成。这种方法可能不是在所有的情况下都可行,但是尽管如此,也能避免在重构时出现大量的单片补丁。开发者使用这种方式重构可能会花去更多的时间,但这也使得代码质量更高并且之后的review会更简单。
|
||||
|
||||
如果实在是没有条件去通过增量方式重构代码(有人可能会说之前的代码书写并组织的是多么的好),一种解决方案是在重构时进行结对编程来代替code review。
|
||||
|
||||
### 解决团队成员之间的纠纷 ###
|
||||
|
||||
你的团队中都是一些有能力的专家,在一些案例中,完全有可能因为对一个具体编码问题的意见的不同而产生争论。作为一个开发者,应该保持一个开发的头脑并且时刻准备着妥协,当你的reviewer更想要另一种解决方法时。不要对你的代码持有专有的态度,也不要自己持有审查的意见。因为有人会觉得你应该将一些重复的代码写入一个能够复用的函数中去,这并不意味着这是你的问题。
|
||||
|
||||
作为一个reviewer,要灵活。在提出修改建议之前,考虑你的建议是否真的更好或者只是无关紧要。如果你把力气和注意力花在那些原来的代码会明确需要改进的地方会更加成功。你应该说"它或许者的考虑..."或者"一些人建议..."而不是”我的宠物都能写一个比这个更加有效的排序方法"。
|
||||
|
||||
如果你真的决定不了,那就询问另一个你和你的reviewee都尊敬的开发者来听一下你意见并给出建议。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://blog.salsitasoft.com/practical-lessons-in-peer-code-review/
|
||||
作者:[Matt][a]
|
||||
译者:[john](https://github.com/johnhoow)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
如何加速Debian或Ubuntu上缓慢的apt-get安装
|
||||
===
|
||||
|
||||
如果你在Debian或Ubuntu系统上经常感觉到**apt-get** 或 **aptitude**包安装速度过慢,那么这里就有几种改善这一情况的方法。你有没有考虑过改变正被使用的默认镜像站点?你有没有排除因特网连接的上游带宽成为瓶颈的可能?
|
||||
|
||||
没有别的,你可以尝试第三个选择:使用[apt-fast][1]工具。apt-fast实际上是一个围绕apt-get和aptitude所写的shell脚本容器,它能过加速包的下载速度。apt-fast本质上采用[aria2][2]下载工具,这款工具能够以“块”的方式从多个镜像并行下载一个文件(就像BitTorrent下载)。
|
||||
|
||||
### 在Debian或Ubuntu上安装apt-fast
|
||||
|
||||
下面是在基于Debian的Linux上安装apt-fast的步骤
|
||||
|
||||
### Debian ###
|
||||
|
||||
$ sudo apt-get install aria2
|
||||
$ wget https://github.com/ilikenwf/apt-fast/archive/master.zip
|
||||
$ unzip master.zip
|
||||
$ cd apt-fast-master
|
||||
$ sudo cp apt-fast /usr/bin
|
||||
$ sudo cp apt-fast.conf /etc
|
||||
$ sudo cp ./man/apt-fast.8 /usr/share/man/man8
|
||||
$ sudo gzip /usr/share/man/man8/apt-fast.8
|
||||
$ sudo cp ./man/apt-fast.conf.5 /usr/share/man/man5
|
||||
$ sudo gzip /usr/share/man/man5/apt-fast.conf.5
|
||||
|
||||
### Ubuntu 14.04 以及更高版本 ###
|
||||
|
||||
$ sudo add-apt-repository ppa:saiarcot895/myppa
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install apt-fast
|
||||
|
||||
### Ubuntu 11.04 到 Ubuntu 13.10 ###
|
||||
|
||||
$ sudo add-apt-repository ppa:apt-fast/stable
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install apt-fast
|
||||
|
||||
在安装期间,你需要选择一个默认的软件包管理器 (e.g., apt-get. aptitude ),还需要设置其余选项。但是你可以随时通过编辑配置文件 /etc/apt-fast/conf 来更改设置。
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 配置 apt-get ###
|
||||
|
||||
安装完成后,你需要在/etc/apt-fast.conf里配置**apt-fast**使用的一系列镜像。
|
||||
|
||||
你可以在下面的URL中找到一系列Debian/Ubuntu镜像。
|
||||
|
||||
- **Debian**: [http://www.debian.org/mirror/list][3]
|
||||
- **Ubuntu**: [https://launchpad.net/ubuntu/+archivemirrors][4]
|
||||
|
||||
选择完那些地理上靠近你的镜像后,你需按照下面的格式将选择的镜像加入到/etc/apt-fast.conf。
|
||||
|
||||
$ sudo vi /etc/apt-fast.conf
|
||||
|
||||
Debian:
|
||||
|
||||
MIRRORS=('http://ftp.us.debian.org/debian/,http://carroll.aset.psu.edu/pub/linux/distributions/debian/,http://debian.gtisc.gatech.edu/debian/,http://debian.lcs.mit.edu/debian/,http://mirror.cc.columbia.edu/debian/')
|
||||
|
||||
Ubuntu/Mint:
|
||||
|
||||
MIRRORS=('http://us.archive.ubuntu.com/ubuntu,http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/,http://mirror.cc.vt.edu/pub2/ubuntu/,http://mirror.umd.edu/ubuntu/,http://mirrors.mit.edu/ubuntu/')
|
||||
|
||||
如上面所示,对于一个特定档案的个别镜像,需要用逗号分割开来。你需要在/etc/apt/sources.list的MIRRORS字符串中包含默认的镜像指定站点。
|
||||
|
||||
### 使用apt-fast安装一个包 ###
|
||||
|
||||
现在你就可以测试apt-fast的强大了。下面是使用**apt-fast**的示例:
|
||||
|
||||
apt-fast [apt-get options and arguments]
|
||||
apt-fast [aptitude options and arguments]
|
||||
apt-fast { { install | upgrade | dist-upgrade | build-dep | download | source } [ -y | --yes | --assume-yes | --assume-no ] ... | clean }
|
||||
|
||||
使用**apt-fast**安装包:
|
||||
|
||||
$ sudo apt-fast install texlive-full
|
||||
|
||||
在当前目录下载软件包,但不安装:
|
||||
|
||||
$ sudo apt-fast download texlive-full
|
||||
|
||||

|
||||
|
||||
如前面所示,apt-fast的并行下载是通过aria2完成的。你可以从下面多个镜像验证并行下载。
|
||||
|
||||
$ sudo netstat -nap | grep aria2c
|
||||
|
||||

|
||||
|
||||
请注意,**apt-fast**并没有加速"apt-get update"。并行下载只在"install", "upgrade", "dist-upgrage"和"build-dep"操作中触发。其余的操作,apt-fast就会简单地回到默认的包管理器apt-get或aptitude。
|
||||
|
||||
### apt-fast有多快? ###
|
||||
|
||||
为了比较apt-fast和apt-get,我尝试在两个相同的Ubuntu实例上使用两种方法安装几个软件包。下面的图表展示了所有软件包安装的时间(单位为秒)。
|
||||
|
||||

|
||||
|
||||
正如你所见到的,**apt-fast**实质上比**apt-get**快(e.g. 快3--4秒),特别是安装庞大软件包的时候。
|
||||
|
||||
当然,安装性能的提高程度还依赖你上游因特网连通性。以我为例,我有富足的带宽来支持我的上游连接。这也是为什么我看到并行下载带来了成功的提高。
|
||||
|
||||
---
|
||||
|
||||
via: http://xmodulo.com/speed-slow-apt-get-install-debian-ubuntu.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[su-kaiyao](https://github.com/su-kaiyao)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
||||
[1]:https://github.com/ilikenwf/apt-fast
|
||||
[2]:http://aria2.sourceforge.net/
|
||||
[3]:http://www.debian.org/mirror/list
|
||||
[4]:https://launchpad.net/ubuntu/+archivemirrors
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
在Github和Git上fork之简单指南
|
||||
===
|
||||
|
||||
以我的经验来看,刚接触Git和GitHub时,最困扰的一件事情就是尝试解决下面的问题:**在Git和GitHub上,我能做什么?**
|
||||
|
||||
Git教程往往不会解决这个问题,因为它集中篇幅来教你Git命令和概念,并且不认为你会使用GitHub。[GitHub帮助教程](https://help.github.com/)一定程度上弥补了这一缺陷,但是它每篇文章的关注点都较为狭隘,而且没有提供关于"Git vs GitHub"问题的概念性概述。
|
||||
|
||||
**如果你是习惯于先理解概念,再着手代码的学习者**,而且你也是Git和GitHub的初学者,我建议你先理解清楚什么是fork,为什么?
|
||||
|
||||
1. Fork是在GitHub起步最普遍的方式。
|
||||
2. Fork只需要很少的Git命令,但是起得作用却非常大。
|
||||
3. Fork提供了对Git和GitHub最基础的了解,有益于你之后的工作。
|
||||
|
||||
**本篇指南使用两张简单的图表,来教会你fork的两种主要工作流程。**我并不打算涉及任何代码,但是在结论中,我会把你需要使用的代码的链接给你。
|
||||
|
||||
### fork并且更新一个仓库
|
||||
|
||||
现在有这样一种情形:有一个叫做Joe的程序猿写了一个游戏程序,而你可能要去改进它。并且Joe将他的代码放在了GitHub仓库上。下面是你要做的事情:
|
||||
|
||||

|
||||
|
||||
**fork并且更新GitHub仓库的图表演示**
|
||||
|
||||
1. **Fork他的仓库**:这是GitHub操作,这个操作会复制Joe的仓库(包括文件,提交历史,issues,和其余一些东西)。复制后的仓库在你自己的GitHub帐号下。目前,你本地计算机对这个仓库没有任何操作。
|
||||
|
||||
2. **Clone你的仓库**:这是Git操作。使用该操作让你发送"请给我发一份我仓库的复制文件"的命令给GitHub。现在这个仓库就会存储在你本地计算机上。
|
||||
|
||||
3. **更新某些文件**:现在,你可以在任何程序或者环境下更新仓库里的文件。
|
||||
|
||||
4. **提交你的更改**:这是Git操作。使用该操作让你发送"记录我的更改"的命令至GitHub。此操作只在你的本地计算机上完成。
|
||||
|
||||
5. **将你的更改push到你的GitHub仓库**:这是Git操作。使用该操作让你发送"这是我的修改"的信息给GitHub。Push操作不会自动完成,所以直到你做了push操作,GitHub才知道你的提交。
|
||||
|
||||
6. **给Joe发送一个pull request**:如果你认为Joe会接受你的修改,你就可以给他发送一个pull request。这是GitHub操作,使用此操作可以帮助你和Joe交流你的修改,并且询问Joe是否愿意接受你的"pull request",当然,接不接受完全取决于他自己。
|
||||
|
||||
如果Joe接受了你的pull request,他将把那些修改拉到自己的仓库。胜利!
|
||||
|
||||
### 同步一个fork
|
||||
|
||||
Joe和其余贡献者已经对这个项目做了一些修改,而你将在他们的修改的基础上,还要再做一些修改。在你开始之前,你最好"同步你的fork",以确保在最新的复制版本里工作。下面是你要做的:
|
||||
|
||||

|
||||
|
||||
*同步GitHub fork的图表示意图*
|
||||
|
||||
1. **从Joe的仓库中取出那些变化的文件**:这是Git操作,使用该命令让你可以从Joe的仓库获取最新的文件。
|
||||
|
||||
2. **将这些修改合并到你自己的仓库**:这是Git操作,使用该命令使得那些修改更新到你的本地计算机(那些修改暂时存放在一个"分支"中)。记住:步骤1和2经常结合为一个命令使用,合并后的Git命令叫做"pull"。
|
||||
|
||||
3. **将那些修改更新推送到你的GitHub仓库**(可选):记住,你本地计算机不会自动更新你的GitHub仓库。所以,唯一更新GitHub仓库的办法就是将那些修改推送上去。你可以在步骤2完成后立即执行push,也可以等到你做了自己的一些修改,并已经本地提交后再执行推送操作。
|
||||
|
||||
**比较一下fork和同步工作流程的区别**:当你最初fork一个仓库的时候,信息的流向是从Joe的仓库到你的仓库,然后再到你本地计算机。但是最初的过程之后,信息的流向是从Joe的仓库到你的本地计算机,之后再到你的仓库。
|
||||
|
||||
### 结论
|
||||
|
||||
我希望这是一篇关于GitHub和Git [fork](https://help.github.com/articles/fork-a-repo)有用概述。现在,你已经理解了那些概念,你将会更容易地在实际中执行你的代码。GitHub关于fork和[同步](https://help.github.com/articles/syncing-a-fork)的文章将会给你大部分你需要的代码。
|
||||
|
||||
如果你是Git的初学者,而且你很喜欢这种学习方式,那么我极力推荐书籍[Pro Git](http://git-scm.com/book)的前两个章节,网上是可以免费查阅的。
|
||||
|
||||
如果你喜欢视频学习,我创建了一个[11部分的视频系列](http://www.dataschool.io/git-and-github-videos-for-beginners/)(总共36分钟),来向初学者介绍Git和GitHub。
|
||||
|
||||
---
|
||||
|
||||
译者:[su-kaiyao](https://github.com/su-kaiyao)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
@@ -0,0 +1,145 @@
|
||||
使用条块化I/O管理多个逻辑卷管理磁盘
|
||||
================================================================================
|
||||
在本文中,我们将了解逻辑卷是如何通过条块化I/O来写入数据到磁盘的。逻辑卷管理的酷炫特性之一,就是它能通过条块化I/O跨多个磁盘写入数据。
|
||||
|
||||

|
||||
使用条块化I/O管理LVM磁盘
|
||||
|
||||
|
||||
### LVM条块化是什么? ###
|
||||
|
||||
**LVM条块化**是LVM功能之一,该技术会跨多个磁盘写入数据,而不是对单一物理卷持续写入。
|
||||
|
||||
#### 条块化特性 ####
|
||||
|
||||
- 它会改善磁盘性能。
|
||||
- 挽救对单一磁盘的重复硬写入。
|
||||
- 使用对多个磁盘的条块化写入,可以减少磁盘填满的几率。
|
||||
|
||||
在逻辑卷管理中,如果我们需要创建一个逻辑卷,扩展的卷会完全映射到卷组和物理卷。在此种情形中,如果其中一个**PV**(物理卷)被填满,我们需要从其它物理卷中添加更多扩展。这样,添加更多扩展到PV中后,我们可以指定逻辑卷使用特定的物理卷写入I/O。
|
||||
|
||||
假设我们又**四个磁盘**驱动器,分别指向了四个物理卷,如果各个物理卷总计可以达到**100 I/O**,我们卷组就可以获得**400 I/O**。
|
||||
|
||||
如果我们不使用**条块化方法**,文件系统将横跨基础物理卷写入。例如,写入一些数据到物理卷达到100 I/O,这些数据只会写入到第一个PV(**sdb1**)。如果我们在写入时使用条块化选项创建逻辑卷,它会分割100 I/O分别写入到四个驱动器中,这就是说每个驱动器中都会接收到25 I/O。
|
||||
|
||||
这会在循环过程中完成。如果这些逻辑卷其中任何一个需要扩展,在这种情形下,我们不能添加1个或2个PV,必须添加所有4个pv来扩展逻辑卷大小。这是条块化特性的缺点之一,从中我们可以知道,在创建逻辑卷时,我们需要为所有逻辑卷分配相同的条块大小。
|
||||
|
||||
逻辑卷管理有着这些特性,它使我们能够同时在多个pv中条块化数据。如果你对逻辑卷熟悉,你可以去设置逻辑卷条块化。反之,你则必须了解逻辑卷管理的基础知识了,请阅读更基础的文章来了解逻辑卷管理。
|
||||
|
||||
#### 我的服务器设置 ####
|
||||
|
||||
这里,我使用**CentOS6.5**用作练习。下面这些步骤也适用于RHEL、Oracle Linux以及大多数发行版。
|
||||
|
||||
操作系统: CentOS 6.5
|
||||
IP地址: 192.168.0.222
|
||||
主机名: tecmint.storage.com
|
||||
|
||||
### 条块化I/O的逻辑卷管理 ###
|
||||
|
||||
出于演示目的,我已经准备了4个硬盘驱动器,每个驱动器1GB大小。让我用下面的‘**fdisk**’命令来列给你看看吧。
|
||||
|
||||
# fdisk -l | grep sd
|
||||
|
||||

|
||||
列出硬盘驱动器
|
||||
|
||||
现在,我们必须为这4个硬盘驱动器**sdb**,**sdc**,**sdd**和**sde**创建分区,我们将用‘**fdisk**’命令来完成该工作。要创建分区,请遵从本文**第一部分**中**步骤#4**的说明,并在创建分区时确保你已将类型修改为**LVM(8e)**。
|
||||
|
||||
# pvcreate /dev/sd[b-e]1 -v
|
||||
|
||||

|
||||
在LVM中创建物理卷
|
||||
|
||||
PV创建完成后,你可以使用‘**pvs**’命令将它们列出来。
|
||||
|
||||
# pvs
|
||||
|
||||

|
||||
验证物理卷
|
||||
|
||||
现在,我们需要使用这4个物理卷来定义卷组。这里,我定义了一个物理扩展大小(PE)为**16MB**,名为**vg_strip**的卷组。
|
||||
|
||||
# vgcreate -s 16M vg_strip /dev/sd[b-e]1 -v
|
||||
|
||||
上面命令中选项的说明。
|
||||
- **[b-e]1** – 定义硬盘驱动器名称,如sdb1,sdc1,sdd1,sde1。
|
||||
- **-s** – 定义物理扩展大小。
|
||||
- **-v** – 详情。
|
||||
|
||||
接下来,验证新创建的卷组:
|
||||
|
||||
# vgs vg_strip
|
||||
|
||||

|
||||
验证卷组
|
||||
|
||||
要获取VG更详细的信息,可以在**vgdisplay**命令中使用‘-v’选项,它将给出**vg_strip**卷组中所使用的全部物理卷的详细情况。
|
||||
|
||||
# vgdisplay vg_strip -v
|
||||
|
||||

|
||||
卷组信息
|
||||
|
||||
回到我们的话题,现在在创建逻辑卷时,我们需要定义条块化值,就是数据需要如何使用条块化方法来写入到我们的逻辑卷中。
|
||||
|
||||
这里,我创建了一个名为**lv_tecmint-strp1**,大小为**900MB**的逻辑卷,它需要放到**vg_strip**卷组中。我定义了4个条块,就是说数据在写入到我的逻辑卷时,需要条块化分散到4个PV中。
|
||||
|
||||
# lvcreate -L 900M -n lv_tecmint_strp1 -i4 vg_strip
|
||||
|
||||
- **-L** –逻辑卷大小
|
||||
- **-n** –逻辑卷名称
|
||||
- **-i** –条块化
|
||||
|
||||

|
||||
创建逻辑卷
|
||||
|
||||
在上面的图片中,我们可以看到条块尺寸的默认大小为**64 KB**,如果我们需要自定义条块值,我们可以使用**-I**(大写I)。要确认逻辑卷已经是否已经创建,请使用以下命令。
|
||||
|
||||
# lvdisplay vg_strip/lv_tecmint_strp1
|
||||
|
||||

|
||||
确认逻辑卷
|
||||
|
||||
现在,接下来的问题是,我们怎样才能知道条块被写入到了4个驱动器。这里,我们可以使用‘**lvdisplay**’和**-m**(显示逻辑卷映射)命令来验证。
|
||||
|
||||
# lvdisplay vg_strip/lv_tecmint_strp1 -m
|
||||
|
||||

|
||||
检查逻辑卷
|
||||
|
||||
要创建自定义的条块尺寸,我们需要用我们自定义的条块大小**256KB**来创建一个**1GB**大小的逻辑卷。现在,我打算将条块分布到3个PV上。这里,我们可以定义我们想要哪些pv条块化。
|
||||
|
||||
# lvcreate -L 1G -i3 -I 256 -n lv_tecmint_strp2 vg_strip /dev/sdb1 /dev/sdc1 /dev/sdd1
|
||||
|
||||

|
||||
定义条块大小
|
||||
|
||||
接下来,检查条块大小和条块化的卷。
|
||||
|
||||
# lvdisplay vg_strip/lv_tecmint_strp2 -m
|
||||
|
||||

|
||||
检查条块大小
|
||||
|
||||
是时候使用设备映射了,我们使用‘**dmsetup**’命令来完成这项工作。它是一个低级别的逻辑卷管理工具,它用于管理使用了设备映射驱动的逻辑设备。
|
||||
|
||||
# dmsetup deps /dev/vg_strip/lv_tecmint_strp[1-2]
|
||||
|
||||

|
||||
设备映射
|
||||
|
||||
这里,我们可以看到strp1依赖于4个驱动器,strp2依赖于3个设备。
|
||||
|
||||
希望你已经明白,我们怎样能让逻辑卷条块化来写入数据。对于此项设置,必须掌握逻辑卷管理基础知识。在我的下一篇文章中,我将给大家展示怎样在逻辑卷管理中迁移数据。到那时,请静候更新。同时,别忘了对本文提出有价值的建议。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/manage-multiple-lvm-disks-using-striping-io/
|
||||
|
||||
作者:[Babin Lonston][a]
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/babinlonston/
|
||||
@@ -0,0 +1,197 @@
|
||||
迁移LVM分区到新的逻辑卷(驱动器)——第六部分
|
||||
================================================================================
|
||||
|
||||
这是我们正在开展的逻辑卷管理系列的第六部分。在本文中,我们将为大家展示怎样来在线将现存的逻辑卷迁移到其它新的驱动器。在开始之前,我想要先来介绍一下LVM迁移及其特性。
|
||||
|
||||

|
||||
LVM存储迁移
|
||||
|
||||
|
||||
### 什么是LVM迁移? ###
|
||||
|
||||
**LVM**迁移是LVM众多优秀特性之一,通过它,我们可以迁移逻辑卷到一个新的磁盘而不会丢失数据,也不用关机操作。该特性的功能是将数据从旧磁盘移动到新磁盘。通常,我们只是在一些磁盘发生错误时,才将数据从一个磁盘迁移到另外一个磁盘存储。
|
||||
|
||||
### 迁移特性 ###
|
||||
|
||||
- 将逻辑卷从一个磁盘移动到另一个磁盘。
|
||||
- 我们可以使用任何类型的磁盘,如SATA、SSD、SAS、SAN storage iSCSI或者FC。
|
||||
- 在线迁移磁盘,而且数据不会丢失。
|
||||
|
||||
在LVM迁移中,我们将交换各个卷、文件系统以及位于现存存储中的数据。例如,如果我们有一个单一逻辑卷,它已经映射到了物理卷,而该物理卷是一个物理硬盘驱动器。
|
||||
|
||||
现在,如果我们需要升级服务器存储为SSD硬盘驱动器,我们首先需要考虑什么?重新格式化磁盘?不!我们不必重新格式化服务器,LVM可以选择将这些旧的SATA驱动器上的数据迁移到新的SSD驱动器上。在线迁移将会支持任何类型的磁盘,不管是本地驱动器,还是SAN或者光纤通道都可以。
|
||||
|
||||
#### 我的服务器设置 ####
|
||||
|
||||
操作系统: CentOS 6.5 Final
|
||||
IP地址: 192.168.0.224
|
||||
系统主机名: lvmmig.tecmintlocal.com
|
||||
|
||||
### 步骤1: 检查当前驱动器 ###
|
||||
|
||||
**1.**假设我们已经有一个名为“**vdb**”的虚拟驱动器,它已经被映射到了其中一个逻辑卷“**tecmint_lv**”。现在,我们想要迁移“**vdb**”这个逻辑卷到其它某个新的存储设备中。在开始之前,首先在下面所示的**fdisk**和lvs命令的帮助下验证该虚拟驱动器。
|
||||
|
||||
# fdisk -l | grep vd
|
||||
# lvs
|
||||
|
||||

|
||||
检查逻辑卷磁盘
|
||||
|
||||
### 步骤2: 检查新添加的驱动器 ###
|
||||
|
||||
**2.**在我们确认了现存驱动器后,现在是时候来将新的SSD驱动器连接到系统并在fdisk命令的帮助下验证新添加的驱动器了。
|
||||
|
||||
# fdisk -l | grep dev
|
||||
|
||||

|
||||
检查新添加的驱动器
|
||||
|
||||
**注意**:你看到上面屏幕中的内容了吗?新的驱动器已经被成功添加了,其名称为“**/dev/sda**”。
|
||||
|
||||
### 步骤3: 检查当前逻辑和物理卷 ###
|
||||
|
||||
**3.**现在,让我们开始创建物理卷、卷组和逻辑卷以用于迁移。在创建卷时,确保检查**/mnt/lvm**挂载点下的当前逻辑卷的数据。用以下命令来列出挂载点并检查数据。
|
||||
|
||||
# df -h
|
||||
# cd /mnt/lvm
|
||||
# cat tecmint.txt
|
||||
|
||||

|
||||
检查逻辑卷数据
|
||||
|
||||
**注意**:出于演示的目的,我们已经在**/mnt/lvm**挂载点下创建了两个文件,我们将在线将这些数据迁移到新的驱动器中。
|
||||
|
||||
**4.**在迁移之前,确保对确认与物理卷相关的逻辑卷和卷组名称,并且确认哪个物理卷用于容纳该卷组和逻辑卷。
|
||||
|
||||
# lvs
|
||||
# vgs -o+devices | grep tecmint_vg
|
||||
|
||||

|
||||
确认逻辑卷名称
|
||||
|
||||
**注意**:看到上面屏幕中的内容了吗?“**vdb**”容纳了卷组**tecmint_vg**。
|
||||
|
||||
### 步骤4: 创建新物理卷 ###
|
||||
|
||||
**5.**在在我们新添加的SSD驱动器中创建物理卷之前,我们需要使用fdisk来定义分区。在创建分区时,别忘了修改分区类型为LVM(8e)。
|
||||
|
||||
# pvcreate /dev/sda1 -v
|
||||
# pvs
|
||||
|
||||

|
||||
创建物理卷
|
||||
|
||||
**6.**接下来,使用‘vgextend命令’来添加新创建的物理卷到现存卷组tecmint_vg。
|
||||
|
||||
# vgextend tecmint_vg /dev/sda1
|
||||
# vgs
|
||||
|
||||

|
||||
添加物理卷
|
||||
|
||||
**7.**要获得卷组的完整信息列表,请使用‘vgdisplay’命令。
|
||||
|
||||
# vgdisplay tecmint_vg -v
|
||||
|
||||

|
||||
列出卷组信息
|
||||
|
||||
**注意**:在上面屏幕中,我们可以看到在输出结果的结束处,我们的PV已经添加到了卷组中。
|
||||
|
||||
**8.**如果我们需要知道更多关于哪些设备被映射的信息,请使用‘**dmsetup**’依赖命令。
|
||||
|
||||
# lvs -o+devices
|
||||
# dmsetup deps /dev/tecmint_vg/tecmint_lv
|
||||
|
||||
在上面的结果中,有个**1个**依赖(PV)或(驱动器),而这里**17**被列出了。如果你想要检查设备,那些关联的有着主、次设备号的驱动器,以确认,使用下面的命令。
|
||||
|
||||
# ls -l /dev | grep vd
|
||||
|
||||

|
||||
列出设备信息
|
||||
|
||||
**注意**:在上面的命令中,我们可以看到主设备号是**252**,次设备号是**17**,它连接到了**vdb1**。希望你理解了上面命令的输出。
|
||||
|
||||
### 步骤5: LVM镜像法 ###
|
||||
|
||||
**9.**现在,该使用镜像法来进行迁移了。使用‘**lvconvert**’命令来将数据从旧逻辑卷迁移到新驱动器。
|
||||
|
||||
# lvconvert -m 1 /dev/tecmint_vg/tecmint_lv /dev/sda1
|
||||
|
||||
- **-m** = 镜像
|
||||
- **1** = 添加单个镜像
|
||||
|
||||

|
||||
镜像法迁移
|
||||
|
||||
**注意**:上面的迁移过程根据卷的大小会花费一段时间。
|
||||
|
||||
**10.**在迁移过程完成后,验证转换的镜像。
|
||||
|
||||
# lvs -o+devices
|
||||
|
||||

|
||||
验证转换的镜像
|
||||
|
||||
**11.**当你确认转换的镜像没有任何问题后,你可以移除旧的虚拟磁盘**vdb1**。**-m**选项将移除镜像,先前我们使用**l**来添加镜像。
|
||||
|
||||
# lvconvert -m 0 /dev/tecmint_vg/tecmint_lv /dev/vdb1
|
||||
|
||||

|
||||
移除虚拟磁盘
|
||||
|
||||
**12.**在旧虚拟磁盘移除后,你可以使用以下命令来再次检查逻辑卷设备。
|
||||
|
||||
# lvs -o+devices
|
||||
# dmsetup deps /dev/tecmint_vg/tecmint_lv
|
||||
# ls -l /dev | grep sd
|
||||
|
||||

|
||||
检查新镜像的设备
|
||||
|
||||
在上面的图片中,你看到了吗?我们的逻辑卷现在依赖于**8,1**,名称为**sda1**。这说明我们的迁移过程已经完成了。
|
||||
|
||||
**13.**现在验证我们从旧驱动器上迁移过来的文件。如果在新驱动器中的数据与原数据一样,那就说明我们每一步都完成得很完美。
|
||||
|
||||
# cd /mnt/lvm/
|
||||
# cat tecmin.txt
|
||||
|
||||

|
||||
检查镜像的数据
|
||||
|
||||
|
||||
# vgreduce /dev/tecmint_vg /dev/vdb1
|
||||
# vgs -o+devices
|
||||
|
||||
**14.**在所有的都被完美创建后,现在该从卷组中删除**vdb1**并进行再次确认,哪些设备依赖于我们的卷组。
|
||||
|
||||
**15.**在从卷组**tecmint_vg**移除vdb1后,我们的逻辑卷还在那儿,因为我们已经将它从**vdb1**迁移到了**sda1**。
|
||||
|
||||
# lvs
|
||||
|
||||

|
||||
删除虚拟磁盘
|
||||
|
||||
### 步骤6: LVM pvmove镜像法 ###
|
||||
|
||||
**16.**我们可以使用带有‘**-n**’(逻辑卷名称)选项的‘**pvmove**’命令来取代‘**lvconvert**’镜像命令,在两个设备间进行数据镜像。
|
||||
|
||||
# pvmove -n /dev/tecmint_vg/tecmint_lv /dev/vdb1 /dev/sda1
|
||||
|
||||
该命令是在两个设备间镜像数据的最简单的一个,但是在真实环境中,**镜像**比**pvmove**使用得更为频繁。
|
||||
|
||||
### 结尾 ###
|
||||
|
||||
在本文中,我们介绍了怎样将逻辑卷从一个驱动器迁移到另一个驱动器。希望你已经掌握了逻辑卷管理中这一新的技巧。对于该配置,必须建立在掌握逻辑卷管理基础技能的基础上。对于基础配置,请参阅本文顶部需求章节中提供的链接。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/lvm-storage-migration/#comment-331336
|
||||
|
||||
作者:[Babin Lonston][a]
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/babinlonston/
|
||||
@@ -0,0 +1,150 @@
|
||||
Linux服务器监控和排障利器:sysdig
|
||||
================================================================================
|
||||
当你需要追踪某个进程产生和接收的系统调用时,首先浮现在你脑海中的是什么?你可能会想到strace,那么你是对的。你会使用什么样的命令行工具来监控原始网络通信呢?如果你想到了tcpdump,你又作出了一个极佳的选择。而如果你碰到必须追踪打开的文件(在Unix意义上:一切皆文件)的需求,可能你会使用lsof。
|
||||
|
||||
strace、tcpdump以及lsof,确实是些伟大的工具,它们应该成为每个系统管理员工具集中的一部分,而这也正是你为什么会爱上[sysdig][1]的原因。它是一个强大的开源工具,用于系统级别的勘察和排障,它的创建者在介绍它时称之为“strace+tcpdump+lsof+上面点缀着lua樱桃的绝妙酱汁”。抛开幽默不说,sysdig的最棒特性之一在于,它不仅能分析Linux系统的“存活”状态,也能将该状态保存为转储文件以供离线检查。更重要的是,你可以自定义sysdig的行为,或者甚至通过内建的(你也可以自己编写)名为凿子的小脚本增强其功能。单独的凿子可以脚本指定的各种风格分析sysdig捕获的事件流。
|
||||
|
||||
在本教程中,我们将探索sysdig的安装及其基本用法,在Linux上实施系统监控和排障。
|
||||
|
||||
### 安装Sysdig ###
|
||||
|
||||
对于本教程,由于为了简便、缩短安装流程以及版本不可知,我们将选择使用官方网站提供的自动化安装过程。在自动化过程中,安装脚本会自动检测操作系统并安装必需的依赖包。
|
||||
|
||||
以root身份运行以下命令来从官方apt/yum仓库安装sysdig:
|
||||
|
||||
# curl -s https://s3.amazonaws.com/download.draios.com/stable/install-sysdig | bash
|
||||
|
||||

|
||||
|
||||
安装完成后,我们可以通过以下方法调用sysdig来感受一下它:
|
||||
|
||||
# sysdig
|
||||
|
||||
我们的屏幕将马上被系统上发生的所有事件填满,对于这些信息,我们不能做更多操作。要进一步处理,我们可以运行:
|
||||
|
||||
# sysdig -cl | less
|
||||
|
||||
来查看可用的凿子列表。
|
||||
|
||||

|
||||
|
||||
The following categories are available by default, each of which is populated by multiple built-in chisels.
|
||||
默认有以下类目可用,各个类目中分布有多个内建的凿子。
|
||||
|
||||
- CPU Usage:CPU使用量
|
||||
- Errors:错误
|
||||
- I/O
|
||||
- Logs:日志
|
||||
- Misc:混杂
|
||||
- Net:网络
|
||||
- Performance:性能
|
||||
- Security:安全
|
||||
- System State:系统状态
|
||||
|
||||
要显示指定凿子上的信息(包括详细的命令行用法),运行以下命令:
|
||||
|
||||
# sysdig -cl [chisel_name]
|
||||
|
||||
例如,我们可以检查“网络”类目下关于spy_port凿子的信息:
|
||||
|
||||
# sysdig -i spy_port
|
||||
|
||||

|
||||
|
||||
凿子可以通过过滤器(可同时应用于存活数据和记录文件)组合,以获取更多有用的输出。
|
||||
|
||||
过滤器遵从“类.字段”结构。例如:
|
||||
|
||||
- **fd.cip**:客户端IP地址。
|
||||
- **evt.dir**:事件方向,可以是‘>’用于进入事件,或‘<’用于退出事件。
|
||||
|
||||
完成得过滤器列表可以通过以下命令显示:
|
||||
|
||||
# sysdig -l
|
||||
|
||||
在本教程剩余部分,我将演示几个sysdig的使用案例。
|
||||
|
||||
### Sysdig实例: 服务器性能排障 ###
|
||||
|
||||
假定你的服务器发生了性能问题(如,没有回应,或者重大的回应延迟)。你可以使用瓶颈凿子来显示当前10个最慢系统调用的列表。
|
||||
|
||||
使用以下命令在存活服务器上进行实时检查。“-c”标识,后跟凿子名告诉sysdig运行指定的凿子。
|
||||
|
||||
# sysdig -c bottlenecks
|
||||
|
||||
或者,你可以离线对服务器实施性能分析。在此种情况下,你可以保存完整的sysdig记录到文件,然后像下面这样针对记录运行瓶颈凿子。
|
||||
|
||||
首先,保存sysdige记录(使用Ctrl+c来停止收集):
|
||||
|
||||
# sysdig -w trace.scap
|
||||
|
||||
收集完记录后,你可以运行以下命令来检查捕获间隔中最慢的系统调用:
|
||||
|
||||
# sysdig -r trace.scap -c bottlenecks
|
||||
|
||||

|
||||
|
||||
你想要关注栏#2,#3和#4,这些分别表示执行时间、进程名和PID。
|
||||
|
||||
### Sysdig实例: 监控交互用户活动 ###
|
||||
|
||||
假定你作为系统管理员想要监控系统中交互的用户活动(如,用户在命令行输入了什么命令,以及用户去了什么目录),这时spy_user凿子就派上用场了。
|
||||
|
||||
让我们首先通过一些额外选项来收集一个sysdig记录。
|
||||
|
||||
# sysdig -s 4096 -z -w /mnt/sysdig/$(hostname).scap.gz
|
||||
|
||||
- “-s 4096”告诉sysdig每个事件捕获4096字节。
|
||||
- “-z” (与“-w”一起使用)为记录文件启用压缩。
|
||||
- “-w <trace-file>”保存sysdig记录到指定的文件。
|
||||
|
||||
在上面的例子中,我们自定义了基于每个主机的压缩的记录文件的名称。记住,你可以在任何时候按下Ctrl+c来打断sysdig的执行。
|
||||
|
||||
在我们收集到了合理数量的数据后,我们可以通过运行以下命令来查看每个用户的交互活动:
|
||||
|
||||
# sysdig -r /mnt/sysdig/debian.scap.gz -c spy_users
|
||||
|
||||

|
||||
|
||||
上面输出的第一栏表示与指定用户的活动相关进程的PID。
|
||||
|
||||
如果你想要定位一个指定的用户,以及只监控该用户的活动又怎么样呢?你可以通过用户名对spy_users凿子的结果进行过滤:
|
||||
|
||||
# sysdig -r /mnt/sysdig/debian.scap.gz -c spy_users "user.name=xmodulo"
|
||||
|
||||

|
||||
|
||||
### Sysdig实例: 监控文件I/O ###
|
||||
|
||||
我们可以使用“-p”标识来自定义sysdig记录的输出格式,并指定双引号括起来的想要的字段(如用户名、进程名,以及文件或套接口名称)。在本例中,我们将创建一个记录文件,该文件将只包含在家目录中的写入事件(我们今后可以使用“sysdig -r writetrace.scap.gz”来检测该文件)。
|
||||
|
||||
# sysdig -p "%user.name %proc.name %fd.name" "evt.type=write and fd.name contains /home/" -z -w writetrace.scap.gz
|
||||
|
||||

|
||||
|
||||
### Sysdig实例: 监控网络I/O ###
|
||||
|
||||
作为服务器排障的一部分,你可能想要监听网络通信,此工作通常由tcpdump做。对于sysdig,可以很容易进行通信嗅探,其风格更为对用户友好。
|
||||
|
||||
例如,你可以检查由特定IP地址,特定进程(如apache2)提供的数据(ASCII编码格式):
|
||||
|
||||
# sysdig -s 4096 -A -c echo_fds fd.cip=192.168.0.100 -r /mnt/sysdig/debian.scap.gz proc.name=apache2
|
||||
|
||||
如果你想要监控原生数据传输(二进制格式),请用“-A”替换“-X”:
|
||||
|
||||
# sysdig -s 4096 -X -c echo_fds fd.cip=192.168.0.100 -r /mnt/sysdig/debian.scap.gz proc.name=apache2
|
||||
|
||||
要获取更多信息、实例以及案例分析,你可以查阅[项目网站][1]。相信我,会有着无限可能,但请不要仅仅局限于我所写的这些。安装sysdig,请从今天开始深入挖掘吧!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/monitor-troubleshoot-linux-server-sysdig.html
|
||||
|
||||
作者:[Gabriel Cánepa][a]
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/gabriel
|
||||
[1]:http://www.sysdig.org/
|
||||
@@ -0,0 +1,81 @@
|
||||
Linux有问必答——如何在Linux命令行中刻录ISO或NRG镜像到DVD
|
||||
================================================================================
|
||||
> **问题**:我需要在Linux盒子上使用DVD刻录机刻录一个镜像文件(.iso或.nrg)到DVD,有没有一个既快捷又简易的方法,最好是使用命令行工具?
|
||||
|
||||
最常见的两种镜像文件格式是ISO(.iso为文件扩展名)和NRG(.nrg为文件扩展名)。ISO格式是一个由ISO(国际标准组织)创立的全球标准,因此被大多数操作系统所支持,它提供了很高的便携性。另一方面,NRG格式是由Nero AG开发的私有格式,Nero AG是一个很大众的磁盘镜像和刻录软件公司。
|
||||
|
||||
下面来解答怎样从Linux命令行刻录.iso或.nrg镜像到DVD。
|
||||
|
||||
### 把NRG镜像转换为ISO格式 ###
|
||||
|
||||
由于ISO被广为采用,刻录.iso镜像到CD/DVD就非常简单。但是,要刻录一个.nrg镜像则首先需要将它转换为.iso格式。
|
||||
|
||||
把一个.nrg镜像文件转换到.iso格式,你可以使用nrg2iso这个工具。它是一个开源程序,用来将Nero Burning Rom创建的镜像转换到标准的.iso(ISO9660)文件。
|
||||
|
||||
在Debian及其衍生版上安装**nrg2iso**:
|
||||
|
||||
# aptitude install nrg2iso
|
||||
|
||||
在基于Red Hat的发行版上安装**nrg2iso**:
|
||||
|
||||
# yum install nrg2iso
|
||||
|
||||
在CentOS/RHEL上,你需要先启用[Repoforge仓库][1],再通过**yum**安装。
|
||||
|
||||
安装完nrg2iso包后,使用以下命令来将.nrg镜像转换到.iso格式:
|
||||
|
||||
# nrg2iso filename.nrg filename.iso
|
||||
|
||||

|
||||
|
||||
转换完成后,在当前目录中会出现一个.iso文件:
|
||||
|
||||

|
||||
|
||||
### 刻录.ISO镜像文件到DVD ###
|
||||
|
||||
为了刻录.iso镜像文件到DVD,我们将使用**growisofs**这个工具:
|
||||
|
||||
# growisofs -dvd-compat -speed=4 -Z /dev/dvd1=WindowsXPProfessionalSP3Original.iso
|
||||
|
||||
在上面的命令行中,“-dvd-compat”选项提供了与DVD-ROM/-Video的最大介质兼容性。在一次写入式 DVD+R 或 DVD-R 上下文中,导致不可添加记录(关闭磁盘)。
|
||||
|
||||
“-Z /dev/dvd1=filename.iso”选项表示我们刻录.iso文件到设备选单(/dev/dvd1)中选择的介质中。
|
||||
|
||||
“-speed=N”参数指定了DVD刻录机的刻录速度,这与驱动自身的能力直接相关。“-speed=8”将以8x刻录,“-speed=16”将以16x刻录,以此类推。没有该参数,growisofs将默认以最低速刻录,在这里是4x。你可以根据你刻录机的可用速度和磁盘类型选择合适的刻录速度。
|
||||
|
||||
你可以根据[此教程][2]找出你的DVD刻录机的设备名称和它所支持的写入速度。
|
||||
注:此文在另一篇原文中(20141014 Linux FAQs with Answers--How to detect DVD writer' s device name and its writing speed from the command line on Linux.md),如果也翻译发布了,可修改此链接.
|
||||
校对注:这篇的原文还没翻译,翻译完一起发布
|
||||
|
||||

|
||||
|
||||
刻录进程完成后,磁盘会自动弹出。
|
||||
|
||||
### 检查已刻录介质的完整性 ###
|
||||
|
||||
关于这一点,你可以通过将刻录的DVD的校验和与原始.iso文件的md5校验和进行对比,以检查所刻录介质的完整性。如果两者相同,你就可以放心了,因为刻录成功了。
|
||||
|
||||
然而,当你使用nrg2iso来将.nrg镜像转换为.iso格式后,你需要明白一点,nrg2iso创建的.iso文件的大小不是2048的倍数(通常,.iso文件的大小是它的倍数)。因此,常规的校验和对比,该.iso文件和刻录介质的内容不一样。
|
||||
|
||||
另一方面,如果你已经刻录了一个不是由.nrg文件转换而来的.iso镜像,你可以使用以下命令来检查记录到DVD中的数据的完整性。替换“/dev/dvd1”为你的设备名。
|
||||
|
||||
# md5sum filename.iso; dd if=/dev/dvd1 bs=2048 count=$(($(stat -c "%s" filename.iso) / 2048)) | md5sum
|
||||
|
||||
命令的第一部分计算.iso文件的md5校验和,而第二部分则读取/dev/dvd1中的磁盘内容,然后通过管道输出给md5sum工具。“bs=2048”表示dd命令将使用2048字节块为单位检查,因为原始iso文件以2048为单位划分。
|
||||
|
||||

|
||||
|
||||
如果两个md5校验和的值相同,这就意味着刻录的介质是有效的。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/burn-iso-nrg-image-dvd-command-line.html
|
||||
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://xmodulo.com/how-to-set-up-rpmforge-repoforge-repository-on-centos.html
|
||||
[2]:http://ask.xmodulo.com/detect-dvd-writer-device-name-writing-speed-command-line-linux.html
|
||||
@@ -0,0 +1,90 @@
|
||||
Linux 有问必答 -- 如何改变libvirt VM镜像的默认位置
|
||||
================================================================================
|
||||
> **提问**: 我使用libvirt和virt-manager在我的Linux系统上创建虚拟机。我注意到虚拟机镜像位于/var/lib/libvirt/images目录。有没有办法改变虚拟机镜像的默认路径?
|
||||
|
||||
**libvirt**和它的GUI前端**virt-manager**可以使用不同的虚拟机管理程序创建和管理VM,例如LVM和Xen。默认上所有的虚拟机镜像通过**libvirt**创建到/var/lib/libvirt/images目录。然而,这有时并不是我们希望的。比如/var/lib/libvirt/images此处的磁盘分区大小有限。或者你想要存储所有的虚拟机镜像到一个特定的用于管理的仓库中。
|
||||
|
||||
实际上,你可以非常容易地改变libvirt镜像的默认目录,或者称之为“存储池”。
|
||||
|
||||
有两种方法可以改变默认存储池。
|
||||
|
||||
### 方法一: Virt-Manager GUI ###
|
||||
|
||||
如果你正在使用virt-manager GUI程序,改变默认存储池非常容易。
|
||||
|
||||
进入**virt-manager**的菜单GUI “编辑” -> "连接细节"。
|
||||
|
||||

|
||||
|
||||
你可以看到如下所是的默认存储池。在窗口的左下角,点击叉形按钮,将会停止默认的存储池。存储池一旦停止后,点击右边的垃圾桶,将会删除存储池。注意这个动作不会删除池中的镜像。
|
||||
|
||||
现在点击左边的加号增加一个新的存储池。
|
||||
|
||||

|
||||
|
||||
输入新的存储池的名字(比如:default),并且选择存储池的类型。本例中,因为我们只是改变存储池目录所以选择“文件系统目录”。
|
||||
|
||||

|
||||
|
||||
输入新的存储池路径(比如,/storage)。
|
||||
|
||||

|
||||
|
||||
这时,新的存储池应该启动了,并且自动在你创建一个新的虚拟机的时候使用。
|
||||
|
||||

|
||||
|
||||
### 方法二: Virsh 命令行 ###
|
||||
|
||||
另外一个改变默认存储池目录的方法是使用来自**libvirt**包的**virsh** 命令行工具。
|
||||
|
||||
首先,运行下面的命令来导出默认存储池的XML定义。
|
||||
|
||||
$ virsh pool-dumpxml default > pool.xml
|
||||
|
||||
用文本编辑器打开XML文件,并且改变<path>节点中的/var/lib/libvirt/images改成新的地址。
|
||||
|
||||
<pool type='dir'>
|
||||
<name>default</name>
|
||||
<uuid>0ec0e393-28a2-e975-feec-0c7356f38d08</uuid>
|
||||
<capacity unit='bytes'>975762788352</capacity>
|
||||
<allocation unit='bytes'>530052247552</allocation>
|
||||
<available unit='bytes'>445710540800</available>
|
||||
<source>
|
||||
</source>
|
||||
<target>
|
||||
<path>/var/lib/libvirt/images</path>
|
||||
<permissions>
|
||||
<mode>0711</mode>
|
||||
<owner>-1</owner>
|
||||
<group>-1</group>
|
||||
</permissions>
|
||||
</target>
|
||||
</pool>
|
||||
|
||||
移除现在的默认池。
|
||||
|
||||
$ virsh pool-destroy default
|
||||
|
||||
----------
|
||||
|
||||
Pool default destroyed
|
||||
|
||||
现在创建一个基于更新后的XML文件的新存储池。
|
||||
|
||||
$ virsh pool-create pool.xml
|
||||
|
||||
----------
|
||||
|
||||
Pool default created from pool.xml
|
||||
|
||||
这时,默认池已经改变到新的地址了,并且可以使用了。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/change-default-location-libvirt-vm-images.html
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
@@ -0,0 +1,75 @@
|
||||
Linux有问必答——如何检测并修复bash中的破壳漏洞
|
||||
================================================================================
|
||||
> **问题**:我想要知道我的Linux服务器是否存在bash破壳漏洞,以及如何来保护我的Linux服务器不受破壳漏洞侵袭。
|
||||
|
||||
2014年9月24日,一位名叫斯特凡·沙泽拉的安全研究者发现了一个名为“破壳”(也称为“bash门”或“Bash漏洞”)的bash漏洞。该漏洞如果被渗透,远程攻击者就可以在调用shell前通过在特别精心编制的环境中输出函数定义执行任何程序代码。然后,这些函数内的代码就可以在调用bash时立即执行。
|
||||
|
||||
注意,破壳漏洞影响到bash版本1.14到4.3(当前版本)。虽然在写本文时还没有该漏洞权威而完整的修复方案,也尽管主要的Linux发行版([Debian][1],[Red Hat][2],[CentOS][3],[Ubuntu][4]和 [Novell/Suse][5])已经发布了用于解决与此漏洞相关的补丁([CVE-2014-6271][6]和[CVE-2014-7169][7]),并且建议尽快更新bash,并在随后数日内检查更新:
|
||||
|
||||
### 检测破壳漏洞 ###
|
||||
|
||||
要检查你的Linux系统是否存在破壳漏洞,请在终端中输入以下命令。
|
||||
|
||||
$ env x='() { :;}; echo "Your bash version is vulnerable"' bash -c "echo This is a test"
|
||||
|
||||
(注:上面代码中echo "Your bash version is vulnerable"一句在发布时刷成红色)
|
||||
|
||||
如果你的Linux系统已经暴露给了破壳漏洞渗透,命令输出会像这样:
|
||||
|
||||
Your bash version is vulnerable
|
||||
This is a test
|
||||
|
||||
在上面的命令中,一个名为x的环境变量已经被设置可用于用户环境。就如我们所了解到的,它并没有赋值(是一个虚函数定义),后面跟了一个任意命令(红色)(注:red这个词在发布时刷成红色),该命令将在bash调用前执行。
|
||||
|
||||
### 为破壳漏洞应用修复 ###
|
||||
|
||||
你可以按照以下方法安装新发布的bash补丁。
|
||||
|
||||
在Debian及其衍生版上:
|
||||
|
||||
# aptitude update && aptitude safe-upgrade bash
|
||||
|
||||
在基于Red Hat的发行版上:
|
||||
|
||||
# yum update bash
|
||||
|
||||
#### 打补丁之前: ####
|
||||
|
||||
Debian:
|
||||
|
||||

|
||||
|
||||
CentOS:
|
||||
|
||||

|
||||
|
||||
#### 打补丁之后: ####
|
||||
|
||||
Debian:
|
||||
|
||||

|
||||
|
||||
CentOS:
|
||||
|
||||

|
||||
|
||||
注意,在安装补丁前后,各个发行版中的bash版本没有发生变化——但是你可以通过从更新命令的运行过程中看到该补丁已经被安装(很可能在安装前需要你确认)。
|
||||
|
||||
如果处于某种原因你不能安装该补丁,或者针对你的发行版的补丁还没有发布,那么建议你先试用另外一个shell,直到修复补丁出现。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/detect-patch-shellshock-vulnerability-bash.html
|
||||
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:https://www.debian.org/security/2014/dsa-3032
|
||||
[2]:https://access.redhat.com/articles/1200223
|
||||
[3]:http://centosnow.blogspot.com.ar/2014/09/critical-bash-updates-for-centos-5.html
|
||||
[4]:http://www.ubuntu.com/usn/usn-2362-1/
|
||||
[5]:http://support.novell.com/security/cve/CVE-2014-6271.html
|
||||
[6]:http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-6271
|
||||
[7]:http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-7169
|
||||
@@ -0,0 +1,65 @@
|
||||
Linux中的鉴别套接字/网络的ss工具示例
|
||||
================================================================================
|
||||
ss是iproute2包的一部分(控制TCP/IP网络和流量的工具)。iproute2目标是替代先前用于配置网络接口,路由表和管理ARP表的标准Unix网络工具套装(通常称之为“net-tools”)。ss工具用于导出套接字统计,它可以显示与netstat类似的信息,且可以显示更多的TCP和状态信息。它也应该更加快因为它工作与内核空间。ss的操作和netstat很像所以这让它可以很容易就可以取代。
|
||||
|
||||
### 使用和常见选项 ###
|
||||
|
||||
ss和netstat很像,默认他会显示已经建立连接的开放的非监听TCP套接字列表。并且你可以用下面的选项过滤输出:
|
||||
|
||||
- **-n** - 尝试解析服务名。
|
||||
- **-r** - 尝试解析数字地址/端口。
|
||||
- **-a** - 显示所有套接字。
|
||||
- **-l** - 显示监听套接字。
|
||||
- **-p** - 显示进程人使用的套接字。
|
||||
- **-s** - 打印统计
|
||||
- **-t** - 只显示TCP套接字。
|
||||
- **-u** - 只显示UDP套接字。
|
||||
- **-d** - 只显示DCCP套接字
|
||||
- **-w** - 只显示原始套接字。
|
||||
- **-x** - 只显示Unix域套接字
|
||||
- **-f FAMILY** - 显示FAMILY套接字的类型。目前支持下面这些家族:unix、inet、inet6、link、netlink。
|
||||
- **-A QUERY** - 导出套接字列表,通过逗号分隔。可以识别下面的标识符:all、inet、tcp、udp、raw、unix、packet、netlink、unix_dgram、unix_stream、packet_raw、packet_dgram。
|
||||
|
||||
### ss 命令示例 ###
|
||||
|
||||
**1.** 显示所有的的TCP端口和使用它们的进程:
|
||||
|
||||
# ss -tnap
|
||||
|
||||

|
||||
|
||||
**2.** 你可以使用-4 标志来显示IPv4链接,-6标志来显示IPv6链接,比如:
|
||||
|
||||
# ss -tnap6
|
||||
|
||||

|
||||
|
||||
**3.** 跟上面的行为一样,你只需用n代替t就会显示所有开放的UDP端口。
|
||||
|
||||
# ss -tnap
|
||||
|
||||

|
||||
|
||||
**4.** 你可以使用-s标志来打印不同的有用的统计:
|
||||
|
||||
# ss -s
|
||||
|
||||

|
||||
|
||||
**5.** 你可以使用-o标志来检查所有不同状态下的链接,比如显示所有已经建立的连接。
|
||||
|
||||
# ss -tn -o state established -p
|
||||
|
||||

|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-command/ss-sockets-network-connection/
|
||||
|
||||
作者:[Adrian Dinu][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/adriand/
|
||||
@@ -1,6 +1,6 @@
|
||||
在ubuntu14.04上配置SNMPv3
|
||||
============================================
|
||||
简单网络管理协议(SNMP)是用于IP网络设备管理的标准协议。典型的支持SNMP协议的设备有路由器、交换机、服务器、工作站、打印机及数据机柜等等。SNMP一般被网络管理系统用于监视网络附加设备,令行政注意(译者注:这个不太明白...按字面意思翻了,麻烦校对更正)。SNMP是因特网协议套件中的一个组成部分,它由IETF机构定义。它包含一系列的网络管理标准,其中有一个应用层协议,一个数据库架构以及一组数据对象。[2]
|
||||
简单网络管理协议(SNMP)是用于IP网络设备管理的标准协议。典型的支持SNMP协议的设备有路由器、交换机、服务器、工作站、打印机及数据机柜等等。SNMP一般被网络管理系统用于监视网络附加设备,以确保行政监管。SNMP是因特网协议套件中的一个组成部分,它由IETF机构定义。它包含一系列的网络管理标准,其中有一个应用层协议,一个数据库架构以及一组数据对象。
|
||||
|
||||
SNMP将管理数据以变量的形式暴露出来,这些变量描述了系统配置。同时这些变量可以被管理应用查询(或者被设置)。
|
||||
|
||||
@@ -10,15 +10,15 @@ SNMP将管理数据以变量的形式暴露出来,这些变量描述了系统
|
||||
|
||||
SNMPv3在SNMP的基础之上增强了安全性以及远程配置功能。
|
||||
|
||||
最初,SNMP最大的缺点就是安全性弱。SNMP的第一与第二个版本中,身份验证仅仅是在管理员与代理间传送一个明文的密码而已。[1]目前每一个SNMPv3的信息都包含了被编码成8进制的安全参数。这些安全参数的具体意义由所选用的安全模型决定。
|
||||
最初,SNMP最大的缺点就是安全性弱。SNMP的第一与第二个版本中,身份验证仅仅是在管理员与代理间传送一个明文的密码而已。目前每一个SNMPv3的信息都包含了被编码成8进制的安全参数。这些安全参数的具体意义由所选用的安全模型决定。
|
||||
|
||||
SNMPv3提供了重要的安全特征:
|
||||
SNMPv3提供了重要的安全特性:
|
||||
|
||||
保密性 -- 加密数据包以防止未经授权的源监听。
|
||||
保密性 —— 加密数据包以防止未经授权的源监听。
|
||||
|
||||
完整性 -- 数据完整性特性确保数据在传输的时候没有被干扰,并且包含了课选的数据响应保护机制。
|
||||
完整性 —— 数据的完整性特性确保数据在传输的时候没有被干扰,并且包含了课选的数据响应保护机制。
|
||||
|
||||
身份验证 -- 检查数据是否来自一个合法的源
|
||||
身份验证 —— 检查数据是否来自一个合法的源
|
||||
|
||||
### 在ubuntu中安装SNMP服务器及客户端 ###
|
||||
|
||||
@@ -30,9 +30,9 @@ SNMPv3提供了重要的安全特征:
|
||||
|
||||
###配置SNMPv3###
|
||||
|
||||
获得守护进程的权限
|
||||
获得从外部守护进程的权限
|
||||
|
||||
默认的安装仅提供本地的访问权限,如果想要获得外部访问权限的话编辑文件 /etc/default/snmpd。
|
||||
默认的安装仅提供本地的访问权限,如果想要获得外部访问权限,打开文件 /etc/default/snmpd。
|
||||
|
||||
sudo vi /etc/default/snmpd
|
||||
|
||||
@@ -54,7 +54,11 @@ SNMPv3提供了重要的安全特征:
|
||||
|
||||
“securityLevel”参数使得SNMPv3有多种不同的用途。
|
||||
|
||||
noAuthNoPriv -- 没有授权,加密以及任何安全保护!authNoPriv -- 需要身份认证,但是不对数据进行加密。 autoPriv -- 最健壮的模式。需要身份认证以及数据会被加密。
|
||||
noAuthNoPriv —— 没有授权,加密以及任何安全保护!
|
||||
|
||||
authNoPriv —— 需要身份认证,但是不对通过网络发送的数据进行加密。
|
||||
|
||||
autoPriv —— 最健模式。需要身份认证而且数据会被加密。
|
||||
|
||||
snmpd 的配置以及设置都保存在文件 /etc/snmp/snmpd.conf。使用编辑器编辑文件:
|
||||
|
||||
@@ -92,6 +96,6 @@ snmpd 的配置以及设置都保存在文件 /etc/snmp/snmpd.conf。使用编
|
||||
via: http://www.ubuntugeek.com/how-to-configure-snmpv3-on-ubuntu-14-04-server.html
|
||||
|
||||
译者:[SPccman](https://github.com/SPccman)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
|
||||
如何在ubuntu桌面配置一个网络打印机和扫描仪
|
||||
================================================================================
|
||||
|
||||
|
||||
在[之前的文章中](注:这篇文章在2014年8月12号的原文里做过,不知道翻译了没有,如果翻译发布了,发布此文章的时候可改成翻译后的链接), 我们讨论过如何在Linux服务器安装各种各样的打印机(当然也包括网络扫描仪)。今天我们将来处理另一端:如何通过桌面客户端来访问网络打印机/扫描仪。
|
||||
|
||||
|
||||
### 网络环境 ###
|
||||
|
||||
在这个安装教程中,我们的服务器(Debian Wheezy 7.2版本)的IP地址是192.168.0.10,我们的客户端(Ubuntu 12.04版本)的IP地址是192.168.0.105.注意这两台机器是在同一个网段(192.168.0.0/24).如果我们想允许打印机访问其它网段,我们需要在服务器上修改cupsd.conf文件的以下部分:
|
||||
|
||||
<Location />
|
||||
Order allow,deny
|
||||
Allow localhost
|
||||
Allow from XXX.YYY.ZZZ.*
|
||||
</Location>
|
||||
|
||||
|
||||
(在上述例子中,我们授予打印机从本地或者任何系统能够访问打印机,这些系统的IPv4地址以XXX.YYY.ZZZ开始。
|
||||
|
||||
为了验证哪些打印机可以在我们的服务器上适用,我们也可以在服务器上使用lpstat命令,或者浏览网页https://192.168.0.10:631/printers page.
|
||||
|
||||
root@debian:~# lpstat -a
|
||||
|
||||
----------
|
||||
|
||||
EPSON_Stylus_CX3900 accepting requests since Mon 18 Aug 2014 10:49:33 AM WARST
|
||||
PDF accepting requests since Mon 06 May 2013 04:46:11 PM WARST
|
||||
SamsungML1640Series accepting requests since Wed 13 Aug 2014 10:13:47 PM WARST
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
### 在Ubuntu桌面安装网络打印机 ###
|
||||
|
||||
|
||||
在我们的Ubuntu 12.04的客户端,我们将打开"Printing"菜单(Dash -> Printing).你会注意到在其它发行版中,这个名字也许会有一点差别(例如会叫做"Printers" 或者 "Print & Fax"):
|
||||
|
||||

|
||||
|
||||
|
||||
还没有打印机添加到我们的客户端:
|
||||
|
||||

|
||||
|
||||
下面是在Ubuntu桌面客户端安装一台网络打印机的一些步骤。
|
||||
|
||||
|
||||
**1)** “Add”按钮将弹出New Printer" 菜单。我们将选择"Network printer" -> "Find Network Printer"并输入我们服务器的IP地址,接着点击"Find":
|
||||
|
||||

|
||||
|
||||
|
||||
**2)** 在最下面我们将会看到可使用的打印机的名称。我们来选择这台三星打印机并按"Forward":
|
||||
|
||||

|
||||
|
||||
|
||||
**3)** 我们将会被要求填写一些关于我们打印机的信息。当我们输入完成时,将点击 "Apply"按钮。
|
||||
|
||||

|
||||
|
||||
|
||||
**4)** 我们接下来将被询问是否打印一张测试页。让我们点击"Print test page"吧:
|
||||
|
||||

|
||||
|
||||
|
||||
这个打印任务将被创建为本地id 2:
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
5)适用我们服务器上的CUPS网络借口,我们可以观察到打印任务已经提交成功了(打印机 -> SamsungML1640系列 -> 显示完成任务):
|
||||
|
||||

|
||||
|
||||
|
||||
我们也可以通过在打印机服务器上运行以下命令显示同样信息:
|
||||
|
||||
root@debian:~# cat /var/log/cups/page_log | grep -i samsung
|
||||
|
||||
----------
|
||||
|
||||
SamsungML1640Series root 27 [13/Aug/2014:22:15:34 -0300] 1 1 - localhost Test Page - -
|
||||
SamsungML1640Series gacanepa 28 [18/Aug/2014:11:28:50 -0300] 1 1 - 192.168.0.105 Test Page - -
|
||||
SamsungML1640Series gacanepa 29 [18/Aug/2014:11:45:57 -0300] 1 1 - 192.168.0.105 Test Page - -
|
||||
|
||||
这个page_log日志显示每一页被打印过的信息,只包括哪些用户发送这些打印任务,打印日期&时间,以及客户端的IPv4地址。
|
||||
|
||||
|
||||
要安装Epson喷墨和PDF打印机,我们只需重复第1-5的步骤即可,并每一次选择左边的打印队列。例如,在下图中选择PDF打印机:
|
||||
|
||||

|
||||
|
||||
然而,请注意到根据[CUPS-PDF 文档中][2],根据默认:
|
||||
|
||||
>PDF文件将会被放置在打印作业的所有者命名的子目录内。在这个案例中,打印作业的所有者不能被识别(i.e.不会存在服务器中)输出的内容被放置在匿名操作的文件中。
|
||||
|
||||
|
||||
这些默认的文件夹可以通过改变在/etc/cups/cups-pdf目录中的**Out**值和**AnonDirName**变量来修改。这里,${HOME}被扩展到用户的家目录中:
|
||||
|
||||
Out ${HOME}/PDF
|
||||
AnonDirName /var/spool/cups-pdf/ANONYMOUS
|
||||
|
||||
|
||||
|
||||
### 网络打印实例 ###
|
||||
|
||||
#### 实例 #1 ####
|
||||
|
||||
|
||||
|
||||
从Ubuntu12.04中打印,通常在本地用gacanepa(具有相同名字存在打印机服务器上)。
|
||||
|
||||

|
||||
|
||||
|
||||
打印到PDF打印机之后,让我们来检查打印机服务器上的/home/gacanepa/PDF目录下的内容:
|
||||
|
||||
|
||||
|
||||
root@debian:~# ls -l /home/gacanepa/PDF
|
||||
|
||||
----------
|
||||
|
||||
total 368
|
||||
-rw------- 1 gacanepa gacanepa 279176 Aug 18 13:49 Test_Page.pdf
|
||||
-rw------- 1 gacanepa gacanepa 7994 Aug 18 13:50 Untitled1.pdf
|
||||
-rw------- 1 gacanepa gacanepa 74911 Aug 18 14:36 Welcome_to_Conference_-_Thomas_S__Monson.pdf
|
||||
|
||||
|
||||
|
||||
这个PDF文件被创建时的,权限已经设置为600(-rw-------),这意味着只有打印任务的所有者(在这个例子中是gacanepa )可以访问它们。我们可以通过修改the /etc/cups/cups-pdf.conf文件**UserUMask**变量的值来改变这种行为。例如,0033的umask值将可以使PDF打印者以及其它所有者拥有创建文件的权限,但是只读权限也会赋予给其它所有者。
|
||||
|
||||
root@debian:~# grep -i UserUMask /etc/cups/cups-pdf.conf
|
||||
|
||||
----------
|
||||
|
||||
### Key: UserUMask
|
||||
UserUMask 0033
|
||||
|
||||
|
||||
|
||||
对于那些不熟悉umask(有名用户文件创建模式掩码),它作为一组可以用于控制那些为新文件创建时修改默认权限。给予特定的umask值,在计算最终文件的许可权限时,在文件基本权限(0666)和umask的单项按位补码之间进行按位布尔 AND 运算。因此,如果设置一个umask值为0033,那么新文件默认的权限将不是(0033)AND 0666 = 644的值(文件拥有者具有读/写/执行的权限,其他人拥有只读权限)。
|
||||
|
||||
|
||||
### 实例 #2 ###
|
||||
|
||||
|
||||
在Ubuntu12.04执行打印,本地登录用户为jdoe(同样的帐号名称但是服务器上是不存在的)。
|
||||
|
||||

|
||||
|
||||
root@debian:~# ls -l /var/spool/cups-pdf/ANONYMOUS
|
||||
|
||||
----------
|
||||
|
||||
total 5428
|
||||
-rw-rw-rw- 1 nobody nogroup 5543070 Aug 18 15:57 Linux_-_Wikipedia__the_free_encyclopedia.pdf
|
||||
|
||||
|
||||
这个PDF被创建时赋予的权限是666(-rw-rw-rw-),这意味着每个人都可以访问它们。我们可以通过编辑在/etc/cups/cups-pdf.conf文件中的**AnonUMask**值来改变这种行为。
|
||||
|
||||
|
||||
在这一点上,你也许会疑惑:为什么同样安装一台网络打印机,大多数(当然不是全部)当前的Linux桌面发行版都会内置一个"打印到文件"的功能来允许用户动态创建PDF文件?
|
||||
|
||||
|
||||
使用一台网络PDF打印机有以下好处:
|
||||
|
||||
|
||||
- 一个网络打印机(任何类型的)允许你直接从命令行直接打印,无需首先打开文件。
|
||||
|
||||
- 在其它操作系统上安装一个网络客户端,一个PDF网络打印机备件,于是系统管理员不必再单独需要安装PDF创建者实用程序(也避免了最终用户安装这些工具存在的风险)。
|
||||
|
||||
- 网络PDF打印机允许通过配置权限直接打印一个网络共享,如我们所见的例子。
|
||||
|
||||
### 在Ubuntu桌面安装一个网络扫描仪 ###
|
||||
|
||||
这里是通过Ubuntu桌面客户端安装和访问一台网络扫描仪的一些步骤。假设网络扫描仪服务器已经启动并运行所述[here][3].
|
||||
|
||||
|
||||
**1)**让我们第一步来检查在我们的Ubuntu客户端主机上是否存在一台可用的扫描仪。没有先前的安装,你将会看到信息提示"没有识别到扫描仪."
|
||||
$ scanimage -L
|
||||
|
||||

|
||||
|
||||
|
||||
**2)** 现在我们需要启用saned进程,用来预装Ubuntu桌面。要启用它,我们需要编辑/etc/default/saned文件,并设置RUN变量为yes:
|
||||
$ sudo vim /etc/default/saned
|
||||
|
||||
----------
|
||||
|
||||
# Set to yes to start saned
|
||||
RUN=yes
|
||||
|
||||
|
||||
**3)** 让我们编辑/etc/sane.d/net.conf文件,并在扫描仪安装后添加服务器IP地址:
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
**4)** 重启saned进程:
|
||||
$ sudo service saned restart
|
||||
|
||||
|
||||
|
||||
**5)** 现在让我们来看看扫描仪是否可用:
|
||||

|
||||
|
||||
|
||||
现在我们可以打开"Simple Scan"(或者其它扫描工具)并开始扫描文件。我们可以旋转,修剪,和保存生成的图片:
|
||||
|
||||

|
||||
|
||||
|
||||
### 总结 ###
|
||||
|
||||
|
||||
拥有一或多台网络打印机或扫描仪在任何办公和家庭网络中都是非常方便适用的,并同时提供了许多好处。例举如下:
|
||||
|
||||
- 多用户(从不同的平台/地方)都能够向打印机发送打印作业的队列。
|
||||
|
||||
- 由于硬件共享达到了节约成本和维护的作用。
|
||||
|
||||
我希望这篇文章可以帮助你更充分地利用这些有点。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/2014/08/configure-network-printer-scanner-ubuntu-desktop.html
|
||||
|
||||
作者:[Gabriel Cánepa][a]
|
||||
译者:[disylee](https://github.com/disylee)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/gabriel
|
||||
[1]:http://xmodulo.com/2014/08/usb-network-printer-and-scanner-server-debian.html
|
||||
[2]:http://www.cups-pdf.de/documentation.shtml
|
||||
[3]:http://xmodulo.com/2014/08/usb-network-printer-and-scanner-server-debian.html#scanner
|
||||
@@ -1,113 +0,0 @@
|
||||
2014年学习如何使用vim处理文件工作
|
||||
================================================================================
|
||||
|
||||
作为一名开发者你不能够只化时间去写你想要的代码。其中最难以处理的部分是我的工作只使用vim来处理文本。我感觉到很无语与无比的蛋疼,vim没有自己额外文件查看系统与内部打开与切换文件功能。因此,继vim之后,我主要使用Eclipse 和 Sublime Text.
|
||||
|
||||
就此,我非常欣赏深度定制的vim文件管理功能。在工作环境上我已经装配了这些工具,甚至比起那些视觉编辑器好很多。因为这个是纯键盘操作,促使我可以更加快地移动我的代码。第一篇文章使我明白这个vim内建功能只是处理文件的另一选择。在这篇文章里我会带你去认识vim文件管理功能与使用更高级的插件。
|
||||
|
||||
### 基础篇:打开新文件 ###
|
||||
|
||||
学习vim其中最大的一个障碍是缺少可视提示,不像现在的GUI图形编辑器,当你在终端打开一个新的vim是没有明显的提示去提醒你去走什么,所有事情都是靠键盘输入,同时也没有更多更好的界面交互,vim新手需要习惯如何靠自己去查找一些基本的操作指令。好吧,让我开始学习基础吧。
|
||||
|
||||
创建新文件的命令是**:e <filename>或:e** 打开一个新缓冲区保存文件内容。如果文件不存在它会开辟一个缓冲区去保存与修改你指定文件。缓冲区是vim是术语,意为"保存文本块到内存"。文本是否能够与存在的文件关联,要看是否每个你打开的文件都对应一个缓冲区。
|
||||
|
||||
|
||||
打开文件与修改文件之后,你可以使用**:w**命令来保存在缓冲区的文件内容到文件里面,如果缓冲区不能关联你的文件或者你想保存到另外一个地方,你需要使用**:w <filename>**来保存指定地方。
|
||||
|
||||
这些是vim处理文件的基本知识,很多的开发者都掌握了这些命令,这些技巧你都需要掌握。vim提供了很多技巧让人去深挖。
|
||||
|
||||
|
||||
### 缓冲区管理 ###
|
||||
|
||||
基础掌握了,就让我来说更多关于缓冲区得东西,vim处理打开文件与其他编辑器有一点不同,打开的文件不会作为一个标签留在一个可视地方,而是只允许你同时只有一个文件在缓冲区打开,vim允许你多个缓存打开。一些会显示出来,另外一些就不会,你需要用**:ls**来查看已经打开的缓存,这个命令会显示每个打开的缓存区,同时会有它们的序码,你可以通过这些序码实用**:b <buffer-number>**来切换或者使用循序移动命令**:bnext** 和 **:bprevious** 也可以使用它们的缩写**:bn**和**:bp**。
|
||||
|
||||
这些命令是vim管理文件缓冲区的一个基础,我发现他们不会按照我的思维去映射出来。我不想关心缓冲区的顺序,我只想按照我的思维去到那个文件或者想在当前这个文件.因此必需了解vim更深的缓存模式,我不是推荐你必须内部命令来作为主要的文件管理方案。但这些的确是很强大可行的选择。
|
||||
|
||||

|
||||
|
||||
### 分屏 ###
|
||||
|
||||
分屏是vim其中一个最好用的管理文件功能,在vim
|
||||
你可以在当前窗同时分开2个窗口,可以按照你喜欢的配置去重设大小和分配,这个很特别可以在不同地方同时打开6文件每个文件都拥有自己的窗口大少
|
||||
|
||||
你可以通过命令**:sp <filename>**来新建水平分割窗口或者 **:vs <filename>**垂直分割窗口。你可以使用这些关键命令去重置你想要的窗口,
|
||||
老实说,我喜欢用鼠标处理vim任务,因为鼠标能够给我更加准确的两列的宽度而不需要猜大概的宽度。
|
||||
|
||||
创建新的分屏后,你需要使用**ctrl-w
|
||||
[h|j|k|l]**来向后向前切换。这个有少少笨拙,但这个确实很重要很普遍很容易很高效的操作.如果你经常使用分屏,我建议你去.vimrc使用以下代码q去设置别名为**ctrl-h** **ctrl-j** 等等。
|
||||
|
||||
nnoremap <C-J> <C-W><C-J> "Ctrl-j to move down a split
|
||||
nnoremap <C-K> <C-W><C-K> "Ctrl-k to move up a split
|
||||
nnoremap <C-L> <C-W><C-L> "Ctrl-l to move right a split
|
||||
nnoremap <C-H> <C-W><C-H> "Ctrl-h to move left a split
|
||||
|
||||
### 跳转表 ###
|
||||
|
||||
分屏是解决多个关联文件同时查看问题,但我们仍然不能满足打开文件与隐藏文件之间快速移动。这时跳转表是一个能够解决的工具。
|
||||
|
||||
跳转表是众多插件中看其来奇怪而且很少使用。vim能够追踪每一步命令还有切换你正在修改的文件。每次从一个分屏窗口跳到另外一个,vim都会添加记录到跳转表里面。这个记录你去过的地方,这样就不需要担心之前的文件在哪里,你可以使用快捷键去快速追溯你的踪迹。**Ctrl-o**允许你返回你上一次地方。重复操作几次就能够返回到你最先编写的代码段地方。你可以使用**ctrl-i**来向前返回。当你在调试多个文件或两个文件之间切换能够发挥极大的快速移动功能。
|
||||
|
||||
|
||||
### 插件 ###
|
||||
|
||||
如果你想vim像Sublime Text 或者Atom一样,我就让你认清一下,这里有很好的机会让你看到一些难懂,可怕和低效的事情。例如大家会发出"当Sublime有了模糊查找功能,为什么我一定要输入全路径才能够打开文件" "没有侧边栏显示目录树我怎样查看项目结构" 。但vim有了解决方案。这些方案不需要破坏vim的核心。我只需要经常修改vim配置与添加一些最新的插件,这里有3个有用的插件可以让你像Sublime管理文件
|
||||
|
||||
- [CtrlP][1] 是一个跟Sublime的"Go to Anything"栏一样模糊查找文件.它快如闪电并且非常可配置性。我使用它最主要打开文件。我只需知道部分的文件名字不需要记住整个项目结构就可以查找了
|
||||
|
||||
- [The NERDTree][2]
|
||||
这个一个文件管理夹插件,它重复了很多编辑器的有的侧边文件管理夹功能。我实际上很少用它,对于我模糊查找会更加快。对于你接手一个项目,尝试学习项目结构与了解什么可以用是非常方便的,NERDTree是可以自己定制配置,安装它能够代替vim内置的目录工具。
|
||||
|
||||
|
||||
- [Ack.vim][3] 是一个专为vim的代码搜索插件,它允许你跨项目搜索文本。通过Ack 或 Ag 去高亮查找
|
||||
[第二个极其好用的搜索工具][4],允许你在任何时候在你项目之间快速搜索跳转
|
||||
|
||||
|
||||
在vim核心与它的插件生态系统之间,vim 提供足够的工具允许你构建你想要得工作环境。文件管理是软件开发系统的最核心部分并且你值得拥有体验的权利
|
||||
|
||||
|
||||
开始是需要通过很长的时间去理解它们,然后才找到你感觉舒服的工作流程之后才开始添加工具在上面。但依然值得你去使用,当你不需要头爆去理解如何去使用就能够轻易编写你的代码。
|
||||
|
||||
|
||||
### 更多插件资源 ###
|
||||
|
||||
- [Seamlessly Navigate Vim & Tmux Splits][5] 这个插件需要每一个想使用它的人都要懂得实用[tmux][6],这个跟vim的splits 一样简单好用
|
||||
|
||||
|
||||
- [Using Tab Pages][7] 它是一个vim的标签功能插件,虽然它的名字用起来有一点疑惑,但我不能说它是文件管理器。
|
||||
对如何在有多个工作可视区使用"tab
|
||||
pages" 在vim wiki 网站上有更好的概述
|
||||
|
||||
- [Vimcasts: The edit command][8] 一般来说 Vimcasts
|
||||
是大家学习vim的一个好资源。这个屏幕截图与一些内置工作流程是很好描述之前说得文件操作方面的知识
|
||||
|
||||
|
||||
### 订阅 ###
|
||||
|
||||
这篇文章通过第三个方面介绍如何通过一些好的手法学习vim。如果你喜欢这篇文章你可以通过[feed][8]来订阅或email我[mailing
|
||||
list][10]。在这个星期javascript小插曲之后,下星期我会继续介绍vim的配置方面的东西,你可以先看基础篇:使用vim
|
||||
看我前2篇系列文章和vim与vi的语言
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://benmccormick.org/2014/07/07/learning-vim-in-2014-working-with-files/
|
||||
|
||||
作者:[Ben McCormick][a]
|
||||
译者:[译者ID](https://github.com/haimingfg)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://benmccormick.org/2014/07/07/learning-vim-in-2014-working-with-files/
|
||||
[1]:https://github.com/kien/ctrlp.vim
|
||||
[2]:https://github.com/scrooloose/nerdtree
|
||||
[3]:https://github.com/mileszs/ack.vim
|
||||
[4]:http://benmccormick.org/2013/11/25/a-look-at-ack/
|
||||
[5]:http://robots.thoughtbot.com/seamlessly-navigate-vim-and-tmux-splits
|
||||
[6]:http://tmux.sourceforge.net/
|
||||
[7]:http://vim.wikia.com/wiki/Using_tab_pages
|
||||
[8]:http://vimcasts.org/episodes/the-edit-command/
|
||||
[9]:http://feedpress.me/benmccormick
|
||||
[10]:http://eepurl.com/WFYon
|
||||
[11]:http://benmccormick.org/2014/07/14/learning-vim-in-2014-configuring-vim/
|
||||
[12]:http://benmccormick.org/2014/06/30/learning-vim-in-2014-the-basics/
|
||||
[13]:http://benmccormick.org/2014/07/02/learning-vim-in-2014-vim-as-language/
|
||||
Reference in New Issue
Block a user