mirror of
https://github.com/LCTT/TranslateProject.git
synced 2026-08-26 04:13:30 +08:00
@@ -1,12 +1,12 @@
|
||||
Linux有问必答 -- 如何在CentOS7上改变网络接口名
|
||||
Linux有问必答:如何在CentOS7上改变网络接口名
|
||||
================================================================================
|
||||
> **提问**: 在CentOS7,我想将分配的网络接口名更改为别的名字。有什么合适的方法来来重命名CentOS或RHEL7的网络接口?
|
||||
|
||||
传统上,Linux的网络接口被枚举为eth[0123...],但这些名称并不一定符合实际的硬件插槽,PCI位置,USB接口数量等,这引入了一个不可预知的命名问题(例如,由于不确定的设备探测行为),这可能会导致不同的网络配置错误(例如,由无意的接口改名引起的禁止接口或者防火墙旁路)。基于MAC地址的udev规则在虚拟化的环境中并不有用,这里的MAC地址如端口数量一样无常。
|
||||
|
||||
CentOS/RHEL6还推出了[一致和可预测的网络设备命名][1]网络接口的方法。这些特性可以唯一地确定网络接口的名称以使定位和区分设备更容易,并且在这样一种方式下,它随着启动,时间和硬件改变的情况下是持久的。然而,这种命名规则并不是默认在CentOS/RHEL6上开启。
|
||||
CentOS/RHEL6引入了[一致和可预测的网络设备命名][1]网络接口的方法。这些特性可以唯一地确定网络接口的名称以使定位和区分设备更容易,并且在这样一种方式下,无论是否重启机器、过了多少时间、或者改变硬件,其名字都是持久不变的。然而,这种命名规则并不是默认在CentOS/RHEL6上开启。
|
||||
|
||||
从CentOS/RHEL7起,可预见的命名规则变成了默认。根据这一规则,接口名称被自动基于固件,拓扑结构和位置信息来确定。现在,即使添加或移除网络设备,接口名称仍然保持固定,而无需重新枚举,和坏掉的硬件可以无缝替换。
|
||||
从CentOS/RHEL7起,这种可预见的命名规则变成了默认。根据这一规则,接口名称被自动基于固件,拓扑结构和位置信息来确定。现在,即使添加或移除网络设备,接口名称仍然保持固定,而无需重新枚举,和坏掉的硬件可以无缝替换。
|
||||
|
||||
* 基于接口类型的两个字母前缀:
|
||||
* en -- 以太网
|
||||
@@ -14,7 +14,7 @@ CentOS/RHEL6还推出了[一致和可预测的网络设备命名][1]网络接口
|
||||
* wl -- wlan
|
||||
* ww -- wwan
|
||||
*
|
||||
* Type of names:
|
||||
* 名字类型:
|
||||
* b<number> -- BCMA总线和新书
|
||||
* ccw<name> -- CCW总线组名
|
||||
* o<index> -- 车载设备的索引号
|
||||
@@ -43,7 +43,7 @@ CentOS/RHEL6还推出了[一致和可预测的网络设备命名][1]网络接口
|
||||
|
||||

|
||||
|
||||
接下来,编辑(或创建)一个udev的网络命名规则文件(/etc/udev/rules.d/70-persistent-net.rules),并添加下面一行。更换成你自己的MAC地址和接口。
|
||||
接下来,编辑(或创建)一个udev的网络命名规则文件(/etc/udev/rules.d/70-persistent-net.rules),并添加下面一行。更换成你自己的MAC地址(08:00:27:a9:7a:e1)和接口(sushi)。
|
||||
|
||||
$ sudo vi /etc/udev/rules.d/70-persistent-net.rules
|
||||
|
||||
@@ -62,7 +62,7 @@ CentOS/RHEL6还推出了[一致和可预测的网络设备命名][1]网络接口
|
||||
via: http://ask.xmodulo.com/change-network-interface-name-centos7.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,24 +1,17 @@
|
||||
Git Rebase教程: 用Git Rebase让时光倒流
|
||||
================================================================================
|
||||

|
||||
|
||||
Christoph Burgdorf自10岁时就是一名程序员,他是HannoverJS Meetup网站的创始人,并且一直活跃在AngularJS社区。他也是非常了解gti的内内外外,在那里他举办一个[thoughtram][1]的工作室来帮助初学者掌握该技术。
|
||||
|
||||
下面的教程最初发表在他的[blog][2]。
|
||||
|
||||
----------
|
||||
|
||||
### 教程: Git Rebase ###
|
||||
|
||||
想象一下你正在开发一个激进的新功能。这将是很灿烂的但它需要一段时间。您这几天也许是几个星期一直在做这个。
|
||||
|
||||
你的功能分支已经超前master有6个提交了。你是一个优秀的开发人员并做了有意义的语义提交。但有一件事情:你开始慢慢意识到,这个野兽仍需要更多的时间才能真的做好准备被合并回主分支。
|
||||
你的功能分支已经超前master有6个提交了。你是一个优秀的开发人员并做了有意义的语义提交。但有一件事情:你开始慢慢意识到,这个疯狂的东西仍需要更多的时间才能真的做好准备被合并回主分支。
|
||||
|
||||
m1-m2-m3-m4 (master)
|
||||
\
|
||||
f1-f2-f3-f4-f5-f6(feature)
|
||||
|
||||
你也知道的是,一些地方实际上是少耦合的新功能。它们可以更早地合并到主分支。不幸的是,你想将部分合并到主分支的内容存在于你六个提交中的某个地方。更糟糕的是,它也包含了依赖于你的功能分支的之前的提交。有人可能会说,你应该在第一处地方做两次提交,但没有人是完美的。
|
||||
你也知道的是,一些地方实际上是交叉不大的新功能。它们可以更早地合并到主分支。不幸的是,你想将部分合并到主分支的内容存在于你六个提交中的某个地方。更糟糕的是,它也包含了依赖于你的功能分支的之前的提交。有人可能会说,你应该在第一处地方做两次提交,但没有人是完美的。
|
||||
|
||||
m1-m2-m3-m4 (master)
|
||||
\
|
||||
@@ -39,11 +32,11 @@ Christoph Burgdorf自10岁时就是一名程序员,他是HannoverJS Meetup网
|
||||
|
||||
在将工作分成两个提交后,我们就可以cherry-pick出前面的部分到主分支了。
|
||||
|
||||
原来Git自带了一个功能强大的命令git rebase -i ,它可以让我们这样做。它可以让我们改变历史。改变历史可能会产生问题,并作为一个经验法应尽快避免历史与他人共享。在我们的例子中,虽然我们只是改变我们的本地功能分支的历史。没有人会受到伤害。这这么做了!
|
||||
原来Git自带了一个功能强大的命令git rebase -i ,它可以让我们这样做。它可以让我们改变历史。改变历史可能会产生问题,作为一个经验,应尽快避免历史与他人共享。不过在我们的例子中,我们只是改变我们的本地功能分支的历史。没有人会受到伤害。就这么做了!
|
||||
|
||||
好吧,让我们来仔细看看f3提交究竟修改了什么。原来我们共修改了两个文件:userService.js和wishlistService.js。比方说,userService.js的更改可以直接合入主分支而wishlistService.js不能。因为wishlistService.js甚至没有在主分支存在。这根据的是f1提交中的介绍。
|
||||
好吧,让我们来仔细看看f3提交究竟修改了什么。原来我们共修改了两个文件:userService.js和wishlistService.js。比方说,userService.js的更改可以直接合入主分支而wishlistService.js不能。因为wishlistService.js甚至不存在在主分支里面。它是f1提交中引入的。
|
||||
|
||||
>>专家提示:即使是在一个文件中更改,git也可以搞定。但这篇博客中我们要让事情变得简单。
|
||||
>>专家提示:即使是在一个文件中更改,git也可以搞定。但这篇博客中我们先简化情况。
|
||||
|
||||
我们已经建立了一个[公众演示仓库][3],我们将使用这个来练习。为了便于跟踪,每一个提交信息的前缀是在上面的图表中使用的假的SHA。以下是git在分开提交f3时的分支图。
|
||||
|
||||
@@ -51,26 +44,37 @@ Christoph Burgdorf自10岁时就是一名程序员,他是HannoverJS Meetup网
|
||||
|
||||
现在,我们要做的第一件事就是使用git的checkout功能checkout出我们的功能分支。用git rebase -i master开始做rebase。
|
||||
|
||||
现在接下来git会用配置的编辑器打开(默认为Vim)一个临时文件。
|
||||
现在接下来git会用所配置的编辑器打开(默认为Vim)一个临时文件。
|
||||
|
||||

|
||||
|
||||
该文件为您提供一些rebase选择,它带有一个提示(蓝色文字)。对于每一个提交,我们可以选择的动作有pick、rwork、edit、squash、fixup和exec。每一个动作也可以通过它的缩写形式p、r、e、s、f和e引用。描述每一个选项超出了本文范畴,所以让我们专注于我们的具体任务。
|
||||
|
||||
我们要为f3提交选择编辑选项,因此我们把内容改变成这样。
|
||||
我们要为f3提交选择edit选项,因此我们把内容改变成这样。
|
||||
|
||||

|
||||
|
||||
现在我们保存文件(在Vim中是按下<ESC>后输入:wq,最后是按下回车)。接下来我们注意到git在编辑选项中选择的提交处停止了rebase。
|
||||
|
||||
这意味这git开始为f1、f2、f3生效仿佛它就是常规的rebase但是在f3**之后**停止。事实上,我们可以看一眼停止的地方的日志就可以证明这一点。
|
||||

|
||||
|
||||
这意味这git开始将f1、f2、f3生效仿佛它就是常规的rebase,但是在f3生效**之后**停止。事实上,我们可以看一眼停止的地方的日志就可以证明这一点。
|
||||
|
||||

|
||||
|
||||
要将f3分成两个提交,我们所要做的是重置git的指针到先前的提交(f2)而保持工作目录和现在一样。这就是git reset在混合模式在做的。由于混合模式是git reset的默认模式,我们可以直接用git reset head~1。就这么做并在运行后用git status看下发生了什么。
|
||||
|
||||
git status告诉我们userService.js和wishlistService.js被修改了。如果我们与行git diff 我们就可以看见在f3里面确切地做了哪些更改。
|
||||

|
||||
|
||||
git status告诉我们userService.js和wishlistService.js被修改了。如果我们运行 git diff 我们就可以看见在f3里面确切地做了哪些更改。
|
||||
|
||||

|
||||
|
||||
如果我们看一眼日志我们会发现f3已经消失了。
|
||||
|
||||
现在我们有了准备提交的先前的f3提交而原先的f3提交已经消失了。记住虽然我们仍旧在rebase的中间过程。我们的f4、f5、f6提交还没有缺失,它们会在接下来回来。
|
||||

|
||||
|
||||
现在我们有了准备提交的先前的f3提交,而原先的f3提交已经消失了。记住虽然我们仍旧在rebase的中间过程。我们的f4、f5、f6提交还没有缺失,它们会在接下来回来。
|
||||
|
||||
让我们创建两个新的提交:首先让我们为可以提交到主分支的userService.js创建一个提交。运行git add userService.js 接着运行 git commit -m "f3a: add updateUser method"。
|
||||
|
||||
@@ -78,27 +82,41 @@ git status告诉我们userService.js和wishlistService.js被修改了。如果
|
||||
|
||||
让我们在看一眼日志。
|
||||
|
||||
这就是我们想要的除了f4、f5、f6仍旧缺失。这是因为我们仍在rebase交互的中间,我们需要告诉git继续rebase。用下面的命令继续:git rebase --continue。
|
||||

|
||||
|
||||
这就是我们想要的,除了f4、f5、f6仍旧缺失。这是因为我们仍在rebase交互的中间,我们需要告诉git继续rebase。用下面的命令继续:git rebase --continue。
|
||||
|
||||
让我们再次检查一下日志。
|
||||
|
||||

|
||||
|
||||
就是这样。我们现在已经得到我们想要的历史了。先前的f3提交现在已经被分割成两个提交f3a和f3b。剩下的最后一件事是cherry-pick出f3a提交到主分支上。
|
||||
|
||||
为了完成最后一步,我们首先切换到主分支。我们用git checkout master。现在我们就可以用cherry-pick命令来拾取f3a commit了。本例中我们可以用它的SHA值bd47ee1来引用它。
|
||||
|
||||
现在f3a这个提交i就在主分支的最上面了。这就是我们需要的!
|
||||

|
||||
|
||||
现在f3a这个提交就在主分支的最上面了。这就是我们需要的!
|
||||
|
||||

|
||||
|
||||
这篇文章的长度看起来需要花费很大的功夫,但实际上对于一个git高级用户而言这只是一会会。
|
||||
|
||||
>注:Christoph目前正在与Pascal Precht写一本关于[Git rebase][4]的书,您可以在leanpub订阅它并在准备出版时获得通知。
|
||||
|
||||

|
||||
|
||||
本文作者 Christoph Burgdorf自10岁时就是一名程序员,他是HannoverJS Meetup网站的创始人,并且一直活跃在AngularJS社区。他也是非常了解gti的内内外外,在那里他举办一个[thoughtram][1]的工作室来帮助初学者掌握该技术。
|
||||
|
||||
本的教程最初发表在他的[blog][2]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.codementor.io/git-tutorial/git-rebase-split-old-commit-master
|
||||
|
||||
作者:[cburgdorf][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/) 荣誉推出
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
Linux 上一些很好用的文献目录管理工具
|
||||
================================================================================
|
||||
你是否写过一些很长很长的文章,以至于你会认为你永远都看不到它的结束?那么你会很明白最糟糕的不是你投入了多少的时间,而是一旦你完成,你仍然要制定和格式化你的所引用的一些参考文献。很幸运的是,Linux 有很多的解决方案:参考书目和文献管理工具。借助BibTex的力量,这些工具可以帮你导入引用源,然后自动生成一个结构化文献目录。这里给大家提供了一些Linux上不完全的参考文献管理工具。
|
||||
你是否写过一些很长很长的文章,以至于你会认为你永远都看不到它的结束?那么你会很明白最糟糕的不是你投入了多少的时间,而是一旦你完成,你仍然要制定和格式化你的所引用的一些参考文献。很幸运的是,Linux 有很多的解决方案:参考书目和文献管理工具。借助BibTex的力量,这些工具可以帮你导入引用源,然后自动生成一个结构化文献目录。这里给大家提供了一些Linux上参考文献管理工具的不完全列表。
|
||||
|
||||
### 1. Zotero ###
|
||||
|
||||

|
||||
|
||||
这应该是最著名的参考文献聚集工具,[Zotero][1]作为一个浏览器的扩展插件。当然,它也有一个方便的Linux 独立工具。拥有强大的性能,Zotero 很容易上手,并且也可以和LibreOffice 或者是其他的文本编辑器配套使用来管理文档的参考文献。我个人很欣赏其操作界面和插件管理器。可惜的是,Zotero 有很快就会受到限制,如果你参考文献有很多不同的需求。
|
||||
这应该是最著名的参考文献聚集工具,[Zotero][1]作为一个浏览器的扩展插件。当然,它也有一个方便的Linux 独立工具。拥有强大的性能,Zotero 很容易上手,并且也可以和LibreOffice 或者是其他的文本编辑器配套使用来管理文档的参考文献。我个人很欣赏其操作界面和插件管理器。可惜的是,如果你对参考文献有很多不同的需求的话,很快就会发现 Zotero 功能有限。
|
||||
|
||||
### 2. JabRef ###
|
||||
|
||||

|
||||
|
||||
[JabRef][2] 是最先进的文献管理工具之一。你可以导入大量的格式,可以在其外部的数据库里查找相应的条目(像Google Scholar),并且能直接输出到你喜欢的编辑器。JabRef 可以很好的兼容你的运行环境,甚至也支持插件。最后还有一点,JabRef可以连接你自己的SQL 数据库。而唯一的缺点就是其学习的难度。
|
||||
[JabRef][2] 是最先进的文献管理工具之一。你可以导入大量的格式,可以在其外部的数据库里查找相应的条目(像Google Scholar),并且能直接输出到你喜欢的编辑器。JabRef 可以很好的兼容你的运行环境,甚至也支持插件。最后还有一点,JabRef可以连接你自己的SQL 数据库。而唯一的缺点就是其学习使用的难度。
|
||||
|
||||
### 3. KBibTex ###
|
||||
|
||||

|
||||
|
||||
对于KDE 使用者,桌面环境也拥有它自己专有的文献管理工具[KBibTex][3]。正如你所期望的必须承诺交付的质量。这个程序高度可定制,通过快捷键就可以很好的操作和体验。你可以很容易找到副本,可以预览结果,也可以直接输出到LaTex 编辑器。而我认为这款软件最大的特色在于它集成了Bigsonomy ,Google Scholar ,甚至是你的Zotero账号。唯一的缺憾是界面看起来实在是有点乱。多花点时间设置软件可以让你使用起来得心应手。
|
||||
对于 KDE 使用者,这个桌面环境也拥有它自己专有的文献管理工具[KBibTex][3]。这个程序的品质,正如你所期望。程序可高度定制,通过快捷键就可以很好的操作和体验。你可以很容易找到副本、可以预览结果、也可以直接输出到LaTex 编辑器。而我认为这款软件最大的特色在于它集成了Bigsonomy ,Google Scholar ,甚至是你的Zotero账号。唯一的缺憾是界面看起来实在是有点乱。多花点时间设置软件可以让你使用起来得心应手。
|
||||
|
||||
### 4. Bibfilex ###
|
||||
|
||||

|
||||
|
||||
可以运行在Gtk 和Qt 环境中,[Bibfilex][4]是一个基于Biblatex 的界面友好的工具。相对于JabRef 和KBibTex ,缺少了一些高级的功能,但这也让他更加的快速和轻巧。不用想太多,这绝对是快速做文献目录的一个聪明的选择。界面很平滑,仅仅反映了一些必要的功能。我给出了其使用的完全手册,你可以从官方的[下载页面][5]去获得。
|
||||
可以运行在Gtk 和Qt 环境中,[Bibfilex][4]是一个基于 Biblatex 的界面友好的工具。相对于JabRef 和KBibTex ,缺少了一些高级的功能,但这也让他更加的快速和轻巧。不用想太多,这绝对是快速做文献目录的一个聪明的选择。界面很舒服,仅仅反映了一些必要的功能。我给出了其使用的完全手册,你可以从官方的[下载页面][5]去获得。
|
||||
|
||||
5. Pybliographer
|
||||
### 5. Pybliographer ###
|
||||
|
||||

|
||||
|
||||
正如它的名字一样,[Pybliographer][6]是一个用Python 写的非图形化的文献目录管理工具。我个人比较喜欢把Pybiographic 当做是图形化的前端。它的界面极其简洁和抽象。如果你仅仅需要输出少数的参考文献,而且也确实没有时间去学习更多的工具软件,那么Pybliographer 确实是一个不错的选择。有一点点像Bibfilex 的是,它是以让用户方便、快速的使用为目标的。
|
||||
正如它的名字一样,[Pybliographer][6]是一个用 Python 写的非图形化的文献目录管理工具。我个人比较喜欢把Pybiographic 当做是图形化的前端。它的界面极其简洁和抽象。如果你仅仅需要输出少数的参考文献,而且也确实没有时间去学习更多的工具软件,那么 Pybliographer 确实是一个不错的选择。有一点点像 Bibfilex 的是,它是以让用户方便、快速的使用为目标的。
|
||||
|
||||
### 6. Referencer ###
|
||||
|
||||

|
||||
|
||||
这应该是我归纳这些时候的一个最大的惊喜,[Referencer][7] 确实是让人眼前一亮。完美兼容Gnome ,它可以查找和导入你的文档,然后在网上查询他们的参考文献,并且输出到LyX ,非常的性感和很好的设计。为数不多的几个快捷键和插件让它拥有了图书馆的风格。
|
||||
这应该是我归纳这些时候的一个最大的惊喜,[Referencer][7] 确实是让人眼前一亮。完美兼容 Gnome ,它可以查找和导入你的文档,然后在网上查询他们的参考文献,并且输出到 LyX ,非常的漂亮和设计良好。为数不多的几个快捷键和插件让它拥有了图书馆的风格。
|
||||
|
||||
总的来说,很感谢这些工具软件,有了它们,你就可以不用再担心长长的文章了,至少是不用再担心参考文献的部分了。那么我们还有什么遗漏的吗?是否还有其他的文献管理工具你很喜欢?请在评论里告诉我们。
|
||||
|
||||
@@ -46,7 +46,7 @@ via: http://xmodulo.com/reference-management-software-linux.html
|
||||
|
||||
作者:[Adrien Brochard][a]
|
||||
译者:[barney-ro](https://github.com/barney-ro)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
zpl1025
|
||||
Will Linux ever be able to give consumers what they want?
|
||||
================================================================================
|
||||
> Jack Wallen offers up the novel idea that giving the consumers what they want might well be the key to boundless success.
|
||||
@@ -48,4 +49,4 @@ via: http://www.techrepublic.com/article/will-linux-ever-be-able-to-give-consume
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.techrepublic.com/search/?a=jack+wallen
|
||||
[1]:http://www.techrepublic.com/article/is-the-cloudbook-the-future-of-linux/
|
||||
[1]:http://www.techrepublic.com/article/is-the-cloudbook-the-future-of-linux/
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
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/) 荣誉推出
|
||||
@@ -1,149 +0,0 @@
|
||||
Translating----geekpi
|
||||
|
||||
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,110 @@
|
||||
Linux 有问必答-- 如何使用Linux命令行检测DVD刻录机的名字和它的读写速度
|
||||
================================================================================
|
||||
> **提问**:我想要知道我的DVD刻录机的名字和在烧录时的速度。该使用什么Linux命令行工具来连测DVD刻录机的设备名和速度?
|
||||
|
||||
如今大多数消费PC和笔记本电脑都配备了DVD刻录机。在Linux中,光盘驱动器,如CD/ DVD驱动器的名字是在引导时内核基于udev规则来命名的。有几种方法来检测刻录机的设备名称和它的写入速度。
|
||||
|
||||
|
||||
### 方法一 ###
|
||||
|
||||
找出与DVD刻录机相关的设备名称最简单的方法是使用dmesg命令行工具,它打印出内核的消息缓冲区。在dmesg的输出中,寻找一个潜在的DVD刻录机:
|
||||
$ dmesg | egrep -i --color 'dvd|cd/rw|writer'
|
||||
|
||||

|
||||
|
||||
上述命令的输出会告诉你你的Linux系统上是否检测到了DVD刻录机以及它被分配的名字。本例中,DVD刻录机的设备名称为“/dev/sr0”。虽然此方法不会告诉你的写入速度
|
||||
|
||||
### 方法二 ###
|
||||
|
||||
第二个获得你DVD刻录机的信息是使用lsscsi命令,它只是列出了所有可用的SCSI设备。
|
||||
|
||||
在基于Debian Linux上安装 **lsscsi**:
|
||||
|
||||
$ sudo apt-get install lsscsi
|
||||
|
||||
在基于Red Hat Linux上安装:
|
||||
|
||||
$ sudo yum install lsscsi
|
||||
|
||||
如果成功检测到,lsscsi命令的输出会告诉你DVD刻录机的名称:
|
||||
|
||||
$ lsscsi
|
||||
|
||||

|
||||
|
||||
这也不会告诉你刻录机更多的细节,比如写入速度。
|
||||
|
||||
### 方法三 ###
|
||||
|
||||
第三种获取有关你DVD刻录机的信息是参考/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
|
||||
|
||||
本例中,输出会告诉你DVD刻录机(/dev/sr0)与x24的CD刻录速度(即24x153.6 Kbps)兼容,且相当于x3的DVD写入速度(即3x1385 KBps的)兼容。这里的写入速度是最大可能的速度,而实际的写入速度当然取决于使用的介质(例如:DVD-RW、DVD + RW、DVD-RAM等)。
|
||||
|
||||
### 方法四 ###
|
||||
|
||||
另一种方法是使用一种称为wodim命令行程序。在大多数的Linux发行版,这个工具以及它的软链接cdrecord都是默认安装的。
|
||||
|
||||
# wodim -prcap
|
||||
(or cdrecord -prcap)
|
||||
|
||||

|
||||
|
||||
如果不带任何参数调用时,wodim命令会自动检测到DVD刻录机,并显示出详细的功能以及它的最大读取/写入速度。例如,你可以找出刻录机支持哪些媒体(如CD-R、CD-RW、DVD-RW、DVD-ROM、DVD-R、DVD-RAM、音频CD),以及有哪些如何读/写速度。上面的例子中输出显示,DVD刻录机对于CD拥有X24最大写入速度,对于DVD有X3的最大写入速度。
|
||||
|
||||
需要注意的是wodim命令报告的写入速度会随您插入到DVD刻录机的CD/DVD介质的改变而改变,这反映了媒体规范。
|
||||
|
||||
### 方法五 ###
|
||||
|
||||
还有一个方法来检查DVD刻录机的写入速度的是一个名为dvd+rw-mediainfo的工具,这是dvd+rw工具包(DVD+-RW/R媒体工具链)的一部分。
|
||||
|
||||
在基于Debian 发行版上安装 **dvd+rw-tools**
|
||||
|
||||
$ sudo apt-get install dvd+rw-tools
|
||||
|
||||
在基于Red Hat 发行版上安装 dvd+rw-tools:
|
||||
|
||||
$ sudo yum install dvd+rw-tools
|
||||
|
||||
不像其他工具, dvd+rw-mediainfo命令不会产生任何输出,除非你插入DVD光盘到刻录机中。所以,当你插入DVD光盘后,运行以下的命令。用你自己的设备名称替换“/dev/sr0”。
|
||||
|
||||
$ sudo dvd+rw-mediainfo /dev/sr0
|
||||
|
||||

|
||||
|
||||
** dvd+rw-mediainfo**工具探测插入的媒体(本例中是“DVD-R”),以找出对媒体的实际写入速度。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/detect-dvd-writer-device-name-writing-speed-command-line-linux.html
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
@@ -0,0 +1,148 @@
|
||||
如何在Linux上验证下载文件的可靠性和完整性
|
||||
================================================================================
|
||||
当你从网上下载一个文件后(比如:安装程序、ISO镜像或者一个压缩包),文件可能在不同的情况下发生了损坏,比如:由于线路传输错误、中断的下载、存储硬件错误、文件系统错误等等。除了这些错误,文件还可能在下载前或者下载中的攻击而被有意地篡改了。比如,一个攻破证书颁发机构的攻击者可以实施一个MITM攻击(中间人攻击),欺骗你从HTTPS网站上下载隐藏恶意软件的文件。
|
||||
|
||||
要保护你自己免受这些问题的困扰,建议你验证你从网上下载的文件的可靠性和完整性。特别是你下载了一个非常敏感的文件的时候)(比如:操作系统镜像、二进制应用程序、可执行安装包等等),盲目地相信下载的文件不是一个好习惯。
|
||||
|
||||
一个快速和简单地验证下载文件的完整性的方法是使用不同的校验工具(比如:md5sum、sha356sum、cksum)来计算和比较校验码(比如:MD5、SHA、CRC)。然而,然而校验容易受到[碰撞攻击][1],而且同样不能用于验证文件的可靠性(比如:拥有者)。
|
||||
|
||||
integrity by using GnuPG (GNU Privacy Guard).
|
||||
如果你想要同时验证下载文件的可靠性(拥有者)和完整性(内容),你需要依赖于加密签名。本教程中,我会描述如何使用GnuPG(GNU Privacy Guard)来检查文件的可靠性和完整性。
|
||||
|
||||
本例中我会验证一个从https://onionshare.org上下载的磁盘镜像。这个网站中,发行商会提供他们的公钥,还有它用于密钥验证的指纹。
|
||||
|
||||

|
||||
|
||||
至于下载的文件,发行上也会提供它相关的PGP签名。
|
||||
|
||||

|
||||
|
||||
### 安装 GnuPG 并且生成一个键对 ###
|
||||
|
||||
让我们首先在你的Linux系统上安装GnuPG。
|
||||
|
||||
在Debian、Ubuntu和其他Debian衍生版上:
|
||||
|
||||
$ sudo apt-get install gnupg
|
||||
|
||||
在Fedora、CentOS或者RHEL上:
|
||||
|
||||
$ sudo yum install gnupg
|
||||
|
||||
完成安装后,生成一个本篇中会使用到的键对。
|
||||
|
||||
$ gpg --gen-key
|
||||
|
||||

|
||||
|
||||
在生成中间,你会被要求提供你的姓名和email,还有保护你私钥的密码。你同样也可以在键对要过期的时候选择(默认不会过期)。依赖于你选择的key的大小(在1024和4096位之间),key生成会花上几分钟或者更多,这由于它要求收集来自你桌面活动的大量的随机数据。(比如键盘输入、鼠标移动、磁盘访问等等)。
|
||||
|
||||
一旦key生成完毕后,公钥和私钥会存储在~/.gnupg目录。
|
||||
|
||||

|
||||
|
||||
### 与某个文件和拥有者建立信任 ###
|
||||
|
||||
验证下载文件的第一步是与任何提供文件下载的人建立信任。出于此,我们下载了这个文件的公钥,并且验证公钥的拥有者是否是他或者她自称的。
|
||||
|
||||
在下载玩文件拥有者的公钥后:
|
||||
|
||||
$ wget https://onionshare.org/signing-key.asc
|
||||
|
||||
使用gpg命令导入公钥到你的keyring中
|
||||
|
||||
$ gpg --import signing-key.asc
|
||||
|
||||

|
||||
|
||||
一旦拥有者的共要导入后,他会像下面那样打印出一个key ID(比如:"EBA34B1C")。记住这个key ID。
|
||||
|
||||
现在,运行下面的命令检查导入的公钥的指纹:
|
||||
|
||||
$ gpg --fingerprint EBA34B1C
|
||||
|
||||

|
||||
|
||||
你会看到key的指纹字符串。把这个和网站上显示的指纹做对比。如果匹配,你可以选择信任这个文件拥有者的公钥。
|
||||
|
||||
一旦你决定相信这个公钥,你可以通过编辑key来标记它:
|
||||
|
||||
$ gpg --edit-key EBA34B1C
|
||||
|
||||
这个命令会显示GPG提示符:
|
||||
|
||||

|
||||
|
||||
在GPG提示符中输入“trust”,它会让你从1-5之间选择这个key的信任等级。
|
||||
|
||||

|
||||
|
||||
本例中,我决定分配给它“4”,在这之后,输入“sign”用你自己的私钥签名,接着输入在GPG提示符中输入“save”来完成操作。
|
||||
|
||||

|
||||
|
||||
要注意的是不需要这样明确地给一个公钥指派信任,通过key的导入隐式地信任往往就够了。
|
||||
|
||||
给一个key隐式地分配给“完全”的信任就是任何其他由这个完全信任签名的key X都会被认为是对你有效的。通常上,key验证依赖于一个复杂的机制称之为“[信任网][2]”
|
||||
|
||||
回到教程,现在让我们检查导入的key列表。
|
||||
|
||||
$ gpg --list-keys
|
||||
|
||||

|
||||
|
||||
你至少会看到两个key:一个带 depth 0和终极信任("1u"),这就是你自己的key,另外一个带depth 1和完全信任("1f"),这是你之前签名的key。
|
||||
|
||||
### 验证文件的可靠性/完整性 ###
|
||||
|
||||
一旦你建立了与文件拥有者和他的/她的公钥之间的信任关系,我们需要验证你从拥有者那边下载的文件的可靠性和完整性了。
|
||||
|
||||
本例中,文件拥有者分别公布了一个文件和它相关的PGP签名(.asc)。签名的角色就是认证并且在文件中加入一个时间戳
|
||||
|
||||
一个典型的签名(*.asc)看上去像这样。
|
||||
|
||||
-----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-----
|
||||
|
||||
现在让我们同时下载它的文件和签名:
|
||||
|
||||
$ wget https://onionshare.org/files/0.6/OnionShare.dmg
|
||||
$ wget https://onionshare.org/files/0.6/OnionShare.dmg.asc
|
||||
|
||||
现在验证下载文件的PGP签名。
|
||||
|
||||
$ gpg --verify OnionShare.dmg.asc OnionShare.dmg
|
||||
|
||||

|
||||
|
||||
如果命令的输出包含了“Good signature from <文件所属者>”,那么下载的.dmg文件就被成功地认证和核实了。如果下载的文件的任何地方在签名后被篡改了,那么验证就会失败。
|
||||
|
||||
这时你就可以放心地信任你下载的文件了。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/verify-authenticity-integrity-downloaded-file.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者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
|
||||
@@ -1,14 +1,14 @@
|
||||
使用Linux命令行嗅探HTTP流量
|
||||
================================================================================
|
||||
假设由于某种原因,你需要嗅探HTTP站点的流量(如HTTP请求与响应)。举个例子,你可能在测试一个web服务器的实验性功能,或者 你在为某个web应用或RESTful服务排错,又或者你正在为PAC排错或寻找某个站点下载的恶意软件。不论什么原因,在这些情况下,进行HTTP流量嗅探对于系统管理、开发者、甚至最终用户来说都是很有帮助的。
|
||||
假设由于某种原因,你需要嗅探HTTP站点的流量(如HTTP请求与响应)。举个例子,你可能在测试一个web服务器的实验性功能,或者你在为某个web应用或RESTful服务排错,又或者你正在为PAC(proxy auto config)排错或寻找某个站点下载的恶意软件。不论什么原因,在这些情况下,进行HTTP流量嗅探对于系统管理、开发者、甚至最终用户来说都是很有帮助的。
|
||||
|
||||
数据包嗅工具tcpdump被广泛用于实时数据包的导出,但是你需要设置过滤规则来捕获HTTP流量,甚至它的原始输出通常不能方便的停 在HTTP协议层。实时web服务器日志解析器如[ngxtop][3]提供可读的实时web流量跟踪痕迹,但这仅适用于可完全访问live web服务器日志的情况。
|
||||
数据包嗅工具tcpdump被广泛用于实时数据包的导出,但是你需要设置过滤规则来捕获HTTP流量,甚至它的原始输出通常不能方便的停在HTTP协议层。实时web服务器日志解析器如[ngxtop][3]提供可读的实时web流量跟踪痕迹,但这仅适用于可完全访问live web服务器日志的情况。
|
||||
|
||||
要是有一个仅用于抓取HTTP流量的类tcpdump的数据包嗅探工具就非常好了。事实上,[httpry][4]就是:**HTTP包嗅探工具**。httpry捕获HTTP数据包,并且将HTTP协议层的数据内容以可读形式列举出来。通过这篇指文章,让我们了解如何使用httpry工具嗅探HTTP流 量。
|
||||
要是有一个仅用于抓取HTTP流量的类tcpdump的数据包嗅探工具就非常好了。事实上,[httpry][4]就是:**HTTP包嗅探工具**。httpry捕获HTTP数据包,并且将HTTP协议层的数据内容以可读形式列举出来。通过这篇指文章,让我们了解如何使用httpry工具嗅探HTTP流量。
|
||||
|
||||
###在Linux上安装httpry###
|
||||
|
||||
在基于Debian系统(Ubuntu 或 LinuxMint),基础仓库中没有httpry安装包(译者注:本人ubuntu14.04,仓库中已有包,可直接安装)。所以我们需要通过源码安装:
|
||||
基于Debian系统(Ubuntu 或 LinuxMint),基础仓库中没有httpry安装包(译者注:本人ubuntu14.04,仓库中已有包,可直接安装)。所以我们需要通过源码安装:
|
||||
|
||||
$ sudo apt-get install gcc make git libpcap0.8-dev
|
||||
$ git clone https://github.com/jbittel/httpry.git
|
||||
@@ -16,11 +16,11 @@
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
||||
在Fedora,CentOS 或 RHEL系统,可以使用如下yum命令安装httpry。在CentOS/RHEL系统上,运行yum之前使能[EPEL repo][5]。
|
||||
在Fedora,CentOS 或 RHEL系统,可以使用如下yum命令安装httpry。在CentOS/RHEL系统上,运行yum之前使齐能够[EPEL repo][5]。
|
||||
|
||||
$ sudo yum install httpry
|
||||
|
||||
如果逆向通过源码来构httpry的话,你可以通过这几个步骤实现:
|
||||
如果你仍想通过基于RPM系统的源码来安装httpry的话,你可以通过这几个步骤实现:
|
||||
|
||||
$ sudo yum install gcc make git libpcap-devel
|
||||
$ git clone https://github.com/jbittel/httpry.git
|
||||
@@ -34,11 +34,11 @@
|
||||
|
||||
$ sudo httpry -i <network-interface>
|
||||
|
||||
httpry就会监听指定的网络接口,并且实时的显示捕获到的HTTP 请求/响。
|
||||
httpry就会监听指定的网络接口,并且实时的显示捕获到的HTTP请求/相应。
|
||||
|
||||

|
||||
|
||||
在大多数情况下,由于发送与接到的数据包过多导致刷屏很快,难以分析。这时候你肯定想将捕获到的数据包保存下来以离线分析。可以使用'b'或'-o'选项保存数据包。'-b'选项将数据包以二进制文件的形式保存下来,这样可以使用httpry软件打开文件以浏览。另 一方面,'-o'选项将数据以可读的字符文件形式保存下来。
|
||||
在大多数情况下,由于发送与接到的数据包过多导致刷屏很快,难以分析。这时候你肯定想将捕获到的数据包保存下来以便离线分析。可以使用'b'或'-o'选项保存数据包。'-b'选项将数据包以二进制文件的形式保存下来,这样可以使用httpry软件打开文件以浏览。另一方面,'-o'选项将数据以可读的字符文件形式保存下来。
|
||||
|
||||
以二进制形式保存文件:
|
||||
|
||||
@@ -54,7 +54,7 @@ httpry就会监听指定的网络接口,并且实时的显示捕获到的HTTP
|
||||
|
||||
$ sudo httpry -i eth0 -o output.txt
|
||||
|
||||
###httpry 的高级应用###
|
||||
###httpry 的高级应用###
|
||||
|
||||
如果你想监视指定的HTTP方法(如:GET,POST,PUT,HEAD,CONNECT等),使用'-m'选项:
|
||||
|
||||
@@ -66,10 +66,10 @@ httpry就会监听指定的网络接口,并且实时的显示捕获到的HTTP
|
||||
|
||||
- **hostnames**: 显示唯一主机名列表.
|
||||
- **find_proxies**: 探测web代理.
|
||||
- **search_terms**: 查找及计算输入检索服务的检索词。
|
||||
- **search_terms**: 查找及计算在搜索服务里面的搜索词。
|
||||
- **content_analysis**: 查找含有指定关键的URL。
|
||||
- **xml_output**: 将输出转换为XML形式。
|
||||
- **log_summary**: 生成日志摘要。
|
||||
- **log_summary**: 生成日志汇总。
|
||||
- **db_dump**: 将日志文件数据保存数据库。
|
||||
|
||||
在使用这些脚本之前,首先使用'-o'选项运行httpry。当获取到输出文件后,立即使用如下命令执行脚本:
|
||||
@@ -77,13 +77,13 @@ httpry就会监听指定的网络接口,并且实时的显示捕获到的HTTP
|
||||
$ cd httpry/scripts
|
||||
$ perl parse_log.pl -d ./plugins <httpry-output-file>
|
||||
|
||||
你可能在使用插件的时候遇到警告。比如,如果你没有安装带有DBI接口的MySQL数据库那么使用db_dump插件时可能会失败。如果一个 插件初始化失败的话,那么这个插件不能使用。所以你可以忽略那些警告。
|
||||
你可能在使用插件的时候遇到警告。比如,如果你没有安装带有DBI接口的MySQL数据库那么使用db_dump插件时可能会失败。如果一个插件初始化失败的话,那么这个插件不能使用。所以你可以忽略那些警告。
|
||||
|
||||
当parse_log.pl完成后,你将在httpry/scripts 目录下看到数个分析结果。例如,log_summary.txt 与如下内容类似。
|
||||
|
||||

|
||||
|
||||
总结,当你要分析HTTP数据包的时候,httpry非常有用。它可能并不被大多Linux使用着所熟知,但会用总是有好处的。你对这个工具有什么看法呢?
|
||||
总的来说,当你要分析HTTP数据包的时候,httpry非常有用。它可能并不被大多Linux使用者所熟知,但会用总是有好处的。你觉得这个工具怎么样呢?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user