mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-01-07 22:11:09 +08:00
commit
5566a971b2
@ -1,20 +1,19 @@
|
||||
为 Linux 用户准备的 10 个开源克隆软件
|
||||
给 Linux 用户的 10 个开源克隆软件
|
||||
================================================================================
|
||||
> 这些克隆软件会读取整个磁盘的数据,将它们转换成一个 .img 文件,之后你可以将它复制到其他硬盘上。
|
||||
|
||||
![](http://1-ps.googleusercontent.com/h/www.efytimes.com/admin/useradmin/photo/150x150x1Qn740810PM9112014.jpg.pagespeed.ic.Ch7q5vT9Yg.jpg)
|
||||
|
||||
磁盘克隆意味着从一个硬盘复制数据到另一个硬盘上,而且你可以通过简单的复制粘贴来做到。但是你却不能复制隐藏文件和文件夹,以及正在使用中的文件。这便是一个克隆软件可以通过保存一份文件和文件夹的镜像来帮助你的地方。克隆软件会读取整个磁盘的数据,将它们转换成一个 .img 文件,之后你可以将它复制到其他硬盘上。现在我们将要向你介绍最优秀的 10 个开源的克隆软件:
|
||||
磁盘克隆的意思是说从一个硬盘复制数据到另一个硬盘上。虽然你可以通过简单的复制粘贴来做到这一点,但是你却不能复制隐藏文件和文件夹,以及正在使用中的文件。这便是一个克隆软件可以通过保存一份文件和文件夹的镜像来做到的。克隆软件会读取整个磁盘的数据,将它们转换成一个 .img 文件,之后你可以将它复制到其他硬盘上。现在我们将要向你介绍最优秀的 10 个开源的克隆软件:
|
||||
|
||||
### 1. [Clonezilla][1]:###
|
||||
|
||||
Clonezilla 是一个基于 Ubuntu 和 Debian 的 Live CD。它可以像 Windows 里的诺顿 Ghost 一样克隆你的磁盘数据和做备份,不过它更有效率。Clonezilla 支持包括 ext2、ext3、ext4、btrfs 和 xfs 在内的很多文件系统。它还支持 BIOS、UEFI、MBR 和 GPT 分区。
|
||||
Clonezilla 是一个基于 Ubuntu 和 Debian 的 Live CD。它可以像 Windows 里的 Ghost 一样克隆你的磁盘数据和做备份,不过它更有效率。Clonezilla 支持包括 ext2、ext3、ext4、btrfs 和 xfs 在内的很多文件系统。它还支持 BIOS、UEFI、MBR 和 GPT 分区。
|
||||
|
||||
![](http://1-ps.googleusercontent.com/h/www.efytimes.com/admin/useradmin/rte/my_documents/my_pictures/600x450xZ34_clonezilla-600x450.png.pagespeed.ic.8Jq7pL2dwo.png)
|
||||
|
||||
### 2. [Redo Backup][2]:###
|
||||
### 2. [Redo Backup][2]:###
|
||||
|
||||
Redo Backup 是另一个用来方便地克隆磁盘的 Live CD。它是自由和开源的软件,使用 GPL 3 许可协议授权。它的主要功能和特点包括从 CD 引导的简单易用的 GUI、无需安装,可以恢复 Linux 和 Windows 等系统、无需登陆访问文件,以及已删除的文件等。
|
||||
Redo Backup 是另一个用来方便地克隆磁盘的 Live CD。它是自由和开源的软件,使用 GPL 3 许可协议授权。它的主要功能和特点包括从 CD 引导的简单易用的 GUI、无需安装,可以恢复 Linux 和 Windows 等系统,无需登陆访问文件,以及已删除的文件等。
|
||||
|
||||
![](http://1-ps.googleusercontent.com/h/www.efytimes.com/admin/useradmin/rte/my_documents/my_pictures/600x450x7D5_Redo-Backup-600x450.jpeg.pagespeed.ic.3QMikN07F5.jpg)
|
||||
|
||||
@ -26,7 +25,7 @@ Mondo 和其他的软件不大一样,它并不将你的磁盘数据转换为
|
||||
|
||||
### 4. [Partimage][4]:###
|
||||
|
||||
这是一个开源的备份软件,默认情况下在 Linux 系统里工作。在大多数发行版中,你都可以从发行版自带的软件包管理工具中安装。如果你没有 Linux 系统,你也可以使用“SystemRescueCd”。它是一个默认包括 Partimage 的 Live CD,可以为你完成备份工作。Partimage 在克隆硬盘方面的性能非常出色。
|
||||
这是一个开源的备份软件,默认工作在 Linux 系统下。在大多数发行版中,你都可以从发行版自带的软件包管理工具中安装。如果你没有 Linux 系统,你也可以使用“SystemRescueCd”。它是一个默认包含了 Partimage 的 Live CD,可以为你完成备份工作。Partimage 在克隆硬盘方面的性能非常出色。
|
||||
|
||||
![](http://1-ps.googleusercontent.com/h/www.efytimes.com/admin/useradmin/rte/my_documents/my_pictures/620x424xBZF_partimage-620x424.png.pagespeed.ic.ygzrogRJgE.png)
|
||||
|
||||
@ -71,7 +70,7 @@ via: http://www.efytimes.com/e1/fullnews.asp?edid=148039
|
||||
|
||||
作者:Sanchari Banerjee
|
||||
译者:[felixonmars](https://github.com/felixonmars)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,72 +1,79 @@
|
||||
什么是有用的bash别名和函数
|
||||
一大波有用的 bash 别名和函数
|
||||
================================================================================
|
||||
作为一个命令行探索者,你或许发现你自己一遍又一遍. 如果你总是用ssh进入到同一台电脑, 同时你总是管道关联相同的命令,或者如果你时常用一些参数运行一个程序,你应该想要拯救你人生中的这个珍贵的助手。你一遍又一遍花费着重复相同的动作.
|
||||
解决方案是使用一个别名.正如你可能知道的,别名用一种方式告诉你的shell记住详细的命令并且给它一个新的名字:别名,的方式。不管怎么样,别名是即时有效的,同样地它只是shell命令的快捷方式,没有能力传递或者控制参数.所以补充时,bash也允许你创建你自己的函数,那样可能更漫长和复杂,并且也允许任意数量的参数.
|
||||
当然,当你有一个好的食谱-像汤,你要分享它.因此这里有一个列表,用一些最有用bash别名和函数的.注意"最有用的"是随意的定义,当然别名的有益依赖在于你每天shell的使用性
|
||||
在你用别名开始试验之前, 这里有一个便于使用的小技巧:如果你给予别名相同的名字作为常规命令,你可以选择开始原始的命令并且用技巧忽略别名
|
||||
|
||||
作为一个命令行探索者,你或许发现你自己一遍又一遍重复同样的命令。如果你总是用ssh进入到同一台电脑,如果你总是将一连串命令连接起来,如果你总是用同样的参数运行一个程序,你也许希望在这种不断的重复中为你的生命节约下几秒钟。
|
||||
|
||||
解决方案是使用一个别名(alias)。正如你可能知道的,别名用一种让你的shell记住一个特定的命令并且给它一个新的名字的方式。不管怎么样,别名有一些限制,它只是shell命令的快捷方式,不能传递或者控制其中的参数。所以作为补充,bash 也允许你创建你自己的函数,这可能更长一些和复杂一点,它允许任意数量的参数。
|
||||
|
||||
当然,当你有美食时,比如某种汤,你要分享它给大家。我这里有一个列表,列出了一些最有用bash别名和函数的。注意“最有用的”只是个说法,别名的是否有用要看你是否每天都需要在 shell 里面用它。
|
||||
|
||||
在你开始你的别名体验之旅前,这里有一个便于使用的小技巧:如果你的别名和原本的命令名字相同,你可以用如下技巧来访问原本的命令(LCTT 译注:你也可以直接原本命令的完整路径来访问它。)
|
||||
|
||||
\command
|
||||
例如,第一个别名在下面替换ls命令。如果你想使用常规的ls命令而不是别名,通过调用它:
|
||||
|
||||
例如,如果有一个替换了ls命令的别名 ls。如果你想使用原本的ls命令而不是别名,通过调用它:
|
||||
|
||||
\ls
|
||||
|
||||
### Productivity ###
|
||||
### 提升生产力 ###
|
||||
|
||||
这些别名真的很简单并且真的很短,但他们大多数主要是以主题为依据,那样无论何时倘若你第二次保存一小部分,它允许在多年以后再结束.也许不会.
|
||||
这些别名真的很简单并且真的很短,但他们大多数是为了给你的生命节省几秒钟,最终也许为你这一辈子节省出来几年,也许呢。
|
||||
|
||||
alias ls="ls --color=auto"
|
||||
|
||||
简单但非常重要.使ls命令带着彩色输出
|
||||
简单但非常重要。使ls命令带着彩色输出。
|
||||
|
||||
alias ll = "ls --color -al"
|
||||
alias ll="ls --color -al"
|
||||
|
||||
从一个目录采用列表格式快速显示全部文件.
|
||||
以彩色的列表方式列出目录里面的全部文件。
|
||||
|
||||
alias grep='grep --color=auto'
|
||||
|
||||
相同地,把一些颜色在grep里输出
|
||||
类似,只是在grep里输出带上颜色。
|
||||
|
||||
mcd() { mkdir -p "$1"; cd "$1";}
|
||||
|
||||
我的最爱之一. 制造一个目录采用一个命令mcd[名字]和cd命令进入到目录里面
|
||||
我的最爱之一。创建一个目录并进入该目录里: mcd [目录名]。
|
||||
|
||||
cls() { cd "$1"; ls;}
|
||||
|
||||
类似于前面的功能,cd命令进入一个目录别且列出它的的内容:cls[名字]
|
||||
类似上一个函数,进入一个目录并列出它的的内容:cls[目录名]。
|
||||
|
||||
backup() { cp "$1"{,.bak};}
|
||||
|
||||
简单的方法,使文件有一个备份: backup [文件]将会在相同的目录创建[文件].bak.
|
||||
简单的给文件创建一个备份: backup [文件] 将会在同一个目录下创建 [文件].bak。
|
||||
|
||||
md5check() { md5sum "$1" | grep "$2";}
|
||||
|
||||
因为我讨厌通过手工比较文件的md5算法,这个函数计算它并且计算它使用grep:md5check[文件][钥匙]
|
||||
因为我讨厌通过手工比较文件的md5校验值,这个函数会计算它并进行比较:md5check[文件][校验值]。
|
||||
|
||||
![](https://farm6.staticflickr.com/5616/15412389280_8be57841ae_o.jpg)
|
||||
|
||||
alias makescript="fc -rnl | head -1 >"
|
||||
|
||||
很容易地制造上个命令的脚本输出,你运行makescript[脚本名字.sh]
|
||||
很容易用你上一个运行的命令创建一个脚本:makescript [脚本名字.sh]
|
||||
|
||||
alias genpasswd="strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo"
|
||||
|
||||
只是瞬间产生一个强壮的密码
|
||||
只是瞬间产生一个强壮的密码。
|
||||
|
||||
![](https://farm4.staticflickr.com/3955/15574321206_dd365f0f0e.jpg)
|
||||
|
||||
alias c="clear"
|
||||
|
||||
不能较为简单的清除你终端的屏幕
|
||||
清除你终端屏幕不能更简单了吧?
|
||||
|
||||
alias histg="history | grep"
|
||||
|
||||
通过你的命令历史:histg[关键字]快速地搜索
|
||||
快速搜索你的命令输入历史:histg [关键字]
|
||||
|
||||
alias ..='cd ..'
|
||||
|
||||
不需要写cd命令到上层目录
|
||||
回到上层目录还需要输入 cd 吗?
|
||||
|
||||
alias ...='cd ../..'
|
||||
|
||||
类似地,去到上两个目录
|
||||
自然,去到上两层目录。
|
||||
|
||||
extract() {
|
||||
if [ -f $1 ] ; then
|
||||
@ -89,98 +96,93 @@
|
||||
fi
|
||||
}
|
||||
|
||||
很长,但是也是最有用的。解压任何的文档类型:extract:[文档文件]
|
||||
|
||||
很长,但是也是最有用的。解压任何的文档类型:extract: [压缩文件]
|
||||
|
||||
### 系统信息 ###
|
||||
|
||||
想尽快地知道一切关于你的系统?
|
||||
想尽快地知道关于你的系统一切信息?
|
||||
|
||||
alias cmount="mount | column -t"
|
||||
|
||||
mount到列队中的格式输出
|
||||
按列格式化输出mount信息。
|
||||
|
||||
![](https://farm6.staticflickr.com/5603/15598830622_587b77a363_z.jpg)
|
||||
|
||||
alias tree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'"
|
||||
|
||||
递归树格式显示目录结构.
|
||||
以树形结构递归地显示目录结构。
|
||||
|
||||
sbs() { du -b --max-depth 1 | sort -nr | perl -pe 's{([0-9]+)}{sprintf "%.1f%s", $1>=2**30? ($1/2**30, "G"): $1>=2**20? ($1/2**20, "M"): $1>=2**10? ($1/2**10, "K"): ($1, "")}e';}
|
||||
|
||||
在当前目录里“按大小排序”显示列表的文件,排序按它们在磁盘上的大小
|
||||
安装文件在磁盘存储的大小排序,显示当前目录的文件列表。
|
||||
|
||||
alias intercept="sudo strace -ff -e trace=write -e write=1,2 -p"
|
||||
|
||||
intercept[一些PID]阻止进程的标准输入输出文件和标准错误文件。注意你需要看着安装完成
|
||||
接管某个进程的标准输出和标准错误。注意你需要安装了 strace。
|
||||
|
||||
alias meminfo='free -m -l -t'
|
||||
|
||||
查看你还有剩下多少内存
|
||||
查看你还有剩下多少内存。
|
||||
|
||||
![](https://farm4.staticflickr.com/3955/15411891448_0b9d6450bd_z.jpg)
|
||||
|
||||
alias ps? = "ps aux | grep"
|
||||
|
||||
ps?[名字]很容易地发现,这个任何进程的
|
||||
可以很容易地找到某个进程的PID:ps? [名字]。
|
||||
|
||||
alias volume="amixer get Master | sed '1,4 d' | cut -d [ -f 2 | cut -d ] -f 1"
|
||||
|
||||
显示现在声音的音量.
|
||||
显示当前音量设置。
|
||||
|
||||
![](https://farm4.staticflickr.com/3939/15597995445_99ea7ffcd5_o.jpg)
|
||||
|
||||
### 网络 ###
|
||||
|
||||
对于所有涉及互联网和你本地网络的命令,也有奇特的别名给它们
|
||||
|
||||
对于所有用在互联网和本地网络的命令,也有一些神奇的别名给它们。
|
||||
|
||||
alias websiteget="wget --random-wait -r -p -e robots=off -U mozilla"
|
||||
|
||||
websiteget[指定的位置]下载完整的网站地址
|
||||
下载整个网站:websiteget [URL]。
|
||||
|
||||
alias listen="lsof -P -i -n"
|
||||
|
||||
显示出哪个应用程序连接到网络
|
||||
显示出哪个应用程序连接到网络。
|
||||
|
||||
![](https://farm4.staticflickr.com/3943/15598830552_c7e5eaaa0d_z.jpg)
|
||||
|
||||
alias port='netstat -tulanp'
|
||||
|
||||
显示出活动的端口
|
||||
显示出活动的端口。
|
||||
|
||||
gmail() { curl -u "$1" --silent "https://mail.google.com/mail/feed/atom" | sed -e 's/<\/fullcount.*/\n/' | sed -e 's/.*fullcount>//'}
|
||||
|
||||
gmail:[用户名]大概的显示你的谷歌邮件里未读邮件的数量
|
||||
|
||||
大概的显示你的谷歌邮件里未读邮件的数量:gmail [用户名]
|
||||
|
||||
alias ipinfo="curl ifconfig.me && curl ifconfig.me/host"
|
||||
|
||||
获得你的公共IP地址和主机
|
||||
获得你的公网IP地址和主机名。
|
||||
|
||||
getlocation() { lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|grep address|egrep 'city|state|country'|awk '{print $3,$4,$5,$6,$7,$8}'|sed 's\ip address flag \\'|sed 's\My\\';}
|
||||
|
||||
以你的IP地址为基础返回你现在的位置
|
||||
返回你的当前IP地址的地理位置。
|
||||
|
||||
### 没用的 ###
|
||||
|
||||
所以呢,如果一些别名是不是全部具有使用价值?它们可能仍然有趣
|
||||
### 也许无用 ###
|
||||
|
||||
所以呢,如果一些别名并不是全都具有使用价值?它们可能仍然有趣。
|
||||
|
||||
kernelgraph() { lsmod | perl -e 'print "digraph \"lsmod\" {";<>;while(<>){@_=split/\s+/; print "\"$_[0]\" -> \"$_\"\n" for split/,/,$_[3]}print "}"' | dot -Tpng | display -;}
|
||||
|
||||
要绘制内核模块依赖曲线图。需要镜像阅读器
|
||||
绘制内核模块依赖曲线图。需要可以查看图片。
|
||||
|
||||
alias busy="cat /dev/urandom | hexdump -C | grep "ca fe""
|
||||
alias busy="cat /dev/urandom | hexdump -C | grep 'ca fe'"
|
||||
|
||||
在非技术人员的眼里你看起来都在忙和构思
|
||||
在那些非技术人员的眼里你看起来是总是那么忙和神秘。
|
||||
|
||||
![](https://farm6.staticflickr.com/5599/15574321326_ab3fbc1ef9_z.jpg)
|
||||
|
||||
最后,这些别名和函数的很大一部分来自于我个人的.bashrc.这些令人敬畏的网站 [alias.sh][1]和[commandlinefu.com][2]我早已经展示在我的[best online tools for Linux][3].当然去检测它们的输出,让你拥有特有的秘诀。如果你真的同意,在注释里分享你的智慧,
|
||||
最后,这些别名和函数的很大一部分来自于我个人的.bashrc。而那些令人点赞的网站 [alias.sh][1]和[commandlinefu.com][2]我早已在我的帖子[best online tools for Linux][3] 里面介绍过。你可以去看看,如果你愿意,也可以分享下你的。也欢迎你在这里评论,分享一下你的智慧。
|
||||
|
||||
|
||||
做为奖励,这里有我提到的全部别名和函数的纯文本版本,随时可以复制粘贴到你的.bashrc.
|
||||
做为奖励,这里有我提到的全部别名和函数的纯文本版本,随时可以复制粘贴到你的.bashrc。(如果你已经一行一行的复制到这里了,哈哈,你发现你又浪费了生命的几秒钟~)
|
||||
|
||||
#Productivity
|
||||
alias ls="ls --color=auto"
|
||||
@ -243,8 +245,8 @@ gmail:[用户名]大概的显示你的谷歌邮件里未读邮件的数量
|
||||
via: http://xmodulo.com/useful-bash-aliases-functions.html
|
||||
|
||||
作者:[Adrien Brochard][a]
|
||||
译者:[译者luoyutiantang](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[luoyutiantang](https://github.com/luoyutiantang)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,8 +1,8 @@
|
||||
Linux上使用备份管理器进行系统备份
|
||||
Linux 上使用 backup-manager 进行系统备份
|
||||
================================================================================
|
||||
无论简单与否,我们都有机会去了解这么一件事,那就是备份的重要性从来都不可以被低估。考虑到备份的方法真的多如牛毛,你可能想要知道怎样来有效地为你的系统选择正确的工具和和合适的策略。
|
||||
|
||||
在本文中,我将为你介绍[备份管理器][1],一个简单易用的命令行备份工具,在大多数的Linux发行版的标准软件库中都能见到它的身影。
|
||||
在本文中,我将为你介绍[backup-manager][1],一个简单易用的命令行备份工具,在大多数的Linux发行版的标准软件库中都能见到它的身影。
|
||||
|
||||
是什么让备份管理器在众多的备份工具或备份策略中脱颖而出呢?让我来简单介绍一些它的与众不同的特性吧:
|
||||
|
||||
@ -28,7 +28,7 @@ Linux上使用备份管理器进行系统备份
|
||||
|
||||
在下一步中,会询问你要备份的所有目录(用空格分隔)。建议,但不是严格要求,列出同一父目录中的几个子目录,而不要仅仅输入父目录。
|
||||
|
||||
你可以跳过该步骤并在以后对配置文件中BM_TARBALL_DIRECTORIESb变量进行设置。否则的话,就请尽可能多地添加你想要的目录,然后选择OK:
|
||||
你可以跳过该步骤并在以后对配置文件中BM\_TARBALL\_DIRECTORIESb变量进行设置。否则的话,就请尽可能多地添加你想要的目录,然后选择OK:
|
||||
|
||||
![](https://farm6.staticflickr.com/5610/15761238616_c9651fea1c_z.jpg)
|
||||
|
||||
@ -115,11 +115,11 @@ Linux上使用备份管理器进行系统备份
|
||||
|
||||
# backup-manager
|
||||
|
||||
BM_TARBALL_DIRECTORIES列出的目录将作为tarball备份到BM_REPOSITORY_ROOT目录,然后通过SSH传输到BM_UPLOAD_SSH_DESTINATION指定的主机dev1和dev3。
|
||||
BM\_TARBALL\_DIRECTORIES列出的目录将作为tarball备份到BM\_REPOSITORY\_ROOT目录,然后通过SSH传输到BM\_UPLOAD\_SSH_DESTINATION指定的主机dev1和dev3。
|
||||
|
||||
![](https://farm8.staticflickr.com/7497/15761238646_945620d8b7_z.jpg)
|
||||
|
||||
正如你在上面图片中看到的那样,备份管理器在运行的时候创建了一个名为/root/.back-manager_my.cnf的文件,MySQL密码通过BM_MYSQL_ ADMINPASS指定。那样,mysqldump可以验证到MySQL服务器,而不必在命令行以明文格式接受密码,那样会有安全风险。
|
||||
正如你在上面图片中看到的那样,备份管理器在运行的时候创建了一个名为/root/.back-manager\_my.cnf的文件,MySQL密码通过BM\_MYSQL\_ADMINPASS指定。那样,mysqldump可以验证到MySQL服务器,而不必在命令行以明文格式接受密码,那样会有安全风险。
|
||||
|
||||
### 通过cron运行备份管理器 ###
|
||||
|
||||
@ -145,7 +145,7 @@ via: http://xmodulo.com/linux-backup-manager.html
|
||||
|
||||
作者:[Gabriel Cánepa][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,12 +1,12 @@
|
||||
Linus Torvalds发布了Linux 3.19 RC1,目前为止最大的更新
|
||||
Linus Torvalds发布了Linux 3.19 RC1,这是目前为止最大的RC1
|
||||
================================================================================
|
||||
> 新的内核开发周期开始了
|
||||
|
||||
![](http://i1-news.softpedia-static.com/images/news2/Linus-Torvalds-Launches-Linux-kernel-3-19-RC1-One-of-the-Biggest-So-Far-468043-2.jpg)
|
||||
|
||||
**首个内核候选版本在3.19分支上发布了,它看上去像目前最大的更新。这个早先发布让众人惊喜,但是很容易理解为什么。**
|
||||
**首个内核候选版本在3.19分支上发布了,它看上去像目前最大的一个 RC1。Linus Torvalds很惊奇这么多人提交了,其实不过也很好理解。**
|
||||
|
||||
内核开发周期被新的3.19的发布而刷新了。事实是3.18分支才几周前才发布,今天的发布并不是完全在预期中。假期要来了,很多开发者和维护任何可能会休息。一般来说RC版本每周发布一次,但是用户可能会看到轻微的延误。
|
||||
内核开发周期因新的3.19的发布而刷新了。事实是3.18分支才几周前才发布,今天的发布并不是完全在预期中。假期要来了,很多开发者和维护人员可能会休息。一般来说RC版本每周发布一次,但是用户可能会看到一点的延误。
|
||||
|
||||
这个版本没有提到在Linux 3.18中确认的回归问题,但是可以确定的是,开发人员仍在努力修复中。另一方面,Linus说这是一个很大的更新,事实上这是目前为止最大的更新。很有可能是许多开发者想要在节日之前推送他们的补丁,因此,下一个RC版本会小一些。
|
||||
|
||||
@ -14,10 +14,9 @@ Linus Torvalds发布了Linux 3.19 RC1,目前为止最大的更新
|
||||
|
||||
发布版本的大小随着更新的频率正在增加。内核的开发周期通常大约8到10周,并且很少多于这个,这给项目一个很好的预测。
|
||||
|
||||
[阅读][1] Linus Torvalds的发布声明中说:“也就是说,也许没有真正的落后者,并且从rc1的大小来看,真的已经不多了。我不仅觉得下一个版本有更多的提交,并且比历史上的rc1更多(知道在提交数量上)。我们已经有比较大的版本(3.10和3.15的都有很大的很并窗口导致的),但是这明显不是一个小的合并窗口。”
|
||||
|
||||
“在这个在蓝图下,这看上去只是一个常规发布。大约三分之二的驱动更新,这剩下的一半是架构的更新(新的nios2补丁还没有优势,它只有ARM一半的性能,新的niso2支持小于整体架构更新的10%)。”
|
||||
[阅读][1] Linus Torvalds的发布声明中说:“也就是说,也许没有谁在拖后腿,并且从rc1的大小来看,真的也不能再多了。我不仅觉得下一个版本会有更多的提交,并且这是历史上最大的一个rc1(在提交数量上)。我们有比它大的版本(3.10和3.15的都是由很大的合并窗口产生的),但是这明显这个合并窗口也不小。”
|
||||
|
||||
“按照蓝图,这看上去只是一个常规发布。大约三分之二的驱动更新,这剩下的一半是架构的更新(新的nios2补丁还没有优势,它只有ARM一半的性能,新的niso2支持小于整体架构更新的10%)。”
|
||||
|
||||
具体关于这个RC的细节可以在官方邮件列表中找到。
|
||||
|
||||
@ -32,9 +31,9 @@ Linus Torvalds发布了Linux 3.19 RC1,目前为止最大的更新
|
||||
|
||||
via: http://news.softpedia.com/news/Linus-Torvalds-Launches-Linux-kernel-3-19-RC1-One-of-the-Biggest-So-Far-468043.shtml
|
||||
|
||||
作者:[Silviu Stahie ][a]
|
||||
作者:[Silviu Stahie][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,36 @@
|
||||
Ubuntu参考手册14.04 LTS第二版正式发布
|
||||
==============================================
|
||||
|
||||
> 初学者可以在手册里获得很有用的信息
|
||||
|
||||
### Ubuntu参考手册团队表示第二版手册现在已经发布并且可以免费下载 ###
|
||||
|
||||
![](http://i1-linux.softpedia-static.com/screenshots/Ubuntu-Manual_1.jpg)
|
||||
|
||||
Ubuntu手册按照惯例会对应相应的LTS发行版本,那么唯一合理的解释就是,现在发布的手册对应于6个月前发布的Ubuntu 14.04 LTS(Trusty Tahr)。与其他书籍一样,特别是大型书籍,手册内容总会出现各种错误或者也许已经和现状不匹配。不过不管怎样,电子书的修正和更新总要方便一些。
|
||||
|
||||
你也许会觉得奇怪,一个方便上手的免费操作系统竟然会有一个参考手册,或许一个社区就已经足够了。但是,总是有一些新用户连基本的操作都不懂,因此,有一本可以指明最基本的东西的手册拿在手里总是一个很好不过的事情。
|
||||
|
||||
### 这是“Ubuntu 14.04 LTS入门”手册的第二个版本 ###
|
||||
|
||||
使用Ubuntu操作系统的用户会发现,它和之前用过的其他操作系统有很大的差异,例如Windows和Max OS X。这很正常,并且你也不是任何时候都可以在网上找到一个特定的功能或者组件的相关资源和信息。有一个可以说明Ubuntu 14.04 LTS基本特性的手册可以提供一些帮助。
|
||||
|
||||
“《Ubuntu 14.04 入门 E2》对于Ubuntu操作系统而言,是一个很全面的初学者指南手册。它采用的是开源许可协议,你可以自由下载、阅读、修改以及共享。这个手册可以帮助你熟悉如何处理日常的工作,例如上网、听音乐或者扫描文档等等。尤其值得一提的是,这个文档浅显易懂,适合各个层次的用户。”
|
||||
|
||||
“这个快速入门手册可以让你很容易的利用你的计算机做一些事情,而不会陷入技术细节当中。在手册的帮助下,新用户可以很快的熟悉Unity桌面,”更多信息参考[官方网站][1]。
|
||||
|
||||
这是该参考手册的第二版,制作手册的团队具有丰富的经验。就算你已经是一个Ubuntu用户,看一看这个手册也没有什么坏处,因为你总能从其中学到一些东西。你可以在Softpedia[下载Ubuntuy参考手册14.04第二版][2]。
|
||||
|
||||
----
|
||||
|
||||
via: http://news.softpedia.com/news/Second-Edition-of-Ubuntu-Manual-14-04-LTS-Is-Out-468395.shtml
|
||||
|
||||
作者:[Silviu Stahie][a]
|
||||
译者:[zhouj-sh](https://github.com/zhouj-sh)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://news.softpedia.com/editors/browse/silviu-stahie
|
||||
[1]:http://ubuntu-manual.org/
|
||||
[2]:http://linux.softpedia.com/get/Documentation/Ubuntu-Manual-53530.shtml
|
@ -1,8 +1,7 @@
|
||||
Linux有问必答-- 如何在Linux上检查SSH的版本
|
||||
Linux有问必答:如何在Linux上检查SSH的版本
|
||||
================================================================================
|
||||
> **Question**:我想到SSH存在1和2两个版本(SSH1和SSH2)。这两者之间有什么不同?还有我该怎么在Linux上检查SSH协议的版本?
|
||||
|
||||
Secure Shell (SSH) is a network protocol that enables remote login or remote command execution between two hosts over a cryptographically secure communication channel. SSH was designed to replace insecure clear-text protocols such as telnet, rsh or rlogin. SSH provides a number of desirable features such as authentication, encryption, data integrity, authorization, and forwarding/tunneling.
|
||||
安全Shell(SSH)通过加密的安全通信通道来远程登录或者远程执行命令。SSH被设计来替代不安全的明文协议,如telnet、rsh和rlogin。SSH提供了大量需要的特性,如认证、加密、数据完整性、授权和转发/通道。
|
||||
|
||||
### SSH1 vs. SSH2 ###
|
||||
@ -11,8 +10,7 @@ SSH协议规范存在一些小版本的差异,但是有两个主要的大版
|
||||
|
||||
事实上,SSH1和SSH2是两个完全不同互不兼容的协议。SSH2明显地提升了SSH1中的很多方面。首先,SSH是宏设计,几个不同的功能(如:认证、传输、连接)被打包进一个单一的协议,SSH2带来了比SSH1更强大的安全特性,如基于MAC的完整性检查,灵活的会话密钥更新、充分协商的加密算法、公钥证书等等。
|
||||
|
||||
SSH2 is standardized by IETF, and as such its implementation is widely deployed and accepted in the industry. Due to SSH2's popularity and cryptographic superiority over SSH1, many products are dropping support for SSH1. As of this writing, OpenSSH still [supports][1] both SSH1 and SSH2, while on all modern Linux distributions, OpenSSH server comes with SSH1 disabled by default.
|
||||
SSH2由IETF标准化,且它的实现在业界被广泛部署和接受。由于SSH2对于SSH1的流行和加密优势,许多产品对SSH1放弃了支持。在写这篇文章的时候,OpenSSH仍旧[支持][1]SSH1和SSH2,然而在所有的现代Linux发行版中,OpenSSH服务器默认禁用了SSH1。
|
||||
SSH2由IETF标准化,且它的实现在业界被广泛部署和接受。由于SSH2对于SSH1的流行和加密优势,许多产品对SSH1放弃了支持。在写这篇文章的时候,OpenSSH仍旧[支持][1]SSH1和SSH2,然而在所有的现代Linux发行版中,OpenSSH服务器默认禁用了SSH1。
|
||||
|
||||
### 检查支持的SSH协议版本 ###
|
||||
|
||||
@ -69,7 +67,7 @@ SSH2由IETF标准化,且它的实现在业界被广泛部署和接受。由于
|
||||
via: http://ask.xmodulo.com/check-ssh-protocol-version-linux.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,3 +1,5 @@
|
||||
Traslating by H-mudcup
|
||||
|
||||
U.S. Marine Corps Wants to Change OS for Radar System from Windows XP to Linux
|
||||
================================================================================
|
||||
**A new radar system has been sent back for upgrade**
|
||||
@ -44,4 +46,4 @@ via: http://news.softpedia.com/news/U-S-Marine-Corps-Want-to-Change-OS-for-Radar
|
||||
|
||||
[a]:http://news.softpedia.com/editors/browse/silviu-stahie
|
||||
[1]:http://www.militaryaerospace.com/articles/2014/12/gator-linux-software.html
|
||||
[2]:http://youtu.be/H2ppl4x-eu8
|
||||
[2]:http://youtu.be/H2ppl4x-eu8
|
||||
|
@ -1,162 +0,0 @@
|
||||
5 Awesome Open Source Backup Software For Linux and Unix-like Systems
|
||||
================================================================================
|
||||
A good backup plan is essential in order to have the ability to recover from
|
||||
|
||||
- Human errors
|
||||
- RAID or disk failure
|
||||
- File system corruption
|
||||
- Data center destruction and more.
|
||||
|
||||
In this post I'm going to list amazingly awesome open source Backup software for you.
|
||||
|
||||
### What to look for when choosing backup software for an enterprise? ###
|
||||
|
||||
Make sure the following features are supported backup software you deploy:
|
||||
|
||||
1. **Open source software** - You must use software for which the original source code is made freely available and may be and modified. This ensures that you can recover your data in case vendor/project stopped working on software or refused to provide patches.
|
||||
1. **Cross-platform support** - Make sure backup software works well on the OS deployed on all desktop and server operating systems.
|
||||
1. **Data format** - Open data format ensures that you can recover data in case vendor or project stopped working on software.
|
||||
1. **Autochangers** - Autochangers are nothing but a variety of backup devices, including library, near-line storage, and autoloader. Autochangers allows you to automate the task of loading, mounting, and labeling backup media such as tape.
|
||||
1. **Backup media** - Make sure you can backup data on tape, disk, DVD and in cloud storage such as AWS.
|
||||
1. **Encryption datastream** - Make sure all client-to-server traffic will be encrypted to ensure transmission integrity over the LAN/WAN/Internet.
|
||||
1. **Database support** - Make sure backup software can backup database server such as MySQL or Oracle.
|
||||
1. **Backup span multiple volumes** - Backup software can split each backup (dumpfile) into a series of parts, allowing for different parts to existing on different volumes. This ensures that large backups (such as 100TB file) can be stored on larger than a single backup device such as disk or tape volume.
|
||||
1. **VSS (Volume Shadow Copy)** - It is [Microsoft's Volume Shadow Copy Service (VSS)][1] and it is used to create snapshots of data that is to be backed up. Make sure backup software support VSS for MS-Windows client/server.
|
||||
1. **[Deduplication][2]** - It is a data compression technique for eliminating duplicate copies of repeating data (for example, images).
|
||||
1. **License and cost** - Make sure you [understand and use of open source license][3] under which the original backup software is made available to you.
|
||||
1. **Commercial support** - Open source software can provide community based (such as email list or fourm) or professional (such as subscriptions provided at additional cost) based support. You can use paid professional support for training and consulting purpose.
|
||||
1. **Reports and alerts** - Finally, you must able to see backup reports, current job status, and get alert when something goes wrong while making backups.
|
||||
|
||||
### Bacula - Client/server backup tool for heterogeneous networks ###
|
||||
|
||||
I personally use this software to manage backup and recovery across a network of computers including Linux, OSX and Windows. You can configure it via a CLI, GUI or web interface.
|
||||
|
||||
![](http://s0.cyberciti.org/uploads/cms/2014/11/bacula-network-backup.jpg)
|
||||
|
||||
- Operating system : Cross-platform
|
||||
- Backup Levels : Full, differential, incremental, and consolidation.
|
||||
- Data format: Custom but fully open.
|
||||
- Autochangers: Yes
|
||||
- Backup media: Tape/Disk/DVD
|
||||
- Encryption datastream: Yes
|
||||
- Database support: MSSQL/PostgreSQL/Oracle/
|
||||
- Backup span multiple volumes: Yes
|
||||
- VSS: Yes
|
||||
- License : Affero General Public License v3.0
|
||||
- Download url : [bacula.org][4]
|
||||
|
||||
### Amanda - Another good client/server backup tool ###
|
||||
|
||||
AMANDA is an acronym for Advanced Maryland Automatic Network Disk Archiver. It allows the sysadmin to set up a single backup server to back up other hosts over network to tape drives or disk or authchangers.
|
||||
|
||||
- Operating system : Cross-platform
|
||||
- Backup Levels : Full, differential, incremental, and consolidation.
|
||||
- Data format: Open (can be recovered using tool such as tar).
|
||||
- Autochangers: Yes
|
||||
- Backup media: Tape/Disk/DVD
|
||||
- Encryption datastream: Yes
|
||||
- Database support: MSSQL/Oracle
|
||||
- Backup span multiple volumes: Yes
|
||||
- VSS: Yes
|
||||
- License : GPL, LGPL, Apache, Amanda License
|
||||
- Download url : [amanda.org][5]
|
||||
|
||||
### Backupninja - Lightweight backup system ###
|
||||
|
||||
Backupninja is a simple and easy to use backup system. You can simply drop a config files into /etc/backup.d/ to backup multiple hosts.
|
||||
|
||||
![](http://s0.cyberciti.org/uploads/cms/2014/11/ninjabackup-helper-script.jpg)
|
||||
|
||||
- Operating system : Linux/Unix
|
||||
- Backup Levels : Full and incremental (rsync+hard links)
|
||||
- Data format: Open
|
||||
- Autochangers: N/A
|
||||
- Backup media: Disk/DVD/CD/ISO images
|
||||
- Encryption datastream: Yes (ssh) and [encrypted remote backups via duplicity][6]
|
||||
- Database support: MySQL/PostgreSQL/OpenLDAP and subversion or trac repositories.
|
||||
- Backup span multiple volumes: ??
|
||||
- VSS: ??
|
||||
- License : GPL
|
||||
- Download url : [riseup.net][7]
|
||||
|
||||
### Backuppc - High-performance client/server tool ###
|
||||
|
||||
Backuppc is can be used to backup Linux and Windows based systems to a master server's disk. It comes with a clever pooling scheme minimizes disk storage, disk I/O and network I/O.
|
||||
|
||||
![](http://s0.cyberciti.org/uploads/cms/2014/11/BackupPCServerStatus.jpg)
|
||||
|
||||
- Operating system : Linux/Unix and Windows
|
||||
- Backup Levels : Full and incremental (rsync+hard links and pooling scheme)
|
||||
- Data format: Open
|
||||
- Autochangers: N/A
|
||||
- Backup media: Disk/RAID storage
|
||||
- Encryption datastream: Yes
|
||||
- Database support: Yes (via custom shell scripts)
|
||||
- Backup span multiple volumes: ??
|
||||
- VSS: ??
|
||||
- License : GPL
|
||||
- Download url : [backuppc.sourceforge.net][8]
|
||||
|
||||
### UrBackup - Easy to setup client/server system ###
|
||||
|
||||
It is an easy to setup open source client/server backup system, that through a combination of image and file backups accomplishes both data safety and a fast restoration time. Your files can be restored through the web interface or the Windows Explorer while the backups of drive volumes can be restored with a bootable CD or USB-Stick (bare metal restore). A web interface makes setting up your own backup server really easy.
|
||||
|
||||
![](http://s0.cyberciti.org/uploads/cms/2014/11/urbackup.jpg)
|
||||
|
||||
- Operating system : Linux/FreeBSD/Unix/Windows/several Linux based NAS operating systems. Client only runs on Linux and Windows.
|
||||
- Backup Levels : Full and incremental
|
||||
- Data format: Open
|
||||
- Autochangers: N/A
|
||||
- Backup media: Disk/Raid storage/DVD
|
||||
- Encryption datastream: Yes
|
||||
- Database support: ??
|
||||
- Backup span multiple volumes: ??
|
||||
- VSS: ??
|
||||
- License : GPL v3+
|
||||
- Download url : [urbackup.org][9]
|
||||
|
||||
### Other awesome open source backup software for your consideration ###
|
||||
|
||||
The Amanda, Bacula and above-mentioned software are feature rich but can be complicated to set for small network or a single server. I recommend that you study and use the following backup software:
|
||||
|
||||
1. [Rsnapshot][10] - I recommend this tool for local and remote filesystem snapshot utility. See how to set and use [this tool on Debian/Ubuntu Linux][11] and [CentOS/RHEL based systems][12].
|
||||
1. [rdiff-backup][13] - Another great remote incremental backup tool for Unix-like systems.
|
||||
1. [Burp][14] - Burp is a network backup and restore program. It uses librsync in order to save network traffic and to save on the amount of space that is used by each backup. It also uses VSS (Volume Shadow Copy Service) to make snapshots when backing up Windows computers.
|
||||
1. [Duplicity][15] - Great encrypted bandwidth-efficient backup for Unix-like system. See how to [Install Duplicity for encrypted backup in cloud][16] for more infomation.
|
||||
1. [SafeKeep][17] - SafeKeep is a centralized and easy to use backup application that combines the best features of a mirror and an incremental backup.
|
||||
1. [DREBS][18] - DREBS is a tool for taking periodic snapshots of EBS volumes. It is designed to be run on the EC2 host which the EBS volumes to be snapshoted are attached.
|
||||
1. Old good unix programs like rsync, tar, cpio, mt and dump.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
I hope you will find this post useful to backup your important data. Do not forgot to verify your backups and make multiple backup copies of your data. Also, RAID is not a backup solution. Use any one of the above-mentioned programs to backup your servers, desktop/laptop and personal mobile devices. If you know of any other open source backup software I didn't mention, share them in the comments below.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.cyberciti.biz/open-source/awesome-backup-software-for-linux-unix-osx-windows-systems/
|
||||
|
||||
作者:[nixCraft][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://www.cyberciti.biz/tips/about-us
|
||||
[1]:http://technet.microsoft.com/en-us/library/cc785914(v=ws.10).aspx
|
||||
[2]:http://en.wikipedia.org/wiki/Data_deduplication
|
||||
[3]:http://opensource.org/licenses
|
||||
[4]:http://www.bacula.org/
|
||||
[5]:http://www.amanda.org/
|
||||
[6]:http://www.cyberciti.biz/faq/duplicity-installation-configuration-on-debian-ubuntu-linux/
|
||||
[7]:https://labs.riseup.net/code/projects/backupninja
|
||||
[8]:http://backuppc.sourceforge.net/
|
||||
[9]:http://www.urbackup.org/
|
||||
[10]:http://www.rsnapshot.org/
|
||||
[11]:http://www.cyberciti.biz/faq/linux-rsnapshot-backup-howto/
|
||||
[12]:http://www.cyberciti.biz/faq/redhat-cetos-linux-remote-backup-snapshot-server/
|
||||
[13]:http://www.nongnu.org/rdiff-backup/
|
||||
[14]:http://burp.grke.org/
|
||||
[15]:http://www.cyberciti.biz/open-source/awesome-backup-software-for-linux-unix-osx-windows-systems/
|
||||
[16]:http://www.cyberciti.biz/faq/duplicity-installation-configuration-on-debian-ubuntu-linux/
|
||||
[17]:http://safekeep.sourceforge.net/
|
||||
[18]:https://github.com/dojo4/drebs
|
@ -1,100 +0,0 @@
|
||||
The Good, The Bad And The Ugly Of Linux In 2014
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/Buggest_Linux_Stories.jpeg)
|
||||
|
||||
Year 2014 is coming to an end and this is the time to summarize some of the **biggest Linux stories in year 2014**. All year round we have followed some good, some bad and some ugly stories related to Linux and Open Source. Let’ have a quick recap on how was the year 2014 for Linux.
|
||||
|
||||
### The Good ###
|
||||
|
||||
First and foremost, let’s see what were the positive stories for Linux lovers in 2014.
|
||||
|
||||
#### Netflix on Linux ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/netflix-linux.jpg)
|
||||
|
||||
Linux users have been trying several workaround to make Netflix work on Linux from using Wine to [using beta features in Chrome][1]. Good thing is that Netflix finally brought native support on Linux in year 2014 bringing smiles on the faces of Linux users where Netflix is available. People would still have to rely on workaround to [use Netflix outside US][2] (and other countries where Netflix is available officially).
|
||||
|
||||
#### Open Source/Linux adoption in European countries ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/OpenSource_World.jpg)
|
||||
|
||||
Give the credit to economic meltdown, if you want, but Linux and Open Source adoption has been gripping European cities. I am not talking about Linux adoption by individuals but by government and authorities. All year round we heard stories of how [French][3] and [Italian cities saved millions of Euro by switching to Linux][4] and Open Office. And the trend was not limited just to Italy and France, the same could be seen in Spain, [Switzerland][5] and [Germany][6].
|
||||
|
||||
#### Windows 10 takes inspiration from Linux ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/10/Windows10_Linux.jpg)
|
||||
|
||||
The upcoming release of Microsoft’s flagship operating system, Windows will be called Windows 10 (no Windows 9). And Windows 10 boasts of a number of new features. But these ‘new features’ are new to Microsoft world only and most of those have been existing in Linux world for years. Have a look at such [Windows 10 features copied from Linux][7].
|
||||
|
||||
### The Bad ###
|
||||
|
||||
Everything was not rosy for Linux in year 2014. Some events happened that dented the image of Linux/Open Source.
|
||||
|
||||
#### Heartbleed ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/heartbleed-bug.jpg)
|
||||
|
||||
In April this year, a vulnerability was detected in [OpenSSL][8]. This bug, named [Heartbleed][9], impacted over half a million ‘secured’ websites including Facebook and Google. The bug actually allowed anyone to read memory of the system and hence giving the access to the key that is used to encrypt the traffic. A [comic at xkcd explains the Heartbleed][10] in easier way. Needless to say that this vulnerability was fixed in an update to OpenSSL.
|
||||
|
||||
#### Shellshock ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/shellshock_Linux_check.jpeg)
|
||||
|
||||
As if Heartbleed was not enough, Linux world was further rocked in September with a vulnerability in Bash. The bug, named [Shellshock][11], further put Linux system at risk of remote attacks. The vulnerability was exploited by hackers to launch DDoS attacks. An update to Bash version supposedly fixed the issue.
|
||||
|
||||
#### Ubuntu Phone and Steam Console ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/Ubuntu_phone.png)
|
||||
|
||||
Promises after promises, hopes after hopes. But even in year 2014 no one saw Ubuntu Phone or Steam gaming consoles. Lots of talks were around Ubuntu Phone tough. From February 2014 release to September to December, finally it is (hopefully slotted) for February 2015 release. No information on Steam consoles though. Read more for [Ubuntu Phone specification, price and release date][12].
|
||||
|
||||
### The Ugly ###
|
||||
|
||||
Things turned ugly with war over systemd adoption.
|
||||
|
||||
### systemd controversy ###
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/Systemd_everywhere.jpg)
|
||||
|
||||
[init vs systemd][13] dispute is going on for some time. But it turned ugly in 2014 as systemd poised to replace init on several major Linux distribution including Debian, Ubuntu, OpenSUSE, Arch Linux and Fedora. It turned so ugly that it was not just limited to boycottsystemd.org like websites. Lennart Poettering (lead developer and author of systemd) claimed in a [Google Plus post][14] that anti systemd people were “collecting bitcoins to hire a hitman to kill him”. Lennart went on calling Open Source community “a sick place to be in”. People have taken this battle as far as forking Debian to a new OS named [Devuan][15].
|
||||
|
||||
### And the weird ###
|
||||
|
||||
Along with the good, the bad and the ugly comes the weird and that weird is none other than Microsoft.
|
||||
|
||||
#### Microsoft loves Linux ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/Microsoft_Loves_Linux.png)
|
||||
|
||||
Yes! You read it right. [Microsoft loves Linux][16]. The same Microsoft whose CEO Steve Ballmer had once said that [Linux is cancer][17]. Change in Microsoft leadership saw some changes in its approach towards Linux and Open Source when the new CEO Satya Nadella announced that Microsoft loves Linux. This new found love for Linux is actually Microsoft’s attempt to make [Azure][18] as a better cloud platform. For this purpose it needs Hyper-V (core of Azure) virtualization to work with Linux. This desperation has made [Microsoft, fifth biggest contributor to Linux kernel][19].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/biggest-linux-stories-2014/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://itsfoss.com/author/Abhishek/
|
||||
[1]:http://itsfoss.com/watch-netflix-in-ubuntu-14-04/
|
||||
[2]:http://itsfoss.com/easiest-watch-netflix-hulu-usa/
|
||||
[3]:http://itsfoss.com/french-city-toulouse-saved-1-million-euro-libreoffice/
|
||||
[4]:http://itsfoss.com/italian-city-turin-open-source/
|
||||
[5]:http://itsfoss.com/170-primary-public-schools-geneva-switch-ubuntu/
|
||||
[6]:http://itsfoss.com/german-town-gummersbach-completes-switch-open-source/
|
||||
[7]:http://itsfoss.com/windows-10-inspired-linux/
|
||||
[8]:http://en.wikipedia.org/wiki/OpenSSL
|
||||
[9]:http://heartbleed.com/
|
||||
[10]:http://xkcd.com/1354/
|
||||
[11]:http://itsfoss.com/linux-shellshock-check-fix/
|
||||
[12]:http://itsfoss.com/ubuntu-phone-specification-release-date-pricing/
|
||||
[13]:http://www.tecmint.com/systemd-replaces-init-in-linux/
|
||||
[14]:https://plus.google.com/+LennartPoetteringTheOneAndOnly/posts/J2TZrTvu7vd
|
||||
[15]:http://debianfork.org/
|
||||
[16]:http://thenewstack.io/microsoft-professes-love-for-linux-adds-support-for-coreos-cloudera-and-host-of-new-features/
|
||||
[17]:http://www.theregister.co.uk/2001/06/02/ballmer_linux_is_a_cancer/
|
||||
[18]:http://azure.microsoft.com/en-us/
|
||||
[19]:http://www.zdnet.com/article/top-five-linux-contributor-microsoft/
|
@ -1,85 +0,0 @@
|
||||
The history of Android
|
||||
================================================================================
|
||||
![The redesigned Dialer and Contacts pages.](http://cdn.arstechnica.net/wp-content/uploads/2014/01/dialercontacts.png)
|
||||
The redesigned Dialer and Contacts pages.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
The rounded tabs in the contacts/dialer app were changed to a sharper, more mature-looking design. The dialer changed its name to "Phone" and the dial pad buttons changed from circles to rounded rectangles. Buttons for voicemail, call, and delete were placed at the bottom. This screen is a great example of Android’s lack of design consistency in the pre-3.0 days. Just on this screen, the tabs used sharp-cornered rectangles, the dial pad used rounded rectangles, and the sides of the bottom buttons were complete circles. It was a grab bag of UI widgets where no one ever tried to make anything match anything else.
|
||||
|
||||
One of the new features in Android 2.0 was "Quick Contacts," which took the form of contact thumbnails that were added all over the OS. Tapping on them would bring up a list of shortcuts to contact that person through other apps. This didn't make as much sense in the contacts app, but in something like Google Talk, being able to tap on the contact thumbnail and call the person was very handy.
|
||||
|
||||
![](http://cdn.arstechnica.net/wp-content/uploads/2014/01/calls.png)
|
||||
Photo by Ron Amadeo
|
||||
|
||||
Android 2.0 was finally equipped with all the on-screen buttons needed to answer and hang up a call without needing a hardware button, and the Droid took advantage of this and removed the now-redundant buttons from its design. Android’s solution to accept or reject calls was these left and right pull tabs. They work a lot like slide-to-unlock (and would later be used for slide-to-unlock)—a slide from the green button to the right would answer, and a slide from the red button to the left would reject the call. Once inside a call, it looked a lot like Android 1.6. All the options were still hidden behind the menu button.
|
||||
|
||||
Someone completely phoned-in the art for the dialpad drawer. Instead of redrawing the number "5" button from Android 1.6, they just dropped in bold text that said "Dialpad" and called it a day.
|
||||
|
||||
![The Calculator and Browser.](http://cdn.arstechnica.net/wp-content/uploads/2014/01/calcubrowser.png)
|
||||
The Calculator and Browser.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
The calculator was revamped for the first time since its introduction in Android 0.9. The black glass balls were replaced with gradiented blue and black buttons. The crazy red on-press highlight of the old calculator was replaced with a more normal looking white outline.
|
||||
|
||||
The browser's tiny website name bar grew into a full, functional address bar, along with a button for bookmarks. To save on screen real estate, the address bar was attached to the page, so the bar scrolled up with the rest of the page and left you with a full screen for reading. Android 1.6's unique magnifying rectangle zoom control and its associated buttons were tossed in favor of a much simpler double-tab-to-zoom gesture, and the browser could once again render arstechnica.com without crashing. There still wasn't pinch zoom.
|
||||
|
||||
![The camera with the settings drawer open, the flash settings, and the menu over top of the photo review screen.](http://cdn.arstechnica.net/wp-content/uploads/2014/03/cam2-these-are-settigns.jpg)
|
||||
The camera with the settings drawer open, the flash settings, and the menu over top of the photo review screen.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
The camera app gained an entire drawer on the left side, which opened to reveal a ton of settings. The Motorola Droid was one of the first Android phones with an LED flash, so there was a setting for flash control, along with settings like scene mode, white balance, effects, picture size, and storage location (SD or Internal).
|
||||
|
||||
On the photo review screen, Google pared down the menu button options. They were no longer redundant when compared to the on-screen options. With the extra room in the menu, all the options fit in the menu bar without needing a "more" button.
|
||||
|
||||
![The “accounts" page of the e-mail app, the new combined inbox, the account & sync page from the system settings, and the auto brightness setting. ](http://cdn.arstechnica.net/wp-content/uploads/2014/02/emailacc2ountsetc.png)
|
||||
The “accounts" page of the e-mail app, the new combined inbox, the account & sync page from the system settings, and the auto brightness setting.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
The e-mail app got a big functionality boost. The most important of which is that it finally supported Microsoft Exchange. The Android 2.0 version of Email finally separated the inbox and folder views instead of using the messy mashed-together view introduced in Android 1.0. Email even had a unified inbox that would weave all your messages together from different accounts.
|
||||
|
||||
The inbox view put the generic Email app on even ground with the Gmail app. Combined inbox even trumped Gmail's functionality, which was an extremely rare occurrence. Email still felt like the unwanted stepchild to Gmail, though. It used the Gmail interface to view messages, which meant the inbox and folders used a black theme, and the message view oddly used a light theme.
|
||||
|
||||
The bundled Facebook app had an awesome account sync feature, which would download contact pictures and information from the social network and seamlessly integrate it into the contacts app. Later down the road when Facebook and Google stopped being friends, [Google removed this feature][1]. The company said it didn't like the idea of sharing information with Facebook when Facebook wouldn't share information back, thus a better user experience lost out to company politics.
|
||||
|
||||
(Sadly, we couldn't show off the Facebook app because it is yet another client that died at the hands of OAuth updates. It's no longer possible to sign in from a client this old.)
|
||||
|
||||
The last picture shows the auto brightness control, which Android 2.0 was the first version to support. The Droid was equipped with an ambient light sensor, and tapping on the checkbox would make the brightness slider disappear and allow the device to automatically control the screen brightness.
|
||||
|
||||
As the name would imply, Android 2.0 was Google's biggest update to date. Motorola and Verizon brought Android a slick-looking device with tons of ad dollars behind it, and for a time, “Droid" became a household name.
|
||||
|
||||
### The Nexus One—enter the Google Phone ###
|
||||
|
||||
![](http://cdn.arstechnica.net/wp-content/uploads/2014/03/nexus_4_lineup.jpg)
|
||||
|
||||
In January 2010, the first Nexus device launched, appropriately called the "[Nexus One][2]". The device was a huge milestone for Google. It was the first phone designed and branded by the company, and Google planned to sell the device directly to consumers. The HTC-manufactured Nexus One had a 1GHz, single-core Qualcomm Snapdragon S1 SoC, 512MB of RAM, 512MB of storage, and a 3.7-inch AMOLED display.
|
||||
|
||||
The Nexus One was meant to be a pure Android experience free of carrier meddling and crapware. Google directly controlled the updates. It was able to push software out to users as soon as it was done, rather than having to be approved by carriers, who slowed the process down and were not always eager to improve a phone customers already paid for.
|
||||
|
||||
Google sold the Nexus One [directly over the Web][3], unlocked, contract-free, and at the full retail price of $529.99. While the Nexus One was also sold at T-Mobile stores on-contract for $179.99, Google wanted to change the way the cell phone industry worked in America with its online store. The idea was to pick the phone first and the carrier second, breaking the control the wireless oligarchy had over hardware in the United States.
|
||||
|
||||
Google's retail revolution didn't work out though, and six months after the opening on the online phone store, Google shut the service down. Google cited the primary problem as low sales. In 2010, Internet shopping wasn't the commonplace thing it is today, and consumers weren't ready to spend $530 on a device they couldn’t first hold in their hands. The high price was also a limiting factor; smartphone shoppers were more used to paying $200 up front for devices and agreeing to a two-year contract. There was also the issue of the Motorola Droid, which came out only three months earlier and was not significantly slower. With the Droid’s huge marketing campaign and "iPhone Killer" hype, it already captured much of the same Android enthusiast market that the Nexus One was gunning for.
|
||||
|
||||
While the Nexus One online sales experiment could be considered a failure, Google learned a lot. In 2012, it [relaunched its online store][4] as the "Devices" section on Google Play.
|
||||
|
||||
----------
|
||||
|
||||
![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg)
|
||||
|
||||
[Ron Amadeo][a] / Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work.
|
||||
|
||||
[@RonAmadeo][t]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/11/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://techcrunch.com/2011/02/22/google-android-facebook-contacts/
|
||||
[2]:http://arstechnica.com/gadgets/2010/01/nexus-one-review/
|
||||
[3]:http://arstechnica.com/gadgets/2010/01/googles-big-news-today-was-not-a-phone-but-a-url/
|
||||
[4]:http://arstechnica.com/gadgets/2012/04/unlocked-samsung-galaxy-nexus-can-now-be-purchased-from-google/
|
||||
[a]:http://arstechnica.com/author/ronamadeo
|
||||
[t]:https://twitter.com/RonAmadeo
|
@ -1,228 +0,0 @@
|
||||
How to install Xen hypervisor on unused old hardware
|
||||
================================================================================
|
||||
Xen is a bare metal hypervisor, meaning that you must prepare a bare machine to install and run Xen. KVM is a little different - you can add it to any machine already running Linux. This tutorial describes how to install and configure Xen hypervisor on unused hardware.
|
||||
|
||||
This procedure uses Debian Jessie (their testing distribution) as the host OS (also known as [Dom0][1]). Jessie is not the only choice - Xen support is built into the Linux kernel, and [plenty of Linux distributions][2] include one of these Xen-enabled kernels.
|
||||
|
||||
### Find unused hardware ###
|
||||
|
||||
As a start, find a suitable workstation which can be wiped out, such as an old laptop or desktop. Older hardware may not be good for gaming, but it is good enough for a host OS and a couple of guests. A PC with these specifications works fine.
|
||||
|
||||
- 1 CPU with 2 cores (64-bit)
|
||||
- 4GB memory
|
||||
- 80GB hard disk
|
||||
- ability to boot from CD, DVD or USB
|
||||
- a network interface
|
||||
|
||||
Note that the CPU must be a 64-bit processor since Debian dropped support for 32-bit Xen packages. If you don't have spare hardware, you could invest in an old machine. 2010's $1000 flagship laptop is today's $100 bargain. A second-hand laptop from eBay and a memory upgrade will do fine.
|
||||
|
||||
### Burn a bootable CD/USB ###
|
||||
|
||||
Download the ISO image for Debian Jessie. The small netinst image available from the [official Debian website][3] works fine.
|
||||
|
||||
$ wget http://cdimage.debian.org/cdimage/jessie_di_beta_2/amd64/iso-cd/debian-jessie-DI-b2-amd64-netinst.iso
|
||||
|
||||
Next, identify the device name assigned to your [CD/DVD][4] or [USB drive][5] (e.g., /dev/sdc).
|
||||
|
||||
Burn the downloaded ISO image into a bootable CD or a USB using dd command. Replace /dev/sdc with the device name you identified above.
|
||||
|
||||
$ sudo dd if=debian-jessie-DI-b2-amd64-netinst.iso of=/dev/sdc
|
||||
|
||||
### Start the installation ###
|
||||
|
||||
To start the installation, boot with the Debian installer CD/USB.
|
||||
|
||||
It's a good idea to use a wired connection, not WiFi. If the WiFi won't connect because firmware or driver software is missing, you won't get very far.
|
||||
|
||||
![](https://farm8.staticflickr.com/7516/15772286696_c31e4c7754_z.jpg)
|
||||
|
||||
### Partition the disk ###
|
||||
|
||||
This setup uses four primary disk partitions. Automatic OS installers usually set up an extended partition that contains logical partitions. Set up the four partitions like this.
|
||||
|
||||
- sda1 mount on /boot, 200MB
|
||||
- sda2 /, 20GB, Ubuntu uses 4GB
|
||||
- sda3 swap, 6GB (4GB of memory x 1.5 = 6)
|
||||
- sda4 reserved for LVM, not mounted, all the rest of the disk space
|
||||
|
||||
### Install the base system ###
|
||||
|
||||
It's a good idea to make the install as simple and short as possible. A basic working system can always be added to later. Debian's APT (Advanced Package Tool) makes adding software easy. Installing Debian on a workstation can cause pretty obscure time-wasting issues. Perhaps a graphics driver does not agree with the kernel or maybe the old CD-ROM drive only works intermittently.
|
||||
|
||||
When it comes to choosing what to install, do install an SSH server and don't install a desktop like Gnome.
|
||||
|
||||
![](https://farm9.staticflickr.com/8541/15176520633_5d31beda9c_z.jpg)
|
||||
|
||||
A graphical desktop requires hundreds of package installs - it's a lot of extra work that can be done later. If you run into problems, waiting for that desktop install is a waste of time. Also, without desktop component, the system boot will be much quicker - seconds rather than minutes. This procedure requires a few reboots, so that's a handy time-saver.
|
||||
|
||||
An SSH server lets you configure the workstation from another computer. This allows you to avoid some of the problems with old hardware - perhaps the old machine's keyboard is missing keys, the LCD screen has dead pixels or the trackpad is unresponsive etc.
|
||||
|
||||
### Add LVM (Logical Volume Manager) ###
|
||||
|
||||
Install the LVM tools as the root.
|
||||
|
||||
# apt-get update
|
||||
# apt-get install lvm2
|
||||
|
||||
Pick a physical volume to work with.
|
||||
|
||||
# pvcreate /dev/sda4
|
||||
|
||||
Create a volume group.
|
||||
|
||||
# vgcreate vg0 /dev/sda4
|
||||
|
||||
You don't need to create a logical volume. If you want to test LVM works, create a volume then delete it.
|
||||
|
||||
# lvcreate -nmytempvol -L10G vg0
|
||||
# lvremove /dev/vg0/mytempvol
|
||||
|
||||
Check LVM status.
|
||||
|
||||
# pvs (to view information about physical volumes)
|
||||
# vgs (to view information about volume groups)
|
||||
# lvs (to view information about logical volumes)
|
||||
|
||||
### Add a Linux Ethernet bridge ###
|
||||
|
||||
We are going to set up a Linux bridge so that all Xen's guest domains can be connected to, and communicate through the bridge.
|
||||
|
||||
Install the bridge tools.
|
||||
|
||||
# apt-get install bridge-utils
|
||||
|
||||
See what interfaces are configured.
|
||||
|
||||
# ip addr
|
||||
|
||||
![](https://farm8.staticflickr.com/7512/15610553338_2f9cf1d3a2_z.jpg)
|
||||
|
||||
In this example, we have one primary interface assigned eth0. We are going to add eth0 to the Linux bridge by editing the network configuration file (/etc/network/interfaces).
|
||||
|
||||
Before making any change, back up the network configuration file to keep the original working configuration safe.
|
||||
|
||||
# cd /etc/network/
|
||||
# cp interfaces interfaces.backup
|
||||
# vi /etc/network/interfaces
|
||||
|
||||
The file contents look something like this.
|
||||
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
allow-hotplug eth0
|
||||
iface eth0 inet dhcp
|
||||
|
||||
Change the file to this.
|
||||
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
auto eth0
|
||||
iface eth0 inet manual
|
||||
|
||||
auto xenbr0
|
||||
iface xenbr0 inet dhcp
|
||||
bridge_ports eth0
|
||||
|
||||
Activate the network configuration change:
|
||||
|
||||
# systemctl restart networking
|
||||
|
||||
### Verify networking settings ###
|
||||
|
||||
Verify that a Linux bridge xenbr0 is created successfully.
|
||||
|
||||
# ip addr show xenbr0
|
||||
|
||||
Also check that the primary interface eth0 is successfully added to the bridge.
|
||||
|
||||
# brctl show
|
||||
|
||||
![](https://farm6.staticflickr.com/5609/15795960355_673c71ab5c_z.jpg)
|
||||
|
||||
You now have a working machine with Jessie installed. Xen is not yet installed at this point. Let's proceed to install Xen next.
|
||||
|
||||
### Install the Xen hypervisor ###
|
||||
|
||||
Install Xen and QEMU packages, and update the GRUB bootloader.
|
||||
|
||||
# apt-get install xen-linux-system
|
||||
|
||||
Reboot.
|
||||
|
||||
When the GRUB screen appears, you can see extra booting options listed.
|
||||
|
||||
![](https://farm8.staticflickr.com/7535/15794086091_bf1bce6b4b_z.jpg)
|
||||
|
||||
The first option will boot automatically in five seconds (see the GRUB_TIMEOUT line in /etc/default/grub), so this is not the time to get a coffee.
|
||||
|
||||
Press the down arrow to highlight the option "Debian GNU/Linux, with Xen hypervisor", and press RETURN. Many lines of information appear, followed by the usual login screen.
|
||||
|
||||
### Check Xen works ###
|
||||
|
||||
Xen hypervisor comes with Xen management command-line tool called xl, which can be used to create and manage Xen guest domains. Let's use xl command to check if Xen is successfully installed.
|
||||
|
||||
Log in as root, and run:
|
||||
|
||||
# xl info
|
||||
|
||||
which will display various information about Xen host.
|
||||
|
||||
![](https://farm9.staticflickr.com/8404/15610553388_db3b134a9d_z.jpg)
|
||||
|
||||
To see a list of existing Xen domains:
|
||||
|
||||
# xl list
|
||||
|
||||
![](https://farm9.staticflickr.com/8393/15610135189_ffd8bd24e8_z.jpg)
|
||||
|
||||
A little table of domains appears. Without any Xen guest domain created, the only entry should be Domain-0, your Debian installation.
|
||||
|
||||
### Change the boot order ###
|
||||
|
||||
When you reach this point, the Xen install is complete. There is one more thing to fix - the default boot will not load Xen. GRUB chooses the first item in the boot menu (Debian GNU/Linux), not the third (Debian GNU/Linux, with Xen hypervisor).
|
||||
|
||||
The default option in the boot menu is defined in the grub configuration file /boot/grub/grub.cfg. To change the default option, don't edit that file, but edit /etc/default/grub instead. A little helper program called grub-mkconfig reads in this default configuration file and all the templates in /etc/grub.d/, then writes the grub.cfg file.
|
||||
|
||||
Edit Debian's configuration file for grub-mkconfig.
|
||||
|
||||
# vi /etc/default/grub
|
||||
|
||||
Change the line:
|
||||
|
||||
GRUB_DEFAULT=0
|
||||
|
||||
to
|
||||
|
||||
GRUB_DEFAULT='Debian GNU/Linux, with Xen hypervisor'
|
||||
|
||||
Then update the grub configuration file.
|
||||
|
||||
# grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
Finally reboot. After a few seconds, the grub boot menu appears. Check that the third option "Debian GNU/Linux, with Xen hypervisor" is highlighted automatically.
|
||||
|
||||
### Final note ###
|
||||
|
||||
If you use this machine as your hands-on workstation, install a graphical desktop. The Debian library includes a few [desktop environments][6]. If you want a graphical desktop that includes everything and the kitchen sink, go for Gnome. If graphics just get in your way, try Awesome.
|
||||
|
||||
Note that the Debian Jessie default environment Gnome comes with a huge amount of extra applications including the productivity suite LibreOffice, the Iceweasel web browser and the Rhythmbox music player. The install command "apt-get install gnome" adds 1,000 packages and takes up nearly 2GB of disk space. Running this heavyweight desktop takes up 1GB of memory.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/install-xen-hypervisor.html
|
||||
|
||||
作者:[Nick Hardiman][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/nick
|
||||
[1]:http://wiki.xen.org/wiki/Dom0
|
||||
[2]:http://wiki.xen.org/wiki/Dom0_Kernels_for_Xen
|
||||
[3]:https://www.debian.org/devel/debian-installer/
|
||||
[4]:http://ask.xmodulo.com/detect-dvd-writer-device-name-writing-speed-command-line-linux.html
|
||||
[5]:http://ask.xmodulo.com/find-device-name-usb-drive-linux.html
|
||||
[6]:https://wiki.debian.org/DesktopEnvironment
|
@ -1,129 +0,0 @@
|
||||
How to install Cacti (Monitoring tool) on ubuntu 14.10 server
|
||||
================================================================================
|
||||
Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices.
|
||||
|
||||
### Features ###
|
||||
|
||||
#### Graphs ####
|
||||
|
||||
Unlimited number of graph items can be defined for each graph optionally utilizing CDEFs or data sources from within cacti.
|
||||
|
||||
Automatic grouping of GPRINT graph items to AREA, STACK, and LINE[1-3] to allow for quick re-sequencing of graph items.
|
||||
|
||||
Auto-Padding support to make sure graph legend text lines up.
|
||||
|
||||
Graph data can be manipulated using the CDEF math functions built into RRDTool. These CDEF functions can be defined in cacti and can be used globally on each graph.
|
||||
|
||||
Support for all of RRDTool's graph item types including AREA, STACK, LINE[1-3], GPRINT, COMMENT, VRULE, and HRULE.
|
||||
|
||||
#### Data Sources ####
|
||||
|
||||
Data sources can be created that utilize RRDTool's "create" and "update" functions. Each data source can be used to gather local or remote data and placed on a graph.
|
||||
|
||||
Supports RRD files with more than one data source and can use an RRD file stored anywhere on the local file system.
|
||||
Round robin archive (RRA) settings can be customized giving the user the ability to gather data on non-standard timespans while store varying amounts of data.
|
||||
|
||||
#### Data Gathering ####
|
||||
|
||||
Contains a "data input" mechanism which allows users to define custom scripts that can be used to gather data. Each script can contain arguments that must be entered for each data source created using the script (such as an IP address).
|
||||
|
||||
Built in SNMP support that can use php-snmp, ucd-snmp, or net-snmp.
|
||||
|
||||
Ability to retrieve data using SNMP or a script with an index. An example of this would be populating a list with IP interfaces or mounted partitions on a server. Integration with graph templates can be defined to enable one click graph creation for hosts.
|
||||
|
||||
A PHP-based poller is provided to execute scripts, retrieve SNMP data, and update your RRD files.
|
||||
|
||||
#### Templates ####
|
||||
|
||||
Graph templates enable common graphs to be grouped together by templating. Every field for a normal graph can be templated or specified on a per-graph basis.
|
||||
|
||||
Data source templates enable common data source types to be grouped together by templating. Every field for a normal data source can be templated or specified on a per-data source basis.
|
||||
|
||||
Host templates are a group of graph and data source templates that allow you to define common host types. Upon the creation of a host, it will automatically take on the properties of its template.
|
||||
|
||||
#### Graph Display ####
|
||||
|
||||
The tree view allows users to create "graph hierarchies" and place graphs on the tree. This is an easy way to manage/organize a large number of graphs.
|
||||
|
||||
The list view lists the title of each graph in one large list which links the user to the actual graph.
|
||||
The preview view displays all of the graphs in one large list format. This is similar to the default view for the 14all cgi script for RRDTool/MRTG.
|
||||
|
||||
#### User Management ####
|
||||
|
||||
User based management allows administrators to create users and assign different levels of permissions to the cacti interface.
|
||||
|
||||
Permissions can be specified per-graph for each user, making cacti suitable for co location situations.
|
||||
Each user can keep their own graph settings for varying viewing preferences.
|
||||
|
||||
#### Preparing your system ####
|
||||
|
||||
Before installing cacti you need to make sure you have installed [Ubuntu 14.10 LAMP server][1].
|
||||
|
||||
#### Install Cacti on ubuntu 14.10 server ####
|
||||
|
||||
Open the terminal and run the following command
|
||||
|
||||
sudo apt-get install cacti-spine
|
||||
|
||||
The above command starts the cacti installation and you should see the first as php path change select ok and press enter
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/18.png)
|
||||
|
||||
Now select the webserver you want to use (in my case it is apache2)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/27.png)
|
||||
|
||||
Cacti database configurations select yes
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/35.png)
|
||||
|
||||
Enter database admin user password
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/42.png)
|
||||
|
||||
Mysql application password for cacti
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/5.png)
|
||||
|
||||
confirm the password
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/6.png)
|
||||
|
||||
Now that Cacti is installed, we can start the configuration process on it.
|
||||
|
||||
#### Configuring cacti ####
|
||||
|
||||
Point your web browser towards http://YOURSERVERIP/cacti/install/ to start the initial setup and click next
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/7.png)
|
||||
|
||||
Select new install option and click next
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/8.png)
|
||||
|
||||
In the following screen you need to make sure you have all the required paths are correct and click on finish
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/9.png)
|
||||
|
||||
Now login to Cacti with the default admin/admin, and change the password to something more sensible
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/10.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/111.png)
|
||||
|
||||
After login in to Cacti you should see similar to the following screen
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/11/14.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/how-to-install-cacti-monitoring-tool-on-ubuntu-14-10-server.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.ubuntugeek.com/www.ubuntugeek.com/step-by-step-ubuntu-14-10-utopic-unicorn-lamp-server-setup.html
|
@ -1,3 +1,4 @@
|
||||
SPccman...................
|
||||
Quick systemd-nspawn guide
|
||||
================================================================================
|
||||
I switched to using systemd-nspawn in place of chroot and wanted to give a quick guide to using it. The short version is that I’d strongly recommend that anybody running systemd that uses chroot switch over - there really are no downsides as long as your kernel is properly configured.
|
||||
@ -73,4 +74,4 @@ via: http://rich0gentoo.wordpress.com/2014/07/14/quick-systemd-nspawn-guide/
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://rich0gentoo.wordpress.com/
|
||||
[a]:http://rich0gentoo.wordpress.com/
|
||||
|
@ -1,153 +0,0 @@
|
||||
ideas4u Translating..
|
||||
How to use matplotlib for scientific plotting on Linux
|
||||
================================================================================
|
||||
If you want an efficient, automatable solution for producing high-quality scientific plots in Linux, then consider using matplotlib. Matplotlib is a Python-based open-source scientific plotting package with a license based on the Python Software Foundation license. The extensive documentation and examples, integration with Python and the NumPy scientific computing package, and automation capability are just a few reasons why this package is a solid choice for scientific plotting in a Linux environment. This tutorial will provide several example plots created with matplotlib.
|
||||
|
||||
### Features ###
|
||||
|
||||
- Numerous plot types (bar, box, contour, histogram, scatter, line plots...)
|
||||
- Python-based syntax
|
||||
- Integration with the NumPy scientific computing package
|
||||
- Source data can be Python lists, Python tuples, or NumPy arrays
|
||||
- Customizable plot format (axes scales, tick positions, tick labels...)
|
||||
- Customizable text (font, size, position...)
|
||||
- TeX formatting (equations, symbols, Greek characters...)
|
||||
- Compatible with IPython (allows interactive plotting from a Python shell)
|
||||
- Automation - use Python loops to iteratively create plots
|
||||
- Save plots to image files (png, pdf, ps, eps, and svg format)
|
||||
|
||||
The Python-based syntax of matplotlib serves as the foundation for many of its features and enables an efficient workflow. There are many scientific plotting packages that can produce quality plots, but do they allow you to do it directly from within your Python code? On top of that, do they allow you to create automated routines for iterative creation of plots that can be saved as image files? Matplotlib allows you to accomplish all of these tasks. You can now look forward to saving time that would have otherwise been spent manually creating multiple plots.
|
||||
|
||||
### Installation ###
|
||||
|
||||
Installation of Python and the NumPy package is a prerequisite for use of matplotlib. Instructions for installing NumPy can be found [here][1].
|
||||
|
||||
To install matplotlib in Debian or Ubuntu, run the following command:
|
||||
|
||||
$ sudo apt-get install python-matplotlib
|
||||
|
||||
To install matplotlib in Fedora or CentOS/RHEL, run the following command:
|
||||
|
||||
$ sudo yum install python-matplotlib
|
||||
|
||||
### Matplotlib Examples ###
|
||||
|
||||
This tutorial will provide several plotting examples that demonstrate how to use matplotlib:
|
||||
|
||||
- Scatter and line plot
|
||||
- Histogram plot
|
||||
- Pie chart
|
||||
|
||||
In these examples we will use Python scripts to execute matplotlib commands. Note that the numpy and matplotlib modules must be imported from within the scripts via the import command. np is specified as a reference to the numpy module and plt is specified as a reference to the matplotlib.pyplot namespace:
|
||||
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
### Example 1: Scatter and Line Plot ###
|
||||
|
||||
The first script, script1.py completes the following tasks:
|
||||
|
||||
- Creates three data sets (xData, yData1, and yData2)
|
||||
- Creates a new figure (assigned number 1) with a width and height of 8 inches and 6 inches, respectively
|
||||
- Sets the plot title, x-axis label, and y-axis label (all with font size of 14)
|
||||
- Plots the first data set, yData1, as a function of the xData dataset as a dotted blue line with circular markers and a label of "y1 data"
|
||||
- Plots the second data set, yData2, as a function of the xData dataset as a solid red line with no markers and a label of "y2 data".
|
||||
- Positions the legend in the upper left-hand corner of the plot
|
||||
- Saves the figure as a PNG file
|
||||
|
||||
Contents of script1.py:
|
||||
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
xData = np.arange(0, 10, 1)
|
||||
yData1 = xData.__pow__(2.0)
|
||||
yData2 = np.arange(15, 61, 5)
|
||||
plt.figure(num=1, figsize=(8, 6))
|
||||
plt.title('Plot 1', size=14)
|
||||
plt.xlabel('x-axis', size=14)
|
||||
plt.ylabel('y-axis', size=14)
|
||||
plt.plot(xData, yData1, color='b', linestyle='--', marker='o', label='y1 data')
|
||||
plt.plot(xData, yData2, color='r', linestyle='-', label='y2 data')
|
||||
plt.legend(loc='upper left')
|
||||
plt.savefig('images/plot1.png', format='png')
|
||||
|
||||
The resulting plot is shown below:
|
||||
|
||||
![](https://farm8.staticflickr.com/7529/15927002365_f5ae11cf02_z.jpg)
|
||||
|
||||
### Example 2: Histogram Plot ###
|
||||
|
||||
The second script, script2.py completes the following tasks:
|
||||
|
||||
- Creates a data set containing 1000 random samples from a Normal distribution
|
||||
- Creates a new figure (assigned number 1) with a width and height of 8 inches and 6 inches, respectively
|
||||
- Sets the plot title, x-axis label, and y-axis label (all with font size of 14)
|
||||
- Plots the data set, samples, as a histogram with 40 bins and an upper and lower bound of -10 and 10, respectively
|
||||
- Adds text to the plot and uses TeX formatting to display the Greek letters mu and sigma (font size of 16)
|
||||
- Saves the figure as a PNG file
|
||||
|
||||
Contents of script2.py:
|
||||
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
mu = 0.0
|
||||
sigma = 2.0
|
||||
samples = np.random.normal(loc=mu, scale=sigma, size=1000)
|
||||
plt.figure(num=1, figsize=(8, 6))
|
||||
plt.title('Plot 2', size=14)
|
||||
plt.xlabel('value', size=14)
|
||||
plt.ylabel('counts', size=14)
|
||||
plt.hist(samples, bins=40, range=(-10, 10))
|
||||
plt.text(-9, 100, r'$\mu$ = 0.0, $\sigma$ = 2.0', size=16)
|
||||
plt.savefig('images/plot2.png', format='png')
|
||||
|
||||
The resulting plot is shown below:
|
||||
|
||||
![](https://farm8.staticflickr.com/7531/15304765024_1cc271b6e0_z.jpg)
|
||||
|
||||
### Example 3: Pie Chart ###
|
||||
|
||||
The third script, script3.py completes the following tasks:
|
||||
|
||||
- Creates data set containing five integers
|
||||
- Creates a new figure (assigned number 1) with a width and height of 6 inches and 6 inches, respectively
|
||||
- Adds an axes to the figure with an aspect ratio of 1
|
||||
- Sets the plot title (font size of 14)
|
||||
- Plots the data set, data, as a pie chart with labels included
|
||||
- Saves the figure as a PNG file
|
||||
|
||||
Contents of script3.py:
|
||||
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
data = [33, 25, 20, 12, 10]
|
||||
plt.figure(num=1, figsize=(6, 6))
|
||||
plt.axes(aspect=1)
|
||||
plt.title('Plot 3', size=14)
|
||||
plt.pie(data, labels=('Group 1', 'Group 2', 'Group 3', 'Group 4', 'Group 5'))
|
||||
plt.savefig('images/plot3.png', format='png')
|
||||
|
||||
The resulting plot is shown below:
|
||||
|
||||
![](https://farm8.staticflickr.com/7504/15926356092_7c3e5217aa_z.jpg)
|
||||
|
||||
### Summary ###
|
||||
|
||||
This tutorial provides several examples of plots that can be created with the matplotlib scientific plotting package. Matplotlib is a great solution for scientific plotting in a Linux environment given its natural integration with Python and NumPy, its ability to be automated, and its production of a wide variety of customizable high quality plots. Documentation and examples for the matplotlib package can be found [here][2].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/matplotlib-scientific-plotting-linux.html
|
||||
|
||||
作者:[Joshua Reed][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/joshua
|
||||
[1]:http://xmodulo.com/numpy-scientific-computing-linux.html
|
||||
[2]:http://matplotlib.org/
|
@ -1,148 +0,0 @@
|
||||
Create Centralized Secure Storage using iSCSI Target on RHEL/CentOS/Fedora Part -I
|
||||
================================================================================
|
||||
**iSCSI** is a block level Protocol for sharing **RAW Storage Devices** over TCP/IP Networks, Sharing and accessing Storage over iSCSI, can be used with existing IP and Ethernet networks such as NICs, Switched, Routers etc. iSCSI target is a remote hard disk presented from an remote iSCSI server (or) target.
|
||||
|
||||
![Install iSCSI Target in Linux](http://www.tecmint.com/wp-content/uploads/2014/07/Install-iSCSI-Target-in-Linux.jpg)
|
||||
Install iSCSI Target in Linux
|
||||
|
||||
We don’t need a high resource for stable connectivity and performance in Client side’s. iSCSI Server called as Target, this share’s the storage from server. iSCSI Client’s called as Initiator, this will access the storage which shared from Target Server. There are iSCSI adapter’s available in market for Large Storage services such as SAN Storage’s.
|
||||
|
||||
**Why we need a iSCSI adapter for Large storage Area?**
|
||||
|
||||
Ethernet adapters (NIC) are designed to transfer packetized file level data among systems, servers and storage devices like NAS storage’s, they are not capable for transferring block level data over Internet.
|
||||
|
||||
### Features of iSCSI Target ###
|
||||
|
||||
- Possible to run several iSCSI targets on a single machine.
|
||||
- A single machine making multiple iscsi target available on the iSCSI SAN
|
||||
- The target is the Storage and makes it available for initiator (Client) over the network
|
||||
- These Storage’s are Pooled together to make available to the network is iSCSI LUNs (Logical Unit Number).
|
||||
- iSCSI supports multiple connections within the same session
|
||||
- iSCSI initiator discover the targets in network then authenticating and login with LUNs, to get the remote storage locally.
|
||||
- We can Install any Operating systems in those locally mounted LUNs as what we used to install in our Base systems.
|
||||
|
||||
### Why the need of iSCSI? ###
|
||||
|
||||
In Virtualization we need storage with high redundancy, stability, iSCSI provides those all in low cost. Creating a SAN Storage in low price while comparing to Fiber Channel SANs, We can use the standard equipment’s for building a SAN using existing hardware such as NIC, Ethernet Switched etc..
|
||||
|
||||
Let start to get install and configure the centralized Secure Storage using iSCSI Target. For this guide, I’ve used following setups.
|
||||
|
||||
- We need separate 1 systems to Setup the iSCSI Target Server and Initiator (Client).
|
||||
- Multiple numbers of Hard disk can be added in large storage environment, But we here using only 1 additional drive except Base installation disk.
|
||||
- Here we using only 2 drives, One for Base server installation, Other one for Storage (LUNs) which we going to create in PART-II of this series.
|
||||
|
||||
#### Master Server Setup ####
|
||||
|
||||
- Operating System – CentOS release 6.5 (Final)
|
||||
- iSCSI Target IP – 192.168.0.200
|
||||
- Ports Used : TCP 860, 3260
|
||||
- Configuration file : /etc/tgt/targets.conf
|
||||
|
||||
## Installing iSCSI Target ##
|
||||
|
||||
Open terminal and use yum command to search for the package name which need to get install for iscsi target.
|
||||
|
||||
# yum search iscsi
|
||||
|
||||
#### Sample Output ####
|
||||
|
||||
========================== N/S matched: iscsi =======================
|
||||
iscsi-initiator-utils.x86_64 : iSCSI daemon and utility programs
|
||||
iscsi-initiator-utils-devel.x86_64 : Development files for iscsi-initiator-utils
|
||||
lsscsi.x86_64 : List SCSI devices (or hosts) and associated information
|
||||
scsi-target-utils.x86_64 : The SCSI target daemon and utility programs
|
||||
|
||||
We got the search result as above, choose the **Target** package and install to play around.
|
||||
|
||||
# yum install scsi-target-utils -y
|
||||
|
||||
![Install iSCSI Utils](http://www.tecmint.com/wp-content/uploads/2014/07/Install-iSCSI-in-Linux.jpg)
|
||||
Install iSCSI Utils
|
||||
|
||||
List the installed package to know the default config, service, and man page location.
|
||||
|
||||
# rpm -ql scsi-target-utils.x86_64
|
||||
|
||||
![List All iSCSI Files](http://www.tecmint.com/wp-content/uploads/2014/07/List-All-ISCSI-Files.jpg)
|
||||
|
||||
List All iSCSI Files
|
||||
|
||||
Let’s start the iSCSI Service, and check the status of Service up and running, iSCSI service named as **tgtd**.
|
||||
|
||||
# /etc/init.d/tgtd start
|
||||
# /etc/init.d/tgtd status
|
||||
|
||||
![Start iSCSI Service](http://www.tecmint.com/wp-content/uploads/2014/07/Start-iSCSI-Service.jpg)
|
||||
|
||||
Start iSCSI Service
|
||||
|
||||
Now we need to configure it to start Automatically while system start-up.
|
||||
|
||||
# chkconfig tgtd on
|
||||
|
||||
Next, verify that the run level configured correctly for the tgtd service.
|
||||
|
||||
# chkconfig --list tgtd
|
||||
|
||||
![Enable iSCSI on Startup](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-iSCSI-on-Startup.jpg)
|
||||
|
||||
Enable iSCSI on Startup
|
||||
|
||||
Let’s use **tgtadm** to list what targets and LUNS we currently got configured in our Server.
|
||||
|
||||
# tgtadm --mode target --op show
|
||||
|
||||
The **tgtd** installed up and running, but there is no **Output** from the above command because we have not yet defined the LUNs in Target Server. For manual page, Run ‘**man**‘ command.
|
||||
|
||||
# man tgtadm
|
||||
|
||||
![iSCSI Man Pages](http://www.tecmint.com/wp-content/uploads/2014/07/iSCSI-Man-Pages.jpg)
|
||||
|
||||
iSCSI Man Pages
|
||||
|
||||
Finally we need to add iptables rules for iSCSI if there is iptables deployed in your target Server. First, find the Port number of iscsi target using following netstat command, The target always listens on TCP port 3260.
|
||||
|
||||
# netstat -tulnp | grep tgtd
|
||||
|
||||
![Find iSCSI Port](http://www.tecmint.com/wp-content/uploads/2014/07/Find-iSCSI-Port.jpg)
|
||||
|
||||
Find iSCSI Port
|
||||
|
||||
Next add the following rules to allow iptables to Broadcast the iSCSI target discovery.
|
||||
|
||||
# iptables -A INPUT -i eth0 -p tcp --dport 860 -m state --state NEW,ESTABLISHED -j ACCEPT
|
||||
# iptables -A INPUT -i eth0 -p tcp --dport 3260 -m state --state NEW,ESTABLISHED -j ACCEPT
|
||||
|
||||
![Open iSCSI Ports](http://www.tecmint.com/wp-content/uploads/2014/07/Open-iSCSI-Ports.jpg)
|
||||
|
||||
Open iSCSI Ports
|
||||
|
||||
![Add iSCSI Ports to Iptables](http://www.tecmint.com/wp-content/uploads/2014/07/Add-iSCSI-Ports-to-Iptables.jpg)
|
||||
|
||||
Add iSCSI Ports to Iptables
|
||||
|
||||
**Note**: Rule may vary according to your **Default CHAIN Policy**. Then save the Iptables and restart the iptables.
|
||||
|
||||
# iptables-save
|
||||
# /etc/init.d/iptables restart
|
||||
|
||||
![Restart iptables](http://www.tecmint.com/wp-content/uploads/2014/07/Restart-iptables.jpg)
|
||||
|
||||
Restart iptables
|
||||
|
||||
Here we have deployed a target server to share LUNs to any initiator which authenticating with target over TCP/IP, This suitable for small to large scale production environments too.
|
||||
|
||||
In my next upcoming articles, I will show you how to [Create LUN’s using LVM in Target Server][1] and how to share LUN’s on Client machines, till then stay tuned to TecMint for more such updates and don’t forget to give valuable comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/create-centralized-secure-storage-using-iscsi-targetin-linux/
|
||||
|
||||
作者:[Babin Lonston][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/babinlonston/
|
||||
[1]:http://www.tecmint.com/create-luns-using-lvm-in-iscsi-target/
|
@ -1,230 +0,0 @@
|
||||
How to Create and Setup LUNs using LVM in “iSCSI Target Server” on RHEL/CentOS/Fedora – Part II
|
||||
================================================================================
|
||||
LUN is a Logical Unit Number, which shared from the iSCSI Storage Server. The Physical drive of iSCSI target server shares its drive to initiator over TCP/IP network. A Collection of drives called LUNs to form a large storage as SAN (Storage Area Network). In real environment LUNs are defined in LVM, if so it can be expandable as per space requirements.
|
||||
|
||||
![Create LUNS using LVM in Target Server](http://www.tecmint.com/wp-content/uploads/2014/07/Create-LUNS-inLVM.png)
|
||||
Create LUNS using LVM in Target Server
|
||||
|
||||
### Why LUNS are Used? ###
|
||||
|
||||
LUNS used for storage purpose, SAN Storage’s are build with mostly Groups of LUNS to become a pool, LUNs are Chunks of a Physical disk from target server. We can use LUNS as our systems Physical Disk to install Operating systems, LUNS are used in Clusters, Virtual servers, SAN etc. The main purpose of Using LUNS in Virtual servers for OS storage purpose. LUNS performance and reliability will be according to which kind of disk we using while creating a Target storage server.
|
||||
|
||||
### Requirements ###
|
||||
|
||||
To know about creating a ISCSI Target Server follow the below link.
|
||||
|
||||
- [Create Centralized Secure Storage using iSCSI Target – Part I][1]
|
||||
|
||||
#### Master Server Setup ####
|
||||
|
||||
System information’s and Network setup are same as iSCSI Target Server as shown in Part – I, As we are defining LUNs in same server.
|
||||
|
||||
- Operating System – CentOS release 6.5 (Final)
|
||||
- iSCSI Target IP – 192.168.0.200
|
||||
- Ports Used : TCP 860, 3260
|
||||
- Configuration file : /etc/tgt/targets.conf
|
||||
|
||||
## Creating LUNs using LVM in iSCSI Target Server ##
|
||||
|
||||
First, find out the list of drives using **fdisk -l** command, this will manipulate a long list of information of every partitions on the system.
|
||||
|
||||
# fdisk -l
|
||||
|
||||
The above command only gives the drive information’s of base system. To get the storage device information, use the below command to get the list of storage devices.
|
||||
|
||||
# fdisk -l /dev/vda && fdisk -l /dev/sda
|
||||
|
||||
![List Storage Drives](http://www.tecmint.com/wp-content/uploads/2014/07/1.jpg)
|
||||
|
||||
List Storage Drives
|
||||
|
||||
**NOTE**: Here **vda** is virtual machines hard drive as I’m using virtual machine for demonstration, **/dev/sda** is added additionally for storage.
|
||||
|
||||
### Step 1: Creating LVM Drive for LUNs ###
|
||||
|
||||
We going to use **/dev/sda** drive for creating a LVM.
|
||||
|
||||
# fdisk -l /dev/sda
|
||||
|
||||
![List LVM Drive](http://www.tecmint.com/wp-content/uploads/2014/07/2.jpg)
|
||||
|
||||
List LVM Drive
|
||||
|
||||
Now let’s Partition the drive using fdisk command as shown below.
|
||||
|
||||
# fdisk -cu /dev/sda
|
||||
|
||||
- The option ‘**-c**‘ switch off the DOS compatible mode.
|
||||
- The option ‘**-u**‘ is used to listing partition tables, give sizes in sectors instead of cylinders.
|
||||
|
||||
Choose **n** to create a New Partition.
|
||||
|
||||
Command (m for help): n
|
||||
|
||||
Choose **p** to create a Primary partition.
|
||||
|
||||
Command action
|
||||
e extended
|
||||
p primary partition (1-4)
|
||||
|
||||
Give a Partition number which we need to create.
|
||||
|
||||
Partition number (1-4): 1
|
||||
|
||||
As here, we are going to setup a LVM drive. So, we need to use the default settings to use full size of Drive.
|
||||
|
||||
First sector (2048-37748735, default 2048):
|
||||
Using default value 2048
|
||||
Last sector, +sectors or +size{K,M,G} (2048-37748735, default 37748735):
|
||||
Using default value 37748735
|
||||
|
||||
Choose the type of partition, Here we need to setup a LVM so use **8e**. Use **l** option to see the list of type.
|
||||
|
||||
Command (m for help): t
|
||||
|
||||
Choose which partition want to change the type.
|
||||
|
||||
Selected partition 1
|
||||
Hex code (type L to list codes): 8e
|
||||
Changed system type of partition 1 to 8e (Linux LVM)
|
||||
|
||||
After changing the type, check the changes by print (**p**) option to list the partition table.
|
||||
|
||||
Command (m for help): p
|
||||
|
||||
Disk /dev/sda: 19.3 GB, 19327352832 bytes
|
||||
255 heads, 63 sectors/track, 2349 cylinders, total 37748736 sectors
|
||||
Units = sectors of 1 * 512 = 512 bytes
|
||||
Sector size (logical/physical): 512 bytes / 512 bytes
|
||||
I/O size (minimum/optimal): 512 bytes / 512 bytes
|
||||
Disk identifier: 0x9fae99c8
|
||||
|
||||
Device Boot Start End Blocks Id System
|
||||
/dev/sda1 2048 37748735 18873344 8e Linux LVM
|
||||
|
||||
Write the changes using **w** to exit from fdisk utility, Restart the system to make changes.
|
||||
|
||||
For your reference, I’ve attached screen shot below that will give you a clear idea about creating LVM drive.
|
||||
|
||||
![Create LVM Partition](http://www.tecmint.com/wp-content/uploads/2014/07/3.jpg)
|
||||
|
||||
Create LVM Partition
|
||||
|
||||
After system reboot, list the Partition table using the following fdisk command.
|
||||
|
||||
# fdisk -l /dev/sda
|
||||
|
||||
![Verify LVM Partition](http://www.tecmint.com/wp-content/uploads/2014/07/4.jpg)
|
||||
|
||||
Verify LVM Partition
|
||||
|
||||
### Step 2: Creating Logical Volumes for LUNs ###
|
||||
|
||||
Now here, we going to create Physical volume using using ‘pvcreate’ command.
|
||||
|
||||
# pvcreate /dev/sda1
|
||||
|
||||
Create a Volume group with name of iSCSI to identify the group.
|
||||
|
||||
# vgcreate vg_iscsi /dev/sda1
|
||||
|
||||
Here I’m defining 4 Logical Volumes, if so there will be 4 LUNs in our iSCSI Target server.
|
||||
|
||||
# lvcreate -L 4G -n lv_iscsi vg_iscsi
|
||||
|
||||
# lvcreate -L 4G -n lv_iscsi-1 vg_iscsi
|
||||
|
||||
# lvcreate -L 4G -n lv_iscsi-2 vg_iscsi
|
||||
|
||||
# lvcreate -L 4G -n lv_iscsi-3 vg_iscsi
|
||||
|
||||
List the Physical volume, Volume group, logical volumes to confirm.
|
||||
|
||||
# pvs && vgs && lvs
|
||||
# lvs
|
||||
|
||||
For better understanding of the above command, for your reference I’ve included a screen grab below.
|
||||
|
||||
![Creating LVM Logical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/5.jpg)
|
||||
|
||||
Creating LVM Logical Volumes
|
||||
|
||||
![Verify LVM Logical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/6.jpg)
|
||||
|
||||
Verify LVM Logical Volumes
|
||||
|
||||
### Step 3: Define LUNs in Target Server ###
|
||||
|
||||
We have created Logical Volumes and ready to use with LUN, here we to define the LUNs in target configuration, if so only it will be available for client machines (Initiators).
|
||||
|
||||
Open and edit Targer configuration file located at ‘/etc/tgt/targets.conf’ with your choice of editor.
|
||||
|
||||
# vim /etc/tgt/targets.conf
|
||||
|
||||
Append the following volume definition in target conf file. Save and close the file.
|
||||
|
||||
<target iqn.2014-07.com.tecmint:tgt1>
|
||||
backing-store /dev/vg_iscsi/lv_iscsi
|
||||
</target>
|
||||
<target iqn.2014-07.com.tecmint:tgt1>
|
||||
backing-store /dev/vg_iscsi/lv_iscsi-1
|
||||
</target>
|
||||
<target iqn.2014-07.com.tecmint:tgt1>
|
||||
backing-store /dev/vg_iscsi/lv_iscsi-2
|
||||
</target>
|
||||
<target iqn.2014-07.com.tecmint:tgt1>
|
||||
backing-store /dev/vg_iscsi/lv_iscsi-3
|
||||
</target
|
||||
|
||||
![Configure LUNs in Target Server](http://www.tecmint.com/wp-content/uploads/2014/07/7.jpg)
|
||||
|
||||
Configure LUNs in Target Server
|
||||
|
||||
- iSCSI qualified name (iqn.2014-07.com.tecmint:tgt1).
|
||||
- Use what ever as your wish.
|
||||
- Identify using target, 1st target in this Server.
|
||||
- 4. LVM Shared for particular LUN.
|
||||
|
||||
Next, reload the configuration by starting **tgd** service as shown below.
|
||||
|
||||
# /etc/init.d/tgtd reload
|
||||
|
||||
![Reload Configuration](http://www.tecmint.com/wp-content/uploads/2014/07/8.jpg)
|
||||
|
||||
Reload Configuration
|
||||
|
||||
Next verify the available LUNs using the following command.
|
||||
|
||||
# tgtadm --mode target --op show
|
||||
|
||||
![List Available LUNs](http://www.tecmint.com/wp-content/uploads/2014/07/9.jpg)
|
||||
|
||||
List Available LUNs
|
||||
|
||||
![LUNs Information](http://www.tecmint.com/wp-content/uploads/2014/07/10.jpg)
|
||||
|
||||
LUNs Information
|
||||
|
||||
The above command will give long list of available LUNs with following information.
|
||||
|
||||
- iSCSI Qualified Name
|
||||
- iSCSI is Ready to Use
|
||||
- By Default LUN 0 will be reserved for Controller
|
||||
- LUN 1, What we have Defined in the Target server
|
||||
- Here i have defined 4 GB for a single LUN
|
||||
- Online : Yes, Its ready to Use the LUN
|
||||
|
||||
Here we have defined the LUNs for target server using LVM, this can be expandable and support for many features such as snapshots. Let us see how to authenticate with Target server in PART-III and mount the remote Storage locally.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/create-luns-using-lvm-in-iscsi-target/
|
||||
|
||||
作者:[Babin Lonston][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/babinlonston/
|
||||
[1]:http://www.tecmint.com/create-centralized-secure-storage-using-iscsi-targetin-linux/
|
@ -1,3 +1,4 @@
|
||||
ideas4u is translating!
|
||||
4 Steps to Setup Local Repository in Ubuntu using APT-mirror
|
||||
================================================================================
|
||||
Today we will show you how to setup a local repository in your Ubuntu PC or Ubuntu Server straight from the official Ubuntu repository. There are a lot benefit of creating a local repository in your computer if you have a lot of computers to install software, security updates and fixes often in all systems, then having a local Ubuntu repository is an efficient way. Because all required packages are downloaded over the fast LAN connection from your local server, so that it will save your Internet bandwidth and reduces the annual cost of Internet..
|
||||
@ -122,4 +123,4 @@ via: http://linoxide.com/ubuntu-how-to/setup-local-repository-ubuntu/
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/arunp/
|
||||
[1]:https://launchpad.net/ubuntu/+archivemirrors
|
||||
[1]:https://launchpad.net/ubuntu/+archivemirrors
|
||||
|
@ -1,265 +0,0 @@
|
||||
translating by mtunique
|
||||
5 User Space Debugging Tools in Linux
|
||||
================================================================================
|
||||
By definition, debugging tools are those programs which allow us to monitor ,control and correct errors in other programs while they execute. Why should we use debugging tools? To answer this, there are various situations where we get stuck while running some programs and will have the need to understand what exactly happened. For example, we might be running an application and it produces some error messages. To fix those errors, we should first figure out why and from where did the error messages come from. An application might suddenly hang and we will have to know what other processes were running at that time. We might also have to figure out what was process 'x' doing at the time of hang. In order to dissect such details, we will need the help of debugging tools. There are a few user space debugging tools and techniques in Linux which are quite useful in analysing user space problems. They are:
|
||||
|
||||
- **'print' statements**
|
||||
- **Querying (/proc, /sys etc)**
|
||||
- **Tracing (strace/ltrace)**
|
||||
- **Valgrind (memwatch)**
|
||||
- **GDB**
|
||||
|
||||
Let's go through each of them one by one.
|
||||
|
||||
### 1.'print' statements ###
|
||||
|
||||
This is a basic or primitive way of debugging a problem. We can insert print statements in the middle of a program to understand the control flow and get the value of key variables. Though it is a simple technique, it has some disadvantages to it. Programs need to be edited to add 'print 'statements which then will have to be recompiled and rerun to get the output. This is a time-consuming method if the program to be debugged is quite big.
|
||||
|
||||
### 2. Querying ###
|
||||
|
||||
In some situations, we might want to figure out in what state a running process is in the kernel or what is the memory map that it is occupying there etc. In order to obtain this type of information, we need not insert any code into the kernel. Instead, one can use the /proc filesystem.
|
||||
|
||||
/proc is a pseudo filesystem that gets populated with runtime system information (cpu information, amount of memory etc) once the system is up and running.
|
||||
|
||||
![output of 'ls /proc'](http://blog.linoxide.com/wp-content/uploads/2014/12/proc-output.png)
|
||||
output of 'ls /proc'
|
||||
|
||||
As you can see, each process that is running in the system has an entry in the /proc filesystem in the form of its process id . Details about each of these processes can be obtained by looking into the files present in its process id directory
|
||||
|
||||
![output of 'ls /proc/pid'](http://blog.linoxide.com/wp-content/uploads/2014/12/proc-pid.png)
|
||||
output of 'ls /proc/pid'
|
||||
|
||||
Explaining all the entries inside the /proc filesystem is beyond the scope of this document. Some of the useful ones are listed below:
|
||||
|
||||
- /proc/cmdline -> Kernel command line
|
||||
- /proc/cpuinfo -> information about the processor's make, model etc
|
||||
- /proc/filesystems -> filesystem information supported by the kernel
|
||||
- /proc//cmdline -> command line arguments passed to the current process
|
||||
- /proc//mem -> memory held by the process
|
||||
- /proc//status -> status of the process
|
||||
|
||||
### 3. Tracing ###
|
||||
|
||||
strace and ltrace are two of the tracing tools used in Linux to trace program execution details.
|
||||
|
||||
#### strace: ####
|
||||
|
||||
strace intercepts and records system calls within a process and the signals received by it. To the user, it displays the system calls, arguments passed to them and the return values. strace can be attached to a process that is already running or to a new process. It is useful as a diagnostic and debugging tools for developers and system administrators. It can also be used as a tool to understand how system calls work by tracing different programs. Advantage of this tool is that no source code is needed and programs need not be recompiled.
|
||||
|
||||
The basic syntax for using strace is:
|
||||
|
||||
**strace command**
|
||||
|
||||
There are various options that are available to be used with strace command. One can check out the man page for strace tool to get more details.
|
||||
|
||||
The output of strace can be quite lengthy and we may not be interested in going through each and every line that is displayed. We can use the '-e expr' option to filter the unwanted data.
|
||||
|
||||
Use '-p pid' option to attach it to a running process.
|
||||
|
||||
Output of the command can be redirected to a file using the '-o' option
|
||||
|
||||
![output of strace filtering only the open system call](http://blog.linoxide.com/wp-content/uploads/2014/12/strace-output.png)
|
||||
output of strace filtering only the open system call
|
||||
|
||||
#### ltrace: ####
|
||||
|
||||
ltrace tracks and records the dynamic (runtime) library calls made by a process and the signals received by it. It can also track the system calls made within a process. It's usage is similar to strace
|
||||
|
||||
**ltrace command**
|
||||
|
||||
'-i ' option prints the instruction pointer at the time of library call
|
||||
|
||||
'-S' option is used to display both system calls and library calls
|
||||
|
||||
Refer to the ltrace man page for all the available options.
|
||||
|
||||
![output of ltrace capturing 'strcmp' library call](http://blog.linoxide.com/wp-content/uploads/2014/12/ltrace-output.png)
|
||||
output of ltrace capturing 'strcmp' library call
|
||||
|
||||
### 4. Valgrind ###
|
||||
|
||||
Valgrind is a suite of debugging and profiling tools. One of the widely used and the default tool is a memory checking tool called 'Memcheck' which intercepts calls made to malloc(), new(), free() and delete(). In other words, it is useful in detecting problems like:
|
||||
|
||||
- memory leaks
|
||||
- double freeing
|
||||
- boundary overruns
|
||||
- using uninitialized memory
|
||||
- using a memory after it has been freed etc.
|
||||
|
||||
It works directly with the executable files.
|
||||
|
||||
Valgrind comes with a few drawbacks as well. It can slow down your program as it increases the memory footprint. It can sometimes produce false positives and false negatives. It cannot detect out-of-range access to statically allocated arrays
|
||||
|
||||
In order to use it, first download it and install it on your system. ([Valgrind's download page][1]). It can be installed using the package manager for the operating system that one is using.
|
||||
|
||||
Installation using command line involves decompressing and untarring the downloaded file.
|
||||
|
||||
tar -xjvf valgring-x.y.z.tar.bz2 (where x.y.z is the version number you are trying to install)
|
||||
|
||||
Get inside the newly created directory (valgrind-x.y.z)and run the following commands:
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
Let's understand how valgrind works with a small program(test.c):
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void f(void)
|
||||
|
||||
{
|
||||
int x = malloc(10 * sizeof(int));
|
||||
|
||||
x[10] = 0;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
f();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Compile the program:
|
||||
|
||||
gcc -o test -g test.c
|
||||
|
||||
Now we have an executable file called 'test'. We can now use valgrind to check for memory errors:
|
||||
|
||||
valgrind –tool=memcheck –leak-check=yes test
|
||||
|
||||
Here is the valgrind output showing the errors:
|
||||
|
||||
![output of valgrind showing heap block overrun and memory leak](http://blog.linoxide.com/wp-content/uploads/2014/12/Valgrind.png)
|
||||
output of valgrind showing heap block overrun and memory leak
|
||||
|
||||
As we can see in the above message, we are trying to access the area beyond what is allocated in function f and the allocated memory is not freed.
|
||||
|
||||
### 5. GDB ###
|
||||
|
||||
GDB is a debugger from Free Software Foundation. It is useful in locating and fixing problems in the code. It gives control to the user to perform various actions when the program to be debugged is running, like:
|
||||
|
||||
- starting the program
|
||||
- stop at specified locations
|
||||
- stop on specified conditions
|
||||
- examine required information
|
||||
- make changes to data in the program etc.
|
||||
|
||||
One can also attach a core dump of a crashed program to GDB and analyse the cause of crash.
|
||||
|
||||
GDB provides a lot of options to debug programs. However, we will cover some important options here so that one can get a feel of how to get started with GDB.
|
||||
|
||||
If you do not already have GDB installed, it can be downloaded from [GDB's official website][2].
|
||||
|
||||
#### Compiling programs: ####
|
||||
|
||||
In order to debug a program using GDB, it has to be compiled using gcc with the'-g' option. This produces debugging information in the operating system's native format and GDB works with this information.
|
||||
|
||||
Here is a simple program (example1.c)performing divide by zero to show the usage of GDB:
|
||||
|
||||
#include
|
||||
int divide()
|
||||
{
|
||||
int x=5, y=0;
|
||||
return x / y;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
divide();
|
||||
}
|
||||
|
||||
![An example showing usage of gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb-example.png)
|
||||
An example showing usage of gdb
|
||||
|
||||
#### Invoking GDB: ####
|
||||
|
||||
GDB can be started by executing 'gdb' in the command-line:
|
||||
|
||||
![invoking gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb.png)
|
||||
invoking gdb
|
||||
|
||||
Once invoked, it remains there waiting for commands from the terminal and executing them until exited .
|
||||
|
||||
If a process is already running and you need to attach GDB to it, it can be done by specifying the process id Suppose a program has already crashed and one wants to analyse the cause of the problem, then attaching GDB to the core file helps.
|
||||
|
||||
#### Starting the program: ####
|
||||
|
||||
Once you are inside GDB, use the 'run' command to start the program to be debugged
|
||||
|
||||
#### Passing arguments to the program: ####
|
||||
|
||||
Use the 'set args' command to send the arguments to your program when it runs next time 'show args' will show the arguments passed to the program
|
||||
|
||||
#### Verifying the stack: ####
|
||||
|
||||
Whenever a program stops, first thing anyone wants to understand is why it stopped and how it stopped there. This information is called backtrace. Every function call generated by a program gets stored along with the local variables, arguments passed, call location etc in a block of data inside the stack and is called a frame. Using GDB we can examine all this data. GDB identifies these frames by giving them numbers starting from the innermost frame.
|
||||
|
||||
- **bt**: prints the backtrace of the entire stack
|
||||
- **bt <n>** prints the backtrace of n frames
|
||||
- **frame <frame number>**: switches to the specified frame and prints that frame
|
||||
- **up <n>**: move 'n' frames up
|
||||
- **down <n>**: move 'n' frames down. ( n is 1 by default)
|
||||
|
||||
#### Examining data: ####
|
||||
|
||||
Program's data can be examined inside GDB using the 'print' command. For example, if 'x' is a variable inside the debugging program, 'print x' prints the value of x.
|
||||
|
||||
#### Examining source: ####
|
||||
|
||||
Parts of source file can be printed within GDB. 'list' command by default prints 10 lines of code.
|
||||
|
||||
- **list <linenum>**: list the source file around 'linenum'
|
||||
- **list <function>**: list the source from the beginning of 'function'
|
||||
|
||||
- **disas <function>**: displays the machine code for the function
|
||||
|
||||
#### Stopping and resuming the program: ####
|
||||
|
||||
Using GDB, we can set breakpoints, watchpoint etc in order to stop the program wherever required.
|
||||
|
||||
- **break <location>**: Sets up a breakpoint at 'location'. When this is hit while the program is executing, control is given to the user.
|
||||
- **watch <expr>**: GDB stops when the 'expr' is written into by the program and it's value changes
|
||||
- **catch <event>**: GDB stops when the 'event' occurs.
|
||||
- **disable <breakpoint>**: disable the specified breakpoint
|
||||
- **enable <breakpoint>**: enable the specified breakpoint
|
||||
- **delete <breakpoint>**: delete the breakpoint / watchpoint / catch point passed. If no arguments are passed default action is to work on all the breakpoints
|
||||
|
||||
- **step**: execute the program step by step
|
||||
- **continue**: continue with program execution until execution is complete
|
||||
|
||||
#### Exiting GDB: ####
|
||||
|
||||
Use the 'quit' command to exit from GDB
|
||||
|
||||
There are many more options that are available with GDB. Use the help option once you are inside GDB for more details.
|
||||
|
||||
![getting help within gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb-help.png)
|
||||
getting help within gdb
|
||||
|
||||
### Summary ###
|
||||
|
||||
In this article, we have seen different types of user space debug tools available in Linux. To summarise all of them, here is a quick guideline on when to use what:
|
||||
Basic debugging, getting values of key variables – print statements
|
||||
|
||||
Get information about filesystems supported, available memory, cpus, status of a running program in the kernel etc - querying /proc filesystem
|
||||
|
||||
Initial problem diagnosis, system call or library call related issues , understanding program flow – strace / ltrace
|
||||
|
||||
Application space related memory problems – valgrind
|
||||
|
||||
To examine runtime behaviour of applications, analysing application crashes – gdb.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-how-to/user-space-debugging-tools-linux/
|
||||
|
||||
作者:[B N Poornima][a]
|
||||
译者:[mtunique](https://github.com/mtunique)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/bnpoornima/
|
||||
[1]:http://valgrind.org/downloads.html
|
||||
[2]:http://www.gnu.org/software/gdb/download/
|
@ -0,0 +1,174 @@
|
||||
Linux 和类Unix 系统上5个极品的开源软件备份工具
|
||||
================================================================================
|
||||
一个好的备份最基本的就是为了能够从一些错误中恢复
|
||||
|
||||
- 人为的失误
|
||||
- 磁盘阵列或是硬盘故障
|
||||
- 文件系统崩溃
|
||||
- 数据中心被破坏等等。
|
||||
|
||||
所以,我为大家罗列了一些开源的软件备份工具。
|
||||
|
||||
### 当为一个企业选择备份工具的时候,你都考虑什么呢? ###
|
||||
|
||||
确定你正在部署的软件具有下面的特性
|
||||
|
||||
1. **开源软件** - 你务必要选择那些源码可以免费获得,并且可以修改的软件。确信可以恢复你的数据,即使是软件的供应商或者/或是项目停止继续维护这个软件或者是拒绝继续为这个软件提供补丁。
|
||||
|
||||
2. **跨平台支持** - 确定备份软件可以很好的运行各种需要部署的桌面操作系统和服务器系统。
|
||||
|
||||
3. **数据格式** - 一种开放的数据格式可以让你能够恢复数据,即使是供应商或是项目停止对软件的支持。
|
||||
|
||||
4. **自动转换** - 自动转换本来是没什么,除了对于各种备份设备,包括图书馆,近线存储和自动加载,自动转换可以自动完成一些任务,包括加载,挂载和标签备份像磁带这些媒体设备。
|
||||
|
||||
5. **备份介质** - 确定你可以备份到磁带,硬盘,DVD 和云存储像AWS。
|
||||
|
||||
6. **加密数据流** - 确定所有客户端到服务器的传输都被加密,保证在LAN/WAN/Internet 中传输的安全性。
|
||||
|
||||
7. **数据库支持** - 确定备份软件可以备份到数据库,像MySQL 或是 Oracle。
|
||||
|
||||
8. **备份可以跨越多个卷** - 备份软件(转存文件)可以把每个备份文件分成几个部分,允许将每个部分存在于不同的卷。这样可以保证一些数据量很大的备份(像100TB的文件)可以被存储在一些比单个部分大的设备中,比如说像硬盘和磁盘卷。
|
||||
|
||||
9. **VSS (卷影复制)** - 这是[微软的卷影复制服务(VSS)][1],通过创建数据的快照来备份。确定备份软件支持VSS的MS-Windows 客户端/服务器。
|
||||
|
||||
10. **重复数据删除** - 这是一种数据压缩技术,用来消除重复数据的副本(比如,图片)。
|
||||
|
||||
11. **许可证和成本** - 确定你[理解和使用的开源许可证][3]下的软件源码你可以得到。
|
||||
|
||||
12. **商业支持** - 开源软件可以提供社区支持(像邮件列表和论坛)和专业的支持(像发行版提供额外的付费支持)。你可以使用付费的专业支持以培训和咨询为目的。
|
||||
|
||||
13. **报告和警告** - 最后,你必须能够看到备份的报告,当前的工作状态,也能够在备份出错的时候提供警告。
|
||||
|
||||
### Bacula - 一个应用于多元化异构网络的客户端服务器备份工具 ###
|
||||
|
||||
我个人应用这个软件来管理备份和通过网络来恢复系统,包括Linux, OSX, 和Windows。你可以通过CLI, GUI, 或者Web界面来配置Bacula。
|
||||
|
||||
![](http://s0.cyberciti.org/uploads/cms/2014/11/bacula-network-backup.jpg)
|
||||
|
||||
- 操作系统:支持跨平台运行。
|
||||
- 备份级别:完全,差异,增量,合并。
|
||||
- 数据格式:支持自定义且完全开放。
|
||||
- 自动转换:支持。
|
||||
- 备份介质:支持磁带,磁盘和DVD。
|
||||
- 加密数据流:支持。
|
||||
- 数据库:支持MSSQL、PostgreSQL、Oracle 。
|
||||
- 跨卷备份:支持
|
||||
- VSS(卷影复制):支持。
|
||||
- 许可:Affero General Public License v3.0。
|
||||
- 下载链接:[bacula.org][4]
|
||||
|
||||
### Amanda - 又一个客户端服务器备份工具 ###
|
||||
|
||||
AMANDA 是 Advanced Maryland Automatic Network Disk Archiver 的缩写。它允许系统管理员创建一个单独的服务器来备份网络上的其他主机到磁带驱动器或硬盘或者是自动转换器。
|
||||
|
||||
- 操作系统:支持跨平台运行。
|
||||
- 备份级别:完全,差异,增量,合并。
|
||||
- 数据格式:开放(可以通过tar等工具恢复)。
|
||||
- 自动转换:支持。
|
||||
- 备份介质:支持磁带,磁盘和DVD。
|
||||
- 加密数据流:支持。
|
||||
- 数据库:支持MSSQL, Oracle。
|
||||
- 跨卷备份:支持。
|
||||
- VSS(卷影复制):支持。
|
||||
- 许可:GPL, LGPL, Apache, Amanda License。
|
||||
- 下载链接:[amanda.org][5]
|
||||
|
||||
### Backupninja - 轻量级备份系统 ###
|
||||
|
||||
Backupninja 是一个简单易用的备份系统。你可以简单的拖放配置文件到 /etc/backup.d/ 目录来备份多个主机。
|
||||
|
||||
![](http://s0.cyberciti.org/uploads/cms/2014/11/ninjabackup-helper-script.jpg)
|
||||
|
||||
- 操作系统:支持Linux,Unix。
|
||||
- 备份级别:支持完全,差异备份(rsync + hard 链接)
|
||||
- 数据格式:开放
|
||||
- 自动转换:N/A。(注:N/A = Not Applicable)。
|
||||
- 备份介质:磁盘,DVD,CD,ISO 镜像。
|
||||
- 加密数据流:支持(ssh)和[通过duplicity远程加密备份][6]。
|
||||
- 数据库:支持MySQL,PostgreSQL,OpenLDAP 和subversion 或trac。
|
||||
- 跨卷备份:??
|
||||
- VSS(卷影复制):??
|
||||
- 许可:GPL
|
||||
- 下载链接:[riseup.net][7]
|
||||
|
||||
### Backuppc - 高效的客户端服务器备份工具###
|
||||
|
||||
Backuppc 可以用来备份基于LInux 和Windows 系统的主服务器硬盘。它配备了一个巧妙的池计划来最大限度的减少磁盘储存,磁盘I/O 和网络I/O。
|
||||
|
||||
![](http://s0.cyberciti.org/uploads/cms/2014/11/BackupPCServerStatus.jpg)
|
||||
|
||||
- 操作系统:支持Linux,Unix 和Windows。
|
||||
- 备份级别:支持完全和增量备份(rsync +hard 链接和pooling 计划)
|
||||
- 数据格式:开放。
|
||||
- 自动转换:N/A。
|
||||
- 备份介质:磁盘和磁盘阵列。
|
||||
- 加密数据流:支持。
|
||||
- 数据库:支持(通过Shell 脚本)
|
||||
- 跨卷备份:??
|
||||
- VSS(卷影复制):??
|
||||
- 许可:GPL。
|
||||
- 下载链接:[backuppc.sourceforge.net][8]
|
||||
|
||||
### UrBackup - 最容易配置的客户端服务器系统 ###
|
||||
|
||||
UrBackup 是一个非常容易配置的开源客户端服务器备份系统,通过图像和文件备份的组合完成了数据安全性和快速的恢复。你的文件可以通过Web界面或者是在Windows资源管理器中恢复,而驱动卷的备份用引导CD或者是USB 棒来恢复(逻辑恢复)。一个Web 界面使得配置你自己的备份服务变得非常简单。
|
||||
|
||||
![](http://s0.cyberciti.org/uploads/cms/2014/11/urbackup.jpg)
|
||||
|
||||
- 操作系统:支持Linux,FreeBSD,Unix,Windows 和少数基于NAS 的Linux操作系统,客户端只支持Linux 和Windows 操作系统。
|
||||
- 备份级别:支持完全和增量备份。
|
||||
- 数据格式:开放。
|
||||
- 自动转换:N/A。
|
||||
- 备份介质:磁盘,磁盘阵列和DVD。
|
||||
- 加密数据流:支持。
|
||||
- 数据库:??
|
||||
- 跨卷备份:??
|
||||
- VSS(卷影复制):??
|
||||
- 许可:GPL v3+
|
||||
- 下载链接:[urbackup.org][9]
|
||||
|
||||
### 其他供你考虑的一些极好用的开源备份软件 ###
|
||||
|
||||
Amanda,Bacula 和上面所提到的软件都是功能丰富,但是配置比较复杂对于一些小的网络或者是单独的服务器。我建议你学习和使用一下的备份软件:
|
||||
|
||||
1. [Rsnapshot][10] - 我建议用这个作为对本地和远程的文件系统快照工具。查看[怎么设置和使用这个工具在Debian 和Ubuntu linux][11]和[基于CentOS,RHEL 的操作系统][12]。
|
||||
2. [rdiff-backup][13] - 另一个好用的类Unix 远程增量备份工具。
|
||||
3. [Burp][14] - Burp 是一个网络备份和恢复程序。它使用了librsync来节省网络流量和节省每个备份占用的空间。它也使用了VSS(卷影复制服务),在备份Windows计算机时进行快照。
|
||||
4. [Duplicity][15] - 伟大的加密和高效的备份类Unix操作系统。查看如何[安装Duplicity来加密云备份][16]来获取更多的信息。
|
||||
5. [SafeKeep][17] - SafeKeep是一个集中和易于使用的备份应用程序,结合了镜像和增量备份最佳功能的备份应用程序。
|
||||
6. [DREBS][18] - DREBS 是EBS定期快照的工具。它被设计成在EBS快照所连接的EC2主机上运行。
|
||||
7. 古老的unix 程序,像rsync, tar, cpio, mt 和dump。
|
||||
|
||||
###结论###
|
||||
|
||||
我希望你会发现这篇有用的文章来备份你的数据。不要忘了验证你的备份和创建多个数据备份。然而,对于磁盘阵列并不是一个备份解决方案。使用任何一个上面提到的程序来备份你的服务器,桌面和笔记本电脑和私人的移动设备。如果你知道其他任何开源的备份软件我没有提到的,请分享在评论里。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.cyberciti.biz/open-source/awesome-backup-software-for-linux-unix-osx-windows-systems/
|
||||
|
||||
作者:[nixCraft][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://www.cyberciti.biz/tips/about-us
|
||||
[1]:http://technet.microsoft.com/en-us/library/cc785914(v=ws.10).aspx
|
||||
[2]:http://en.wikipedia.org/wiki/Data_deduplication
|
||||
[3]:http://opensource.org/licenses
|
||||
[4]:http://www.bacula.org/
|
||||
[5]:http://www.amanda.org/
|
||||
[6]:http://www.cyberciti.biz/faq/duplicity-installation-configuration-on-debian-ubuntu-linux/
|
||||
[7]:https://labs.riseup.net/code/projects/backupninja
|
||||
[8]:http://backuppc.sourceforge.net/
|
||||
[9]:http://www.urbackup.org/
|
||||
[10]:http://www.rsnapshot.org/
|
||||
[11]:http://www.cyberciti.biz/faq/linux-rsnapshot-backup-howto/
|
||||
[12]:http://www.cyberciti.biz/faq/redhat-cetos-linux-remote-backup-snapshot-server/
|
||||
[13]:http://www.nongnu.org/rdiff-backup/
|
||||
[14]:http://burp.grke.org/
|
||||
[15]:http://www.cyberciti.biz/open-source/awesome-backup-software-for-linux-unix-osx-windows-systems/
|
||||
[16]:http://www.cyberciti.biz/faq/duplicity-installation-configuration-on-debian-ubuntu-linux/
|
||||
[17]:http://safekeep.sourceforge.net/
|
||||
[18]:https://github.com/dojo4/drebs
|
@ -0,0 +1,102 @@
|
||||
Translated by H-mudcup
|
||||
|
||||
2014年Linux界发生的好事,坏事和丑事
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/Buggest_Linux_Stories.jpeg)
|
||||
|
||||
2014年已经接近尾声,现在正是盘点**2014年Linux大事件**的时候。整整一年,我们关注了有关Linux和开源的一些好事,坏事和丑事。让我们来快速回顾一下2014对于Linux是怎样的一年。
|
||||
|
||||
### 好事 ###
|
||||
|
||||
首先,让我们来看看在2014年对于Linux爱好者发生了什么有积极意义的事。
|
||||
|
||||
#### Linux上的Netflix ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/netflix-linux.jpg)
|
||||
|
||||
从使用Wine到[使用Chrome的测试功能][1],为了能让Netflix能在Linux上工作,Linux用户曾尝试了各种方法。好消息是Netflix终于在2014年带来了Linux的本地支持。这让所有能使用Netflix的地区的Linux用户的脸上浮现出了微笑。想在[美国以外的地区使用Netflix][2](或其他官方授权使用Netflix的国家之外)的人还是得靠其他的方法。
|
||||
|
||||
#### 欧洲国家采用开源/Linux ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/OpenSource_World.jpg)
|
||||
|
||||
如果你愿意的话,你可以归功于经济滑坡,但是Linux和开源的采用已经俘虏了欧洲各大城市。我说的可不是个人用户,而是政府和各个官方机构。一整年我们都在听到这样的消息:[法国][3]和[意大利各大城市如何通过改用Linux和开源办公软件节省了数百万欧元][4]。而且这个趋势并没有仅限于意大利和法国,在西班牙、[瑞士][5]和[德国][6]也能见到。
|
||||
|
||||
#### Windows 10从Linux获得灵感 ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/10/Windows10_Linux.jpg)
|
||||
|
||||
即将发行的微软的旗舰操作系统Windows,将被称为Windows 10(没有Windows 9)。并且Windows 10将拥有一大堆的新特性。但是这些“新特性”只在微软的世界里是新的,而且大多是这些新特性已经在Linux的世界里存在了数年。看看这些[Windows 10从Linux复制的特性][7]。
|
||||
|
||||
### 坏事 ###
|
||||
|
||||
Linux在2014年并不是一帆风顺。某些事件的发生损坏了Linux/开源的形象。
|
||||
|
||||
#### Heartbleed心血 ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/heartbleed-bug.jpg)
|
||||
|
||||
在今年的四月份,检测到[OpenSSL][8]有一个缺陷。这个漏洞被命名为[Heartbleed心血][9]。他影响了包括Facebook和Google在内的50多万个“安全”网站。这项漏洞可以真正的允许任何人读取系统的内存,并能因此给予用于加密数据流的密匙的访问权限。[xkcd上的漫画以更简单的方式解释了心血][10]。不必说,这个漏洞在OpenSSL的更新中被修复了。
|
||||
|
||||
#### Shellshock ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/09/shellshock_Linux_check.jpeg)
|
||||
|
||||
好像有个心血还不够似的,在Bash里的一个缺陷更严重的震撼了Linux世界。这个漏洞被命名为[Shellshock][11]。这个漏洞把Linux往远程攻击的危险深渊又推了一把。这项漏洞是通过黑客的DDoS攻击暴露出来的。升级一下Bash版本应该能修复这个问题。
|
||||
|
||||
#### Ubuntu Phone和Steam控制台 ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/Ubuntu_phone.png)
|
||||
|
||||
一个又一个的承诺,一次又一次的期望。但是即使在2014年也没人看见Ubuntu Phone或是Steam游戏控制台。围绕Ubuntu Phone产生了很多激烈的讨论。从2014年二月发行推到九月又推到十二月,(谢天谢地)终于有可能在2015年二月发行。但是Steam控制台还是没有消息。想了解更多请读[Ubuntu Phone说明书,价格和发行日期][12]。
|
||||
|
||||
### 丑事 ###
|
||||
|
||||
systemd的归属战变得不知廉耻。
|
||||
|
||||
### systemd大论战 ###
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/Systemd_everywhere.jpg)
|
||||
|
||||
用init还是systemd的争吵已经进行了一段时间了。但是在2014年当systemd准备在包括Debian, Ubuntu, OpenSUSE, Arch Linux and Fedora几个主流Linux分布中替代init时,事情变得不知廉耻了起来。它是如此的一发不可收拾,以至于它已经不限于boycottsystemd.org这类网站了。Lennart Poettering(systemd的首席开发人员及作者)在一条Google Plus状态上声明,说那些反对systemd的人在“收集比特币来雇杀手杀他”。Lennart还声称开源社区“是个恶心得不能待的地方”。人们吵得越来越离谱以至于把Debian分裂成了一个新的操作系统,称为[Devuan][15]。
|
||||
|
||||
### 还有诡异的事 ###
|
||||
|
||||
伴随着好事、坏事和丑事而来得是诡异的事,而且没谁能比微软更诡异。
|
||||
|
||||
#### 微软爱Linux ####
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/12/Microsoft_Loves_Linux.png)
|
||||
|
||||
是的,你没看错。[微软爱Linux][16]。同为微软CEO,Steve Ballmer曾说[Linux是毒瘤][17]。当新CEO,Satya Nadella宣称微软爱Linux时,我们透过微软向Linux和开源的靠近,看到了领导层的改变。这份对Linux的爱实际上是微软试图让[Azure][18]成为更好的云平台。为了达成这项目标,需要虚拟化Hyper-V(Azure核心),以便同Linux一起运行。这个绝境让[微软成为Linux内核的第五大贡献者][19]。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/biggest-linux-stories-2014/
|
||||
|
||||
作者:[Abhishek][a]
|
||||
译者:[H-mudcup](https://github.com/H-mudcup)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://itsfoss.com/author/Abhishek/
|
||||
[1]:http://itsfoss.com/watch-netflix-in-ubuntu-14-04/
|
||||
[2]:http://itsfoss.com/easiest-watch-netflix-hulu-usa/
|
||||
[3]:http://itsfoss.com/french-city-toulouse-saved-1-million-euro-libreoffice/
|
||||
[4]:http://itsfoss.com/italian-city-turin-open-source/
|
||||
[5]:http://itsfoss.com/170-primary-public-schools-geneva-switch-ubuntu/
|
||||
[6]:http://itsfoss.com/german-town-gummersbach-completes-switch-open-source/
|
||||
[7]:http://itsfoss.com/windows-10-inspired-linux/
|
||||
[8]:http://en.wikipedia.org/wiki/OpenSSL
|
||||
[9]:http://heartbleed.com/
|
||||
[10]:http://xkcd.com/1354/
|
||||
[11]:http://itsfoss.com/linux-shellshock-check-fix/
|
||||
[12]:http://itsfoss.com/ubuntu-phone-specification-release-date-pricing/
|
||||
[13]:http://www.tecmint.com/systemd-replaces-init-in-linux/
|
||||
[14]:https://plus.google.com/+LennartPoetteringTheOneAndOnly/posts/J2TZrTvu7vd
|
||||
[15]:http://debianfork.org/
|
||||
[16]:http://thenewstack.io/microsoft-professes-love-for-linux-adds-support-for-coreos-cloudera-and-host-of-new-features/
|
||||
[17]:http://www.theregister.co.uk/2001/06/02/ballmer_linux_is_a_cancer/
|
||||
[18]:http://azure.microsoft.com/en-us/
|
||||
[19]:http://www.zdnet.com/article/top-five-linux-contributor-microsoft/
|
@ -0,0 +1,85 @@
|
||||
安卓编年史
|
||||
================================================================================
|
||||
![重新设计的拨号和联系人页面。](http://cdn.arstechnica.net/wp-content/uploads/2014/01/dialercontacts.png)
|
||||
重新设计的拨号和联系人页面。
|
||||
Ron Amadeo供图
|
||||
|
||||
联系人/拨号应用程序的圆角标签拥有了更清晰,更成熟的外观设计。拨号器更名为“电话”,并且拨号按键从圆形改为了圆角矩形。语音邮件,拨号,以及删除的按键被放置在底部。这个界面是安卓在3.0之前缺乏设计一致性的一个很好的例子。仅仅在这个界面上,标签用的是直角矩形,拨号按键使用圆角矩形,底部按键两侧合起来是个完整的圆。这里就像是个UI控件的摸奖袋,没有人尝试过让它们之间相互搭配。
|
||||
|
||||
安卓2.0的一个新特性是“快速拨号”,它将联系人以略缩图的形式添加到整个系统。从其它应用中点击它们可以打开一个联系这个人的快捷方式列表。这在联系人里并没有多大意义,但像在Google Talk中,能够通过点击某人的略缩图来给他拨号是十分方便的。
|
||||
|
||||
![](http://cdn.arstechnica.net/wp-content/uploads/2014/01/calls.png)
|
||||
Ron Amadeo供图
|
||||
|
||||
安卓2.0终于配备了接通和拒绝来电所需要的所有屏幕按键,而不再需要实体按钮,Droid从中获益,从它的设计中除去了在现在看来是多余的按钮。安卓对于接通和拒绝来电的解决方案是这些左滑和右滑的标签。他们的工作方式就像是滑动解锁(后来被用到了滑动解锁中)——向右滑动绿色按钮接通来电,向左滑动红色按钮则是拒绝。一旦进入通话中,它看起来就很像安卓1.6了。所有选项还是隐藏在菜单按钮之中。
|
||||
|
||||
某人在设计拨号界面的时候一定在煲电话粥。他们只是去掉了“拨号盘”上字母的粗体,而不是从安卓1.6中重新绘制数字“5”的按键,然后就这么收工了。
|
||||
|
||||
![计算器和浏览器。](http://cdn.arstechnica.net/wp-content/uploads/2014/01/calcubrowser.png)
|
||||
计算器和浏览器。
|
||||
Ron Amadeo供图
|
||||
|
||||
计算器从在安卓0.9中被引入以来第一次得到改进。黑色玻璃球按钮换成了渐变色的蓝色和黑色的按钮。旧版计算器点击状态疯狂的红色高亮被改为了一个比较正常的白色轮廓。
|
||||
|
||||
浏览器的微型网站名称栏改进为一个完整的,功能更完善的地址栏,并且带有书签按钮。为了节省屏幕空间,地址栏被附加到网页上,所以地址栏会随着页面向上滚动,给你留下更多的网页阅读空间。安卓1.6独特的缩放控制和附加按钮被去除,被替换为一个更简单的双击缩放手势,并且浏览器可以再次打开arstechnica.com而不崩溃。这里还是没有双指捏合缩放。
|
||||
|
||||
![打开设置的相机,闪光灯设置,以及查看照片界面的菜单。](http://cdn.arstechnica.net/wp-content/uploads/2014/03/cam2-these-are-settigns.jpg)
|
||||
打开设置的相机,闪光灯设置,以及查看照片界面的菜单。
|
||||
Ron Amadeo供图
|
||||
|
||||
相机应用获得整个左侧的抽屉式菜单,打开它有许多设置。摩托罗拉Droid是第一款带有LED闪光灯的安卓手机之一,所以设置里有个闪光灯控制,以及还有像场景模式,白平衡,效果,图片尺寸和存储位置(SD卡或内置存储)的设置。
|
||||
|
||||
在照片查看界面,谷歌精简了菜单按钮。和屏幕上的选项相比,它们之间不再有重复的选项。这样精简后省下的空间,使得所有的选项能够在菜单里放得下了,而不再需要一个“更多”按钮。
|
||||
|
||||
![电子邮件应用的“帐户”页面,新的组合收件箱,系统设置的帐户与同步页面,自动亮度设置。 ](http://cdn.arstechnica.net/wp-content/uploads/2014/02/emailacc2ountsetc.png)
|
||||
电子邮件应用的“帐户”页面,新的联合收件箱,系统设置的帐户与同步页面,自动亮度设置。
|
||||
Ron Amadeo供图
|
||||
|
||||
电子邮件应用程序有个大的功能提升。最重要的是它终于支持了Microsoft Exchange。安卓2.0版本的电子邮件中收件箱和文件夹视图终于分开了,而不是使用安卓1.0引入的凌乱的混合视图。电子邮件甚至有了一个统一的收件箱,可以将你不同账户的所有邮件显示到一起。
|
||||
|
||||
这个收件箱视图和Gmail一起,把普通的电子邮件应用打趴下了。联合收件箱甚至胜过了Gmail的功能,这是极其罕见的。尽管如此,相对于Gmail来说,电子邮件仍然感觉像个多余的继女。它使用了Gmail界面来查看邮件,这意味着收件箱和文件夹使用了黑色主题,查看邮件却奇怪地选择了亮色主题。
|
||||
|
||||
捆绑的Facebook应用程序有一个很棒的账户同步功能,它可以从社交网络上下载联系人的照片和信息,并无缝集成到联系人应用里。后来Facebook和谷歌分道扬镳,[谷歌取消了这一功能][1]。谷歌表示,在Facebook不向其共享信息的情况下,与Facebook分享信息并不是什么好想法,因此更好的用户体验败给了公司间的政治斗争。
|
||||
|
||||
(不幸的是,我们无法展示Facebook应用,因为它也是死在OAuth更新手中的客户端之一。现在不可能从像这么老旧的应用上登录了。)
|
||||
|
||||
最后一张图片显示了自动亮度控制,安卓2.0是第一个支持这一功能的版本。Droid配备了光线传感器,点击该复选框,会使亮度滑块消失,并且允许设备自动控制屏幕亮度。
|
||||
|
||||
正如它的名字所暗示的那样,安卓2.0是谷歌有史以来最大的更新。摩托罗拉和威瑞森给安卓带来了一个外形酷炫的设备,并在广告上投入了数不清的资金。之后的一段时间里,“Droid”成为了一个家喻户晓的名字。
|
||||
|
||||
### The Nexus One——迎来Google Phone ###
|
||||
|
||||
![](http://cdn.arstechnica.net/wp-content/uploads/2014/03/nexus_4_lineup.jpg)
|
||||
|
||||
2010年1月,第一款Nexus设备发布,称为“[Nexus One][2]”。对谷歌来说,这部设备是个巨大的里程碑。这是第一部由谷歌设计并冠名的设备,而且谷歌计划直接向消费者出售设备。宏达电代工的Nexus One拥有1GHz的单核高通骁龙S1处理器,512MB的内存,512MB存储空间,以及一块3.7英寸的AMOLED显示屏。
|
||||
|
||||
Nexus One注定拥有纯净的安卓体验,没有运营商的定制和应用植入。谷歌直接控制安卓的更新。这使得谷歌能够在软件完成时直接向用户进行推送, 而不是再经过运营商的许可。运营商总是拖慢这一过程,因为他们对用户已经付过钱手机并不总是那么热切地想要改善它们。
|
||||
|
||||
谷歌[直接在网上][3]销售Nexus One,无锁,无合约,完整零售价529.99美元。尽管同样的Nexus One在T-Mobile商店的合约价仅为179.99美元,谷歌想通过它的在线商店改变美国手机行业的运作方式。谷歌当时的想法是先挑选手机,再选择运营商,以此打破美国无线寡头对硬件的控制。
|
||||
|
||||
但谷歌的零售革命并没有奏效,在在线手机商店开通半年后,谷歌关闭了该服务。谷歌指出首要问题是销量低。在2010年,网上购物并不像今天这样司空见惯,消费者也还没有准备好在他们不能先握在自己手中试用的设备上花费530美元。高昂的价格也是一个制约因素;智能手机消费者更习惯于为眼前的设备花费200美元,并签署一项为期两年的合同。还有摩托罗拉Droid的因素,相比之下这部三个月前发布的设备并没有显著的不足。还由于Droid的庞大的营销活动和“iPhone杀手”的炒作,它已经夺取了大多数Nexus One面向的安卓发烧友市场。
|
||||
|
||||
尽管Nexus One的网上销售尝试可以被认为是失败的,谷歌还是从中学到了很多。2012年,谷歌以Google Play的“设备”板块[重新推出其网上商店][4]。
|
||||
|
||||
----------
|
||||
|
||||
![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg)
|
||||
|
||||
[Ron Amadeo][a] / Ron是Ars Technica的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。
|
||||
|
||||
[@RonAmadeo][t]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/11/
|
||||
|
||||
译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://techcrunch.com/2011/02/22/google-android-facebook-contacts/
|
||||
[2]:http://arstechnica.com/gadgets/2010/01/nexus-one-review/
|
||||
[3]:http://arstechnica.com/gadgets/2010/01/googles-big-news-today-was-not-a-phone-but-a-url/
|
||||
[4]:http://arstechnica.com/gadgets/2012/04/unlocked-samsung-galaxy-nexus-can-now-be-purchased-from-google/
|
||||
[a]:http://arstechnica.com/author/ronamadeo
|
||||
[t]:https://twitter.com/RonAmadeo
|
@ -0,0 +1,229 @@
|
||||
|
||||
怎样在废旧的硬件上安装 Xen 虚拟机监视器
|
||||
================================================================================
|
||||
Xen 是一个直接运行在硬件上的虚拟机监视器,这意味着你必须准备一个裸机来安装和运行 Xen。KVM 和 Xen 有一些不同 —— 你可以把它安装在任何已经正在运行 Linux 的机器上。本教程描述了如何在废旧的硬件上安装和配置 Xen 虚拟机监视器。
|
||||
|
||||
整个安装过程使用 Debian Jessie(Debian 的测试发行版)作为宿主机操作系统(也称作 [Dom0][1])。Jessie 并不是唯一的选择 —— Xen 的支持是内建在 Linux 内核中的,[许多 Linux 发行版][2] 都包含支持 Xen 的内核。
|
||||
|
||||
### 找点废旧的硬件 ###
|
||||
首先,找一个可以格式化的合适的工作站,比如一台旧的笔记本或者台式机。旧的硬件可能不适合玩游戏,但是足够安装一个宿主机和一些客户机了。一个满足下面这些要求的 PC 机就可以了。
|
||||
|
||||
- 一个双核 CPU(64 位)
|
||||
- 4GB 内存
|
||||
- 80GB 硬盘
|
||||
- 能够从 CD,DVD 或者 USB 引导启动
|
||||
- 一块网卡
|
||||
|
||||
注意 CPU 必须是 64 位的,因为 Debian 已经不再支持 32 位的 Xen 安装包。如果你没有空余的硬件,你可以花点钱投资一台旧机器。2010 年值 $1000 的旗舰级笔记本现在只需要 $100。从 eBay 买台二手笔记本并升级下内存也可以满足需求。
|
||||
|
||||
### 刻录一个引导 CD/USB ###
|
||||
|
||||
下载 Debian Jessie 的 ISO 镜像。从 [Debian 官网][3] 下载网络安装镜像就可以了。
|
||||
|
||||
$ wget http://cdimage.debian.org/cdimage/jessie_di_beta_2/amd64/iso-cd/debian-jessie-DI-b2-amd64-netinst.iso
|
||||
|
||||
接下来,记下你的 [CD/DVD][4] 或者 [USB设备][5] 所识别的设备名 (例如 /dev/sdc)。
|
||||
|
||||
使用 dd 命令将 ISO 镜像刻录至 CD 或者 USB 中。将下面的 /dev/sdc 替换为你上面识别出的设备名。
|
||||
|
||||
$ sudo dd if=debian-jessie-DI-b2-amd64-netinst.iso of=/dev/sdc
|
||||
|
||||
### 开始安装 ###
|
||||
|
||||
安装前,使用刻录的 CD/USB 启动 Debian 的安装界面。
|
||||
|
||||
最好是使用有线网络,而不是 WIFI。如果因为固件或者驱动的原因导致 WIFI 不能连接,你将无法完成下面的步骤。
|
||||
|
||||
![](https://farm8.staticflickr.com/7516/15772286696_c31e4c7754_z.jpg)
|
||||
|
||||
### 硬盘分区 ###
|
||||
|
||||
这里的设置使用了四个分区。自动安装时通常会创建一个包含逻辑分区的扩展分区。像下面这样给硬盘分四个区。
|
||||
|
||||
- sda1 挂载至 /boot,200MB
|
||||
- sda2 /, 20GB, Ubuntu 占用 4GB
|
||||
- sda3 swap, 6GB (4GB x 1.5 = 6)
|
||||
- sda4 保留用作 LVM, 不挂载,大小为剩余的硬盘大小
|
||||
|
||||
### 安装基本的系统 ###
|
||||
|
||||
这里尽可能的让系统的安装更简单快速一些。一个基本的工作用系统可以稍后再添加。Debian 的 APT(Advanced Package Tool)使得添加软件非常的简单。在一个工作站上安装 Deibian 可能会有一些很浪费时间的问题。可能显卡驱动与内核不监控或者可能老旧的 CD-ROM 驱动器只能间歇性的工作。
|
||||
|
||||
当选择安装软件时,选择安装一个 SSH 服务器,不要安装桌面环境如 Gnome。
|
||||
|
||||
![](https://farm9.staticflickr.com/8541/15176520633_5d31beda9c_z.jpg)
|
||||
|
||||
安装一个图形桌面需要安装成百上千的包 —— 这些额外的工作可以稍后再进行。如果你遇到问题了,等到图形桌面的安装会浪费很多事件。同时,没有桌面组件,系统的启动可以更快一些 —— 只需要几十秒而不是几分钟。整个安装过程会需要重启几次,因此这样做可以节省不少时间。
|
||||
|
||||
一个 SSH 服务器可以让你从另一台电脑来配置这台工作站。这可以避免一些旧硬件的问题 —— 可能旧机器的键盘少了几个键,LCD 屏幕有坏点或者触摸板没有反应等等。
|
||||
|
||||
### 添加 LVM (Logical Volume Manager) ###
|
||||
|
||||
以 root 身份安装 LVM 工具。
|
||||
|
||||
# apt-get update
|
||||
# apt-get install lvm2
|
||||
|
||||
选择一个分区创建物理卷。
|
||||
|
||||
# pvcreate /dev/sda4
|
||||
|
||||
创建卷组。
|
||||
|
||||
# vgcreate vg0 /dev/sda4
|
||||
|
||||
你并不需要创建逻辑卷。如果你想测试 LVM 是否正常,可以创建一个逻辑卷然后删掉它。
|
||||
|
||||
# lvcreate -nmytempvol -L10G vg0
|
||||
# lvremove /dev/vg0/mytempvol
|
||||
|
||||
检查 LVM 状态。
|
||||
|
||||
# pvs (to view information about physical volumes)
|
||||
# vgs (to view information about volume groups)
|
||||
# lvs (to view information about logical volumes)
|
||||
|
||||
### 添加一个 Linux 网桥 ###
|
||||
|
||||
这里我们要添加一个桥接网卡,这样 Xen 客户机就可以通过网桥连接网络。
|
||||
|
||||
安装桥接的工具。
|
||||
|
||||
# apt-get install bridge-utils
|
||||
|
||||
查看在哪块网卡配置桥接。
|
||||
See what interfaces are configured.
|
||||
|
||||
# ip addr
|
||||
|
||||
![](https://farm8.staticflickr.com/7512/15610553338_2f9cf1d3a2_z.jpg)
|
||||
|
||||
在这个例子中,我们有一块网卡名称为 eth0。我们准备修改配置文件(/etc/network/interfaces)将 eth0 作为桥接设备。
|
||||
|
||||
在进行更改之前,备份网络配置文件以保证原来的工作配置是安全的。
|
||||
|
||||
# cd /etc/network/
|
||||
# cp interfaces interfaces.backup
|
||||
# vi /etc/network/interfaces
|
||||
|
||||
文件的内容类似下面这样。
|
||||
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
allow-hotplug eth0
|
||||
iface eth0 inet dhcp
|
||||
|
||||
修改成这样。
|
||||
|
||||
auto lo
|
||||
iface lo inet loopback
|
||||
|
||||
auto eth0
|
||||
iface eth0 inet manual
|
||||
|
||||
auto xenbr0
|
||||
iface xenbr0 inet dhcp
|
||||
bridge_ports eth0
|
||||
|
||||
激活网卡配置的修改:
|
||||
|
||||
# systemctl restart networking
|
||||
|
||||
### 验证网络设置 ###
|
||||
|
||||
验证桥接设备 xenbr0 创建成功。
|
||||
|
||||
# ip addr show xenbr0
|
||||
|
||||
同时检查 eth0 被成功加入网桥。
|
||||
|
||||
# brctl show
|
||||
|
||||
![](https://farm6.staticflickr.com/5609/15795960355_673c71ab5c_z.jpg)
|
||||
|
||||
你现在安装好了 Jessie 系统。不过此时 Xen 还没有安装。下面我们开始安装 Xen。
|
||||
|
||||
### 安装 Xen 虚拟机监视器 ###
|
||||
|
||||
安装 Xen 和 QEMU 包,并升级 GRUB 引导程序。
|
||||
|
||||
# apt-get install xen-linux-system
|
||||
|
||||
重启。
|
||||
|
||||
当 GRUB 界面出现时,你可以看到列出的额外的启动选项。
|
||||
|
||||
![](https://farm8.staticflickr.com/7535/15794086091_bf1bce6b4b_z.jpg)
|
||||
|
||||
第一个选项会在 5 秒钟内自动启动(在 /etc/default/grub 的 GRUB_TIMEOUT 这行设置),因此这点时间还来不及喝咖啡的。
|
||||
|
||||
按下方向键选择 "Debian GNU/Linux, with Xen hypervisor" 这个选项,然后按回车。这时屏幕会出现很多行信息,接着是正常的登录界面。
|
||||
|
||||
### 检查 Xen 工作是否正常 ###
|
||||
|
||||
Xen 虚拟机监视器嗲有一个管理 Xen 的命令行工序叫做 xl,可以用来创建和管理 Xen 虚拟机。使用 xl 命令来检查 Xen 是否成功安装了。
|
||||
|
||||
以 root 用户登录,执行:
|
||||
|
||||
# xl info
|
||||
|
||||
将会显示很多关于 Xen 主机的信息。
|
||||
|
||||
![](https://farm9.staticflickr.com/8404/15610553388_db3b134a9d_z.jpg)
|
||||
|
||||
查看已有 Xen 虚拟机的列表:
|
||||
|
||||
# xl list
|
||||
|
||||
![](https://farm9.staticflickr.com/8393/15610135189_ffd8bd24e8_z.jpg)
|
||||
|
||||
这里显示了一个主机的列表。因为没有创建任何的 Xen 客户机,唯一的条目是 Domain-0,即你安装的 Debian 系统。
|
||||
|
||||
### 修改启动顺序 ###
|
||||
|
||||
当你到这一步之后,Xen 的安装已经完成了。这里还有一件事需要修改 —— 默认的启动选项不会加载 Xen。GRUB 选择启动菜单的第一个选项 (Debian GNU/Linux),而不是第三个(Debian GNU/Linux, with Xen hypervisor)。
|
||||
|
||||
启动菜单的默认选项是在 grub 配置文件 /boot/grub/grub.cfg 中定义的。修改选项时,不要直接修改这个文件,而是编辑 /etc/default/grub 这个文件。有一个叫做 grub-mkconfig 的工具可以读取这个配置文件和 /etc/grub.d/ 中的所有莫爸妈,并写入到 grub.cfg 文件中。
|
||||
|
||||
编辑 Debian 的 grub-mkconfig 的配置文件
|
||||
|
||||
# vi /etc/default/grub
|
||||
|
||||
修改这一行:
|
||||
|
||||
GRUB_DEFAULT=0
|
||||
|
||||
改为
|
||||
|
||||
GRUB_DEFAULT='Debian GNU/Linux, with Xen hypervisor'
|
||||
|
||||
然后更新 grub 的配置文件。
|
||||
|
||||
# grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
最后重启。几秒钟后,grub 启动菜单出现了。检查看第三个选项 "Debian GNU/Linux, with Xen hypervisor" 是否是自动选中的选项。
|
||||
|
||||
### 最后 ###
|
||||
|
||||
如果你使用这台主机作为你的工作站,可以安装一个图形桌面。Debian 包好几种[桌面环境][6]。如果你想要一个包含所有东西的图形桌面,那么安装 Gnome 吧。如果图形效果并不是你的菜,试试 Awesome 吧。
|
||||
|
||||
注意 Debian 的默认 Gnome 环境有大量的额外应用程序包括办公套件 LibreOffice,Iceweasel 浏览器和 Rhythmbox 音乐播放器。安装命令 "apt-get install gnome" 会安装 1,000 多个包并需要将近 2GB 的硬盘空间。运行这个重量级的桌面环境需要占用 1GB 的内存。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/install-xen-hypervisor.html
|
||||
|
||||
作者:[Nick Hardiman][a]
|
||||
译者:[Liao](https://github.com/liaoishere)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nick
|
||||
[1]:http://wiki.xen.org/wiki/Dom0
|
||||
[2]:http://wiki.xen.org/wiki/Dom0_Kernels_for_Xen
|
||||
[3]:https://www.debian.org/devel/debian-installer/
|
||||
[4]:http://ask.xmodulo.com/detect-dvd-writer-device-name-writing-speed-command-line-linux.html
|
||||
[5]:http://ask.xmodulo.com/find-device-name-usb-drive-linux.html
|
||||
[6]:https://wiki.debian.org/DesktopEnvironment
|
@ -0,0 +1,131 @@
|
||||
How to install Cacti (Monitoring tool) on ubuntu 14.10 server
|
||||
怎样在 Ubuntu 14.10 Server 上安装 Cacti(监控工具)
|
||||
================================================================================
|
||||
Cacti 是一个网络绘图解决方案,它被设计用来管理 RRDTool (一个 Linux 数据存储和绘图工具)的数据存储和绘图的强大功能。Cacti 提供一个快速的轮询器,高级的绘图模版,多种数据获取方法和用户管理功能,并且可以开箱即用。所有的这些都被打包进一个直观,易用的界面,可用于监控简单的 LAN 网络,乃至包含成百上千设备的复杂网络。
|
||||
|
||||
### 功能 ###
|
||||
|
||||
#### 绘图 ####
|
||||
|
||||
无上限的监控图条目(graph item),每个图形可以视情况使用 Cacti 中的 CDEFs (Calculation Define,可以对图形输出结果进行计算)或者数据源。
|
||||
|
||||
自动将 GPRINT 条目分组至 AREA,STACK 和 LINE[1-3] 中,可以对图形进行快速重排序。
|
||||
|
||||
自动填充功能使得图形的说明整齐排列。
|
||||
|
||||
可以使用 RRDTool 中内置的 CDEF 数学函数对图形数据进行处理。这些 CDEF 函数可以定义在 Cacti 中,并且每一个图形都可以使用它们。
|
||||
|
||||
支持所有的 RRDTool 图形类型包括 AREA,STACK,LINE[1-3],GPRINT,COMMENT,VRULE 和 HRULE。
|
||||
|
||||
#### 数据源 ####
|
||||
|
||||
数据源可以使用 RRDTool 的 "create" 和 "update" 功能创建。每一个数据源可以用来收集本地或者远程的数据,并将数据输出给图形。
|
||||
|
||||
支持包含多个数据源的 RRD 文件,并可以使用存储在本地文件系统中任何位置的 RRD 文件。
|
||||
可以自定义轮询归档(RRA)设置,用户可以在存储数据时使用非标准的时间间隔(标准时间间隔是5分钟,30分钟,2小时 和 1天)。
|
||||
|
||||
#### 数据收集 ####
|
||||
|
||||
Cacti 包含一个 "data input" 机制,可以让用户定义自定义的脚本用来收集数据。每个脚本可以包含调用参数,每次创建调用此脚本的数据源时输入相应的调用参数(如 IP 地址)。
|
||||
|
||||
支持 SNMP 功能,可以使用 php-snmp,ucd-snmp 或者 net-snmp。
|
||||
|
||||
可以基于索引来使用 SNMP 或者脚本收集数据。例如,可以列出一个服务器上所有网卡接口或者已挂载分区的索引列表。集成的绘图模版可以用来一键为主机创建图形。
|
||||
|
||||
提供一个基于 PHP 的轮询器用于执行脚本,收集 SNMP数据并更新数据至 RRD 文件中。
|
||||
|
||||
#### 模版 ####
|
||||
|
||||
绘图模版可以将相同图形分组到为一类。图形中的每一个条目都可以使用模版的默认值或者自定义。
|
||||
|
||||
数据源模版可以通过将相同数据源类型分组为一类。数据源中每一个条目都可以使用模版的默认值或者自定义。
|
||||
|
||||
主机模版是一组图形和数据源模版,可以用来定义某一类型的主机。创建主机时,它会自动使用相应模版的属性。
|
||||
|
||||
#### 图形展示 ####
|
||||
|
||||
图形树允许用户创建「图形层次结构」并将图形放至树中。这种方法可以方便的管理大量图形。
|
||||
|
||||
列表模式将所有图形的链接在一个大列表中展示出来,链接指向用户创建的图形。
|
||||
|
||||
预览模式将所有图形在一个大列表中展示出来。这有点类似于 RRDTool/MRTG 的默认视图。
|
||||
|
||||
#### 用户管理 ####
|
||||
|
||||
用户管理功能允许管理员创建用户并分配给用户访问 Cacti 接口的不同级别的权限。
|
||||
|
||||
权限可以为每个用户指定其对每个图形的权限,这适用于主机租用的场景。
|
||||
每个用户可以保存他自己的图形显示模式。
|
||||
|
||||
#### 系统准备 ####
|
||||
|
||||
在安装 cacti 之前,确保你已经安装了 [Ubuntu 14.10 LAMP server][1]。
|
||||
|
||||
#### 在 Ubuntu 14.10 Server 上安装 Cacti ####
|
||||
|
||||
打开终端,运行下面的命令
|
||||
|
||||
sudo apt-get install cacti-spine
|
||||
|
||||
上面的命令开始 Cacti 的安装,你会看到下图中 PHP 路径的更改,选择 ok 按回车
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/18.png)
|
||||
|
||||
选择你想使用的 Web 服务器 (我使用的是 apache2)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/27.png)
|
||||
|
||||
Cacti 数据库配置,选 yes
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/35.png)
|
||||
|
||||
输入数据库管理员账户密码
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/42.png)
|
||||
|
||||
输入 Cacti 访问数据库的密码
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/5.png)
|
||||
|
||||
确认密码
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/6.png)
|
||||
|
||||
现在 Cacti 已经安装了,我们可以开始配置它了。
|
||||
|
||||
#### Cacti 配置 ####
|
||||
|
||||
在浏览器中访问 http://你的服务器IP/cacti/install/ 来进行初始化设置,点击 next 下一步
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/7.png)
|
||||
|
||||
选择 New install,点击 next 下一步
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/8.png)
|
||||
|
||||
下一个界面中,你需要确保所有的路径都是正确的,点击 finish 完成
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/9.png)
|
||||
|
||||
现在以 admin/admin 登录 Cacti,修改管理员的默认密码
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/10.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/111.png)
|
||||
|
||||
登录 Cacti 之后你会看到类似于下面这样的界面
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/11/14.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/how-to-install-cacti-monitoring-tool-on-ubuntu-14-10-server.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[Liao](https://github.com/liaoishere)
|
||||
校对:[校对者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.ubuntugeek.com/www.ubuntugeek.com/step-by-step-ubuntu-14-10-utopic-unicorn-lamp-server-setup.html
|
@ -0,0 +1,158 @@
|
||||
+在Linux中使用matplotlib进行科学画图
|
||||
+================================================================================
|
||||
+
|
||||
+如果你想要在Linxu中获得一个高效、自动化、高质量的科学画图的解决方案,那就要考虑一下使用matplotlib库了。Matplotlib是基于python的开源科学测绘包,版权基于python软件基金许可证。大量的文档和例子,整合在Python和Numpy科学计处包中,其自动化性能是少数几个为什么这个包是在Linux环境中进行科学画图的可靠选择。这个教程将提供几个用matplotlib画图的例子。
|
||||
+
|
||||
+###特性###
|
||||
+-
|
||||
+-众多的画图类型,如:bar,box,contour,histogram,scatter,line plots....
|
||||
+-基于python的语法
|
||||
+-集成Numpy科学计算包
|
||||
+-可定制的画图格式(axes scales,tick positions, tick labels...)
|
||||
+-可定制文本(字体,大小,位置...)
|
||||
+-TeX 格式化(等式,符号,希腊字体...)
|
||||
+-与IPython相兼容
|
||||
+-自动化 -用Python 的循环迭代生成图片
|
||||
+-保存所绘图片格式为图片文件,如:png,pdf,ps,eps,svg等
|
||||
+
|
||||
+
|
||||
+基于Python语法的matplotlib通过许多自身特性和高效工作流基础进行表现。
|
||||
+世面上有许多用于绘制高质量图的科学绘图包,但是这些包允许你直接在你的Python代码中去使用吗?
|
||||
+除那以外,这些包允许你创建可以保存为图片文件的图片吗?
|
||||
+Matplotlib允许你完成所有的这些任务。
|
||||
+你可以期望着节省你的时间,从于使用你能够花更多的时间在如何创建更多的图片。
|
||||
+
|
||||
+###安装###
|
||||
+ 安装Python和Numpy包是使用Matplotlib的前提,安装Numpy的指引请见该链接。[here][1].
|
||||
+
|
||||
+
|
||||
+可以通过如下命令在Debian或Ubuntu中安装Matplotlib:
|
||||
+
|
||||
+ $ sudo apt-get install python-matplotlib
|
||||
+
|
||||
+
|
||||
+在Fedora或CentOS/RHEL环境则可用如下命令:
|
||||
+ $ sudo yum install python-matplotlib
|
||||
+
|
||||
+
|
||||
+###Matplotlib 例子###
|
||||
+
|
||||
+该教程会提供几个绘图例子演示如何使用matplotlib:
|
||||
+-离散和线性画图
|
||||
+-柱状图画图
|
||||
+-饼状图
|
||||
+
|
||||
+在这些例子中我们将用Python脚本来执行Mapplotlib命令。注意numpy和matplotlib模块需要通过import命令在脚本中进行导入。
|
||||
+在命令空间中,np指定为nuupy模块的引用,plt指定为matplotlib.pyplot的引用:
|
||||
+ import numpy as np
|
||||
+ import matplotlib.pyplot as plt
|
||||
+
|
||||
+
|
||||
+###例1:离散和线性图###
|
||||
+
|
||||
+第一个脚本,script1.py 完成如下任务:
|
||||
+
|
||||
+-创建3个数据集(xData,yData1和yData2)
|
||||
+-创建一个宽8英寸、高6英寸的图(赋值1)
|
||||
+-设置图画的标题、x轴标签、y轴标签(字号均为14)
|
||||
+-绘制第一个数据集:yData1为xData数据集的函数,用圆点标识的离散蓝线,标识为"y1 data"
|
||||
+-绘制第二个数据集:yData2为xData数据集的函数,采用红实线,标识为"y2 data"
|
||||
+-把图例放置在图的左上角
|
||||
+-保存图片为PNG格式文件
|
||||
+
|
||||
+script1.py的内容如下:
|
||||
+ import numpy as np
|
||||
+ import matplotlib.pyplot as plt
|
||||
+
|
||||
+ xData = np.arange(0, 10, 1)
|
||||
+ yData1 = xData.__pow__(2.0)
|
||||
+ yData2 = np.arange(15, 61, 5)
|
||||
+ plt.figure(num=1, figsize=(8, 6))
|
||||
+ plt.title('Plot 1', size=14)
|
||||
+ plt.xlabel('x-axis', size=14)
|
||||
+ plt.ylabel('y-axis', size=14)
|
||||
+ plt.plot(xData, yData1, color='b', linestyle='--', marker='o', label='y1 data')
|
||||
+ plt.plot(xData, yData2, color='r', linestyle='-', label='y2 data')
|
||||
+ plt.legend(loc='upper left')
|
||||
+ plt.savefig('images/plot1.png', format='png')
|
||||
+
|
||||
+
|
||||
+所画之图如下:
|
||||
+![](https://farm8.staticflickr.com/7529/15927002365_f5ae11cf02_z.jpg)
|
||||
+
|
||||
+
|
||||
+###例2:柱状图###
|
||||
+
|
||||
+第二个脚本,script2.py 完成如下任务:
|
||||
+
|
||||
+-创建一个包含1000个随机样本的正态分布数据集。
|
||||
+-创建一个宽8英寸、高6英寸的图(赋值1)
|
||||
+-设置图的标题、x轴标签、y轴标签(字号均为14)
|
||||
+-用samples这个数据集画一个40个柱状,边从-10到10的柱状图
|
||||
+-添加文本,用TeX格式显示希腊字母mu和sigma(字号为16)
|
||||
+-保存图片为PNG格式。
|
||||
+
|
||||
+script2.py代码如下:
|
||||
+ import numpy as np
|
||||
+ import matplotlib.pyplot as plt
|
||||
+
|
||||
+ mu = 0.0
|
||||
+ sigma = 2.0
|
||||
+ samples = np.random.normal(loc=mu, scale=sigma, size=1000)
|
||||
+ plt.figure(num=1, figsize=(8, 6))
|
||||
+ plt.title('Plot 2', size=14)
|
||||
+ plt.xlabel('value', size=14)
|
||||
+ plt.ylabel('counts', size=14)
|
||||
+ plt.hist(samples, bins=40, range=(-10, 10))
|
||||
+ plt.text(-9, 100, r'$\mu$ = 0.0, $\sigma$ = 2.0', size=16)
|
||||
+ plt.savefig('images/plot2.png', format='png')
|
||||
+
|
||||
+
|
||||
+结果见如下链接:
|
||||
+![](https://farm8.staticflickr.com/7531/15304765024_1cc271b6e0_z.jpg)
|
||||
+
|
||||
+
|
||||
+###例3:饼状图###
|
||||
+
|
||||
+第三个脚本,script3.py 完成如下任务:
|
||||
+
|
||||
+-创建一个包含5个整数的列表
|
||||
+-创建一个宽6英寸、高6英寸的图(赋值1)
|
||||
+-添加一个长宽比为1的轴图
|
||||
+-设置图的标题(字号为14)
|
||||
+-用data列表画一个包含标签的饼状图
|
||||
+-保存图为PNG格式
|
||||
+
|
||||
+脚本script3.py的代码如下:
|
||||
+ import numpy as np
|
||||
+ import matplotlib.pyplot as plt
|
||||
+
|
||||
+ data = [33, 25, 20, 12, 10]
|
||||
+ plt.figure(num=1, figsize=(6, 6))
|
||||
+ plt.axes(aspect=1)
|
||||
+ plt.title('Plot 3', size=14)
|
||||
+ plt.pie(data, labels=('Group 1', 'Group 2', 'Group 3', 'Group 4', 'Group 5'))
|
||||
+ plt.savefig('images/plot3.png', format='png')
|
||||
+
|
||||
+
|
||||
+结果如下链接所示:
|
||||
+![](https://farm8.staticflickr.com/7504/15926356092_7c3e5217aa_z.jpg)
|
||||
+
|
||||
+
|
||||
+###总结###
|
||||
+ 这个教程提供了几个用matplotlib科学画图包进行画图的例子,Matplotlib是在Linux环境中用于解决科学画图的绝佳方案,表现在其无缝地和Python、Numpy连接,自动化能力,和提供多种自定义的高质量的画图产品。[here][2].
|
||||
+
|
||||
+matplotlib包的文档和例子详见:
|
||||
+--------------------------------------------------------------------------------
|
||||
+
|
||||
+via: http://xmodulo.com/matplotlib-scientific-plotting-linux.html
|
||||
+
|
||||
+作者:[Joshua Reed][a]
|
||||
+译者:[ideas4u](https://github.com/ideas4u)
|
||||
+校对:[校对者ID](https://github.com/校对者ID)
|
||||
+
|
||||
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
+
|
||||
+[a]:http://xmodulo.com/author/joshua
|
||||
+[1]:http://xmodulo.com/numpy-scientific-computing-linux.html
|
||||
+[2]:http://matplotlib.org/
|
@ -1,46 +1,47 @@
|
||||
Centralized Secure Storage (iSCSI) – “Initiator Client” Setup on RHEL/CentOS/Fedora – Part III
|
||||
中心化存储(iSCSI)- “初始器客户端” 在RHEL/CentOS/Fedora上的设置 - 第三部分
|
||||
================================================================================
|
||||
**iSCSI** Initiator are the clients which use to authenticated with iSCSI target servers to access the LUNs shared from target server. We can deploy any kind of Operating systems in those locally mounted Disks, just a single package need to be install to get authenticate with target server.
|
||||
**iSCSI** 初始化器是一种用于与iSCSI target服务器认证并访问服务器上共享的的LUN的客户端。我们可以在本地挂载的硬盘上部署任何操作系统,只需要安装一个包来与target服务器验证。
|
||||
|
||||
![Client Initiator Setup](http://www.tecmint.com/wp-content/uploads/2014/07/Client-Initiator-Setup.jpg)
|
||||
|
||||
Client Initiator Setup
|
||||
初始器客户端设置
|
||||
|
||||
#### Features ####
|
||||
#### 功能 ####
|
||||
|
||||
- Can handle any kind of file systems in locally mounted Disk.
|
||||
- No need of restating the system after partition using fdisk.
|
||||
- 可以处理本地挂载磁盘上的任意文件系统
|
||||
- 在使用fdisk命令后不需要重启系统
|
||||
|
||||
#### Requirements ####
|
||||
#### 要求 ####
|
||||
|
||||
- [Create Centralized Secure Storage using iSCSI Target – Part 1][1]
|
||||
- [Create LUN’s using LVM in Target Server – Part 2][2]
|
||||
- [使用iSCSI Target创建集中化安全存储- 第一部分][1]
|
||||
- [在Target服务器中使用LVM创建LUN - 第二部分][2]
|
||||
|
||||
#### My Client Setup for Initiator ####
|
||||
#### 我的客户端设置 ####
|
||||
|
||||
- Operating System – CentOS release 6.5 (Final)
|
||||
- 操作系统 – CentOS release 6.5 (最终版)
|
||||
- iSCSI Target IP – 192.168.0.50
|
||||
- Ports Used : TCP 3260
|
||||
- 使用的端口 : TCP 3260
|
||||
|
||||
**Warning**: Never stop the service while LUNs Mounted in Client machines (Initiator).
|
||||
**Warning**:永远不要在使用LUN的时候在客户端中(初始化器)停止服务。
|
||||
|
||||
### Initiator Client Setup ###
|
||||
|
||||
**1.** In Client side, we need to install the package ‘**iSCSI-initiator-utils**‘, search for the package using following command.
|
||||
### 客户端设置 ###
|
||||
|
||||
**1.** 在客户端,我们需要安装包‘**iSCSI-initiator-utils**‘,用下面的命令搜索包。
|
||||
|
||||
# yum search iscsi
|
||||
|
||||
**Sample Output**
|
||||
**示例输出**
|
||||
|
||||
============================= N/S Matched: iscsi ================================
|
||||
iscsi-initiator-utils.x86_64 : iSCSI daemon and utility programs
|
||||
iscsi-initiator-utils-devel.x86_64 : Development files for iscsi-initiator-utils
|
||||
|
||||
**2.** Once you locate the package, just install the initiator package using yum command as shown.
|
||||
**2.** 一旦定位了包,就用下面的yum命令安装初始化包。
|
||||
|
||||
# yum install iscsi-initiator-utils.x86_64
|
||||
|
||||
**3.** After installing the package, we need to discover the share from **Target server**. The client side commands little hard to remember, so we can use man page to get the list of commands which required to run.
|
||||
**3.** 安装完毕后,我们需要发现**Target 服务器**上的共享。客户端的命令有点难记,因此我们使用man来的到需要运行的命令列表
|
||||
|
||||
# man iscsiadm
|
||||
|
||||
@ -48,47 +49,47 @@ Client Initiator Setup
|
||||
|
||||
man iscsiadm
|
||||
|
||||
**4.** Press **SHIFT+G** to Navigate to the Bottom of the man page and scroll little up to get the login example commands. We need to replace our **Target servers IP** address in below command Discover the Target.
|
||||
**4.** 按下**SHIFT+G** 进入man页的底部并且稍微向上滚动来的到登录的示例命令。下面的发现命令中,需要用我们的**服务器IP地址**来替换。
|
||||
|
||||
# iscsiadm --mode discoverydb --type sendtargets --portal 192.168.0.200 --discover
|
||||
|
||||
**5.** Here we got the iSCSI (iqn) qualified name from above command execution.
|
||||
**5.** 这里我们从下面的命令中得到了iSCSIi限定名(iqn)。
|
||||
|
||||
192.168.0.200:3260,1 iqn.2014-07.com.tecmint:tgt1
|
||||
|
||||
![Discover Target](http://www.tecmint.com/wp-content/uploads/2014/07/Discover-Target.jpg)
|
||||
|
||||
Discover Target
|
||||
发现服务器
|
||||
|
||||
**6.** To log-in use the below command to attach the LUN to our local System, this will authenticate with target server and allow us to log-in into LUN.
|
||||
**6.** 要登录就用下面的命令来连接一台LUN到我们本地系统中,这会与服务器验证并允许我们登录LUN。
|
||||
|
||||
# iscsiadm --mode node --targetname iqn.2014-07.com.tecmint:tgt1 --portal 192.168.0.200:3260 --login
|
||||
|
||||
![Login To Target Server](http://www.tecmint.com/wp-content/uploads/2014/07/Login-To-Target-Server.jpg)
|
||||
|
||||
Login To Target Server
|
||||
登录到服务器
|
||||
|
||||
**Note**: Use the login command and replace login with logout at end of command.
|
||||
**注意**:登出使用登录命令并在命令的最后使用logout来替换。
|
||||
|
||||
# iscsiadm --mode node --targetname iqn.2014-07.com.tecmint:tgt1 --portal 192.168.0.200:3260 --logout
|
||||
|
||||
![Logout from Target Server](http://www.tecmint.com/wp-content/uploads/2014/07/Logout-from-Target-Server.jpg)
|
||||
|
||||
Logout from Target Server
|
||||
等出服务器
|
||||
|
||||
**7.** After login to the LUN, list the records of Node using.
|
||||
**7.** 登录服务器后,使用下面的命令列出节点的记录。
|
||||
|
||||
# iscsiadm --mode node
|
||||
|
||||
![List Node](http://www.tecmint.com/wp-content/uploads/2014/07/List-Node.jpg)
|
||||
|
||||
List Node
|
||||
列出节点
|
||||
|
||||
**8.** Display all data of a particular node.
|
||||
**8.** 显示特定节点的所有数据
|
||||
|
||||
# iscsiadm --mode node --targetname iqn.2014-07.com.tecmint:tgt1 --portal 192.168.0.200:3260
|
||||
|
||||
**Sample Output**
|
||||
**示例输出**
|
||||
|
||||
# BEGIN RECORD 6.2.0-873.10.el6
|
||||
node.name = iqn.2014-07.com.tecmint:tgt1
|
||||
@ -108,33 +109,33 @@ List Node
|
||||
iface.linklocal_autocfg = <empty>
|
||||
....
|
||||
|
||||
**9.** Then list the drive using, fdisk will list every authenticated disks.
|
||||
**9.** 接着列出使用的磁盘,fdisk会列出所有的认证过的磁盘。
|
||||
|
||||
# fdisk -l /dev/sda
|
||||
|
||||
![List Disks](http://www.tecmint.com/wp-content/uploads/2014/07/List-Disks.jpg)
|
||||
|
||||
List Disks
|
||||
列出磁盘
|
||||
|
||||
**10.** Run fdisk to create a new partition.
|
||||
**10.** 运行fdisk命令来创建一个新的分区
|
||||
|
||||
# fdisk -cu /dev/sda
|
||||
|
||||
![Create New Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Create-New-Partition.jpg)
|
||||
|
||||
Create New Partition
|
||||
创建新分区
|
||||
|
||||
**Note**: After Creating a Partition using fdisk, we don’t need to reboot, as we used to do in our local systems, Because this is a remote shared storage mounted locally.
|
||||
**注意**:在使用fdisk创建新分区之后,我们无需重启,就像使用我们本地的文件系统一样就行。因为这个将远程共享存储挂载到本地了。
|
||||
|
||||
**11.** Format the newly created partition.
|
||||
**11.** 格式化新创建的分区
|
||||
|
||||
# mkfs.ext4 /dev/sda1
|
||||
|
||||
![Format New Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Format-New-Partition.jpg)
|
||||
|
||||
Format New Partition
|
||||
格式化新分区
|
||||
|
||||
**12.** Create a Directory and mount the formatted partition.
|
||||
**12.** 创建一个目录来挂载新创建的分区
|
||||
|
||||
# mkdir /mnt/iscsi_share
|
||||
# mount /dev/sda1 /mnt/iscsi_share/
|
||||
@ -142,9 +143,9 @@ Format New Partition
|
||||
|
||||
![Mount New Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Mount-New-Partition.jpg)
|
||||
|
||||
Mount New Partition
|
||||
挂载新分区
|
||||
|
||||
**13.** List the Mount Points.
|
||||
**13.** 列出挂载点
|
||||
|
||||
# df -Th
|
||||
|
||||
@ -153,45 +154,45 @@ Mount New Partition
|
||||
|
||||
![List New Partition](http://www.tecmint.com/wp-content/uploads/2014/07/List-New-Partition.jpg)
|
||||
|
||||
List New Partition
|
||||
列出新分区
|
||||
|
||||
**14.** If we need to permanently mount the Drive use fstab entry.
|
||||
**14.** 如果需要永久挂在使用fdtab文件
|
||||
|
||||
# vim /etc/fstab
|
||||
|
||||
**15.**Append the following Entry in fstab.
|
||||
**15.**在fstab后追加下面行
|
||||
|
||||
/dev/sda1 /mnt/iscsi_share/ ext4 defaults,_netdev 0 0
|
||||
|
||||
**Note:** Use _netdev in fstab, as this is a network device.
|
||||
**注意:** 在fdtab中使用_netdev,说明这是一个网络设备。
|
||||
|
||||
![Auto Mount Partition](http://www.tecmint.com/wp-content/uploads/2014/07/Auto-Mount-Partition.jpg)
|
||||
|
||||
Auto Mount Partition
|
||||
自动挂载分区
|
||||
|
||||
**16.** Finally check whether our fstab entry have any error.
|
||||
**16.** 最后检查我们fstab文件是否有错误。
|
||||
|
||||
# mount -av
|
||||
|
||||
- **-a** – all mount point
|
||||
- **-v** – Verbose
|
||||
- **-a** – 所有挂载点
|
||||
- **-v** – 繁琐模式
|
||||
|
||||
![Verify fstab Entries](http://www.tecmint.com/wp-content/uploads/2014/07/Verify-fstab-Entries.jpg)
|
||||
|
||||
Verify fstab Entries
|
||||
验证fstab文件
|
||||
|
||||
We have Completed Our client side configuration Successfully. Start to use the drive as we use our local system disk.
|
||||
我们已经成功完成了我们的客户端配置。现在让我们像本地磁盘一样使用它吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/iscsi-initiator-client-setup/
|
||||
|
||||
作者:[Babin Lonston][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/babinlonston/
|
||||
[1]:http://www.tecmint.com/create-centralized-secure-storage-using-iscsi-targetin-linux/
|
||||
[2]:http://www.tecmint.com/create-luns-using-lvm-in-iscsi-target/
|
||||
[2]:http://www.tecmint.com/create-luns-using-lvm-in-iscsi-target/
|
@ -0,0 +1,149 @@
|
||||
在RHEL/CentOS/Fedora上使用iSCSI Target创建集中式安全存储 - 第一部分
|
||||
================================================================================
|
||||
**iSCSI** 是一种就块级别协议,用于通过TCP/IP网络共享**原始存储设备**,可以用已经存在的IP和以太网如网卡、交换机、路由器等通过iSCSI协议共享和访问存储。iSCSI target是一种远程iSCSI服务器或者taget上的远程硬盘。
|
||||
|
||||
![Install iSCSI Target in Linux](http://www.tecmint.com/wp-content/uploads/2014/07/Install-iSCSI-Target-in-Linux.jpg)
|
||||
在Linux中安装iSCSI Target
|
||||
|
||||
我们不需要在客户端为了稳定的连接和性能而占用很大的资源。iSCSI服务器称为Target,它共享存储。iSCSI客户端称为Initiator,它访问Target服务器行的存储。市场中有用于大型存储服务如SAN的iSCSI适配器。
|
||||
|
||||
**我们为什么要在大型存储领域中使用iSCSI适配器**
|
||||
|
||||
以太网适配器(NIC)被设计用于在系统、服务器和存储设备如NAS间传输分组数据,它不适合在Internet中传输块级别数据。
|
||||
|
||||
### iSCSI Target的功能 ###
|
||||
|
||||
- 可以在一台机器上运行几个iSCSI target
|
||||
- 一台机器的多个iSCSI target可以在iSCSI中访问
|
||||
- 一个target就是一块存储,并且可以通过网络被初始化器(客户端)访问
|
||||
- 把这些存储汇聚在一起让它们在网络中可以访问的是iSCSI LUN(逻辑单元号)
|
||||
- iSCSI支持在同一个会话中含有多个连接
|
||||
- iSCSI初始化器在网络中发现目标接着用LUN验证并登录,这样就可以本地访问远程存储。
|
||||
- 我们了一在本地挂载的LUN上安装任何操作系统,就像我们安装我们本地的操作系统一样。
|
||||
|
||||
### 为什么需要iSCSI? ###
|
||||
|
||||
在虚拟化中,我们需要存储拥有高度的冗余性、稳定性,iSCSI以低成本的方式提供了这些特性。与使用光纤通道的SAN比起来,我们可以使用已经存在的设备比如NIC、以太网交换机等建造一个低成本的SAN。
|
||||
|
||||
现在我开始使用iSCSI Target安装并配置安全存储。本篇中,我们遵循下面的步骤
|
||||
|
||||
- 我们需要隔离一个系统来设置iSCSI Target服务器和初始化器(客户端)。
|
||||
- 可以在大型存储环境中添加多个硬盘,但是我们除了基本的安装盘之外只使用一个额外的驱动器。
|
||||
- 现在我们只使用2块硬盘,一个用于基本的服务器安装,另外一个用于存储(LUN),这个我们会在这个系列的第二篇描述。
|
||||
|
||||
#### 主服务器设置 ####
|
||||
|
||||
- 操作系统 – CentOS release 6.5 (最终版)
|
||||
- iSCSI Target IP – 192.168.0.200
|
||||
- 使用的端口 : TCP 860, 3260
|
||||
- 配置文件 : /etc/tgt/targets.conf
|
||||
|
||||
## 安装 iSCSI Target ##
|
||||
|
||||
打开终端并使用yum命令来搜索我们需要在iscsi target上安装的包名。
|
||||
|
||||
# yum search iscsi
|
||||
|
||||
#### 输出示例 ####
|
||||
|
||||
========================== N/S matched: iscsi =======================
|
||||
iscsi-initiator-utils.x86_64 : iSCSI daemon and utility programs
|
||||
iscsi-initiator-utils-devel.x86_64 : Development files for iscsi-initiator-utils
|
||||
lsscsi.x86_64 : List SCSI devices (or hosts) and associated information
|
||||
scsi-target-utils.x86_64 : The SCSI target daemon and utility programs
|
||||
|
||||
We got the search result as above, choose the **Target** package and install to play around.
|
||||
你会的到上面的那些结果,选择**Target**包来安装
|
||||
|
||||
# yum install scsi-target-utils -y
|
||||
|
||||
![Install iSCSI Utils](http://www.tecmint.com/wp-content/uploads/2014/07/Install-iSCSI-in-Linux.jpg)
|
||||
安装iSCSI工具
|
||||
|
||||
列出安装的包来了解默认的配置、服务和man页面的位置
|
||||
|
||||
# rpm -ql scsi-target-utils.x86_64
|
||||
|
||||
![List All iSCSI Files](http://www.tecmint.com/wp-content/uploads/2014/07/List-All-ISCSI-Files.jpg)
|
||||
|
||||
列出所有的iSCSI文件
|
||||
|
||||
让我们启动iSCSI服务,并检查服务运行的状态,iSCSI的服务名是**tgtd**。
|
||||
|
||||
# /etc/init.d/tgtd start
|
||||
# /etc/init.d/tgtd status
|
||||
|
||||
![Start iSCSI Service](http://www.tecmint.com/wp-content/uploads/2014/07/Start-iSCSI-Service.jpg)
|
||||
|
||||
启动iSCSI服务
|
||||
|
||||
现在我们需要配置开机自动启动。
|
||||
|
||||
# chkconfig tgtd on
|
||||
|
||||
现在验证tgtd服务的运行级别是否配置正确。
|
||||
|
||||
# chkconfig --list tgtd
|
||||
|
||||
![Enable iSCSI on Startup](http://www.tecmint.com/wp-content/uploads/2014/07/Enable-iSCSI-on-Startup.jpg)
|
||||
|
||||
开机启动iSCSI
|
||||
|
||||
现在使用**tgtadm**来列出在我们的服务器上已经配置了哪些target和LUN。
|
||||
|
||||
# tgtadm --mode target --op show
|
||||
|
||||
**tgtd**已经安装并在运行了,但是上面的命令没有**输出**因为我们还没有在Target服务器上定义LUN。要查看手册,运行‘**man**‘命令。
|
||||
|
||||
# man tgtadm
|
||||
|
||||
![iSCSI Man Pages](http://www.tecmint.com/wp-content/uploads/2014/07/iSCSI-Man-Pages.jpg)
|
||||
|
||||
iSCSI Man 页面
|
||||
|
||||
最终我们需要为iSCSI添加iptable规则,如果你的target服务器上存在iptable的话。首先使用netstat命令找出iscsi target的端口号,target总是监听TCP端口3260。
|
||||
|
||||
# netstat -tulnp | grep tgtd
|
||||
|
||||
![Find iSCSI Port](http://www.tecmint.com/wp-content/uploads/2014/07/Find-iSCSI-Port.jpg)
|
||||
|
||||
找出iSCSI端口
|
||||
|
||||
下面加入如下规则让iptable允许广播iSCSI target发现包。
|
||||
|
||||
# iptables -A INPUT -i eth0 -p tcp --dport 860 -m state --state NEW,ESTABLISHED -j ACCEPT
|
||||
# iptables -A INPUT -i eth0 -p tcp --dport 3260 -m state --state NEW,ESTABLISHED -j ACCEPT
|
||||
|
||||
![Open iSCSI Ports](http://www.tecmint.com/wp-content/uploads/2014/07/Open-iSCSI-Ports.jpg)
|
||||
|
||||
打开iSCSI端口
|
||||
|
||||
![Add iSCSI Ports to Iptables](http://www.tecmint.com/wp-content/uploads/2014/07/Add-iSCSI-Ports-to-Iptables.jpg)
|
||||
|
||||
添加iSCSI端口到iptable中
|
||||
|
||||
**注意**: 规则可能根据你的 **默认链策略**而不同。接着保存iptable并重启。
|
||||
|
||||
# iptables-save
|
||||
# /etc/init.d/iptables restart
|
||||
|
||||
![Restart iptables](http://www.tecmint.com/wp-content/uploads/2014/07/Restart-iptables.jpg)
|
||||
|
||||
重启iptable
|
||||
|
||||
现在我们已经部署了一个target服务器来共享LUN给通过TCP/IP认证的初始化器。这也适用于从小到大规模的生产环境。
|
||||
|
||||
在我的下篇文章中,我会展示如何[在Target服务器中使用LVM创建LUN][1],并且如何在客户端中共享LUN,在此之前请继续关注TecMint获取更多的更新,并且不要忘记留下有价值的评论。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/create-centralized-secure-storage-using-iscsi-targetin-linux/
|
||||
|
||||
作者:[Babin Lonston][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/babinlonston/
|
||||
[1]:http://www.tecmint.com/create-luns-using-lvm-in-iscsi-target/
|
@ -0,0 +1,232 @@
|
||||
如何在RHEL/CentOS/Fedora中使用LVM创建和设置LUN- 第二部分
|
||||
================================================================================
|
||||
LUN是逻辑单元号,它与iSCSI存储服务器共享。物理iSCSI target服务器共享它的驱动器来初始化TCP/IP网络。驱动器的集合称作LUN来幸存一个大型存储也就是SAN(Storage Area Network)。在真实环境中LUN在LVM中定义,因此它可以按需扩展。
|
||||
|
||||
![Create LUNS using LVM in Target Server](http://www.tecmint.com/wp-content/uploads/2014/07/Create-LUNS-inLVM.png)
|
||||
Create LUNS using LVM in Target Server
|
||||
|
||||
### 为什么使用LUN? ###
|
||||
|
||||
LUN用于存储,SAN存储大多数有LUN的集群来组成池,LUN由几块物理驱动器组成。我们可以使用LUN作为系统物理驱动器来安装操作系统,LUN在集群、虚拟服务器、SAN中使用。在虚拟服务器中使用LUN的目的是作为系统存储。LUN的性能和可靠性根据在创建目标存储服务器时所使用的驱动器决定。
|
||||
|
||||
### 需求 ###
|
||||
|
||||
要了解创建iSCSI target服务器点击下面的链接。
|
||||
|
||||
- [使用iSCSI target创建爱你集中话安全存储][1]
|
||||
|
||||
#### 主服务器设置 ####
|
||||
|
||||
系统信息和网络设置部分与已经写的iSCSI Target服务相同 - 我们在相同的服务器上定义LUN。
|
||||
|
||||
|
||||
- 操作系统 – CentOS release 6.5 (最终版)
|
||||
- iSCSI Target IP – 192.168.0.200
|
||||
- 使用的端口 : TCP 860, 3260
|
||||
- 配置文件 : /etc/tgt/targets.conf
|
||||
|
||||
## 在iSCSI Target Server使用LVM创建LUN ##
|
||||
|
||||
首先,用**fdisk -l**命令找出驱动器的列表,这会列出系统中所有分区的列表。
|
||||
|
||||
# fdisk -l
|
||||
|
||||
上面的命令只会给出基本系统的驱动器信息。为了个到存储设备的信息,使用下面的命令来的到存储设备的列表。
|
||||
|
||||
# fdisk -l /dev/vda && fdisk -l /dev/sda
|
||||
|
||||
![List Storage Drives](http://www.tecmint.com/wp-content/uploads/2014/07/1.jpg)
|
||||
|
||||
列出存储设备
|
||||
|
||||
**注意**:这里**vda**是虚拟机硬盘,因为我使用的是虚拟机来用于演示,**/dev/sda** 是额外加入的存储。
|
||||
|
||||
### 第一步: 创建用于LUN的LVM ###
|
||||
|
||||
我们使用**/dev/sda**驱动器来创建LVM。
|
||||
|
||||
# fdisk -l /dev/sda
|
||||
|
||||
![List LVM Drive](http://www.tecmint.com/wp-content/uploads/2014/07/2.jpg)
|
||||
|
||||
列出LVM驱动器
|
||||
|
||||
现在让我们如下使用fdisk命令列出驱动器分区。
|
||||
|
||||
# fdisk -cu /dev/sda
|
||||
|
||||
- The option ‘**-c**‘ 关闭DOS兼容模式。
|
||||
- The option ‘**-u**‘ 用于列出分区表,给出扇区而不是柱面的大小。
|
||||
|
||||
使用**n**创建新的分区。
|
||||
|
||||
Command (m for help): n
|
||||
|
||||
使用**p**创建主分区。
|
||||
|
||||
Command action
|
||||
e extended
|
||||
p primary partition (1-4)
|
||||
|
||||
给我们创建的分区一个分区号。
|
||||
|
||||
Partition number (1-4): 1
|
||||
|
||||
到这里,我们就要设置LVM驱动器了。因此,我们需要使用默认的设置来使用整个驱动器。
|
||||
|
||||
First sector (2048-37748735, default 2048):
|
||||
Using default value 2048
|
||||
Last sector, +sectors or +size{K,M,G} (2048-37748735, default 37748735):
|
||||
Using default value 37748735
|
||||
|
||||
选择分区的类型,这里我们要设置LVM,因此使用**8e**。使用**l**列出所有的类型。
|
||||
|
||||
Command (m for help): t
|
||||
|
||||
选择想要改变类型的分区。
|
||||
|
||||
Selected partition 1
|
||||
Hex code (type L to list codes): 8e
|
||||
Changed system type of partition 1 to 8e (Linux LVM)
|
||||
|
||||
在改变完类型之后,通过打印(**p**)选项来列出分区表。
|
||||
|
||||
Command (m for help): p
|
||||
|
||||
Disk /dev/sda: 19.3 GB, 19327352832 bytes
|
||||
255 heads, 63 sectors/track, 2349 cylinders, total 37748736 sectors
|
||||
Units = sectors of 1 * 512 = 512 bytes
|
||||
Sector size (logical/physical): 512 bytes / 512 bytes
|
||||
I/O size (minimum/optimal): 512 bytes / 512 bytes
|
||||
Disk identifier: 0x9fae99c8
|
||||
|
||||
Device Boot Start End Blocks Id System
|
||||
/dev/sda1 2048 37748735 18873344 8e Linux LVM
|
||||
|
||||
使用**w**写入设置并退出fdisk工具,重启系统使设置生效。
|
||||
|
||||
作为参考,我下面附上了截图来给你在创建LVM驱动器时一个明确的指导。
|
||||
|
||||
![Create LVM Partition](http://www.tecmint.com/wp-content/uploads/2014/07/3.jpg)
|
||||
|
||||
创建LVM分区
|
||||
|
||||
系统重启后,使用fdisk命令列出分区表。
|
||||
|
||||
# fdisk -l /dev/sda
|
||||
|
||||
![Verify LVM Partition](http://www.tecmint.com/wp-content/uploads/2014/07/4.jpg)
|
||||
|
||||
验证LVM分区
|
||||
|
||||
### 第二步: 为LUN创建逻辑卷 ###
|
||||
|
||||
现在我们使用‘pvcreate’命令创建物理卷。
|
||||
|
||||
# pvcreate /dev/sda1
|
||||
|
||||
用iSCSI的名字创建卷组来区分组。
|
||||
|
||||
# vgcreate vg_iscsi /dev/sda1
|
||||
|
||||
这里我定义了4个逻辑卷,因此在我的iSCSI target上就会有4个LUN。
|
||||
|
||||
# lvcreate -L 4G -n lv_iscsi vg_iscsi
|
||||
|
||||
# lvcreate -L 4G -n lv_iscsi-1 vg_iscsi
|
||||
|
||||
# lvcreate -L 4G -n lv_iscsi-2 vg_iscsi
|
||||
|
||||
# lvcreate -L 4G -n lv_iscsi-3 vg_iscsi
|
||||
|
||||
列出物理卷、卷组和逻辑卷确定。
|
||||
|
||||
# pvs && vgs && lvs
|
||||
# lvs
|
||||
|
||||
为了更好地理解上面的命令,我在下面包含了截图作为参考。
|
||||
|
||||
![Creating LVM Logical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/5.jpg)
|
||||
|
||||
创建LVM逻辑卷
|
||||
|
||||
![Verify LVM Logical Volumes](http://www.tecmint.com/wp-content/uploads/2014/07/6.jpg)
|
||||
|
||||
验证LVM逻辑卷
|
||||
|
||||
### 第三步: 在Target Server中定义LUN ###
|
||||
|
||||
我们已经创建了逻辑卷并准备使用LUN,现在我们在target配置中定义LUN,如果这样那么它只能用在客户机中(启动器)。
|
||||
|
||||
用你选择的编辑器打开位于‘/etc/tgt/targets.conf’的target配置文件。
|
||||
|
||||
# vim /etc/tgt/targets.conf
|
||||
|
||||
追加下面的target配置文件中的定义。保存并关闭文件。
|
||||
|
||||
<target iqn.2014-07.com.tecmint:tgt1>
|
||||
backing-store /dev/vg_iscsi/lv_iscsi
|
||||
</target>
|
||||
<target iqn.2014-07.com.tecmint:tgt1>
|
||||
backing-store /dev/vg_iscsi/lv_iscsi-1
|
||||
</target>
|
||||
<target iqn.2014-07.com.tecmint:tgt1>
|
||||
backing-store /dev/vg_iscsi/lv_iscsi-2
|
||||
</target>
|
||||
<target iqn.2014-07.com.tecmint:tgt1>
|
||||
backing-store /dev/vg_iscsi/lv_iscsi-3
|
||||
</target
|
||||
|
||||
![Configure LUNs in Target Server](http://www.tecmint.com/wp-content/uploads/2014/07/7.jpg)
|
||||
|
||||
在target中配置LUN
|
||||
|
||||
- iSCSI 限定名 (iqn.2014-07.com.tecmint:tgt1).
|
||||
- 随你怎么使用
|
||||
- 确定使用目标, 这台服务器中的第一个目标
|
||||
- 4. LVM共享特定的LUN。
|
||||
|
||||
接下来使用下面命令重载**tgd**服务配置。
|
||||
|
||||
# /etc/init.d/tgtd reload
|
||||
|
||||
![Reload Configuration](http://www.tecmint.com/wp-content/uploads/2014/07/8.jpg)
|
||||
|
||||
重载配置
|
||||
|
||||
接下来使用下面的命令验证可用的LUN。
|
||||
|
||||
# tgtadm --mode target --op show
|
||||
|
||||
![List Available LUNs](http://www.tecmint.com/wp-content/uploads/2014/07/9.jpg)
|
||||
|
||||
列出可用LUN
|
||||
|
||||
![LUNs Information](http://www.tecmint.com/wp-content/uploads/2014/07/10.jpg)
|
||||
|
||||
LUN信息
|
||||
|
||||
The above command will give long list of available LUNs with following information.
|
||||
上面的命令会列出可用LUN的下面这些信息
|
||||
|
||||
- iSCSI 限定名
|
||||
- iSCSI 准备使用
|
||||
- 默认LUN 0被控制器保留
|
||||
- LUN 1是我们定义的target服务器
|
||||
- 这里我为每个LUN都定义了4GB
|
||||
- 在线: 是的,这就是可以使用的LUN
|
||||
|
||||
现在我们已经使用LVM为target服务器定义了LUN,这可扩展并且支持很多特性,如快照。我们将会在第三部分了解如何用target服务器授权,并且本地挂载远程存储。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/create-luns-using-lvm-in-iscsi-target/
|
||||
|
||||
作者:[Babin Lonston][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/babinlonston/
|
||||
[1]:http://www.tecmint.com/create-centralized-secure-storage-using-iscsi-targetin-linux/
|
@ -0,0 +1,263 @@
|
||||
5 Linux下用户空间调试工具
|
||||
================================================================================
|
||||
根据定义,调试工具是那些那些使我们能够监测、控制和纠正其他程序的程序。我们为什么应该用调试工具呢? 在有些情况下,运行一些程序的时候我们会被卡住,我们需要明白究竟发生了什么。 例如, 我们正在运行应用程序,它产生了一些错误消息。要修复这些错误,我们应该先找出为什么产生这些错误的消息和这些错误消息从哪里产生的。 一个应用程序可能突然挂起,我们必须了解其他什么进程同时在运行。我们可能还必须弄清楚进程'x'挂起的时候在做什么。为了剖析这些细节, 我们需要调试工具的帮助。有几个Linux下的用户空间调试工具和技术,他们用来分析用户空间问题相当有用。他们是:
|
||||
|
||||
- **'print' 语句**
|
||||
- **查询 (/proc, /sys etc)**
|
||||
- **跟踪 (strace/ltrace)**
|
||||
- **Valgrind (memwatch)**
|
||||
- **GDB**
|
||||
|
||||
让我们一个个地了解。
|
||||
|
||||
### 1.'print' 语句 ###
|
||||
|
||||
这是一个基本的原始的调试问题的方法。 我们可以在程序中插入print语句来了解控制流和变量值。 虽然这是一个简单的技术, 但它有一些缺点的。 程序需要进行编辑以添加'print'语句,然后不得不重新编译,重新运行来获得输出。 如果要调试的程序相当大,这是一个耗时的方法。
|
||||
|
||||
### 2. 查询 ###
|
||||
|
||||
在某些情况下,我们需要弄清楚在一个运行在内核中的进程的状态和内存映射。为了获得这些信息,我们不需要在内核中插入任何代码。 相反,可以用 /proc 文件系统。
|
||||
|
||||
/proc 是一个伪文件系统,系统一起启动运行就收集着运行时系统的信息 (cpu信息, 内存容量 等)。
|
||||
|
||||
![output of 'ls /proc'](http://blog.linoxide.com/wp-content/uploads/2014/12/proc-output.png)
|
||||
'ls /proc'的输出
|
||||
|
||||
正如你看到的, 系统中运行的每一个进程在/proc文件系统中有一个以进程id命名的项。每个进程的细节信息可以在进程id对应的目录下的文件中获得。
|
||||
|
||||
![output of 'ls /proc/pid'](http://blog.linoxide.com/wp-content/uploads/2014/12/proc-pid.png)
|
||||
'ls /proc/pid'的输出
|
||||
|
||||
解释/proc文件系统内的所有条目超出了本文的范围。一些有用的列举如下:
|
||||
|
||||
- /proc/cmdline -> 内核命令行
|
||||
- /proc/cpuinfo -> 关于处理器的品牌,型号信息等
|
||||
- /proc/filesystems -> 文件系统的内核支持的信息
|
||||
- /proc//cmdline -> 命令行参数传递到当前进程
|
||||
- /proc//mem -> 当前进程持有的内存
|
||||
- /proc//status -> 当前进程的状态
|
||||
|
||||
### 3. 跟踪 ###
|
||||
|
||||
strace的和ltrace是两个在Linux中用来追踪程序的执行细节的跟踪工具
|
||||
|
||||
#### strace: ####
|
||||
|
||||
strace拦截和记录系统调用并且由它来接收的信号。对于用户,它显示了系统调用,传递给它们的参数和返回值。 strace的可以附着到已在运行的进程中,或到一个新的进程。它作为一个针对开发者和系统管理员的诊断,调试工具是很有用的。它也可以用来当为一个通过跟踪不同的程序调用来了解系统的工具。这个工具的好处是不需要源代码和程序不需要重新编译。
|
||||
|
||||
使用strace的基本语法是:
|
||||
|
||||
**strace command**
|
||||
|
||||
strace有各种各样的参数。可以检查看strace的手册页来获得更多的细节。
|
||||
|
||||
strace的输出非常长,我们通常不会对显示的每一行都感兴趣。我们可以用'-e expr'选项来过滤不想要的数据。
|
||||
|
||||
用 '-p pid' 选项来绑到运行中的进程.
|
||||
|
||||
用'-o'选项,命令的输出可以被重定向到文件。
|
||||
|
||||
![output of strace filtering only the open system call](http://blog.linoxide.com/wp-content/uploads/2014/12/strace-output.png)
|
||||
strace过滤成只有系统调用的输出
|
||||
|
||||
#### ltrace: ####
|
||||
|
||||
ltrace跟踪和记录一个进程的动态(运行时)库的调用和收到的信号。它也可以跟踪一个进程所作的系统调用。它的用法是类似与strace。
|
||||
|
||||
**ltrace command**
|
||||
|
||||
'-i' 选项在调用库时打印指令指针。
|
||||
|
||||
'-S' 选项被用来现实系统调用和库调用
|
||||
|
||||
所有可用的选项请参阅ltrace手册。
|
||||
|
||||
![output of ltrace capturing 'strcmp' library call](http://blog.linoxide.com/wp-content/uploads/2014/12/ltrace-output.png)
|
||||
ltrace捕捉'STRCMP'库调用的输出
|
||||
|
||||
### 4. Valgrind ###
|
||||
|
||||
Valgrind是一套调试和分析工具。一个被广泛使用的工具,默认的工具被称为'Memcheck'的拦截malloc(),new(),free()和delete()调用的内存检测工具。换句话说,它在检测下面这些问题非常有用:
|
||||
|
||||
- 内存泄露
|
||||
- 重释放
|
||||
- 访问越界
|
||||
- 使用未初始化的内存
|
||||
- 使用的内存已经被释放 等。
|
||||
|
||||
它直接通过可执行文件运行。
|
||||
|
||||
Valgrind带有一些缺点。因为它增加了内存占用,可以减慢你的程序。它有时会造成误报和漏报。它不能检测出静态分配的数组的访问越界问题。
|
||||
|
||||
为了用他, 首先下载并安装在你的系统上。 ([Valgrind下载页面][1]). 可以使用操作系统上的包管理起来安装。
|
||||
|
||||
使用命令行安装涉及解压缩,解包下载的文件。
|
||||
|
||||
tar -xjvf valgring-x.y.z.tar.bz2 (where x.y.z is the version number you are trying to install)
|
||||
|
||||
进入新创建的目录(的valgrind-XYZ)内运行以下命令:
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
让我们通过一个小程序(test.c)来理解valgrind怎么工作的:
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void f(void)
|
||||
|
||||
{
|
||||
int x = malloc(10 * sizeof(int));
|
||||
|
||||
x[10] = 0;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
f();
|
||||
return 0;
|
||||
}
|
||||
|
||||
编译程序:
|
||||
|
||||
gcc -o test -g test.c
|
||||
|
||||
现在我们有一个可执行文件叫做'test'。我们现在可以用valgrind来检测内存错误:
|
||||
|
||||
valgrind –tool=memcheck –leak-check=yes test
|
||||
|
||||
这是valgrind呈现错误的输出:
|
||||
|
||||
![output of valgrind showing heap block overrun and memory leak](http://blog.linoxide.com/wp-content/uploads/2014/12/Valgrind.png)
|
||||
valgrind显示堆溢出和内存泄漏的输出
|
||||
|
||||
正如我们在上面看到的消息,我们正在试图访问超出函数f分配的内存和分配的内存没有释放。
|
||||
|
||||
### 5. GDB ###
|
||||
|
||||
GDB是来自自由软件基金会的调试器。它对定位和修复代码中的问题很有帮助。当被调试的程序运行时,它给用户控制权去执行各种动作, 比如:
|
||||
|
||||
- 启动程序
|
||||
- 停在指定位置
|
||||
- 停在指定的条件
|
||||
- 检查所需信息
|
||||
- 改变程序中的数据 等。
|
||||
|
||||
你也可以附加一个崩溃的程序coredump到GDB并分析故障的原因。
|
||||
|
||||
GDB提供很多选项来调试程序。 然而,我们将介绍一些重要的选择,来感受如何开始使用GDB。
|
||||
|
||||
如果你还没有安装GDB,可以在这里下载 [GDB官方网站][2].
|
||||
|
||||
#### 编译程序: ####
|
||||
|
||||
为了用GDB调试程序,必须使用gcc的'-g'选项进行编译。将以操作系统的本地格式产生调试信息,GDB利用这些信息来工作。
|
||||
|
||||
下面是一个简单的程序(example1.c)执行被零除用来显示GDB的用法:
|
||||
|
||||
#include
|
||||
int divide()
|
||||
{
|
||||
int x=5, y=0;
|
||||
return x / y;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
divide();
|
||||
}
|
||||
|
||||
![An example showing usage of gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb-example.png)
|
||||
展示GDB用法的例子
|
||||
|
||||
#### 调用 GDB: ####
|
||||
|
||||
通过在命令行中执行'gdb'来启动gdb:
|
||||
|
||||
![invoking gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb.png)
|
||||
调用 gdb
|
||||
|
||||
一旦调用, 它将等待终端命令并执行,直到退出。
|
||||
|
||||
如果一个进程已经在运行,你需要将GDB连接到它上面,可以通过指定进程ID来实现。假设程序已经崩溃,要分析问题的原因,则连接GDB到core文件。
|
||||
|
||||
#### 启动程序: ####
|
||||
|
||||
一旦你在GDB里面,使用'run'命令来启动程序进行调试。
|
||||
|
||||
#### 给程序传参数: ####
|
||||
|
||||
使用'set args'给你的程序传参数,当程序下次运行时将获得参数。'show args'将显示传递给程序的参数。
|
||||
|
||||
#### 检查堆栈: ####
|
||||
|
||||
每当程序停止,任何人想明白的第一件事就是它为什么停止,以及怎么停在那里的。该信息被称为反向跟踪。由程序产生每个函数调用和局部变量,传递的参数,调用位置等信息一起存储在堆栈内的数据块种,被称为一帧。我们可以使用GDB来检查所有这些数据。 GDB从最底层的帧开始给这些帧编号。
|
||||
|
||||
- **bt**: 打印整个堆栈的回溯
|
||||
- **bt <n>** 打印n个帧的回溯
|
||||
- **frame <frame number>**: 切换到指定的帧,并打印该帧
|
||||
- **up <n>**: 上移'n'个帧
|
||||
- **down <n>**: 下移'n'个帧 ( n默认是1)
|
||||
|
||||
#### 检查数据: ####
|
||||
|
||||
程序的数据可以在里面GDB使用'print'命令进行检查。例如,如果'X'是调试程序内的变量,'print x'会打印x的值。
|
||||
|
||||
#### 检查源码: ####
|
||||
|
||||
源码可以在GDB中打印。默认情况下,'list'命令会打印10行代码。
|
||||
|
||||
- **list <linenum>**: 列出'linenum'行周外的源码
|
||||
- **list <function>**: 从'function'开始列出源码
|
||||
- **disas <function>**: 显示该函数机器代码
|
||||
|
||||
#### 停止和恢复程序: ####
|
||||
|
||||
使用GDB,我们可以在必要的地方设置断点,观察点等来停止程序。
|
||||
|
||||
- **break <location>**: 在'location'设置一个断点。当在程序执行到这里时断点将被击中,控制权被交给用户。
|
||||
- **watch <expr>**: 当'expr'被程序写而且它的值发生变化时GDB将停止
|
||||
- **catch <event>**: 当'event'发生时GDB停止。
|
||||
- **disable <breakpoint>**: 禁用指定断点
|
||||
- **enable <breakpoint>**: 启用指定断点
|
||||
- **delete <breakpoint>**: 删除 断点/观察点/捕获点。 如果没有传递参数默认操作是在所有的断点。
|
||||
- **step**: 一步一步执行程序
|
||||
- **continue**: 继续执行程序,直到执行完毕
|
||||
|
||||
#### 退出 GDB: ####
|
||||
|
||||
用'quit'命令还从GDB中退出。
|
||||
|
||||
GDB还有更多的可用选项。里面GDB使用help选项了解更多详情。
|
||||
|
||||
![getting help within gdb](http://blog.linoxide.com/wp-content/uploads/2014/12/gdb-help.png)
|
||||
在GDB种获得帮助
|
||||
|
||||
### 总结 ###
|
||||
|
||||
在这篇文章中,我们已经看到不同类型的Linux用户空间的调试工具。总结以上所有内容,这是些什么时候使用该什么的快速指南:
|
||||
|
||||
基本调试,获得关键变量 - print 语句
|
||||
|
||||
获取有关文件系统支持,可用内存,CPU,运行程序的内核状态等信息 - 查询 /proc 文件系统
|
||||
|
||||
最初的问题诊断,系统调用或库调用的相关问题,了解程序流程 – strace / ltrace
|
||||
|
||||
应用程序内存空间的问题 – valgrind
|
||||
|
||||
检查应用程序运行时的行为,分析应用程序崩溃 – gdb。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-how-to/user-space-debugging-tools-linux/
|
||||
|
||||
作者:[B N Poornima][a]
|
||||
译者:[mtunique](https://github.com/mtunique)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/bnpoornima/
|
||||
[1]:http://valgrind.org/downloads.html
|
||||
[2]:http://www.gnu.org/software/gdb/download/
|
@ -1,254 +0,0 @@
|
||||
什么是有用的bash别名和函数
|
||||
================================================================================
|
||||
作为一个命令行探索者,你或许发现你自己一遍又一遍. 如果你总是用ssh进入到同一台电脑, 同时你总是管道关联相同的命令,或者如果你时常用一些参数运行一个程序,你应该想要拯救你人生中的这个珍贵的助手。你一遍又一遍花费着重复相同的动作.
|
||||
解决方案是使用一个别名.正如你可能知道的,别名用一种方式告诉你的shell记住详细的命令并且给它一个新的名字:别名,的方式。不管怎么样,别名是即时有效的,同样地它只是shell命令的快捷方式,没有能力传递或者控制参数.所以补充时,bash也允许你创建你自己的函数,那样可能更漫长和复杂,并且也允许任意数量的参数.
|
||||
当然,当你有一个好的食谱-像汤,你要分享它.因此这里有一个列表,用一些最有用bash别名和函数的.注意"最有用的"是随意的定义,当然别名的有益依赖在于你每天shell的使用性
|
||||
在你用别名开始试验之前, 这里有一个便于使用的小技巧:如果你给予别名相同的名字作为常规命令,你可以选择开始原始的命令并且用技巧忽略别名
|
||||
\command
|
||||
例如,第一个别名在下面替换ls命令。如果你想使用常规的ls命令而不是别名,通过调用它:
|
||||
\ls
|
||||
|
||||
### Productivity ###
|
||||
|
||||
这些别名真的很简单并且真的很短,但他们大多数主要是以主题为依据,那样无论何时倘若你第二次保存一小部分,它允许在多年以后再结束.也许不会.
|
||||
|
||||
alias ls="ls --color=auto"
|
||||
|
||||
简单但非常重要.使ls命令带着彩色输出
|
||||
|
||||
alias ll = "ls --color -al"
|
||||
|
||||
从一个目录采用列表格式快速显示全部文件.
|
||||
|
||||
alias grep='grep --color=auto'
|
||||
|
||||
相同地,把一些颜色在grep里输出
|
||||
|
||||
mcd() { mkdir -p "$1"; cd "$1";}
|
||||
|
||||
我的最爱之一. 制造一个目录采用一个命令mcd[名字]和cd命令进入到目录里面
|
||||
|
||||
cls() { cd "$1"; ls;}
|
||||
|
||||
类似于前面的功能,cd命令进入一个目录别且列出它的的内容:cls[名字]
|
||||
|
||||
backup() { cp "$1"{,.bak};}
|
||||
|
||||
简单的方法,使文件有一个备份: backup [文件]将会在相同的目录创建[文件].bak.
|
||||
|
||||
md5check() { md5sum "$1" | grep "$2";}
|
||||
|
||||
因为我讨厌通过手工比较文件的md5算法,这个函数计算它并且计算它使用grep:md5check[文件][钥匙]
|
||||
|
||||
![](https://farm6.staticflickr.com/5616/15412389280_8be57841ae_o.jpg)
|
||||
|
||||
alias makescript="fc -rnl | head -1 >"
|
||||
|
||||
很容易地制造上个命令的脚本输出,你运行makescript[脚本名字.sh]
|
||||
|
||||
alias genpasswd="strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo"
|
||||
|
||||
只是瞬间产生一个强壮的密码
|
||||
|
||||
![](https://farm4.staticflickr.com/3955/15574321206_dd365f0f0e.jpg)
|
||||
|
||||
alias c="clear"
|
||||
|
||||
不能较为简单的清除你终端的屏幕
|
||||
|
||||
alias histg="history | grep"
|
||||
|
||||
通过你的命令历史:histg[关键字]快速地搜索
|
||||
|
||||
alias ..='cd ..'
|
||||
|
||||
不需要写cd命令到上层目录
|
||||
|
||||
alias ...='cd ../..'
|
||||
|
||||
类似地,去到上两个目录
|
||||
|
||||
extract() {
|
||||
if [ -f $1 ] ; then
|
||||
case $1 in
|
||||
*.tar.bz2) tar xjf $1 ;;
|
||||
*.tar.gz) tar xzf $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.rar) unrar e $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.tar) tar xf $1 ;;
|
||||
*.tbz2) tar xjf $1 ;;
|
||||
*.tgz) tar xzf $1 ;;
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7z x $1 ;;
|
||||
*) echo "'$1' cannot be extracted via extract()" ;;
|
||||
esac
|
||||
else
|
||||
echo "'$1' is not a valid file"
|
||||
fi
|
||||
}
|
||||
|
||||
很长,但是也是最有用的。解压任何的文档类型:extract:[文档文件]
|
||||
|
||||
|
||||
### 系统信息 ###
|
||||
|
||||
想尽快地知道一切关于你的系统?
|
||||
|
||||
alias cmount="mount | column -t"
|
||||
|
||||
mount到列队中的格式输出
|
||||
|
||||
![](https://farm6.staticflickr.com/5603/15598830622_587b77a363_z.jpg)
|
||||
|
||||
alias tree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'"
|
||||
|
||||
递归树格式显示目录结构.
|
||||
|
||||
sbs() { du -b --max-depth 1 | sort -nr | perl -pe 's{([0-9]+)}{sprintf "%.1f%s", $1>=2**30? ($1/2**30, "G"): $1>=2**20? ($1/2**20, "M"): $1>=2**10? ($1/2**10, "K"): ($1, "")}e';}
|
||||
|
||||
在当前目录里“按大小排序”显示列表的文件,排序按它们在磁盘上的大小
|
||||
|
||||
alias intercept="sudo strace -ff -e trace=write -e write=1,2 -p"
|
||||
|
||||
intercept[一些PID]阻止进程的标准输入输出文件和标准错误文件。注意你需要看着安装完成
|
||||
|
||||
alias meminfo='free -m -l -t'
|
||||
|
||||
查看你还有剩下多少内存
|
||||
|
||||
![](https://farm4.staticflickr.com/3955/15411891448_0b9d6450bd_z.jpg)
|
||||
|
||||
alias ps? = "ps aux | grep"
|
||||
|
||||
ps?[名字]很容易地发现,这个任何进程的
|
||||
|
||||
alias volume="amixer get Master | sed '1,4 d' | cut -d [ -f 2 | cut -d ] -f 1"
|
||||
|
||||
显示现在声音的音量.
|
||||
|
||||
![](https://farm4.staticflickr.com/3939/15597995445_99ea7ffcd5_o.jpg)
|
||||
|
||||
### 网络 ###
|
||||
|
||||
对于所有涉及互联网和你本地网络的命令,也有奇特的别名给它们
|
||||
|
||||
|
||||
alias websiteget="wget --random-wait -r -p -e robots=off -U mozilla"
|
||||
|
||||
websiteget[指定的位置]下载完整的网站地址
|
||||
|
||||
alias listen="lsof -P -i -n"
|
||||
|
||||
显示出哪个应用程序连接到网络
|
||||
|
||||
![](https://farm4.staticflickr.com/3943/15598830552_c7e5eaaa0d_z.jpg)
|
||||
|
||||
alias port='netstat -tulanp'
|
||||
|
||||
显示出活动的端口
|
||||
|
||||
gmail() { curl -u "$1" --silent "https://mail.google.com/mail/feed/atom" | sed -e 's/<\/fullcount.*/\n/' | sed -e 's/.*fullcount>//'}
|
||||
|
||||
gmail:[用户名]大概的显示你的谷歌邮件里未读邮件的数量
|
||||
|
||||
|
||||
alias ipinfo="curl ifconfig.me && curl ifconfig.me/host"
|
||||
|
||||
获得你的公共IP地址和主机
|
||||
|
||||
getlocation() { lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|grep address|egrep 'city|state|country'|awk '{print $3,$4,$5,$6,$7,$8}'|sed 's\ip address flag \\'|sed 's\My\\';}
|
||||
|
||||
以你的IP地址为基础返回你现在的位置
|
||||
|
||||
### 没用的 ###
|
||||
|
||||
所以呢,如果一些别名是不是全部具有使用价值?它们可能仍然有趣
|
||||
|
||||
|
||||
kernelgraph() { lsmod | perl -e 'print "digraph \"lsmod\" {";<>;while(<>){@_=split/\s+/; print "\"$_[0]\" -> \"$_\"\n" for split/,/,$_[3]}print "}"' | dot -Tpng | display -;}
|
||||
|
||||
要绘制内核模块依赖曲线图。需要镜像阅读器
|
||||
|
||||
alias busy="cat /dev/urandom | hexdump -C | grep "ca fe""
|
||||
|
||||
在非技术人员的眼里你看起来都在忙和构思
|
||||
|
||||
![](https://farm6.staticflickr.com/5599/15574321326_ab3fbc1ef9_z.jpg)
|
||||
|
||||
最后,这些别名和函数的很大一部分来自于我个人的.bashrc.这些令人敬畏的网站 [alias.sh][1]和[commandlinefu.com][2]我早已经展示在我的[best online tools for Linux][3].当然去检测它们的输出,让你拥有特有的秘诀。如果你真的同意,在注释里分享你的智慧,
|
||||
|
||||
|
||||
做为奖励,这里有我提到的全部别名和函数的纯文本版本,随时可以复制粘贴到你的.bashrc.
|
||||
|
||||
#Productivity
|
||||
alias ls="ls --color=auto"
|
||||
alias ll="ls --color -al"
|
||||
alias grep='grep --color=auto'
|
||||
mcd() { mkdir -p "$1"; cd "$1";}
|
||||
cls() { cd "$1"; ls;}
|
||||
backup() { cp "$1"{,.bak};}
|
||||
md5check() { md5sum "$1" | grep "$2";}
|
||||
alias makescript="fc -rnl | head -1 >"
|
||||
alias genpasswd="strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo"
|
||||
alias c="clear"
|
||||
alias histg="history | grep"
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
extract() {
|
||||
if [ -f $1 ] ; then
|
||||
case $1 in
|
||||
*.tar.bz2) tar xjf $1 ;;
|
||||
*.tar.gz) tar xzf $1 ;;
|
||||
*.bz2) bunzip2 $1 ;;
|
||||
*.rar) unrar e $1 ;;
|
||||
*.gz) gunzip $1 ;;
|
||||
*.tar) tar xf $1 ;;
|
||||
*.tbz2) tar xjf $1 ;;
|
||||
*.tgz) tar xzf $1 ;;
|
||||
*.zip) unzip $1 ;;
|
||||
*.Z) uncompress $1 ;;
|
||||
*.7z) 7z x $1 ;;
|
||||
*) echo "'$1' cannot be extracted via extract()" ;;
|
||||
esac
|
||||
else
|
||||
echo "'$1' is not a valid file"
|
||||
fi
|
||||
}
|
||||
|
||||
#System info
|
||||
alias cmount="mount | column -t"
|
||||
alias tree="ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'"
|
||||
sbs(){ du -b --max-depth 1 | sort -nr | perl -pe 's{([0-9]+)}{sprintf "%.1f%s", $1>=2**30? ($1/2**30, "G"): $1>=2**20? ($1/2**20, "M"): $1>=2**10? ($1/2**10, "K"): ($1, "")}e';}
|
||||
alias intercept="sudo strace -ff -e trace=write -e write=1,2 -p"
|
||||
alias meminfo='free -m -l -t'
|
||||
alias ps?="ps aux | grep"
|
||||
alias volume="amixer get Master | sed '1,4 d' | cut -d [ -f 2 | cut -d ] -f 1"
|
||||
|
||||
#Network
|
||||
alias websiteget="wget --random-wait -r -p -e robots=off -U mozilla"
|
||||
alias listen="lsof -P -i -n"
|
||||
alias port='netstat -tulanp'
|
||||
gmail() { curl -u "$1" --silent "https://mail.google.com/mail/feed/atom" | sed -e 's/<\/fullcount.*/\n/' | sed -e 's/.*fullcount>//'}
|
||||
alias ipinfo="curl ifconfig.me && curl ifconfig.me/host"
|
||||
getlocation() { lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|grep address|egrep 'city|state|country'|awk '{print $3,$4,$5,$6,$7,$8}'|sed 's\ip address flag \\'|sed 's\My\\';}
|
||||
|
||||
#Funny
|
||||
kernelgraph() { lsmod | perl -e 'print "digraph \"lsmod\" {";<>;while(<>){@_=split/\s+/; print "\"$_[0]\" -> \"$_\"\n" for split/,/,$_[3]}print "}"' | dot -Tpng | display -;}
|
||||
alias busy="cat /dev/urandom | hexdump -C | grep \"ca fe\""
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/useful-bash-aliases-functions.html
|
||||
|
||||
作者:[Adrien Brochard][a]
|
||||
译者:[译者luoyutiantang](https://github.com/译者luoyutiantang)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/adrien
|
||||
[1]:http://alias.sh/
|
||||
[2]:http://www.commandlinefu.com/commands/browse
|
||||
[3]:http://xmodulo.com/useful-online-tools-linux.html
|
Loading…
Reference in New Issue
Block a user