mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-29 21:41:00 +08:00
commit
5a0db84196
@ -1,26 +1,28 @@
|
||||
HTG解释:什么是Unix以及它为什么这么重要?
|
||||
什么是Unix以及它为什么这么重要?
|
||||
================================================================================
|
||||
![](http://cdn.howtogeek.com/wp-content/uploads/2014/02/ken-thompson-and-dennis-richie-at-pdp-11.jpg)
|
||||
|
||||
大多数操作系统可以被划分到两个不同的家族。除了微软的基于Windows NT的操作系统外,几乎所有其他的都可以追溯到Unix。
|
||||
|
||||
Linux,Mac OS X,Android,iOS,Chrome OS,PlayStaion 4上运行的Orbis OS,运行在路由器上的任意固件,所有这些操作系统通常都被称为“类Unix”操作系统。
|
||||
Linux,Mac OS X,Android,iOS,Chrome OS,PlayStaion 4上运行的Orbis OS,运行在路由器上的各种固件,所有这些操作系统通常都被称为“类Unix”操作系统。
|
||||
|
||||
### Unix的设计现在都还在应用 ###
|
||||
|
||||
Unix在20世纪60年代中晚期诞生于AT&T的贝尔实验室中。最初发布的Unix中的一些重要设计因素到如今都还在使用。
|
||||
|
||||
其中一个是“Unix哲学”,建立小的模块化的应用,只做一件事情并把它做好。如果你对Linux终端很熟悉的话,应该对这个不陌生-系统提供了大量的应用,可以通过[管道或其他特性][1]形成不同的组合来完成更复杂的任务。甚至图形界面程序也经常会在后台调用更简单的应用去做比较耗时的任务。这种模式也让[建立终端脚本][2]更为简单,通过文本把一些简单工具结合起来去做复杂的事情。
|
||||
其中一个设计是“Unix哲学”,建立小的模块化的应用,只做一件事情并把它做好。如果你对Linux终端很熟悉的话,应该对这个不陌生-系统提供了大量的应用,可以通过[管道或其他特性][1]形成不同的组合来完成更复杂的任务。甚至图形界面程序也经常会在后台调用更简单的应用去做比较耗时的任务。这种模式也让[建立终端脚本][2]更为简单,通过文本把一些简单工具结合起来去做复杂的事情。
|
||||
|
||||
Unix还设计了一个单一的文件系统,程序可以通过它互相通讯。这也是[为什么在Linux里说“一切都是文件”][3]-包括硬件设备和提供系统信息或其他数据的特殊文件。这也是为什么只有Windows系统中才有磁盘盘符,这是从DOS继承过来的-在其他操作系统中,所有文件都是一个单一目录结构中的一部分。
|
||||
Unix还设计了一个单一的文件系统,程序可以通过它互相通讯。这也是[为什么在Linux里说“一切都是文件”][3]-包括硬件设备文件,和提供系统信息及其他数据的特殊文件。这也是为什么只有Windows系统中才有磁盘盘符,这是从DOS继承过来的-在其他操作系统中,所有文件都是一个单一目录结构中的一部分。
|
||||
|
||||
![](http://cdn.howtogeek.com/wp-content/uploads/2014/02/unix-bell-labs.jpg)
|
||||
|
||||
### 那些从Unix派生出的系统 ###
|
||||
|
||||
类似任何往前追溯40年的历史,Unix的历史和它的派生系统一片混乱。为了简单,我们把Unix的派生系统大致分成两组。
|
||||
类似任何可以往前追溯40年的历史,Unix的历史和它的派生系统一片混乱。为了简单,我们把Unix的派生系统大致分成两组。
|
||||
|
||||
一组Unix派生系统是学术界开发的。首先是BSD(伯克利软件发布版),一个开源的类Unix操作系统。BSD如今还存在于FreeBSD,NetBSD和OpenBSD等系统中。NeXTStep基于最初版的BSD开发,苹果的Mac OS X基于NeXTStep,iOS基于Mac OS X。许多其他操作系统,包括运行在PlayStation 4上的Orbis OS,也源于各种BSD操作系统。
|
||||
一组Unix派生系统是学术界开发的。
|
||||
|
||||
首先是BSD(伯克利软件发布版),一个开源的类Unix操作系统。BSD如今还存在于FreeBSD,NetBSD和OpenBSD等系统中。NeXTStep基于最初版的BSD开发,苹果的Mac OS X基于NeXTStep,iOS基于Mac OS X。许多其他操作系统,包括运行在PlayStation 4上的Orbis OS,也源于各种BSD操作系统。
|
||||
|
||||
Richard Stallman建立GNU项目的目的是为了反对AT&T的Unix软件协议条款日渐严格的限制。MINIX是一个类Unix操作系统,为教育目的而实现的,而Linux则是受到了MINIX的启发。[我们今天所熟悉的Linux其实应该叫GNU/Linux][4],因为它是由Linux内核和大量GNU应用组成的。GNU/Linux不是直接从BSD继承下来的,但是它继承了Unix的设计而且根植于学术界。如今许多操作系统,包括Android,Chrome OS,Steam OS,以及数量巨大的在各种设备上使用的嵌入式操作系统,都基于Linux。
|
||||
|
||||
@ -34,7 +36,7 @@ Richard Stallman建立GNU项目的目的是为了反对AT&T的Unix软件协议
|
||||
|
||||
许多人希望Unix能够成为工业标准操作系统,但是DOS和“IBM PC兼容”计算机却最终人气爆发而普及开来。微软的DOS也成为众多DOS系统中最成功的一个。DOS完全没有参照Unix,这也是[为什么Windows使用反斜杠划分文件路径,而其他所有系统都使用正斜杠][6]。这个决定是在早期的DOS系统中做出的,而之后的Windows版本继承了这一设定,就像BSD,Linux,Mac OS X,和其他类Unix操作系统继承了许多Unix设计因素一样。
|
||||
|
||||
Windows 3.1,Windows 95,Windows 98,and Windows ME都是建立在DOS的基础上。当时微软已经在开发一个更现代更稳定的操作系统,叫做Windows NT-意思是“Windows新技术”。Windows NT最终通过Windows XP应用到普通计算机用户中,但是之前它都只用于针对企业用户的Windows 2000和Windows NT。
|
||||
Windows 3.1,Windows 95,Windows 98,和 Windows ME都是建立在DOS的基础上。当时微软已经在开发一个更现代更稳定的操作系统,叫做Windows NT-意思是“Windows新技术”。Windows NT最终通过Windows XP应用到普通计算机用户中,但是之前它都只用于针对企业用户的Windows 2000和Windows NT。
|
||||
|
||||
如今所有微软的操作系统都基于Windows NT内核。Windows 7,Windows 8,Windows RT,Windows Phone 8,Windows Server,以及Xbox One上的操作系统都在使用Windows NT内核。不像其他大多数操作系统那样,Windows NT没有被开发成一个类Unix操作系统。
|
||||
|
||||
@ -42,11 +44,11 @@ Windows 3.1,Windows 95,Windows 98,and Windows ME都是建立在DOS的基
|
||||
|
||||
![](http://cdn.howtogeek.com/wp-content/uploads/2014/02/windows-2000-professional-built-on-nt-technology.jpg)
|
||||
|
||||
为什么它影响很大
|
||||
### 为什么它影响很大 ###
|
||||
|
||||
不知道你有没有看过Mac OS X终端或是文件系统,有没有注意到它们和Linux是如此相似,而又和Windows是如此不同?好吧,原因是-Mac OS X和Linux两个都是类Unix操作系统。
|
||||
|
||||
了解了这点历史,就可以帮助你理解什么是“类Unix”操作系统,以及为什么这么多操作系统看起来都差不多,而Windows却那么与众不同。这也可以解释为什么Linux极客对Mac OS X上的终端会感觉如此熟悉,而[Windows 7上的Command Prompt和PowerShell][7]相对于其他命令行环境显得如此不同。
|
||||
了解了这点历史,就可以帮助你理解什么是“类Unix”操作系统,以及为什么这么多操作系统看起来都差不多,而Windows却那么与众不同。这也可以解释为什么Linux极客对Mac OS X上的终端会感觉如此熟悉,而[Windows 7上的Command Prompt和PowerShell][7]相对于其他命令行环境显得格格不入。
|
||||
|
||||
这只是一点快速掠过的历史,帮助了解是如何发展到今天的,而不用陷入到细节中。如果你想了解更多,可以找到许多关于Unix历史的整本的书籍。
|
||||
|
||||
@ -56,7 +58,7 @@ Windows 3.1,Windows 95,Windows 98,and Windows ME都是建立在DOS的基
|
||||
|
||||
via: http://www.howtogeek.com/182649/htg-explains-what-is-unix/
|
||||
|
||||
译者:[zpl1025](https://github.com/zpl1025) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[zpl1025](https://github.com/zpl1025) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,127 @@
|
||||
如何拯救一台GRUB 2启动失败的Linux电脑
|
||||
================================================================================
|
||||
![Figure 1: GRUB 2 menu with cool Apollo 17 background.](http://www.linux.com/images/stories/41373/grub-command-shell.jpg)
|
||||
|
||||
旧版GRUB我们使用了一段时间了,这个重要的Linux通用引导器的版本已经到了0.97。尽管旧版GRUB有很多的优点,但是它已经有点陈旧了,并且它的开发者也希望添加更多的功能,于是,GRUB 2 时代就要来了。
|
||||
|
||||
GRUB 2 做了几个明显的改进。它可以从移动存储设备上启动,并且可以通过配置一个选项来进入系统BIOS。相对于将所有的配置都放到一个配置文件`/boot/grub/menu.lst`中 (现在默认是`/boot/grub/grub.cfg `),使用各种脚本来配置会更复杂。你不要直接编辑这个文件,那不是人干的事,太复杂了,我们需要使用其它的脚本来改变。我们卑微的人类可以编辑修改`/etc/default/grub`文件,它主要是控制Grub菜单的外观。我们还可以修改` /etc/grub.d/ `下的脚本,这些脚本用于启动操作系统、控制外部应用程序,如memtest 、os_prober和theming等等 。`./boot/grub/grub.cfg`是由`/etc/default/grub`和`/etc/grub.d/*`生成的。当你修改了某个地方,你必须要运行update-grub命令来生成它。
|
||||
|
||||
好消息是,update-grub脚本可以可靠的检测内核、启动文件,并添加所有的操作系统,自动生成你的启动菜单,所以你不必手动的修改他们。
|
||||
|
||||
我们还要学习如何解决两个常见的故障。当启动系统时,它会停在grub>提示上,这是一个完整的GRUB 2命令界面,所以不要惊慌。这意味着GRUB 2依旧可以正常启动和加载normal.mod模块(它和其他模块分别位于/boot/grub/[架构]/ 下),但没有找到你的grub.cfg文件。如果你看到grub rescue> 这意味着它无法找到normal.mod,因此它有可能找不到你的启动文件。
|
||||
|
||||
这是如何发生的?因为内核可能改变驱动器分区号码的分配,或者您移动了您的硬盘驱动器,或者你手动改变一些分区,也有可能是安装一个新的操作系统或者移动一些文件。在这些情况下你的启动文件仍然存在,但GRUB不能找到他们。所以你可以在GRUB提示符中找到启动文件,设置它们的位置,然后启动您的系统并修复GRUB配置。
|
||||
|
||||
### GRUB 2 命令行 ###
|
||||
|
||||
GRUB 2 的命令界面和上一代GRUB中的一样强大。你可以用它来找到引导镜像,内核和根文件系统。事实上,它可以让你避开权限和其它访问控制,完全访问本地计算机上的所有文件。有些人可能会认为这是一个安全漏洞,但是你知道古老的UNIX的名言:有物理访问机器权限的人,就是拥有它的人。
|
||||
|
||||
当你在` grub > `提示时,你有许多类似命令行界面的功能,如命令历史和tab补全。但是`grub rescue> `模式是受限的,没有命令历史,没有tab补全。
|
||||
|
||||
如果你是在一个正常运作的系统上练习,那就当GRUB菜单出现时,可以按下C来打开GRUB命令行界面。你可以通过向上和向下光标键滚动你的菜单条目来停止启动倒计时。在GRUB命令行下做实验是安全的,因为做不了永久的修改,一切都是暂时的。如果你已经看到`grub > `或`grub rescue> `提示符,那就说明你的表现时刻到了。
|
||||
|
||||
接下来的几个命令可以在`grub>`和`grub rescue`模式下运行。你应该运行的第一个命令是设置一个分页器,将长的命令分页。如下:
|
||||
|
||||
grub> set pager=1
|
||||
|
||||
等号两侧必须不能出现空格。现在让我们做一点探索。输入`ls`来列出的GRUB识别的所有分区:
|
||||
|
||||
grub> ls
|
||||
(hd0) (hd0,msdos2) (hd0,msdos1)
|
||||
|
||||
msdos是什么?这意味着该系统具有老式的MS-DOS分区表,而不是全新的全局唯一标识符的分区表(GPT)。参见“[在Linux下使用新的GUID分区表,和古老的MBR说再见!][1]”。如果你正在运行的GPT,它会出现(hd0,GPT1)。现在让我们看看,使用ls命令查看你的系统里面有什么文件:
|
||||
|
||||
grub> ls (hd0,1)/
|
||||
lost+found/ bin/ boot/ cdrom/ dev/ etc/ home/ lib/
|
||||
lib64/ media/ mnt/ opt/ proc/ root/ run/ sbin/
|
||||
srv/ sys/ tmp/ usr/ var/ vmlinuz vmlinuz.old
|
||||
initrd.img initrd.img.old
|
||||
|
||||
太好了,我们已经找到了根文件系统。你可以省略msdos和GPT的标签。如果没有加分区后面的斜杠/,则只会列出分区的信息。你可以用cat命令显示文件系统上的任何文件:
|
||||
|
||||
grub> cat (hd0,1)/etc/issue
|
||||
Ubuntu 14.04 LTS \n \l
|
||||
|
||||
在一个多引导系统上,通过/etc/issue文件可以知道这是哪个Linux系统。
|
||||
|
||||
### 从 grub> 中启动###
|
||||
|
||||
下面讲述如何设置启动文件并从`grub >`提示下启动系统。我们已经知道如何从Linux根文件系统(hd0,1)下运行ls命令,你可以一直寻找直到找到你的/boot/grub所在位置。然后运行以下命令,记得使用您自己的根分区,内核和initrd映像等参数:
|
||||
|
||||
grub> set root=(hd0,1)
|
||||
grub> linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1
|
||||
grub> initrd /boot/initrd.img-3.13.0-29-generic
|
||||
grub> boot
|
||||
|
||||
第一行设置分区的根文件系统。第二行告诉GRUB您想要使用的内核位置。开始输入/boot/vmli,然后使用tab补完填写。输入`root= /dev/sdX`设置根文件系统位置。是的,这似乎是多余的,但如果你忘记了输入,你会得到一个kernel panic。你知道怎么找到正确的分区吗?hd0,1 即 /dev/sda1,hd1,1 即 /dev/sdb1,hd3,2 即 /dev/ sdd2。我想你可以自己推算剩下的了。
|
||||
|
||||
第三行设置initrd文件,必须是和内核相同的版本号。
|
||||
|
||||
最后一行启动系统。
|
||||
|
||||
在一些Linux系统上,内核和initrd是被符号链接到当前的根文件系统的根目录,就像:
|
||||
|
||||
$ ls -l /
|
||||
vmlinuz -> boot/vmlinuz-3.13.0-29-generic
|
||||
initrd.img -> boot/initrd.img-3.13.0-29-generic
|
||||
|
||||
所以,你也可以这样输入命令:
|
||||
|
||||
grub> set root=(hd0,1)
|
||||
grub> linux /vmlinuz root=/dev/sda1
|
||||
grub> initrd /initrd.img
|
||||
grub> boot
|
||||
|
||||
### 从grub rescue> 中启动 ###
|
||||
|
||||
如果你处在grub rescue> 命令界面下,命令有所不同,你必须要先加载两个模块normal.mod 和 linux.mod。
|
||||
|
||||
grub rescue> set prefix=(hd0,1)/boot/grub
|
||||
grub rescue> set root=(hd0,1)
|
||||
grub rescue> insmod normal
|
||||
grub rescue> normal
|
||||
grub rescue> insmod linux
|
||||
grub rescue> linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1
|
||||
grub rescue> initrd /boot/initrd.img-3.13.0-29-generic
|
||||
grub rescue> boot
|
||||
|
||||
在你加载了这两个模块之后tab补完的功能就可以用了。
|
||||
|
||||
### 永久性的修复 ###
|
||||
|
||||
当你成功地启动你的系统,运行这些命令来永久修复GRUB:
|
||||
|
||||
# update-grub
|
||||
Generating grub configuration file ...
|
||||
Found background: /usr/share/images/grub/Apollo_17_The_Last_Moon_Shot_Edit1.tga
|
||||
Found background image: /usr/share/images/grub/Apollo_17_The_Last_Moon_Shot_Edit1.tga
|
||||
Found linux image: /boot/vmlinuz-3.13.0-29-generic
|
||||
Found initrd image: /boot/initrd.img-3.13.0-29-generic
|
||||
Found linux image: /boot/vmlinuz-3.13.0-27-generic
|
||||
Found initrd image: /boot/initrd.img-3.13.0-27-generic
|
||||
Found linux image: /boot/vmlinuz-3.13.0-24-generic
|
||||
Found initrd image: /boot/initrd.img-3.13.0-24-generic
|
||||
Found memtest86+ image: /boot/memtest86+.elf
|
||||
Found memtest86+ image: /boot/memtest86+.bin
|
||||
done
|
||||
# grub-install /dev/sda
|
||||
Installing for i386-pc platform.
|
||||
Installation finished. No error reported.
|
||||
|
||||
当你运行 `grub-install` 时,记得GRUB是安装到整个硬盘驱动器的主引导扇区而不是到一个具体分区,所以不要加上像/dev/sda1一样的分区号。
|
||||
|
||||
### 如果还是不能使用 ###
|
||||
|
||||
如果你的系统是如此的倒霉,而且这个方式没有能起作用,那就尝试[超级GRUB2现场救援磁盘][2]吧。[官方GNU GRUB手册][3]也应该有所帮助。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linux.com/learn/tutorials/776643-how-to-rescue-a-non-booting-grub-2-on-linux
|
||||
|
||||
译者:[MikeCoder](https://github.com/MikeCoder) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.linux.com/learn/tutorials/730440-using-the-new-guid-partition-table-in-linux-good-bye-ancient-mbr-
|
||||
[2]:http://www.supergrubdisk.org/
|
||||
[3]:https://www.gnu.org/software/grub/manual/grub.html
|
@ -2,9 +2,9 @@
|
||||
================================================================================
|
||||
[NeoBundle][1] 是一个 [Vim][2] 的插件管理器,以 [Vundle][3] 为基础(Vundle 是一个基于 [Pathogen][4] 的 Vim 插件管理器)。在之前的文章中,我[非常不推荐使用 Neobundle][5],原因是它当时还处于高速开发阶段(LCTT:意味着不稳定、变数大),并且当时它的英文文档很少。现在,已经过了一年多了,这两个问题都早已不再是问题。
|
||||
|
||||
我们为什么要使用插件管理器?Vim 支持大量插件,但是由于它没有严格定义框架,插件的文件可以胡乱分布在不同目录下,导致用户管理起来会很困难(LCTT:当然,前提是你有很多插件,还有点小小的强迫症,觉得理一理这些插件心里会舒服点)。而一款插件管理器能让管理变得简单许多。Pathogen, Vundle 和 NeoBundle 的工作就是为不同插件建立一个目录,然后将这些目录扔到 ~/.vim/bundle 目录下。这个文件整理方法可以让你方便彻底地删除插件,使用 'rm -rf <插件目录>' 或直接 'Ctrl + Del' 组合键把插件所在的目录删除就可以了,绝对绿色环保无残留。同时,这种方法还能最大程度避免插件与插件之间的不兼容性。
|
||||
我们为什么要使用插件管理器?Vim 支持大量插件,但是由于它没有严格定义框架,插件的文件可以胡乱分布在不同目录下,导致用户管理起来会很困难(LCTT:当然,前提是你有很多插件,还有点小小的强迫症,觉得理一理这些插件心里会舒服点)。而一款插件管理器能让管理变得简单许多。Pathogen, Vundle 和 NeoBundle 的工作就是为不同插件建立一个目录,然后将这些目录扔到 ~/.vim/bundle 目录下。这个文件整理方法可以让你方便彻底地删除插件,使用 'rm -rf <插件目录>' 或直接在文件管理器里面把插件所在的目录删除就可以了,绝对绿色环保无残留。同时,这种方法还能最大程度避免插件与插件之间的不兼容性。
|
||||
|
||||
NeoBundle 是一个基于 Vundle 的项目,如同 Vundle,它们都可以安装和升级插件。然而 NeoBundle 的说明文件上明确指出:“NeoBundle 不是一个稳定的插件管理器,如果你想要一个稳定的,请选择 Vundle”。最新的 release-note 上也有警“可能会造成兼容性问题”——这是一个开发者写的注解,说明这个管理器还不能让人放心使用。
|
||||
NeoBundle 是一个基于 Vundle 的项目,如同 Vundle,它们都可以安装和升级插件。然而 NeoBundle 的说明文件上明确指出:“NeoBundle 不是一个稳定的插件管理器,如果你想要一个稳定的,请选择 Vundle”。最新的 release-note 上也有警告“可能会造成兼容性问题”——这是一个开发者写的注解,说明这个管理器还不能让人放心使用。
|
||||
|
||||
所以,我们为什么要使用 NeoBundle?它都不能保证稳定运行!好吧,它还是有可取之处的。Vundle 只支持 [Git][6] 这种版本控制系统,而 NeoBundle 可以支持 [Subversion][7] 和 [Mercurial][8]。另一个原因是如果你不想插件升级时破坏你的 Vim 生态环境,你可以锁住 NeoBundle,让它只使用某个插件的固定版本。
|
||||
|
||||
@ -12,11 +12,11 @@ NeoBundle 是一个基于 Vundle 的项目,如同 Vundle,它们都可以安
|
||||
|
||||
### 安装并初始化 NeoBundle ###
|
||||
|
||||
NeoBundle 依赖 Vim 7.2.051 或更高版本,依赖 git,依赖 [cURL][12](用于下载文件)。你可以手动下载 NeoBundle,也可以使用 cURL 下载它在 GitHub 上的库。在你的 home 目录下使用如下命令,可以将 NeoBundle 插件下载到 .vim/bundle/neobundle.vim 目录里,然后 NeoBundle 就能管理它自己了。
|
||||
NeoBundle 支持 Vim 7.2.051 或更高版本,需要 git 和 [cURL][12](用于下载文件)。你可以手动下载 NeoBundle,也可以使用 cURL 下载它在 GitHub 上的库。在你的 home 目录下使用如下命令,可以将 NeoBundle 插件下载到 .vim/bundle/neobundle.vim 目录里,然后 NeoBundle 就能管理它自己了。
|
||||
|
||||
curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh
|
||||
|
||||
你还需要修改 .vimrc 文件。NeoBundle 的 GitHub 主页提供一个 .vimrc 范本,使用这个范本后,NeoBundle 会为你下载5个插件。如果不需要它们,你可以使用下面的最小配置:
|
||||
你还需要修改 .vimrc 文件。NeoBundle 的 GitHub 主页提供一个 .vimrc 范本,但是直接使用这个范本,NeoBundle 需要你安装5个可能不需要插件。如果不需要它们,你可以使用下面的最小配置:
|
||||
|
||||
if has('vim_starting')
|
||||
set nocompatible
|
||||
@ -40,17 +40,17 @@ NeoBundle 依赖 Vim 7.2.051 或更高版本,依赖 git,依赖 [cURL][12](
|
||||
|
||||
NeoBundle 'tpope/vim-abolish'
|
||||
|
||||
再介绍一个小技巧:你可以为插件指定一个分支或版本号。什么意思?NeoBundle 只会关注这个插件的某个分支或版本的更新,而忽略其他更新。如果你使用的某个插件处于高速开发过程,你就可以使用这个技巧,避免用到有 bug 的插件版本。举个例子:
|
||||
再介绍一个小技巧:你可以为插件指定一个分支或版本号。什么意思?NeoBundle 只会使用这个插件的某个分支或版本,而忽略其版本更新。如果你使用的某个插件处于高速开发过程,你就可以使用这个技巧,避免用到有 bug 的插件版本。举个例子:
|
||||
|
||||
NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' }
|
||||
|
||||
还有一个技巧:在 .vimtc 文件内添加一行关于“NeoBundleCheck”的属性。NeoBundle 会检查被卸载的插件,并提示你安装它们。你也可以使用命令“:NeoBundleInstall”(LCTT:这是要在 Vim 编辑器的命令模式下输入)来安装或升级插件。
|
||||
还有一个技巧:在 .vimtc 文件内添加一行关于“NeoBundleCheck”的属性。NeoBundle 会根据配置检查没安装的插件,并提示你安装它们。你也可以使用命令“:NeoBundleInstall”(LCTT:这是要在 Vim 编辑器的命令模式下输入)来安装或升级插件。
|
||||
|
||||
### NeoBundle 用法 ###
|
||||
|
||||
很多 NeoBundle 命令用起来和 Vundle 类似,但命令的名字不一样。下面是 NeoBundle 命令的用法:
|
||||
|
||||
- `:NeoBundleUpdate`:安装或升级插件,如果你手动把一个插件的目录删除了,这个命令会重新安装这个插件。在这个命令后面加上插件名称,就只升级一个插件;不加参数,会将所有己安装但没被记录在案的插件给记录下来。“:NeoBundleInstall”命令效果相同。
|
||||
- `:NeoBundleUpdate`:安装或升级插件,如果你手动把一个插件的目录删除了,这个命令会重新安装这个插件。在这个命令后面加上插件名称,就只升级一个插件;不加参数,会将所有己安装但没被记录在案的插件给记录下来。`:NeoBundleInstall` 命令效果相同。
|
||||
- `:NeoBundle {REPOSITORY URI} [[REVISION}] [,OPTIONS}]]`:将一个插件锁定到固定版本,防止胡乱升级。
|
||||
- `:NeoBundleList`:列出所有未初始化的插件。
|
||||
- `:NeoBundleClean`:进入交互界面,删除插件。
|
||||
@ -59,7 +59,7 @@ NeoBundle 依赖 Vim 7.2.051 或更高版本,依赖 git,依赖 [cURL][12](
|
||||
|
||||
### 是否使用 NeoBundle,自己决定 ###
|
||||
|
||||
NeoBundle 是强大的工具,正处于高速开发状态。任何处于这种状态的项目,都会被帖上“有前途”和“不稳定”两个标签,看你自己怎么选。如果你想要最新的稳定版本的插件,NeoBundle 可以让 Vundle 和 Pathogen 永远保持在老界面。
|
||||
NeoBundle 是强大的工具,正处于高速开发状态。任何处于这种状态的项目,都会被帖上“有前途”和“不稳定”两个标签,看你自己怎么选。如果你想要最新的稳定版本的插件,NeoBundle 能够把 Vundle 和 Pathogen 甩出几条街。
|
||||
|
||||
然而在线帮助文档已经给出警告,它不是个稳定的产品,不及时更新版本可能造成一些插件运行出错。最后,你需要在 .vimrc 文件为你的 Neoundle 和其他插件指定一个稳定的版本。记住这警告,然后你可以在使用这些尖端技术产品时游刃有余。
|
||||
|
||||
@ -67,7 +67,7 @@ NeoBundle 是强大的工具,正处于高速开发状态。任何处于这种
|
||||
|
||||
via: http://www.openlogic.com/wazi/bid/348084/Managing-Vim-extensions-with-NeoBundle
|
||||
|
||||
译者:[bazz2](https://github.com/bazz2) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[bazz2](https://github.com/bazz2) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,8 +1,8 @@
|
||||
Zukimac 主题使 Ubuntu 14.04 桌面变成 Mac 桌面
|
||||
在 Ubuntu 上体验 Mac 风格
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/06/Make_Ubuntu_Look_Like_Mac_OS.jpeg)
|
||||
|
||||
虽然 Ubuntu Unity 本身已经是一款很漂亮的桌面了,但世界各地还是有很人被 Mac OS X 的外观所震撼。如果您恰好是其中之一,为了获得 OS X 的主题,是不需要换掉 Ubuntu 的,相反,您可以对它来个美化改造,**使 Ubuntu 14.04 看起来就像 Mac OS X**。
|
||||
虽然 Ubuntu Unity 本身已经是一款很漂亮的桌面了,但世界各地还是有很人被 Mac OS X 的外观所震撼。如果您恰好是其中之一,要获得 Mac OS X 一样外观体验,是不需要丢掉 Ubuntu 的,相反,您可以对它来个美化改造,**使 Ubuntu 14.04 看起来就像 Mac OS X**。
|
||||
|
||||
### 让 Ubuntu 14.04 看起来像 Mac OS X ###
|
||||
|
||||
@ -12,11 +12,11 @@ Zukimac 主题使 Ubuntu 14.04 桌面变成 Mac 桌面
|
||||
- 解压下载的 Zip 包,解压后会出现 Zukimac 和 Zukimac-ml 两个目录文件。把这些目录拷贝到您的 home 目录下的 .themes 文件夹中。进入 Home 目录中,按下快捷键 Ctrl+H 可以显示所有隐藏的文件,如果没有 .themes 文件夹,需要创建一个。
|
||||
- 使用 [Unity Tweak Tool 来改变主题][2].
|
||||
|
||||
就这些操作。Zukimac 提供了一些基本的 Mac OS 系统的外观和视窗感觉。下面是带有默认的 OS X MaVeric 壁纸的外观。
|
||||
就这些操作。Zukimac 提供了一些基本的 Mac OS 系统的外观和视窗感觉。下面是带有默认的 OS X Maveric 壁纸的外观。
|
||||
|
||||
![Make Ubuntu 14.04 look like Mac OS X](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/06/Ubuntu_MAC_OS_Looks.jpeg)
|
||||
|
||||
### Ubuntu 14.04 中获得 Mac 感觉更多的调整###
|
||||
### Ubuntu 14.04 中获得更多 Mac 体验 ###
|
||||
|
||||
通常,您可以**安装像 Plank 或 Docky 这样的 dock 启动面板**。在 Ubuntu 14.04 中要安装 Plank 可以使用下面的命令:
|
||||
|
||||
@ -42,7 +42,7 @@ Zukimac 主题使 Ubuntu 14.04 桌面变成 Mac 桌面
|
||||
|
||||
via: http://itsfoss.com/ubuntu-1404-mac-zukimac-theme/
|
||||
|
||||
译者:[runningwater](https://github.com/runningwater) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[runningwater](https://github.com/runningwater) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,5 +1,3 @@
|
||||
CNprober翻译完成。。。619913541
|
||||
|
||||
Betty:通过大白话执行Linux命令
|
||||
================================================================================
|
||||
|
||||
@ -7,7 +5,7 @@ Betty:通过大白话执行Linux命令
|
||||
|
||||
### 安装 ###
|
||||
|
||||
Betty的安装非常简单直接。首先确认你已经安装了下面这些依赖包[译注,需要安装至少Ruby1.9以上版本]。
|
||||
Betty的安装非常简单直接。首先确认你已经安装了下面这些依赖包[LCTT译注,需要安装至少Ruby1.9以上版本]。
|
||||
|
||||
#### 对于基于Debian的系统:####
|
||||
|
||||
@ -17,7 +15,7 @@ Betty的安装非常简单直接。首先确认你已经安装了下面这些依
|
||||
|
||||
yum install git curl ruby
|
||||
|
||||
现在git工具把Betty库clone到你自定义的任何路径。这里我克隆到我的home目录,**例如 /home/sk/**.
|
||||
现在用git工具把Betty库clone到你自定义的任何路径。这里我克隆到我的home目录,**例如 /home/sk/**.
|
||||
|
||||
git clone https://github.com/pickhardt/betty
|
||||
|
||||
@ -35,7 +33,7 @@ Betty的安装非常简单直接。首先确认你已经安装了下面这些依
|
||||
|
||||
### 用法 ###
|
||||
|
||||
你应该在英语短语之前加上单词“betty”。你也许已经知道,如果我们想知道在系统中我们的用户名,应该运行下面的命令:
|
||||
你应该在英语短语之前加上单词“betty” [LCTT译注,你自然可以用你的小甜心的名字来替换这个不是知道是谁的Betty :>]。你也许已经知道,如果我们想知道在系统中我们的用户名,应该运行下面的命令:
|
||||
|
||||
whoami
|
||||
|
||||
@ -60,7 +58,7 @@ Betty的安装非常简单直接。首先确认你已经安装了下面这些依
|
||||
|
||||
betty whats my name
|
||||
|
||||
Betty不确定她应该查找系统用户名还是用户全名。这种情况下,她会询问你多个问题来找到准确的结果。如你下面所见,Betty问我想要运行哪一条命令(whoami 还是 finger $(whoami) | sed 's/.*:*//;q')[译注,需要你的系统已经安装finger]。我只想知道我的用户名,所以我选择数字**1**。
|
||||
Betty不确定她应该查找系统用户名还是用户全名。这种情况下,她会询问你多个问题来找到准确的结果。如你下面所见,Betty问我想要运行哪一条命令(whoami 还是 finger $(whoami) | sed 's/.*:*//;q')[LCTT译注,需要你的系统已经安装finger]。我只想知道我的用户名,所以我选择数字**1**。
|
||||
|
||||
Betty: Okay, I have multiple ways to respond.
|
||||
Betty: Enter the number of the command you want me to run, or N (no) if you don't want me to run any.
|
||||
@ -76,7 +74,6 @@ Betty不确定她应该查找系统用户名还是用户全名。这种情况下
|
||||
|
||||
如果你想要压缩一个文件或者文件夹,用下面的命令。例如,我想压缩我home目录下的“test”文件夹。
|
||||
|
||||
|
||||
betty compress test/ test.tar.gz
|
||||
|
||||
输出是这样的:
|
||||
@ -197,7 +194,7 @@ Cheers!
|
||||
|
||||
via: http://www.unixmen.com/betty-translate-english-phrases-linux-commands/
|
||||
|
||||
译者:[love_daisy_love](https://github.com/CNprober) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[love\_daisy\_love](https://github.com/CNprober) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,19 +1,27 @@
|
||||
Ubuntu 14.04 LTS: 定制 Unity
|
||||
Ubuntu 14.04 LTS: 定制 Unity
|
||||
================================================================================
|
||||
虽然Unity桌面管理器自从伴随 Ubuntu 11.01首次发布以来表现出了强劲的性能,并在可用性上迈进了一大步,但是有人对自定义其外观和行为所带的限制感到反感。我们马上就去看看如何自定义Unity,让你重拾自己掌控桌面的感觉。
|
||||
虽然Unity桌面管理器自从伴随 Ubuntu 11.10首次发布以来表现出了强劲的性能,并在可用性上迈进了一大步,但是有人对自定义其外观和行为所带的限制感到反感。我们现在来看看如何自定义Unity,让你重拾自己掌控桌面的感觉。
|
||||
|
||||
### Unity中的可用定制项目 ###
|
||||
|
||||
在ubuntu 14.04中,Unity 有一些以前没有的可定制项。登入你的 Unity,进入“设置”并选择“显示”,你将看到以下画面:
|
||||
|
||||
![Ubuntu 14.04 LTS Display and Unity Settings](https://linuxacademy.com/blog/wp-content/uploads/2014/06/unitysettings.png)
|
||||
|
||||
Ubuntu 14.04 LTS 显示和 Unity 设置
|
||||
|
||||
你看到的大多数项目相比Ubuntu 11.01 中所采用的都是新的,而且一些相比较最近的Ubuntu 版本Ubuntu13.10也是新的。从Ubuntu13.10开始,Ubuntu加入了可以改变菜单栏和标题栏大小的新特性。
|
||||
Unity中所特有的一个特性是我们能够打开或者关闭的“粘性边缘”功能,它能让你的鼠标停止在多显示器组的每个屏幕的边缘,它使光标暂时停在边缘,仿佛是鼠标卡住了一样,我们可以选择关闭它。
|
||||
你看到的大多数项目相比 Ubuntu 11.01 而言都是新的,而且一些相比较上一个版本的 Ubuntu13.10 也是新的。从Ubuntu13.10开始,Ubuntu加入了可以改变菜单栏和标题栏大小的新特性。
|
||||
|
||||
Unity中所特有的一个特性是我们能够打开或者关闭的“粘性边缘”功能,它能让你的鼠标停止在多显示器组的每个屏幕的边缘,它使光标暂时停在边缘,仿佛是鼠标卡住了一样,我们可以选择关闭它。(LCTT译注,其实我觉得挺有用的,可以避免无意中切换到其他工作桌面,不要关闭)
|
||||
|
||||
在“设置”中选择“外观”选项,可以看到如下画面。
|
||||
|
||||
![Ubuntu 14.04 LTS Appearance and Unity Settings](https://linuxacademy.com/blog/wp-content/uploads/2014/06/unityappearance.png)
|
||||
Ubuntu 14.04 LTS 显示和Unity设置
|
||||
这里我们可以看到对于 Unity 启动器栏被要求最多的选项-能够改变启动器大小的特性。虽然在Ubuntu 11.10及以后的各种版本中可以通过多种方法实现这个特性,但将其放入外观设置中使其显得更加正式。我喜欢它能将启动器图标缩小直至16号的功能(我们接下来所要谈论的工具仅能支持最小调至24号)。
|
||||
|
||||
Ubuntu 14.04 LTS 显示和Unity设置
|
||||
|
||||
这里我们可以看到一个人们最渴望在 Unity 启动器栏中包含的功能-能够改变启动器大小。虽然在Ubuntu 11.10及以后的各种版本中可以通过多种方法实现这个特性,但将其放入外观设置中使其显得更加正式。我喜欢它能将启动器图标缩小直至16的功能(我们接下来所要讲到的工具仅能支持最小调至24)。
|
||||
|
||||
### Unity Tweak Tool-强大! ###
|
||||
|
||||
在Unity首次伴随Ubuntu 11.10发布的几天之内这款工具就跟着出现了,只是你得大费周折去自己把它安装好而且在Unity升级时它可能会损坏。
|
||||
@ -25,21 +33,26 @@ Unity中所特有的一个特性是我们能够打开或者关闭的“粘性边
|
||||
安装好,启动后你将看到如下画面:
|
||||
|
||||
![Ubuntu 14.04 LTS Official Unity Tweak Tool](https://linuxacademy.com/blog/wp-content/uploads/2014/06/unitytweaktool.png)
|
||||
正式的Unity Tweak Tool
|
||||
|
||||
这款工具集中大量的Unity桌面定制项目于一体。这些定制项大多能通过默认的Unity设置,命令行操作或者是编辑有时候很难寻找的配置文件来实现。
|
||||
正式的Unity Tweak Tool
|
||||
|
||||
这款工具它集大量Unity桌面定制项目于一体。这些定制项大多能通过默认的Unity设置,命令行操作或者是即使是编辑有时候也很难寻找到的配置文件来实现。
|
||||
|
||||
我们可以改变启动器栏,网页小程序和面板的行为,可以在Unity菜单中搜索等等。所有的都通过着一个工具来实现。花些时间去挖掘适合你的选项-Unity Tweak Tool-学习它,和它一起生活,爱上它(如果你使用Unity,这是起码的)
|
||||
|
||||
### 结尾的一些想法 ###
|
||||
|
||||
Ubuntu 14.04 LTS 越来越向成为Linux Desktop迈进,(Canonical,对不起,你还是Linux),Linux Desktop不仅可以作为非正式的Linux使用者(的确有这样的事)的选择,也适用于骨灰级linux专家。
|
||||
那现在相比较于不借助工具,公共程序或是进行在随后的更新中可能损坏的配置文件编辑的Unity桌面我们就拥有了更多的控制权,Unity桌面性能强劲可靠,又通过Unity Tweak Tool加入一些风味元素,使得它的外观也酷极了!!!请给我们你的想法或者点击链接发表你对Unity桌面的评论,我们将有兴趣知道你是如何使用Ubuntu 14.04 LTS 的。
|
||||
Ubuntu 14.04 LTS 越来越被人们视作Linux上的典型的Desktop,(对不起,Canonical,你还没有摆脱Linux身份),Linux Desktop不仅可以作为偶尔使用Linux的那些人(的确有这样的事)的选择,也适用于骨灰级linux专家。
|
||||
|
||||
比之前没有工具,功能可以定制,或是通过配置文件修改定制但是有可能被之后个更新所破坏,现在对于Unity桌面我们就拥有了更多的控制权。Unity桌面性能强劲可靠,又通过Unity Tweak Tool加入一些特色元素,使得它的外观也酷极了!!!
|
||||
|
||||
请给我们你的想法或者点击链接发表你对Unity桌面的评论,我们将有兴趣知道你是如何使用Ubuntu 14.04 LTS 的。
|
||||
|
||||
|
||||
----------
|
||||
|
||||
#### Terrence T. Cox ####
|
||||
|
||||
开发者,Linux倡导者,开源爱好者。 进入这个技术领域很久,被认为经验丰富,但从未感到厌倦。
|
||||
[Twitter][1]
|
||||
|
||||
@ -47,7 +60,7 @@ Ubuntu 14.04 LTS 越来越向成为Linux Desktop迈进,(Canonical,对不
|
||||
|
||||
via: https://linuxacademy.com/blog/linux/ubuntu-14-04-lts-customizing-unity/
|
||||
|
||||
译者:[Love-xuan](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[Love-xuan](https://github.com/Love-xuan) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,4 +1,4 @@
|
||||
如何在Ubuntu 14.04中添加多时区时间 [小技巧]
|
||||
[小白技巧]如何在Ubuntu 14.04中添加多个时区时间
|
||||
================================================================================
|
||||
如果你需要和多时区时间打交道的话,你一定希望你的电脑时钟可以显示多个时区的时间。作为一个移居国外的人,我需要关注法国和印度的时间。在Ubuntu系统中,你可以进行简易的设置来添加多时区时间。
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
|
||||
### 在Ubuntu 14.04系统中添加多时区时间 ###
|
||||
|
||||
打开系统设置(按下标有微软徽标的按键,在Dash中搜索“系统设置”),进入”时间&日期“选项。
|
||||
打开系统设置(按下标有微软徽标的按键,在Dash中搜索“系统设置”),进入“时间&日期”选项。
|
||||
|
||||
接下来,进入**时钟**标签页,找到**其他时区时间**选项,然后点击**选择地区**按钮。
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
![multiple timezone displayed in Ubuntu 14.04](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/06/Multiple_Timezones_display_Ubuntu.png)
|
||||
|
||||
好好的感受Ubuntu多时区时钟给你带来的便捷吧。:)
|
||||
体验下Ubuntu多时区时钟给你带来的便捷吧。:)
|
||||
|
||||
----------
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
via: http://itsfoss.com/add-multiple-timezones-ubuntu-1404/
|
||||
|
||||
译者:[JonathanKang](https://github.com/JonathanKang) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[JonathanKang](https://github.com/JonathanKang) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,8 +1,8 @@
|
||||
如何在Linux上检查MySQL的存储引擎类型
|
||||
[小白技巧]如何在Linux上检查MySQL数据表的存储引擎类型
|
||||
================================================================================
|
||||
> **提问**: 我想要知道我的MySQL数据库是MyISAM还是Innodb类型。我该如何检查MySQL数据库表的类型?
|
||||
|
||||
MySQl主要使用两种存储引擎:**MyISAM and Innodb**。MyISAM是非事务的,因此拥有读取更快,然而InnoDB完全支持细颗粒的事务锁定(比如:commit/rollback)。当你创建一张新的MySQL表时,你要选择它的类型(也就是存储引擎)。如果没有选择,你就会使用与预设置的默认引擎。
|
||||
MySQl主要使用两种存储引擎:**MyISAM 和 Innodb**。MyISAM是非事务的,因此拥有读取更快,然而InnoDB完全支持细颗粒度的事务锁定(比如:commit/rollback)。当你创建一张新的MySQL表时,你要选择它的类型(也就是存储引擎)。如果没有选择,你就会使用与预设置的默认引擎。
|
||||
|
||||
如果你想要知道已经存在的MySQL数据表的类型,这里有几种方法达到。
|
||||
|
||||
@ -34,7 +34,7 @@ MySQl主要使用两种存储引擎:**MyISAM and Innodb**。MyISAM是非事务
|
||||
|
||||
via: http://ask.xmodulo.com/check-mysql-storage-engine-type-linux.html
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,11 +1,10 @@
|
||||
如何在linux中创建sosreport(RHEL 5.X / RHEL 6.X)
|
||||
如何用sosreport在Linux上创建诊断信息
|
||||
================================================================================
|
||||
**Sosreport**是linux中的一个命令**RHEL / CentOS**),它会收集**系统配置**和你linux机器上如正在运行的内核版本、加载的模块和系统和服务配置文件之类的诊断信息。这个命令同样可以运行外部的程序来收集更多的信息,并存储这些输出到一个结论文档中。
|
||||
**Sosreport**是**RHEL / CentOS**上的一个命令,它会收集**系统配置**和你linux机器上的诊断信息,如正在运行的内核版本、加载的模块和系统和服务配置文件之类的信息。这个命令同样可以运行外部的程序来收集更多的信息,并存储这些输出到一个结论文档中。
|
||||
|
||||
Sosreport在你需要获得redhat的技术支持时需要它。Redhat的支持工程师会要求你服务器上的sosreport来用于故障排除。
|
||||
|
||||
To run sosreport , **sos** package should be installed. Sos package is part of default installation in most of linux. If for any reason this package is no installed , then use below yum command to install **sos package** :
|
||||
要运行sosreport,需要安装**sos** 包。Sos包是大多是linux的默认安装包中的一部分。如果有任何原因没有安装,那么运行下面的yum命令来安装**sos 包** :
|
||||
要运行sosreport,需要安装**sos** 包。sos包是大多是linux的默认安装包中的一部分。如果因为某种原因没有安装,那么运行下面的yum命令来安装**sos 包** :
|
||||
|
||||
# yum install sos
|
||||
|
||||
@ -15,7 +14,7 @@ To run sosreport , **sos** package should be installed. Sos package is part of d
|
||||
|
||||
# sosreport
|
||||
|
||||
这条命令正常情况下会在**几分钟**里完成。根据本地配置,在某些情况下,某些选项可能需要更长的时间才能完成。一旦完成,sosreport将在**/ tmp目录**目录中生成压缩文件。不同版本使用不同的压缩方案(** gz,bz2,或xz**)。该文件应提供给红帽的支持代表(在开放的情况下通常作为附件)。
|
||||
这条命令正常情况下会在**几分钟**里完成。根据本地配置,在某些情况下,某些选项可能需要更长的时间才能完成。一旦完成,sosreport将在**/ tmp目录**目录中生成一个压缩文件。不同版本使用不同的压缩方案(** gz,bz2,或xz**)。该文件应提供给红帽的支持代表(在开放的情况下通常作为附件)。
|
||||
|
||||
**注意**:sosreport需要root权限才能运行。
|
||||
|
||||
@ -38,6 +37,6 @@ sosreport命令有一个**模块化结构**,并允许用户启用和禁用模
|
||||
|
||||
via: http://www.linuxtechi.com/how-to-create-sosreport-in-linux/
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[geekpi](https://github.com/geekpi) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -1,5 +1,5 @@
|
||||
#命令行星期二-第四部分#
|
||||
--------------------------------------------------------
|
||||
命令行星期二——第四部分
|
||||
===================
|
||||
|
||||
大家好。新的一周,新的冒险!
|
||||
|
||||
@ -10,17 +10,19 @@
|
||||
###通配符###
|
||||
|
||||
使用图形工具区复制、粘贴、新建目录等操作也许很容易,但是若想完成一些更复杂的任务,例如仅仅将一个目录下的所有.html文件复制到另一个目录中、或者只复制在某个目录中不存在的文件,这时命令行也许会比较方便。我们回到通配符的学习中,通配符是shell的基本功能,它是一个由一些特殊字符组成的集合,它让你可以用一些简单的规则来选择出某些文件。(通配符可以出现在文件名中,用于指定文件名的字符个数和字母的大/小写等规则)。
|
||||
如下表(点击放大):
|
||||
|
||||
如下表 :
|
||||
|
||||
![](https://news.opensuse.org/wp-content/uploads/2014/07/Screenshot-08.-07.-2014-125946.png)
|
||||
|
||||
下面是mr Shotts给出的一些实例,如下表:(点击放大)
|
||||
下面是肖茨先生给出的一些实例,如下表:
|
||||
|
||||
![](https://news.opensuse.org/wp-content/uploads/2014/07/Screenshot-08.-07.-2014-125959.png)
|
||||
|
||||
如果你使用一个包含文件名参数的命令,你就可以使用通配符。
|
||||
|
||||
###cp###
|
||||
|
||||
cp是一个用于复制文件或者目录的命令,它的用法相当的简单。进入到你想复制的文件所在的目录,然后使用如下命令
|
||||
|
||||
`cp file1 file2` -复制一个文件
|
||||
@ -29,11 +31,12 @@ cp是一个用于复制文件或者目录的命令,它的用法相当的简单
|
||||
|
||||
`cp file1 file2 ... directory` -从当前工作目录复制多个文件到指定的目录。
|
||||
|
||||
下表是mr Shotts给出的cp命令的一些选项:
|
||||
下表是肖茨先生给出的cp命令的一些选项:
|
||||
|
||||
![](https://news.opensuse.org/wp-content/uploads/2014/07/Screenshot-08.-07.-2014-134248.png)
|
||||
|
||||
###mv###
|
||||
|
||||
mv是今天的第二个命令,我们可以使用mv来重命名一个文件或目录,或者移动一个文件或目录。我们可以这样使用mv命令。
|
||||
|
||||
`mv filename1 filename2` -若想将文件filename1重命名为filename2。
|
||||
@ -47,6 +50,7 @@ mv是今天的第二个命令,我们可以使用mv来重命名一个文件或
|
||||
![](https://news.opensuse.org/wp-content/uploads/2014/07/Screenshot-08.-07.-2014-133515.png)
|
||||
|
||||
###rm###
|
||||
|
||||
rm命令是用于删除文件或目录,它的用法比较直接,如下:
|
||||
|
||||
`rm file`
|
||||
@ -62,6 +66,7 @@ rm命令是用于删除文件或目录,它的用法比较直接,如下:
|
||||
但是,使用rm命令时要小心点。因为并没有撤销删除的选项,因此使用rm命令式要格外的小心,避免对你的系统造成不必要的破坏。
|
||||
|
||||
###mkdir###
|
||||
|
||||
mkdir是用于创建目录.它是今天最简单的一个命令:
|
||||
|
||||
`mkdir directory`
|
||||
@ -73,6 +78,6 @@ mkdir是用于创建目录.它是今天最简单的一个命令:
|
||||
-------------------------------------------------------------------------
|
||||
via: https://news.opensuse.org/2014/07/08/command-line-tuesdays-part-four/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[cvsher](https://github.com/cvsher) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -0,0 +1,34 @@
|
||||
Git 2.0.2版本控制系统现在可供下载使用了
|
||||
==================================================================================================================================================
|
||||
|
||||
![](http://i1-news.softpedia-static.com/images/news2/Git-2-0-2-Version-Control-System-Now-Available-for-Download-451147-2.jpg)
|
||||
|
||||
**Git 2.0.2如今已正式发布。这是一个免费和开源的分布式版本控制系统,因其处理速度和效率的优势,它可以处理大大小小各种项目。**
|
||||
|
||||
新的Git 2.0.x分支保持着带来大量更新的传统,它整合了大量的改变和修正。这个最新的更新只是维护版,但是它的功能特性的确有一些有趣的修改。
|
||||
|
||||
根据开发者的描述:"git submodule sync(git子模块的同步)"的文档中提到的子命令可以使用"--recursive"(递归)的选项;在.gitignore中跟踪引用反斜杠的空格的处理不当已经被纠正;对"git repack"命令的更新,将不再错误地复制那些被.keep标签标记的pack目录下的对象。
|
||||
|
||||
还有,"git clone -b brefs/tags/bar"不再认为git遵循一个单一的tag,尽管它是一个分支的名称;"%G(G后面没有跟任何东西)"是一个无效的漂亮的格式说明符,现在的解析器不再对它进行解析;用于避免增加相同替代对象的存储的代码经过了两次修正,而且其余的几个修正也已经完成。
|
||||
|
||||
想要查看完整的改变列表,查看[changelog][1]。
|
||||
|
||||
下载Git 2.0.2:
|
||||
|
||||
- [tar.gz][1][sources] [4.70 MB]
|
||||
- [Debian/Ubuntu DEB ALL][2][ubuntu_deb] [0 KB]
|
||||
- [Red Hat/Fedora/Mandriva/openSUSE RPM noarch][3][rh_rpm] [0 KB]
|
||||
|
||||
-------------------------------------------------------------------------------------
|
||||
|
||||
via: http://news.softpedia.com/news/Git-2-0-2-Version-Control-System-Now-Available-for-Download-451147.shtml
|
||||
|
||||
译者:[su-kaiyao](https://github.com/su-kaiyao) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:https://github.com/git/git/blob/master/Documentation/RelNotes/2.0.2.txt
|
||||
[2]:https://github.com/git/git/archive/v2.0.2.tar.gz
|
||||
[3]:http://git-scm.com/download/linux
|
||||
[4]:http://git-scm.com/download/linux
|
||||
|
@ -1,7 +1,8 @@
|
||||
来自树莓派的Eben Upton:我们是怎么让大家都成为DIY黑客的。
|
||||
树莓派的联合创始人访谈——我们是怎么让大家都成为DIY黑客的
|
||||
================================================================================
|
||||
> 请记住它是为喜欢折腾的人准备的只要35美元的计算机
|
||||
|
||||
![](http://a2.files.readwrite.com/image/upload/c_fill,h_900,q_70,w_1600/MTIyMjkzMzI3NjMzNjA3OTYx.jpg)
|
||||
我永远不会忘记我第一次看到树莓派的情形。那个小巧的,信用卡大小的计算机,性能却足够强劲,可以作为一般家用PC,媒体中心,电视游戏机,或是其他任何你能够想像的东西。只有35美元的价格,它是任何年龄段的动手爱好者都可以拥有的小东西,可以在上面捣腾硬件和软件试验,而不用担心会弄坏昂贵的家庭电脑。
|
||||
|
||||
[Eben Upton][1],是树莓派基金会的共同创始人,通常被誉为这个神奇机器背后的魔法师。在剑桥大学的计算机实验室攻读哲学博士学位的时候,他费尽苦心地手工打造了树莓派的原型机。
|
||||
@ -14,17 +15,17 @@ ReadWrite网: 一开始是什么让你对技术这么感兴趣?它又是如何
|
||||
|
||||
**Eben Upton**: 在我还是孩子的时候就开始对技术感兴趣了。我有个对工程技术有很大兴趣的父亲,他自己不是工程师,而是一个英语老师。我们的房子里经常到处堆着各种电子器件,在还不知道这些东西是干嘛的时候,我就开始摆弄了。都是些小玩意,比如在床头装个灯,在“关灯”后还可以继续看书之类的。
|
||||
|
||||
![](http://readwrite.com/files/raspberry%20pi%20black-and-white%20flickr%20johan%20larsson.jpg)
|
||||
![](http://a5.files.readwrite.com/image/upload/c_fit,q_80,w_630/MTIyMzAxOTQxOTk1ODI2NDU3.jpg)
|
||||
|
||||
之后我有了一台计算机。在英国,我们把这种机器叫做[BBC微计算机][2],实际上是8位单片机,做教学用的。我们在学校的时候接触到这种机器,我之后就学会了编程,而且还蛮喜欢的。
|
||||
|
||||
这些机器在学校里并不一定是用来编程的,或者说他们根本不是用来编程的,一般都运行教学软件。但是我却给它编程,之后我还买了一台回家,在我买了这台BBC微机后,我就泡在了房间里,再没出来过。[笑]
|
||||
|
||||
编程对于小孩来说太神奇了。当你还是小孩的时候,并没有太多力量。没有听话的随从,反而身边有很多的限制。编程最伟大的地方在于,这是一个可以让你随喜所欲的小世界。而这当然让我无法抗拒。
|
||||
编程对于小孩来说太神奇了。当你还是小孩的时候,并没有太多力量。没有听话的随从,反而身边有很多的限制。编程最伟大的地方在于,这是一个可以让你随心所欲的小世界。而这当然让我无法抗拒。
|
||||
|
||||
我一直都对科学和数学,以及硬科学学科感兴趣。我在我的BBC微机上做了大量的计算和编程,之后我拥有了一台Commodore Amiga。
|
||||
我一直都对科学和数学,以及理科感兴趣。我在我的BBC微机上做了大量的计算和编程,之后我拥有了一台Commodore Amiga。
|
||||
|
||||
在大学里我学习了物理,工程和计算机科学。这是激发树莓派项目想法的原因,因为当我在学校呆了10年的时候[当时在读博士学位],我发现那些新来的孩子们在他们小时候并没有机会获得这方面的经验。你也许仍然能拥有乐高玩具,但是问题是梯子。
|
||||
在大学里我学习了物理,工程和计算机科学。这是激发树莓派项目想法的原因,因为当我在学校呆了10年的时候[当时在读博士学位],我发现那些新来的孩子们在他们小时候并没有机会获得这方面的经验。你也许仍然能拥有乐高玩具,但是它不是我们要的梯子。
|
||||
|
||||
在一定程度上我们把身后的梯子撤掉了。我们造出了这些非常复杂而且用户友好的计算机给小孩使用,或者不仅仅是计算机,还包括电视游戏机,电话和平板,以及一些家用电器。但是,人们却没有机会自己动手改一改。所以实际上,树莓派是回到最初的一种尝试,当然也不会过于原始,希望找到在过去25年里计算机发展中迷失掉的那种感觉。
|
||||
|
||||
@ -34,7 +35,7 @@ ReadWrite网: 一开始是什么让你对技术这么感兴趣?它又是如何
|
||||
|
||||
另外一件麻烦事是募集资金。我们是非营利组织,所以我们得去找人赞助,而这最后都变成了董事会中的几个人自掏腰包。我们有25万美元的启动资金是从我和其他几个成员自己借的。所以我觉得,当初这样做还挺有勇气。
|
||||
|
||||
![](http://readwrite.com/files/raspberry%20pi%20flickr%20clive%20darra.jpg)
|
||||
![](http://a4.files.readwrite.com/image/upload/c_fit,q_80,w_960/MTIyMzAxOTQzODc0ODgwMTAy.jpg)
|
||||
|
||||
### 从东方到西方 ###
|
||||
|
||||
@ -62,7 +63,7 @@ ReadWrite网: 一开始是什么让你对技术这么感兴趣?它又是如何
|
||||
|
||||
**EU:** 我们尝试过基于所谓的微控制器技术做了几台机器。不知道你有没有听过一个叫Arduino的[开源电子原型]平台?它们的性能跟Arduino是一个级别的,优点是很容易买到,是常用的元器件,非常便宜,也很容易掌握。
|
||||
|
||||
![](http://readwrite.com/files/raspberry%20pi%20pibow%20flickr%20peet%20sneekes.jpg)
|
||||
![](http://a2.files.readwrite.com/image/upload/c_fit,q_80,w_630/MTIyMzAxOTQ1NzU0MDUzOTEz.jpg)
|
||||
|
||||
所以我们试了一下。最后的成品只能从技术上来说还是计算机,你可以把它接到电视机或其他显示设备上。但是,它太原始了,很明显不能吸引孩子们的兴趣。这个是一号原型机,它在爱尔兰一家博物馆的叫“失败”的展览中展出[笑]。我下个月会去看看。它现在被装载一个玻璃盒子里,作为一次辉煌失败的典型。
|
||||
|
||||
@ -76,13 +77,13 @@ ReadWrite网: 一开始是什么让你对技术这么感兴趣?它又是如何
|
||||
|
||||
真正的突破是三号原型机。我们从Broadcom拿到了另一种应用了ARM处理器的芯片,可以直接运行标准Linux。我们意识到终于可以做出能够满足所有的需求的机器了,这就是我们推向市场的产品。
|
||||
|
||||
### 黑黑下一代黑客 ###
|
||||
### 黑一黑下一代黑客 ###
|
||||
|
||||
**RW:** 八岁的孩子就开始用树莓派做项目了。这在你意料中吗,还是说让你意外了?
|
||||
|
||||
**EU:** 八岁是很好的年纪。我想每个人都会把自己开始编程的年龄定义成合适的年龄。我就是八岁开始编程的。某种程度上来说,孩子们所需要的只是年龄大到拥有相对完整的认知技能,或者说是解决问题的技能。也许在学校学一点数学就够了。
|
||||
|
||||
![](http://readwrite.com/files/raspberry%20pi%20lego%20flickr%20luca%20sbardella.jpg)
|
||||
![](http://a2.files.readwrite.com/image/upload/c_fit,q_80,w_630/MTIyMzAxOTQ3MzY0NTQxMDMw.jpg)
|
||||
|
||||
年龄大到可以计划任务,编程就是终极的计划任务。还是得有一定的智力基础去做这个事情。八岁的时候,大多数孩子在自己的思维上已经非常成熟了。另外还需要敏捷的身手,对更小的孩子来说还存在一个问题就是,他们还不够灵巧去使用键盘。
|
||||
|
||||
@ -118,9 +119,9 @@ ReadWrite网: 一开始是什么让你对技术这么感兴趣?它又是如何
|
||||
|
||||
**RW:** 你怎么看现在出现的主流硬件黑客文化?
|
||||
|
||||
**EU:** 我觉得,这太美妙了,不是吗?这是在软件工程领域里完全无法想到的。我接触这些之前就有软件背景,所以,实际上人们用树莓派制作的多数很酷的东西都是硬件相关的,让我很惊讶。当然现在没那么吃惊了,不过一开始是有的。
|
||||
**EU:** 我觉得,这太美妙了,不是吗?这是在软件工程领域里完全无法想到的。我接触这些之前就有软件背景,所以,实际上人们用树莓派制作的大多数很酷的东西都是硬件相关的,让我很惊讶。当然现在没那么吃惊了,不过一开始是有的。
|
||||
|
||||
![](http://readwrite.com/files/raspberry%20pi%20robot%20flickr%20ashley%20basil.jpg)
|
||||
![](http://a3.files.readwrite.com/image/upload/c_fit,q_80,w_630/MTIyMzAxOTQ5NTEyMDI0Njc4.jpg)
|
||||
|
||||
我认为这是非常积极的趋势,基于所有这些因素。因为它给孩子们带来了相关的经验。在我看来,在屏幕上移动一下像素还是很酷的,不过事实上,它没有像80年代那样酷了。我觉得,在现实世界里移动一些物体,比如机器人,对于现在的孩子来说是非常酷的。
|
||||
|
||||
@ -152,11 +153,11 @@ ReadWrite网: 一开始是什么让你对技术这么感兴趣?它又是如何
|
||||
|
||||
显然,我们同时也必须做一点[硬件方面]的事情。我真的不知道具体在什么时候。如果到了2017,2018,我们还在销售树莓派B型的话,那也挺糟糕的。但是,我认为我们也许在一年后再认真考虑后面要做什么。
|
||||
|
||||
**RW:** 很多人的项目同时用到了派和Arduino,一个DIY电子调试工具套件。你在设计派的时候,有考虑类似Arduino的工具吗?
|
||||
**RW:** 很多人的项目同时用到了派和Arduino(一个DIY电子调试工具套件)。你在设计派的时候,有考虑类似Arduino的工具吗?
|
||||
|
||||
**EU:** 实际上没有,但是我们很早就意识到,媒体可能会倾向于把我们和Arduino看作竞争者。对于这件事情我们有点多疑,我觉得,因为我认为派和Arduino分别处理不同的事情,而且他们都做得很好。
|
||||
|
||||
我们并没有把它设计成配合Arduino工作,但是Arduino被设计成配合家用PC一起工作。所以,我们为Arduino制作了一台非常低功耗的家用PC。所以好吧,只是巧合,我猜。
|
||||
我们并没有把它设计成配合Arduino工作,但是Arduino被设计成配合家用PC一起工作。所以,我们实际上为Arduino制作了一台非常低功耗的家用PC。所以好吧,只是巧合,我猜。
|
||||
|
||||
**RW:** 你在家里用树莓派做什么?工作中呢?
|
||||
|
||||
@ -169,13 +170,14 @@ ReadWrite网: 一开始是什么让你对技术这么感兴趣?它又是如何
|
||||
不过,看到这么多的人喜欢它,看到它被出现在各种不同的地方,也是很开心的。我听说在《生活大爆炸》中提到了我们,我要去找找是哪一集。它出现在所有的这些不可思议的地方。真是非常开心,看到这么多人把它放在心上,开始用它做点事情。
|
||||
|
||||
承蒙树莓派基金会提供Eben Upton的图片;
|
||||
|
||||
树莓派图片来自Flickr用户:[Johan Larsson][5], [Clive Darra][6], [Pete Sneekes][7], [Luca Sbardella][8]和[Ashley Basil][9]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://readwrite.com/2014/04/08/raspberry-pi-eben-upton-builders#awesm=~oBGnazhOCOfaUd
|
||||
via: http://readwrite.com/2014/04/08/raspberry-pi-eben-upton-builders
|
||||
|
||||
译者:[zpl1025](https://github.com/zpl1025) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[zpl1025](https://github.com/zpl1025) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,32 +0,0 @@
|
||||
Git 2.0.2 Version Control System Now Available for Download
|
||||
================================================================================
|
||||
![](http://i1-news.softpedia-static.com/images/news2/Git-2-0-2-Version-Control-System-Now-Available-for-Download-451147-2.jpg)
|
||||
|
||||
**Git 2.0.2, a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency, has been officially released.**
|
||||
|
||||
The new Git 2.0.x branch continues the trend of large releases, integrating a big number of changes and fixes. This latest update may be just a maintenance one, but it does feature some interesting modifications.
|
||||
|
||||
According to the developers, the documentation for the "git submodule sync" mentions that the subcommand can take the "--recursive" option, the mishandling of patterns in .gitignore that had trailing SPs quoted with backslashes has been corrected, and the Recent updates to "git repack" no longer duplicate objects that are in the packfiles marked with .keep flag by mistake.
|
||||
|
||||
Also, "git clone -b brefs/tags/bar" no longer thinks that git follows a single tag, even though it was a name of the branch, "%G" (nothing after G) is an invalid pretty format specifier and now the parser knows that it's garbage, the code used to avoid adding the same alternate object store twice has been fixed, and a couple of other fixes have been implemented.
|
||||
|
||||
For a complete list of changes, check out the [changelog][1].
|
||||
|
||||
Download Git 2.0.2:
|
||||
|
||||
- [tar.gz][1][sources] [4.70 MB]
|
||||
- [Debian/Ubuntu DEB ALL][2][ubuntu_deb] [0 KB]
|
||||
- [Red Hat/Fedora/Mandriva/openSUSE RPM noarch][3][rh_rpm] [0 KB]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://news.softpedia.com/news/Git-2-0-2-Version-Control-System-Now-Available-for-Download-451147.shtml
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:https://github.com/git/git/blob/master/Documentation/RelNotes/2.0.2.txt
|
||||
[2]:https://github.com/git/git/archive/v2.0.2.tar.gz
|
||||
[3]:http://git-scm.com/download/linux
|
||||
[4]:http://git-scm.com/download/linux
|
@ -0,0 +1,42 @@
|
||||
Budgie Desktop 5.1 Is a Superb New Desktop Environment for Conservative Users
|
||||
================================================================================
|
||||
![](http://i1-news.softpedia-static.com/images/news2/Budgie-Desktop-5-1-Is-a-Superb-New-Desktop-Environment-For-Conservative-Users-451477-2.jpg)
|
||||
|
||||
**The developer of Evolve OS, Ikey Doherty, has made a new desktop environment called Budgie Desktop and released a new version of it.**
|
||||
|
||||
Evolve OS hasn't been launched yet, but the developer is actively working on it. Instead of adopting an existing desktop environment, he decided that it would be better to make his own. It's based on GNOME and uses quite a few GNOME packages, but it looks very different. In fact, it follows the same paradigm as MATE and Cinnamon, although Budgie seems to be a little more modern and polished.
|
||||
|
||||
It's quite interesting to see that a critical piece of technology is released before the operating system that it's going to serve, but potential users don't have to be completely taken by surprise. To that effect, a [PPA][1] has been put in place for Ubuntu 14.04 LTS and Ubuntu 14.10, although it's not official. Also, the Arch Linux users will find the new desktop environment in the AUR repository.
|
||||
|
||||
“Almost all of the changes since v4 have been related to the panel. It’s been completely rewritten in Vala, lowering the maintenance overhead and significantly reducing the barrier of entry for new contributors. So, when your update comes through later on (hopefully) today through OBS if you use it, or for Evolve OS users you already have the update, you should only see minor visual differences. The idea was not to change the look, but to rewrite what was there and make it moar better.”
|
||||
|
||||
“The rewrite into Vala took quite some effort, but has immediately paid off. In the future all of the desktop will be rewritten to use Vala, and being the ‘second write’ – we do things better the second time around,” says Ikey Doherty in the release [announcement][2].
|
||||
|
||||
Even if the desktop environment looks pretty advanced, judging by the version number, there is still room for improvements. The developer has promised that the next release in the series, 6.x, will allow users to write plugins in any language supported by libpeas, and that includes C, Vala, JavaScript, and Python.
|
||||
|
||||
Users will also notice that some of the main elements from Budgie Desktop have remained in place, like the position of the menu and the size of the icons. In the future, it will be possible to change them, but for now, users need to contend with what's available.
|
||||
|
||||
Even in this incipient phase, Budgie Desktop 5.1 looks better than many of the alternatives that can be found right now on other OSes.
|
||||
|
||||
Download the source package right now for Ubuntu and Arch Linux:
|
||||
|
||||
- [GIT sources][3][sources] [0 KB]
|
||||
- [Ubuntu 14.04 PPA Repository][4][ubuntu_deb] [0 KB]
|
||||
- [Arch Linux binary][5][binary] [0 KB]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://news.softpedia.com/news/Budgie-Desktop-5-1-Is-a-Superb-New-Desktop-Environment-For-Conservative-Users-451477.shtml
|
||||
|
||||
原文作者:[Silviu Stahie][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://news.softpedia.com/editors/browse/silviu-stahie
|
||||
[1]:https://launchpad.net/~sukso96100/+archive/ubuntu/budgie-desktop
|
||||
[2]:https://evolve-os.com/2014/07/20/budgie-desktop-v5-1-released/
|
||||
[3]:https://github.com/evolve-os/budgie-desktop/
|
||||
[4]:https://launchpad.net/~sukso96100/+archive/ubuntu/budgie-desktop?field.series_filter=trusty
|
||||
[5]:https://aur.archlinux.org/packages/budgie-desktop-git
|
@ -0,0 +1,59 @@
|
||||
The Native Dropbox Linux Client Debuts New Qt Interface
|
||||
================================================================================
|
||||
**The latest experimental build of the native Dropbox Linux client has debuted with an all new Qt interface.**
|
||||
|
||||
Dropbox say that the UI rewrite, which will be used on both Windows and Linux, will fix a ‘large number’ of long-standing bugs, issues and glitches. The cross-platform toolkit is also set to improve general performance.
|
||||
|
||||
Alongside an all new setup wizard and login screen (see below) is a handful of redesigned splash screens.
|
||||
|
||||
![Login Screen ](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/dropbox-qt-login.jpg)
|
||||
Login Screen
|
||||
|
||||
![Setup Screen](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/dropbox-qt-set-up.jpg)
|
||||
Setup Screen
|
||||
|
||||
![Congratulations Screen ](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/dropbox-qt-finished.jpg)
|
||||
Congratulations Screen
|
||||
|
||||
### Not Stable Yet ###
|
||||
|
||||
Dropbox developers caution that since much of the new interface “is still rough around the edges” testers should expect to encounter various visual bugs while using it. The new UI does not yet work with accessibility tools like screen readers.
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/dropbox-linux-clients-old-and-new.jpg)
|
||||
|
||||
The new UI uses (for now) the stock Qt theme. This isn’t ugly per se, but it does look a little out of place on the Ubuntu desktop, especially compared to previous builds. Memory usage is also reportedly higher, in some cases jumping from 60MB when idle to more than 178MB. Those on low-end devices should resist the temptation to try this build — at least until this particular bug has been addressed.
|
||||
|
||||
Full change log for Dropbox 2.11.0 (Experimental) for Linux:
|
||||
|
||||
- Rewrite of the Windows & Linux UI in Qt
|
||||
- File identifiers detect when files have been moved/renamed
|
||||
- New setup/login experience
|
||||
- Faster uploads for small files
|
||||
- New splash screens
|
||||
|
||||
### Download Dropbox Linux Build 2.11.x ###
|
||||
|
||||
To try the experimental builds just download the correct archive for your system using the links below.
|
||||
|
||||
- [Dropbox Experimental (64bit) Offline Linux Installer][1]
|
||||
- [Dropbox Experimental (32bit) Offline Linux Installer][2]
|
||||
|
||||
Once downloaded, extract the archive to your Home folder. It’s hidden by default, so using the Terminal, ‘`cd`‘ into the ‘`.dropbox-dist/dropbox-lnx`‘ folder and run ‘`./dropbox start`‘.
|
||||
|
||||
Dropbox terminal navigation gif:
|
||||
|
||||
![](http://i.imgur.com/5TeYXEm.gif)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/07/dropbox-experimental-linux-build-qt-rewrite
|
||||
|
||||
原文作者:[Joey-Elijah Sneddon][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:https://d1ilhw0800yew8.cloudfront.net/client/dropbox-lnx.x86_64-2.11.0.tar.gz
|
||||
[2]:https://d1ilhw0800yew8.cloudfront.net/client/dropbox-lnx.x86-2.11.0.tar.gz
|
@ -1,59 +0,0 @@
|
||||
zpl1025
|
||||
Joy of Programming: Fail Fast!
|
||||
================================================================================
|
||||
![](http://www.opensourceforu.com/wp-content/uploads/2011/12/fail-350x262.jpg)
|
||||
|
||||
> When a problem occurs in the software, it should fail immediately, in an easily noticeable way. This “fail fast” behaviour is desirable, and we’ll discuss this important concept in this column.
|
||||
|
||||
At first, a “fail fast” might appear to be a bad practice affecting reliability — why should a system crash (or fail), when it can continue execution? For this, we need to understand that fail fast is very relevant in the context of Heisenbugs.
|
||||
|
||||
Consider Bohrbugs, which always crash for a given input, for example, with a null-pointer access. These bugs are easier to test, reproduce and fix. Now, all experienced programmers would have faced situations where the bug that caused the crash just disappears when the software is restarted. No matter how much time and effort is spent to reproduce the problem, the bug eludes us. These bugs are known as Heisenbugs.
|
||||
|
||||
The effort required to find, fix and test Heisenbugs is an order of magnitude more than the effort required for Bohrbugs. One strategy to avoid Heisenbugs is to turn them into Bohrbugs. How? By anticipating the possible cases in which Heisenbugs can arise, and trying to make them Bohrbugs. Yes, it is not easy, and it is also not always possible, but let us look at a specific example where it is useful.
|
||||
|
||||
Concurrent programming is one paradigm where Heisenbugs are common. Our example is a concurrency-related issue in Java. While iterating over a Java collection, we are supposed to modify the collection only through the Iterator methods, such as the remove() method. During iteration, if another thread attempts to modify that underlying collection (because of a programming mistake), the underlying collection will get corrupted (i.e., result in an incorrect state).
|
||||
|
||||
Such an incorrect state can lead to an eventual failure — or if we are fortunate (actually, unfortunate!), the program continues execution without crashing, but gives the wrong results. It is difficult to reproduce and fix these bugs, because such programming mistakes are non-deterministic. In other words, it is a Heisenbug.
|
||||
|
||||
Fortunately, the Java Iterators try to detect such concurrent modifications, and if found, will throw a `ConcurrentModificationException`, instead of failing late — and that too, silently. In other words, the Java Iterators follow the “fail fast” approach.
|
||||
|
||||
What if a `ConcurrentModificationException` is observed in production software? As the Javadoc for this exception observes, it “
should be used only to detect bugs.” In other words, `ConcurrentModificationExceptions` are supposed to be found and fixed during software development, and should not leak to production code.
|
||||
|
||||
Well, if production software does get this exception, it is certainly a bug in the software, and should be reported to the developer and fixed. At least, we know that there was an attempt for concurrent modification of the underlying data structure, and that’s why the software failed (instead of getting wrong results from the software, or failing later with some other symptoms, for which it is not feasible to trace the root cause).
|
||||
|
||||
The “fail-safe” approach is meant for developing robust code. A very good example of writing fail-safe code is using assertions. Unfortunately, there is a lot of unnecessary controversy surrounding the use of asserts. The main criticism is this: the checks are enabled in the development version, and disabled in release versions.
|
||||
|
||||
However, this criticism is wrong: asserts are never meant to replace the defensive checks that should be put in place in the release version of the software. For example, asserts should not be used to check if the argument passed to a function is null or not. Instead, an if condition should be used to check if the argument is passed correctly, or else an exception, or a premature return, should be performed, as appropriate to the context. However, asserts can be used to do additional checks for assumptions that are made in the code, which are supposed to hold true. For example, a condition that checks that the stack is not empty after a push operation is performed on it (i.e., checking for “invariants”).
|
||||
|
||||
So, fail fast, be assertive, and you’re on the way to developing more robust code.
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via:http://www.opensourceforu.com/2011/12/joy-of-programming-fail-fast/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:
|
||||
[2]:
|
||||
[3]:
|
||||
[4]:
|
||||
[5]:
|
||||
[6]:
|
||||
[7]:
|
||||
[8]:
|
||||
[9]:
|
||||
[10]:
|
||||
[11]:
|
||||
[12]:
|
||||
[13]:
|
||||
[14]:
|
||||
[15]:
|
||||
[16]:
|
||||
[17]:
|
||||
[18]:
|
||||
[19]:
|
||||
[20]:
|
@ -0,0 +1,50 @@
|
||||
Linux System Administration Skills are Changing
|
||||
================================================================================
|
||||
When was the last time you compiled a kernel? For many of the latest generation of Linux admins, the answer is really simple: never. I am one of those, provided we don't count a few times I tried it just for fun, then couldn't see why I would need a custom kernel and went back to my out-of-the-box kernel.
|
||||
|
||||
For many of the longer-time Linux admins and engineers this may seem laughable, but it is a reality: As Linux adoption grows in the enterprise, a new generation of Linux admins is created that has extremely good technical skills, but lacks these 'simple' low level skills seen by many as fundamental to being a good Linux admin. We can build a high performance, highly available web infrastructure that uses the latest of the latest techniques, but don't ask us to fix a non-booting Linux machine: our advice will be to ditch it and set up a new vm.
|
||||
|
||||
Over the past decade or so, we have seen some interesting trends. Linux became a commodity in the enterprise, and as that happened the various distributions became powerful yet flexible enough to remove the need for the average admin to ever have to do low level things like compiling a kernel.
|
||||
|
||||
Next, we welcomed virtual machine technology as a commodity, which added another layer of abstraction. Users of clouds like amazon or VPS providers will possibly never have to deal with deploying Linux on bare metal. As hybrid and private clouds are becoming common as well, many enterprise admins will also not have to deal with this kind of thing anymore, they will just log into a web interface and spin up 5 more apache vm's.
|
||||
|
||||
The newest two trends add even more abstraction: configuration management and the seemingly brand new (yet not new at all) containerization with tools like docker. Whenever a client asks us at [OlinData][1] to configure a Linux machine, our first action will be to set up [Puppet][2]. With our trusted library of well-functioning Puppet modules, that is very easy and will cost me less time then doing this manually.
|
||||
|
||||
For example with Puppet, I can install Apache on a new machine as simple as this:
|
||||
|
||||
node 'web01.olindata.com' {
|
||||
include apache
|
||||
apache::vhost{ 'www.olindata.com':
|
||||
docroot => '/var/www/olindata'
|
||||
}
|
||||
}
|
||||
|
||||
Depending on the environment, I don't even have to log into the machine anymore. Deploying this code through Continuous Deployment tools like [Jenkins][3] will allow me to deploy my infrastructure code automatically as it passes the tests I set up.
|
||||
|
||||
### SysAdmin skills move up the stack ###
|
||||
|
||||
Even as we move toward higher levels of abstraction, ongoing Linux training is still highly valuable and desirable for admins today and will be well into the future. Knowing the fundamentals is key but as abstraction removes some of the old tasks, this requires sysadmins to move up further in the stack and enhance their skills in the higher level tools and practices. It is critical for a sysadmin to become familiar with the tools that enable these higher levels of abstraction. It pushes them to become more skilled in things like coding so that they can do more with these "new" tools.
|
||||
|
||||
Will the need for low(er) level linux skills ever go away completely? Of course not. We still have many other uses for Linux then just the commodity server deployments. Also, people will still benefit hugely from knowing how to do lower level operations in their everyday work. On top of that, with demonstrable Linux skills on your resume, I (and many other employers with me) will always prefer you over candidates that don't have them. You never know when you need those low-level skills!
|
||||
|
||||
|
||||
----------
|
||||
![Walter Heck is CEO and Founder of Olindata, an open source training and consulting company based in The Netherlands.](http://www.linux.com/images/stories/41373/Walter-Heck.jpg)
|
||||
|
||||
Walter Heck is CEO and Founder of OlinData, an authorized Linux Foundation training partner. Here's a list of [scheduled official Linux Foundation courses by OlinData][4].
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linux.com/news/enterprise/systems-management/780956-linux-system-administration-skills-are-changing
|
||||
|
||||
原文作者:[Walter Heck][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linux.com/community/forums/person/59207
|
||||
[1]:http://olindata.com/
|
||||
[2]:http://puppetlabs.com/
|
||||
[3]:http://jenkins.org/
|
||||
[4]:http://www.olindata.com/training/upcoming?technology=295
|
@ -1,78 +0,0 @@
|
||||
The history of Android
|
||||
================================================================================
|
||||
![Left: the Milestone 5 home screen showing the “all" button, two dock icons, and four recent apps. Center: the home screen with the app list open. Right: the power menu.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/homescree052n.jpg)
|
||||
Left: the Milestone 5 home screen showing the “all" button, two dock icons, and four recent apps. Center: the home screen with the app list open. Right: the power menu.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
### Android 0.5, Milestone 5—the land of scrapped interfaces ###
|
||||
|
||||
The first major Android change came three months after the first emulator release: the "m5-rc14" build. Released in February 2008, “Milestone 5" dumped the stretched-out BlackBerry interface and went with a totally revamped design—Google's first attempt at a finger-friendly interface.
|
||||
|
||||
This build was still identified as "Android 0.5" in the browser user agent string, but Milestone 5 couldn't be more different from the first release of Android. Several core Android features can directly trace their lineage back to this version. The layout and functionality of the notification panel was almost ready to ship, and, other than a style change, the menu was present in its final form, too. Android 1.0 was only eight months away from shipping, and the basics of an OS were starting to form.
|
||||
|
||||
One thing that was definitely not in its final form was the home screen. It was an unconfigurable, single-screen wallpaper with an app drawer and dock. App icons were bubbly, three-color affairs, surrounded by a square, white background with rounded corners. The app drawer consisted of an "All" button in the lower-right corner, and tapping on it expanded the list of apps out to the left. Above the "All" button was a two icon dock where "Contacts" and "Dialer" were given permanent home screen real estate. The four blocks above that were an early version of Recent Apps, showing the last apps accessed. With no left or right screens and a whole column taken up by the dock and recent apps, this layout only allowed for 21 app squares before the screen would be filled. The emulator still only sported the bare-minimum app selection, but in an actual device, this design didn't appear like it would work well.
|
||||
|
||||
Holding down the "end call" button brought up a super early version of the power menu, which you can see in the rightmost picture. Google didn't have the normal smartphone nomenclature down yet: "Turn Off Screen" would best be described as "Lock screen" (although there was no lock screen) and "Turn Off Radio" would be called "Airplane mode" today.
|
||||
|
||||
![From left to right: the surprisingly modern notification panel, the menu open in Google Maps (Maps doesn't work anymore), and the new finger-friendly list view.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/noti2.png)
|
||||
From left to right: the surprisingly modern notification panel, the menu open in Google Maps (Maps doesn't work anymore), and the new finger-friendly list view.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
All the way back in Milestone 5, Google had the basics of the notification panel nailed down. It pulled down from the top of the screen just like it does on any modern smartphone. Current notifications displayed in a list. The first version of the notification panel was an opaque white sheet with a ribbed “handle" on the bottom and an orange dot in the center. Notifications were pressable, opening the appropriate app for that notification. No one bothered to vertically align the app icons in this list, but that's OK. This was gone in the next update.
|
||||
|
||||
Sticky notifications went into an "ongoing" section at the top of the panel. In this build, that seemed to only include phone calls. The "Latest Event" notifications were clearable only after opening the appropriate app. Users surprisingly managed to sign in to Google Talk over the built-in XMPP connection. But while the notification panel displayed "new chat message," there wasn't actually an instant messaging app.
|
||||
|
||||
The artwork in Milestone 5 was all new. The app icons were redrawn, and the menu switched from a boring BlackBerry-style text list to full-color, cartoony icons on a large grid. The notification panel icons switched from simple, sharp, white icons to a bubbly green design. There was now a strange black line under the signal bar indicator with no apparent purpose. The tiny list view from earlier builds really wasn't usable with a finger, so Milestone 5 came with an overall beefier layout.
|
||||
|
||||
![The dialer, recent calls, and an incoming call.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/phonestuff.png)
|
||||
The dialer, recent calls, and an incoming call.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
M5 was the first build to have a dialer, albeit a fairly ugly one. Numbers were displayed in a gradient-filled bar containing a bizarre speech-bubble-styled backspace button that looked like it was recycled from some other interface. Alignment issues were everywhere. The numbers on the buttons weren't vertically aligned correctly, and the “X" in the backspace button wasn’t aligned with the speech bubble. You couldn't even start a call from the dialer—with no on-screen “dial" button, a hardware button was mandatory.
|
||||
|
||||
Milestone 5 had a few tabbed interfaces, all of which demonstrated an extremely odd idea of how tabs should work. The active tab was white, and the background tabs were black with a tiny strip of white at the bottom. Were background tabs supposed to "shrink" downward? There was no animation when switching tabs. It wasn't clear what the design tried to communicate.
|
||||
|
||||
Recent Calls, shown in the second picture, was downgraded from a top-tier app to a tab on the dialer. It ditched the crazy crosshair UI from earlier builds and, thanks to the chunkier list view, now displayed all the necessary information in a normal list.
|
||||
|
||||
Unlike the dialer, the incoming call screen had on-screen buttons for answering and ending a call. Bizarrely, the incoming call screen was stuck to the bottom of the display, rather than the top or center. It was possibly left over from the old 4:3 BlackBerry screens.
|
||||
|
||||
![An active call, the disabled touchscreen error message, and the call screen with a second call on hold.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/callsstuff.png)
|
||||
An active call, the disabled touchscreen error message, and the call screen with a second call on hold.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
The in-call interface looked normal but made zero sense in practice. Today, to stop your face from pressing buttons while on a call, phones have proximity sensors that turn the screen off when the sensor detects something. Milestone 5 didn’t support proximity sensors, though. Google’s haphazard solution was to disable the entire touch screen during a call. At the same time, the in-call screen was clearly overhauled for touch. There were big, finger-friendly buttons; *you just couldn't touch anything*.
|
||||
|
||||
M5 featured a few regressions here from the old Milestone 3 build. Many decent-looking icons from the old interface were replaced with text. Buttons like "mute" no longer offered on-screen feedback that they were active. Merging calls was cut completely.
|
||||
|
||||
![The browser’s primary menu, the browser’s secondary menu, the crazy zoom control, and the window interface.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/browser4.png)
|
||||
The browser’s primary menu, the browser’s secondary menu, the crazy zoom control, and the window interface.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
The browser menu got the usual touch overhaul, and for the first time a "more" button appeared. It functioned as an [extra menu for your menu][1]. Rather than turning the 3x2 grid into a 3x4 grid, Milestone 5 (and many successive versions of Android) used a long, scrolling list for the additional options. Pinch zoom wasn't supported (supposedly a [concession to Apple][2]), so Android went with the ridiculous looking zoom control in the third picture above. Rather than something sensible like a horizontal, bottom-aligned zoom control, Google stuck it smack in the middle of the screen. The last picture shows the Browser’s "window" interface, which allowed you to open multiple webpages and semi-easily switch between them.
|
||||
|
||||
![Google Maps’ layers section screen, search interface, and directions screen.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/amps.png)
|
||||
Google Maps’ layers section screen, search interface, and directions screen.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
Google Maps still didn't work, but the little UI we accessed saw significant updates. You could pick map layers, although there were only two to choose from: Satellite and Traffic. The top-aligned search interface strangely hid the status bar, while the bottom-aligned directions didn't hide the status bar. Direction's enter button was labeled with "Go," and Search's enter button was labeled with a weird curvy arrow. The list goes on and demonstrates old school Android at its worst: two functions in the same app that should look and work similarly, but these were implemented as complete opposites.
|
||||
|
||||
----------
|
||||
|
||||
![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/2/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://i.imgur.com/GIYGTnb.jpg
|
||||
[2]:http://www.businessinsider.com/steve-jobs-on-android-founder-andy-rubin-big-arrogant-f-2013-11
|
||||
[a]:http://arstechnica.com/author/ronamadeo
|
||||
[t]:https://twitter.com/RonAmadeo
|
@ -1,3 +1,4 @@
|
||||
zpl1025
|
||||
Super Pi Brothers
|
||||
================================================================================
|
||||
I don't game as much as I used to. Although I've certainly spent countless hours of my life in front of a Nintendo, SNES, or after that, playing a first-person shooter on my computer (Linux only, thank you), these days, my free time tends to go toward one of the many nongaming hobbies I've accumulated. Recently though, I found myself dusting off my Wii console just so I could play an NES and SNES game I re-purchased for it. The thing is, those games require using a somewhat strange controller, and I already have a modified SNES controller that can connect over USB. That was enough to encourage me to search for a better solution. Of course, I simply could connect three or four consoles and stack up games in my living room, but I've grown accustomed to ripping my CDs and DVDs and picking what I want to listen to or watch from a central media center. It would be nice if I didn't have to get up and find a cartridge every time I wanted to switch games. This, of course, means going with emulation, but although in the past I'd had success with a modified classic Xbox, I didn't have that hardware anymore. I figured someone must have gotten this set up on the Raspberry Pi, and sure enough, after a brief search and a few commands, I had a perfect retro-gaming arcade set up on a spare Raspberry Pi.
|
||||
@ -67,4 +68,4 @@ via: http://www.linuxjournal.com/content/super-pi-brothers
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://blog.petrockblock.com/retropie
|
||||
[2]:https://github.com/petrockblog/RetroPie-Setup
|
||||
[2]:https://github.com/petrockblog/RetroPie-Setup
|
||||
|
@ -1,59 +0,0 @@
|
||||
Love-xuan 翻译中
|
||||
How to Install Lightweight Budgie Desktop in Ubuntu 14.04
|
||||
================================================================================
|
||||
**If you follow us over on Twitter you may have caught a glimpse of a screenshot we shared recently, along with the invitation to name the desktop environment pictured. **
|
||||
|
||||
Did you guess correctly? The answer is [Budgie][1] — a simple desktop designed for, but not exclusive to, an openSUSE-based Linux distribution called Evolve OS.
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/BsCvTxJIcAAPjUR.png-large.png)
|
||||
|
||||
We first wrote about Budgie back in March and were suitably bowled over by both the clean, minimal aesthetic and nimble framework, but also by the decision to reuse common components and the standard stack of GNOME 3.10 technologies readily available in most modern distributions.
|
||||
|
||||
I’m a huge admirer of the development choices taken by the project lead, Ikey Doherty. There’s no denying that forking has its merits, but by deciding to favour upstream projects whole project is able to move faster, both development-wise (less technical debt) and in being available for users (easier to run on other distributions).
|
||||
|
||||
Politics of choice aside, the desktop is clean and minimal with a nod to the Ash desktop of Google’s Chrome OS. If you don’t mind a few rough edges, its well worth a play with. But how do you install Budgie on Ubuntu?
|
||||
|
||||
### Unofficial PPA is Unofficial ###
|
||||
|
||||
Open source being what it is means if you have a bit of terminal know-how you can grab the source and get it up and running with a bit of wily compiling.
|
||||
|
||||
But if you’re too lazy for that and happen to be running Ubuntu 14.04 LTS (or a distro based on it) you can get it the easy way.
|
||||
|
||||
Just add one **unofficial PPA**, refresh your Software Sources and then install. A few minutes later and you’ll have both a new uncle in the family by the [name of Bob][2] and a new desktop shell to play with.
|
||||
|
||||
### Add the Budgie PPA ###
|
||||
|
||||
With a terminal window open copy and paste the following commands carefully, entering your password when/if prompted:
|
||||
|
||||
sudo add-apt-repository ppa:sukso96100/budgie-desktop
|
||||
sudo apt-get update && sudo apt-get install budgie-desktop
|
||||
|
||||
### Log into the Budgie Session ###
|
||||
|
||||
After installation you’ll be able to select ‘Budgie’ from the session selector of the Unity Greeter. (Don’t forget to change this back to a stable DE at a later date.)
|
||||
|
||||
### Notes ###
|
||||
|
||||
**Budgie is not stable, finished nor is it officially supported on Ubuntu**. It is in active development and features remain missing, including, but not limited to: no network management support, no volume control applet (keyboard keys will work fine), no notification system and no way to ‘pin’ apps to the task bar.
|
||||
|
||||
It also doesn’t play too nicely with Ubuntu’s overlay scrollbars, some GTK themes, and session management (e.g., logout, restart, etc.) on distributions using Upstart (like Ubuntu, [though that’s changing][3]) does not work.
|
||||
|
||||
As a workaround you can disable overlay scrollbars, set a different default theme and quit a session from the terminal using the following command:
|
||||
|
||||
gnome-session-quit
|
||||
|
||||
With all of those caveats in mind, I’d suggest those whose sanity hinges on a stable, dependable system avoid using it for now.
|
||||
|
||||
But for the rest of you crazy folks? Well, let us know what you think of it in the comments below. I’m off to let Bob in.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/07/install-budgie-evolve-os-desktop-ubuntu-14-04
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.omgubuntu.co.uk/2014/03/budgie-desktop-chrome-os-like
|
||||
[2]:http://en.wikipedia.org/wiki/Bob
|
||||
[3]:http://www.omgubuntu.co.uk/2014/02/ubuntu-debian-switching-systemd
|
@ -1,104 +0,0 @@
|
||||
How to simulate key press and mouse movement in Linux
|
||||
================================================================================
|
||||
Have you ever dreamed of your computer doing stuff automatically for you? Probably not if you just watched Terminator. But except for that, scripting and task automation are every power user's dreams. If a lot of solutions exist today to fit such goal, it is sometimes hard to pick the simple, smart, and efficient one out of the lot. I cannot pretend to have found it myself, but in the mean time, my preference goes to neat software called xdotool. Its approach is intuitive as it stands as an X11 automation tool. In other words, xdotool can simulate key presses and even mouse events from reading a text file.
|
||||
|
||||
### Installation of Xdotool on Linux ###
|
||||
|
||||
For Ubuntu, Debian or Linux Mint, you can just do:
|
||||
|
||||
$ sudo apt-get install xdotool
|
||||
|
||||
For Fedora, use yum command:
|
||||
|
||||
$ sudo yum install xdotool
|
||||
|
||||
For CentOS user, the package is available in [EPEL repo][1]. After enabling EPEL repo, simply use yum command as above.
|
||||
|
||||
For Arch user, the package is available in the Community repo:
|
||||
|
||||
$ sudo pacman -S xdotool
|
||||
|
||||
If you cannot find xdotool for your distribution, you can always download it from the [official website][2].
|
||||
|
||||
### Basic Usage of Xdotool ###
|
||||
|
||||
As intuitive as it is, xdotool remains a scripting application. Hence you have to know the syntax in order to use it properly. Rest assured though, the syntax is very simple and quick to pick up, relative to the extent of the program's features.
|
||||
|
||||
First, it is very easy to simulate key press. From the terminal, you can type the command:
|
||||
|
||||
$ xdotool key [name of the key]
|
||||
|
||||
If you want to chain two keys, use the "+" operator between them. So:
|
||||
|
||||
$ xdotool key alt+Tab
|
||||
|
||||
will switch window for you.
|
||||
|
||||
To have xdotool type for you, use the type command:
|
||||
|
||||
$ xdotool type ''
|
||||
|
||||
That's already enough for basic key pressing. But one of the many strengths of xdotool is its ability to put the focus on a particular window. It can fetch the right window, and then type in it, preventing all your recorded keystrokes to just vaporize in thin air. For this, the simplest command is:
|
||||
|
||||
$ xdotool search --name [name of the window] key [keys to press]
|
||||
|
||||
This will search through the opened window for one with the name matching the search, give it the focus, and then simulate the key pressing.
|
||||
|
||||
A bit more advanced, but very useful, xdotool can simulate mouse movement and click. With:
|
||||
|
||||
$ xdotool mousemove x y
|
||||
|
||||
you can place the cursor at coordinates (x,y) of your screen (in pixels). You can also combine it with the "click" argument:
|
||||
|
||||
$ xdotool mousemove x y click 1
|
||||
|
||||
This will move the mouse to (x,y), and click with the left button. The "1" represents the left button of the mouse, "2" would be the scroll wheel, "3" the right button, etc.
|
||||
|
||||
Finally, once you have your commands in mind, you might want to actually dump it in a file to edit and play. For that, there is more than one syntax. You can write is a bash script:
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
xdotool [command 1]
|
||||
xdotool [command 2]
|
||||
etc
|
||||
|
||||
Or you can use:
|
||||
|
||||
$ xdotool [filename]
|
||||
|
||||
where you write your commands in a separate file and plug its name as the argument.
|
||||
|
||||
### Bonus ###
|
||||
|
||||
As a bonus to this post, here is a concrete example of xdotool in action. You may or may not have heard of Bing, the Microsoft's search engine. In the latter case, you have then never heard of Bing Rewards: a program that allows you to trade Bing points for Amazon's and other gift cards. To earn those points, you can do up to 30 searches a day on Bing, each search giving you 0.5 point. In other words, you have to make Bing your default search engine, and use it every day.
|
||||
|
||||
Or, you can use this xdotool script, which will automatically give focus to Firefox (replace it with your favorite navigator), and perform a search using the fortune command to generate some random words. In about 30 seconds, all your daily searches will be done.
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
for i in {1..30}
|
||||
do
|
||||
WID=`xdotool search --title "Mozilla Firefox" | head -1`
|
||||
xdotool windowfocus $WID
|
||||
xdotool key ctrl+l
|
||||
xdotool key Tab
|
||||
SENTENCE="$(fortune | cut -d' ' -f1-3 | head -1)"
|
||||
xdotool type $SENTENCE
|
||||
xdotool key "Return"
|
||||
sleep 4
|
||||
done
|
||||
|
||||
To conclude, I really like xdotool even if its full capabilities extend way beyond the scope of this post. It is a really approachable way to scripting and task automation. The downside is that it probably is not the most efficient one. But again, it does the job, and isn't too much of a bother to learn.
|
||||
|
||||
What are your thoughts on xdotool? Do you prefer another automation tool to it? And why? Let us know in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/2014/07/simulate-key-press-mouse-movement-linux.html
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://xmodulo.com/2013/03/how-to-set-up-epel-repository-on-centos.html
|
||||
[2]:http://www.semicomplete.com/projects/xdotool/
|
@ -1,61 +0,0 @@
|
||||
Fix No Sound In Ubuntu 14.04 As HDMI Enabled BY Default
|
||||
================================================================================
|
||||
Sound problem is not new in Ubuntu. I have previously written on various ways to [fix “no sound” issue in Ubuntu][1]. But the soud issue I am going to discuss here is different than those mentioned in the other article.
|
||||
|
||||
So I installed Ubuntu 14.04, actually re-installed it. As always, I did all those [things to do after a fresh install of Ubuntu 14.04][2]. And than I realized that the system had no sound. While investigating the issue I found one strange thing. I checked [alsamixer][3] and it was in a weird state:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/06/alsamixer_Set_HDMI_Default.jpeg)
|
||||
|
||||
As you can see, **HDMI is set by default in alsamixer**. Which means by default HDMI output has been selected instead of the built in speakers. This is why I get no sound from the built in speakers in my system.
|
||||
|
||||
Use the following command to check the state of alsamixer:
|
||||
|
||||
alsamixer
|
||||
|
||||
If alsamixer is set by default to HDMI or some other audio output, continue this article to see how can we fix it.
|
||||
|
||||
### Fixing no sound in Ubuntu when HDMI is set as default ###
|
||||
|
||||
Now to force Ubuntu to use analog output instead of HDMI by default, we need a little information. Open a terminal and use the following command:
|
||||
|
||||
aplay -l
|
||||
|
||||
This will list the devices, card number etc. Note down the card and device number for analog output. For me the output was like this:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/07/AlsaMixer_List_Device.jpeg)
|
||||
|
||||
Once you have the required card and device number, make a new configuration file like this:
|
||||
|
||||
sudo gedit /etc/asound.conf
|
||||
|
||||
The above command will also open the file. Add the following lines to it, replacing with your card and device number of course:
|
||||
|
||||
defaults.pcm.card 1
|
||||
defaults.pcm.device 0
|
||||
|
||||
Save the file and restart the computer. You should hear the sound now. Just to mention, this will work for all the Linux distributions such as Linux Mint, Elementary OS, Fedora, Arch Linux etc. As I said previously, this “no sound fix” only works with the case where HDMI is set by default. For other cases, you can read [this article about fixing no sound issue in Ubuntu and Linux Mint][4].
|
||||
|
||||
Feel free to use the comment section to let me know if it worked or not or if you have some better trick to handle this such issue. Ciao ![](http://itsfoss.itsfoss.netdna-cdn.com/wp-includes/images/smilies/icon_smile.gif)
|
||||
|
||||
----------
|
||||
|
||||
![](http://1.gravatar.com/avatar/20749c268f5d3e4d2c785499eb6a17c0?s=100&r=pg&d=mm)
|
||||
|
||||
About Abhishek
|
||||
|
||||
I am Abhishek Prakash, 'creator' of It's F.O.S.S. I have a Masters in Communication System Engineering. I am an avid Linux lover and Open Source enthusiast. I use Ubuntu and believe in sharing knowledge. Apart from Linux, I love classic detective mystery. Huge fan of Agatha Christie work. Feel free to circle me on [Google Plus][g] and Follow [@abhishek_pc][t]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/fix-sound-ubuntu-1404/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://itsfoss.com/fix-sound-ubuntu-1304-quick-tip/
|
||||
[2]:http://itsfoss.com/things-to-do-after-installing-ubuntu-14-04/
|
||||
[3]:http://en.wikipedia.org/wiki/Alsamixer
|
||||
[4]:http://itsfoss.com/fix-sound-ubuntu-1304-quick-tip/
|
||||
[g]:https://plus.google.com/u/0/110180944531110746460
|
||||
[t]:https://twitter.com/abhishek_pc
|
@ -1,103 +0,0 @@
|
||||
[su-kaiyao]翻译中
|
||||
|
||||
5 Simple Ways To Make Cinnamon Feel at Home on Ubuntu
|
||||
================================================================================
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/des.jpg)
|
||||
|
||||
**The latest stable release of the popular Cinnamon desktop environment is [once again available for Ubuntu users to install][1].**
|
||||
|
||||
And while it’s good to go out of the box (or rather PPA) there are a handful of small tweaks you can make to get an even better experience.
|
||||
|
||||
If you don’t have Cinnamon installed in Ubuntu head on over to our previous article about it.
|
||||
|
||||
### Change the Mint Menu Icon ###
|
||||
|
||||
The Mint Menu is one of the standout features of Cinnamon. It’s a simple, fast and familiar way to search, open and organise your applications. By default the menu uses the Linux Mint logo on the launcher item. Since you’re running the DE on Ubuntu rather than Mint you may prefer the menu to use Ubuntu’s familiar orange circle of friends logo instead. How? It’s easy.
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/min-menu.jpg)
|
||||
|
||||
To change the Cinnamon menu icon to the Ubuntu emblem right click on the applet and select ‘Configure‘. In the Settings window that appears check ‘Use a custom icon’ and enter the following to use the Ubuntu logo:
|
||||
|
||||
/usr/share/icons/ubuntu-mono-dark/actions/24/package-supported.svg
|
||||
|
||||
You can use any supported image type. Just enter the path to the icon in the field, or click the box at the end to open a file picker.
|
||||
|
||||
### Try Out Cinnamon Themes ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/cinnamon-themes-zukitwo.jpg)
|
||||
|
||||
Like GNOME Shell Cinnamon also supports custom themes. And by that I don’t mean just GTK themes for apps and window decoration, but visual styles that theme the shell as a whole — panel, menu, applets, and so on.
|
||||
|
||||
Cinnamon themes can be browsed, downloaded and enabled without leaving the desktop — no downloads or manual installation required. Open the Appearance pane of the Cinnamon Settings tool and select the ‘Online Themes’ tab to get started.
|
||||
|
||||
Below are a handful of our favourite themes.
|
||||
|
||||
- [**Android Holo**][2] — Android 4.x style theme
|
||||
- [**Zukitwo**][3] — Sleek, stylish and light
|
||||
- [**Minty**][4] — Dark theme with bold green accents
|
||||
- [**Metro**][5] — Based on the visual style of Windows 8.x
|
||||
|
||||
### Find Your Perfect Layout ###
|
||||
|
||||
Unity may insist that its app launcher stay bolted firmly to the side of the screen, but Cinnamon has no such qualms about letting you rearrange the desktop layout to suit your own style.
|
||||
|
||||
Panels can be added, edited and moved manually, or by selecting one of three preset layouts:
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/traditional.jpg)
|
||||
|
||||
Open `Settings > Panel > Layout Options > Panel Layout` and select from one of the following:
|
||||
|
||||
- Traditional – this is the default layout, with a panel at the bottom of the screen
|
||||
- Flipped – like traditional, but with panel on top of the screen
|
||||
- Classic – two panels, one at the top, one at the bottom
|
||||
|
||||
You will need to log out or restart Cinnamon before your selected changes will take effect.
|
||||
|
||||
### Add Panel Applets ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/weather-applet.png)
|
||||
|
||||
Cinnamon embraces extensibility with the same gusto as GNOME Shell. A wealth of community add-ons and applets offering extra features and functionality, such as weather, system monitors and window management tools, are available to browse, install and enable straight form the desktop.
|
||||
|
||||
Right click on the panel you wish to add an applet to and select ‘…Add Applets to the Panel‘. Some notable applets to check out:
|
||||
|
||||
- [**Weather**][6] - does what it forecasts (ho ho)
|
||||
- [**Stark Menu**][7] - Clone of the Windows 7 Start Menu
|
||||
- [**Screenshot**][8] — Easy way to grab screenshots with delays
|
||||
|
||||
### Change Date Format ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/applet.jpg)
|
||||
|
||||
Cinnamon’s time and date applet is handy if, like me, you’re prone to never remembering the date.
|
||||
|
||||
But it defaults to only showing the time in the 24 hour clock format. The good news is that we can tweak the time format of the clock applet fairly easily.
|
||||
|
||||
Right click and select the ‘Configure’ option. In the settings window that appears tick the box listed beside “Use a custom date format“. Next, use an online generator tool to generate a date/time format suited to you, or use one of the presets listed below by copying and pasting the bit marked in bold:
|
||||
|
||||
- **%B %e, %I:%M %p** (July 13, 7:19 PM)
|
||||
- **%m/%d/%Y** (07/13/2014)
|
||||
- **%l:%M %p** (7:19 PM)
|
||||
|
||||
Changes are applied immediately, and if you make a mistake you can uncheck the custom date format option to return to the default settings.
|
||||
|
||||
### Going Further ###
|
||||
|
||||
These are just a handful of customisation choices available in Cinnamon, but we think they’re a good springboard for exploring more. Let us know what your favourite Cinnamon tweaks are in the comments section below, on Facebook or via Google+.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/07/5-things-installing-cinnamon-ubuntu
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.omgubuntu.co.uk/2014/07/new-cinnamon-ubuntu-14-04-ppa-stable
|
||||
[2]:http://cinnamon-spices.linuxmint.com/themes/view/122
|
||||
[3]:http://cinnamon-spices.linuxmint.com/themes/view/219
|
||||
[4]:http://cinnamon-spices.linuxmint.com/themes/view/25
|
||||
[5]:http://cinnamon-spices.linuxmint.com/themes/view/188
|
||||
[6]:http://cinnamon-spices.linuxmint.com/applets/view/17
|
||||
[7]:http://cinnamon-spices.linuxmint.com/applets/view/168
|
||||
[8]:http://cinnamon-spices.linuxmint.com/applets/view/35
|
@ -1,40 +0,0 @@
|
||||
‘Simple Dock’ GNOME Shell Extension Puts Your Fave Apps On The Desktop
|
||||
================================================================================
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/screenshot_815_1.jpg)
|
||||
|
||||
**I love GNOME Shell, but what I don’t love is having to rustle through a hidden screen to get at my favourite applications or switch between those I have running. **
|
||||
|
||||
It may make me sound awesomely retro, like a UX luddite, or like someone who has become far too accustomed to the usability of Unity but I, like many of you reading this, like having an app launcher/switcher accessible on the desktop. It’s a familiar, fast way of working.
|
||||
|
||||
GNOME Shell is, by design, different. It tucks everything out of the way – from the messaging centre and notifications, to workspaces and the apps list. It’s a minimal aesthetic that makes sense: help users focus on what matters.
|
||||
|
||||
But for me, my desktop needs to be more than a glorified picture frame.
|
||||
|
||||
### The Beauty of GNOME Shell ###
|
||||
|
||||
Despite my own preferences, the decision to hide apps is part of the beauty of GNOME Shell. It ships with a default desktop experience that is user friendly, sane and predictable — but also thoroughly extensible. Because of this there’s a huge array of add-ons catering to every need, niche and want, including traditional app menus, desktop docks and even an Ubuntu Unity Dash clone!
|
||||
|
||||
In this article I’m just focusing on one add-on that caters to my needs: the aptly named **Simple Dock**. Simple Dock takes the GNOME Shell apps grid and favourites bar and puts it slap bang where I want it: on the desktop.
|
||||
|
||||
For now it only supports being positioned on the bottom of the screen, and only offers a minimal set of settings. While minimal, I feel these cover all of my needs:
|
||||
|
||||
- ntelligent auto hide
|
||||
- Minimise/restore application windows
|
||||
- Drag-and-drop favourites
|
||||
- Button to launch activities overlay
|
||||
|
||||
Want it? Providing you’re running GNOME Shell on Ubuntu 13.10 or above you can. Just head on over to the GNOME Extensions page linked to below in a supported browser (Firefox, GNOME Web, etc.) then slide the on-page switch from ‘off‘ to ‘on‘.
|
||||
|
||||
- [Simple Dock on GNOME Shell Extensions][1]
|
||||
|
||||
To adjust the settings of Simple Dock hit the cog icon on the GNOME Extensions webpage listing for it or through a desktop application like GNOME Tweak Tool.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/07/simple-dock-gnome-shell-extension
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:https://extensions.gnome.org/extension/815/simple-dock/
|
@ -1,3 +1,4 @@
|
||||
Love-xuan 翻译中
|
||||
Display Song Lyrics On Desktop In Ubuntu 14.04
|
||||
================================================================================
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/07/display_lyrics_desktop_Ubuntu.jpeg)
|
||||
|
108
sources/tech/20140718 Linux Kernel Testing and Debugging 2.md
Normal file
108
sources/tech/20140718 Linux Kernel Testing and Debugging 2.md
Normal file
@ -0,0 +1,108 @@
|
||||
[bazz2 so handsome]
|
||||
Linux Kernel Testing and Debugging
|
||||
================================================================================
|
||||
### Compiling and Installing Stable Kernel ###
|
||||
|
||||
If you cloned the stable git:
|
||||
|
||||
cd linux-stable
|
||||
|
||||
git checkout linux-3.x.y
|
||||
|
||||
or if you are using the tar-ball:
|
||||
|
||||
cd linux-3.x.y
|
||||
|
||||
Starting out with the distribution configuration file is the safest approach for the very first kernel install on any system. You can do so by copying the configuration for your current kernel from /boot.
|
||||
|
||||
cp /boot/config-3.x.y-z-generic .config
|
||||
|
||||
Run the following command to generate kernel configuration file based on the current configuration. You will be prompted to tune the configuration to enable new features and drivers that have been added since the Ubuntu snapshot the kernel from the mainline.
|
||||
|
||||
make oldconfig
|
||||
|
||||
Once this step is complete, it is time to compile the kernel:
|
||||
|
||||
make all
|
||||
|
||||
Once the kernel compilation is complete, install the new kernel:
|
||||
|
||||
sudo "make modules_install install"
|
||||
|
||||
The above command will install the new kernel and run update-grub to add the new kernel to the grub menu. Now it is time to reboot the system to boot the newly installed kernel. Before we do that, let's save logs from the current kernel to compare and look for regressions and new errors, if any:
|
||||
|
||||
dmesg -t > dmesg_current
|
||||
|
||||
dmesg -t -k > dmesg_kernel
|
||||
|
||||
dmesg -t -l emerg > dmesg_current_emerg
|
||||
|
||||
dmesg -t -l alert > dmesg_current_alert
|
||||
|
||||
dmesg -t -l crit > dmesg_current_alert
|
||||
|
||||
dmesg -t -l err > dmesg_current_err
|
||||
|
||||
dmesg -t -l warn > dmesg_current_warn
|
||||
|
||||
In general, dmesg should be clean with no emerg, alert, crit, and err level messages. If you see any of these, it might indicate some hardware and/or kernel problem.
|
||||
|
||||
A couple more important steps before trying out the newly installed kernel. There is no guarantee that the new kernel will boot. As a safe guard, please ensure that there is at least one good kernel installed. Change the default grub configuration file /etc/default/grub:
|
||||
|
||||
Enable printing early boot messages to vga using earlyprink=vga kernel boot option:
|
||||
|
||||
GRUB_CMDLINE_LINUX="earlyprink=vga"
|
||||
|
||||
Increase the GRUB_TIMEOUT value to 10 - 15 seconds, so grub pauses in menu allowing time to choose kernel to be boot:
|
||||
|
||||
Uncomment GRUB_TIMEOUT and set it to 10: GRUB_TIMEOUT=10
|
||||
Comment out GRUB_HIDDEN_TIMEOUT and GRUB_HIDDEN_TIMEOUT_QUIET
|
||||
|
||||
Run update-grub to update the grun configuration in /boot
|
||||
|
||||
sudo update-grub
|
||||
|
||||
Now restart the system. Once the new kernel comes up, compare the saved dmesg from the old kernel with the new one and see if there are any regressions. If the newly installed kernel fails to boot, you will have to boot a good kernel and then investigate why the new kernel failed to boot.
|
||||
|
||||
### Living in The Fast Lane ###
|
||||
|
||||
If you like driving in the fast lane and have the need for speed, clone the mainline kernel git or better yet the linux-next git. Booting and testing mainline and linux-next helps find and fix problems before the kernel is released.
|
||||
|
||||
Mainline:
|
||||
|
||||
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
|
||||
|
||||
linux-next:
|
||||
|
||||
git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
|
||||
|
||||
Compiling and installing mainline and linux-next kernels is exactly same as the stable kernel. Please follow the instructions from previous sections.
|
||||
|
||||
### Applying Patches ###
|
||||
|
||||
Linux kernel patch files are text files that contain the differences from the original source to the new. Each Linux patch is a self-contained change to the code that stands on its own, unless explicitly made part of a patch series. New patches are applied as follows:
|
||||
|
||||
patch -p1 < file.patch
|
||||
|
||||
git apply --index file.patch
|
||||
|
||||
Either one will work, however, when a patch adds a new file and if it is applied using the patch command, git doesn't know about the new files and they will be treated as untracked files. "git diff" will not show the files in its output and "git status" will show the files as untracked.
|
||||
|
||||
For the most part, there are no issues with building and installing kernels, however, "git reset --hard" will not remove the newly added files and a subsequent git pull will fail. A couple of ways to tell git about the new files and have it track them, there by avoiding the above issues:
|
||||
|
||||
|
||||
Option 1:
|
||||
|
||||
> When a patch that adds new files is applied using the patch command, run "git clean" to remove untracked files, before running "git reset --hard". For example, git clean -dfx will force remove untracked directories and files, ignoring any standard ignore rules specified in the .gitignore file. You could include -q option to run git clean in quiet mode, if you don't care to know which files are removed.
|
||||
|
||||
Option 2:
|
||||
|
||||
> An alternate approach is to tell git to track the newly added files by running "git apply --index file.patch". This will result in git applying the patch and adding the result to the index. Once this is done, git diff will show the newly added files in its output and git status will report the status correctly tagging these files as newly created files.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxjournal.com/content/linux-kernel-testing-and-debugging?page=0,1
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
125
sources/tech/20140718 Linux Kernel Testing and Debugging 3.md
Normal file
125
sources/tech/20140718 Linux Kernel Testing and Debugging 3.md
Normal file
@ -0,0 +1,125 @@
|
||||
Linux Kernel Testing and Debugging
|
||||
================================================================================
|
||||
### Basic Testing ###
|
||||
|
||||
Once a new kernel is installed, the next step is try to boot it and see what happens. Once the new kernel is up and running, check dmesg for any regressions. Run a few usage tests:
|
||||
|
||||
- Is networking (wifi or wired) functional?
|
||||
- Does ssh work?
|
||||
- Run rsync of a large file over ssh
|
||||
- Run git clone and git pull
|
||||
- Start web browser
|
||||
- Read email
|
||||
- Download files: ftp, wget etc.
|
||||
- Play audio/video files
|
||||
- Connect new USB devices mouse, usb stick etc.
|
||||
|
||||
|
||||
### Examine Kernel Logs ###
|
||||
|
||||
Checking for regressions in dmesg is a good way to identify problems, if any, introduced by the new code. As a general rule, there should be no new crit, alert, and emerg level messages in dmesg. There should be no new err level messages. Pay close attention to any new warn level messages as well. lease note that new warn messages aren't as bad. New code at times adds new warning messages which are just warnings.
|
||||
|
||||
- dmesg -t -l emerg
|
||||
- dmesg -t -l crit
|
||||
- dmesg -t -l alert
|
||||
- dmesg -t -l err
|
||||
- dmesg -t -l warn
|
||||
- dmesg -t -k
|
||||
- dmesg -t
|
||||
|
||||
The following script runs the above dmesg commands and saves the output for comparing with older release dmesg files. It then runs diff commands against the older release dmesg files. Old release is a required input parameter. If one is not supplied, it will simply generate dmesg files and exit. Regressions indicate newly introduced bugs and/or bugs that escaped patch testing and integration testing in linux git trees prior to including the patch in a release. Are there any stack traces resulting from WARN_ON in the dmesg? These are serious problems that require further investigation.
|
||||
|
||||
- [**dmesg regression check script**][1]
|
||||
|
||||
### Stress Testing ###
|
||||
|
||||
Running 3 to 4 kernel compiles in parallel is a good overall stress test. Download a few Linux kernel gits, stable, linux-next etc.. Run timed compiles in parallel. Compare times with old runs of this test for regressions in performance. Longer compile times could be indicators of performance regression in one of the kernel modules. Performance problems are hard to debug. First step is to detect them. Running several compiles in parallel is a good overall stress test that could be used as a performance regression test and overall kernel regression test, as it exercises various kernel modules like memory, file-systems, dma, and drivers.
|
||||
|
||||
time make all
|
||||
|
||||
### Kernel Testing Tools ###
|
||||
|
||||
There are several tests under tools/testing that are included in the Linux kernel git. There is a good mix of automated and functional tests.
|
||||
ktest suite
|
||||
|
||||
ktest is an automated test suite that can test builds, installs, and kernel boots. It can also run cross-compile tests provided the system has cross-compilers installed. ktest depends on flex and bison tools. Please consult the ktest documentation in tools/testing/ktest for details on how to run ktest. It is left to the reader as a self-study. A few resources that go into detail on how to run ktest:
|
||||
|
||||
- [**ktest-eLinux.org**][2]
|
||||
|
||||
### tools/testing/selftests ###
|
||||
|
||||
Let's start with selftests. Kernel sources include a set of self-tests which test various sub-systems. As of this writing, breakpoints, cpu-hotplug, efivarfs, ipc, kcmp, memory-hotplug, mqueue, net, powerpc, ptrace, rcutorture, timers, and vm sub-systems have self-tests. In addition to these, user memory self-tests test user memory to kernel memory copies via test_user_copy module. The following is on how to run these self-tests:
|
||||
|
||||
Compile tests:
|
||||
|
||||
make -C tools/testing/selftests
|
||||
|
||||
Run all tests: (running some tests needs root access, login as root and run)
|
||||
|
||||
make -C tools/testing/selftests run_tests
|
||||
|
||||
Run only tests targeted for a single sub-system:
|
||||
|
||||
make -C tools/testing/selftests TARGETS=vm run_tests
|
||||
|
||||
### tools/testing/fault-injection ###
|
||||
|
||||
Another test suite under tools/testing is fault-injection. failcmd.sh script runs a command to inject slab and page allocation failures. This type of testing helps validate how well kernel can recover from faults. This test should be run as root. The following is a quick summary of currently implemented fault injection capabilities. The list keeps growing as new fault injection capabilities get added. Please refer to the Documentation/fault-injection/fault-injection.txt for the latest.
|
||||
|
||||
failslab (default option)
|
||||
|
||||
injects slab allocation failures. kmalloc(), kmem_cache_alloc(), ...
|
||||
|
||||
fail_page_alloc
|
||||
|
||||
injects page allocation failures. alloc_pages(), get_free_pages(), ...
|
||||
|
||||
fail_make_request
|
||||
|
||||
injects disk IO errors on devices permitted by setting, /sys/block//make-it-fail or /sys/block///make-it-fail. (generic_make_request())
|
||||
|
||||
fail_mmc_request
|
||||
|
||||
injects MMC data errors on devices permitted by setting debugfs entries under /sys/kernel/debug/mmc0/fail_mmc_request
|
||||
|
||||
The capabilities and behavior of fault-injection can be configured. fault-inject-debugfs kernel module provides some debugfs entries for runtime. Ability to specify the error probability rate for faults, the interval between fault injection are just a couple of examples of the configuration choices fault-injection test supports. Please refer to the Documentation/fault-injection/fault-injection.txt for details. Boot options can be used to inject faults during early boot before debugfs becomes available. The following boot options are supported:
|
||||
|
||||
- failslab=
|
||||
- fail_page_alloc=
|
||||
- fail_make_request=
|
||||
- mmc_core.fail_request=[interval],[probability],[space],[times]
|
||||
|
||||
The fault-injection infrastructure provides interfaces to add new fault-injection capabilities. The following is a brief outline of the steps involved in adding a new capability. Please refer to the above mentioned document for details:
|
||||
|
||||
define the fault attributes using DECLARE_FAULT_INJECTION(name);
|
||||
|
||||
> Please see the definition of struct fault_attr in fault-inject.h for details.
|
||||
|
||||
add a boot option to configure fault attributes
|
||||
|
||||
> This can be done using helper function setup_fault_attr(attr, str); Adding a boot option is necessary to enable the fault injection capability during early boot time.
|
||||
|
||||
add debugfs entries
|
||||
|
||||
> Use the helper function fault_create_debugfs_attr(name, parent, attr); to add new debugfs entries for this new capability.
|
||||
|
||||
add module parameters
|
||||
|
||||
> Adding module parameters to configure the fault attributes is a good option, when the scope of the new fault capability is limited to a single kernel module.
|
||||
|
||||
add a hook to insert failures
|
||||
|
||||
> should_fail(attr, size); Upon should_fail() returning true, client code should inject a failure.
|
||||
|
||||
Applications using this fault-injection infrastructure can target a specific kernel module to inject slab and page allocation failures to limit the testing scope if need be.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxjournal.com/content/linux-kernel-testing-and-debugging?page=0,2
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://linuxdriverproject.org/mediawiki/index.php/Dmesg_regression_check_script
|
||||
[2]:http://elinux.org/Ktest#Git_Bisect_type
|
143
sources/tech/20140718 Linux Kernel Testing and Debugging 4.md
Normal file
143
sources/tech/20140718 Linux Kernel Testing and Debugging 4.md
Normal file
@ -0,0 +1,143 @@
|
||||
Linux Kernel Testing and Debugging
|
||||
================================================================================
|
||||
### Auto Testing Tools ###
|
||||
|
||||
There are several automated testing tools and test infrastructures that you can chose from based on your specific testing needs. This section is intended to be a brief overview and not a detailed guide on how to use each of these.
|
||||
|
||||
#### [AuToTest][1] ####
|
||||
|
||||
> Autotest is a framework for fully automated testing. It is designed primarily to test the Linux kernel, though it is useful for many other functions such as qualifying new hardware. It is an open source project under the GPL. Autotest works in server-client mode. Autotest server can be configured to initiate, run, and monitor tests on several target systems running the autotest client. Autotest client can be run manually on a target system or via the server. Using this framework, new test cases can be added. Please [Autotest White Paper][2] for more information.
|
||||
|
||||
#### Linaro Automated Validation Architecture ####
|
||||
|
||||
> LAVA-Test Automated Testing Framework is a framework to help with automated installation and executions of tests. For example, running LTP in LAVA framework can be accomplished with a few commands. Running lava-test tool to install LTP will automatically install any dependencies, download the source for the recent release of LTP, compile it, and install the binaries in a self-contained area so that they can be removed easily when user runs uninstall. At this point running lava-test run with ltp test option will execute LTP tests and save results with an unique id that includes the test name, time/date stamp of the test execution. These results are saved for future reference. This is a good feature to find regressions, if any, between test runs. Summary of commands to run as an example:
|
||||
|
||||
Show a list of tests supported by lava-test:
|
||||
|
||||
lava-test list-tests
|
||||
|
||||
Install a new test:
|
||||
|
||||
lava-test install ltp
|
||||
|
||||
Run the test:
|
||||
|
||||
lava-test run ltp
|
||||
|
||||
Check results:
|
||||
|
||||
lava-test results show ltp-timestamp.0
|
||||
|
||||
Remove tests:
|
||||
|
||||
lava-test uninstall ltp
|
||||
|
||||
### Kernel Debug Features ###
|
||||
|
||||
Linux kernel includes several debugging features such as kmemcheck and kmemleak.
|
||||
|
||||
#### kmemcheck ####
|
||||
|
||||
> kmemcheck is a dynamic checking tool that detects and warns about some uses of uninitialized memory. It serves the same function as Valgrind's memcheck which is a userspace memory checker, where as kmemcheck checks kernel memory. CONFIG_KMEMCHECK kernel configuration option enables the kmemcheck debugging feature. Please read the Documentation/kmemcheck.txt for information on how to configure and use this feature, and how to interpret the reported results.
|
||||
|
||||
#### kmemleak ####
|
||||
|
||||
> kmemleak can be used to detect possible kernel memory leaks in a way similar to a tracing garbage collector. The difference between the tracing garbage collector and kmemleak is that the latter doesn't free orphan objects, instead it reports them in /sys/kernel/debug/kmemleak. A similar method of reporting and not freeing is used by the Valgrind's memcheck --leak-check to detect memory leaks in user-space applications. CONFIG_DEBUG_KMEMLEAK kernel configuration option enables the kmemleak debugging feature. Please read the Documentation/kmemleak.txt for information on how to configure and use this feature, and how to interpret the reported results.
|
||||
|
||||
### Kernel Debug Interfaces ###
|
||||
|
||||
Linux kernel has support for static and dynamic debugging via configuration options, debug APIs, interfaces, and frameworks. Let's learn more about each of these starting with the static options.
|
||||
|
||||
### Debug Configuration Options - Static ###
|
||||
|
||||
Linux kernel core and several Linux kernel modules, if not all, include kernel configuration options to debug. Several of these static debug options can be enabled at compile time. Debug messages are logged in dmesg buffer.
|
||||
|
||||
### Debug APIs ###
|
||||
|
||||
An example of Debug APIs is DMA-debug which is desiged for debugging driver dma api usage errors. When enabled, it keeps track of dma mappings per device, detects unmap attempts on addresses that aren't mapped, and missing mapping error checks in driver code after dma map attempts. CONFIG_HAVE_DMA_API_DEBUG and CONFIG_DMA_API_DEBUG kernel configuration options enable this feature on architectures that provide the support. With the CONFIG_DMA_API_DEBUG option enabled, the Debug-dma interfaces are called from DMA API. For example, when a driver calls dma_map_page() to map a dma buffer, dma_map_page() will call debug_dma_map_page() to start tracking the buffer until it gets released via dma_unmap_page() at a later time. For further reading on [Detecting silent data corruptions and memory leaks using DMA Debug API ][3]
|
||||
|
||||
### Dynamic Debug ###
|
||||
|
||||
Dynamic debug feature allows dynamically enabling/disabling pr_debug(), dev_dbg(), print_hex_dump_debug(), print_hex_dump_bytes() per-callsite. What this means is, a specific debug message can be enabled at run-time to learn more about a problem that is observed. This is great because, there is no need to re-compile the kernel with debug options enabled, then install the new kernel, only to find that the problem is no longer reproduciable. Once CONFIG_DYNAMIC_DEBUG is enabled in the kernel, dynamic debug feature enables a fine grain enable/disable of debug messages. /sys/kernel/debug/dynamic_debug/control is used to specify which pr_* messages are enabled. A quick summary of how to enable dynamic debug per call level, per module level is as follows:
|
||||
|
||||
Enable pr_debug() in kernel/power/suspend.c at line 340:
|
||||
|
||||
echo 'file suspend.c line 340 +p' > /sys/kernel/debug/dynamic_debug/control
|
||||
|
||||
Enable dynamic debug feature in a module at module load time
|
||||
|
||||
> Pass in dyndbg="plmft" to modprobe at the time module is being loaded.
|
||||
|
||||
Enable dynamic debug feature in a module to persist across reboots
|
||||
|
||||
> create or change modname.conf file in /etc/modprobe.d/ to add dyndbg="plmft" option. However for drivers that get loaded from initramfs, changing modname.conf is insufficient for the dynamic debug feature to persist across reboot. For such drivers, change grub to pass in module.dyndbg="+plmft" as a module option as a kernel boot parameter.
|
||||
|
||||
dynamic_debug.verbose=1 kernel boot option increases the verbosity of dynamic debug messages. Please consult the Documentation/dynamic-debug-howto.txt for more information on this feature.
|
||||
|
||||
### Tracepoints ###
|
||||
|
||||
So far we talked about various static and dynamic debug features. Both static debug options and debug hooks such as the DMA Debug API are either enabled or disabled at compile time. Both of these options require a new kernel to be compiled and installed. The dynamic debug feature eliminates the need for a recompile, however the debug code is compiled in with a conditional variable that controls whether or not the debug message gets printed. It helps that the messages can be enabled at run-time, however, the conditional code is executed at run-time to determine if the message needs to be printed. Tracepoint code on the otherhand can be triggered to be included at run-time only when the tracepoint is enabled. In other words, tracepoint code is different in that, it is inactive unless it is enabled. When it is enabled, code is modified to include the tracepoint code. It doesn't add any conditional logic overhead to determine whether or not to generate a trace message.
|
||||
|
||||
Please read [Tips on how to implement good tracepoint code][4] for more insight into how tracing works.
|
||||
|
||||
### Tracepoint mechanism ###
|
||||
|
||||
The tracepoints use jump-labels which is a code modification of a branch.
|
||||
|
||||
When it is disabled, the code path looks like:
|
||||
|
||||
[ code ]
|
||||
nop
|
||||
back:
|
||||
[ code ]
|
||||
return;
|
||||
tracepoint:
|
||||
[ tracepoint code ]
|
||||
jmp back;
|
||||
|
||||
When it is enabled, the code path looks like: (notice how the tracepoint code appears in the code path below)
|
||||
|
||||
[ code ]
|
||||
jmp tracepoint
|
||||
back:
|
||||
[ code ]
|
||||
return;
|
||||
tracepoint:
|
||||
[ tracepoint code ]
|
||||
jmp back;
|
||||
|
||||
### Linux PM Sub-system Testing ###
|
||||
|
||||
Using debug, dynamic debug, and tracing, let's run a few suspend to disk PM tests. When system is suspended, kernel creates hibernation image on disk, suspends and uses the image to restore the systerm state at resume time.
|
||||
|
||||
Enable logging time it takes to suspend and resume each device
|
||||
|
||||
echo 1 > /sys/power/pm_print_times
|
||||
|
||||
Run suspend to disk test in reboot mode
|
||||
|
||||
echo reboot > /sys/power/disk
|
||||
echo disk > /sys/power/state
|
||||
|
||||
Run suspend to disk test in shutdown mode - same as reboot, except requires powering on to resume
|
||||
|
||||
echo shutdown > /sys/power/disk
|
||||
echo disk > /sys/power/state
|
||||
|
||||
Run suspend to disk test in platform mode - more extensive and tests BIOS suspend and resume paths e.g: ACPI methods will be invoked. This is the recommended mode for hibernation so BIOS is informed and aware of suspend/resume action.
|
||||
|
||||
echo platform > /sys/power/disk
|
||||
echo disk > /sys/power/state
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via:http://www.linuxjournal.com/content/linux-kernel-testing-and-debugging?page=0,3
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://autotest.github.io/
|
||||
[2]:https://github.com/autotest/autotest/wiki/WhitePaper
|
||||
[3]:http://events.linuxfoundation.org/sites/events/files/slides/Shuah_Khan_dma_map_error.pdf
|
||||
[4]:http://www.linuxjournal.com/content/july-2013-linux-kernel-news
|
@ -0,0 +1,90 @@
|
||||
Linux Kernel Testing and Debugging
|
||||
================================================================================
|
||||
### Linux PM Sub-system Testing in Simulation Mode ###
|
||||
|
||||
The Linux PM sub-system provides five PM test modes to test hibernation in a simulated mode. These modes allow exercising the hibernation code in various layers of the kernel without actually suspending the system. This is useful when there is a concern that suspend might not work on a specific platform and help detect errors in a simulation similar to simulating flying a plane, so to speak.
|
||||
|
||||
freezer - test the freezing of processes
|
||||
|
||||
echo freezer > /sys/power/pm_test
|
||||
echo platform > /sys/power/disk
|
||||
echo disk > /sys/power/state
|
||||
|
||||
devices - test the freezing of processes and suspending of devices
|
||||
|
||||
echo devices > /sys/power/pm_test
|
||||
echo platform > /sys/power/disk
|
||||
echo disk > /sys/power/state
|
||||
|
||||
platform - test the freezing of processes, suspending of devices and platform global control methods(*)
|
||||
|
||||
echo platform > /sys/power/pm_test
|
||||
echo platform > /sys/power/disk
|
||||
echo disk > /sys/power/state
|
||||
|
||||
processors - test the freezing of processes, suspending of devices, platform global control methods(*) and the disabling of non-boot CPUs
|
||||
|
||||
echo processors > /sys/power/pm_test
|
||||
echo platform > /sys/power/disk
|
||||
echo disk > /sys/power/state
|
||||
|
||||
core - test the freezing of processes, suspending of devices, platform global control methods, the disabling of non-boot CPUs and suspending of platform/system devices. Note: this mode is tested on ACPI systems.
|
||||
|
||||
echo core > /sys/power/pm_test
|
||||
echo platform > /sys/power/disk
|
||||
echo disk > /sys/power/state
|
||||
|
||||
### Linux PM Sub-system Trace Events ###
|
||||
|
||||
PM sub-system supports several tracepoints and trace events that can be enabled to trigger during run-time. I will give an overview on how to enable couple of these trace events and where to find the trace information they generate:
|
||||
|
||||
Enabling PM events at run-time:
|
||||
|
||||
cd /sys/kernel/debug/tracing/events/power
|
||||
echo 1 > cpu_frequency/enable
|
||||
cat /sys/kernel/debug/tracing/set_event
|
||||
less /sys/kernel/debug/tracing/trace
|
||||
|
||||
Enabling events at boot-time kernel trace parameter with a kernel boot option:
|
||||
|
||||
trace_event=cpu_frequency
|
||||
|
||||
For more information on Linux PM testing, please consult the Documentation/power/basic-pm-debugging.txt and other documents in the same directory.
|
||||
|
||||
### git bisect ###
|
||||
|
||||
git bisect is an invaluable and powerful tool to isolate an offending commit. I will go over very basic git bisect steps.
|
||||
|
||||
This is how the process works:
|
||||
|
||||
git bisect start
|
||||
git bisect bad # Current version is bad
|
||||
git bisect good v3.14-rc6 # last good version
|
||||
|
||||
Once, one bad and one good version are specified, git bisect will start bisecting by pulling in commits between the good version and the bad. Once a set of commits are pulled in, compile the kernel, install, test, and tag the version good or bad. This process repeats until the selected commits are tested and tagged as good or bad. There can be several kernel versions to test. When the last version is tested, git bisect will flag a commit that is bad. The following useful git-bisect command can aid in using git-bisect process:
|
||||
|
||||
See step by step bisect progress
|
||||
|
||||
git bisect log
|
||||
|
||||
Reset git bisect can be used in case of mistakes in tagging, save git log output and replay prior to reset
|
||||
|
||||
git bisect reset
|
||||
|
||||
Replay a git-bisect log
|
||||
|
||||
git bisect replay git_log_output
|
||||
|
||||
git bisect can be run on a section of kernel source tree if the problem is clearly in that area. For example, when debugging a problem in radeon driver, running git bisect on drivers/drm/radeon will limit the scope of bisect to just the commits to drivers/drm/radeon driver.
|
||||
|
||||
Start git bisect on a section of a kernel tree
|
||||
|
||||
git bisect start drivers/drm/radeon
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxjournal.com/content/linux-kernel-testing-and-debugging?page=0,4
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
138
sources/tech/20140718 Linux Kernel Testing and Debugging 6.md
Normal file
138
sources/tech/20140718 Linux Kernel Testing and Debugging 6.md
Normal file
@ -0,0 +1,138 @@
|
||||
Linux Kernel Testing and Debugging
|
||||
================================================================================
|
||||
### Linux Kernel Patch Testing ###
|
||||
|
||||
Are you try your hands on writing a kernel patch? This section will go over how to test a new patch before sending it to the Linux mailing list. Further more, we will also talk about how to send it.
|
||||
Once the code is ready, compile it. Save the make output to a file to see if the new code introduced any new warnings. Address warnings, if any. Once the code compiles cleanly, install the compiled kernel and boot test. If it boots successfully, make sure there are no new errors in the dmesg, comparing it with the previous kernel dmesg. Run a few usage and stress tests. Please refer to the testing content we discussed earlier in this paper. If the patch is for fixing a specific bug, make sure the patch indeed fixes the bug. If the patch fixes the problem, make sure, other module regression tests pass. Identify regression tests for the patched module and run them. When a patch touches other architectures, cross-compile build testing is recommended. Please check the following in the source git as a reference to identify tests.
|
||||
|
||||
- linux_git/Documentation
|
||||
- linux_git/tools/testing
|
||||
- Cross-compiling reference: [Cross-compiling Linux Kernels on x86_64: A tutorial on How to Get Started][1]
|
||||
|
||||
Once you are satisfied with the patch testing, it is time to commit the change and generate the patch. Make sure the commit message describes the change made very clearly. It is important that the maintainer and other developers can understand what this change is all about. Once patch is ready, run scripts/checkpatch.pl on the generated patch. Address checkpatch errors and/or warnings, if any. Regenerate and repeat until the patch passes the checkpatch test. Unless the checkpatch errors are minor whitespace type, re-test the patch. Apply the patch to another instance of the kernel git to make sure patch applies cleanly.
|
||||
|
||||
Now you are ready to send the patch. Please run the scripts/get_maintainer.pl to identify whom the patch should be sent to. Please remember that the patch needs to be sent as a plain text, not as an attachment. Please make sure your email client can send plain text messages. Email the patch to yourself to test your client settings. Run checkpatch and apply the received patch. If these two steps pass, then you are ready to send the patch to the Linux Kernel Mailing List. git send-email is the safest way to send patches to avoid email client complications. Please make sure your .gitconfig includes sendemail with a valid smtpserver. Please consult git manpage for details.
|
||||
|
||||
Please refer to the following documentation in the kernel sources for rules and guidelines on sending patches:
|
||||
|
||||
- linux_git/Documentation/applying-patches.txt
|
||||
- linux_git/Documentation/SubmitChecklist
|
||||
- linux_git/Documentation/SubmittingDrivers
|
||||
- linux_git/Documentation/SubmittingPatches
|
||||
- linux_git/Documentation/stable_kernel_rules.txt
|
||||
- linux_git/Documentation/stable_api_nonsense.txt
|
||||
|
||||
The following is a list of additional testing guides and resources:
|
||||
|
||||
- [USB Testing on Linux][2]
|
||||
- [Linux Kernel Tester's Guide Chapter2][3]
|
||||
- [Linux Kernel Tester's Guide][4]
|
||||
- [Testing resources at eLinux.org][5]
|
||||
- [eLinux Debugging Portal][6]
|
||||
|
||||
### Kernel test suites and projects ###
|
||||
|
||||
In addition to the testing resources we discussed so far, there are projects both open source and initiated by hardware vendors that are worth a mention. Each of these projects focus on specific areas of the kernel and in some cases a specific space such as, embedded or enterprise where the kernel is used. We will look at a few in this section.
|
||||
|
||||
[Linux Test Project][7] (LTP) test suite is a collection of tools to test reliability, robustness, and stability of Linux kernel and related features. This test suite can be customized by adding new tests and the LTP project welcomes contributions. runltp script tests the following sub-systems by default:
|
||||
|
||||
- filesystem stress tests
|
||||
- disk I/O tests
|
||||
- memory management stress tests
|
||||
- ipc stress
|
||||
- scheduler tests
|
||||
- commands functional verification tests
|
||||
- system call functional verification tests
|
||||
|
||||
[**LTP-DDT**][8] is an LTP based test application wth a reduced focus to test embedded device drivers.
|
||||
|
||||
[**Linux Driver Verification**][9] project's goals are to improve the quality of Linux device drivers, develop an integrated platform for device drivers verification, and adopt latest research outcome to enhance quality of verification tools.
|
||||
|
||||
### Compliance Testing ###
|
||||
|
||||
If you ever had to port applications from one Unix variant to another, you would understand the importance of the [Linux Standard Base (LSB)][10] and LSB compliance test suite. The LSB is a Linux Foundation workgroup created to reduce the costs of supporting Linux platform, by reducing the differences between various Linux distributions and ensuring application portability between distributions. If anything, divergence in the Unix world taught us that it is vital to avoid it in the Linux world. This is exactly the reason why you can take an rpm convert it to deb and install and run it, and how sweet is that.
|
||||
|
||||
### Static Analysis and Tools ###
|
||||
|
||||
Static analysis tools analyze the code without executing it, hence the name static analysis. There are a couple of static analysis tools that are sepcifically written for analyzing the Linux kernel code base. Sparse is a static type-checking program written specifically for the Linux kernel, by Linus Torvalds. Sparse is a semantic parser. It creates a sematic prase tree to validate C semantics. It performs lazy type evaluation. Kernel build system has support for sparse and provides a make option to compile the kernel with sparse checking enabled.
|
||||
|
||||
Run sparse on all kernel C files that would get re-compiled:
|
||||
|
||||
make C=1 allmodconfig
|
||||
|
||||
Run sparse on all kernel C files even when they don't need a re-compile:
|
||||
|
||||
make C=2 allmodconfig
|
||||
|
||||
Sparse resources:
|
||||
|
||||
- [Sparse Archive][11]
|
||||
- [Sparse How To][12]
|
||||
|
||||
Smatch analyzes source to detect programming logic errors. It can detect logic errors such as, attempts to unlock already unlocked spinlock. It is actively used to detect logic errors in the Linux kernel sources.
|
||||
|
||||
Run smatch on Linux kernel:
|
||||
|
||||
make CHECK="~/path/to/smatch/smatch -p=kernel" C=1 bzImage modules | tee warns.txt
|
||||
|
||||
Please follow instructions on how to get smatch from smatch git repo and compile. Smatch is work in progress, instructions keep changing.
|
||||
|
||||
- [**Smatch**][12]
|
||||
|
||||
So what do we do about all of these semantic and logic problems found by Sparse and Smatch? Some of these problems are isolated to a routine and/or a module which can be fixed easily. However, some of these semantic issues are global in nature due to cut and paste of code. In some cases when interfaces get obsoleted or changed slightly, a mass change to update several source files becomes necessary. This is where Coccinelle comes in to rescue. Coccinelle is a program matching and transformation engine which provides the language SmPL (Semantic Patch Language) for specifying desired matches and transformations in C code. Coccinelle was initially targeted towards performing collateral evolutions in Linux.
|
||||
|
||||
For example, foo(int) interfaces changes to foo(int, char \*) with an optional second input parameter which can be a null. All usages of foo() will need to be updated to the new convention, which will be a very laborious task. Using Cocinelle, this task becomes easier with a script that looks for all instances of foo(parameter1) and replacing them with foo(parameter1, NULL). Once this task is done, all instances of foo() can be examined to see if passing in NULL value for parameter2 is a good assumption. For more information on Cocinelle and how it is used in fixing problems in various projects including the Linux kernel, please refer to the project page: [**Cocinelle**][13]
|
||||
|
||||
### References ###
|
||||
|
||||
We covered a lot of ground in this paper. I leave you with a few references for further reading on the topics we discussed.
|
||||
|
||||
- [KernelHacking][14]
|
||||
- [kernel Documentation][15]
|
||||
- [Linux Device Drivers, Third Edition][16]
|
||||
- [Dynamic Event Tracing in Linux Kernel][17]
|
||||
- [Kernel Testing: Tool and Techniques][18]
|
||||
|
||||
### Acknowledgements ###
|
||||
|
||||
I would like to thank Khalid Aziz, Oracle for his review, proof reading, and valuable suggestions for improvement. My special thanks to Mauro Chehab, Samsung and Guy Martin, Samsung for their review and feedback at various stages of writing this paper. I would like to extend my thanks to Greg Kroah-Hartman, Linux Foundation for his review. My special thanks to Ibrahim Haddad, Samsung for his support and encouragement without which, I would probably have never set out to write this paper in the first place.
|
||||
|
||||
----------
|
||||
|
||||
![](http://www.linuxjournal.com/files/linuxjournal.com/ufiles/pictures/picture-1088573.jpg)
|
||||
|
||||
Author:[Shuah Khan][a]
|
||||
|
||||
Shuah Khan is a Senior Linux Kernel Developer at Samsung's Open Source Group.
|
||||
She is a Linux Kernel Contributor who focuses on IOMMU, DMA, Linux Power
|
||||
Management, and PCIe, in addition to helping with stable release kernel
|
||||
maintenance testing and bug fixes. Shuah has several years of Unix kernel
|
||||
development experience. She has also contributed to OpenHPI, and LLDP projects.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxjournal.com/content/linux-kernel-testing-and-debugging?page=0,5
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://events.linuxfoundation.org/sites/events/files/slides/Shuah_Khan_cross_compile_linux.pdf
|
||||
[2]:http://www.linux-usb.org/usbtest/
|
||||
[3]:http://kernelnewbies.org/Linux_Kernel_Tester%27s_Guide_Chapter2
|
||||
[4]:http://www.kerneltravel.net/downloads/tester_guide.pdf
|
||||
[5]:http://elinux.org/Test_Systems
|
||||
[6]:http://elinux.org/Debugging_Portal
|
||||
[7]:http://ltp.sourceforge.net/documentation/how-to/ltp.php
|
||||
[8]:http://processors.wiki.ti.com/index.php/LTP-DDT
|
||||
[9]:http://linuxtesting.org/project/ldv
|
||||
[10]:http://www.linuxfoundation.org/collaborate/workgroups/lsb
|
||||
[11]:http://codemonkey.org.uk/projects/git-snapshots/sparse/
|
||||
[12]:http://smatch.sourceforge.net/
|
||||
[13]:http://coccinelle.lip6.fr/
|
||||
[14]:http://kernelnewbies.org/KernelHacking
|
||||
[15]:http://kernelnewbies.org/Documents
|
||||
[16]:http://lwn.net/Kernel/LDD3/
|
||||
[17]:http://events.linuxfoundation.org/slides/lfcs2010_hiramatsu.pdf
|
||||
[18]:http://events.linuxfoundation.org/images/stories/slides/elc2013_porter.pdf
|
||||
[a]:http://www.linuxjournal.com/users/shuah-khan
|
@ -0,0 +1,185 @@
|
||||
How to manage DigitalOcean VPS droplets from the command line on Linux
|
||||
================================================================================
|
||||
[DigitalOcean][1] is one of the [hottest][2] new kids in the block in the cloud VPS hosting market. While not offering as comprehensive service portfolio as Amazon Web Services and the likes, DigitalOcean is already a strong contender for the best Linux-based cloud VPS service targeted at small businesses and developers, thanks to their competitive pricing and user-friendly management interface.
|
||||
|
||||
![](https://farm4.staticflickr.com/3841/14501627500_2ef275ac1c_z.jpg)
|
||||
|
||||
Whenever you need a web-facing server for your personal project, you can quickly spin up a "droplet" (nickname for a VPS instance at [DigitalOcean][3]). And kill it when it's not needed. No need to burn a hole in your pocket as you are charged for its up time. While DigitalOcean's web-based management interface is streamlined already, for those of you who are die-hard fans of command-line interface (CLI), there is a CLI-based droplet management tool called [Tugboat][4]. Thanks to this CLI tool, any complex droplet management task can easily be turned into a script.
|
||||
|
||||
In this tutorial, I am going to describe **how to use Tugboat to manage DigitalOcean dropets from the command line**.
|
||||
|
||||
### Install Tugboat on Linux ###
|
||||
|
||||
To install Tugboat on Debian, Ubuntu or Linux Mint:
|
||||
|
||||
$ sudo apt-get install ruby-dev
|
||||
$ sudo gem install tugboat
|
||||
|
||||
To install Tugboat on Fedora:
|
||||
|
||||
$ sudo yum install ruby-devel
|
||||
$ sudo gem install tugboat
|
||||
|
||||
To install Tugboat on CentOS, first [install or upgrade to the latest Ruby][5], because on CentOS 6.5 and earlier, the default Ruby does not meet the minimum version requirement (1.9 and higher) for Tugboat. Once you install Ruby 1.9 and higher, install Tugboat as follows.
|
||||
|
||||
$ sudo gem install tugboat
|
||||
|
||||
### Configure Tugboat for the First Time ###
|
||||
|
||||
After installation, it's time to go through one-time configuration, which involves authorizing Tugboat to access your DigitalOcean account.
|
||||
|
||||
Go to [https://cloud.digitalocean.com/api_access][6], and create a new API key. Make a note of client ID and API key.
|
||||
|
||||
![](https://farm4.staticflickr.com/3836/14688299215_fd282a0142_z.jpg)
|
||||
|
||||
Start authorization process by running:
|
||||
|
||||
$ tugboat authorize
|
||||
|
||||
When prompted, enter your client ID and API key. It will ask you several other questions. You can accept default answers for now. We are going to customize the default settings later anyway.
|
||||
|
||||
[![](https://farm6.staticflickr.com/5596/14685122101_dba50fc86b_z.jpg)][7]
|
||||
|
||||
Now let's customize default droplet settings to reflect your typical use cases. For that, first check available droplet offerings (e.g., available images, regions, sizes).
|
||||
|
||||
Running the command below will show you a list of available droplet images. Pick a default image to use, and make a note of the corresponding ID.
|
||||
|
||||
$ tugboat images --global
|
||||
|
||||
![](https://farm3.staticflickr.com/2900/14688299175_e77e74fa1e_z.jpg)
|
||||
|
||||
Similarly, pick a default geographic location from available regions:
|
||||
|
||||
$ tugboat regions
|
||||
|
||||
Also, choose a default droplet size from available RAM sizes:
|
||||
|
||||
$ tugboat sizes
|
||||
|
||||
![](https://farm4.staticflickr.com/3858/14501661238_4304e8bdfb_o.png)
|
||||
|
||||
Now put your default choices in ~/.tugboat. For example, here I customize my default settings to 512MB Ubuntu 14.04 x64 to be created in New York region. Set "ssh_user" to root if you want to enable SSH via key authentication, which will be described shortly.
|
||||
|
||||
$ vi ~/.tugboat
|
||||
|
||||
----------
|
||||
|
||||
---
|
||||
authentication:
|
||||
client_key: XXXXXXXXXXXXXXXXXXX
|
||||
api_key: XXXXXXXXXXXXXXXXXXXX
|
||||
ssh:
|
||||
ssh_user: root
|
||||
ssh_key_path: /home/dev/.ssh/id_rsa
|
||||
ssh_port: '22'
|
||||
defaults:
|
||||
region: '4'
|
||||
image: '3240036'
|
||||
size: '66'
|
||||
ssh_key: ''
|
||||
private_networking: 'false'
|
||||
backups_enabled: 'false'
|
||||
|
||||
### Create and Add SSH Key to DigitalOcean ###
|
||||
|
||||
A secure way to access your droplet instance is to SSH to the instance via [key authentication][8].
|
||||
|
||||
In fact, you can automatically enable key authentication for your droplets by registering your SSH public key with [DigitalOcean][9]. Here is how to do it.
|
||||
|
||||
First, generate a private/public SSH key pair (if you don't have one).
|
||||
|
||||
$ ssh-keygen -t rsa -C "your@emailaddress.com"
|
||||
|
||||
Assuming that the generated key pair consists of: ~/.ssh/id_rsa (private key) and ~/.ssh/id_rsa.pub (public key), go ahead and upload your public key by running:
|
||||
|
||||
$ tugboat add-key [name-of-your-key]
|
||||
|
||||
You can give your key any name you like (e.g., "my-default-key"). When prompted, enter the path to your public key (e.g., /home/user/.ssh/id_rsa.pub). After key uploading is completed, verify the key is successfully added by running:
|
||||
|
||||
$ tugboat keys
|
||||
|
||||
![](https://farm4.staticflickr.com/3869/14501853397_3d3f4365b1_z.jpg)
|
||||
|
||||
The key should also appear in DigitalOcean's [SSH key page][10]. If you want the key to be automatically used for your droplets, add the ID of your key to ~/.tugboat.
|
||||
|
||||
ssh_key: '182710'
|
||||
|
||||
### Basic Usage of Tugboat ###
|
||||
|
||||
Here are a few basic use cases of tugboat command line.
|
||||
|
||||
1. Create a new droplet with default settings.
|
||||
|
||||
$ tugboat create <name-of-droplet>
|
||||
|
||||
2. Show a list of all active droplets.
|
||||
|
||||
$ tugboat droplets
|
||||
|
||||
3. Display information about a droplet.
|
||||
|
||||
$ tugboat info <name-of-droplet>
|
||||
|
||||
[![](https://farm6.staticflickr.com/5593/14501627440_5835506d2a_z.jpg)][11]
|
||||
|
||||
4. Shutdown a droplet, and remove its image.
|
||||
|
||||
$ tugboat destroy <name-of-droplet>
|
||||
|
||||
5. Shutdown a droplet, but keep its image
|
||||
|
||||
$ tugboat halt <name-of-droplet>
|
||||
|
||||
6. Take a snapshot of a droplet. The droplet must be turned off first.
|
||||
|
||||
$ tugboat snapshot <snapshot-name> <name-of-droplet>
|
||||
|
||||
7. Resize (increase or decrease the RAM size of) a droplet. The droplet must be shutdown first.
|
||||
|
||||
$ tugboat resize <name-of-droplet> -s <image-id>
|
||||
|
||||
If you want to know more about a particular command option, run:
|
||||
|
||||
$ tugboat help <command>
|
||||
|
||||
![](https://farm4.staticflickr.com/3900/14688013322_4fa6080c5e_z.jpg)
|
||||
|
||||
### Troubleshooting ###
|
||||
|
||||
1. When I run tugboat command, it fails with the following error.
|
||||
|
||||
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': /usr/lib/ruby/gems/1.8/gems/tugboat-0.2.0/lib/tugboat/cli.rb:12: syntax error, unexpected ':', expecting kEND (SyntaxError)
|
||||
|
||||
Tugboat requires Ruby 1.9 and higher. You need to upgrade Ruby to solve this problem. For CentOS, refer to [this tutorial][12].
|
||||
|
||||
2. When I try to install Tugboat with gem, I get the following error.
|
||||
|
||||
/usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- json/pure (LoadError)
|
||||
|
||||
Install the following gem to fix the problem.
|
||||
|
||||
$ sudo gem install json_pure
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/2014/07/manage-digitalocean-vps-droplets-command-line-linux.html
|
||||
|
||||
原文作者:[Dan Nanni][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
||||
[1]:http://xmodulo.com/go/digitalocean
|
||||
[2]:http://news.netcraft.com/archives/2013/12/11/digitalocean-now-growing-faster-than-amazon.html
|
||||
[3]:http://xmodulo.com/go/digitalocean
|
||||
[4]:https://github.com/pearkes/tugboat
|
||||
[5]:http://ask.xmodulo.com/upgrade-ruby-centos.html
|
||||
[6]:https://cloud.digitalocean.com/api_access
|
||||
[7]:https://www.flickr.com/photos/xmodulo/14685122101/
|
||||
[8]:http://xmodulo.com/2012/04/how-to-enable-ssh-login-without.html
|
||||
[9]:http://xmodulo.com/go/digitalocean
|
||||
[10]:https://cloud.digitalocean.com/ssh_keys
|
||||
[11]:https://www.flickr.com/photos/xmodulo/14501627440/
|
||||
[12]:http://ask.xmodulo.com/upgrade-ruby-centos.html
|
@ -0,0 +1,36 @@
|
||||
Fix Missing Speaker Icon From Moka Icon Theme [Quick Tip]
|
||||
================================================================================
|
||||
[Moka][1] is a beautiful icon theme. It has been constantly featured among the [best icon themes available for Ubuntu][2]. But there is little issue with Moka in Ubuntu 14.04. If you use Moka icons in Ubuntu 14.04 with Unity, you’ll find that speaker icon used for sound is missing:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/07/Moka_Missing_Sound_Icon.jpeg)
|
||||
|
||||
### Fix missing sound icon while using Moka icon theme ###
|
||||
|
||||
Though you might have already added official Moka PPA but for the sake of checking, add it again:
|
||||
|
||||
sudo add-apt-repository ppa:moka/stable
|
||||
sudo apt-get update
|
||||
|
||||
Now, next step is to install monochrome panel icons. Use the following command to install it:
|
||||
|
||||
sudo apt-get install faba-mono-icons
|
||||
|
||||
Once you have installed the Faba monochrome icons, change your icon theme from Moka to Faba. This will give you Moka icon theme along with beautiful monochrome icons in the top panel in Unity:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/07/Moka_With_Sound_Icons.jpeg)
|
||||
|
||||
I hope this helped you to fix the missing sound icon. Enjoy every bit and every sip of the Moka.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/fix-missing-speaker-icon-from-moka/
|
||||
|
||||
原文作者:[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://mokaproject.com/
|
||||
[2]:http://itsfoss.com/best-icon-themes-ubuntu-1404/
|
@ -0,0 +1,89 @@
|
||||
How to access SoundCloud from the command line in Linux
|
||||
================================================================================
|
||||
If you enjoy music streaming and originally-created sounds, you cannot have missed [SoundCloud][1]. Based in Germany, this cloud streaming service is now famous and well-established for any music adventurer. And naturally, as a Linux enthusiast, you might wonder how to join your passion for Linux with your love for music. As a solution, I advise you to check out Soundcloud2000, **a command line client for SoundCloud** born out of the [Music Hack Day Stockholm '13][2].
|
||||
|
||||
### Installation ###
|
||||
|
||||
For Debian or Ubuntu users, install via:
|
||||
|
||||
$ sudo apt-get install portaudio19-dev libmpg123-dev libncurses-dev ruby1.9.1-dev
|
||||
$ sudo gem install soundcloud2000
|
||||
|
||||
For Archlinux users, the package is available in [AUR][3].
|
||||
|
||||
For Fedora users, install via:
|
||||
|
||||
$ sudo yum install portaudio-devel libmpg123-devel ncurses-devel ruby-devel
|
||||
$ sudo gem install soundcloud2000
|
||||
|
||||
For CentOS users, install or upgrade to the [latest Ruby/RubyGems][4] (1.9 and higher), enable [Repoforge repo][5], and install via:
|
||||
|
||||
$ sudo yum install portaudio-devel mpg123-devel
|
||||
$ sudo gem install curses soundcloud2000
|
||||
|
||||
And finally, go to the official github page for the sources.
|
||||
|
||||
### Usage ###
|
||||
|
||||
Soundcloud2000 is very easy to pick up. Some might even say simplistic. I like it for that sobriety and the effort of the three authors and contributors. Launch it via:
|
||||
|
||||
$ soundcloud2000
|
||||
|
||||
From there, you will be welcomed with a splash screen:
|
||||
|
||||
![](https://farm4.staticflickr.com/3919/14658085706_71c9094e4f_z.jpg)
|
||||
|
||||
and then a list of songs:
|
||||
|
||||
![](https://farm4.staticflickr.com/3888/14494626757_3e788482d5_z.jpg)
|
||||
|
||||
You can scroll through the list via the up and down keys, play a song with enter, pause/resume with the space bar, and fast forward/rewind with the right and left arrow keys. As you can see, nothing groundbreaking but definitely ergonomic.
|
||||
|
||||
If the random list is too long to scroll through, you have an option to see all the tracks for a particular user by hitting the 'u' key and then typing his name.
|
||||
|
||||
![](https://farm4.staticflickr.com/3861/14494436719_b5536f7b67_z.jpg)
|
||||
|
||||
That is probably one of the major defaults of Soundcloud2000. While the navigation is not optimized, I have high hopes for improvements and support as the software is still very young.
|
||||
|
||||
### Bonus ###
|
||||
|
||||
Another alternative as a bonus: if you like the idea of using SoundCloud from a terminal, but do not want to install any additional software (or maybe you cannot), I advise you to go to [cmd.fm][6]. The website is a kind of camouflage for SoundCloud, as it hides it behind a shell interface.
|
||||
|
||||
[![](https://farm6.staticflickr.com/5580/14494448218_a16b05e3ee_z.jpg)][7]
|
||||
|
||||
Type "help" for a list of commands, which is a lot longer than for Soundcloud2000. As examples, I noticed:
|
||||
|
||||
- _genres to list all genres
|
||||
- _play random to play a random track
|
||||
- _pause to pause the current track
|
||||
- _playlist new to make a new playlist
|
||||
- _loop to loop current track
|
||||
- _cinema to watch and ASCII version of Star Wars which completely blew my mind.
|
||||
|
||||
And it even supports auto-completion via the tabulation key for genres.
|
||||
|
||||
To conclude, Soundcloud2000 is a neat program that does exactly what it is supposed to. We can forgive its current flaws as they are surely tied to its youth. I really hope that it will grow and include more features (and potentially get inspiration from cmd.fm).
|
||||
|
||||
If you like the idea, I invite you to support the programmers, and if you like these kinds of initiatives, support [Music Hack Day][8] which mixes software development and music.
|
||||
|
||||
What do you think of using SoundCloud from the command line? Please let us know in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/2014/07/access-soundcloud-command-line-linux.html
|
||||
|
||||
原文作者:[Adrien Brochard][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/adrien
|
||||
[1]:https://soundcloud.com/
|
||||
[2]:https://www.hackerleague.org/hackathons/music-hack-day-stockholm-13/
|
||||
[3]:https://aur.archlinux.org/packages/ruby-soundcloud2000/
|
||||
[4]:http://ask.xmodulo.com/upgrade-ruby-centos.html
|
||||
[5]:http://xmodulo.com/2013/01/how-to-set-up-rpmforge-repoforge-repository-on-centos.html
|
||||
[6]:https://cmd.fm/
|
||||
[7]:https://www.flickr.com/photos/xmodulo/14494448218/
|
||||
[8]:http://new.musichackday.org/
|
@ -0,0 +1,89 @@
|
||||
How to configure chroot SFTP in Linux
|
||||
================================================================================
|
||||
There are **some scenario** where system admin wants only few users should be allowed to transfer files to Linux boxes not ssh. We can achieve this by setting up **SFTP** in chroot environment.
|
||||
|
||||
### Background of SFTP & chroot : ###
|
||||
|
||||
**SFTP** stands for **SSH File Transfer protocol or Secure File Transfer Protocol**. SFTP provides file access, file transfer, and file management functionalities over any reliable data stream. When we configure SFTP in chroot environment , then only allowed users will be limited to their **home directory** , or we can say allowed users will be in jail like environment where they can’t even change their directory.
|
||||
|
||||
In article we will configure **Chroot SFTP in RHEL 6.X** & **CentOS 6.X**. We have one user ‘**Jack**’ , this users will be allowed to transfer files on linux box but no ssh access.
|
||||
|
||||
### Step:1 Create a group ###
|
||||
|
||||
[root@localhost ~]# groupadd sftp_users
|
||||
|
||||
### Step:2 Assign the secondary group(sftp_users) to the user. ###
|
||||
|
||||
If the users doesn’t exist on system , use below command :
|
||||
|
||||
[root@localhost ~]# useradd -G sftp_users -s /sbin/nologin jack
|
||||
[root@localhost ~]# passwd jack
|
||||
|
||||
For **already existing users** , use below usermod command :
|
||||
|
||||
[root@localhost ~]# usermod –G sftp_users -s /sbin/nologin jack
|
||||
|
||||
**Note** : if you want to change the **default home directory** of users , then use ‘**-d**’ option in useradd and usermod command and set the **correct permissions**.
|
||||
|
||||
### Step:3 Now edit the config file “/etc/ssh/sshd_config” ###
|
||||
|
||||
# vi /etc/ssh/sshd_config
|
||||
#comment out the below line and add a line like below
|
||||
#Subsystem sftp /usr/libexec/openssh/sftp-server
|
||||
Subsystem sftp internal-sftp
|
||||
|
||||
# add Below lines at the end of file
|
||||
Match Group sftp_users
|
||||
X11Forwarding no
|
||||
AllowTcpForwarding no
|
||||
ChrootDirectory %h
|
||||
ForceCommand internal-sftp
|
||||
|
||||
#### Where : ####
|
||||
|
||||
- **Match Group sftp_users** – This indicates that the following lines will be matched only for users who belong to group sftp_users
|
||||
- **ChrootDirectory %h** – This is the path(default user's home directory) that will be used for chroot after the user is authenticated. So, for Jack, this will be /home/jack.
|
||||
- **ForceCommand internal-sftp** – This forces the execution of the internal-sftp and ignores any command that are mentioned in the ~/.ssh/rc file.
|
||||
|
||||
Restart the ssh service
|
||||
|
||||
# service sshd restart
|
||||
|
||||
### Step:4 Set the Permissions : ###
|
||||
|
||||
[root@localhost ~]# chmod 755 /home/jack
|
||||
[root@localhost ~]# chown root /home/jack
|
||||
[root@localhost ~]# chgrp -R sftp_users /home/jack
|
||||
|
||||
If You want that jack user should be allowed to upload files , then create a upload folder with the below permissions ,
|
||||
|
||||
[root@localhost jack]# mkdir /home/jack/upload
|
||||
[root@localhost jack]# chown jack. /home/jack upload/
|
||||
|
||||
### Step:5 Now try to access the system & do testing ###
|
||||
|
||||
Try to access the system via ssh
|
||||
|
||||
![](http://www.linuxtechi.com/wp-content/uploads/2014/07/ssh-try.png)
|
||||
|
||||
As You can see below jack user is logged in via SFTP and can't change the directory becuase of chroot environment.
|
||||
|
||||
![](http://www.linuxtechi.com/wp-content/uploads/2014/07/sftp-login.png)
|
||||
|
||||
Now do the **uploading and downloading** testing as shown below:
|
||||
|
||||
![](http://www.linuxtechi.com/wp-content/uploads/2014/07/sftp-upload-download.png)
|
||||
|
||||
As we can see above , both uploading & downloading working fine for jack user.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxtechi.com/configure-chroot-sftp-in-linux/
|
||||
|
||||
原文作者:[Pradeep Kumar][a]
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxtechi.com/author/pradeep/
|
116
sources/tech/20140723 Top 10 Fun On The Command Line.md
Normal file
116
sources/tech/20140723 Top 10 Fun On The Command Line.md
Normal file
@ -0,0 +1,116 @@
|
||||
Top 10! Fun On The Command Line
|
||||
================================================================================
|
||||
**If you just love making 'top 10'-type lists but are a little embarrassed to say so, tell people you're passionate about data exploration. To impress them even more, explain that you do your data exploration on the command line. But don't ruin the impression by telling them how easy that is!**
|
||||
|
||||
In this article I'll do some data exploration with basic GNU/Linux tools and 'one-column tables', by which I mean simple lists. For more information on the commands used here, see their Linux 'man' pages, or ask for an explanation in the 'Comments' section.
|
||||
|
||||
### Passwords ###
|
||||
|
||||
The first list to explore is Mark Burnett's 2011 compilation of the [10000 most commonly used passwords][1]. The list is ordered most-frequent-first, and is one source of the widely known factoid that 'password' is the most commonly used password, with '123456' in second place. Here I've put the list in a file called passwords, and used the head command to show the first 10 lines:
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/1.png)
|
||||
|
||||
(Burnett explains how he collects his passwords [here][2]. Note that he converted all uppercase letters to lowercase in his list.)
|
||||
|
||||
OK, so 'password' is top of the Burnett list. What about individual digits?
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/2.png)
|
||||
|
||||
Interesting. The digit '1' appears in the password list more than twice as often as the next most-used digit, '2', and the 10 digits are in numerical as well as popularity order, except for 0 and 9. And the top 10 letters?
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/3.png)
|
||||
|
||||
The most frequent letters in the passwords file are EARONISTLC. That's not too far off EAIRTONSLC, which is the frequency pattern in at least [one published table][3] of letter usage in common English words. Does this mean that most passwords are actually common English words, maybe with a few digits thrown in?
|
||||
|
||||
To find out, I'll first convert passwords to a list of letters-only strings, then see how many of those strings are in an English dictionary.
|
||||
|
||||
First I'll delete all the digits in passwords with a **sed** command, then delete all the punctuation marks, then all the blank lines. This creates a list of letters-only passwords. Then I'll prune that list with **sort** and **uniq** to get rid of any duplicates. (For example, 'abc1234def' and 'abc1!2!3!def!' both reduce to 'abcdef'.) According to the wc command, my pruning reduces the 10000 passwords to 8583 letters-only strings:
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/4.png)
|
||||
|
||||
For a handy English dictionary I'll use the file `usr/share/dict/american-english`, which came with my Debian Linux distribution. It contains 99171 words. I'll first convert this wordlist to lowercase-only with the **tr** command, then delete any duplicate entries with **sort** and **uniq** (like 'A' and 'a' both becoming 'a'). That reduces the wordlist to 97723 entries:
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/5.png)
|
||||
|
||||
I can now ask the comm command with the '-23' option to compare the two lists and report just the words in the letters-only file that are not found in the dictionary:
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/6.png)
|
||||
|
||||
The total is 3137, so at least 8583 - 3137 = 5446 'core' passwords in Burnett's lowercase-only list (about 63%) are either plain English words, or plain English words with some digits or punctuation marks added. I wrote at least because a big proportion of the 3137 strings are only slight modifications of plain English words or names, or words or names missing from the /usr/share dictionary. Among the LA's, for example, are 'labtec', 'ladyboy', 'lakeside', 'lalakers', 'lalala', 'laserjet', 'lasvegas', 'lavalamp' and 'lawman'.
|
||||
|
||||
### Placenames ###
|
||||
|
||||
In a previous [Linux Rain article][4], I described how I built a table of Australian placenames with more than 370 000 entries. Using it, I can now answer vital questions like 'Is Round Hill the most popular name for hills in Australia?' and 'Is Sandy Beach tops for beaches, and Rocky Creek for creeks?'
|
||||
|
||||
The placename field in the gazetteer table is number 2, so here goes:
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/7.png)
|
||||
|
||||
Wow. I wasn't even close. (But note how I saved typing by using the **^string1^string2** command. It repeats the last command, but substitutes string2 for string1. Wonderful BASH trick!)
|
||||
|
||||
Another burning question is how many placenames there are with 'Mile' in them, like 'Six Mile Creek', and how they rank:
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/8.png)
|
||||
|
||||
I've noticed a lot of Dead Horse Creeks in my Australian travels, and so has the gazetteer:
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/9.png)
|
||||
|
||||
### Species ###
|
||||
|
||||
The third list to explore comes from a table I published this year of new Australian insect species named in the period 1961-2010. From the table I've pulled out all the 'species epithets', which are the second parts of genus-species combinations like Homo sapiens (you and me) and Apis mellifera (European honeybee).
|
||||
|
||||
(Tech note: The insects table, which is available from the open data Zenodo repository at [https://zenodo.org/record/10481][5], includes subspecies. For my 'top 10' exercise I first isolated all the unique genus-species combinations, to avoid duplication from subspecies like Apis mellifera iberica, Apis mellifera intermissa, etc. The final species file has 18155 species epithets.)
|
||||
|
||||
Most people who make jokes about scientific names use the '-us' ending, as in 'Biggus buggus'. What about entomologists? There are a couple of good, command-line ways to get the last 2 letters of a string, and here I've used both:
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/10.png)
|
||||
|
||||
Yep, entomologists prefer '-us', too. Next, I wonder how many species are named for my home State of Tasmania? (Below I ask head for the first 100 lines to make sure I get all the 'tasman' combinations.)
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/11.png)
|
||||
|
||||
How about Queensland?
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/12.png)
|
||||
|
||||
And generally speaking, what are the top 10 names in that insect species list?
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/13.png)
|
||||
|
||||
Hmm. Apart from the obvious 'australis' and 'australiensis', and the geographical 'occidentalis' (of the west), the other 7 epithets in the 10-most-popular list have been created by entomologists to honour other entomologists. (The epithet 'commoni' honors the Australian butterfly and moth specialist Ian F.B. Common, 1917-2006.)
|
||||
|
||||
### Speechifying ###
|
||||
|
||||
The commands used above work on simple lists. To make a simple list out a block of text, the command line is again your friend. For example, I've saved a rather filibustery [speech][6] in the Australian Senate on 16 July 2014 as the text file hansard. To split hansard into a list of words:
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/14.png)
|
||||
|
||||
And to look at word frequency in the speech:
|
||||
|
||||
![](http://thelinuxrain.com/content/01-articles/67-top-10-fun-on-the-command-line/15.png)
|
||||
|
||||
### Coming soon... ###
|
||||
|
||||
Doing 'top 10' and other rankings from multi-column tables requires a few more command-line tools. I'll demonstrate their use in a future article.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://thelinuxrain.com/articles/top-10-fun-on-the-command-line
|
||||
|
||||
原文作者:Bob Mesibov(Bob Mesibov is Tasmanian, retired and a keen Linux tinkerer.)
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:https://xato.net/passwords/more-top-worst-passwords/#.U8eD13AvDy0
|
||||
[2]:https://xato.net/passwords/how-i-collect-passwords/#.U8eEdnAvDy0
|
||||
[3]:http://www.rinkworks.com/words/letterfreq.shtml
|
||||
[4]:http://www.thelinuxrain.com/articles/building-a-gazetteer-table-from-kml-files
|
||||
[5]:https://zenodo.org/record/10481
|
||||
[6]:http://parlinfo.aph.gov.au/parlInfo/search/display/display.w3p;db=CHAMBER;id=chamber%2Fhansards%2F232fa1a8-d7e8-4b22-9018-1a99b5a96812%2F0025;query=Id%3A%22chamber%2Fhansards%2F232fa1a8-d7e8-4b22-9018-1a99b5a96812%2F0000%22
|
80
translated/talk/02 - The history of Android.md
Normal file
80
translated/talk/02 - The history of Android.md
Normal file
@ -0,0 +1,80 @@
|
||||
安卓编年史 02
|
||||
|
||||
=============================================================================
|
||||
![Left: the Milestone 5 home screen showing the “all" button, two dock icons, and four recent apps. Center: the home screen with the app list open. Right: the power menu.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/homescree052n.jpg)
|
||||
左边:里程碑 5,主屏幕展示了“All”按钮,两个dock图标,以及最近使用的四个应用。中间:主屏幕与打开的应用程序列表。右边:电源菜单。
|
||||
图片来自@Ron Amadeo
|
||||
|
||||
###Android0.5, 里程碑 5——如今已经是报废接口的领地了 ### -
|
||||
|
||||
“M5-RC14”构建后:也就是第一个仿真器发布,三个月之后Android迎来了她的首次重大革新。 2008年2月发布的“里程碑5”甩掉了发展中的黑莓界面,走向一个完全革新的设计——谷歌在手指触摸技术的第一次尝试。
|
||||
|
||||
由于浏览器的用户代理字符串的使用,此版本仍然被识别为“Android0.5”,但里程碑 5与Android的第一个版本相比已经完全不一样了。几个核心的Android功能直接追踪他们的血统最终还是会回到这个版本。通知面板的布局和功能几乎已经整装待发,并且,除了样式变化外,菜单同样也存在于它的最终组成。安卓1.0距离该项目起航的时间仅仅只有八个月,一个操作系统的基础已经开始形成了。
|
||||
|
||||
有一件东西绝对不会存在于最后的组成,那就是是主屏幕。这是一个不可配置的,单屏壁纸的应用程序的架子和空位。【译者注:"an app drawer and dock,",度娘直接是"应用程序的抽屉和码头,",没有搜到相关专业的词汇,求指点,感激。zsky@live.com】应用程序图标是天真活泼的,三种颜色的组合,由一个方形的、有圆角的白色背景包围着。应用程序的架子由在右下角的一个“All”按钮组成,轻按它,扩展的应用程序列表显示在了左边。这个“All”按钮正上面的是两个图标空位,“联系人”和“拨号器”分别获得了专属的永久主屏幕位置。然后上边有四个板块,它们是最近应用程序的早期版式,展示了最后访问的应用程序。没有了左画面或右画面,基座和最近的应用程序占用一整列,这种布局下21个正方形的应用程序才会填充满整个屏幕。模拟器仍然只选择同等最小的应用程序,但在实际的设备中,这样的设计并产生没有很好地工作效果。
|
||||
|
||||
按住“end call”按钮会出现一个超级早期版本的电源菜单,您可以在最右边的图片中看到的。谷歌迄今为止没有正常的智能手机命名术语:对于“Turn Off Screen”最好地形容也许是“Lock screen”(虽然当时没有锁屏)和“Turn Off Radio”在今天被叫做“Airplane Mode”。
|
||||
|
||||
![From left to right: the surprisingly modern notification panel, the menu open in Google Maps (Maps doesn't work anymore), and the new finger-friendly list view.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/noti2.png)
|
||||
从左至右依次为:令人惊喜的现代版通知面板,谷歌地图的菜单在打开着(地图已经不可用了),和新的适合手指操作的列表视图。
|
||||
照片来自@Ron Amadeo
|
||||
|
||||
所有的方式都会回溯到里程碑 5,谷歌在那时就毫无疑问拥有通知面板的基本知识储备。就像在任何现代的智能手机里看到的一样,它能够从屏幕顶部下拉下来。目前的通知都显示在列表中。通知面板的第一个版本是不透明的白色薄片带着棱纹的的“handle”在底部,一个橙色的圆点在中心。通知是可触的,通过触摸可以打开该通知关联的应用程序。没有人被在此列表中垂直对齐的应用程序图标所困扰,不过也没关系,随着在接下来的更新,它已经是过去式了。
|
||||
|
||||
点一下通知,进入一个在面板顶部的“on going”部分。在这个版本,这里似乎只包含打电话。在“Latest Event”里的通知只有打开相应的应用程序后才是清楚的。用户令人惊喜的通过内置的XMPP连接成功登录到谷歌talk。不过,虽然通知面板中显示“new chat message,”,其实这里并没有没有真正的即时消息应用程序。
|
||||
|
||||
里程碑 5里的艺术设计全部都是新的。该应用程序图标被重新绘制,并且菜单从一个无聊的黑莓风格的文本列表转变为一个大格全彩色、卡通的图标。通知面板图标也从简单的、突兀的、白色的图标切换到一个天真活泼的绿色设计。当时在信号栏指示器下边有一个奇怪的黑线,几乎没有作用。早期开发版本的微小列表视图不适合手指使用,所以里程碑 5开发了全面强大的整体布局。
|
||||
|
||||
![The dialer, recent calls, and an incoming call.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/phonestuff.png)
|
||||
拨号器,最近通话,和来电接听。
|
||||
照片来自@Ron Amadeo
|
||||
|
||||
M5是第一个有一个拨号器的版本,即使她是一个相当难看的版本。数字被显示在包含一个奇怪的语音气泡风格的退格键里,看上去就像是从其他界面回收回来的。对齐问题随处可见。按钮上的数字没有正确的垂直排列,而且退格键的“X”也没有与对话框对齐。由于屏幕上没有的“dial”按钮,你甚至不能从拨号程序打个电话,一个硬件按钮也被托管了。
|
||||
|
||||
里程碑 5 有几个选项卡式界面,所有这些都表明了一个非常奇怪的想法:标签应该如何工作。活跃的标签是白色的,而背景标签是拥有一小条白色在其边沿的黑色。后台标签应该是向下的“shrink”吗?切换标签时,是没有动画的。目前还不清楚这个设计试图想表达什么。
|
||||
|
||||
在第二张图片中显示的最近通话记录项,是从顶级的应用程序降级到拨号器选项卡的。它丢弃了早期版本的疯狂十字丝UI,多亏了大块列表视图,现在所有必要的信息都是显示在一个正常的列表。
|
||||
|
||||
不同于拨号器,来电画面只有即时屏幕上的按钮来接听和结束通话。奇怪的是,来电屏幕贴在显示器的底部,而不是顶部或中心。它可能是从旧的黑莓4:3屏幕遗留下来的。
|
||||
|
||||
![An active call, the disabled touchscreen error message, and the call screen with a second call on hold.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/callsstuff.png)
|
||||
通话中,触摸屏不可用的显示错误信息,和暂停通话的第二个呼叫的呼叫屏幕。
|
||||
照片来自@Ron Amadeo
|
||||
|
||||
通话中界面看起来正常,但在实践中毫无意义。今天,在通话中为了阻止你的脸按到屏幕按钮,手机近距离传感器一旦检测到相关信息会快速关闭屏幕。虽然里程碑 5不支持近距离传感器。谷歌的杂乱无章的解决方案是在通话过程中禁止整个触摸屏。与此同时,通话中的屏幕显然会彻底检查触摸功能。这时候是有大的,可触摸的按钮; *就是不让你摸!!*。
|
||||
|
||||
M5在这里让旧里程碑3版本的几个回归者占据特色地位。许多旧的接口里有体面相貌的图标被替换成了文本。像“mute”按钮不再提供屏幕上的反馈,过去他们是活跃的。合并通话被完全切掉了。
|
||||
|
||||
![The browser’s primary menu, the browser’s secondary menu, the crazy zoom control, and the window interface.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/browser4.png)
|
||||
浏览器的主要菜单,浏览器的二级菜单,疯狂的变焦控制和窗口界面。
|
||||
照片来自@Ron Amadeo
|
||||
|
||||
浏览器菜单中得到了一贯的触摸功能大修理,并且“more”按钮第一次出现。它充当一个[extra menu for your menu] [1]。而不是转动3x2的网格成3x4的网格,里程碑 5(和Android的许多后续版本一样)中使用很长的、滚动的列表来引出其他选项。不支持双指缩放(据说是[concession to Apple] [2]),因此Android运行着可笑的变焦控制外表,在上边第三张图片。而不是理智的比如是一个水平的、底部对齐变焦的控制,谷歌控制它直接出现在屏幕的中间。最后一张图片显示浏览器的“window”界面,允许你打开多个网页和两者之间轻松切换。
|
||||
|
||||
![Google Maps’ layers section screen, search interface, and directions screen.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/amps.png)
|
||||
谷歌地图的层级部分的屏幕,搜索界面,并指示屏幕。
|
||||
照片来自@Ron Amadeo
|
||||
|
||||
谷歌地图仍然不能使用,但我们访问的小小UI却有了显著更新。你可以挑选地图图层,虽然只有两种可以选择:卫星和交通。顶部对齐的搜索界面隐藏了奇怪的状态栏,而底部对齐方向没有隐藏状态栏。指示的输入按钮被标有“Go”,而且搜寻的输入按钮被标有一个奇怪的弯曲的箭头。这样的例子不胜枚举,并演示了老同学的Android在最坏时候的情况:在同一个应用程序,它的外观和工作方式类似的两个功能,但这些都实现为完全相反的方向。
|
||||
|
||||
----------
|
||||
|
||||
![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg)
|
||||
|
||||
[Ron Amadeo][a] / Ron是Ars Technica的评论编辑,他专注于Android操作系统和谷歌的产品。他总是在寻找一个新的小工具,喜欢分解事物来看看它们是如何工作的。
|
||||
|
||||
[@RonAmadeo][t]
|
||||
|
||||
-------------------------------------------------- ------------------------------
|
||||
|
||||
via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/2/
|
||||
|
||||
译者:[cereuz](https://github.com/cereuz)邮箱:[cereuz](mailto:sunedo@qq.com)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://i.imgur.com/GIYGTnb.jpg
|
||||
[2]:http://www.businessinsider.com/steve-jobs-on-android-founder-andy-rubin-big-arrogant-f-2013-11
|
||||
[a]:http://arstechnica.com/author/ronamadeo
|
||||
[t]:https://twitter.com/RonAmadeo
|
58
translated/talk/20140626 Joy of Programming--Fail Fast.md
Normal file
58
translated/talk/20140626 Joy of Programming--Fail Fast.md
Normal file
@ -0,0 +1,58 @@
|
||||
编程的乐趣:快速出错!
|
||||
================================================================================
|
||||
![](http://www.opensourceforu.com/wp-content/uploads/2011/12/fail-350x262.jpg)
|
||||
|
||||
> 当软件出现问题的时候,它应该以一种能引起注意的方式马上终止。这种“快速出错”的方式值得借鉴,我们会在这期专栏里谈谈这个重要的概念。
|
||||
|
||||
一开始,“快速出错”看上去是一种会影响可靠性的不好的实践-为什么一个系统在还可以继续运行的时候要崩溃(或者说终止)?对于这个,我们需要理解,快速出错是和Heisenbugs(对于不能复现bug的一种称呼)紧密联系在一起的。
|
||||
|
||||
考虑一下Bohrbugs(对于能够重现的bug的一种称呼),它们在给定输入的时候总是会出现,比如,访问空指针。这类问题很容易测试,复现并修复。如今,所有有经验的程序员应该都面对过这样的情形,导致崩溃的bug在重启软件后不再出现了。不管花多少时间或努力去重现问题,那个bug就是跟我们捉迷藏。这种bug被称为Heisenbugs。
|
||||
|
||||
花在寻找,修复和测试Heisenbugs上的努力比起Bohrbugs来说,要高出一个数量级。一种避免Heisenbugs的策略是将它们转化为Bohrbugs。怎么做呢?预测可能导致Heisenbugs的因素,然后尝试将它们变成Bohrbugs。是的,这并不简单,而且也并不是一定就能成功,但是让我们来看一个能产生效果的特殊例子。
|
||||
|
||||
并发编程是Heisenbugs经常出现的一个典范。我们的例子就是一个Java里和并发相关的问题。在遍历一个Java集合的时候,一般要求只能通过Iterator的方法,比如remove()方法。而当遍历的时候,如果有另一个线程尝试修改底层集合(因为编程时留下的错误),那么底层集合就可能会被破坏(例如,导致不正确的状态)。
|
||||
|
||||
类似这种不正确的状态会导致不确定的错误-假如我们幸运的话(实际上,这很不幸!),程序可以继续执行而不会崩溃,但是却给出错误的结果。这种bug很难重现和修复,因为这一类的程序错误都是不确定的。换句话说,这是个Heisenbug。
|
||||
|
||||
幸运的是,Java Iterators会尝试侦测这种并发修改,在发现了以后,会丢出异常`ConcurrentModificationException`,而不是等到最后再出错-那样也是没有任何迹象的。换句话说,Java Iterators也遵从了“快速出错”的方法。
|
||||
|
||||
如果异常`ConcurrentModificationException`在正式软件中发生了呢?根据在Javadoc里对这个异常的说明,它“只应该用于侦测bug”。换句话说,`ConcurrentModificationException`只应该在开发阶段监听和修复,而不应该泄漏到正式代码中。
|
||||
|
||||
好吧,如果正式软件确实发生了这个异常,那它当然是软件中的bug,应当报告给开发者并修复。至少,我们能够知道发生了一次底层数据结构的并发修改,而这是软件出错的原因(而不是让软件产生错误的结果,或是以其他现象延后出错,这样就很难跟踪到根本原因)。
|
||||
|
||||
“安全出错”的方法意味着开发健壮的代码。一个很好的编写安全出错代码的例子就是使用断言。很可惜的是,关于断言的使用有大量不必要的公开争论。其中主要的批评点是:它在开发版本中使用,而在发布版中却被关掉的。
|
||||
|
||||
不管怎么样,这个批评是错误的:从来没有说用断言来替代应该放到发布版软件中的防御式检查代码。例如,断言不应该用来检查传递给函数的参数是否为空。相应的,应该用一个if语句来检查这个参数是否正确,否则的话抛出异常,或是提前返回,来适合上下文。然而,断言一般用于额外检查代码中所做出的假设,它们应该为真才正常。例如,用一个语句来检查在进行了入栈操作后,栈应该不是空的(例如,对“不变量”的检查)。
|
||||
|
||||
所以,快速出错,随时中断,那么你已经走在开发更加健壮代码的道路上了。
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via:http://www.opensourceforu.com/2011/12/joy-of-programming-fail-fast/
|
||||
|
||||
译者:[zpl1025](https://github.com/zpl1025) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:
|
||||
[2]:
|
||||
[3]:
|
||||
[4]:
|
||||
[5]:
|
||||
[6]:
|
||||
[7]:
|
||||
[8]:
|
||||
[9]:
|
||||
[10]:
|
||||
[11]:
|
||||
[12]:
|
||||
[13]:
|
||||
[14]:
|
||||
[15]:
|
||||
[16]:
|
||||
[17]:
|
||||
[18]:
|
||||
[19]:
|
||||
[20]:
|
@ -1,128 +0,0 @@
|
||||
如何拯救一台没有成功通过Grub启动的Linux电脑
|
||||
================================================================================
|
||||
![Figure 1: GRUB 2 menu with cool Apollo 17 background.](http://www.linux.com/images/stories/41373/grub-command-shell.jpg)
|
||||
Figure 1: GRUB 2 menu with cool Apollo 17 background.
|
||||
|
||||
自从我们拥有GRUB以来,Linux Bootloader 0.97就开始了传奇的一生。尽管传统的GRUB有很多的有点,但是他开始陈旧了,并且他的开发者也开始添加更多的功能,于是,Grub2.0时代就要来了。
|
||||
|
||||
GRUB 2 做了几个明显的改进。它可以从移动存储设备上启动,并且可以有进入BIOS配置的选项。尽管它有着更复杂的脚本配置,但是一个简单的`/boot/grub/menu.lst`文件却一个地方集中了所有配置选项,默认的是存放在`/boot/grub/grub.cfg `。你不能直接编辑,这不是人做的事,太复杂,我们需要用简单的脚本实现。我们卑微的人类可以编辑`/etc/default/grub`文件来修改,它主要是控制Grub菜单。我们还可以修改` /etc/grub.d/ `。这些脚本可以启动操作系统,控制外部应用程序,如memtest 和 os_prober,还有theming `./boot/grub/grub.cfg`是建立在`/etc/default/grub`和`/etc/grub.d/*`的基础上的。当你修改了一个地方,你必须要运行更新GRUB的命令。
|
||||
|
||||
好消息是,update-grub脚本是可以可靠的检测内核,启动文件,并添加所有的操作系统的,自动生成你的启动菜单,所以你不必手动的修改他们。
|
||||
|
||||
我们还要学习如何解决两个常见的故障。当启动系统时,它会停在GRUB >提示上,这是完整的GRUB 2命令界面,所以不要惊慌。这意味着GRUB 2依旧可以正常启动和加载normal.mod模块(和其他模块分别位于/boot/grub/[arch]/),但没有找到你的grub.cfg文件。如果你看到grub rescue> 这意味着它无法找到normal.mod,因此它有可能找不到你的启动文件。
|
||||
|
||||
这是如何发生的?因为内核可能改变驱动器分配或您移动您的硬盘驱动器,或者你手动改变一些分区,或安装一个新的操作系统或者移动一些文件。在这些情况下你的启动文件仍然存在,但GRUB不能找到他们。所以你可以看看在GRUB提示符中启动文件,设置它们的位置,然后启动您的系统和修复您的grub配置。
|
||||
|
||||
### GRUB 2 命令行 ###
|
||||
|
||||
GRUB 2 命令是一个伟大的财富。你不仅可以用它来发现引导镜像,内核,和根文件系统。事实上,它给你完全访问本地计算机上的所有文件的系统权限。其中有些人可能会认为一个安全漏洞,但是你知道古老的UNIX的名言:有物理访问机器权限的人,就是拥有它的人。
|
||||
|
||||
当你在` GRUB > `提示时,你有许多类似的功能,如命令如历史和tab补全。但是`grub rescue> `模式是有限的,没有历史,没有tab补全。
|
||||
|
||||
如果你是在一个正常运作的系统上练习,那就当GRUB菜单打开GRUB命令行时,按C。你可以通过向上和向下滚动你的菜单条目箭头键停止启动倒计时。它是安全的,在此GRUB命令行下,你不会进行永久的修改,一切都是暂时的。如果你已经看到`grub > `或`grub rescue> `提示符,那就说明你的表现时刻到了。
|
||||
|
||||
接下来的几个命令可以在`grub>`和`grub rescue`模式下运行。同时,你应该第一个运行的命令如下:
|
||||
|
||||
grub> set pager=1
|
||||
|
||||
等号两侧必须不能出现空格。现在让我们做一点探讨。ls列出的所有分区:
|
||||
|
||||
grub> ls
|
||||
(hd0) (hd0,msdos2) (hd0,msdos1)
|
||||
|
||||
MSDOS是什么?这意味着该系统具有老式的MS-DOS分区表,而不是全新的全局唯一标识符的分区表(GPT)。(见[Using the New GUID Partition Table in Linux (Goodbye Ancient MBR)][1]。如果你正在运行的GPT,它会出现(hd0,GPT1)。使用ls命令查看你的系统文件是什么:
|
||||
|
||||
grub> ls (hd0,1)/
|
||||
lost+found/ bin/ boot/ cdrom/ dev/ etc/ home/ lib/
|
||||
lib64/ media/ mnt/ opt/ proc/ root/ run/ sbin/
|
||||
srv/ sys/ tmp/ usr/ var/ vmlinuz vmlinuz.old
|
||||
initrd.img initrd.img.old
|
||||
|
||||
好的,我们已经找到了根文件系统。你可以省略MSDOS和GPT的标签。如果你无视打印的分区信息。你可以用cat命令读取文件系统上的文件:
|
||||
|
||||
grub> cat (hd0,1)/etc/issue
|
||||
Ubuntu 14.04 LTS \n \l
|
||||
|
||||
从/etc/issue文件中,可以看到你的不同的Linux系统
|
||||
|
||||
### 从 grub> 中启动###
|
||||
|
||||
这是如何设置启动文件和启动从`GRUB>`提示中进入系统。我们知道,从运行ls命令有一个Linux根文件系统(hd0,1),你可以继续寻找直到你找到你的/boot/grub所在位置。然后运行这些命令,使用您自己的根分区,内核和initrd映像:
|
||||
|
||||
grub> set root=(hd0,1)
|
||||
grub> linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1
|
||||
grub> initrd /boot/initrd.img-3.13.0-29-generic
|
||||
grub> boot
|
||||
|
||||
第一行设置分区的根文件系统是。第二行告诉grub您想要使用的内核位置。开始输入/boot/vmli,然后使用tab完成填写。输入`root= /dev/sdX`设置根文件系统位置。是的,这似乎是多余的,但如果你忘记了输入你会得到一个kernel panic。你知道怎么正确的分区?hd0,1 = /dev/sda1。hd1,1 = /dev/sdb1。hd3,2 = /开发/ sdd2。我想你可以推出自己的。
|
||||
|
||||
第三行设置initrd文件,必须是和内核相同的版本号。
|
||||
|
||||
最后一行启动系统。
|
||||
|
||||
在一些Linux系统上,内核和initrds是被符号链接到当前的根文件系统的根目录,就像:
|
||||
|
||||
$ ls -l /
|
||||
vmlinuz -> boot/vmlinuz-3.13.0-29-generic
|
||||
initrd.img -> boot/initrd.img-3.13.0-29-generic
|
||||
|
||||
所以,你也可以这样输入命令:
|
||||
|
||||
grub> set root=(hd0,1)
|
||||
grub> linux /vmlinuz root=/dev/sda1
|
||||
grub> initrd /initrd.img
|
||||
grub> boot
|
||||
|
||||
### 从grub-rescue> 中启动 ###
|
||||
|
||||
你必须要加载两个模块normal.mod 和 linux.mod,如果你的GRUB命令不同于大众。
|
||||
|
||||
grub rescue> set prefix=(hd0,1)/boot/grub
|
||||
grub rescue> set root=(hd0,1)
|
||||
grub rescue> insmod normal
|
||||
grub rescue> normal
|
||||
grub rescue> insmod linux
|
||||
grub rescue> linux /boot/vmlinuz-3.13.0-29-generic root=/dev/sda1
|
||||
grub rescue> initrd /boot/initrd.img-3.13.0-29-generic
|
||||
grub rescue> boot
|
||||
|
||||
tab补全应该在你加载了这几个模块之后开始工作。
|
||||
|
||||
### 永久性的修复 ###
|
||||
|
||||
当你成功地启动你的系统,运行这些命令来永久修复GRUB:
|
||||
|
||||
# update-grub
|
||||
Generating grub configuration file ...
|
||||
Found background: /usr/share/images/grub/Apollo_17_The_Last_Moon_Shot_Edit1.tga
|
||||
Found background image: /usr/share/images/grub/Apollo_17_The_Last_Moon_Shot_Edit1.tga
|
||||
Found linux image: /boot/vmlinuz-3.13.0-29-generic
|
||||
Found initrd image: /boot/initrd.img-3.13.0-29-generic
|
||||
Found linux image: /boot/vmlinuz-3.13.0-27-generic
|
||||
Found initrd image: /boot/initrd.img-3.13.0-27-generic
|
||||
Found linux image: /boot/vmlinuz-3.13.0-24-generic
|
||||
Found initrd image: /boot/initrd.img-3.13.0-24-generic
|
||||
Found memtest86+ image: /boot/memtest86+.elf
|
||||
Found memtest86+ image: /boot/memtest86+.bin
|
||||
done
|
||||
# grub-install /dev/sda
|
||||
Installing for i386-pc platform.
|
||||
Installation finished. No error reported.
|
||||
|
||||
当你运行 `grub-install` 时,记得grub是安装到硬盘驱动器的引导扇区而不是到一个具体分区,所以不要加上像/dev/sda1的分区号。
|
||||
|
||||
### 如果还是不能使用 ###
|
||||
|
||||
如果你的系统是如此的倒霉,而且这个方式没有能起作用,那就尝试[超级GRUB2现场救援磁盘][2]。[官方GNU GRUB手册][3]也应该是有帮助的。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linux.com/learn/tutorials/776643-how-to-rescue-a-non-booting-grub-2-on-linux
|
||||
|
||||
译者:[MikeCoder](https://github.com/MikeCoder) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.linux.com/learn/tutorials/730440-using-the-new-guid-partition-table-in-linux-good-bye-ancient-mbr-
|
||||
[2]:http://www.supergrubdisk.org/
|
||||
[3]:https://www.gnu.org/software/grub/manual/grub.html
|
@ -0,0 +1,131 @@
|
||||
在Linux中模拟击键和鼠标移动
|
||||
================================================================================
|
||||
你是否曾经拥有一个梦
|
||||
——你的计算机
|
||||
可以自动为你干活?
|
||||
或许,并非因为
|
||||
你刚看了终结者。
|
||||
然而,除此之外
|
||||
脚本和任务自动化
|
||||
是每个高级用户追寻的梦
|
||||
如果今天
|
||||
有许多的解决方案
|
||||
可以满足这个目标
|
||||
那么
|
||||
有时候
|
||||
就难以从那众多之中采撷那
|
||||
简洁、聪明而又高效的一个
|
||||
我
|
||||
不能假装
|
||||
是我自己发现了它
|
||||
而与此同时
|
||||
却偏爱着那个
|
||||
整洁的软体——xdotool
|
||||
其方法是如此直观
|
||||
正如它作为X11自动化工具的表露
|
||||
转换思想
|
||||
xdotool可以通过读取文本文件
|
||||
模拟击键的旋律
|
||||
以及鼠标的曼舞
|
||||
|
||||
|
||||
### 让Xdotool在Linux定居 ###
|
||||
对于Ubuntu,Debian或者Linux Mint,你能够只做:
|
||||
|
||||
$ sudo apt-get install xdotool
|
||||
|
||||
对于Fedora,请使用yum命令:
|
||||
|
||||
$ sudo yum install xdotool
|
||||
|
||||
对于CentOS用户,可以在[EPEL repo][1]中找到该包。在启用EPEL仓库后,只要使用上面的yum命令就可以达成你的愿望。
|
||||
|
||||
对于Arch用户,可在Community仓库中找到该包:
|
||||
|
||||
$ sudo pacman -S xdotool
|
||||
|
||||
如果你还是找不到你的发行版的对应xdotool,你可以从它的[官方站点][2]下载。
|
||||
|
||||
### Xdotool基本功 ###
|
||||
|
||||
虽然xdotool是那样的直观,但它仍然是个脚本程序。因此,为了要正确地使用它,你还是得了解它的语法。不过敬请放心,相对于程序的功能而言,语法还是比较简单易学的。
|
||||
|
||||
首先,模拟击键是很容易的。你可以从终端敲入下面的命令:
|
||||
|
||||
$ xdotool key [name of the key]
|
||||
|
||||
如果你想要连接两个键,可以在它们之间使用“+”操作符。它看起来像这样:
|
||||
|
||||
$ xdotool key alt+Tab
|
||||
|
||||
这两个组合键可以为你切换窗口。
|
||||
|
||||
要想让xdotool帮你输入,可以使用以下命令:
|
||||
|
||||
$ xdotool type ''
|
||||
|
||||
这些对于基本的击键而言已经足够了。但是,xdotool的众多长处之一,就是它可以获取特定窗口的焦点。它可以获取右边的窗口,然后在里面输入,同时阻止所有你记录的按键,让那些动作随风而逝吧。要获得该功能,一个简单的命令可以搞定:
|
||||
|
||||
$ xdotool search --name [name of the window] key [keys to press]
|
||||
|
||||
该命令将在打开的窗口中搜索对应名称的窗口,并聚焦于该窗口,然后模拟击键。
|
||||
|
||||
来点更高级的,但很有用哦,xdotool可以模拟鼠标移动和点击,看这命令:
|
||||
|
||||
$ xdotool mousemove x y
|
||||
|
||||
你可以将光标定位到屏幕坐标(x,y)(像素)。你也可以使用“click”参数来组合:
|
||||
|
||||
$ xdotool mousemove x y click 1
|
||||
|
||||
这会让鼠标移动到(x,y),然后点击鼠标左键。“1”代表鼠标左键,“2”则是滚轮,“3”则是右键。
|
||||
|
||||
最后,一旦你这些命令根植于你脑海,你也许想要实际转储于文件来编辑并试着玩玩。鉴于此,就会有超过一个语句以上的内容了。你可以写的就是一个bash脚本了:
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
xdotool [command 1]
|
||||
xdotool [command 2]
|
||||
etc
|
||||
|
||||
或者你可以使用:
|
||||
|
||||
$ xdotool [filename]
|
||||
|
||||
这里你将命令写入到一个独立的文件中,然后通过将文件名作为xdotool命令的参数。
|
||||
|
||||
### 意外收获 ###
|
||||
|
||||
作为本文的一个意外收获,这里是xdotool的一个具体实例。你可能听说过,也可能没听说过Bing,微软的搜索引擎。在后面的实例中,你从没听过Bing奖励吧:一个程序,可以让你用Bing积分兑取亚马逊的礼物卡和其它的一些礼物卡。要赚取这些积分,你可以每天在Bing上搜索累计达30次,每次搜索你都会获得0.5个积分。换句话说,你必须把Bing设为默认搜索引擎,并每天使用它。
|
||||
|
||||
或者,你可以使用xdotool脚本,在这个脚本中,会自动聚焦到Firefox(你可以用你喜欢的浏览器来取代它),并使用fortune命令生成一些随机单词来实施搜索。大约30秒之内,你的日常搜索任务就完成了。
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
for i in {1..30}
|
||||
do
|
||||
WID=`xdotool search --title "Mozilla Firefox" | head -1`
|
||||
xdotool windowfocus $WID
|
||||
xdotool key ctrl+l
|
||||
xdotool key Tab
|
||||
SENTENCE="$(fortune | cut -d' ' -f1-3 | head -1)"
|
||||
xdotool type $SENTENCE
|
||||
xdotool key "Return"
|
||||
sleep 4
|
||||
done
|
||||
|
||||
|
||||
下面来个小结吧:我真的很喜欢xdotool,即便它完整功能超越了本文涵盖的范围。这对于脚本和任务自动化而言,确实是种平易的方式。负面的问题是,它可能不是最有效率的一个。但我要再说一遍,它忠于职守了,而且学习起来也不是那么麻烦。
|
||||
|
||||
你对xdotool怎么看呢?你是否更喜欢另外一个自动化工具,而不是它呢?为什么呢?请在评论中告诉我们吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/2014/07/simulate-key-press-mouse-movement-linux.html
|
||||
|
||||
译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://xmodulo.com/2013/03/how-to-set-up-epel-repository-on-centos.html
|
||||
[2]:http://www.semicomplete.com/projects/xdotool/
|
@ -0,0 +1,64 @@
|
||||
Ubuntu 14.04中修复默认启用HDMI后没有声音的问题
|
||||
================================================================================
|
||||
|
||||
声音问题在Ubuntu中是老生常谈了。先前我已经在[修复Ubuntu中的“无声”问题][1]一文中写到了多种方法,但是我在此正要谈及的声音问题跟在另外一篇文章中提到的有所不同。
|
||||
|
||||
因此,我安装了Ubuntu 14.04,实际上是重新安装了一遍。一如既往,我将[全新安装Ubuntu 14.04后要做的事][2]全部又重新做了一遍。然后,我意识到系统突然失声了。当我正侦查问题所在之时,我发现了一件奇怪的事情。我检查了[alsamixer][3],发现它的状况有点离奇。
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/06/alsamixer_Set_HDMI_Default.jpeg)
|
||||
|
||||
正如你能看到的,**alsamixer中默认设置了HDMI**。这意味着默认情况下将使用HDMI输出,而不是内置扬声器。这就是我从系统上内置扬声器无法获得声音的原因。
|
||||
|
||||
使用下面的命令来检查alsamixer的状态:
|
||||
|
||||
alsamixer
|
||||
|
||||
如果alsamixer默认设置成了HDMI或者其它声音输出,那就继续读下去吧,看看我们是怎么来修复这个问题的。
|
||||
|
||||
### 修复默认设置成HDMI时Ubuntu的失声问题 ###
|
||||
|
||||
现在来强制Ubuntu使用模拟输出来取代默认的HDMI,但我们还需要一点点信息。打开终端,然后使用下列命令:
|
||||
|
||||
aplay -l
|
||||
|
||||
这会列出设备,卡号之类的东西。注意,向下检查模拟输出使用的卡和设备编号。我的输出如下所示:
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2014/07/AlsaMixer_List_Device.jpeg)
|
||||
|
||||
一旦你取得了所需的卡和设备编号,重新构建一个配置文件:
|
||||
|
||||
sudo gedit /etc/asound.conf
|
||||
|
||||
上面的命令也会打开文件,将下面两行添加进去,当然将卡和设备编号替换成你自己的:
|
||||
|
||||
defaults.pcm.card 1
|
||||
defaults.pcm.device 0
|
||||
|
||||
保存文件,并重启计算机。现在,你应该听到声音了吧。需要提一下的是,这对所有的Linux发行版都有效,如Linux Mint,Elementary OS,Fedora,Arch Linux等等都可以。正如我之前所说,该“失声疗法”仅针对HDMI被设置为默认设备的情况。对于其它情况,你可以阅读[关于在Ubuntu和Linux Mint中修复失声问题这篇文章][4]。
|
||||
|
||||
您可以尽情发表评论来告诉我这个方法是否有疗效,或者您有更好的方法来处理该问题,也可以告诉我。再见了!
|
||||
|
||||
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-includes/images/smilies/icon_smile.gif)
|
||||
|
||||
----------
|
||||
|
||||
![](http://1.gravatar.com/avatar/20749c268f5d3e4d2c785499eb6a17c0?s=100&r=pg&d=mm)
|
||||
|
||||
关于Abhishek
|
||||
|
||||
我是Abhishek Prakash,It's F.O.S.S.的“创立者”,我有一个通信系统工程的硕士学位。我酷爱Linux和开源。我使用Ubuntu,信奉知识分享。除了Linux之外,我也喜爱经典的侦探推理小说,是Agatha Christie作品的超级粉丝。大家尽可以在[Google+][g]上将我圈进去,并追随[@abhishek_pc][t]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://itsfoss.com/fix-sound-ubuntu-1404/
|
||||
|
||||
译者:[GOLinux](https://github.com/GOLinux) 校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://itsfoss.com/fix-sound-ubuntu-1304-quick-tip/
|
||||
[2]:http://itsfoss.com/things-to-do-after-installing-ubuntu-14-04/
|
||||
[3]:http://en.wikipedia.org/wiki/Alsamixer
|
||||
[4]:http://itsfoss.com/fix-sound-ubuntu-1304-quick-tip/
|
||||
[g]:https://plus.google.com/u/0/110180944531110746460
|
||||
[t]:https://twitter.com/abhishek_pc
|
@ -1,26 +1,29 @@
|
||||
利用终端(Terminal)在Debian/Ubuntu中设置默认浏览器
|
||||
[快速技巧]利用终端在 Debian/Ubuntu 中设置默认浏览器
|
||||
================================================================================
|
||||
嘿,伙计们
|
||||
|
||||
在这篇文章中,我们将使用终端设置默认浏览器
|
||||
![img](http://180016988.r.cdn77.net/wp-content/uploads/2014/07/Browsers-790x436.jpg)
|
||||
|
||||
嘿,伙计们!
|
||||
|
||||
虽然,可以很方便地使用浏览器主界面来设置为默认浏览器,但是有时,你需要远程做到这一点
|
||||
在这篇文章中,我们将使用终端设置默认浏览器。
|
||||
|
||||
要做到这一点,你只需简简单单的打开终端,然后执行下述的命令:
|
||||
虽然,使用浏览器主界面来设置默认浏览器很方便,但是有时,你需要远程来操作。
|
||||
|
||||
要做到这一点,你只需打开终端,然后执行下述命令:
|
||||
```
|
||||
sudo update-alternatives --config x-www-browser
|
||||
```
|
||||
之后输入你想设置为默认的浏览器的号码,你就完成了!
|
||||
之后输入你想设置为默认浏览器的号码,这样就搞定了!
|
||||
|
||||
真个过程截图如下:
|
||||
截图如下:
|
||||
|
||||
![图片1](https://camo.githubusercontent.com/7eae55f5fac41634017c1fb5a8bd9cb634a86dc4/687474703a2f2f3138303031363938382e722e63646e37372e6e65742f77702d636f6e74656e742f75706c6f6164732f323031342f30372f6368616e67655f64656661756c745f62726f777365725f66726f6d5f7465726d696e616c5f64656269616e5f656e6f636b2e706e67)
|
||||
|
||||
你成功了吗?
|
||||
成功了吗?
|
||||
|
||||
---
|
||||
via: http://www.unixmen.com/quick-tip-set-default-browser-debianubuntu-using-terminal/
|
||||
|
||||
译者:译者ID 校对:校对者ID
|
||||
译者:[su-kaiyao](https://github.com/su-kaiyao) 校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 LCTT 原创翻译,Linux中国 荣誉推出
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,109 @@
|
||||
5个让Cinnamon桌面环境完美运行在ubuntu上的方法
|
||||
=======================================================================
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/des.jpg)
|
||||
|
||||
**Cinnamon桌面环境最新稳定版本发行了,[ubuntu用户可以去安装使用了][1]**
|
||||
|
||||
在其安装后的基础上,我们可以做一些微调来拥有更棒的体验
|
||||
|
||||
你的ubuntu如果没有安装Cinnamon,你可以参照我们之前的文章进行安装
|
||||
|
||||
###更改Mint菜单图标###
|
||||
Mint菜单图标是Cinnamon的特色之一,它给予用户一种简单,快速,熟悉的方式来搜索,打开,组织应用程序,默认情况下,菜单使用启动程序项中的Linux
|
||||
Mint
|
||||
Logo。既然你是在ubuntu系统下使用它,而不是Mint,为什么不使用ubuntu熟悉的橙色朋友圈logo来替换原有的菜单图标呢?实现很简单
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/min-menu.jpg)
|
||||
|
||||
想要改变Cinnamon菜单图标为ubuntu风格的,只需点击applet,选择‘config‘,在设置窗口,就会出现‘Use
|
||||
a custom icon‘,然后你就输入下面的路径来使用ubuntu logo了
|
||||
|
||||
/usr/share/icons/ubuntu-mono-dark/actions/24/package-supported.svg
|
||||
|
||||
你可以使用任何支持的图片类型,只需要在刚才的填写区域写入正确的图片路径,或者点击后面的方框来打开文件选择器,选择你要使用的图标
|
||||
|
||||
###尝试Cinnamon主题###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/cinnamon-themes-zukitwo.jpg)
|
||||
|
||||
和GNOME
|
||||
Shell一样,Cinnamon也支持自定义主题,我所说的主题并不只是应用程序的GTK主题和简单的窗口装饰,而是将面板,菜单,程序等等结合为一个整体的视觉风格
|
||||
|
||||
Cinnamon主题可以被浏览,下载甚至不需要离开桌面的就触手可及 —
|
||||
无需下载或者手动安装:打开Cinnamon Settings tool中的Appearance
|
||||
pane,然后选择‘Online Themes‘
|
||||
|
||||
下面是一些受欢迎的主题:
|
||||
|
||||
- [**Android Holo**][2] — Android 4.x style theme
|
||||
- [**Zukitwo**][3] — Sleek, stylish and light
|
||||
- [**Minty**][4] — Dark theme with bold green accents
|
||||
- [**Metro**][5] — Based on the visual style of Windows 8.
|
||||
|
||||
###找出你最喜欢的布局###
|
||||
|
||||
我们统一认为应用程序发射器永远只是固定地待在屏幕的一侧,但是Cinnamon并没有这样的顾虑,它可以让你重新设计最符合你的桌面布局
|
||||
|
||||
手动面板可以增加,编辑和移动,或选择三种预设的布局
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/traditional.jpg)
|
||||
|
||||
打开`Settings > Panel > Layout Options > Panel Layout`,然后下面这几个中选择
|
||||
|
||||
- Traditional — 这是默认的布局,控制面板在屏幕的顶部
|
||||
- Flipped ——和Traditional一样,控制面板在屏幕顶部
|
||||
- Classic ——两个控制面板,一个在顶部,一个在底部
|
||||
|
||||
你需要注销或者重启Cinnamon才能生效
|
||||
|
||||
###添加面板小程序###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/weather-applet.png)
|
||||
|
||||
Cinnamon和GNOE
|
||||
Shell一样具有可扩展性,丰富的社区插件和扩展程序提供了额外的特性和功能,比如天气,系统监测,窗口管理工具等,这些都可以被浏览,安装并能从桌面直接启动
|
||||
|
||||
选择控制面板,右键点击要添加小程序,选择 ‘…Add Appls to the
|
||||
Panel‘,一些著名的小程序如下:
|
||||
|
||||
- [**Weather**][6] - does what it forecasts (ho ho)
|
||||
- [**Stark Menu**][7] - Clone of the Windows 7 Start Menu
|
||||
- [**Screenshot**][8] — Easy way to grab screenshots with delay
|
||||
|
||||
###改变日期的显示格式###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/applet.jpg)
|
||||
|
||||
Cinnamon的时间日期程序很方便,它可以让你很容易就记住日期
|
||||
|
||||
但是它显示时间的默认格式是24小时制,但是我们很容易就能调整时钟格式
|
||||
|
||||
右击然后选择‘Configure‘,在设置窗口中出现“Use a custom date
|
||||
format“的选择框上打勾,或者使用下面的几种格式(复制粘帖粗体字段)
|
||||
|
||||
- **%B %e, %I:%M %p** (July 13, 7:19 PM)
|
||||
- **%m/%d/%Y** (07/13/2014)
|
||||
- **%l:%M %p** (7:19 PM)
|
||||
|
||||
改变立马生效,如果中途发生了错误,你可以取消自定义时间格式选项恢复到默认状态
|
||||
|
||||
###更多###
|
||||
|
||||
在Cinnamon桌面环境中只有少部分定制选择供使用者使用,但是我们认为上述所讲的调整是不断探索的很好跳板,通过下面的评论栏让我们了解你最喜欢的调整是什么吧,你可以通过Facebook或者Google+
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/07/5-things-installing-cinnamon-ubuntu
|
||||
|
||||
译者:[su-kaiyao](https://github.com/su-kaiyao) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.omgubuntu.co.uk/2014/07/new-cinnamon-ubuntu-14-04-ppa-stable
|
||||
[2]:http://cinnamon-spices.linuxmint.com/themes/view/122
|
||||
[3]:http://cinnamon-spices.linuxmint.com/themes/view/219
|
||||
[4]:http://cinnamon-spices.linuxmint.com/themes/view/25
|
||||
[5]:http://cinnamon-spices.linuxmint.com/themes/view/188
|
||||
[6]:http://cinnamon-spices.linuxmint.com/applets/view/17
|
||||
[7]:http://cinnamon-spices.linuxmint.com/applets/view/168
|
||||
[8]:http://cinnamon-spices.linuxmint.com/applets/view/35
|
@ -1,24 +1,24 @@
|
||||
7 ‘dmesg’ Commands for Troubleshooting and Collecting Information of Linux Systems
|
||||
================================================================================
|
||||
The ‘dmesg‘ command displays the messages from the kernel ring buffer. A system passes multiple runlevel from where we can get lot of information like system architecture, cpu, attached device, RAM etc. When computer boots up, a kernel (core of an operating system) is loaded into memory. During that period number of messages are being displayed where we can see hardware devices detected by kernel.
|
||||
在linux系统中处理故障和收集系统信息的7种‘dmesg’的用法
|
||||
==========================================================
|
||||
‘dmesg’命令显示linux内核的环形缓冲区信息,我们可以从中获得诸如系统架构,cpu,挂载的硬件,RAM等多个运行级别的大量的系统信息。当计算机启动时,系统内核(操作系统的核心部分)将会被加载到内存中。在加载的过程中会显示很多的信息,在这些信息中我们可以看到内核检测硬件设备。
|
||||
|
||||
![dmesg Command Examples](http://www.tecmint.com/wp-content/uploads/2014/07/dmesg-Command-Examples.png)
|
||||
dmesg Command Examples
|
||||
dmesg 命令的使用范例
|
||||
|
||||
The messages are very important in terms of diagnosing purpose in case of device failure. When we connect or disconnect hardware device on the system, with the help of dmesg command we come to know detected or disconnected information on the fly. The dmesg command is available on most **Linux and Unix** based Operating System.
|
||||
‘dmesg’命令设备故障的诊断是非常重要的。在‘dmesg’命令的帮助下进行硬件的连接或断开连接操作时,我们可以看到硬件的检测或者断开连接的信息。‘dmesg’命令在多数基于**Linux**和**Unix**的操作系统中都可以使用。
|
||||
|
||||
Let’s throw some light on most famous tool called ‘dmesg’ command with their practical examples as discussed below. The exact syntax of dmesg as follows.
|
||||
下面我们展示一些最负盛名的‘dmesg’命令工具以及其实际使用举例。‘dmesg’命令的使用语法如下。
|
||||
|
||||
# dmseg [options...]
|
||||
# dmesg [options...]
|
||||
|
||||
### 1. List all loaded Drivers in Kernel ###
|
||||
### 1. 列出加载到内核中的所有驱动 ###
|
||||
|
||||
We can use text-manipulation tools i.e. ‘**more**‘, ‘**tail**‘, ‘**less**‘ or ‘**grep**‘ with dmesg command. As output of dmesg log won’t fit on a single page, using dmesg with pipe more or less command will display logs in a single page.
|
||||
我们可以使用如‘**more**’。 ‘**tail**’, ‘**less** ’或者‘**grep**’的文字处理工具来处理‘dmesg’命令的输出。由于dmesg日志的输出不适合在一页中完全显示,因此我们使用管道(pipe)将其输出送到more或者less命令中进行分页显示。
|
||||
|
||||
[root@tecmint.com ~]# dmesg | more
|
||||
[root@tecmint.com ~]# dmesg | less
|
||||
|
||||
#### Sample Output ####
|
||||
### 输出 ###
|
||||
|
||||
[ 0.000000] Initializing cgroup subsys cpuset
|
||||
[ 0.000000] Initializing cgroup subsys cpu
|
||||
@ -49,9 +49,9 @@ We can use text-manipulation tools i.e. ‘**more**‘, ‘**tail**‘, ‘**les
|
||||
[ 0.000000] NX (Execute Disable) protection: active
|
||||
.....
|
||||
|
||||
### 2. List all Detected Devices ###
|
||||
### 列出所有被检测到的硬件 ###
|
||||
|
||||
To discover which hard disks has been detected by kernel, you can search for the keyword “**sda**” along with “**grep**” like shown below.
|
||||
要显示所有被内核检测到的硬盘设备,你可以使用‘**grep**’命令搜索‘**sda**’关键词,如下:
|
||||
|
||||
[root@tecmint.com ~]# dmesg | grep sda
|
||||
|
||||
@ -68,11 +68,9 @@ To discover which hard disks has been detected by kernel, you can search for the
|
||||
[ 24.330762] EXT4-fs (sda7): mounted filesystem with ordered data mode. Opts: (null)
|
||||
[ 24.561015] EXT4-fs (sda8): mounted filesystem with ordered data mode. Opts: (null)
|
||||
|
||||
**NOTE**: The ‘sda’ first SATA hard drive, ‘sdb’ is the second SATA hard drive and so on. Search with ‘hda’ or ‘hdb’ in the case of IDE hard drive.
|
||||
**注解** ‘sda’表示第一块 SATA硬盘,‘sdb’表示第二块SATA硬盘。若想查看IDE硬盘搜索‘hda’或‘hdb’关键词。
|
||||
|
||||
### 3. Print Only First 20 Lines of Output ###
|
||||
|
||||
The ‘head’ along with dmesg will show starting lines i.e. ‘dmesg | head -20′ will print only 20 lines from the starting point.
|
||||
### 3. 只输出dmesg命令的前20行日志 ###
|
||||
|
||||
[root@tecmint.com ~]# dmesg | head -20
|
||||
|
||||
@ -97,9 +95,9 @@ The ‘head’ along with dmesg will show starting lines i.e. ‘dmesg | head -2
|
||||
[ 0.000000] BIOS-e820: [mem 0x000000007dc5cc00-0x000000007dc5ebff] ACPI data
|
||||
[ 0.000000] BIOS-e820: [mem 0x000000007dc5ec00-0x000000007fffffff] reserved
|
||||
|
||||
### 4. Print Only Last 20 Lines of Output ###
|
||||
### 只输出dmesg命令最后20行日志 ###
|
||||
|
||||
The ‘tail’ along with dmesg command will print only 20 last lines, this is useful in case we insert removable device.
|
||||
当我们插入可以出的硬件是在‘dmesg’命令后跟随‘tail’命令来输出‘dmesg’命令的最后20行日志是非常有用的。
|
||||
|
||||
[root@tecmint.com ~]# dmesg | tail -20
|
||||
|
||||
@ -124,17 +122,16 @@ The ‘tail’ along with dmesg command will print only 20 last lines, this is u
|
||||
readahead-collector: sorting
|
||||
readahead-collector: finished
|
||||
|
||||
### 5. Search Detected Device or Particular String ###
|
||||
|
||||
It’s difficult to search particular string due to length of dmesg output. So, filter the lines with are having string like ‘**usb**‘ ‘**dma**‘ ‘**tty**‘ and ‘**memory**‘ etc. The ‘**-i**’ option instruct to [grep command][1] to ignore the case (upper or lower case letters).
|
||||
### 5. 搜索包含特定字符串的被检测到的硬件 ###
|
||||
由于‘dmesg’命令的输出实在太长了,在其中搜索某个特定的字符串是非常困难的。因此,有必要过滤出一些包含‘**usb**’ ‘**dma**’ ‘**tty**’ ‘**memory**’等字符串的日志行。[grep 命令][1] 的‘**-i**’选项表示忽略大小写。
|
||||
|
||||
[root@tecmint.com log]# dmesg | grep -i usb
|
||||
[root@tecmint.com log]# dmesg | grep -i dma
|
||||
[root@tecmint.com log]# dmesg | grep -i tty
|
||||
[root@tecmint.com log]# dmesg | grep -i memory
|
||||
|
||||
#### Sample Output ####
|
||||
|
||||
###输出###
|
||||
|
||||
[ 0.000000] Scanning 1 areas for low memory corruption
|
||||
[ 0.000000] initial memory mapped: [mem 0x00000000-0x01ffffff]
|
||||
[ 0.000000] Base memory trampoline at [c009b000] 9b000 size 16384
|
||||
@ -157,19 +154,19 @@ It’s difficult to search particular string due to length of dmesg output. So,
|
||||
[ 1.360318] Freeing unused kernel memory: 880K (c1962000 - c1a3e000)
|
||||
[ 1.429066] [drm] Memory usable by graphics device = 2048M
|
||||
|
||||
### 6. Clear dmesg Buffer Logs ###
|
||||
### 6. 清空dmesg缓冲区日志 ###
|
||||
|
||||
Yes, we can clear dmesg logs if required with below command. It will clear dmesg ring buffer message logs till you executed the command below. Still you can view logs stored in ‘**/var/log/dmesg**‘ files. If you connect any device will generate dmesg output.
|
||||
我们可以使用如下命令来清空dmesg的日志。该命令会清空dmesg环形缓冲区中的日志。但是你依然可以查看存储在‘**/var/log/dmesg**’文件中的日志。你连接任何的设备都会产生dmesg日志输出。
|
||||
|
||||
[root@tecmint.com log]# dmesg -c
|
||||
|
||||
### 7. Monitoring dmesg in Real Time ###
|
||||
### 7. 实时监控dmesg日志输出 ###
|
||||
|
||||
Some distro allows command ‘tail -f /var/log/dmesg’ as well for real time dmesg monitoring.
|
||||
在某些发行版中可以使用命令‘tail -f /var/log/dmesg’来实时监控dmesg的日志输出。
|
||||
|
||||
[root@tecmint.com log]# watch "dmesg | tail -20"
|
||||
|
||||
**Conclusion**: The dmesg command is useful as dmesg records all the system changes done or occur in real time. As always you can man dmesg to get more information.
|
||||
**结论**:dmesg命令在系统dmesg记录实时更改或产生的情况下是非常有用的。你可以使用man dmesg来获取关于dmesg更多的信息。
|
||||
|
||||
----------
|
||||
|
||||
@ -181,17 +178,18 @@ Narad Shrestha
|
||||
- [Facebook profile][f]
|
||||
- [Google+ profile][g]
|
||||
|
||||
He has over 10 years of rich IT experience which includes various Linux Distros, FOSS and Networking. Narad always believes sharing IT knowledge with others and adopts new technology with ease.
|
||||
他在IT领域拥有超过10年的丰富经验,其中包括各种Linux发行版,开源软件和网络。 Narad始终坚持与人分享知识和自如的运用新技术。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/dmesg-commands/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[cvsher](https://github.com/cvsher) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.tecmint.com/12-practical-examples-of-linux-grep-command/
|
||||
[t]:http://twitter.com/@nrdshrestha
|
||||
[f]:http://facebook.com/narad.shrestha.9
|
||||
[g]:http://plus.google.com/104542109955805873615?rel=author
|
||||
[g]:http://plus.google.com/104542109955805873615?rel=author
|
||||
|
@ -1,6 +1,6 @@
|
||||
How to analyze Squid logs with SARG log analyzer on CentOS
|
||||
如何用CentOS上的SARG log分析其来分析Squid的log
|
||||
================================================================================
|
||||
In a [previous tutorial][1], we show how to configure a transparent proxy with Squid on CentOS. Squid provides many useful features, but analyzing a raw Squid log file is not straightfoward. For example, how could you analyze the time stamps and the number of hits in the following Squid log?
|
||||
[上一节教程][1]中,我们战士了如何在CentOS上使用Squid配置透明代理。Squid提供了很多有用的特性,但是分析一个原始Squid日志文件并不直接。比如,你如何分析下面Squid log中的时间戳和数字?
|
||||
|
||||
1404788984.429 1162 172.17.1.23 TCP_MISS/302 436 GET http://facebook.com/ - DIRECT/173.252.110.27 text/html
|
||||
1404788985.046 12416 172.17.1.23 TCP_MISS/200 4169 CONNECT stats.pusher.com:443 - DIRECT/173.255.223.127 -
|
||||
@ -12,24 +12,24 @@ In a [previous tutorial][1], we show how to configure a transparent proxy with S
|
||||
1404788990.849 2151 172.17.1.23 TCP_MISS/200 76809 CONNECT fbstatic-a.akamaihd.net:443 - DIRECT/184.26.162.35 -
|
||||
1404788991.140 611 172.17.1.23 TCP_MISS/200 110073 CONNECT fbstatic-a.akamaihd.net:443 - DIRECT/184.26.162.35 –
|
||||
|
||||
SARG (or Squid Analysis Report Generator) is a web based tool that creates reports from Squid logs. SARG provides an easy-to-understand view of network traffic handled by Squid, and it is very easy to set up and maintain. In the following tutorial, we show **how to set up SARG on a CentOS platform**.
|
||||
SARG(或者说是Squid分析报告生成器)是一款基于web的工具,用于从Squid日志中生成报告。SARG提供了一个易于理解的由Squid处理的网络流量视图,并且它很容易设置与维护。在下面的教程中,我们会展示**如何在CentOS平台上设置SARG**。
|
||||
|
||||
We start the process by installing necessary dependencies using yum.
|
||||
我们使用yum来安装安装必要的依赖。
|
||||
|
||||
# yum install gcc make wget httpd crond
|
||||
|
||||
Necessary services are started and loaded at startup.
|
||||
在启动时加载必要的服务
|
||||
|
||||
# service httpd start; service crond start
|
||||
# chkconfig httpd on; chkconfig crond on
|
||||
|
||||
Now we download and extract SARG.
|
||||
现在我们下载并解压SARG
|
||||
|
||||
# wget http://downloads.sourceforge.net/project/sarg/sarg/sarg-2.3.8/sarg-2.3.8.tar.gz?
|
||||
# tar zxvf sarg-2.3.8.tar.gz
|
||||
# cd sarg-2.3.8
|
||||
|
||||
**NOTE**: For 64-bit Linux, the source code in log.c needs to be patched as follows.
|
||||
**注意**: 对于64位的Linux,log.c的源代码需要用下面的文件打补丁。
|
||||
|
||||
1506c1506
|
||||
< if (fprintf(ufile->file, "%s\t%s\t%s\t%s\t%"PRIi64"\t%s\t%ld\t%s\n",dia,hora,ip,url,nbytes,code,elap_time,smartfilter)<=0) {
|
||||
@ -44,13 +44,13 @@ Now we download and extract SARG.
|
||||
---
|
||||
> printf("LEN=\t%"PRIi64"\n",(int64_t)nbytes);
|
||||
|
||||
Go ahead and build/install SARG as follows.
|
||||
如下继续并编译/安装SARG
|
||||
|
||||
# ./configure
|
||||
# make
|
||||
# make install
|
||||
|
||||
After SARG is installed, the configuration file can be modified to match your requirements. The following is one example of SARG configuration.
|
||||
SARG安装之后,配置文件可以按你的要求修改。下面是一个SARG配置的例子。
|
||||
|
||||
# vim /usr/local/etc/sarg.conf
|
||||
|
||||
@ -63,19 +63,19 @@ After SARG is installed, the configuration file can be modified to match your re
|
||||
## we don’t want multiple reports for single day/week/month ##
|
||||
overwrite_report yes
|
||||
|
||||
Now it's time for a test run. We run sarg command in debug mode to find whether there is any error.
|
||||
现在是时候测试运行了,我们用调试模式运行sarg来找出是否存在错误。
|
||||
|
||||
# sarg -x
|
||||
|
||||
If all goes well, sarg should analyze Squid logs, and create reports in /var/www/html/squid-reports. The reports should be visible in a web browser using the address http://<server-IP>/squid-reports/
|
||||
如果i一切正常,sarg会根系Squid日志,并在/var/www/html/squid-reports下创建报告。报告也可以在浏览器中通过地址http://<服务器IP>/squid-reports/访问
|
||||
|
||||
![](https://farm3.staticflickr.com/2931/14631403935_4ff34e07b9_z.jpg)
|
||||
|
||||
![](https://farm4.staticflickr.com/3901/14629281644_fec31014c5_z.jpg)
|
||||
|
||||
SARG can be used to create daily, weekly and monthly reports. Time range can be specified using the "-d" parameter with possible values in the form of day-n, week-n or month-n, where n is the number of days/weeks/months to jump backward. For example, with week-1, SARG will generate a report for the previous week. With day-2, SARG will prepare reports for the previous two days.
|
||||
、SARG可以用于创建每日、每周、每月的报告。时间范围用“-d”参数来指定,可能的值的形式可能为day-n、 week-n 或者 month-n,n的值向后天/周/月的数量。比如,使用week-1,SARG会生成前面一星期的报告。使用day-2,SARG会准备前面两天的报告。
|
||||
|
||||
As a demonstration, we will prepare a cron job to run SARG daily.
|
||||
作为演示,我们会准备一个计划任务来每天运行SARG。
|
||||
|
||||
# vim /etc/cron.daily/sarg
|
||||
|
||||
@ -84,34 +84,35 @@ As a demonstration, we will prepare a cron job to run SARG daily.
|
||||
#!/bin/sh
|
||||
/usr/local/bin/sarg -d day-1
|
||||
|
||||
The file needs a execution permission.
|
||||
文件需要可执行权限。
|
||||
|
||||
# chmod 755 /usr/local/bin/sarg
|
||||
|
||||
Now SARG should prepare daily reports about Squid-managed traffic. These reports can easily be accessed from the SARG web interface.
|
||||
现在SARG应该会每天准备关于Squid管理的流量报告。这些报告可以很容易地通过SARG网络接口访问。
|
||||
|
||||
To sum up, SARG is a web based tool that analyzes Squid logs and presents the analysis in an informative way. System admins can leverage SARG to monitor what sites are being accessed, and to keep track of top visited sites and top users. This tutorial covers a working configuration for SARG. You can customize the configuration even further to match your requirements.
|
||||
总结一下,SARG一款基于网络的工具,它可以分析Squid日志,并以更详细的方式展示分析。系统管理员可以利用SARG来监视哪些网站被访问了,并跟踪访问量最大的网站和用户。本教程涵盖了SARG配置工作。你甚至可以进一步自定义配置来满足您的要求。
|
||||
|
||||
Hope this helps.
|
||||
希望这篇教程有用
|
||||
|
||||
----------
|
||||
|
||||
[Sarmed Rahman][w]
|
||||
|
||||
- [Twitter profile][t]
|
||||
- [LinkedIn profile][l]
|
||||
- [Twitter 地址][t]
|
||||
- [LinkedIn 地址][l]
|
||||
|
||||
Sarmed Rahman is an IT professional in the Internet Industry in Bangladesh. He writes tutorial articles on technology every now and then from a belief that knowledge grows through sharing. During his free time, he loves gaming and spending time with his friends.
|
||||
Sarmed Rahman是一名在孟加拉国的IT专业人士。他坚持写作科学文章,并坚信技术可以通过分享提高。在他的空闲时间里,他爱好游戏与他的朋友在一起
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/2014/07/analyze-squid-logs-sarg-log-analyzer-centos.html
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者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/) 荣誉推出
|
||||
|
||||
[1]:http://xmodulo.com/2014/06/squid-transparent-web-proxy-centos-rhel.html
|
||||
[w]:http://amar-linux.blogspot.com/
|
||||
[t]:http://twitter.com/SarmedRahman
|
||||
[l]:http://www.linkedin.com/in/sarmedrahman
|
||||
[l]:http://www.linkedin.com/in/sarmedrahman
|
@ -0,0 +1,40 @@
|
||||
“Simple Dock” GNOME Shell扩展乾坤大挪移,钟爱应用桌面展现
|
||||
================================================================================
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/07/screenshot_815_1.jpg)
|
||||
|
||||
**我爱GNOME Shell,但是我痛恨的是话费力气从隐藏屏幕中找到我所钟爱的应用或者在我正运行的应用间切换。**
|
||||
|
||||
这么说,好像听起来我是个老古董,像是一个UX勒德分子,也像是某个过分沉溺于Unity可用性瘾君子,但我,像阅读本文的许多人一样,喜欢将app启动器/切换器放到桌面上。这是一个熟悉、快速的工作方式。
|
||||
|
||||
而GNOME Shell,从设计上看,却完全是个不同的世界。它将所有这一切隐藏起来 —— 从消息中心和通知,到工作区和应用列表。它是最小美学,包含这样的道理:帮助用户专注于最重要的部分。
|
||||
|
||||
但是对我而言,我的桌面需要比一个美化的相框更多的东西。
|
||||
|
||||
### GNOME Shell之美 ###
|
||||
|
||||
抛开我自己的偏好,隐藏应用是GNOME Shell之美的一部分。它带来了默认的桌面体验:用户友好,稳健以及可预见性——而且也完全可扩展。因此,它也附带有大量的扩展组件以迎合不同用户的需要、职业和希望,包括传统应用菜单,桌面停靠栏,以及甚至是Ubuntu Unity Dash的复制品!
|
||||
|
||||
在本文中,我仅仅关注那个能满足我需要的扩展:它有个恰如其分的名字**Simple Dock**。Simple Dock获取GNOME Shell应用网格以及收藏栏,并可以将它放到任何我想要放的不引人注目的位置:桌面上。
|
||||
|
||||
目前为止,它只支持放置在屏幕底部,只提供了最小的设置项。虽然是最小的,但我觉得所有这些设置已经能满足我的需要:
|
||||
|
||||
- 智能自动隐藏
|
||||
- 最小化/还原应用窗口
|
||||
- 拖放收藏
|
||||
- 覆盖活动启动按钮
|
||||
|
||||
想要吗?如果你正在Ubuntu 13.10或更高版本上使用GNOME Shell,那么你可以使用它。只需在支持的浏览器(Firefox, GNOME Web之类)中访问下面的链接就可以导航到GNOME扩展页面,然后将页面上开个从“off”拖动到“on”上。
|
||||
|
||||
- [GNOME Shell扩展中的Simple Dock][1]
|
||||
|
||||
要调整Simple Dock设置,点击GNOME扩展页面上的齿轮图标,或者通过GNOME优化工具这样的桌面应用程序来设置。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/07/simple-dock-gnome-shell-extension
|
||||
|
||||
译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:https://extensions.gnome.org/extension/815/simple-dock/
|
@ -0,0 +1,76 @@
|
||||
Linux 内核的测试和调试
|
||||
================================================================================
|
||||
### Linux 内核测试哲学 ###
|
||||
|
||||
不管是开源还是闭源,所有软件的开发流程中,测试是一个重要的、不可或缺的环节,Linux 内核也不例外。开发人员自测、系统测试、回归测试、压力测试,都有各自不同的目的,但是从更高一个层次上看,这些测试的最终目的又是一样的:保证软件能一直运行下去,当有新功能加进去时,要保证新功能可以正常工作。
|
||||
|
||||
在软件释出 release 版之前,不用回归测试就能保证稳定性,并且尽量避免在软件发布后被用户发现 bug。调试被用户发现的 bug 是一项非常浪费时间和精力的工作。因此测试是一项非常重要的工作。不像闭源和专有的操作系统,Linux 内核的开发过程是完全开放的。这种处理方式即是它的优点,也是它的缺点。多个开发者持续增加新功能、修 bug、不断集成与测试 —— 当环境有新的硬件或功能时,这种开发方式能够保证内核能持续工作。在开源项目中,开发者与用户共享测试的结果,这也是开源项目与闭源项目之间的一个很重要的差别。
|
||||
|
||||
几乎所有 Linux 内核开发者都是活跃的 Linux 用户。内核测试人员不一定非得是内核开发者,相反,用户和开发者如果对新增的代码不是很熟悉,他们的测试效果会比代码开发人员自己测试的效果要好很多。也就是说,开发者的单元自测能验证软件的功能,但并不能保证在其他代码、其他功能、其他软件、硬件环境下面运行时会出现什么问题。开发者无法预料、也没有机会和资源来测试所有环境。因此,用户在 Linux 内核开发过程中起到非常重要的角色。
|
||||
|
||||
现在我们已经了解了持续集成测试的重要性,接下来我们会详细介绍测试的知识。但在此之前,我还是向介绍一下开发的过程,以便让大家了解它是怎么工作的,以及如何把补丁打进内核主线。
|
||||
|
||||
全世界共有3000多个内核开发者为 Linux 内核贡献代码,每天都有新代码添加到内核,结果是大概2个月就能产生一个稳定版和多个扩展的稳定版。新功能的开发与已发布的稳定版集成测试流程在同时进行。
|
||||
|
||||
关于开发流程的详细描述,请参考[Greg Kroah-Hartman 的 Linux 内核开发的介绍][1]。
|
||||
|
||||
这份教程适合与初学者以及有经验的内核开发者,如果你想加入到内核开发者行列,那么它也适合你。有经验的开发人员可以跳过那些介绍基础测试和调试的章节。
|
||||
|
||||
这份教程介绍如何测试和调试 Linux 内核、工具、脚本以及在回归测试会集成测试中使用的调试机制。另外,本文还会介绍如何使用 git 把针对一个 bug 的补丁分离出来,在介绍介绍把你的补丁提交到内核的邮件列表之前需要做些什么。我将会使用 Linux PM 作为测试它调试的对象。尽管本文讨论的是 Linux 内核,但是介绍的方法适用于任何其他软件开发项目。
|
||||
|
||||
### 配置开发与测试的系统 ###
|
||||
|
||||
第一步,找一个满足你需求的开发环境,x86-64 是一个比较理想的选择,除非你必须用特别的架构。
|
||||
|
||||
第二步,安装 Linux 发行版,我推荐 Ubuntu,所以本教程会介绍基于 Ubuntu 的配置过程。你可以参考[如何使用 Ubuntu][2] 来安装一个 Ubuntu 系统。
|
||||
|
||||
在开发和测试环境,最好要保证你的 boot 分区有足够的空间来存放内核文件。你可以为 boot 分区留下 3GB 空间,或把 boot 分区直接放到根目录下,这样 boot 分区可以使用整个磁盘的空间。
|
||||
|
||||
安装好操作系统后,确保 root 用户可用,确保你的用户可以使用 sudo 命令。你的系统也许已经安装了 build-essential,它是编译内核必备的软件包,如果没安装,运行下面的命令:
|
||||
|
||||
sudo apt-get install build-essential
|
||||
|
||||
然后运行下面的命令,保证你的系统能够交叉编译内核。下面的 ncurses-dev 安装包是运行 make menuconfig 命令必须用到的。
|
||||
|
||||
sudo apt-get install binutils-multiarch
|
||||
|
||||
sudo apt-get install ncurses-dev
|
||||
|
||||
sudo apt-get install alien
|
||||
|
||||
然后安装一些每个内核开发者都会用到的工具包:
|
||||
|
||||
sudo apt-get install git
|
||||
|
||||
sudo apt-get install cscope
|
||||
|
||||
sudo apt-get install meld
|
||||
|
||||
sudo apt-get install gitk
|
||||
|
||||
如果你喜欢把内核通过交叉编译以支持非 x86_64 架构的环境,请参考[在 x86_64 上交叉编译 Linux 内核][3]。
|
||||
|
||||
### 稳定的内核 ###
|
||||
|
||||
使用 git 克隆一个稳定的内核,然后编译安装。你可以参考[Linux 内核结构][4]来找到最新的稳定版和开发主线。
|
||||
|
||||
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
|
||||
|
||||
上面的步骤将会创建一个新的目录,名为 linux-stable,然后把源码下载到里面。
|
||||
|
||||
你也可以直接下载压缩包并解压出源码,无需使用 git:
|
||||
|
||||
tar xvf linux-3.x.y.tar.xz
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxjournal.com/content/linux-kernel-testing-and-debugging?page=0,0
|
||||
|
||||
译者:[bazz2](https://github.com/bazz2) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://events.linuxfoundation.org/images/stories/pdf/als2012_gregkh.pdf
|
||||
[2]:http://howtoubuntu.org/
|
||||
[3]:http://linuxdriverproject.org/mediawiki/index.php/Cross-compiling_Linux_kernel_on_x86_64
|
||||
[4]:https://www.kernel.org/
|
@ -0,0 +1,68 @@
|
||||
关于Linux命令的10个有用的面试问题及其答案
|
||||
==================================================================================================================================================
|
||||
Linux命令行,以及用户使用Linux命令进行Linux shell交互,是Linux最吸引人的地方,也是面试中最普遍的话题之一。在这篇文章中,我们将提出10个面试中很重要问题,这肯定能拓宽你的知识面
|
||||
|
||||
![Linux Command Questions](http://www.tecmint.com/wp-content/uploads/2014/07/Linux-Command-Questions.png) Linux Command Questions
|
||||
|
||||
### 1. 如何停止一个正在运行的进程 ###
|
||||
|
||||
**答案**:为了停止正在运行的进程,我们可以使用组合键 Ctrl+Z
|
||||
|
||||
### 2. 什么是安装Linux所需的最小分区数量,以及如何查看系统启动信息? ###
|
||||
|
||||
**答案**:单独一个/root分区足以执行所有的系统任务,但是强烈建议安装Linux时,需要至少三个分区:/root,/boot,/swap。一个IDE硬盘驱动器支持高达63个分区,SCSI硬盘驱动器支持超过15个分区
|
||||
|
||||
为了检查启动信息,我们可以使用cat或者dmesg命令,如下所示:
|
||||
|
||||
#cat /var/log/messages
|
||||
|
||||
OR
|
||||
|
||||
#dmesg
|
||||
|
||||
### 3. 在你的Linux机器上更踪系统事件的守护进程名是什么?###
|
||||
|
||||
**答案**:'syslogd',它负责更踪系统信息,并将更踪日志存储在特定的日志文件里
|
||||
|
||||
### 4. 在/root分区运行'fsck'命令的最低要求是什么?###
|
||||
|
||||
**答案**:/root分区必须挂载为只读模式,而不是读写模式
|
||||
|
||||
### 5. 如何分层复制/home目录到另一个目录,你有什么办法?###
|
||||
|
||||
**答案**:Linux的'cpio'命令起到了效果。'cpio'可以分层地复制文件和目录层次结构到另一个位置
|
||||
|
||||
### 6. 在Linux中,怎样实现日志文件的自动替换?###
|
||||
|
||||
**答案**:'logrotate'提供日志自动替换功能
|
||||
|
||||
### 7. 你知道Linux中是谁在安排工作吗?###
|
||||
|
||||
**答案**:使用'at'命令加上'-l'选项,就可以查出
|
||||
|
||||
### 8. 如何在不解压tar包的前提下,查看包里的内容 ###
|
||||
|
||||
**答案**:使用'tar -tvf'。选项‘t’(显示内容),‘v’(详细报告tar处理的文件信息),‘f’(使用档案文件或者设备)
|
||||
|
||||
### 9. 什么是页面错误,它是怎么发生的?###
|
||||
|
||||
**答案**:当一个程序请求内存中不存在的数据时,就会产生页面错误,导致的结果就是程序停止
|
||||
|
||||
### 10. 什么叫在程序中返回代码?###
|
||||
|
||||
**答案**:返回代码是shell的特性。返回代码显示了程序的状态,一个成功的程序执行后返回‘0’,&&可以用来决定那个应用程序先执行
|
||||
|
||||
好了,文章要结束了。不久以后,我还会在这分享其余有趣文章的,记得和我们保持联系。还有,别忘了在评论栏里面向我们提供您的宝贵意见
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/10-useful-interview-questions-and-answers-on-linux-commands/
|
||||
|
||||
原文作者:[Avishek Kumar][a]
|
||||
|
||||
译者:[su-kaiyao](https://github.com/su-kaiyao) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/avishek/
|
||||
|
Loading…
Reference in New Issue
Block a user