mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Merge branch 'master' of https://github.com/LCTT/TranslateProject.git
This commit is contained in:
commit
17d979dfa0
@ -1,8 +1,9 @@
|
||||
Linux 中的TCP/IP网络配置:net-tools vs. iproute2
|
||||
iproute2 对决 net-tools
|
||||
================================================================================
|
||||
如今很多系统管理员依然通过组合使用诸如ifconfig、route、arp和netstat等命令行工具(统称为net-tools)来配置网络功能,解决网络故障。net-tools起源于BSD的TCP/IP工具箱,后来成为老版本Linux内核中配置网络功能的工具。但自2001年起,Linux社区已经对其停止维护。同时,一些比如Arch Linux和CentOS/RHEL 7的Linux发行版则已经完全抛弃了net-tools,以支持iproute2。
|
||||
|
||||
作为网络配置工具的一份子,iproute2的出现旨在在功能上取代net-tools。net-tools通过procfs(/proc)和ioctl系统调用去访问和改变内核网络配置,而iproute2则通过netlink套接字接口与内核通讯。抛开性能而言,iproute2的用户接口比net-tools显得更加直观。比如,各种网络资源(如link、IP地址、路由和隧道等)均使用合适的对象抽象去定义,使得用户可使用一致的语法去管理不同的对象。更重要的是,到目前为止,iproute2仍处在[持续开发][1]中。
|
||||
如今很多系统管理员依然通过组合使用诸如ifconfig、route、arp和netstat等命令行工具(统称为net-tools)来配置网络功能,解决网络故障。net-tools起源于BSD的TCP/IP工具箱,后来成为老版本Linux内核中配置网络功能的工具。**但自2001年起,Linux社区已经对其停止维护。**同时,一些Linux发行版比如Arch Linux和CentOS/RHEL 7则已经完全抛弃了net-tools,只支持iproute2。
|
||||
|
||||
作为网络配置工具的一份子,iproute2的出现旨在从功能上取代net-tools。net-tools通过procfs(/proc)和ioctl系统调用去访问和改变内核网络配置,而iproute2则通过netlink套接字接口与内核通讯。抛开性能而言,iproute2的用户接口比net-tools显得更加直观。比如,各种网络资源(如link、IP地址、路由和隧道等)均使用合适的对象抽象去定义,使得用户可使用一致的语法去管理不同的对象。更重要的是,到目前为止,iproute2仍处在[持续开发][1]中。
|
||||
|
||||
如果你仍在使用net-tools,而且尤其需要跟上新版Linux内核中的最新最重要的网络特性的话,那么是时候转到iproute2的阵营了。原因就在于使用iproute2可以做很多net-tools无法做到的事情。
|
||||
|
||||
@ -27,10 +28,12 @@ Linux 中的TCP/IP网络配置:net-tools vs. iproute2
|
||||
使用这些命令来激活或停用某个指定的网络接口。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ sudo ifconfig eth1 up
|
||||
$ sudo ifconfig eth1 down
|
||||
|
||||
使用**iproute2**:
|
||||
|
||||
$ sudo ip link set down eth1
|
||||
$ sudo ip link set up eth1
|
||||
|
||||
@ -39,9 +42,11 @@ Linux 中的TCP/IP网络配置:net-tools vs. iproute2
|
||||
使用这些命令配置网络接口的IPv4地址。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ sudo ifconfig eth1 10.0.0.1/24
|
||||
|
||||
使用**iproute2**:
|
||||
|
||||
$ sudo ip addr add 10.0.0.1/24 dev eth1
|
||||
|
||||
值得注意的是,可以使用iproute2给同一个接口分配多个IP地址,ifconfig则无法这么做。使用ifconfig的变通方案是使用[IP别名][2]。
|
||||
@ -55,9 +60,11 @@ Linux 中的TCP/IP网络配置:net-tools vs. iproute2
|
||||
就IP地址的移除而言,除了给接口分配全0地址外,net-tools没有提供任何合适的方法来移除网络接口的IPv4地址。相反,iproute2则能很好地完全。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ sudo ifconfig eth1 0
|
||||
|
||||
使用**iproute2**:
|
||||
|
||||
$ sudo ip addr del 10.0.0.1/24 dev eth1
|
||||
|
||||
### 显示网络接口的IPv4地址 ###
|
||||
@ -65,9 +72,11 @@ Linux 中的TCP/IP网络配置:net-tools vs. iproute2
|
||||
按照如下操作可查看某个指定网络接口的IPv4地址。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ ifconfig eth1
|
||||
|
||||
使用**iproute2**:
|
||||
|
||||
$ ip addr show dev eth1
|
||||
|
||||
同样,如果接口分配了多个IP地址,iproute2会显示出所有地址,而net-tools只能显示一个IP地址。
|
||||
@ -79,21 +88,25 @@ Linux 中的TCP/IP网络配置:net-tools vs. iproute2
|
||||
使用这些命令为网络接口添加IPv6地址。net-tools和iproute2都允许用户为一个接口添加多个IPv6地址。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ sudo ifconfig eth1 inet6 add 2002:0db5:0:f102::1/64
|
||||
$ sudo ifconfig eth1 inet6 add 2003:0db5:0:f102::1/64
|
||||
|
||||
使用**iproute2**:
|
||||
|
||||
$ sudo ip -6 addr add 2002:0db5:0:f102::1/64 dev eth1
|
||||
$ sudo ip -6 addr add 2003:0db5:0:f102::1/64 dev eth1
|
||||
|
||||
### 显示网络接口的IPv6地址 ###
|
||||
|
||||
按照如下操作可显示某个指定网络接口的IPv6地。net-tools和iproute2都可以显示出所有已分配的IPv6地址。
|
||||
按照如下操作可显示某个指定网络接口的IPv6地址。net-tools和iproute2都可以显示出所有已分配的IPv6地址。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ ifconfig eth1
|
||||
|
||||
使用**iproute2**:
|
||||
|
||||
$ ip -6 addr show dev eth1
|
||||
|
||||
![](https://farm4.staticflickr.com/3906/15111848536_f6cb7ddb4f_z.jpg)
|
||||
@ -103,9 +116,11 @@ Linux 中的TCP/IP网络配置:net-tools vs. iproute2
|
||||
使用这些命令可移除接口中不必要的IPv6地址。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ sudo ifconfig eth1 inet6 del 2002:0db5:0:f102::1/64
|
||||
|
||||
使用**iproute2**:
|
||||
|
||||
$ sudo ip -6 addr del 2002:0db5:0:f102::1/64 dev eth1
|
||||
|
||||
### 改变网络接口的MAC地址 ###
|
||||
@ -113,9 +128,11 @@ Linux 中的TCP/IP网络配置:net-tools vs. iproute2
|
||||
使用下面的命令可[篡改网络接口的MAC地址][3],请注意在更改MAC地址前,需要停用接口。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ sudo ifconfig eth1 hw ether 08:00:27:75:2a:66
|
||||
|
||||
使用**iproute2**:
|
||||
|
||||
$ sudo ip link set dev eth1 address 08:00:27:75:2a:67
|
||||
|
||||
### 查看IP路由表 ###
|
||||
@ -123,6 +140,7 @@ Linux 中的TCP/IP网络配置:net-tools vs. iproute2
|
||||
net-tools中有两个选择来显示内核的IP路由表:route和netstat。在iproute2中,使用命令ip route。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ route -n
|
||||
|
||||
----------
|
||||
@ -140,10 +158,12 @@ net-tools中有两个选择来显示内核的IP路由表:route和netstat。在
|
||||
这里的命令用来添加或修改内核IP路由表中的默认路由规则。请注意在net-tools中可通过添加新的默认路由、删除旧的默认路由来实现修改默认路由。在iproute2使用ip route命令来代替。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ sudo route add default gw 192.168.1.2 eth0
|
||||
$ sudo route del default gw 192.168.1.1 eth0
|
||||
|
||||
使用**iproute2**:
|
||||
|
||||
$ sudo ip route add default via 192.168.1.2 dev eth0
|
||||
$ sudo ip route replace default via 192.168.1.2 dev eth0
|
||||
|
||||
@ -152,10 +172,12 @@ net-tools中有两个选择来显示内核的IP路由表:route和netstat。在
|
||||
使用下面命令添加或移除一个静态路由。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ sudo route add -net 172.16.32.0/24 gw 192.168.1.1 dev eth0
|
||||
$ sudo route del -net 172.16.32.0/24
|
||||
|
||||
使用**iproute2**:
|
||||
|
||||
$ sudo ip route add 172.16.32.0/24 via 192.168.1.1 dev eth0
|
||||
$ sudo ip route del 172.16.32.0/24
|
||||
|
||||
@ -169,6 +191,7 @@ net-tools中有两个选择来显示内核的IP路由表:route和netstat。在
|
||||
$ netstat -l
|
||||
|
||||
使用**iproute2**:
|
||||
|
||||
$ ss
|
||||
$ ss -l
|
||||
|
||||
@ -179,6 +202,7 @@ net-tools中有两个选择来显示内核的IP路由表:route和netstat。在
|
||||
使用这些命令显示内核的ARP表。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ arp -an
|
||||
|
||||
使用**iproute2**:
|
||||
@ -192,6 +216,7 @@ net-tools中有两个选择来显示内核的IP路由表:route和netstat。在
|
||||
按照如下操作在本地ARP表中添加或删除一个[静态ARP项][4]。
|
||||
|
||||
使用**net-tools**:
|
||||
|
||||
$ sudo arp -s 192.168.1.100 00:0c:29:c0:5a:ef
|
||||
$ sudo arp -d 192.168.1.100
|
||||
|
||||
@ -223,7 +248,7 @@ via: http://xmodulo.com/2014/09/linux-tcpip-networking-net-tools-iproute2.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[KayGuoWhu](https://github.com/KayGuoWhu)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,8 +1,8 @@
|
||||
桌面看腻了?试试这 4 款漂亮的 Linux 图标主题吧
|
||||
================================================================================
|
||||
**Ubuntu 的默认图标主题在 5 年内[并未发生太大的变化][1],那些说“[图标早就彻底更新过了][2]”的你过来,我保证不打你。如果你确实想尝试一些新鲜的东西,我们将向你展示一些惊艳的替代品,它们会让你感到眼前一亮。**
|
||||
**Ubuntu 的默认图标主题在 5 年内[并未发生太大的变化][1],除了[一些古怪的新图标][2]。如果你确实想尝试一些新鲜的东西,我们将向你展示一些惊艳的替代品,它们会让你感到眼前一亮。**
|
||||
|
||||
如果还是感到不太满意,你可以在文末的评论里留下你比较中意的图标主题的链接地址。
|
||||
希望您可以在文末的评论里留下您比较中意的图标主题的链接地址。
|
||||
|
||||
### Captiva ###
|
||||
|
||||
@ -10,9 +10,9 @@
|
||||
|
||||
Captiva 图标 + elementary 文件夹图标 + Moka GTK
|
||||
|
||||
Captiva 是一款相对较新的图标主题,即使那些有华丽图标倾向的用户也会接受它。
|
||||
Captiva 是一款相对较新的图标主题,即使是那些喜欢华丽图标的用户也会接受它。
|
||||
|
||||
Captiva 由 DeviantArt 的用户 ~[bokehlicia][3] 制作,它并未使用现在非常流行的平面扁平风格,而是采用了一种圆润、柔和的外观。图标本身呈现出一种很有质感的材质外观,同时通过微调的阴影和亮丽的颜色提高了自身的格调。
|
||||
Captiva 由 DeviantArt 的用户 ~[bokehlicia][3] 制作,它并未使用现在非常流行的2D扁平化风格,而是采用了一种柔和圆滑的外观。图标本身呈现出一种很有质感的材质外观,同时通过微调的阴影和亮丽的颜色提高了自身的格调。
|
||||
|
||||
不过 Captiva 图标主题并未包含文件夹图标在内,因此它将使用 elementary(如果可以的话)或者普通的 Ubuntu 文件夹图标。
|
||||
|
||||
@ -24,29 +24,29 @@ Captiva 由 DeviantArt 的用户 ~[bokehlicia][3] 制作,它并未使用现在
|
||||
|
||||
或者,如果你不擅长通过软件源安装的话,你也可以直接从 DeviantArt 的主页上下载图标压缩包。把解压过的文件夹挪到家目录的‘.icons’目录下,即可完成安装。
|
||||
|
||||
不过在你完成安装后,你必须得通过像 [Unity Tweak Tool][4] 这样的工具来把你安装的图标主题(本文列出的其他图标主题也要这样)应用到系统上。
|
||||
无论你选择哪种方式来安装,你必须得通过像 [Unity Tweak Tool][4] 这样的工具来把你安装的图标主题(本文列出的其他图标主题也要这样)应用到系统上。
|
||||
|
||||
- [DeviantArt 上的 Captiva 图标主题][5]
|
||||
|
||||
### Square Beam ###
|
||||
|
||||
![Square Beam 图标在 Orchis GTK 主题下](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/squarebeam.jpg)
|
||||
![Orchis GTK 主题下的 Square Beam 图标](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/squarebeam.jpg)
|
||||
|
||||
Square Beam 图标在 Orchis GTK 主题下
|
||||
Orchis GTK 主题下的 Square Beam 图标
|
||||
|
||||
厌倦有棱角的图标了?尝试下 Square Beam 吧。Square Beam 因为其艳丽的色泽、尖锐的坡度变化和鲜明的图标形象,比本文列出的其他图标具有更加宏大的视觉效果。Square Beam 声称自己有超过 30,000 个(抱歉,我没有仔细数过...)的不同图标(!),因此你很难找到它没有考虑到的地方。
|
||||
厌倦有棱角的图标了?尝试下 Square Beam 吧。Square Beam 因为其艳丽的色泽、尖锐的坡度变化和鲜明的图标形象,比本文列出的其他图标具有更加宏大的视觉效果。Square Beam 声称自己有超过 30,000 个(抱歉,我没有仔细数过...)不同的图标(!),因此你很难找到它没有涉及到的地方。
|
||||
|
||||
- [GNOME-Look.org 上的 Square Beam 图标主题][6]
|
||||
|
||||
### Moka & Faba ###
|
||||
|
||||
![Moka/Faba Mono 图标在 Orchis GTK 主题下](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/moka-faba.jpg)
|
||||
![在 Orchis GTK 主题下的 Moka/Faba Mono 图标](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/moka-faba.jpg)
|
||||
|
||||
Moka/Faba Mono 图标在 Orchis GTK 主题下
|
||||
在 Orchis GTK 主题下的 Moka/Faba Mono 图标
|
||||
|
||||
这里得稍微介绍下 Moka 图标集。事实上,我敢打赌阅读此文的绝大部分用户正在使用这款图标。
|
||||
这里得稍微介绍下 Moka 图标集。事实上,我敢打赌阅读此文的大部分用户正在使用这款图标。
|
||||
|
||||
柔和的颜色、平滑的边缘以及简洁的图标艺术设计,Moka 是一款真正出色的覆盖全面的应用图标。它的兄弟 Faba 将这些特点展现得淋漓尽致,而 Moka 也将延续这些 —— 涵盖所有的系统图标、文件夹图标、面板图标,等等。
|
||||
淡柔的颜色、平滑的边缘以及简洁的图标艺术设计,Moka 是一款真正出色又覆盖全面的应用图标。它的兄弟 Faba 将这些特点展现得淋漓尽致,而 Moka 也将延续这些 —— 涵盖所有的系统图标、文件夹图标、面板图标,等等。这个组合的结果是...吸引你的眼球!
|
||||
|
||||
欲知 Ubuntu 上的安装详情、访问项目官方网站?请点击下面的链接。
|
||||
|
||||
@ -74,7 +74,7 @@ via: http://www.omgubuntu.co.uk/2014/09/4-gorgeous-linux-icon-themes-download
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[SteveArcher](https://github.com/SteveArcher)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
@ -86,4 +86,4 @@ via: http://www.omgubuntu.co.uk/2014/09/4-gorgeous-linux-icon-themes-download
|
||||
[5]:http://bokehlicia.deviantart.com/art/Captiva-Icon-Theme-479302805
|
||||
[6]:http://gnome-look.org/content/show.php/Square-Beam?content=165094
|
||||
[7]:http://mokaproject.com/moka-icon-theme/download/ubuntu/
|
||||
[8]:http://gnome-look.org/content/show.php/Compass?content=160629
|
||||
[8]:http://gnome-look.org/content/show.php/Compass?content=160629
|
@ -1,9 +1,8 @@
|
||||
如何用Puppet和Augeas管理Linux配置
|
||||
================================================================================
|
||||
虽然[Puppet][1](注:此文原文原文中曾今做过,文件名:“20140808 How to install Puppet server and client on CentOS and RHEL.md”,如果翻译发布过,可修改此链接为发布地址)是一个非常独特的和有用的工具,在有些情况下你可以使用一点不同的方法。要修改的配置文件已经在几个不同的服务器上且它们在这时是互补相同的。Puppet实验室的人也意识到了这一点并集成了一个伟大的工具,称之为[Augeas][2],它是专为这种使用情况而设计的。
|
||||
虽然[Puppet][1]是一个真正独特的有用工具,但在有些情况下你可以使用一点不同的方法来用它。比如,你要修改几个服务器上已有的配置文件,而且它们彼此稍有不同。Puppet实验室的人也意识到了这一点,他们在 Puppet 中集成了一个叫做[Augeas][2]的伟大的工具,它是专为这种使用情况而设计的。
|
||||
|
||||
|
||||
Augeas可被认为填补了Puppet能力的缺陷,其中一个特定对象的资源类型(如主机资源来处理/etc/hosts中的条目)还不可用。在这个文档中,您将学习如何使用Augeas来减轻你管理配置文件的负担。
|
||||
Augeas可被认为填补了Puppet能力的空白,比如在其中一个指定对象的资源类型(例如用于维护/etc/hosts中的条目的主机资源)还不可用时。在这个文档中,您将学习如何使用Augeas来减轻你管理配置文件的负担。
|
||||
|
||||
### Augeas是什么? ###
|
||||
|
||||
@ -11,13 +10,13 @@ Augeas基本上就是一个配置编辑工具。它以他们原生的格式解
|
||||
|
||||
### 这篇教程要达成什么目的? ###
|
||||
|
||||
我们会安装并配置Augeas用于我们之前构建的Puppet服务器。我们会使用这个工具创建并测试几个不同的配置文件,并学习如何适当地使用它来管理我们的系统配置。
|
||||
我们会针对[我们之前构建的Puppet服务器][1]安装并配置Augeas。我们会使用这个工具创建并测试几个不同的配置文件,并学习如何适当地使用它来管理我们的系统配置。
|
||||
|
||||
### 先决条件 ###
|
||||
### 前置阅读 ###
|
||||
|
||||
我们需要一台工作的Puppet服务器和客户端。如果你还没有,请先按照我先前的教程来。
|
||||
我们需要一台工作的Puppet服务器和客户端。如果你还没有,请先按照我先前的[教程][1]来。
|
||||
|
||||
Augeas安装包可以在标准CentOS/RHEL仓库中找到。不幸的是,Puppet用到的ruby封装的Augeas只在puppetlabs仓库中(或者[EPEL][4])中才有。如果你系统中还没有这个仓库,请使用下面的命令:
|
||||
Augeas安装包可以在标准CentOS/RHEL仓库中找到。不幸的是,Puppet用到的Augeas的ruby封装只在puppetlabs仓库中(或者[EPEL][4])中才有。如果你系统中还没有这个仓库,请使用下面的命令:
|
||||
|
||||
在CentOS/RHEL 6.5上:
|
||||
|
||||
@ -31,7 +30,7 @@ Augeas安装包可以在标准CentOS/RHEL仓库中找到。不幸的是,Puppet
|
||||
|
||||
# yum install rubyaugeas
|
||||
|
||||
或者如果你是从我的上一篇教程中继续的,使用puppet的方法安装这个包。在/etc/puppet/manifests/site.pp中修改你的custom_utils类,在packages这行中加入“rubyaugeas”。
|
||||
或者如果你是从我的[上一篇教程中继续][1]的,使用puppet的方法安装这个包。在/etc/puppet/manifests/site.pp中修改你的custom_utils类,在packages这行中加入“rubyaugeas”。
|
||||
|
||||
class custom_utils {
|
||||
package { ["nmap","telnet","vimenhanced","traceroute","rubyaugeas"]:
|
||||
@ -54,7 +53,7 @@ Augeas安装包可以在标准CentOS/RHEL仓库中找到。不幸的是,Puppet
|
||||
|
||||
1. 给wheel组加上sudo权限。
|
||||
|
||||
这个例子会向你战士如何在你的GNU/Linux系统中为%wheel组加上sudo权限。
|
||||
这个例子会向你展示如何在你的GNU/Linux系统中为%wheel组加上sudo权限。
|
||||
|
||||
# 安装sudo包
|
||||
package { 'sudo':
|
||||
@ -73,7 +72,7 @@ Augeas安装包可以在标准CentOS/RHEL仓库中找到。不幸的是,Puppet
|
||||
]
|
||||
}
|
||||
|
||||
现在来解释这些代码做了什么:**spec**定义了/etc/sudoers中的用户段,**[user]**定义了数组中给定的用户,所有的定义的斜杠( / ) 后用户的子部分。因此在典型的配置中这个可以这么表达:
|
||||
现在来解释这些代码做了什么:**spec**定义了/etc/sudoers中的用户段,**[user]**定义了数组中给定的用户,所有的定义放在该用户的斜杠( / ) 后那部分。因此在典型的配置中这个可以这么表达:
|
||||
|
||||
user host_group/host host_group/command host_group/command/runas_user
|
||||
|
||||
@ -83,7 +82,7 @@ Augeas安装包可以在标准CentOS/RHEL仓库中找到。不幸的是,Puppet
|
||||
|
||||
2. 添加命令别称
|
||||
|
||||
下面这部分会向你展示如何定义命令别名,他可以在你的sudoer文件中使用。
|
||||
下面这部分会向你展示如何定义命令别名,它可以在你的sudoer文件中使用。
|
||||
|
||||
# 创建新的SERVICE别名,包含了一些基本的特权命令。
|
||||
augeas { 'sudo_cmdalias':
|
||||
@ -97,7 +96,7 @@ Augeas安装包可以在标准CentOS/RHEL仓库中找到。不幸的是,Puppet
|
||||
]
|
||||
}
|
||||
|
||||
sudo命令别名的语法很简单:**Cmnd_Alias**定义了命令别名字段,**[alias/name]**绑定所有给定的别名,/alias/name **SERVICES** 定义真实的别名以及alias/command 是所有命令的数组,每条命令是这个别名的一部分。
|
||||
sudo命令别名的语法很简单:**Cmnd_Alias**定义了命令别名字段,**[alias/name]**绑定所有给定的别名,/alias/name **SERVICES** 定义真实的别名,alias/command 是属于该别名的所有命令的数组。以上将被转换如下:
|
||||
|
||||
Cmnd_Alias SERVICES = /sbin/service , /sbin/chkconfig , /bin/hostname , /sbin/shutdown
|
||||
|
||||
@ -105,12 +104,12 @@ sudo命令别名的语法很简单:**Cmnd_Alias**定义了命令别名字段
|
||||
|
||||
#### 向一个组中加入用户 ####
|
||||
|
||||
要使用Augeas向组中添加用户,你有也许要添加一个新用户,无论是在gid字段后或者在最后一个用户后。我们在这个例子中使用组SVN。这可以通过下面的命令达成:
|
||||
要使用Augeas向组中添加用户,你也许要添加一个新用户,不管是排在 gid 字段还是最后的用户 uid 之后。我们在这个例子中使用SVN组。这可以通过下面的命令达成:
|
||||
|
||||
在Puppet中:
|
||||
|
||||
augeas { 'augeas_mod_group:
|
||||
context => '/files/etc/group', # The target file is /etc/group
|
||||
context => '/files/etc/group', #目标文件是 /etc/group
|
||||
changes => [
|
||||
"ins user after svn/*[self::gid or self::user][last()]",
|
||||
"set svn/user[last()] john",
|
||||
@ -123,14 +122,14 @@ sudo命令别名的语法很简单:**Cmnd_Alias**定义了命令别名字段
|
||||
|
||||
### 总结 ###
|
||||
|
||||
目前为止,你应该对如何在Puppet项目中使用Augeas有一个好想法了。随意地试一下,你肯定会经历官方的Augeas文档。这会帮助你了解如何在你的个人项目中正确地使用Augeas,并且它会想你展示你可以用它节省多少时间。
|
||||
目前为止,你应该对如何在Puppet项目中使用Augeas有点明白了。随意地试一下,你肯定需要浏览官方的Augeas文档。这会帮助你了解如何在你的个人项目中正确地使用Augeas,并且它会让你知道可以用它节省多少时间。
|
||||
|
||||
如有任何问题,欢迎在下面的评论中发布,我会尽力解答和向你建议。
|
||||
|
||||
### 有用的链接 ###
|
||||
|
||||
- [http://www.watzmann.net/categories/augeas.html][6]: contains a lot of tutorials focused on Augeas usage.
|
||||
- [http://projects.puppetlabs.com/projects/1/wiki/puppet_augeas][7]: Puppet wiki with a lot of practical examples.
|
||||
- [http://www.watzmann.net/categories/augeas.html][6]: 包含许多关于 Augeas 使用的教程。
|
||||
- [http://projects.puppetlabs.com/projects/1/wiki/puppet_augeas][7]: Puppet wiki 带有许多实例。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -138,12 +137,12 @@ via: http://xmodulo.com/2014/09/manage-configurations-linux-puppet-augeas.html
|
||||
|
||||
作者:[Jaroslav Štěpánek][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/jaroslav
|
||||
[1]:http://xmodulo.com/2014/08/install-puppet-server-client-centos-rhel.html
|
||||
[1]:http://linux.cn/article-3959-1.html
|
||||
[2]:http://augeas.net/
|
||||
[3]:http://xmodulo.com/manage-configurations-linux-puppet-augeas.html
|
||||
[4]:http://xmodulo.com/2013/03/how-to-set-up-epel-repository-on-centos.html
|
@ -1,24 +1,24 @@
|
||||
Ansible和Docker的作用和用法
|
||||
================================================================================
|
||||
在 [Docker][1] 和 [Ansible][2] 的技术社区内存在着很多好玩的东西,我希望在你阅读完这篇文章后也能获取到我们对它们的那种热爱。当然,你也会收获一些实践知识,那就是如何通过部署 Ansible 和 Docker 来为 Rails 应用搭建一个完整的服务器环境。
|
||||
在 [Docker][1] 和 [Ansible][2] 的技术社区内存在着很多好玩的东西,我希望在你阅读完这篇文章后也能像我们一样热爱它们。当然,你也会收获一些实践知识,那就是如何通过部署 Ansible 和 Docker 来为 Rails 应用搭建一个完整的服务器环境。
|
||||
|
||||
也许有人会问:你怎么不去用 Heroku?首先,我可以在任何供应商提供的主机上运行 Docker 和 Ansible;其次,相比于方便性,我更偏向于喜欢灵活性。我可以在这种组合中运行任何程序,而不仅仅是 web 应用。最后,我骨子里是一个工匠,我非常理解如何把零件拼凑在一起工作。Heroku 的基础模块是 Linux Container,而 Docker 表现出来的多功能性也是基于这种技术。事实上,Docker 的其中一个座右铭是:容器化是新虚拟化技术。
|
||||
也许有人会问:你怎么不去用 Heroku?首先,我可以在任何供应商提供的主机上运行 Docker 和 Ansible;其次,相比于方便性,我更偏向于喜欢灵活性。我可以在这种组合中运行任何程序,而不仅仅是 web 应用。最后,我骨子里是一个工匠,我非常了解如何把零件拼凑在一起工作。Heroku 的基础模块是 Linux Container,而 Docker 表现出来的多功能性也是基于这种技术。事实上,Docker 的其中一个座右铭是:容器化是新虚拟化技术。
|
||||
|
||||
### 为什么使用 Ansible? ###
|
||||
|
||||
我重度使用 Chef 已经有4年了(LCTT:Chef 是与 puppet 类似的配置管理工具),**基础设施即代码**的观念让我觉得非常无聊。我花费大量时间来管理代码,而不是管理基础设施本身。不论多小的改变,都需要相当大的努力来实现它。使用 [Ansible][3],你可以一手掌握拥有可描述性数据的基础架构,另一只手掌握不同组件之间的交互作用。这种更简单的操作模式让我把精力集中在如何将我的技术设施私有化,提高了我的工作效率。与 Unix 的模式一样,Ansible 提供大量功能简单的模块,我们可以组合这些模块,达到不同的工作要求。
|
||||
|
||||
除了 Python 和 SSH,Ansible 不再依赖其他软件,在它的远端主机上不需要部署代理,也不会留下任何运行痕迹。更厉害的是,它提供一套内建的、可扩展的模块库文件,通过它你可以控制所有:包管理器、云服务供应商、数据库等等等等。
|
||||
除了 Python 和 SSH,Ansible 不再依赖其他软件,在它的远端主机上不需要部署代理,也不会留下任何运行痕迹。更厉害的是,它提供一套内建的、可扩展的模块库文件,通过它你可以控制所有的一切:包管理器、云服务供应商、数据库等等等等。
|
||||
|
||||
### 为什么要使用 Docker? ###
|
||||
|
||||
[Docker][4] 的定位是:提供最可靠、最方便的方式来部署服务。这些服务可以是 mysqld,可以是 redis,可以是 Rails 应用。先聊聊 git,它的快照功能让它可以以最有效的方式发布代码,Docker 的处理方法与它类似。它保证应用可以无视主机环境,随心所欲地跑起来。
|
||||
[Docker][4] 的定位是:提供最可靠、最方便的方式来部署服务。这些服务可以是 mysqld,可以是 redis,可以是 Rails 应用。先聊聊 git 吧,它的快照功能让它可以以最有效的方式发布代码,Docker 的处理方法与它类似。它保证应用可以无视主机环境,随心所欲地跑起来。
|
||||
|
||||
一种最普遍的误解是人们总是把 Docker 容器看成是一个虚拟机,当然,我表示理解你们的误解。Docker 满足[单一功能原则][5],在一个容器里面只跑一个进程,所以一次修改只会影响一个进程,而这些进程可以被重用。这种模型参考了 Unix 的哲学思想,当前还处于试验阶段,并且正变得越来越稳定。
|
||||
|
||||
### 设置选项 ###
|
||||
|
||||
不需要离开终端,我就可以使用 Ansible 来生成以下实例:Amazon Web Services,Linode,Rackspace 以及 DigitalOcean。如果想要更详细的信息,我于1分25秒内在位于阿姆斯特丹的2号数据中心上创建了一个 2GB 的 DigitalOcean 虚拟机。另外的1分50秒用于系统配置,包括设置 Docker 和其他个人选项。当我完成这些基本设定后,就可以部署我的应用了。值得一提的是这个过程中我没有配置任何数据库或程序开发语言,Docker 已经帮我把应用所需要的事情都安排好了。
|
||||
不需要离开终端,我就可以使用 Ansible 来在这些云平台中生成实例:Amazon Web Services,Linode,Rackspace 以及 DigitalOcean。如果想要更详细的信息,我于1分25秒内在位于阿姆斯特丹的2号数据中心上创建了一个 2GB 的 DigitalOcean 虚拟机。另外的1分50秒用于系统配置,包括设置 Docker 和其他个人选项。当我完成这些基本设定后,就可以部署我的应用了。值得一提的是这个过程中我没有配置任何数据库或程序开发语言,Docker 已经帮我把应用所需要的事情都安排好了。
|
||||
|
||||
Ansible 通过 SSH 为远端主机发送命令。我保存在本地 ssh 代理上面的 SSH 密钥会通过 Ansible 提供的 SSH 会话分享到远端主机。当我把应用代码从远端 clone 下来,或者上传到远端时,我就不再需要提供 git 所需的证书了,我的 ssh 代理会帮我通过 git 主机的身份验证程序的。
|
||||
|
||||
@ -65,13 +65,13 @@ CMD 这个步骤是在新的 web 应用容器启动后执行的。在测试环
|
||||
|
||||
没有本地 Docker 镜像,从零开始部署一个中级规模的 Rails 应用大概需要100个 gems,进行100次整体测试,在使用2个核心实例和2GB内存的情况下,这些操作需要花费8分16秒。装上 Ruby、MySQL 和 Redis Docker 镜像后,部署应用花费了4分45秒。另外,如果从一个已存在的主应用镜像编译出一个新的 Docker 应用镜像出来,只需花费2分23秒。综上所述,部署一套新的 Rails 应用,解决其所有依赖关系(包括 MySQL 和 Redis),只需花我2分钟多一点的时间就够了。
|
||||
|
||||
需要指出的一点是,我的应用上运行着一套完全测试套件,跑完测试需要花费额外1分钟时间。尽管是无意的,Docker 可以变成一套简单的持续集成环境,当测试失败后,Docker 会把“test-only”这个容器保留下来,用于分析出错原因。我可以在1分钟之内和我的客户一起验证新代码,保证不同版本的应用之间是完全隔离的,同操作系统也是隔离的。传统虚拟机启动系统时需要花费好几分钟,Docker 容器只花几秒。另外,一旦一个 Dockedr 镜像编译出来,并且针对我的某个版本的应用的测试都被通过,我就可以把这个镜像提交到 Docker 私服 Registry 上,可以被其他 Docker 主机下载下来并启动一个新的 Docker 容器,而这不过需要几秒钟时间。
|
||||
需要指出的一点是,我的应用上运行着一套完全测试套件,跑完测试需要花费额外1分钟时间。尽管是无意的,Docker 可以变成一套简单的持续集成环境,当测试失败后,Docker 会把“test-only”这个容器保留下来,用于分析出错原因。我可以在1分钟之内和我的客户一起验证新代码,保证不同版本的应用之间是完全隔离的,同操作系统也是隔离的。传统虚拟机启动系统时需要花费好几分钟,Docker 容器只花几秒。另外,一旦一个 Dockedr 镜像编译出来,并且针对我的某个版本的应用的测试都被通过,我就可以把这个镜像提交到一个私有的 Docker Registry 上,可以被其他 Docker 主机下载下来并启动一个新的 Docker 容器,而这不过需要几秒钟时间。
|
||||
|
||||
### 总结 ###
|
||||
|
||||
Ansible 让我重新看到管理基础设施的乐趣。Docker 让我有充分的信心能稳定处理应用部署过程中最重要的步骤——交付环节。双剑合璧,威力无穷。
|
||||
|
||||
从无到有搭建一个完整的 Rails 应用可以在12分钟内完成,这种速度放在任何场合都是令人印象深刻的。能获得一个免费的持续集成环境,可以查看不同版本的应用之间的区别,不会影响到同主机上已经在运行的应用,这些功能强大到难以置信,让我感到很兴奋。在文章的最后,我只希望你能感受到我的兴奋。
|
||||
从无到有搭建一个完整的 Rails 应用可以在12分钟内完成,这种速度放在任何场合都是令人印象深刻的。能获得一个免费的持续集成环境,可以查看不同版本的应用之间的区别,不会影响到同主机上已经在运行的应用,这些功能强大到难以置信,让我感到很兴奋。在文章的最后,我只希望你能感受到我的兴奋!
|
||||
|
||||
我在2014年1月伦敦 Docker 会议上讲过这个主题,[已经分享到 Speakerdeck][7]了。
|
||||
|
||||
@ -87,7 +87,7 @@ via: http://thechangelog.com/ansible-docker/
|
||||
|
||||
作者:[Gerhard Lazu][a]
|
||||
译者:[bazz2](https://github.com/bazz2)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
Git教程往往不会解决这个问题,因为它集中篇幅来教你Git命令和概念,并且不认为你会使用GitHub。[GitHub帮助教程](https://help.github.com/)一定程度上弥补了这一缺陷,但是它每篇文章的关注点都较为狭隘,而且没有提供关于"Git vs GitHub"问题的概念性概述。
|
||||
|
||||
**如果你是习惯于先理解概念,再着手代码的学习者**,而且你也是Git和GitHub的初学者,我建议你先理解清楚什么是fork,为什么?
|
||||
**如果你是习惯于先理解概念,再着手代码的学习者**,而且你也是Git和GitHub的初学者,我建议你先理解清楚什么是fork。为什么呢 ?
|
||||
|
||||
1. Fork是在GitHub起步最普遍的方式。
|
||||
2. Fork只需要很少的Git命令,但是起得作用却非常大。
|
||||
@ -53,15 +53,19 @@ Joe和其余贡献者已经对这个项目做了一些修改,而你将在他
|
||||
|
||||
### 结论
|
||||
|
||||
我希望这是一篇关于GitHub和Git [fork](https://help.github.com/articles/fork-a-repo)有用概述。现在,你已经理解了那些概念,你将会更容易地在实际中执行你的代码。GitHub关于fork和[同步](https://help.github.com/articles/syncing-a-fork)的文章将会给你大部分你需要的代码。
|
||||
我希望这是一篇关于GitHub和Git 的 [fork](https://help.github.com/articles/fork-a-repo)有用概述。现在,你已经理解了那些概念,你将会更容易地在实际中执行你的代码。GitHub关于fork和[同步](https://help.github.com/articles/syncing-a-fork)的文章将会给你大部分你需要的代码。
|
||||
|
||||
如果你是Git的初学者,而且你很喜欢这种学习方式,那么我极力推荐书籍[Pro Git](http://git-scm.com/book)的前两个章节,网上是可以免费查阅的。
|
||||
|
||||
如果你喜欢视频学习,我创建了一个[11部分的视频系列](http://www.dataschool.io/git-and-github-videos-for-beginners/)(总共36分钟),来向初学者介绍Git和GitHub。
|
||||
|
||||
---
|
||||
via: http://www.dataschool.io/simple-guide-to-forks-in-github-and-git/
|
||||
|
||||
作者:[Kevin Markham][a]
|
||||
译者:[su-kaiyao](https://github.com/su-kaiyao)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://disqus.com/home/user/justmarkham/
|
54
published/20141023 6 Minesweeper Clones for Linux.md
Normal file
54
published/20141023 6 Minesweeper Clones for Linux.md
Normal file
@ -0,0 +1,54 @@
|
||||
Linux下的6个扫雷游戏的翻版
|
||||
================================================================================
|
||||
Windows 下的扫雷游戏还没玩够么?那么来 Linux 下继续扫雷吧——这是一个雷的时代~~
|
||||
|
||||
### GNOME Mines ###
|
||||
|
||||
这是GNOME扫雷复制品,允许你从3个不同的预定义表大小(8×8, 16×16, 30×16)中选择其一,或者自定义行列的数量。它能以全屏模式运行,带有高分值、耗时和提示。游戏可以暂停和继续。
|
||||
|
||||
![](http://www.tuxarena.com/wp-content/uploads/2014/10/gnome-mines1.jpg)
|
||||
|
||||
### ace-minesweeper ###
|
||||
|
||||
这是一个大的软件包中的游戏,此包中也包含有其它一些游戏,如ace-freecel,ace-solitaire或ace-spider。它有一个以小企鹅为特色的图形化界面,但好像不能调整表的大小。该包在Ubuntu中名为ace-of-penguins。
|
||||
|
||||
![](http://www.tuxarena.com/wp-content/uploads/2014/10/ace-minesweeper.jpg)
|
||||
|
||||
### XBomb ###
|
||||
|
||||
XBomb是针对X Windows系统扫雷游戏,它有三种不同的表尺寸和卡牌风格,包含有不同的外形:六角形、矩形(传统)或三角形。不幸的是,在Ubuntu 14.04中的版本会出现程序分段冲突,所以你可能需要安装另外一个版本。
|
||||
[首页][1]。
|
||||
|
||||
![](http://www.tuxarena.com/wp-content/uploads/2014/10/xbomb.png)
|
||||
|
||||
([图像来源][1])
|
||||
|
||||
### KMines ###
|
||||
|
||||
KMines是一个KDE游戏,和GNOME Mines类似,有三个内建表尺寸(简易、中等、困单),也可以自定义,支持主题和高分。
|
||||
|
||||
![](http://www.tuxarena.com/wp-content/uploads/2014/10/kmines.jpg)
|
||||
|
||||
### freesweep ###
|
||||
|
||||
Freesweep是一个针对终端的扫雷复制品,它可以配置表行列、炸弹比例、颜色,也有一个高分表。
|
||||
|
||||
![](http://www.tuxarena.com/wp-content/uploads/2014/10/freesweep.jpg)
|
||||
|
||||
### xdemineur ###
|
||||
|
||||
另外一个针对X的图形化扫雷Xdemineur,和Ace-Minesweeper十分相像,带有一个预定义的表尺寸。
|
||||
|
||||
![](http://www.tuxarena.com/wp-content/uploads/2014/10/xdemineur.jpg)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tuxarena.com/2014/10/6-minesweeper-clones-for-linux/
|
||||
|
||||
作者:Craciun Dan
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.gedanken.org.uk/software/xbomb/
|
@ -1,6 +1,6 @@
|
||||
教你在 Ubuntu 上使用 LXC 容器
|
||||
================================================================================
|
||||
使用“容器”来保证主机环境的安全性,这个概念早在十年前就已经存在(例如 FreeBSD 的 jail 虚拟化技术),但是直到最近,随着部署云架构需求越来越多,像 LXC 和 [Docker][1] 这种 Linux 下的容器才成为被关注的焦点。当然,由于主流厂商(云供应商如亚马逊主推 AWS,微软主推 Azure;发行版如红帽、Ubuntu等)组成的强大靠山,[Docker][2] 已经被放在媒体的聚光灯下面,其实,Docker 里面所谓的“容器”技术是由 LXC 提供的。
|
||||
使用“容器”来保证主机环境的安全性,这个概念早在十年前就已经存在(例如 FreeBSD 的 jail 虚拟化技术),但是直到最近,随着部署云架构需求越来越多,像 LXC 和 [Docker][1] 这种 Linux 下的容器才成为被关注的焦点。当然,由于主流厂商(云服务商如亚马逊主推 AWS,微软主推 Azure;发行版如红帽、Ubuntu等)组成的强大靠山,[Docker][2] 已经被放在媒体的聚光灯下面,其实,Docker 里面所谓的“容器”技术是由 LXC 提供的。
|
||||
|
||||
你只是一个普通的 Linux 用户,那 Docker/LXC 能为你带来什么好处呢?容器可以将你的应用在不同的 Linux 发行版之间迁移。想像一下这个场景:你正在用的发行版是 Debian,你喜欢它的稳定性,同时你又想玩一款最新的 Ubuntu 游戏,你不需要在电脑上装双系统然后重启进入 Ubuntu,也不需要在 Debian 上跑一个耗资源的 Ubuntu 虚拟机,你只需要简单地生成一个 Ubuntu 容器就够了。
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
![](https://farm4.staticflickr.com/3955/15655792445_d462957ee9_z.jpg)
|
||||
|
||||
安装完 LXC 工具后,就能看到 LXC 自动创建了一块桥接网卡(lxcbr0,在 /etc/lxc/default.conf 中设置)。
|
||||
安装完 LXC 工具后,就能看到 LXC 自动创建了一块桥接网卡(lxcbr0,可以在 /etc/lxc/default.conf 中设置)。
|
||||
|
||||
![](https://farm6.staticflickr.com/5598/15035046834_a53c092230_z.jpg)
|
||||
|
||||
@ -66,11 +66,11 @@
|
||||
------------------------------------
|
||||
test-lxc STOPPED - - NO
|
||||
|
||||
使用下面的命令启动容器。参数“-d”将容器作为后台进程打开。如果没有指定这个参数,你可以在控制台界面上直接把容器的运行程序关闭(LCTT:Ctrl+C组合键)。
|
||||
使用下面的命令启动容器。参数“-d”将容器作为后台进程打开。如果没有指定这个参数,你可以在控制台界面上直接把容器的运行程序关闭(LCTT译注:Ctrl+C组合键)。
|
||||
|
||||
$ sudo lxc-start -n <container-name> -d
|
||||
|
||||
开容器后,看看状态:
|
||||
打开容器后,看看状态:
|
||||
|
||||
$ sudo lxc-ls --fancy
|
||||
|
||||
@ -132,7 +132,7 @@ via: http://xmodulo.com/lxc-containers-ubuntu.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[bazz2](https://github.com/bazz2)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,12 +1,12 @@
|
||||
CentOS 下安装 LEMP 包(nginx、MariaDB/MySQL 和 php)
|
||||
CentOS 下安装 LEMP 服务(nginx、MariaDB/MySQL 和 php)
|
||||
================================================================================
|
||||
LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作用。正如其名称所暗示的, LEMP 包是由 Linux、ngix、MariaDB/MySQL 和 PHP 组成的。在传统的 LAMP 包中使用的 Apache HTTP 协议服务器性能低下而且难于大规模集群,相比来说 ngix 的高性能及轻量级等特性,正是其的替代方案。 MariaDB 是一款社区支持驱动的 MySQL 数据库的分支,其功能更多性能更佳。PHP,服务端编程语言,具体是由 PHP FastCGI 的增强版 PHP-FPM 组件来处理,生成网页动态内容。
|
||||
LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生产环境中的核心网站服务上起着强有力的作用。正如其名称所暗示的, LEMP 包是由 Linux、nginx、MariaDB/MySQL 和 PHP 组成的。在传统的 LAMP 包中使用的 Apache HTTP 协议服务器性能低下而且难于大规模集群,相比来说 nginx 的高性能及轻量级等特性,正是其的替代方案。 MariaDB 是一款社区支持驱动的 MySQL 数据库的分支,其功能更多性能更佳。PHP,服务端编程语言,具体是由 PHP FastCGI 的增强版 PHP-FPM 组件来处理,生成网页动态内容。
|
||||
|
||||
这篇文章里,我们示范**如何在 CentOS 操作平台上安装 LEMP 包**。我们安装的目标是 CentOS 6 和 CentOS 7 两个操作平台,如有必要会指出它们的不同。
|
||||
|
||||
### 第一步: Nginx ###
|
||||
|
||||
让我们在 CentOS 上安装 nginx 作为第一步,然后对它作些基本的配置,比如使其能自启动和[对防火墙做个性化设置][1]。
|
||||
让我们在 CentOS 上安装 nginx 作为第一步,然后对它作些基本的配置,比如使其能引导时启动和[对防火墙做个性化设置][1]。
|
||||
|
||||
#### 安装 Nginx ####
|
||||
|
||||
@ -48,7 +48,7 @@ LEMP 组合包是一款日益流行的网站服务组合软件包,在许多生
|
||||
|
||||
#### 测试 Nginx ####
|
||||
|
||||
nginx 的默认文档要目录是 /usr/share/nginx/html。默认的 index.html 文件一定已经在这目录下了。让我们检测下是否可以访问到这个测试 web 页,输入 http://<nginx-ip-address>/ 访问。
|
||||
nginx 的默认文档要目录是 /usr/share/nginx/html。默认的 index.html 文件一定已经在这目录下了。让我们检测下是否可以访问到这个测试 web 页,输入 http://nginx的ip地址/ 访问。
|
||||
|
||||
![](https://farm4.staticflickr.com/3940/15461279287_8573948074_b.jpg)
|
||||
|
||||
@ -56,7 +56,7 @@ nginx 的默认文档要目录是 /usr/share/nginx/html。默认的 index.html
|
||||
|
||||
### 第二步: MariaDB/MySQL ###
|
||||
|
||||
下一步就是安装 LEMP 包的数据库组件。CentOS/RHEL 6 或早期的版本中提供的是 MySQL 的服务/客户端安装包,但 CentOS/RHEL 7 已使用了 MySQL 默认实现的版本 MariaDB。作为 MySQL 的简单替代品,MariaDB 保证了与 MySQL 的 API 和命令行用法方面最大的兼容性。下面是关于怎么在 CentOS 上安装和配置 MaraDB/MySQL 的操作示例。
|
||||
下一步就是安装 LEMP 包的数据库组件。CentOS/RHEL 6 或早期的版本中提供的是 MySQL 的服务器/客户端安装包,但 CentOS/RHEL 7 已使用了 MariaDB 替代了默认的 MySQL。作为 MySQL 的简单替代品,MariaDB 保证了与 MySQL 的 API 和命令行用法方面最大的兼容性。下面是关于怎么在 CentOS 上安装和配置 MaraDB/MySQL 的操作示例。
|
||||
|
||||
在 CentOS 7 系统上:
|
||||
|
||||
@ -76,7 +76,7 @@ nginx 的默认文档要目录是 /usr/share/nginx/html。默认的 index.html
|
||||
|
||||
在成功启动 MariaDB/MySQL 服务后,执行在 MariaDB/MySQL 服务包中的脚本。这一次的运行会为为数据库服务器进行一些安全强化措施,如设置(非空)的 root 密码、删除匿名用户、锁定远程访问。
|
||||
|
||||
$ sudo mysql_secure_installation
|
||||
$ sudo mysql_secure_installation
|
||||
|
||||
![](https://farm8.staticflickr.com/7545/15644566071_8c39875512_z.jpg)
|
||||
|
||||
@ -84,7 +84,7 @@ nginx 的默认文档要目录是 /usr/share/nginx/html。默认的 index.html
|
||||
|
||||
### 第三步: PHP ###
|
||||
|
||||
PHP 是 LEMP 包中一个重要的组件,它负责把存储在 MariaDB/MySQL 服务器的数据取出生成动态内容。为了 LEMP 可用,您至少需要安装上 PHP-FPM 和 PHP-MySQL 两个模块。PHP-FPM(FastCGI 进程管理器)实现的是 nginx 服务器和生成动态内容的 PHP 应用程序的访问接口。PHP-MySQL 模块使 PHP 程序能访问 MariaDB/MySQL 数据库。
|
||||
PHP 是 LEMP 包中一个重要的组件,它负责把存储在 MariaDB/MySQL 服务器的数据取出生成动态内容。为了 LEMP 需要,您至少需要安装上 PHP-FPM 和 PHP-MySQL 两个模块。PHP-FPM(FastCGI 进程管理器)实现的是 nginx 服务器和生成动态内容的 PHP 应用程序的访问接口。PHP-MySQL 模块使 PHP 程序能访问 MariaDB/MySQL 数据库。
|
||||
|
||||
#### 安装 PHP 模块 ####
|
||||
|
||||
@ -116,14 +116,14 @@ PHP 是 LEMP 包中一个重要的组件,它负责把存储在 MariaDB/MySQL
|
||||
- **php-dba**: PHP 的数据抽象层支持。
|
||||
- **php-pecl-apc**: PHP 加速器/缓存支持。
|
||||
|
||||
安装时,要查看可用的 PHP 模块的完整列表的话,可以运行:
|
||||
安装时,要查看可用的 PHP 模块的完整列表的话,可以运行:
|
||||
|
||||
$ sudo yum search php- (CentOS 7)
|
||||
$ sudo yum --enablerepo=remi search php- (CentOS 6)
|
||||
|
||||
#### 启动 PHP-FPM ####
|
||||
|
||||
您需要启动 PHP-FPM ,然后把它加放自动启动服务列表。
|
||||
您需要启动 PHP-FPM ,然后把它放到自动启动服务列表。
|
||||
|
||||
在 CentOS 7 系统上:
|
||||
|
||||
@ -185,7 +185,7 @@ PHP 是 LEMP 包中一个重要的组件,它负责把存储在 MariaDB/MySQL
|
||||
}
|
||||
}
|
||||
|
||||
nginx 的默认工作线程(在 /etc/nginx/nginx.conf 文件中指定的)数是一个,让我们也来调整一下这个数字。通常来说我们创建的工作线程数应该和 CPU 核数相同。要确信您的 CPU 的核数,请运行下面这命令:
|
||||
nginx 的默认工作线程数(在 /etc/nginx/nginx.conf 文件中指定的)是 1,让我们也来调整一下这个数字。通常来说我们创建的工作线程数应该和 CPU 核数相同。要确信您的 CPU 的核数,请运行下面这命令:
|
||||
|
||||
$ grep processor /proc/cpuinfo | wc -l
|
||||
|
||||
@ -202,11 +202,11 @@ nginx 的默认工作线程(在 /etc/nginx/nginx.conf 文件中指定的)数
|
||||
接下来,让我们对 PHP 的配置文件 /etc/php.ini 做自定义设置。更具体的就是在 /etc/php.ini 文件中增加以下两行。
|
||||
|
||||
cgi.fix_pathinfo=0
|
||||
date.timezone = "America/New York"
|
||||
date.timezone = "PRC"
|
||||
|
||||
为了安全起见,我们希望的是 PHP 解释器只是处理指定文件路径的文件任务,而不是预测搜索一些并不存在的文件任务。上面的第一行起的就是这个作用。
|
||||
为了安全起见,我们希望的是 PHP 解释器只是处理指定文件路径的文件任务,而不是预测搜索一些并不存在的文件任务。上面的第一行起的就是这个作用。(LCTT 译注:原文用的时区是“America/New York”,根据国内情况,应该用 PRC或 Asia 下的中国城市。)
|
||||
|
||||
第二行定义的是 PHP 中 日期/时间相关函数使用相关的默认时区。使用[本指南] [3],找出您所在的时区,并设置相应 **date.timezone 的值**。
|
||||
第二行定义的是 PHP 中日期/时间相关函数使用相关的默认时区。使用[本指南][3],找出您所在的时区,并设置相应 **date.timezone 的值**。
|
||||
|
||||
#### 测试 PHP ####
|
||||
|
||||
@ -226,7 +226,7 @@ nginx 的默认工作线程(在 /etc/nginx/nginx.conf 文件中指定的)数
|
||||
|
||||
<?php phpinfo(); ?>
|
||||
|
||||
打开浏览器,输入 http://<nginx-ip-address>/test.php 。
|
||||
打开浏览器,输入 http://nginx的IP地址/test.php 。
|
||||
|
||||
![](https://farm6.staticflickr.com/5608/15647258715_9d7bcd8c73_z.jpg)
|
||||
|
||||
@ -238,11 +238,11 @@ via: http://xmodulo.com/install-lemp-stack-centos.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[runningwater](https://github.com/runningwater)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
||||
[1]:http://ask.xmodulo.com/open-port-firewall-centos-rhel.html
|
||||
[2]:http://ask.xmodulo.com/install-remi-repository-centos-rhel.html
|
||||
[1]:http://linux.cn/article-4243-1.html
|
||||
[2]:http://linux.cn/article-4192-1.html
|
||||
[3]:http://ask.xmodulo.com/set-default-timezone-php.html
|
@ -1,6 +1,6 @@
|
||||
Linux 有问必答 -- 如何修复“hda-duplex not supported in this QEMU binary”(hda-duplex在此QEMU文件中不支持)
|
||||
Linux 有问必答:如何修复“hda-duplex not supported in this QEMU binary”
|
||||
================================================================================
|
||||
> **提问**: 当我尝试在虚拟机中安装一个新的Linux时,虚拟机不能启动且报了下面这个错误:“不支持的配置:hda-duplex在此QEMU文件中不支持。” 我该如何修复?
|
||||
> **提问**: 当我尝试在虚拟机中安装一个新的Linux时,虚拟机不能启动且报了下面这个错误:"unsupported configuration: hda-duplex not supported in this QEMU binary."(“不支持的配置:hda-duplex在此QEMU文件中不支持。”) 我该如何修复?
|
||||
|
||||
这个错误可能来自一个当默认声卡型号不能被识别时的一个qemu bug。
|
||||
|
||||
@ -20,7 +20,7 @@ Linux 有问必答 -- 如何修复“hda-duplex not supported in this QEMU binar
|
||||
|
||||
### 方案二: Virsh ###
|
||||
|
||||
如果你使用的是**virt-manager** 而不是**virt-manager**, 你可以编辑VM相应的配置文件。在<device>节点中查找**sound**节点,并按照下面的默认声卡型号改成**ac97**。
|
||||
如果你使用的是**virsh** 而不是**virt-manager**, 你可以编辑VM相应的配置文件。在<device>节点中查找**sound**节点,并按照下面的默认声卡型号改成**ac97**。
|
||||
|
||||
<devices>
|
||||
. . .
|
||||
@ -35,6 +35,6 @@ Linux 有问必答 -- 如何修复“hda-duplex not supported in this QEMU binar
|
||||
via: http://ask.xmodulo.com/hda-duplex-not-supported-in-this-qemu-binary.html
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -4,7 +4,7 @@ Ubuntu也许能在中国给Windows以致命打击
|
||||
|
||||
**Windows操作系统将退出中国的前门,而它的位置将由一个Linux发行版替代,用于官方和政府部门。问题是目前还没有一个真正的可替代系统,尽管还是有一款操作系统也许已经准备接下这个任务,它就是Ubuntu Kylin。**
|
||||
|
||||
至少可以这么说,中国政府和微软目前的关系很紧张。[就像今天新闻里说的][1],一个用Linux类似系统在全国逐步替换Windows的计划已经在准备了。还不清楚具体会采用哪个系统,因为情况很复杂而且这是一个非常大的国家。
|
||||
至少可以这么说,中国政府和微软目前的关系很紧张。[就像新闻里说的][1],一个用Linux类似系统在全国逐步替换Windows的计划已经在准备了。还不清楚具体会采用哪个系统,因为情况很复杂而且这是一个非常大的国家。
|
||||
|
||||
通常,这种问题没有一个普适的解决方案,而且中国的行动确实看起来有点呆板。不管怎样,这为Ubuntu Keylin打开了一扇巨大的机会之窗,它是一个基于Ubuntu由中国开发者和Canonical共同开发的发行版。它已经稳定一段时间了,而且已经发布了几个连续版本。
|
||||
|
||||
@ -12,13 +12,13 @@ Ubuntu也许能在中国给Windows以致命打击
|
||||
|
||||
有趣的是,在这个关于中国意图的新闻冒出来的同一天里,发布了一篇对国防科技大学(NUDT)副教授Dr. Jonas Zhang的采访,关于[最新的14.10分支开发计划][2]。
|
||||
|
||||
“在这次的14.10版本中,有许多很好的功能。比如,新手也可以轻松地通过Ubuntu Kylin软件中心找到Windows软件的替代;用户可以使用Ubuntu Kylin的SSO(Ubuntu Kylin的单一登录系统,我们叫它UKID)来登陆到Ubuntu Kylin的软件和社区;Sogou输入法(一款世界知名的中文输入法,上个月已经在苹果的应用市场上线了)减少了40%的CPU和内存占用。”
|
||||
“在这次的14.10版本中,有许多很好的功能。比如,新手也可以轻松地通过Ubuntu Kylin软件中心找到Windows软件的替代;用户可以使用Ubuntu Kylin的SSO(Ubuntu Kylin的单一登录系统,我们叫它UKID)来登录到Ubuntu Kylin的软件和社区;Sogou输入法(一款世界知名的中文输入法,上个月已经在苹果的应用市场上线了)减少了40%的CPU和内存占用。”
|
||||
|
||||
“来自CSIP(中国政府的一个部门),Canonical和NUDT(国防科技大学)的超过50个项目经理,工程师和社区管理员在为Ubuntu Kylin工作。大部分全职工程师来自NUDT。许多来自Ubuntu,Debian和其他社区的开发者也参与到Ubuntu Kylin的开发中了。”Dr. Jonas Zhang[说][2]。
|
||||
“来自CSIP(中国政府的一个部门),超过50个 Canonical 和 NUDT(国防科技大学)的项目经理、工程师和社区管理员在为 Ubuntu Kylin 工作。大部分全职工程师来自NUDT。许多来自Ubuntu,Debian和其他社区的开发者也参与到Ubuntu Kylin的开发中了。”Dr. Jonas Zhang[说][2]。
|
||||
|
||||
中国政府也许自己也正想办法搭建另一个Linux发行版(不是第一次尝试了),但是目前看来已经有一个很好的用来替代Windows的候选者了。这对于Canonical也是很好的商机,至少从被承认这个角度看。
|
||||
|
||||
如果Ubuntu,通过它和Kylin的联系,想在像中国这样一个大国里取代Windows,对这家公司是巨大的促进。让我们拭目以待,开发者们让Ubuntu Kylin变成一个有竞争力的操作系统的努力是不是白费力气。
|
||||
如果Ubuntu,通过它和Kylin的联系,想在像中国这样的大国里取代Windows,对这家公司将会是个巨大的促进。让我们拭目以待,看看开发者们让Ubuntu Kylin变成一个有竞争力的操作系统所花费的努力是不是白费力气。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -26,7 +26,7 @@ via: http://news.softpedia.com/news/Ubuntu-Could-Give-a-Fatal-Blow-to-Windows-in
|
||||
|
||||
作者:[Silviu Stahie][a]
|
||||
译者:[zpl1025](https://github.com/zpl1025)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[Caroline](https://github.com/carolinewuyan)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,4 +1,4 @@
|
||||
Linux 有问必答 -- 如何在wget中禁用HTTP转发
|
||||
Linux 有问必答:如何在wget中禁用HTTP转发
|
||||
================================================================================
|
||||
> **提问**: 当我用wget获取一个重定向到URL Y的URL X的时候,wget默认会自动获取URL Y。然而我想要强制获取不带重定向的URL X。我该如何禁用wget重定向URL的功能。
|
||||
|
||||
@ -28,6 +28,6 @@ Linux 有问必答 -- 如何在wget中禁用HTTP转发
|
||||
via: http://ask.xmodulo.com/disable-http-redirect-wget.html
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -0,0 +1,129 @@
|
||||
在 Linux 中使用"avconv"工具录制计算机桌面视频和音频
|
||||
================================================================================
|
||||
**Libav**是一款跨平台的工具库,能够用来处理多媒体文件、流和协议。它最初是源自ffmpeg。Libav带有一些工具,比如:
|
||||
|
||||
- **Avplay**: 一款视频音频播放器。
|
||||
- **Avconv**: 能够记录多个设备输入源的一个多媒体转换器和视频音频录制器。
|
||||
- **Avprobe**: 一个连接多媒体文件流并且返回关于这个文件流的统计信息的工具。
|
||||
- **Libavfilter**: 一个Libav工具的过滤器(filtering)API。
|
||||
|
||||
在这篇文章里面,我们就要展示如何通过'Avconv'程序在**Debian/Ubuntu/Linux Mint**发行版上录制Linux桌面视频音频。
|
||||
|
||||
### 第一步:下载 Avconv 工具 ###
|
||||
|
||||
**1.** **avconv**是 “**libav-tools**” 的一部分, 可以通过官方的基于debian的仓库下载,比如Mint、Ubuntu。输入下面命令即可:
|
||||
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install libav-tools
|
||||
|
||||
![Install Avconv Tool](http://www.tecmint.com/wp-content/uploads/2014/11/Install-avconv-tool.jpeg)
|
||||
|
||||
*下载Avconv工具*
|
||||
|
||||
**注意**: 如果从默认仓库下载的话, ‘**avconv**’ 的版本可能比较老。 因此我们推荐你拉取最新的git官方版本。
|
||||
|
||||
$ sudo apt-get install yasm
|
||||
$ git clone git://git.libav.org/libav.git
|
||||
$ cd libav
|
||||
$ ./configure
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
||||
**注意**: 你应该运行 ‘**./configure –help**’ 来列出所有的可选配置选项并且安装相应的解码器和库,你还需要做很多工作来解决依赖问题。
|
||||
|
||||
也要注意,如果你是从源代码编译的,就需要使用**sudo avconv**而不是**avconv**来运行这个工具。
|
||||
|
||||
### 第二步:开始录制桌面视频 ###
|
||||
|
||||
**2.**一切就绪,现在可以通过运行下面的命令录制你的视频了:
|
||||
|
||||
$ avconv -f x11grab -r 25 -s 1920x1080 -i :0.0 -vcodec libx264 -threads 4 $HOME/output.avi
|
||||
|
||||
简单解释一下这个命令:
|
||||
|
||||
- **avconv -f x11grab** 默认从X服务捕捉画面。
|
||||
- **-r 25** 这是你需要的视频帧率,可以自行设置。
|
||||
- **-s 1920×1080** 是你的系统的桌面分辨率,要设置成你当前桌面的分辨率,这一点非常重要。
|
||||
- **-i :0.0** 我们要记录的位置(X 服务输出端口),设置成这样就可以了。
|
||||
- **-vcodec libx264** 我们用来录制视频的编码器。
|
||||
- **-threads 4** 线程数,可以根据情况更改。
|
||||
- **$HOME/output** 输出的目标文件路径。
|
||||
- **.avi** 使用的视频格式,可以换成 “flv”、“mp4″、 “wmv”、 “mov”、 “mkv”等。
|
||||
|
||||
**3.**在运行命令之后,就会在terminal上自动运行一个进程进行记录,按"Ctrl+C"键来终止记录。
|
||||
|
||||
![Record Desktop Screen](http://www.tecmint.com/wp-content/uploads/2014/11/Record-Desktop-Screen.jpeg)
|
||||
|
||||
*录制桌面视频*
|
||||
|
||||
**4.** 现在,你可以使用VLC或者其他的播放器,或者使用来自Libav包里的播放器"avplay"来播放你录制的视频。
|
||||
|
||||
$ avplay $HOME/output.avi
|
||||
|
||||
**注意:** 别忘了替换输出文件的路径为你自己的,录制效果还是很好的。
|
||||
|
||||
![Play Recorded Video](http://www.tecmint.com/wp-content/uploads/2014/11/Play-Recorded-Video.jpeg)
|
||||
|
||||
*播放录制的文件*
|
||||
|
||||
这有一段我用 “**avconv**” 录制的[视频](http://www.youtube.com/embed/g1FEh4wByGE) (墙外)。
|
||||
|
||||
|
||||
### 第三步: 开始录制桌面的音频和视频 ###
|
||||
|
||||
**5.** 如果也想同时录制音频,先运行这个命令,列出所有的音频输入源:
|
||||
|
||||
$ arecord -l
|
||||
|
||||
结果类似这样:
|
||||
|
||||
![Check Audio Input](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Audio-Input.png)
|
||||
|
||||
*检查音频输入源*
|
||||
|
||||
在我这里,我只有一个音频输入源,所以数量是**1**,这就是我使用如下命令来捕捉我的视频以及麦克风的音频的原因。
|
||||
|
||||
$ avconv -f alsa -i hw:1 -f x11grab -r 25 -s 1920x1080 -i :0.0 -vcodec libx264 -threads 4 output-file2.avi
|
||||
|
||||
我修改了部分地方,下面做个简短的解释:
|
||||
|
||||
- **-f** alsa 一个从alsa设备捕捉声音的选项。
|
||||
- **-i** hw:1 是一个从 “hw:1” 设备捕捉音频的选项,这个设备是我电脑上仅有的一个音频输入设备。
|
||||
|
||||
**注意**: 如果你想用**arecord -l**显示的**1**之外的设备的话,别忘了替换 “**1**”。
|
||||
|
||||
结束录制,再来一次“**Ctrl + C**” 就可以。
|
||||
|
||||
### 第四步: 开始录制桌面音频 ###
|
||||
|
||||
**6.** 如果只想录制音频的话,使用下面的命令。
|
||||
|
||||
$ avconv -f alsa -i hw:1 out.wav
|
||||
|
||||
**7.** 替换成 **.mp3** 等Libav支持的格式都可以,播放 **out.wav**就能听到你自己的声音了。
|
||||
|
||||
![Record Desktop Audio](http://www.tecmint.com/wp-content/uploads/2014/11/Record-Desktop-Audio.png)
|
||||
|
||||
*录制桌面音频*
|
||||
|
||||
###最后 ###
|
||||
|
||||
“**avconv**” 工具可以用来做很多其他事情,不仅仅是录制桌面视频,更多的教程和文档请移步到官网。
|
||||
|
||||
- [https://libav.org/avconv.html][1]
|
||||
|
||||
你对"avconv"的体验如何,你使用过其他工具录制桌面视频么?在评论里面和我们分享吧。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/record-ubuntu-desktop-screen-using-avconv/
|
||||
|
||||
作者:[Hanny Helal][a]
|
||||
译者:[ggaaooppeenngg](https://github.com/ggaaooppeenngg)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/hannyhelal/
|
||||
[1]:https://libav.org/avconv.html
|
@ -1,6 +1,6 @@
|
||||
[Quick Tip]如何修复Lubuntu中的Docky混合错误
|
||||
小技巧:如何修复Lubuntu中的Docky混合错误
|
||||
================================================================================
|
||||
总所周知,**Docky**是Unix/Linux类系统中的轻量级应用启动器。我是 Lubuntu 和 Docky的忠实粉丝,因为他们不需要占用我的所有系统资源,这样就可以同时运行更多应用。我在笔记本上使用Docky应用启动器,系统为Lubuntu 14.04.
|
||||
总所周知,**Docky**是Unix/Linux类系统中的轻量级应用启动器。我是 Lubuntu 和 Docky 的忠实粉丝,因为它们不需要占用我的所有系统资源,这样就可以同时运行更多应用。我在笔记本上使用Docky应用启动器,系统为Lubuntu 14.04.
|
||||
|
||||
但是,如果你使用LXDE发行版,你也许肯定遇到过使用Docky时报混合的错误。看下面的截图。
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/unknown_006.png)
|
||||
|
||||
这时,你结可以使用3D背景和隐藏功能,如自动隐藏(Auto-hide),Intellihide和窗口闪烁(Window dodge)等。
|
||||
这时,你就可以使用3D背景和隐藏功能,如自动隐藏(Auto-hide),Intellihide和窗口闪烁(Window dodge)等。
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/Docky-Settings_003.png)
|
||||
|
||||
@ -32,7 +32,7 @@ via: http://www.unixmen.com/quick-tip-fix-docky-compositing-error-lubuntu/
|
||||
|
||||
作者:[SK][a]
|
||||
译者:[Vic020/VicYu](http://www.vicyu.net)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,54 @@
|
||||
Linux有问必答:如何检查Linux上的glibc版本
|
||||
================================================================================
|
||||
> **问题**:我需要找出我的Linux系统上的GNU C库(glibc)的版本,我怎样才能检查Linux上的glibc版本呢?
|
||||
|
||||
GNU C库(glibc)是标准C库的GNU实现。glibc是GNU工具链的关键组件,用于和二进制工具和编译器一起使用,为目标架构生成用户空间应用程序。
|
||||
|
||||
当从源码进行构建时,一些Linux程序可能需要链接到某个特定版本的glibc。在这种情况下,你可能想要检查已安装的glibc信息以查看是否满足依赖关系。
|
||||
|
||||
这里介绍几种简单的方法,方便你检查Linux上的glibc版本。
|
||||
|
||||
### 方法一 ###
|
||||
|
||||
下面给出了命令行下检查GNU C库的简单命令。
|
||||
|
||||
$ ldd --version
|
||||
|
||||
![](https://farm6.staticflickr.com/5613/15631104658_940163834a_z.jpg)
|
||||
|
||||
在本例中,**glibc**版本是**2.19**。
|
||||
|
||||
### 方法二 ###
|
||||
|
||||
另一个方法是在命令行“输入”**glibc 库的名称**(如,libc.so.6),就像命令一样执行。
|
||||
|
||||
输出结果会显示更多关于**glibc库**的详细信息,包括glibc的版本以及使用的GNU编译器,也提供了glibc扩展的信息。glibc变量的位置取决于Linux版本和处理器架构。
|
||||
|
||||
在基于Debian的64位系统上:
|
||||
|
||||
$ /lib/x86_64-linux-gnu/libc.so.6
|
||||
|
||||
在基于Debian的32位系统上:
|
||||
|
||||
$ /lib/i386-linux-gnu/libc.so.6
|
||||
|
||||
在基于Red Hat的64位系统上:
|
||||
|
||||
$ /lib64/libc.so.6
|
||||
|
||||
在基于Red Hat的32位系统上:
|
||||
|
||||
$ /lib/libc.so.6
|
||||
|
||||
下图中是输入glibc库后的输出结果样例。
|
||||
|
||||
![](https://farm8.staticflickr.com/7516/15631334667_ef50b247a4_z.jpg)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/check-glibc-version-linux.html
|
||||
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -1,6 +1,6 @@
|
||||
使用GDB命令行调试器调试C/C++程序
|
||||
============================================================
|
||||
没有调试器的情况下编写程序时最糟糕的状况是什么?编译时,跪着祈祷不要出错?用生命在运行可执行程序(blood offering不知道怎么翻译好...)?或者在每一行代码间添加printf("test")语句来定位错误点?如你所知,编写程序时不使用调试器的话是不利的。幸好,linux下调试还是很方便的。大多数人使用的IDE都集成了调试器,但linxu著名的调试器是命令行形式的C/C++调试器GDB。然而,与其他命令行工具一致,DGB需要一定的练习才能完全掌握。这里,我会告诉你GDB的基本情况及使用方法。
|
||||
没有调试器的情况下编写程序时最糟糕的状况是什么?编译时跪着祈祷不要出错?用血祭召唤恶魔帮你运行可执行程序?或者在每一行代码间添加printf("test")语句来定位错误点?如你所知,编写程序时不使用调试器的话是不方便的。幸好,linux下调试还是很方便的。大多数人使用的IDE都集成了调试器,但 linux 最著名的调试器是命令行形式的C/C++调试器GDB。然而,与其他命令行工具一致,DGB需要一定的练习才能完全掌握。这里,我会告诉你GDB的基本情况及使用方法。
|
||||
|
||||
###安装GDB###
|
||||
|
||||
@ -18,11 +18,11 @@ Fedora,CentOS 或 RHEL:
|
||||
|
||||
$sudo yum install gdb
|
||||
|
||||
如果在仓库中找不到的话,可以从官网中下载[official page][1]
|
||||
如果在仓库中找不到的话,可以从[官网中下载][1]。
|
||||
|
||||
###示例代码###
|
||||
|
||||
当学习GDB时,最好有一份代码,动手试验。下列代码是我编写的简单例子,它可以很好的体现GDB的特性。将它拷贝下来并且进行实验。这是最好的方法。
|
||||
当学习GDB时,最好有一份代码,动手试验。下列代码是我编写的简单例子,它可以很好的体现GDB的特性。将它拷贝下来并且进行实验——这是最好的方法。
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -48,21 +48,21 @@ Fedora,CentOS 或 RHEL:
|
||||
|
||||
$ gdb -tui [executable's name]
|
||||
|
||||
使用”-tui“选项可以将代码显示在一个窗口内(被称为”文本接口”),在这个窗口内可以使用光标来操控,同时在下面输入GDB shell命令。
|
||||
使用”-tui“选项可以将代码显示在一个漂亮的交互式窗口内(所以被称为“文本用户界面 TUI”),在这个窗口内可以使用光标来操控,同时在下面的GDB shell中输入命令。
|
||||
|
||||
![](https://farm3.staticflickr.com/2947/15397534362_ac0b5692c8_z.jpg)
|
||||
|
||||
现在我们可以在程序的任何地方设置断点。你可以通过下列命令来为当前源文件的某一行设置断点。
|
||||
|
||||
break [line number]
|
||||
break [行号]
|
||||
|
||||
或者为一个特定的函数设置断点:
|
||||
|
||||
break [function name]
|
||||
break [函数名]
|
||||
|
||||
甚至可以设置条件断点
|
||||
|
||||
break [line number] if [condition]
|
||||
break [行号] if [条件]
|
||||
|
||||
例如,在我们的示例代码中,可以设置如下:
|
||||
|
||||
@ -74,23 +74,25 @@ Fedora,CentOS 或 RHEL:
|
||||
|
||||
最后但也是很重要的是,我们可以设置一个“观察断点”,当这个被观察的变量发生变化时,程序会被停止。
|
||||
|
||||
watch [variable]
|
||||
watch [变量]
|
||||
|
||||
可以设置如下:
|
||||
这里我们可以设置如下:
|
||||
|
||||
watch d
|
||||
|
||||
当d的值发生变化时程序会停止运行(例如,当i>97为真时)。
|
||||
当设置后断点后,使用"run"命令开始运行程序,或按如下所示:
|
||||
|
||||
当设置断点后,使用"run"命令开始运行程序,或按如下所示:
|
||||
|
||||
r [程序的输入参数(如果有的话)]
|
||||
|
||||
gdb中,大多数的单词都可以简写为一个字母。
|
||||
gdb中,大多数的命令单词都可以简写为一个字母。
|
||||
|
||||
不出意外,程序会停留在11行。这里,我们可以做些有趣的事情。下列命令:
|
||||
|
||||
bt
|
||||
|
||||
回溯功能可以让我们知道程序如何到达这条语句的。
|
||||
回溯功能(backtrace)可以让我们知道程序如何到达这条语句的。
|
||||
|
||||
![](https://farm3.staticflickr.com/2943/15211202760_1e77a3bb2e_z.jpg)
|
||||
|
||||
@ -98,16 +100,15 @@ gdb中,大多数的单词都可以简写为一个字母。
|
||||
|
||||
这条语句会显示所有的局部变量以及它们的值(你可以看到,我没有为d设置初始值,所以它现在的值是任意值)。
|
||||
|
||||
当然
|
||||
当然:
|
||||
|
||||
![](https://farm4.staticflickr.com/3843/15374838916_8b65e4e3c7_z.jpg)
|
||||
|
||||
p [variable]
|
||||
p [变量]
|
||||
|
||||
这可以显示特定变量的值,但是还有更好的:
|
||||
|
||||
ptype [variable]
|
||||
这个命令可以显示特定变量的值,而更进一步:
|
||||
|
||||
ptype [变量]
|
||||
|
||||
可以显示变量的类型。所以这里可以确定d是double型。
|
||||
|
||||
@ -115,11 +116,11 @@ gdb中,大多数的单词都可以简写为一个字母。
|
||||
|
||||
既然已经到这一步了,我么不妨这么做:
|
||||
|
||||
set var [variable] = [new value]
|
||||
set var [变量] = [新的值]
|
||||
|
||||
这样会覆盖变量的值。不过需要注意,你不能创建一个新的变量或改变变量的类型。我们可以这样做:
|
||||
|
||||
set var a = 0
|
||||
set var a = 0
|
||||
|
||||
![](https://farm3.staticflickr.com/2949/15211357497_d28963a9eb_o.png)
|
||||
|
||||
@ -127,17 +128,17 @@ gdb中,大多数的单词都可以简写为一个字母。
|
||||
|
||||
step
|
||||
|
||||
使用如上命令,运行到下一条语句,也可以进入到一个函数里面。或者使用:
|
||||
使用如上命令,运行到下一条语句,有可能进入到一个函数里面。或者使用:
|
||||
|
||||
next
|
||||
|
||||
这可以直接下一条语句,并且不进入子函数内部。
|
||||
这可以直接运行下一条语句,而不进入子函数内部。
|
||||
|
||||
![](https://farm4.staticflickr.com/3927/15397863215_fb2f5912ac_o.jpg)
|
||||
|
||||
结束测试后,删除断点:
|
||||
|
||||
delete [line number]
|
||||
delete [行号]
|
||||
|
||||
从当前断点继续运行程序:
|
||||
|
||||
@ -147,7 +148,7 @@ gdb中,大多数的单词都可以简写为一个字母。
|
||||
|
||||
quit
|
||||
|
||||
总结,有了GDB,编译时不用祈祷上帝了,运行时不用血祭(?)了,再也不用printf(“test“)了。当然,这里所讲的并不完整,而且GDB的功能远不止这些。所以我强烈建议你自己更加深入的学习它。我现在感兴趣的是将GDB整合到Vim中。同时,这里有一个[备忘录][2]记录了GDB所有的命令行,以供查阅。
|
||||
总之,有了GDB,编译时不用祈祷上帝了,运行时不用血祭了,再也不用printf(“test“)了。当然,这里所讲的并不完整,而且GDB的功能远远不止于此。所以我强烈建议你自己更加深入的学习它。我现在感兴趣的是将GDB整合到Vim中。同时,这里有一个[备忘录][2]记录了GDB所有的命令行,以供查阅。
|
||||
|
||||
你对GDB有什么看法?你会将它与图形调试器对比吗,它有什么优势呢?对于将GDB集成到Vim有什么看法呢?将你的想法写到评论里。
|
||||
|
||||
@ -157,7 +158,7 @@ via: http://xmodulo.com/gdb-command-line-debugger.html
|
||||
|
||||
作者:[Adrien Brochard][a]
|
||||
译者:[SPccman](https://github.com/SPccman)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,80 @@
|
||||
Systemd这个有争议的项目正在接管你身边的Linux发行版
|
||||
=========
|
||||
![](http://core4.staticworld.net/images/article/2014/10/linux-attack-100528169-gallery.jpg)
|
||||
|
||||
Systemd 是目前为止在Linux平台上最有争议的项目之一。它到底有多大的争议?它的争议大到systemd的开发者之一Lennart Poettering 声称有人使用[比特币][2]雇佣职业杀手要干掉他。但是还是有比较理智的做法的,有一个[抵制systemd网站][3]在技术角度上提出了抵制systemd的原因。
|
||||
|
||||
如此强烈的抵制也反映了systemd的成功。它已经被或将要被Fedroa、OpenSUSE、Ubuntu、Debian、Arch Linux等众多发行版采用。随着时间推移,GNOME越来越依赖它,Debian[回归GNOME][4]的原因之一就是它采用了systemd。systemd无处不在!
|
||||
|
||||
那么如此激烈的争论到底是关于什么呢?让我们近距离观察这场战争。
|
||||
|
||||
###Systemd是一个全新的init
|
||||
|
||||
[Systemd][5]的核心是取代老旧的[SysV init][6]。init用来初始化你的操作系统,当你启动系统时,init负责加载需要的驱动,激活你的网络链接,启动众多的系统服务,最后进入图形登陆界面。而SysV init 是一个老旧的系统,它基本上仅运行**/etc/init.d**目录下的一些脚本。
|
||||
|
||||
Systemd是一个现代技术,用以取代老旧以及粗糙的SysV init。它可以在接收到事件响应时启动相关服务;比如,当你接入了一个USB打印机,systemd可以在接收到设备接入响应时启动打印服务。当它接收到某个网络端口的连接请求时,它可以启动在此端口上监听的服务并且传递这个连接。
|
||||
|
||||
获取更多关于SysV init 与 systemd的信息,可以参考Jorgen Schäfer的 “[Why systemd?][9]”
|
||||
|
||||
###但是systemd远不止此###
|
||||
|
||||
systemd的反对者之中也有部分人认为SysV太老了,应该被取代掉。但是批评systemd的人发现Systemd是一个巨大的项目,其中包括了很多其他的功能。它是一个软件套件,而不仅仅是一个init。
|
||||
|
||||
![An illustration of systemd's structure.](https://cms-images.idgesg.net/images/article/2014/10/systemd-diagram-100528171-orig.png)
|
||||
|
||||
*[维基共享资源][10] systemd 结构图解*
|
||||
|
||||
Systemd包括用于管理用户登陆的守护进程logind,还包括journald,并且journald 颇有争议的使用了二进制形式保存系统日志而不是以文本形式。systemd也采用了[udev][11]的思想及代码,它对**/dev/**目录下的虚拟设备文件进行管理,并且处理设备接入或推出时所产生的事件。除了这些还有很多其他的,如:systemd还包括了[cron][12]风格的任务调度器与网络守护进程networkd等等。
|
||||
|
||||
###抨击者认为systemd不是类UNIX风格
|
||||
|
||||
多数的抱怨源于人们认为systemd项目太大以至于超出了它的工作范围,并且它从Linux系统接管的部分太多了。不要感到惊奇,systemd的抵制活动是以下面的抱怨开始的:
|
||||
|
||||
>"systemd文件是一大堆的复杂的高度耦合的二进制组成的,这违反了UNIX哲学:‘做一件事情,并把它做好’。它超出了一个init程序的职责范围,因为它还有电源管理,设备管理,挂载管理,cron(定时执行工具),磁盘加密,socket接口/inetd,syslog,网络配置,登陆/会话管理,文件预读,GPT分区发现,容器注册,hostname/locale/time管理,mDNS/DNS-SD等功能,它将Linux控制台以及其他的一些功能都包装在一个程序里面。
|
||||
|
||||
##那么,systemd是好是坏?
|
||||
|
||||
到这里,我判断一下,到底谁是正确的。
|
||||
|
||||
![](https://cms-images.idgesg.net/images/article/2013/09/linux-penguin-100055693-medium.png)
|
||||
|
||||
systemd最初的想法是非常好的。Linux需要一个新的东西来替换老的 SysV init 和沉重的 SysV init 脚本,这个新的程序应该是灵活的,现代化的系统守护进程,它可以响应更多类型,并且智能化的管理众多的守护进程。然而,事实上systemd好像成为了**一个仅依赖Linux核心的完全统一的系统层**。
|
||||
|
||||
*但是*,尽管Linux是一个社区开发项目,但它不是为PC世界的专栏作家或者是一群网络评论者提供的,这些人都不能决定它的进化与发展。只有那些亲手贡献代码以及全身心投入的人才有这个资格。巧的是,Linux发行版以及那些参与者好像大部分都倾向与systemd。
|
||||
|
||||
>'我对于systemd本身并没有很强烈的个人看法。我与核心开发人员争论过它的bug与兼容性,并且我认为它的一些设计是愚蠢的(比如二进制的日志),但这只是细节,不是大问题。
|
||||
|
||||
如果 Linux Torvald 对于systemd的设计没有什么反对意见,那么说明它可能还是不错的。如果你想平静的看下为什么Linux发行版要使用systemd的话,我推荐这篇文章,[Debian's systemd discussion document][13]。
|
||||
|
||||
你是如何看systemd的,可以在评论回复!但是请文明讨论。
|
||||
|
||||
*更新这篇文章以澄清之前的错误的消息,ubuntu 桌面版将在下一个版本中纳入systemd。之前我们错误的认为ubuntu已经使用了systemd*。
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.pcworld.com/article/2841873/meet-systemd-the-controversial-project-taking-over-a-linux-distro-near-you.html
|
||||
|
||||
作者:[Chris Hoffman][a]
|
||||
译者:[SPccman](https://github.com/SPccman)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.pcworld.com/article/2841873/meet-systemd-the-controversial-project-taking-over-a-linux-distro-near-you.html#chrishoffman
|
||||
[1]:https://plus.google.com/app/basic/stream/z13rdjryqyn1xlt3522sxpugoz3gujbhh04
|
||||
[2]:http://www.pcworld.com/article/2033715/7-things-you-need-to-know-about-bitcoin.html
|
||||
[3]:http://boycottsystemd.org/
|
||||
[4]:http://www.pcworld.com/article/2691192/how-gnome-3-14-is-winning-back-disillusioned-linux-users.html
|
||||
[5]:http://www.freedesktop.org/wiki/Software/systemd/
|
||||
[6]:http://en.wikipedia.org/wiki/Init#SysV-style
|
||||
[7]:http://www.pcworld.com/column/world-beyond-windows/
|
||||
[8]:http://www.pcworld.com/blog/world-beyond-windows/index.rss
|
||||
[9]:http://blog.jorgenschaefer.de/2014/07/why-systemd.html
|
||||
[10]:http://en.wikipedia.org/wiki/File:Systemd_components.svg
|
||||
[11]:http://en.wikipedia.org/wiki/Udev
|
||||
[12]:http://en.wikipedia.org/wiki/Cron
|
||||
[13]:http://www.markshuttleworth.com/archives/1295
|
||||
[14]:http://www.pcworld.com/article/2836984/why-ubuntu-1410-utopic-unicorns-humble-changes-are-the-calm-before-the-storm.html
|
||||
[15]:http://www.maximumpc.com/article/news/linus_torvalds_tosses_f-bombs_middle_fingers_and_general_disdain_nvidia
|
||||
[16]:http://www.zdnet.com/linus-torvalds-and-others-on-linuxs-systemd-7000033847/
|
||||
[17]:https://wiki.debian.org/Debate/initsystem/systemd
|
@ -1,32 +1,32 @@
|
||||
安卓编年史
|
||||
安卓编年史(4)
|
||||
================================================================================
|
||||
![安卓0.9显示着横屏的主屏幕——后续一些版本无法实现的一个特性。](http://cdn.arstechnica.net/wp-content/uploads/2013/12/horizontal.png)
|
||||
安卓0.9显示着横屏的主屏幕——后续一些版本无法实现的一个特性。
|
||||
Ron Amadeo供图
|
||||
|
||||
尽管从功能上很难将模拟器和操作系统区分开,但安卓0.9是第一个支持横屏显示的版本。更让人惊讶的是,几乎所有东西都支持横屏模式,在某些方面安卓0.9甚至做的比KitKat更好。在Kiakat中,主屏幕和拨号被锁定为竖向并且无法旋转。但在安卓0.9这里,对任何一个应用横向显示都不是问题。(有谁知道怎么把Nexus 5从Kitkat升级到安卓0.9吗?)
|
||||
*安卓0.9显示着横屏的主屏幕——后续一些版本无法实现的一个特性* [Ron Amadeo供图]
|
||||
|
||||
尽管从功能上很难将模拟器和操作系统区分开,但安卓0.9是第一个支持横屏显示的版本。更让人惊讶的是,几乎所有东西都支持横屏模式,在某些方面安卓0.9甚至做的比KitKat更好。在Kiakat中,主屏幕和拨号被锁定为竖向并且无法旋转。但在安卓0.9这里,对任何一个应用横向显示都不是问题。(有谁知道怎么把Nexus 5从Kitkat升(降)级到安卓0.9吗?)
|
||||
|
||||
截图同样显示了安卓0.9中的新的音量显示设计。它抛弃了在Milestone 3中初次登场的旧铃铛式控制界面。那是一个巨大的,充满屏幕的界面。实际上,安卓4.0的重新设计中让它变得更小了,但它仍然是个问题。(你想增加音量却因此没法看到视频了这种情况特别烦人。)
|
||||
|
||||
![新通知面板,抛弃了应用快捷方式并添加了顶部部分。](http://cdn.arstechnica.net/wp-content/uploads/2013/12/n09c2.png)
|
||||
新通知面板,抛弃了应用快捷方式并添加了顶部部分。
|
||||
Ron Amadeo供图
|
||||
|
||||
*新通知面板,抛弃了应用快捷方式并添加了顶部部分* [Ron Amadeo供图]
|
||||
|
||||
几乎每个安卓版本中的通知面板都有一定的调整,安卓0.9也不例外。电池电量图标进行了重绘,变成了黑底绿色图标,其它的状态栏图标变为黑色,白色以及灰色。状态栏左侧部分明智地选择在通知面板打开的时候显示日期。
|
||||
|
||||
通知面板加入了一个新的顶部部分,它能够显示运营商名称(在模拟器里显示“安卓”),以及一个巨大的写着“清除通知”的按钮,它能够让你不用打开应用而彻底清除通知。应用程序图标被取消了,替换为通知到达的时间,“最新事件”文字被更换为简单的“通知”。面板的空白部分现在是灰色的而不是之前的白色,底部的滑动条也进行了重新设计。上面两张图片的底部看起来并没有对齐,但这是因为Milestone 5的通知面板在面板底部有一圈空白。安卓0.9的通知面板是完全直达底部边缘的。
|
||||
|
||||
![安卓0.9和0.5的浏览器,展现出新的无色彩菜单。](http://cdn.arstechnica.net/wp-content/uploads/2013/12/browser4c2.png)
|
||||
安卓0.9和0.5的浏览器,展现出新的无色彩菜单。
|
||||
Ron Amadeo供图
|
||||
|
||||
*安卓0.9和0.5的浏览器,展现出新的无色彩菜单* [Ron Amadeo供图]
|
||||
|
||||
浏览器主页现在是加载一个真正的网站,而不是像Milestone 5中那样的本地存储的假Google页面。Webkit的版本升至525.10,但是看起来它似乎没法正确渲染更现代的Google.com搜索按钮。纵观安卓0.9,Milestone 5中的菜单设计已经被抛弃,取而代之的是重新设计的灰色图标。这些截图的区别十分的明显,因为所有的颜色都被去除了。
|
||||
|
||||
“更趋向于”列表式的菜单变得更高了一点,并且只是一个没有图标的列表而已。安卓0.9已经获得了其它搜索方式,这次是在浏览器菜单里。和主屏幕小部件,主屏幕菜单按钮,以及浏览器主页,它们共同组成了四个搜索框。谷歌从未隐藏它的主要业务是什么,就连在它的操作系统中也是这样。
|
||||
|
||||
![从左到右:安卓0.9的浏览器缩放控件,页面内搜索界面,浏览器窗口,以及设置。](http://cdn.arstechnica.net/wp-content/uploads/2013/12/b4.png)
|
||||
从左到右:安卓0.9的浏览器缩放控件,页面内搜索界面,浏览器窗口,以及设置。
|
||||
Ron Amadeo供图
|
||||
|
||||
*从左到右:安卓0.9的浏览器缩放控件,页面内搜索界面,浏览器窗口,以及设置* [Ron Amadeo供图]
|
||||
|
||||
安卓0.9带来了许多浏览器改进。谢天谢地缩放控件又能正常使用了,而且从疯狂的垂直控制变成了简单的加减按钮。谷歌做了个符合常识的决定,将缩放控制从屏幕中间移到了屏幕底部。在这些缩放控件中,安卓在一致性方面的努力显而易见。这些看起来是系统中唯一的圆形按钮。
|
||||
|
||||
@ -35,20 +35,20 @@ Ron Amadeo供图
|
||||
这个版本的系统没有设置界面,但是浏览器最终还是有了自己的设置界面。它会有个桌面式选项的弹窗,Javascript,隐私和cookie,保存的密码以及表单数据。甚至还有Google Gears整合(还记得Google Gears吗?)。
|
||||
|
||||
![拨号盘以及打开菜单的正在通话界面。](http://cdn.arstechnica.net/wp-content/uploads/2014/04/revisedcalls.jpg)
|
||||
拨号盘以及打开菜单的正在通话界面。
|
||||
Ron Amadeo供图
|
||||
|
||||
*拨号盘以及打开菜单的正在通话界面* [Ron Amadeo供图]
|
||||
|
||||
拨号和联系人在安卓0.9中实际上是同一个应用——两个图标只是打开不同的标签而已。将联系人像这样附到拨号盘表明了智能手机联系人的第一目的还是通话,不是短信,电子邮件,即时通讯或查找地址。最终谷歌还是会完全接受非传统的智能手机沟通,将联系人和拨号分为两个独立的应用程序。
|
||||
|
||||
Milestone 5中大多数拨号盘的缺陷在安卓0.9中得到了修复。“最小化”标签被一组正常的亮/暗标签替代。对话气泡式的退格键被替换为正常的退格图标并集成到了拨号数字显示界面。数字键变成了圆形,尽管这个系统的其它东西是圆角矩形的(至少这次文本是垂直对齐的)。谷歌还修复了Milestone 5中“一”键,“星”键和“井”键不平衡的问题。
|
||||
Milestone 5中大多数拨号盘的缺陷在安卓0.9中得到了修复。“最小化”标签被一组正常的亮/暗标签替代。对话气泡式的退格键被替换为正常的退格图标并集成到了拨号数字显示界面。数字键变成了圆形,尽管这个系统的其它东西是圆角矩形的(至少这次文本是垂直对齐的)。谷歌还修复了Milestone 5中“-”键,“*”键和“#”键不平衡的问题。
|
||||
|
||||
在安卓0.9中点击显示的号码会开始一个通话。这是十分重要的,因为这是摆脱安卓设备硬件实体“拨号”和“结束”键的一大步。另一方面,来电界面却走的是完全相反的道路,去除了在安卓0.5中显示于屏幕之上的“接听”和“拒绝”按键。谷歌会花上接下来几个版本的时间去摸索在特定的显示之下是否需要硬件实体拨号键。但是直到安卓2.0和摩托罗拉Droid面世,实体拨号按钮才最终变成了可选选项。
|
||||
|
||||
来电界面的所有选项隐藏在目录按钮之后。Milestone 5不支持距离传感器,所以它采取了简单粗暴的路线,在通话过程中禁用触摸屏。安卓0.9为G1开发,它有个距离传感器。最终谷歌没有在通话的时候禁用触摸传感器。
|
||||
|
||||
![安卓0.9和0.5中独立的联系人界面和联系人编缉界面。](http://cdn.arstechnica.net/wp-content/uploads/2013/12/CONTACTS.png)
|
||||
安卓0.9和0.5中独立的联系人界面和联系人编缉界面。
|
||||
Ron Amadeo供图
|
||||
|
||||
*安卓0.9和0.5中独立的联系人界面和联系人编缉界面* [Ron Amadeo供图]
|
||||
|
||||
Milestone 5的一些联系人信息有令人困惑的标签,像电子邮件只被打上“主要的”标签而不是“主电子邮箱”标签。安卓0.9用各部分的水平标题纠正了这个错误。而且现在左侧的每个联系人类型都有了手形图标(Action icons)。
|
||||
|
||||
@ -66,7 +66,7 @@ Milestone 5的一些联系人信息有令人困惑的标签,像电子邮件只
|
||||
|
||||
via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/4/
|
||||
|
||||
译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[alim0x](https://github.com/alim0x) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,8 +1,7 @@
|
||||
如何将Ubuntu14.04安全的升级到14.10
|
||||
如何将 Ubuntu14.04 安全的升级到14.10
|
||||
================================================================================
|
||||
本文将讨论如何将Ubuntu14.04升级到14.10的beta版。Ubuntu14.10的最终beta版已经发布了
|
||||
|
||||
如果想从Ubuntu14.04/13.10/13.04/12.10/12.04或者更老的版本升级到14.10,只要遵循下面给出的步骤。注意,你不能直接从13.10升级到14.10。你应该想将13.10升级到14.04在从14.04升级到14.10。下面是详细步骤。
|
||||
如果想从Ubuntu14.04/13.10/13.04/12.10/12.04或者更老的版本升级到14.10,只要遵循下面给出的步骤。注意,你不能直接从13.10升级到14.10。你应该先将13.10升级到14.04在从14.04升级到14.10。下面是详细步骤。
|
||||
|
||||
下面的步骤不仅能用于14.10,也兼容于一些像Lubuntu14.10,Kubuntu14.10和Xubuntu14.10等的Ubuntu衍生版本
|
||||
|
||||
@ -90,15 +89,15 @@
|
||||
|
||||
sudo do-release-upgrade -d
|
||||
|
||||
直到屏幕提示你已完成
|
||||
直到屏幕提示你已完成。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.unixmen.com/upgrade-ubuntu-14-04-trusty-ubuntu-14-10-utopic/
|
||||
|
||||
作者:SK
|
||||
译者:[译者ID](https://github.com/johnhoow)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[johnhoow](https://github.com/johnhoow)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,94 +0,0 @@
|
||||
UbuTricks – Script to install the latest versions of several games and applications in Ubuntu
|
||||
================================================================================
|
||||
UbuTricks is a program that helps you install the latest versions of several games and applications in Ubuntu.
|
||||
|
||||
UbuTricks is a Zenity-based, graphical script with a simple interface. Although early in development, its aim is to create a simple, graphical way of installing updated applications in Ubuntu 14.04 and future releases.
|
||||
|
||||
Apps will be downloaded and installed automatically. Some will require a PPA to be added to the repositories. Others will be compiled from source if no PPA is available. The compilation process can take a long time, while installing from a PPA or DEB file should be quick, depending on your download speed.
|
||||
|
||||
### The install methods are as follows: ###
|
||||
|
||||
- PPA – the program will be downloaded and installed from a PPA
|
||||
- DEB – the program will be installed from a DEB package
|
||||
- Source – the program will be compiled (may take a long time)
|
||||
- Script – the program will be installed using a script provided by the developer
|
||||
- Archive – the program will be installed from a compressed archive
|
||||
- Repository – the program will be installed from a repository (not PPA)
|
||||
|
||||
### List of applications you can install ###
|
||||
|
||||
The latest versions of the following applications can be installed via UbuTricks:
|
||||
|
||||
### Games ###
|
||||
|
||||
- 0 A.D.
|
||||
- Battle for Wesnoth (Dev)
|
||||
- VCMI (Heroes III Engine)
|
||||
|
||||
### File Managers ###
|
||||
|
||||
- PCManFM
|
||||
|
||||
### Internet ###
|
||||
|
||||
- Geary
|
||||
- HexChat
|
||||
- QupZilla
|
||||
- QuiteRSS
|
||||
|
||||
### Multimedia ###
|
||||
|
||||
- SMPlayer
|
||||
- Transmageddon
|
||||
- Kdenlive
|
||||
- Fotoxx
|
||||
- jAlbum
|
||||
- GIMP
|
||||
- Shutter
|
||||
- Qmmp
|
||||
- XBMC
|
||||
|
||||
### Office/Ebooks/Documents ###
|
||||
|
||||
- Calibre
|
||||
- LibreOffice
|
||||
|
||||
### Tools ###
|
||||
|
||||
- Ubuntu Tweak
|
||||
|
||||
### Desktop Environments ###
|
||||
|
||||
- Cinnamon
|
||||
|
||||
### Other ###
|
||||
|
||||
- Google Earth
|
||||
- Wine
|
||||
|
||||
### Download and install Ubuntutricks script ###
|
||||
|
||||
You can download ubuntutricks script from [here][1] Once downloaded, make it executable and either double-click the script or run it from the terminal.
|
||||
|
||||
### Screenshots ###
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/10/116.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/10/213.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/10/35.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/10/45.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/ubutricks-script-to-install-the-latest-versions-of-several-games-and-applications-in-ubuntu.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
||||
[1]:http://www.tuxarena.com/intro/files/ubutricks.sh
|
@ -1,52 +0,0 @@
|
||||
6 Minesweeper Clones for Linux
|
||||
================================================================================
|
||||
### GNOME Mines ###
|
||||
|
||||
This is the GNOME Minesweeper clone, allowing you to choose from three different pre-defined table sizes (8×8, 16×16, 30×16) or a custom number of rows and columns. It can be ran in fullscreen mode, comes with highscores, elapsed time and hints. The game can be paused and resumed.
|
||||
|
||||
![](http://www.tuxarena.com/wp-content/uploads/2014/10/gnome-mines1.jpg)
|
||||
|
||||
### ace-minesweeper ###
|
||||
|
||||
This is part of a package that contains some other games too, like ace-freecel, ace-solitaire or ace-spider. It has a graphical interface featuring Tux, but doesn’t seem to come with different table sizes. The package is called ace-of-penguins in Ubuntu.
|
||||
|
||||
![](http://www.tuxarena.com/wp-content/uploads/2014/10/ace-minesweeper.jpg)
|
||||
|
||||
### XBomb ###
|
||||
|
||||
XBomb is a mines game for the X Window System with three different table sizes and tiles which can take different shapes: hexagonal, rectangular (traditional) or triangular. Unfortunately the current version in Ubuntu 14.04 crashes with a segmentation fault, so you may need to install another version to make it work.
|
||||
[Homepage][1]
|
||||
|
||||
![](http://www.tuxarena.com/wp-content/uploads/2014/10/xbomb.png)
|
||||
|
||||
([Image credit][1])
|
||||
|
||||
### KMines ###
|
||||
|
||||
KMines is the a KDE game, and just like GNOME Mines, there are three built-in table sizes (easy, medium, hard) and custom, support for themes and highscores.
|
||||
|
||||
![](http://www.tuxarena.com/wp-content/uploads/2014/10/kmines.jpg)
|
||||
|
||||
### freesweep ###
|
||||
|
||||
Freesweep is a Minesweeper clone for the terminal which allows you to configure settings such as table rows and columns, percentage of bombs, colors and also has a highscores table.
|
||||
|
||||
![](http://www.tuxarena.com/wp-content/uploads/2014/10/freesweep.jpg)
|
||||
|
||||
### xdemineur ###
|
||||
|
||||
Another graphical Minesweeper clone for X, Xdemineur is very much alike Ace-Minesweeper, with one predefined table size.
|
||||
|
||||
![](http://www.tuxarena.com/wp-content/uploads/2014/10/xdemineur.jpg)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tuxarena.com/2014/10/6-minesweeper-clones-for-linux/
|
||||
|
||||
作者:Craciun Dan
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.gedanken.org.uk/software/xbomb/
|
@ -1,47 +0,0 @@
|
||||
Qshutdown – An avanced shutdown tool
|
||||
================================================================================
|
||||
qshutdown is a Qt program to shutdown/reboot/suspend/hibernate the computer at a given time or after a certain number of minutes. It shows the time until the corresponding request is send to either the Gnome- or KDE-session-manager, to HAL or to DeviceKit and if none of these works the command ‘sudo shutdown -P now' is used. This program may be useful for people who want to work with the computer only for a certain time.
|
||||
|
||||
qshutdown will show it self 3 times as a warning if there are less than 70 seconds left. (if 1 Minute or local time +1 Minute was set it’ll appear only once.)
|
||||
|
||||
This program uses qdbus to send a shutdown/reboot/suspend/hibernate request to either the gnome- or kde-session-manager, to HAL or to DeviceKit and if none of these works, the command ’sudo shutdown’ will be used (note that when sending the request to HAL or DeviceKit, or the shutdown command is used, the Session will never be saved. If the shutdown command is used, the program will only be able to shutdown and reboot). So if nothing happens when the shutdown- or reboot-time is reached, it means that one lacks the rights for the shutdown command.
|
||||
|
||||
In this case one can do the following:
|
||||
|
||||
Post the following in a terminal: "EDITOR:nano sudo -E visudo" and add this line: "* ALL = NOPASSWD:/sbin/shutdown" whereas * replaces the username or %groupname.
|
||||
|
||||
Configurationfile qshutdown.conf
|
||||
|
||||
The maximum Number of countdown_minutes is 1440 (24 hours).The configurationfile (and logfile) is located at ~/.qshutdown
|
||||
|
||||
For admins:
|
||||
|
||||
With the option Lock_all in qshutdown.conf set to true the user won’t be able to change any settings. If you change the permissions of qshutdown.conf with "sudo chown root -R ~/.qshutdown" and "sudo chmod 744 ~/.qshutdown/qshutdown.conf", the user won’t be able to change anything in the configurationfile.
|
||||
|
||||
### Install Qshutdown in Ubuntu ###
|
||||
|
||||
Open the terminal and run the following command
|
||||
|
||||
sudo apt-get install qshutdown
|
||||
|
||||
### Screenshots ###
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/11/12.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/11/23.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/11/31.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/11/41.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/qshutdown-an-avanced-shutdown-tool.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
@ -0,0 +1,154 @@
|
||||
11 Useful Utilities To Supercharge Your Ubuntu Experience
|
||||
================================================================================
|
||||
**Whether you’re a relative novice or a seasoned pro, we all want to get the most from our operating system. Ubuntu, like most modern OSes, has more to offer than what is presented at first blush.**
|
||||
|
||||
From tweaking and refining the look, behaviour and performance of the Unity desktop to performing system maintenance, there are a huge array of useful utilities and apps that can help **tune Ubuntu to meet your needs in no time**.
|
||||
|
||||
Caveat time: Ubuntu has always shipped with ‘sane defaults’ — options that just work — out of the box. These defaults are well suited for the majority of people. They’re tested, accepted and recommended.
|
||||
|
||||
But one size doesn’t fit all. For the tinkerers and experimenters among us the default experience is a starting point from which to tailor.
|
||||
|
||||
So, without any more waffle, here is a set of 11 nifty utilities to help you supercharge your Ubuntu experience.
|
||||
|
||||
### Unity Tweak Tool ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/unity-tweak-tool.jpg)
|
||||
|
||||
I’ll kick off this list with the big one: **Unity Tweak** Tool. The kitchen sink of customisation, Unity Tweak Tool offers a comprehensive set of system tweaks tuned for Ubuntu and the Unity desktop.
|
||||
|
||||
It’s stuffed full of switches, toggles and control, letting you configure everything from the way Unity looks to the way it behaves. Use it to **quickly and easily change the GTK theme and icon set**, set up hot corners, adjust launcher size, add or remove workspaces, and — notably — enable Unity’s elusive ‘minimise on click’ feature.
|
||||
|
||||
Free and readily available from the Software Center, Unity Tweak Tool is one well worth keeping in your back pocket.
|
||||
|
||||
### Unity Privacy Indicator ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/indicator-privacy-in-ubuntu.jpg)
|
||||
|
||||
Privacy. A big, big issue and rightly so. But the topic is often shaded rather than binary; you may be happy to let some data or habits, say apps you frequently open, be logged locally, but not be ok with the searches you make in the Dash being ferried to a third-party server (however anonymous that data may be).
|
||||
|
||||
[Privacy Indicator][1] is a useful tool to help you stay abreast of what files, folders and services are being accessed, logged and recce’d on the Ubuntu desktop.
|
||||
|
||||
With a quick click on the ‘eye’ icon added to the desktop panel you can:
|
||||
|
||||
- Toggle Online Search Results, Zeitgeist, HUD Logging & GeoIP
|
||||
- Quick access to clean Zeitgeist, F2, Recent Files, etc.
|
||||
- Options to show/hide desktop icons and name in the panel
|
||||
|
||||
The latter two options may seem a little misplaced in this app but have less obvious privacy implications for those who take screenshots or screen share.
|
||||
|
||||
- [Download Indicator Privacy (.deb)][2]
|
||||
|
||||
### Unity Folders ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/09/unity-folders.jpg)
|
||||
|
||||
**Android, iOS, OS X, Chrome OS, and GNOME Shell have app folders, and so can Unity with a nifty third-party app. **
|
||||
|
||||
“Unity Folders” allows you to organise apps on the Unity Launcher into handy folders — think ‘games’, ‘office’, ‘social‘, etc. You get quick access to your favourite apps without needing to open the Dash, which may suit your workflow.
|
||||
|
||||
Each ‘folder’ is, actually, an application that opens up and positions itself near the origin point. But the overall effect is one that looks like an OS X style stack or an Android folder popover.
|
||||
|
||||
Folder icons can be customised or auto-generated based on the applications tucked up inside. Existing folders can be edited, rearranged, rename and re-other stuff, too.
|
||||
|
||||
- Create as many folders as you like
|
||||
- Choose custom or auto-generated folder icon
|
||||
- 3 folder layouts to choose from
|
||||
- Set custom icons for apps added to folders
|
||||
- Edit existing folders
|
||||
|
||||
- Unity Folders Website
|
||||
|
||||
### Caffeine ###
|
||||
|
||||
A staple for many of us, and not just in our drinks, Caffeine offers a fast, silent way to stop your screensaver or lock-screen kicking in. The degree of usefulness will depend on your circumstances (read: quirks of your system), and though it’s not quite as user friendly as it once was, it’s still worth [checking out][3].
|
||||
|
||||
### System Monitor Indicator ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/multiload-indicator-in-ubuntu.jpg)
|
||||
|
||||
If you’re a stat hound who likes to keep tabs on apps, processes and hardware status, Linux makes it easy. From Conky Configs to Terminal Commands — there’s no shortage of ways to monitor your CPU usage, network traffic or GPU temperature.
|
||||
|
||||
But by far my favourite is System **Monitor Indicator** – also known as indicator-multiload — available from the Ubuntu Software Center. It has a host of configuration options, too.
|
||||
|
||||
- [Click to Install ‘System Load Indicator’ on Ubuntu][4]
|
||||
|
||||
### Power Saving Tools for Linux Laptops ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2012/08/front.jpg)
|
||||
|
||||
**TLP**
|
||||
|
||||
Linux distributions don’t have the best reputation when it comes to power efficiency on portable devices.
|
||||
|
||||
If your own Linux laptop can barely get you from the sofa to the kitchen before needing a recharge, there are some tools you can try.
|
||||
|
||||
TLP is one of the most popular automated background tool promising to prolong battery life of laptops running Linux. It does this by adjusting the settings and behaviour of system processes and hardware, such as enabling Wi-Fi power saving mode, runtime power management of PCI bus devices, and processor frequency scaling.
|
||||
|
||||
It’s available to [install on Ubuntu 14.04 LTS and later using the dedicated TLP PPA][5] and comes with a ‘catch-all’ config to get you started. The more advanced users among you can dive in and manually adjust the settings to suit your own hardware, something that a [thorough guide on the TLP wiki][6] makes easy.
|
||||
|
||||
**Laptop Mode Tools**
|
||||
|
||||
If TLP sounds a little too complex — and there’s no shame if it does — there’s a simpler alternative: **Laptop Mode Tools**. This package is available to install from the Ubuntu Software Center and keeps the tweaks made to a set of sane defaults (Wi-Fi, Bluetooth, etc.).
|
||||
|
||||
Laptop Mode Tools cannot be installed at the same time as TLP.
|
||||
|
||||
- [Laptop Mode Tools in Ubuntu Software Center][7]
|
||||
|
||||
### Intel Graphics Installer ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/intelgraphicsdriverinstaller.png)
|
||||
|
||||
The Intel Graphics Installer tool is a must-have for those running Intel graphics hardware who want the best performance they can get. It makes finding and installing the latest Intel GPU drivers a painless, fuss-free affair — no PPAs or Terminal kung foo needed.
|
||||
|
||||
- [Download Intel Graphics Installer for Linux 0.7][8]
|
||||
|
||||
### Hardware Stats ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/02/Screen-Shot-2014-02-10-at-21.05.37.png)
|
||||
|
||||
If you plan on upgrading your PC or replacing a worn-out part you’ll need to get some specific hardware details, such as RAM type, CPU socket set or what PCI slots are available.
|
||||
|
||||
**I-Nex** makes unearthing this, and host of other detailed system stats, easy. Use it to find your motherboard model number, RAM stepping, S.M.A.R.T. status and…well, pretty much anything else you can think of!
|
||||
|
||||
- [Learn More About I-Nex on Launchpad][9]
|
||||
|
||||
### Disk Space Visualizer ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/disk-usage-visualizer-for-ubuntu.jpg)
|
||||
|
||||
In this age of 1TB hard drives we might not need to be as prudent with disk space as we once were. But for those of using a smallish SSD, running multiple partitions or working in a virtual machine with a fixed-size virtual disk, there’ll be times when freeing up a bit of extra space is required.
|
||||
|
||||
GNOME Disks, installed in Ubuntu by default, makes finding the biggest space-gobbling culprits easy. Ideal for locating hidden logs, caches, and media files.
|
||||
|
||||
### BleachBit (Cruft Cleaner) ###
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/bleachbit.jpg)
|
||||
|
||||
Windows users will be familiar with applications like CCleaner, which scan for and clean out junk files, empty folders, bloated caches, and obsolete packages. For a a similarly quick and effortless click n’ clean solution on Ubuntu try **BleachBit**.
|
||||
|
||||
It is a powerful tool, so do pay attention to what you’re cleaning. Don’t aimlessly check every box; not everything that it can clean needs to be. Play it smart; when in doubt, leave it out.
|
||||
|
||||
- [Install BleachBit from Ubuntu Software Center][10]
|
||||
|
||||
Got a favourite system utility of your own? Let others know about it in the comments.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/11/useful-tools-for-ubuntu-do-you-use-them
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://plus.google.com/117485690627814051450/?rel=author
|
||||
[1]:http://www.florian-diesch.de/software/indicator-privacy/index.html
|
||||
[2]:http://www.florian-diesch.de/software/indicator-privacy/dist/indicator-privacy_0.04-1_all.deb
|
||||
[3]:http://www.omgubuntu.co.uk/2014/05/stop-ubuntu-sleeping-caffeine
|
||||
[4]:apt://indicator-mulitload
|
||||
[5]:https://launchpad.net/~linrunner/+archive/ubuntu/tlp/+packages
|
||||
[6]:http://linrunner.de/en/tlp/docs/tlp-configuration.html
|
||||
[7]:https://apps.ubuntu.com/cat/applications/laptop-mode-tools/
|
||||
[8]:https://01.org/linuxgraphics/downloads/2014/intelr-graphics-installer-linux-1.0.7
|
||||
[9]:https://launchpad.net/i-nex
|
||||
[10]:https://apps.ubuntu.com/cat/applications/bleachbit/
|
@ -0,0 +1,196 @@
|
||||
Five Magnificent Linux Music Streaming Clients
|
||||
================================================================================
|
||||
Digital streams almost totally command my music listening these days. Over the years I have amassed a large collection of CDs at considerable expense; most of them now sit neglected gathering dust. Almost all music streaming services fall short of the audio quality of CDs, but their popularity has more to do with sheer convenience than high-fidelity sound reproduction. Music streaming has not only been to the detriment of CD sales; digital downloads have also experienced a slowing down of sales. This is only set to continue. Audiophiles may be tempted to embrace music streaming given that there are now services such as Tidal which offers high fidelity music streaming, 25 million tracks encoded with the FLAC format streamed at 1,411kbps.
|
||||
|
||||
CDs are not going away though. Music streaming services do experience issues with record labels and artists who are unhappy with the amount of return they receive from letting their music be hosted on the service. This is still in flux; we have seen this year Led Zeppelin, Pink Floyd, Metallica sign up to streaming services, but there are still some notable omissions such as the Beatles, Radiohead and AC/DC who refuse to allow fans to stream their music. Even where a record label or singer has given permission to allow streaming services to access their work, an artist's back catalog can be pulled at a moment's notice. This month, Taylor Swift’s entire catalog of music was pulled from Spotify's streaming service at the pop singer’s request. Some people will still prefer to "possess" their collection, but it's looking like an increasingly old fashioned way to enjoy music.
|
||||
|
||||
The Linux platform has matured into a good way of listening to streaming music services. There are clients available for most of the music streaming services; I hope TIDAL will support Linux on the desktop in due course, and not rely on a web player. All of the applications featured in this article are excellent. An honorable mention should be given to Amarok, pianobar, and Tomahawk.
|
||||
|
||||
![Spotify](http://www.linuxlinks.com/portal/content2/png/Spotify.png)
|
||||
|
||||
![Spotify in action](http://www.linuxlinks.com/portal/content/reviews/Audio/Screenshot-Spotify-Streaming.png)
|
||||
|
||||
Spotify is a proprietary peer-to-peer music streaming service that allows users to listen to tracks or albums on demand. The service describes itself as "A world of music. Instant, simple and free". Spotify uses 96kbps streaming on mobile, 160kbps on desktop and 320kbps for "Premium subscribers" - all encoded in the Ogg Vorbis format. Spotify is free for those who choose to live with adverts, or at a reasonable monthly charge without them.
|
||||
|
||||
Spotify is a fantastic service, offering access to a huge library of music covering all different types of music such as pop, alternative, classical, techno, and rock. It is a great way of dipping into new music. The service has the support of major labels including Sony BMG, EMI, Universal, and Warner Music, as well as independent labels and distribution networks like Labrador Records, The Orchard, Alligator Records, Merlin, CD Baby, INgrooves as well as classical music labels such as Chandos, Naxos, EMI Classic, Warner Classics, Denon Essentials and many more. The breadth of music is continuing to expand at a phenomenal pace.
|
||||
|
||||
Spotify does not officially support Linux at the moment. However, they have developed a preview build of Spotify for Linux, which works well. As its a preview release, this version is still unsupported.
|
||||
|
||||
Spotify is available in Andorra, Argentina, Australia, Austria, Belgium, Bulgaria, Colombia, Cyprus, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Iceland, Ireland, Italy, Latvia, Liechtenstein, Lithuania, Luxembourg, Malaysia, Malta, Mexico, Monaco, Netherlands, New Zealand, Norway, the Philippines, Poland, Portugal, Spain, Singapore, Sweden, Switzerland, Taiwan, Turkey, the United Kingdom, the United States, Uruguay, and a few others.
|
||||
|
||||
**Features include:**
|
||||
|
||||
- A well designed interface makes navigation effortless
|
||||
- Create and edit playlists
|
||||
- Discover new music
|
||||
- Share music and playlists
|
||||
- Radio feature
|
||||
- Top Lists
|
||||
- Additional functionality with large variety of apps
|
||||
|
||||
- Website: [www.spotify.com/uk/download/previews][1]
|
||||
- Developer: Spotify
|
||||
- License: Proprietary
|
||||
- Version Number: Preview
|
||||
|
||||
----------
|
||||
|
||||
![Pithos](http://www.linuxlinks.com/portal/content2/png/Pithos.png)
|
||||
|
||||
![Pithos in action](http://www.linuxlinks.com/portal/content/reviews/Audio/Screenshot-Pithos-streaming.png)
|
||||
|
||||
Pithos is an open source native Pandora Radio client for Linux. It offers a lightweight alternative to the official Pandora.com web client. The graphical user interface integrates with desktop features such as media keys, notifications, and the sound menu.
|
||||
|
||||
The Pandora music service is only intended to be used by US IP addresses. However, users located outside the US can use Pandora with a VPN.
|
||||
|
||||
**Features include: **
|
||||
|
||||
- Play / Pause / Next Song
|
||||
- Switching stations
|
||||
- Remembers your user name and password
|
||||
- Bookmarking of songs and artists
|
||||
- Cover Art
|
||||
- Thumbs Up / Thumbs Down / Tired of this song
|
||||
- Notification popup with song info
|
||||
- Launching pandora.com song info page and station page
|
||||
- Reconnecting when pandora session times out
|
||||
- Editing QuickMix
|
||||
- Creating stations
|
||||
- Media Key support
|
||||
- Proxy support
|
||||
- Last.fm scrobbling support
|
||||
- Volume control
|
||||
- Plugins including Screensaver pause
|
||||
- Two DBUS APIs: MPRIS and Pithos
|
||||
|
||||
- Website: [pithos.github.io][2]
|
||||
- Developer: Kevin Mehall
|
||||
- License: GNU GPL v3
|
||||
- Version Number: 1.0.0
|
||||
|
||||
----------
|
||||
|
||||
![Clementine](http://www.linuxlinks.com/portal/content2/png/Clementine.png)
|
||||
|
||||
![Clementine in action](http://www.linuxlinks.com/portal/content/reviews/Audio/Screenshot-Clementine-Streaming.png)
|
||||
|
||||
Clementine is a cross-platform, lightweight, modern music player and library organiser based on Amarok. Clementine focuses on a fast and easy-to-use interface for searching and playing your music.
|
||||
|
||||
It is inspired by Amarok 1.4, focusing on a fast and easy-to-use interface for searching and playing your music.
|
||||
|
||||
Features include:
|
||||
|
||||
- Search and play your local music library
|
||||
- Listen to internet radio from Last.fm and SomaFM
|
||||
- Tabbed playlists, import and export M3U, XSPF, PLS and ASX
|
||||
- Create smart playlists and dynamic playlists
|
||||
- Load M3U and XSPF playlists
|
||||
- Undo and redo in the playlist
|
||||
- Edit tags on MP3 and OGG files, organise your music
|
||||
- Download missing album cover art from Last.fm
|
||||
- Podcast support with integration with gpodder.net
|
||||
- Graphical equalizer
|
||||
- Cross-platform works on Windows, Mac OS X and Linux
|
||||
- Native desktop notifications on Linux (libnotify) and Mac OS X (Growl)
|
||||
- Fetch missing tags from MusicBrainz
|
||||
- Attractive on screen display
|
||||
- Queue manager
|
||||
- Supports MPRIS on Linux, or remote control using the command-line
|
||||
- Supports indexing and playing music from Google Drive
|
||||
- Support for Soundcloud
|
||||
- Support for jazzradio.com
|
||||
- Support for Moodbar
|
||||
- Visualizations from projectM
|
||||
- Copy music to your iPod, iPhone, MTP or mass-storage USB player
|
||||
- Remote control
|
||||
- Transcode music into MP3, Ogg Vorbis, Ogg Speex, FLAC or AAC
|
||||
|
||||
- Website: [www.clementine-player.org][3]
|
||||
- Developer: David Sansome, John Maguire
|
||||
- License: GNU GPL v3
|
||||
- Version Number: 1.2
|
||||
|
||||
----------
|
||||
|
||||
![Nuvola Player](http://www.linuxlinks.com/portal/content2/png/NuvolaPlayer.png)
|
||||
|
||||
![Nuvola Player in action](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-NuvolaPlayer-Streaming.png)
|
||||
|
||||
Nuvola Player is a free and open source project that offers cloud music integration for your desktop (system tray, Ubuntu sound menu, dock menu and notifications).
|
||||
|
||||
To use all of the streaming services, you need Flash and HTML5 audio support. Some web-based streaming services can utilize HTML5 Audio technology for music playback instead of the Flash plugin. Nuvola Player requires GStreamer with MP3 decoder plugin to provide HTML5 Audio support.
|
||||
|
||||
**Supported Services:**
|
||||
|
||||
- Amazon Cloud Player integrated with the MP3 store and allows users to store their music on Amazon Cloud Drive, and play that music from any supported web browsers
|
||||
- Bandcamp an online music store, as well as a platform for artist promotion, that caters mainly to independent artists
|
||||
- Deezer a French web-based music streaming service. It allows users to listen to music on various devices online or offline. It currently has 18 million licensed tracks, over 30,000 radio channels and 22 million users (1.5 million subscribers)
|
||||
- 8tracks a website that fuses elements of internet radio and social networking revolving around the concept of streaming user-curated playlists consisting of at least 8 tracks
|
||||
- Google Play Music a digital content service from Google which includes an online store for music, movies, books, and Android apps and games, as well as a cloud media player that supports uploading a user's own music and buying music at Google Play Store
|
||||
- Grooveshark an international online music search engine, music streaming service and music recommendation web software application, allowing users to search for, stream, and upload music that can be played immediately or added to a playlist
|
||||
- Grooveshark Mobile the HTML5-based mobile version of Grooveshark which does not require Flash
|
||||
- Hype Machine an amalgamation of Pandora Radio and Pitchfork Media. It aggregates the most recently posted songs from a selection of music blogs (about 1,500) and lists them on the website's main page
|
||||
- Jango a free online music streaming service that allows users to create and share custom radio stations
|
||||
- Logitech Media Server the open source media server for Logitech Squeezebox devices. It supports plug-ins and multiple only services like Deezer or Spotify
|
||||
- Pandora an automated music recommendation service and "custodian" of the Music Genome Project available only in the United States
|
||||
- Rdio an ad-free music subscription service
|
||||
- Spotify a commercial music streaming service providing digital rights management-restricted content from record labels
|
||||
- This is My Jam a place to put your favorite song of the moment & hear great music, handpicked every day by friends
|
||||
|
||||
**Features include:**
|
||||
|
||||
- Multimedia keys
|
||||
- Shows desktop notifications
|
||||
- Integrates with various sound menus, applets and launchers and more
|
||||
- Last FM and Libre FM scrobbling
|
||||
- Lyrics fetching
|
||||
- Support for Amazon Music Prime streaming
|
||||
|
||||
- Website: [tiliado.eu/nuvolaplayer][4]
|
||||
- Developer: Jiří Janoušek and service maintainers
|
||||
- License: 2-Clause BSD license
|
||||
- Version Number: 2.4.3
|
||||
|
||||
----------
|
||||
|
||||
![Atraci](http://www.linuxlinks.com/portal/content2/png/Atraci-2.png)
|
||||
|
||||
![Atraci in action](http://www.linuxlinks.com/portal/content/reviews/Utilities/Screenshot-Atraci.png)
|
||||
|
||||
Atraci is a multi-platform open source streaming application that lets users listen to more than 60 million songs. It is still in an early stage of development, so the application is not the most feature laden.
|
||||
|
||||
Atraci use iTunes, Last.fm and SoundCloud to display song information - cover, title, artist. Atraci searches the best match for this song on YouTube and streams the highest quality video stream.
|
||||
|
||||
**Features include: **
|
||||
|
||||
- No advertisements, no sign up required
|
||||
- Intuitive user interface
|
||||
- Smart matching search for any song, artist name or album. Atraci checks it against online listings to show correct title, album artwork, track lists and so on, with listed options being the highest quality video streams
|
||||
- Album and artist autosuggestions
|
||||
- Sort results by 'default', 'artist' or ‘track’
|
||||
- View results in 'grid' or 'list' layouts
|
||||
- Accompanying video can be made full screen
|
||||
- Create playlists with shuffle and repeat options
|
||||
- In-app volume slider, track scrubber and album artwork
|
||||
- History of recently played tracks
|
||||
|
||||
- Website: [atraci.github.io/Atraci-website][5]
|
||||
- Developer: The Atraci Team
|
||||
- License: The MIT License
|
||||
- Version Number: 0.7.0
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxlinks.com/article/20141116052055674/MusicStreaming.html
|
||||
|
||||
作者:Frazer Kline
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:https://www.spotify.com/uk/download/previews/
|
||||
[2]:http://pithos.github.io/
|
||||
[3]:https://www.clementine-player.org/
|
||||
[4]:https://tiliado.eu/nuvolaplayer/
|
||||
[5]:http://atraci.github.io/Atraci-website/
|
@ -1,66 +0,0 @@
|
||||
[translating by KayGuoWhu]
|
||||
When hackers grow old
|
||||
================================================================================
|
||||
Lately I’ve been wrestling with various members of an ancient and venerable open-source development group which I am not going to name, though people who regularly follow my adventures will probably guess which one it is by the time I’m done venting.
|
||||
|
||||
Why it so freaking hard to drag some people into the 21st century? Sigh…
|
||||
|
||||
I’m almost 56, an age at which a lot of younger people expect me to issue semi-regular salvos of get-off-my-lawn ranting at them. But no – I find, that, especially in technical contexts, I am far more likely to become impatient with my age peers.
|
||||
|
||||
A lot of them really have become grouchy, hidebound old farts. And, alas, it not infrequently falls to me to be the person who barges in and points out that practices well-adapted for 1995 (or, in the particular case I’m thinking of, 1985) are … not good things to hold on to decades later.
|
||||
|
||||
Why me? Because the kids have little or no cred with a lot of my age peers. If anyone’s going to get them to change, it has to be someone who is their peer in their own perception. Even so, I spend a lot more time than seems just or right fighting inertia.
|
||||
|
||||
Young people can be forgiven for lacking a clue. They’re young. Young means little experience, which often leads to unsound judgment. It’s more difficult for me to forgive people who have been around the track often enough that they should have a clue, but are so attached to The Way It’s Always Been Done that they can’t see what is in front of their freaking noses.
|
||||
|
||||
(News flash: I really don’t have a conservative temperament. I find it wryly amusing how often both conservatives and non-conservatives who argue politics with me fail to notice this.)
|
||||
|
||||
OK, now let’s talk about GNU ChangeLog files. They were a fine idea, a necessary one even, in 1985. The idea was to use a single ChangeLog entry to document a group of related changes to multiple files. This was a reasonable adaptation to absent or extremely primitive version control. I know this because I was there.
|
||||
|
||||
Even in 1995, or as late as the early 2000s, many version control systems didn’t have changesets. That is, there was no or only weak support for grouping multiple file modifications into a single retrievable object with a comment attached to the object rather than to individual file modifications. CVS, the system in widest use then, only faked changesets – and did it so badly that many people felt they couldn’t rely on that feature. ChangeLog files still made some functional sense.
|
||||
|
||||
But then Subversion – with real changesets – achieved wide acceptance through its beta releases around 2003 and its 1.0 in 2004. It should have been obvious then, even before the new wave of DVCSes that began a year later, that there was a culture clash a comin’. Because if your project both has a DVCS and uses the ChangeLog convention, they’re fighting for control of the same metadata.
|
||||
|
||||
There are different ways you can adapt. One is to continue to treat the ChangeLogs as the authoritative record of the evolution of the code. In that case, you tend to get stubby or pro-forma commit comments.
|
||||
|
||||
Another is to treat the commit comment log as authoritative. If you do that, you soon begin to wonder why you’re still writing ChangeLog entries at all. The commit metadata has better coherence with the code changes, after all – that’s what it’s designed for.
|
||||
|
||||
(Now imagine a project in which, with the best of intentions, different people are making opposite choices out of these two. Now you have to read both the ChangeLogs and the commit logs to know what’s going on. Friction costs are rising…)
|
||||
|
||||
A third is to try to have it both ways – duplicating commit comment data in a slightly different format in a ChangeLog entry that’s part of the commit. This has all the problems you’d expect with a representation in which there is no single point of truth; one copy gets garbled, or the ChangeLog entry gets modified so that it’s no longer in sync with the allegedly matching commit data, and life gets very confusing for anyone who comes along later and tries to figure out what people were thinking.
|
||||
|
||||
Or, as a senior dev on a Certain Project I Won’t Name just did in email, declaring that commits can include multiple ChangeLog entries and the commit metadata is irrelevant to the Changelogs. Which we still have to write.
|
||||
|
||||
My eyes crossed and my gorge rose when I read that. What kind of fool fails to realize that this is begging for trouble – that, actually, the whole edifice of custom around ChangeLog files is just dead weight and friction drag in a DVCS world with good browsing tools for reliable commit logs?
|
||||
|
||||
Alas, it’s a very particular kind of fool: a hacker who has grown old and rigid. All the rationalizations he will ever utter fail to hide this. He’s attached to tactics that made sense a decade ago but have become counterproductive ceremonies now. If you tried to explain not just about git summary lines but that the correct adaptation for current toolsets is to scrap ChangeLogs entirely … well, that would be insupportable, inconceivable, and just crazy talk.
|
||||
|
||||
Functionally this infuriates me. It is substantially harder to work on that project because of this and related nonsense. And, as badly as it happens to need young developers, that’s a real problem. It has a G+ community well into 4 digits, they’re mostly kids, and they’re not stepping up. Evidently the message has been received on the outside; the devs on this project are ancient mossbacks with inexplicable tribal fixations, and best admired from a good long distance.
|
||||
|
||||
What gives this extra emotional edge for me is that whenever I have to butt heads with a mossback, I keep wondering: will I be like this someday? Worse, am I looking in a mirror, already rigidified and not knowing it? I mean, I get the impression from his web presence that this particular specimen is younger than me. By a good fifteen years.
|
||||
|
||||
I feel mentally agile. I don’t get frustrated by people moving faster than I can handle, I get frustrated by people who can’t keep up with me, who can’t see the obvious. But this self-belief could be just a bad case of Dunning-Krueger effect biting me where I least understand it. Very few things terrify me; this possibility is high on the short list.
|
||||
|
||||
A separately disconcerting thing is that as I get older this sort of collision is happening more often rather than less. Somehow I expected my hacker peers to age more gracefully, to retain their neotenous flexibility even if they were physically aging. Some do indeed seem to be going that way; too many, alas, are not. It is a sadness.
|
||||
|
||||
I’m not sure I have a good finish for this. If I’ve escaped mentally rigidifying (and that’s an if) I think I know at least in part why, but I’m very unsure whether it can be generally replicated – you might need to have a wired-in brain chemistry that matches the strategy. Nevertheless, for whatever it’s worth, here is my advice to young hackers and indeed the young of all kinds.
|
||||
|
||||
You – yes, even you – cannot count on retaining your mental flexibility into middle and old unless you work at it. You have to practice busting out of comfortable mental grooves and regularly checking your assumptions when you’re young, and you have to develop a habit of it that sustains into old age.
|
||||
|
||||
It’s said that the best time for a middle-aged person to start (physically) exercising is thirty years ago. I think the same goes for the habits that might (might!) keep you mentally agile at 56, or 65. Push your envelope. Develop the regular practice of challenging yourself and exiting your comfort zone now so you’ll have it established when you really need it.
|
||||
|
||||
You have to be realistic about this; there’s an optimal-challenge level where you choose an attainable goal and work mentally hard for it. This month I’m going to learn go. Not the game, I already play that (though not very well); the programming language. Not because I really need to for a specific project, but because it’s time to stretch myself.
|
||||
|
||||
Develop that habit. And never let it go.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://esr.ibiblio.org/?p=6485
|
||||
|
||||
作者:[Eric Raymond][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://esr.ibiblio.org/?author=2
|
@ -1,91 +0,0 @@
|
||||
spccman translating
|
||||
Meet systemd, the controversial project taking over a Linux distro near you
|
||||
================================================================================
|
||||
![](http://core4.staticworld.net/images/article/2014/10/linux-attack-100528169-gallery.jpg)
|
||||
|
||||
Systemd is one of the most controversial projects in Linux-land right now. How controversial? So controversial that Lennart Poettering, one of systemd’s developers, even [claims][1] that horrible people have been pooling [Bitcoins][2] to hire a hitman on him. On a more reasonable level, there’s a [Boycott systemd website][3] that argues for a boycott of this software on various technical merits.
|
||||
|
||||
All this backlash is a reaction to systemd’s success. It has been—or is being—adopted by Linux distributions from Fedora and OpenSuSE to Ubuntu, Debian, and even Arch Linux. GNOME is becoming more dependent on it over time—one of Debian’s stated reasons for [switching back to GNOME][4] was because of its systemd integration. It’s everywhere.
|
||||
|
||||
So what’s all the hub-bub—and the fierce backlash—about? Let’s look a bit closer at this raging battle.
|
||||
|
||||
### Systemd is a new init system ###
|
||||
|
||||
At its core, [systemd][5] is a replacement for the old [SysV init][6] system. The init system is the software that initializes your system. When you boot up, init is responsible for loading the appropriate drivers, activating your network connection, launching various system services, and finally bringing up the graphical login screen where you log in. SysV init is an old system that basically just runs scripts located under **/etc/init.d**.
|
||||
|
||||
> Want to stay up to date on Linux, BSD, Chrome OS, and the rest of the World Beyond Windows? Bookmark the [World Beyond Windows column page][7] or follow [our RSS feed][8].
|
||||
|
||||
At its core, systemd is a modern replacement for the old and crufty SysV init. It can also launch services in response to events; for example, when you plug in a USB printer, it could launch the printing service in response to the device being plugged in. When it receives a connection on a specific network port, it could launch a network service configured to listen on that port and pass the connection along.
|
||||
|
||||
For more technical information about SysV init vs. systemd, read Jorgen Schäfer’s “[Why systemd?][9]”
|
||||
|
||||
### But systemd is more than that ###
|
||||
|
||||
Even systemd’s detractors largely agree that SysV is old and needs to be replaced. But critics correctly note that systemd is in fact more than that. It’s a large project containing many other bits of functionality. It’s a software suite, not just an init system.
|
||||
|
||||
![An illustration of systemd's structure.](https://cms-images.idgesg.net/images/article/2014/10/systemd-diagram-100528171-orig.png)
|
||||
|
||||
[Wikimedia Commons][10]
|
||||
|
||||
An illustration of systemd's structure.
|
||||
|
||||
The systemd project also contains logind, a daemon that manages user logins, and journald, an event-logging system that controversially writes to binary files and not text ones. Systemd has also absorbed [the udev project][11] and its code, which handles the management of virtual device files in the **/dev/** directory and events when devices are plugged in and unplugged. The list goes on and on: systemd also includes a [cron][12]-style task scheduler and networkd, a daemon for managing network connections.
|
||||
|
||||
More recently, systemd is gaining consoled, a user-mode console daemon that can be used when Linux’s virtual terminal code is stripped out of the kernel itself. The kernel developers seem happy to get this stuff out of the kernel and into user-space , but some people have to be thinking: Does systemd really have to take over this as well?
|
||||
|
||||
### Critics say it’s not Unix-like ###
|
||||
|
||||
Many of the complaints to systemd stem from a feeling that this huge project is increasing in scope and taking over too much of the Linux system. Not surprisingly, the Boycott systemd site starts with this exact complaint:
|
||||
|
||||
> “Systemd flies in the face of the Unix philosophy: ‘do one thing and do it well,’ representing a complex collection of dozens of tightly coupled binaries. Its responsibilities grossly exceed that of an init system, as it goes on to handle power management, device management, mount points, cron, disk encryption, socket API/inetd, syslog, network configuration, login/session management, readahead, GPT partition discovery, container registration, hostname/locale/time management, mDNS/DNS-SD, the Linux console and other things all wrapped into one.”
|
||||
|
||||
Ubuntu’s Mark Shuttleworth originally [called systemd][13] “hugely invasive and hardly justified” when Ubuntu was sticking with their own “upstart” init system. Ubuntu eventually gave up that fight and is switching to systemd. The change will show up [in the Ubuntu Desktop Next images][14] starting in the 15.04 update cycle.
|
||||
|
||||
### So, systemd: good or bad? ###
|
||||
|
||||
Oh boy, here we go. This is the part of the article where I have to wrap everything up with a nice bow and make a pronouncement about which side is right.
|
||||
|
||||
![](https://cms-images.idgesg.net/images/article/2013/09/linux-penguin-100055693-medium.png)
|
||||
|
||||
The original idea of systemd is definitely good. Linux needs a replacement for the old SysV init system and clunky SysV init scripts, and a sleek, modern system daemon that can respond to more types events and manage daemons more intelligently is a great idea. However, it’s true that systemd seems to be growing into a monolithic system layer that lives just above the Linux kernel.
|
||||
|
||||
*But*, although Linux is a community-developed project, it’s not for the peanut gallery—whether it’s a PCWorld columnist or a gaggle of Internet commenters—to decide how it evolves. It’s for the people actually getting their hands dirty with the code and involving themselves in these projects. And, interestingly enough, Linux distributions and the people involved in them seem mostly to be moving toward systemd integration.
|
||||
|
||||
Even Linux creator Linus Torvalds (who [isn’t afraid to say what he thinks][15]) doesn’t seem to mind systemd. As he told [ZDNet][16]:
|
||||
|
||||
> "I don't actually have any particularly strong opinions on systemd itself. I've had issues with some of the core developers that I think are much too cavalier about bugs and compatibility, and I think some of the design details are insane (I dislike the binary logs, for example), but those are details, not big issues."
|
||||
|
||||
If Linus Torvalds doesn’t have any big issues with the design of systemd, perhaps it’s not all bad. If you’d like a calm look at why a Linux distribution might want to go with systemd, [Debian’s systemd discussion document][17] is good reading.
|
||||
|
||||
What do you think of systemd? Sound off in the comments! Just try to keep it civil, folks—swaying opinions on contentious issues takes level-headed talk.
|
||||
|
||||
*This article has been updated to clarify when systemd is appearing in the Ubuntu Desktop Next images. It originally erroneously stated the change already took place. *
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.pcworld.com/article/2841873/meet-systemd-the-controversial-project-taking-over-a-linux-distro-near-you.html
|
||||
|
||||
作者:[Chris Hoffman][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.pcworld.com/article/2841873/meet-systemd-the-controversial-project-taking-over-a-linux-distro-near-you.html#chrishoffman
|
||||
[1]:https://plus.google.com/app/basic/stream/z13rdjryqyn1xlt3522sxpugoz3gujbhh04
|
||||
[2]:http://www.pcworld.com/article/2033715/7-things-you-need-to-know-about-bitcoin.html
|
||||
[3]:http://boycottsystemd.org/
|
||||
[4]:http://www.pcworld.com/article/2691192/how-gnome-3-14-is-winning-back-disillusioned-linux-users.html
|
||||
[5]:http://www.freedesktop.org/wiki/Software/systemd/
|
||||
[6]:http://en.wikipedia.org/wiki/Init#SysV-style
|
||||
[7]:http://www.pcworld.com/column/world-beyond-windows/
|
||||
[8]:http://www.pcworld.com/blog/world-beyond-windows/index.rss
|
||||
[9]:http://blog.jorgenschaefer.de/2014/07/why-systemd.html
|
||||
[10]:http://en.wikipedia.org/wiki/File:Systemd_components.svg
|
||||
[11]:http://en.wikipedia.org/wiki/Udev
|
||||
[12]:http://en.wikipedia.org/wiki/Cron
|
||||
[13]:http://www.markshuttleworth.com/archives/1295
|
||||
[14]:http://www.pcworld.com/article/2836984/why-ubuntu-1410-utopic-unicorns-humble-changes-are-the-calm-before-the-storm.html
|
||||
[15]:http://www.maximumpc.com/article/news/linus_torvalds_tosses_f-bombs_middle_fingers_and_general_disdain_nvidia
|
||||
[16]:http://www.zdnet.com/linus-torvalds-and-others-on-linuxs-systemd-7000033847/
|
||||
[17]:https://wiki.debian.org/Debate/initsystem/systemd
|
@ -0,0 +1,55 @@
|
||||
Four ways Linux is headed for no-downtime kernel patching
|
||||
================================================================================
|
||||
![Credit: Shutterstock](http://images.techhive.com/images/article/2014/10/patch_f-100526950-primary.idge.jpeg)
|
||||
Credit: Shutterstock
|
||||
|
||||
These technologies are competing to provide the best way to patch the Linux kernel without reboots or downtime
|
||||
|
||||
Nobody loves a reboot, especially not if it involves a late-breaking patch for a kernel-level issue that has to be applied stat.
|
||||
|
||||
To that end, three projects are in the works to provide a mechanism for upgrading the kernel in a running Linux instance without having to reboot anything.
|
||||
|
||||
### Ksplice ###
|
||||
|
||||
The first and original contender is Ksplice, courtesy of a company of the same name founded in 2008. The kernel being replaced does not have to be pre-modified; all it needs is a diff file listing the changes to be made to the kernel source. Ksplice, Inc. offered support for the (free) software as a paid service and supported most common Linux distributions used in production.
|
||||
|
||||
All that changed in 2011, when [Oracle purchased the company][1], rolled the feature into its own Linux distribution, and kept updates for the technology to itself. As a result, other intrepid kernel hackers have been looking for ways to pick up where Ksplice left off, without having to pay the associated Oracle tax.
|
||||
|
||||
### Kgraft ###
|
||||
|
||||
In February 2014, Suse provided the exact solution needed: [Kgraft][2], its kernel-update technology released under a mixed GPLv2/GPLv3 license and not kept close as a proprietary creation. It's since been [submitted][3] as a possible inclusion to the mainline Linux kernel, although Suse has rolled a version of the technology into [Suse Linux Enterprise Server 12][4].
|
||||
|
||||
Kgraft works roughly like Ksplice by using a set of diffs to figure out what parts of the kernel to replace. But unlike Ksplice, Kgraft doesn't need to stop the kernel entirely to replace it. Any running functions can be directed to their old or new kernel-level counterparts until the patching process is finished.
|
||||
|
||||
### Kpatch ###
|
||||
|
||||
Red Hat came up with its own no-reboot kernel-patch mechanism, too. Also introduced earlier this year -- right after Suse's work in that vein, no less -- [Kpatch][5] works in roughly the same manner as Kgraft.
|
||||
|
||||
The main difference, [as outlined][6] by Josh Poimboeuf of Red Hat, is that Kpatch doesn't redirect calls to old kernel functions. Rather, it waits until all function calls have stopped, then swaps in the new kernel. Red Hat's engineers consider this approach safer, with less code to maintain, albeit at the cost of more latency during the patch process.
|
||||
|
||||
Like Kgraft, Kpatch has been submitted for consideration as a possible kernel inclusion and can be used with Linux kernels other than Red Hat's. The bad news is that Kpatch isn't yet considered production-ready by Red Hat. It's included as part of Red Hat Enterprise Linux 7, but only in the form of a technology preview.
|
||||
|
||||
### ...or Kgraft + Kpatch? ###
|
||||
|
||||
A fourth solution [proposed by Red Hat developer Seth Jennings][7] early in November 2014 is a mix of both the Kgraft and Kpatch approaches, using patches built for either one of those solutions. This new approach, Jennings explained, "consists of a live patching 'core' that provides an interface for other 'patch' kernel modules to register patches with the core." This way, the patching process -- specifically, how to deal with any running kernel functions -- can be handled in a more orderly fashion.
|
||||
|
||||
The sheer newness of these proposals means it'll be a while before any of them are officially part of the Linux kernel, although Suse's chosen to move fast and made it a part of its latest enterprise offering. Let's see if Red Hat and Canonical choose to follow suit in the short run as well.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.infoworld.com/article/2851028/linux/four-ways-linux-is-headed-for-no-downtime-kernel-patching.html
|
||||
|
||||
作者:[Serdar Yegulalp][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.infoworld.com/author/Serdar-Yegulalp/
|
||||
[1]:http://www.infoworld.com/article/2622437/open-source-software/oracle-buys-ksplice-for-linux--zero-downtime--tech.html
|
||||
[2]:http://www.infoworld.com/article/2610749/linux/suse-open-sources-live-updater-for-linux-kernel.html
|
||||
[3]:https://lwn.net/Articles/596854/
|
||||
[4]:http://www.infoworld.com/article/2838421/linux/suse-linux-enterprise-12-goes-light-on-docker-heavy-on-reliability.html
|
||||
[5]:https://github.com/dynup/kpatch
|
||||
[6]:https://lwn.net/Articles/597123/
|
||||
[7]:http://lkml.iu.edu/hypermail/linux/kernel/1411.0/04020.html
|
@ -1,78 +0,0 @@
|
||||
alim0x translating
|
||||
|
||||
The history of Android
|
||||
================================================================================
|
||||
![The new Android Market—less black, more white and green.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/marketab2.png)
|
||||
The new Android Market—less black, more white and green.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
### Android 1.6, Donut—CDMA support brings Android to any carrier ###
|
||||
|
||||
The fourth version of Android—1.6, Donut—launched in September 2009, five months after Cupcake hit the market. Despite the myriad of updates, Google was still adding basic functionality to Android. Donut brought support for different screen sizes, CDMA support, and a text-to-speech engine.
|
||||
|
||||
Android 1.6 is a great example of an update that, today, would have little reason to exist as a separate point update. The major improvements basically boiled down to new versions of the Android Market, camera, and YouTube. In the years since, apps like this have been broken out of the OS and can be updated by Google at any time. Before all this modularization work, though, even seemingly minor app updates like this required a full OS update.
|
||||
|
||||
The other big improvement—CDMA support—demonstrated that, despite the version number, Google was still busy getting basic functionality into Android.
|
||||
|
||||
The Android Market was christened as version "1.6" and got a complete overhaul. The original all-black design was tossed in favor of a white app with green highlights—the Android designers were clearly using the Android mascot for inspiration.
|
||||
|
||||
The new market was definitely a new style of app design for Google. The top fifth of the screen was dedicated to a banner logo announcing that this app is indeed the “Android Market." Below the banner were buttons for Apps, Games, and Downloads, and a search button was placed to the right of the banner. Below the navigation was a thumbnail display of featured apps, which could be swiped through. Below that were even more featured apps in a vertically scrolling list.
|
||||
|
||||
![The new Market design, showing an app page with screenshots, the apps categories page, an app top list, and the downloads section.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/marketpages.png)
|
||||
The new Market design, showing an app page with screenshots, the apps categories page, an app top list, and the downloads section.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
The biggest addition to the market was the inclusion of app screenshots. Android users could finally see what an app looked like before installing it—previously they only had a brief description and user reviews to go on. Your personal star review and comment was given top billing, followed by the description, and then finally the screenshots. Viewing the screenshots would often require a bit of scrolling—if you were looking for a well-designed app, it was a lot of work.
|
||||
|
||||
Tapping on App or Games would bring up a category list, which you can see in the second picture, above. After picking a category, more navigation was shown at the top of the screen, where users could see "Top paid," "Top free," or "Just in" apps within a category. While these sorta looked like buttons that would load a new screen, they were really just a clunky tabbed interface. To denote which "tab" was currently active, there were little green lights next to each button. The nicest part of this interface was that the list of apps would scroll infinitely—once you hit the bottom, more apps would load in. This made it easy to look through the list of apps, but opening any app and coming back would lose your spot in the list—you’d be kicked to the top. The downloads section would do something the new Google Play Store still can't do: simply display a list of your purchased apps.
|
||||
|
||||
While the new Market definitely looked better than the old market, cohesion across apps was getting worse and worse. It seemed like each app was made by a different group with no communication about how all Android apps should look.
|
||||
|
||||
![The Camera viewfinder, photo review screen, and menu.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/device-2013-12-27-145949.png)
|
||||
The Camera viewfinder, photo review screen, and menu.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
For instance, the camera app was changed from a full-screen, minimal design to a boxed viewfinder with controls on the side. With the new camera app, Google tried its hand at skeuomorphism, wrapping the whole app in a leather texture roughly replicating the exterior of a classic camera. Switching between the camera and camcorder was done with a literal switch, and below that was the on-screen shutter button.
|
||||
|
||||
Tapping on the previous picture thumbnail no longer launched the gallery, but a custom image viewer that was built in to the camera app. When viewing a picture the leather control area changed the camera controls to picture controls, where you could delete, share a picture, or set the picture as a wallpaper or contact image. There was still no swiping between pictures—that was still done with arrows on either side of the image.
|
||||
|
||||
This second picture shows one of the first examples of designers reducing dependence on the menu button, which the Android team slowly started to realize functioned terribly for discoverability. Many app designers (including those within Google) used the menu as a dumping ground for all sorts of controls and navigational elements. Most users didn't think to hit the menu button, though, and never saw the commands.
|
||||
|
||||
A common theme for future versions of Android would be moving things out of the menu and on to the main screen, making the whole OS more user-friendly. The menu button was completely killed in Android 4.0, and it's only supported in Android for legacy apps.
|
||||
|
||||
![The battery and TTS settings.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/settings1.png)
|
||||
The battery and TTS settings.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
Donut was the first Android version to keep track of battery usage. Buried in the "About phone" menu was an option called "Battery use," which would display battery usage by app and hardware function as a percentage. Tapping on an item would bring up a separate page with relevant stats. Hardware items had buttons to jump directly to their settings, so for instance, you could change the display timeout if you felt the display battery usage was too high.
|
||||
|
||||
Android 1.6 was also the first version to support text-to-speech (TTS) engines, meaning the OS and apps would be able to talk back to you in a robot voice. The “Speech synthesizer controls" would allow you to set the language, choose the speech rate, and (critically) install the voice data from the Android market. Today, Google has its own TTS engine that ships with Android, but it seems Donut was hard coded to accept one specific TTS engine made by SVOX. But SVOX’s engine didn’t ship with Donut, so tapping on “install voice data" linked to an app in the Android Market. (In the years since Donut’s heyday, the app has been taken down. It seems Android 1.6 will never speak again.)
|
||||
|
||||
![From left to right: new widgets, the search bar UI, the new notification clear button, and the new gallery controls.](http://cdn.arstechnica.net/wp-content/uploads/2013/12/grabbag16.png)
|
||||
From left to right: new widgets, the search bar UI, the new notification clear button, and the new gallery controls.
|
||||
Photo by Ron Amadeo
|
||||
|
||||
There was more work on the widget front. Donut brought an entirely new widget called "Power control." This comprised on/off switches for common power-hungry features: Wi-FI, Bluetooth, GPS, Sync (to Google's servers), and brightness.
|
||||
|
||||
The search widget was redesigned to be much slimmer looking, and it had an embedded microphone button for voice search. It now had some actual UI to it and did find-as-you-type live searching, which searched not only the Internet, but your applications and history too.
|
||||
|
||||
The "Clear notifications" button has shrunk down considerably and lost the "notifications" text. In later Android versions it would be reduced to just a square button. The Gallery continues the trend of taking functionality out of the menu and putting it in front of the user—the individual picture view gained buttons for "Set as," "Share," and "Delete."
|
||||
|
||||
----------
|
||||
|
||||
![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/9/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://arstechnica.com/author/ronamadeo
|
||||
[t]:https://twitter.com/RonAmadeo
|
@ -1,3 +1,4 @@
|
||||
forsil translating ...
|
||||
How to use on-screen virtual keyboard on Linux
|
||||
================================================================================
|
||||
On-screen virtual keyboard is an alternative input method that can replace a real hardware keyboard. Virtual keyboard may be a necessity in various cases. For example, your hardware keyboard is just broken; you do not have enough keyboards for extra machines; your hardware does not have an available port left to connect a keyboard; you are a disabled person with difficulty in typing on a real keyboard; or you are building a touchscreen-based web kiosk.
|
||||
|
@ -1,65 +0,0 @@
|
||||
disylee来翻译
|
||||
How to Remove Music Players from Ubuntu Sound Menu
|
||||
================================================================================
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/music-players.jpg)
|
||||
|
||||
**Since its introduction back in 2010, the Ubuntu Sound Menu has proven to be one of the most popular and unique features of the Unity desktop.**
|
||||
|
||||
Allowing music players to integrate with the volume applet – i.e., where one would expect to find sound-related tomfoolery – through a standard interface is inspired. One wonders why other operating systems haven’t followed suit!
|
||||
|
||||
#### Overstuffed ####
|
||||
|
||||
Handy though it may be there is a “problem” with the applet as it currently exists: pretty much anything that so much as looks at an MP3 can, should it want, lodge itself inside. While useful, an omnipresent listing for apps you have installed but don’t use that often is annoying and unsightly.
|
||||
|
||||
I’m going to wager that the screenshot above looks familiar to a great many of you reading this! Never fear, **dconf-editor** is here.
|
||||
|
||||
### Remove Players from Ubuntu Sound Menu ###
|
||||
|
||||
#### Part One: Basics ####
|
||||
|
||||
The quickest and easiest way to remove entries from the Sound Menu is to uninstall the apps afflicting it. But that’s extreme; as I said, you may want the app, just not the integration.
|
||||
|
||||
To remove players without ditching the apps we need to use a scary looking tool called dconf-editor.
|
||||
|
||||
You may have it installed already, but if you don’t you’ll find it in the Ubuntu Software Center waiting.
|
||||
|
||||
- [Click to Install Dconf-Editor in Ubuntu][1]
|
||||
|
||||
Once installed, head to the Unity Dash to open it. Don’t panic when it opens; you’ve not been shunted back to the 2002, it’s supposed to look like that.
|
||||
|
||||
Using the left-hand sidebar you need to navigate to com > canonical > indicator > sound. The following pane will appear.
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/dconf-editor.jpg)
|
||||
|
||||
Double click on the closed brackets next to interested-media-players and delete the players you wish to remove from the Sound Menu, but leave in the square brackets and don’t delete any commas or apostrophes from items you wish to keep.
|
||||
|
||||
For example, I removed ‘**rhythmbox.desktop**’, ‘**pithos.desktop**’, ‘**clementine.desktop**’, to leave a line that reads:
|
||||
|
||||
['tomahawk.desktop']
|
||||
|
||||
Now, when I open the Sound menu I only see Tomahawk:
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/music-players-2.jpg)
|
||||
|
||||
#### Part Two: Blacklisting ####
|
||||
|
||||
Wait! Don’t close dconf-editor yet. While the steps above makes things look nice and tidy some players will instantly re-add themselves to the sound menu when opened. To avoid having to repeat the process add them to the **blacklisted-media-player** section.
|
||||
|
||||
Remember to enclose each player in apostrophes with a comma separating multiple entries. They must also be inside the square brackets — so double check before exiting.
|
||||
|
||||
The net result:
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/from-to-.jpg)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/11/remove-players-ubuntu-sound-menu
|
||||
|
||||
作者:[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]:apt://dconf-editor
|
@ -0,0 +1,189 @@
|
||||
johnhoow translating...
|
||||
Important 10 Linux ps command Practical Examples
|
||||
================================================================================
|
||||
As an Operating System which inspired from Unix, Linux has a built-in tool to capture current processes on the system. This tool is available in command line interface.
|
||||
|
||||
### What is PS Command ###
|
||||
|
||||
From its manual page, PS gives a snapshots of the current process. It will “capture” the system condition at a single time. If you want to have a repetitive updates in a real time, we can use top command.
|
||||
|
||||
PS support three (3) type of usage syntax style.
|
||||
|
||||
1. UNIX style, which may be grouped and **must** be preceded by a dash
|
||||
2. BSD style, which may be grouped and **must not be** used with a dash
|
||||
3. GNU long options, which are preceded by two dash
|
||||
|
||||
We can mix those style, but conflicts can appear. In this article, will use UNIX style. Here’s are some examples of PS command in a daily use.
|
||||
|
||||
### 1. Run ps without any options ###
|
||||
|
||||
This is a very basic **ps** usage. Just type ps on your console to see its result.
|
||||
|
||||
![ps with no options](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_no_options.png)
|
||||
|
||||
By default, it will show us 4 columns of information.
|
||||
|
||||
- PID is a Process ID of the running command (CMD)
|
||||
- TTY is a place where the running command runs
|
||||
- TIME tell about how much time is used by CPU while running the command
|
||||
- CMD is a command that run as current process
|
||||
|
||||
This information is displayed in unsorted result.
|
||||
|
||||
### 2. Show all current processes ###
|
||||
|
||||
To do this, we can use **-a** options. As we can guess, **-a is stand for “all”**. While x will show all process even the current process is not associated with any TTY (terminal)
|
||||
|
||||
$ ps -ax
|
||||
|
||||
This result might be long result. To make it more easier to read, combine it with less command.
|
||||
|
||||
$ ps -ax | less
|
||||
|
||||
![ps all information](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_ax.png)
|
||||
|
||||
### 3. Filter processes by its user ###
|
||||
|
||||
For some situation we may want to filter processes by user. To do this, we can use **-u** option. Let say we want to see what processes which run by user pungki. So the command will be like below
|
||||
|
||||
$ ps -u pungki
|
||||
|
||||
![filter by user](http://blog.linoxide.com/wp-content/uploads/2014/10/ps__u.png)
|
||||
|
||||
### 4. Filter processes by CPU or memory usage ###
|
||||
|
||||
Another thing that you might want to see is filter the result by CPU or memory usage. With this, you can grab information about which processes that consume your resource. To do this, we can use **aux options**. Here’s an example of it :
|
||||
|
||||
$ ps -aux | less
|
||||
|
||||
![show all information](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_aux.png)
|
||||
|
||||
Since the result can be in a long list, we can **pipe** less command into ps command.
|
||||
By default, the result will be in unsorted form. If we want to sort by particular column, we can add **--sort** option into ps command.
|
||||
|
||||
Sort by the highest **CPU utilization** in ascending order
|
||||
|
||||
$ ps -aux --sort -pcpu | less
|
||||
|
||||
![sort by cpu usage](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_aux_sort_cpu.png)
|
||||
|
||||
Sort by the highest **Memory utilization** in ascending order
|
||||
|
||||
$ ps -aux --sort -pmem | less
|
||||
|
||||
![sort by memory usage](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_aux_sort_mem.png)
|
||||
|
||||
Or we can combine itu a single command and display only the top ten of the result :
|
||||
|
||||
$ ps -aux --sort -pcpu,+pmem | head -n 10
|
||||
|
||||
### 5. Filter processes by its name or process ID ###
|
||||
|
||||
To to this, we can use **-C option** followed by the keyword. Let say, we want to show processes named getty. We can type :
|
||||
|
||||
$ ps -C getty
|
||||
|
||||
![filter by its name or process ID](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_C.png)
|
||||
|
||||
If we want to show more detail about the result, we can add -f option to show it on full format listing. The above command will looks like below :
|
||||
|
||||
$ ps -f -C getty
|
||||
|
||||
![filter by its name or process ID](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_C_f.png)
|
||||
|
||||
### 6. Filter processes by thread of process ###
|
||||
|
||||
If we need to know the thread of a particular process, we can use **-L option** followed by its Process ID (PID). Here’s an example of **-L option** in action :
|
||||
|
||||
$ ps -L 1213
|
||||
|
||||
![show processes in threaded view](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_L.png)
|
||||
|
||||
As we can see, the PID remain the same value, but the LWP which shows numbers of thread show different values.
|
||||
|
||||
### 7. Show processes in hierarchy ###
|
||||
|
||||
Sometime we want to see the processes in hierarchical form. To do this, we can use **-axjf** options.
|
||||
|
||||
$ps -axjf
|
||||
|
||||
![show in hierarchy](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_axjf.png)
|
||||
|
||||
Or, another command which we can use is pstree.
|
||||
|
||||
$ pstree
|
||||
|
||||
![show information in hierarchy](http://blog.linoxide.com/wp-content/uploads/2014/10/pstree.png)
|
||||
|
||||
### 8. Show security information ###
|
||||
|
||||
If we want to see who is currently logged on into your server, we can see it using the ps command. There are some options that we can use to fulfill our needs. Here’s some examples :
|
||||
|
||||
$ ps -eo pid,user,args
|
||||
|
||||
**Option -e** will show you all processes while **-o option** will control the output. **Pid**, **User and Args** will show you the **Process ID**, **the User who run the application** and **the running application**.
|
||||
|
||||
![show security information](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_security_1.png)
|
||||
|
||||
The keyword / user-defined format that can be used with **-e option** are **args, cmd, comm, command, fname, ucmd, ucomm, lstart, bsdstart and start**.
|
||||
|
||||
### 9. Show every process running as root (real & effecitve ID) in user format ###
|
||||
|
||||
System admin may want to see what processes are being run by root and other information related to it. Using ps command, we can do by this simple command :
|
||||
|
||||
$ ps -U root -u root u
|
||||
|
||||
The **-U parameter** will select by **real user ID (RUID)**. It selects the processes whose real user name or ID is in the userlist list. The real User ID identifies the user who created the process.
|
||||
|
||||
While the **-u paramater** will select by effective user ID (EUID)
|
||||
|
||||
The last **u** paramater, will display the output in user-oriented format which contains **User, PID, %CPU, %MEM, VSZ, RSS, TTY, STAT, START, TIME and COMMAND** columns.
|
||||
|
||||
Here’s the output of the above command.
|
||||
|
||||
![show real and effective User ID](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_root_real_effective_ID.png)
|
||||
|
||||
### 10. Use PS in a realtime process viewer ###
|
||||
|
||||
ps will display a report of what happens in your system. The result will be a static report.
|
||||
Let say, we want to filter processes by CPU and Memory usage as on the point 4 above. And we want the report is updated every 1 second. We can do it by **combining ps command with watch command** on Linux.
|
||||
|
||||
Here’s the command :
|
||||
|
||||
$ watch -n 1 ‘ps -aux --sort -pmem, -pcpu’
|
||||
|
||||
![combine ps with watch](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_watch_1.png)
|
||||
|
||||
If you feel the report is too long, **we can limit it** by - let say - the top 20 processes. We can add **head** command to do it.
|
||||
|
||||
$ watch -n 1 ‘ps -aux --sort -pmem, -pcpu | head 20’
|
||||
|
||||
![combine ps with watch](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_watch_2.png)
|
||||
|
||||
This live reporter **is not** like top or htop of course. **But the advantage of using ps** to make live report is that you can custom the field. You can choose which field you want to see.
|
||||
|
||||
For example, **if you need only the pungki user shown**, then you can change the command to become like this :
|
||||
|
||||
$ watch -n 1 ‘ps -aux -U pungki u --sort -pmem, -pcpu | head 20’
|
||||
|
||||
![combine ps with watch](http://blog.linoxide.com/wp-content/uploads/2014/10/ps_watch_3.png)
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
You may use **ps** on your daily usage to monitor about what happens your Linux system. But actually, you can generate various types of report using **ps** command with the use of appropriate paramaters.
|
||||
|
||||
**Another ps advantage** is that **ps** are installed by default in any kind of Linux. So you can just start to use it.
|
||||
|
||||
Don't forget to see **ps documentation** by typing **man ps** on you Linux console to explore more options.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/how-tos/linux-ps-command-examples/
|
||||
|
||||
作者:[Pungki Arianto][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/pungki/
|
@ -0,0 +1,129 @@
|
||||
How to install Cacti (Monitoring tool) on ubuntu 14.10 server
|
||||
================================================================================
|
||||
Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices.
|
||||
|
||||
### Features ###
|
||||
|
||||
#### Graphs ####
|
||||
|
||||
Unlimited number of graph items can be defined for each graph optionally utilizing CDEFs or data sources from within cacti.
|
||||
|
||||
Automatic grouping of GPRINT graph items to AREA, STACK, and LINE[1-3] to allow for quick re-sequencing of graph items.
|
||||
|
||||
Auto-Padding support to make sure graph legend text lines up.
|
||||
|
||||
Graph data can be manipulated using the CDEF math functions built into RRDTool. These CDEF functions can be defined in cacti and can be used globally on each graph.
|
||||
|
||||
Support for all of RRDTool's graph item types including AREA, STACK, LINE[1-3], GPRINT, COMMENT, VRULE, and HRULE.
|
||||
|
||||
#### Data Sources ####
|
||||
|
||||
Data sources can be created that utilize RRDTool's "create" and "update" functions. Each data source can be used to gather local or remote data and placed on a graph.
|
||||
|
||||
Supports RRD files with more than one data source and can use an RRD file stored anywhere on the local file system.
|
||||
Round robin archive (RRA) settings can be customized giving the user the ability to gather data on non-standard timespans while store varying amounts of data.
|
||||
|
||||
#### Data Gathering ####
|
||||
|
||||
Contains a "data input" mechanism which allows users to define custom scripts that can be used to gather data. Each script can contain arguments that must be entered for each data source created using the script (such as an IP address).
|
||||
|
||||
Built in SNMP support that can use php-snmp, ucd-snmp, or net-snmp.
|
||||
|
||||
Ability to retrieve data using SNMP or a script with an index. An example of this would be populating a list with IP interfaces or mounted partitions on a server. Integration with graph templates can be defined to enable one click graph creation for hosts.
|
||||
|
||||
A PHP-based poller is provided to execute scripts, retrieve SNMP data, and update your RRD files.
|
||||
|
||||
#### Templates ####
|
||||
|
||||
Graph templates enable common graphs to be grouped together by templating. Every field for a normal graph can be templated or specified on a per-graph basis.
|
||||
|
||||
Data source templates enable common data source types to be grouped together by templating. Every field for a normal data source can be templated or specified on a per-data source basis.
|
||||
|
||||
Host templates are a group of graph and data source templates that allow you to define common host types. Upon the creation of a host, it will automatically take on the properties of its template.
|
||||
|
||||
#### Graph Display ####
|
||||
|
||||
The tree view allows users to create "graph hierarchies" and place graphs on the tree. This is an easy way to manage/organize a large number of graphs.
|
||||
|
||||
The list view lists the title of each graph in one large list which links the user to the actual graph.
|
||||
The preview view displays all of the graphs in one large list format. This is similar to the default view for the 14all cgi script for RRDTool/MRTG.
|
||||
|
||||
#### User Management ####
|
||||
|
||||
User based management allows administrators to create users and assign different levels of permissions to the cacti interface.
|
||||
|
||||
Permissions can be specified per-graph for each user, making cacti suitable for co location situations.
|
||||
Each user can keep their own graph settings for varying viewing preferences.
|
||||
|
||||
#### Preparing your system ####
|
||||
|
||||
Before installing cacti you need to make sure you have installed [Ubuntu 14.10 LAMP server][1].
|
||||
|
||||
#### Install Cacti on ubuntu 14.10 server ####
|
||||
|
||||
Open the terminal and run the following command
|
||||
|
||||
sudo apt-get install cacti-spine
|
||||
|
||||
The above command starts the cacti installation and you should see the first as php path change select ok and press enter
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/18.png)
|
||||
|
||||
Now select the webserver you want to use (in my case it is apache2)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/27.png)
|
||||
|
||||
Cacti database configurations select yes
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/35.png)
|
||||
|
||||
Enter database admin user password
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/42.png)
|
||||
|
||||
Mysql application password for cacti
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/5.png)
|
||||
|
||||
confirm the password
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/6.png)
|
||||
|
||||
Now that Cacti is installed, we can start the configuration process on it.
|
||||
|
||||
#### Configuring cacti ####
|
||||
|
||||
Point your web browser towards http://YOURSERVERIP/cacti/install/ to start the initial setup and click next
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/7.png)
|
||||
|
||||
Select new install option and click next
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/8.png)
|
||||
|
||||
In the following screen you need to make sure you have all the required paths are correct and click on finish
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/9.png)
|
||||
|
||||
Now login to Cacti with the default admin/admin, and change the password to something more sensible
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/10.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/01/111.png)
|
||||
|
||||
After login in to Cacti you should see similar to the following screen
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/11/14.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/how-to-install-cacti-monitoring-tool-on-ubuntu-14-10-server.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
||||
[1]:http://www.ubuntugeek.com/www.ubuntugeek.com/step-by-step-ubuntu-14-10-utopic-unicorn-lamp-server-setup.html
|
@ -0,0 +1,103 @@
|
||||
How To Create A Multiboot USB From Ubuntu Using MultiSystem
|
||||
================================================================================
|
||||
### Introduction ###
|
||||
|
||||
For those who don’t know, **MultiSystem** is a small, Open Source freeware to create a multiboot usb drives from Linux systems. Using this utility, we can create any number of bootable Linux distributions in a USB drive. All you need is an Internet connection(at the time of MultiSystem installation only), and a sufficient size of a USB drive depending upon the number of distributions you want to include in that USB drive.
|
||||
|
||||
### Install MultiSystem On Ubuntu 14.10/14.04 ###
|
||||
|
||||
#### Manual Installation: ####
|
||||
|
||||
[Download MultiSystem][1] script, and extract it anywhere of your choice. Go to the extracted location, and run the script as shown below.
|
||||
|
||||
sudo ./install-depot-multisystem.sh
|
||||
|
||||
#### Installation Using PPA: ####
|
||||
|
||||
Alternatively, you can install MultiSystem more easily using PPA as shown below.
|
||||
|
||||
sudo apt-add-repository 'deb http://liveusb.info/multisystem/depot all main'
|
||||
wget -q -O - http://liveusb.info/multisystem/depot/multisystem.asc | sudo apt-key add -
|
||||
sudo apt-get update
|
||||
sudo apt-get install multisystem
|
||||
|
||||
After installation, It will automatically open. Just click Close button to exit.
|
||||
|
||||
### Post Installation ###
|
||||
|
||||
Once installed, plug-in your USB key, and launch MultiSystem either from Unity Dash or Menu.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/Menu_0012.png)
|
||||
|
||||
At first time, the MultiSystem interface will look like below.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/MultiSystem_002.png)
|
||||
|
||||
Select the USB drive, and click **Confirm** button. You may get the following error dialog box. Don’t worry, It says our USB drive has no label. Click Ok to set label by MultiSystem itself.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/Error_003.png)
|
||||
|
||||
Then, unplug/replug the USB key, and launch MultiSystem again. Select the USB key, and click Confirm again. Now, you’ll be asked to confirm Grub2 installation in your USB key. Click Ok to continue.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/gtkdialog_004.png)
|
||||
|
||||
Finally, you’ll be pleased with MultiSystem interface. Now’ it’s time to create multiboot usb key.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/MultiSystem_005.png)
|
||||
|
||||
### Usage ###
|
||||
|
||||
MultiSystem is very simple to use. Drag the ISO of your choice into the MultiSystem window. If it doesn’t work, click on the **cd icon** on the bottom and select the ISO’s.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/MultiSystem_006.png)
|
||||
|
||||
Now, MultiSystem will copy the files from the ISO, and make the USB key as bootable.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/MultiSystem_007.png)
|
||||
|
||||
Likewise, you can add as many distributions as you want in your USB key. In my case, I have added two Linux distributions: CentOS 6.5 and Android.
|
||||
|
||||
After adding all ISO’s, you will now see the list of bootable distributions in the MultiSystem main window.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/MultiSystem_008.png)
|
||||
|
||||
That’s it. Our multiboot USB key is ready to use. Reboot your system, and set the first boot device as USB in your Bios. Select the distribution you want to install, and start installing the OS from the multiboot USB key.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/QEMU_009.png)
|
||||
|
||||
Additionally, MultiSystem includes some extra options such as:
|
||||
|
||||
- Grub Settings;
|
||||
- Grub & Burg bootloaders Update;
|
||||
- Download Live Cds;
|
||||
- VirtualBox installation;
|
||||
- Format USB key;
|
||||
- and many.
|
||||
|
||||
To view the list of additional options, navigate to the **Menus** tab of the MultiSystem.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/MultiSystem_010.png)
|
||||
|
||||
Also, you can test the multiboot USB key within your Ubuntu desktop itself using QEMU or Oracle VirtualBox.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/MultiSystem_011.png)
|
||||
|
||||
MultiSystem tool is one of the best and useful tool ever I have tested. This tool will definitely useful for those who wants to install multiple different operating systems on their systems. You don’t have to carry your CD/DVD pouch wherever you go. Just buy a 16GB 0r 32GB USB, and dumb all Operating systems you want to install in it. and install OS like a boss.
|
||||
|
||||
And, the good news for Windows OS users is it supports some Windows os too. I tested Windows 7, and it’s working!
|
||||
|
||||
Enjoy!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.unixmen.com/create-multiboot-usb-ubuntu-using-multisystem/
|
||||
|
||||
作者:[SK][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.unixmen.com/author/sk/
|
||||
[1]:http://liveusb.info/multisystem/install-depot-multisystem.sh.tar.bz2
|
||||
[2]:http://liveusb.info/dotclear/
|
76
sources/tech/20141127 Quick systemd-nspawn guide.md
Normal file
76
sources/tech/20141127 Quick systemd-nspawn guide.md
Normal file
@ -0,0 +1,76 @@
|
||||
Quick systemd-nspawn guide
|
||||
================================================================================
|
||||
I switched to using systemd-nspawn in place of chroot and wanted to give a quick guide to using it. The short version is that I’d strongly recommend that anybody running systemd that uses chroot switch over - there really are no downsides as long as your kernel is properly configured.
|
||||
|
||||
Chroot should be no stranger to anybody who works on distros, and I suspect that the majority of Gentoo users have need for it from time to time.
|
||||
|
||||
### The Challenges of chroot ###
|
||||
|
||||
For most interactive uses it isn’t sufficient to just run chroot. Usually you need to mount /proc, /sys, and bind mount /dev so that you don’t have issues like missing ptys, etc. If you use tmpfs you might also want to mount the new tmp, var/tmp as tmpfs. Then you might want to make other bind mounts into the chroot. None of this is particularly difficult, but you usually end up writing a small script to manage it.
|
||||
|
||||
Now, I routinely do full backups, and usually that involves excluding stuff like tmp dirs, and anything resembling a bind mount. When I set up a new chroot that means updating my backup config, which I usually forget to do since most of the time the chroot mounts aren’t running anyway. Then when I do leave it mounted overnight I end up with backups consuming lots of extra space (bind mounts of large trees).
|
||||
|
||||
Finally, systemd now by default handles bind mounts a little differently when they contain other mount points (such as when using -rbind). Apparently unmounting something in the bind mount will cause systemd to unmount the corresponding directory on the other side of the bind. Imagine my surprise when I unmounted my chroot bind to /dev and discovered /dev/pts and /dev/shm no longer mounted on the host. It looks like there are ways to change that, but this isn’t the point of my post (it just spurred me to find another way).
|
||||
|
||||
### Systemd-nspawn’s Advantages ###
|
||||
|
||||
Systemd-nspawn is a tool that launches a container, and it can operate just like chroot in its simplest form. By default it automatically sets up most of the overhead like /dev, /tmp, etc. With a few options it can also set up other bind mounts as well. When the container exits all the mounts are cleaned up.
|
||||
|
||||
From the outside of the container nothing appears different when the container is running. In fact, you could spawn 5 different systemd-nspawn container instances from the same chroot and they wouldn’t have any interaction except via the filesystem (and that excludes /dev, /tmp, and so on - only changes in /usr, /etc will propagate across). Your backup won’t see the bind mounts, or tmpfs, or anything else mounted within the container.
|
||||
|
||||
The container also has all those other nifty container benefits like containment - a killall inside the container won’t touch anything outside, and so on. The security isn’t airtight - the intent is to prevent accidental mistakes.
|
||||
|
||||
Then, if you use a compatible sysvinit (which includes systemd, and I think recent versions of openrc), you can actually boot the container, which drops you to a getty inside. That means you can use fstab to do additional mounts inside the container, run daemons, and so on. You get almost all the benefits of virtualization for the cost of a chroot (no need to build a kernel, and so on). It is a bit odd to be running systemctl poweroff inside what looks just like a chroot, but it works.
|
||||
|
||||
Note that unless you do a bit more setup you will share the same network interface with the host, so no running sshd on the container if you have it on the host, etc. I won’t get into this but it shouldn’t be hard to run a separate network namespace and bind the interfaces so that the new instance can run dhcp.
|
||||
|
||||
### How to do it ###
|
||||
|
||||
So, getting it actually working will likely be the shortest bit in this post.
|
||||
|
||||
You need support for namespaces and multiple devpts instances in your kernel:
|
||||
|
||||
CONFIG_UTS_NS=y
|
||||
CONFIG_IPC_NS=y
|
||||
CONFIG_USER_NS=y
|
||||
CONFIG_PID_NS=y
|
||||
CONFIG_NET_NS=y
|
||||
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
|
||||
|
||||
From there launching a namespace just like a chroot is really simple:
|
||||
|
||||
systemd-nspawn -D .
|
||||
|
||||
That’s it - you can exit from it just like a chroot. From inside you can run mount and see that it has taken care of /dev and /tmp for you. The “.” is the path to the chroot, which I assume is the current directory. With nothing further it runs bash inside.
|
||||
|
||||
If you want to add some bind mounts it is easy:
|
||||
|
||||
systemd-nspawn -D . --bind /usr/portage
|
||||
|
||||
Now your /usr/portage is bound to your host, so no need to sync/etc. If you want to bind to a different destination add a “:dest” after the source, relative to the root of the chroot (so --bind foo is the same as --bind foo:foo).
|
||||
|
||||
If the container has a functional init that can handle being run inside, you can add a -b to boot it:
|
||||
|
||||
systemd-nspawn -D . --bind /usr/portage -b
|
||||
|
||||
Watch the init do its job. Shut down the container to exit.
|
||||
|
||||
Now, if that container is running systemd you can direct its journal to the host journal with -h:
|
||||
|
||||
systemd-nspawn -D . --bind /usr/portage -j -b
|
||||
|
||||
Now, nspawn registers the container so that it shows up in machinectl. That makes it easy to launch a new getty on it, or ssh to it (if it is running ssh - see my note above about network namespaces), or power it off from the host.
|
||||
|
||||
That’s it. If you’re running systemd I’d suggest ditching chroot almost entirely in favor of nspawn.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://rich0gentoo.wordpress.com/2014/07/14/quick-systemd-nspawn-guide/
|
||||
|
||||
作者:[rich0][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://rich0gentoo.wordpress.com/
|
@ -0,0 +1,98 @@
|
||||
dupeGuru – Find And Remove Duplicate Files Instantly From Hard Drive
|
||||
================================================================================
|
||||
### Introduction ###
|
||||
|
||||
Disk full is one of the big trouble for us. No matter how we’re careful, sometimes we might copy the same file to multiple locations, or download the same file twice unknowingly. Therefore, sooner or later we will end up with disk full error message, which is worst when we really need some space to store important data. If you believe your system has multiple duplicate files, then **dupeGuru** might help you.
|
||||
|
||||
dupeGuru team have also developed applications called **dupeGuru Music Edition** to remove duplicate music files, and **dupeGuru Picture Edition** to remove duplicate pictures.
|
||||
|
||||
### 1. dupeGuru (Standard Edition) ###
|
||||
|
||||
For those who don’t know about [dupeGuru][1], It is a free, open source, cross-platform application that can used to find and remove the duplicate files in your system. It will run under Linux, Windows, and Mac OS X platforms. It uses a quick fuzzy matching algorithm to find the duplicate files in minutes. Also, you can tweak dupeGuru to find exactly what kind of duplicate files you want to, and eliminate what kind of files from deletion. It supports English, French, German, Chinese (Simplified), Czech, Italian, Armenian, Russian, Ukrainian, Brazilian, and Vietnamese.
|
||||
|
||||
#### Install dupeGuru On Ubuntu 14.10/14.04/13.10/13.04/12.04 ####
|
||||
|
||||
dupeGuru developers have created a Ubuntu PPA to ease the installation. To install dupeGuru, enter the following commands one by one in your Terminal.
|
||||
|
||||
sudo apt-add-repository ppa:hsoft/ppa
|
||||
sudo apt-get update
|
||||
sudo apt-get install dupeguru-se
|
||||
|
||||
#### Usage ####
|
||||
|
||||
Usage is very simple. Launch dupeGuru either from Unity Dash or Menu.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru_007.png)
|
||||
|
||||
Click + button on the bottom, and add the folder you want to scan. Click Scan button to start finding the duplicate files.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru_008.png)
|
||||
|
||||
If the selected folder contains any duplicate files, it will display them. As you in the below screen shot, I have a duplicate file in the Downloads directory.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru-Results_009.png)
|
||||
|
||||
Now, you can decide what to do. You can either delete the duplicate file, or rename it, or copy/move it to another location. To do that select the duplicate files, or check the box that says “**Dupes only**” on the Menu bar. If you selected the Dupes only option, the duplicates files will only visible. So you can select and delete them easily. Click on the **Actions** drop-down box. Finally, select the action you want to perform. Here, I just want to delete the duplicate file, so I selected the option: **Send marked to Recycle bin**.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/Menu_010.png)
|
||||
|
||||
Then, click **Proceed** to delete the duplicate files.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/Deletion-Options_011.png)
|
||||
|
||||
### 2. dupeGuru Music Edition ###
|
||||
|
||||
[dupeGuru Music Edition][2] or dupeGuru ME in short, is just like dupeGuru. It does everything dupeGuru does, but it has more information columns (such as bitrate, duration, tags, etc..) and more scan types (filename with fields, tags and audio content). Like dupeGuru, dupeGuru ME also runs on Linux, Windows, and Mac OS X.
|
||||
|
||||
It supports variety of formats such as MP3, WMA, AAC (iTunes format), OGG, FLAC, loss-less AAC and loss-less WMA etc,
|
||||
|
||||
#### Install dupeGuru ME On Ubuntu 14.10/14.04/13.10/13.04/12.04 ####
|
||||
|
||||
Now, we don’t have to add any PPA, because already the added in the previous steps. So, enter the following command to install from your Terminal.
|
||||
|
||||
sudo apt-get install dupeguru-me
|
||||
|
||||
#### Usage ####
|
||||
|
||||
Launch it either from Unity dash or Menu. The usage, interface, and look of dupeGuru ME is similar to normal dupeGuru. Add the folder you to scan and select the action you want to perform. The duplicate music files will be deleted.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru-Music-Edition-Results_012.png)
|
||||
|
||||
### 3. dupeGuru Picture Edition ###
|
||||
|
||||
[dupeGuru Picture Edition][3], or duepGuru PE in short, is a tool to find duplicate pictures on your computer. It is as like as dupeGuru, but is specialized for duplicate pictures matching. dupeGuru PE runs on Linux, Windows, and Mac OS X.
|
||||
|
||||
dupeGuru PE supports JPG, PNG, TIFF, GIF and BMP formats. All these formats can be compared together. The Mac OS X version of dupeGuru PE also supports PSD and RAW (CR2 and NEF) formats.
|
||||
|
||||
#### Install dupeGuru PE On Ubuntu 14.10/14.04/13.10/13.04/12.04 ####
|
||||
|
||||
As we have already added the PPA, We don’t need to add PPA for dupeGuru either. Just, run the following command to install it.
|
||||
|
||||
sudo apt-get install dupeguru-pe
|
||||
|
||||
#### Usage ####
|
||||
|
||||
It’s also look like dupeGuru, and dupeGuru ME in terms of usage, interface, and look.I wonder why the developer have created there separate versions for each category. It would be better, a single application has all of the above three features combined.
|
||||
|
||||
Launch it, add the folder you want to scan, and select the action you want to perform. That’s it. you duplicated files will be gone.
|
||||
|
||||
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/11/dupeGuru-Picture-Edition-Results_014.png)
|
||||
|
||||
If you can’t remove them in case of any security problems, note down the location of the files, and manually delete them either from Terminal or File manager.
|
||||
|
||||
Cheers!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.unixmen.com/dupeguru-find-remove-duplicate-files-instantly-hard-drive/
|
||||
|
||||
作者:[SK][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.unixmen.com/author/sk/
|
||||
[1]:http://www.hardcoded.net/dupeguru/
|
||||
[2]:http://www.hardcoded.net/dupeguru_me/
|
||||
[3]:http://www.hardcoded.net/dupeguru_pe/
|
@ -0,0 +1,94 @@
|
||||
UbuTricks - 在ubuntu上安装几个最新游戏和应用的脚本
|
||||
===
|
||||
UbuTricks是一个可以帮助你在ubuntu上安装几个最新版本的游戏和应用的程序。
|
||||
|
||||
UbuTricks是一个有简单界面,基于Zenity的图形脚本。虽然早期开发中,它的目标是通过简单的界面操作来安装Ubuntu14.04 及以后发行版上应用程序的更新。
|
||||
|
||||
应用程序会自动下载安装。一些更新可能会需要ppa。其它的将会通过编译源代码安装。编译过程可能会需要一些时间,当从ppa或者deb文件安装应该会快一点,取决于你的下载速度。
|
||||
|
||||
###一共有以下几种安装方式:
|
||||
|
||||
- PPA - 程序将会从PPA下载安装
|
||||
- DEB - 程序将会从DEB文件进行安装
|
||||
- Source - 程序会进行编译安装 (可能需要一点时间)
|
||||
- Script - 程序会通过开发者提供的脚本进行安装
|
||||
- Archive - 程序会通过压缩文件安装
|
||||
- Repository - 程序从仓库安装 (不是PPA)
|
||||
|
||||
###你可以安装的应用程序列表
|
||||
|
||||
通过UbuTricks可以安装下面应用的最新版本:
|
||||
|
||||
###游戏
|
||||
|
||||
- 0 A.D.
|
||||
- Battle for Wesnoth (Dev)
|
||||
- VCMI (Heroes III Engine)
|
||||
|
||||
###文件管理
|
||||
|
||||
- PCManFM
|
||||
|
||||
###互联网
|
||||
|
||||
- Geary
|
||||
- HexChat
|
||||
- QupZilla
|
||||
- QuiteRSS
|
||||
|
||||
###多媒体
|
||||
|
||||
- SMPlayer
|
||||
- Transmageddon
|
||||
- Kdenlive
|
||||
- Fotoxx
|
||||
- jAlbum
|
||||
- GIMP
|
||||
- Shutter
|
||||
- Qmmp
|
||||
- XBMC
|
||||
|
||||
###办公/电子书/文档
|
||||
|
||||
- Calibre
|
||||
- LibreOffice
|
||||
|
||||
###工具
|
||||
|
||||
- Ubuntu Tweak
|
||||
|
||||
###桌面环境
|
||||
|
||||
- Cinnamon
|
||||
|
||||
###其他
|
||||
|
||||
- Google Earth
|
||||
- Wine
|
||||
|
||||
###下载,安装Ubuntutricks
|
||||
|
||||
你可以从[这里][1]下载ubuntutricks,让它可执行然后双击脚本或者从终端里运行它。
|
||||
|
||||
###截图
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/10/116.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/10/213.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/10/35.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/10/45.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/ubutricks-script-to-install-the-latest-versions-of-several-games-and-applications-in-ubuntu.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[DoubleShit](https://github.com/DoubleShit)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
||||
[1]:http://www.tuxarena.com/intro/files/ubutricks.sh
|
@ -0,0 +1,47 @@
|
||||
Qshutdown – 一个先进的关机神器
|
||||
================================================================================
|
||||
qshutdown是一个QT程序,用于让计算机在指定时间或者在几分钟后关机/重启/挂起/睡眠。它会一直显示时间,直到相应的请求被发送到Gnome或KDE会话管理器,或者发送到HAL或DeviceKit。而如果这一切都没有发生,将会使用‘sudo shutdown -P now’进行关机。对于那些只在特定时间使用计算机工作的人而言,可能很有用。
|
||||
|
||||
qshutdown将在最后70秒时显示3次警告提醒。(如果设置了1分钟或者本地时间+1,它只会显示一次。)
|
||||
|
||||
该程序使用qdbus来发送关机/重启/挂起/睡眠请求到gnome或kde会话管理器,或者到HAL或DeviceKit,而如果这些都没有工作,那么就会使用‘sudo shutdown’命令进行关机(注意,但发送请求到HAL或DeviceKit,或者使用shutdown命令时,会话不会被保存。如果使用shutdown命令,该程序只会被关机或重启)。所以,如果在shutdown或reboot时间到时什么都没发生,这就意味着用户缺少使用shutdown命令的权限。
|
||||
|
||||
在这种情况下,你可以进行以下操作:
|
||||
|
||||
粘贴以下信息到终端:“EDITOR:nano sudo -E visudo”并添加此行:“* ALL = NOPASSWD:/sbin/shutdown”这里*替换username或%groupname。
|
||||
|
||||
配置文件qshutdown.conf
|
||||
|
||||
倒计时最大计数为1440分钟(24小时)。配置文件(和日志文件)位于~/.qshutdown。
|
||||
|
||||
对于管理员:
|
||||
|
||||
在将qshutdonw.conf中的Lock_all选项设置为true后,用户将不能修改设置。如果你使用“sudo chown root -R ~/.qshutdown”和“sudo chmod 744 ~/.qshutdown/qshutdown.conf”命令修改qshutdown.conf的权限后,用户将不能修改配置文件。
|
||||
|
||||
### Ubuntu中安装Qshutdown ###
|
||||
|
||||
打开终端,然后运行以下命令
|
||||
|
||||
sudo apt-get install qshutdown
|
||||
|
||||
### 屏幕截图 ###
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/11/12.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/11/23.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/11/31.png)
|
||||
|
||||
![](http://www.ubuntugeek.com/wp-content/uploads/2014/11/41.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.ubuntugeek.com/qshutdown-an-avanced-shutdown-tool.html
|
||||
|
||||
作者:[ruchi][a]
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.ubuntugeek.com/author/ubuntufix
|
65
translated/talk/20141108 When hackers grow old.md
Normal file
65
translated/talk/20141108 When hackers grow old.md
Normal file
@ -0,0 +1,65 @@
|
||||
黑客年暮
|
||||
================================================================================
|
||||
近来我一直在与某资深开源组织的各成员进行争斗,尽管密切关注我的人们会在读完本文后猜到是哪个组织,但我不会在这里说出这个组织的名字。
|
||||
|
||||
怎么让某些人进入 21 世纪就这么难呢?真是的...
|
||||
|
||||
我快56 岁了,也就是大部分年轻人会以为的我将时不时朝他们发出诸如“滚出我的草坪”之类歇斯底里咆哮的年龄。但事实并非如此 —— 我发现,尤其是在技术背景之下,我变得与我的年龄非常不相称。
|
||||
|
||||
在我这个年龄的大部分人确实变成了爱发牢骚、墨守成规的老顽固。并且,尴尬的是,偶尔我会成为那个打断谈话的人,然后提出在 1995 年(或者在某些特殊情况下,1985 年)时很适合的方法... 但十年后就不是个好方法了。
|
||||
|
||||
为什么是我?因为我的同龄人里大部分人在孩童时期都没有什么名气。任何想要改变自己的人,就必须成为他们中具有较高思想觉悟的佼佼者。即便如此,在与习惯做斗争的过程中,我也比实际上花费了更多的时间。
|
||||
|
||||
年轻人犯下无知的错误是可以被原谅的。他们还年轻。年轻意味着缺乏经验,缺乏经验通常会导致片面的判断。我很难原谅那些经历了足够多本该有经验的人,却被<em>长期的固化思维</em>蒙蔽,无法发觉近在咫尺的东西。
|
||||
|
||||
(补充一下:我真的不是老顽固。那些和我争论政治的,无论保守派还是非保守派都没有注意到这点,我觉得这颇有点嘲讽的意味。)
|
||||
|
||||
那么,现在我们来讨论下 GNU 更新日志文件这件事。在 1985 年的时候,这是一个不错的主意,甚至可以说是必须的。当时的想法是用单独的更新日志文件来记录相关文件的变更情况。用这种方式来对那些存在版本缺失或者非常原始的版本进行版本控制确实不错。当时我也在场,所以我知道这些。
|
||||
|
||||
不过即使到了 1995 年,甚至 21 世纪早期,许多版本控制系统仍然没有太大改进。也就是说,这些版本控制系统并非对批量文件的变化进行分组再保存到一条记录上,而是对每个变化的文件分别进行记录并保存到不同的地方。CVS,当时被广泛使用的版本控制系统,仅仅是模拟日志变更 —— 并且在这方面表现得很糟糕,导致大多数人不再依赖这个功能。即便如此,更新日志文件的出现依然是必要的。
|
||||
|
||||
但随后,版本控制系统 Subversion 于 2003 年发布 beta 版,并于 2004 年发布 1.0 正式版,Subversion 真正实现了更新日志记录功能,得到了人们的广泛认可。它与一年后兴起的分散式版本控制系统(Distributed Version Control System,DVCS)共同引发了主流世界的激烈争论。因为如果你在项目上同时使用了分散式版本控制与更新日志文件记录的功能,它们将会因为争夺相同元数据的控制权而产生不可预料的冲突。
|
||||
|
||||
另一种方法是对提交的评论日志进行授权。如果你这样做了,不久后你就会开始思忖为什么自己仍然对所有的日志更新条目进行记录。提交的元数据与变化的代码具有更好的相容性,毕竟这就是它当初设计的目的。
|
||||
|
||||
(现在,试想有这样一个项目,同样本着把项目做得最好的想法,但两拨人却做出了完全不同的选择。因此你必须同时阅读更新日志和评论日志以了解到底发生了什么。最好在矛盾激化前把问题解决....)
|
||||
|
||||
第三种办法是尝试同时使用两种方法 —— 以另一种格式再次提交评论数据,作为更新日志提交的一部分。这解决了所有你期待的有代表性的问题,并且没有任何缺陷遗留下来;只要其中有拷贝文件损坏,日志文件就会修改,因此这不再是同步时数据匹配的问题,而且导致在其后参与进来的人试图搞清人们是怎么想的时候将会变得非常困惑。
|
||||
|
||||
或者,如某个<em>我就不说出具体名字的特定项目</em>的高层开发只是通过电子邮件来完成这些,声明提交可以包含多个更新日志,以及提交的元数据与更新日志是无关的。这导致我们直到现在还得不断进行记录。
|
||||
|
||||
当我读到那条的时候我的眼光停在了那个地方。什么样的傻瓜才会没有意识到这是在自找麻烦 —— 事实上,针对更新日志文件采取的定制措施完全是不必要的,尤其是在分散式版本控制系统中
|
||||
有很好的浏览工具来阅读可靠的提交日志的时候。
|
||||
|
||||
唉,这是比较特殊的笨蛋:变老的并且思维僵化了的黑客。所有的合理化改革他都会极力反对。他所遵循的行事方法在十年前是有效的,但现在只能使得其反了。如果你试图解释不只是git的总摘要,还得正确掌握当前的各种工具才能完全弃用更新日志... 呵呵,准备好迎接无法忍受、无法想象的疯狂对话吧。
|
||||
|
||||
幸运的是这激怒了我。因为这点还有其他相关的胡言乱语使这个项目变成了很难完成的工作。而且,这类糟糕的事时常发生在年轻的开发者身上,这才是问题所在。相关 G+ 社群的数量已经达到了 4 位数,他们大部分都是孩子,他们也没有紧张起来。显然消息已经传到了外面;这个项目的开发者都是被莫名关注者的老牌黑客,同时还有很多对他们崇拜的人。
|
||||
|
||||
这件事给我的最大触动就是每当我要和这些老牌黑客较量时,我都会想:有一天我也会这样吗?或者更糟的是,我看到的只是如同镜子一般对我自己的真实写照,而我自己却浑然不觉吗?我的意思是,我的印象来自于他的网站,这个特殊的样本要比我年轻。通过十五年的仔细观察得出的结论。
|
||||
|
||||
我觉得思路很清晰。当我和那些比我聪明的人打交道时我不会受挫,我只会因为那些不能跟上我的人而
|
||||
沮丧,这些人也不能看见事实。但这种自信也许只是邓宁·克鲁格效应的消极影响,至少我明白这点。很少有什么事情会让我感到害怕;而这件事在让我害怕的事情名单上是名列前茅的。
|
||||
|
||||
另一件让人不安的事是当我逐渐变老的时候,这样的矛盾发生得越来越频繁。不知怎的,我希望我的黑客同行们能以更加优雅的姿态老去,即使身体老去也应该保持一颗年轻的心灵。有些人确实是这样;但可是绝大多数人都不是。真令人悲哀。
|
||||
|
||||
我不确定我的职业生涯会不会完美收场。假如我最后成功避免了思维僵化(注意我说的是假如),我想我一定知道其中的部分原因,但我不确定这种模式是否可以被复制 —— 为了达成目的也许得在你的头脑中发生一些复杂的化学反应。尽管如此,无论对错,请听听我给年轻黑客以及其他有志青年的建议。
|
||||
|
||||
你们 —— 对的,也包括你 —— 一定无法在你中年老年的时候保持不错的心灵,除非你能很好的控制这点。你必须不断地去磨练你的内心、在你还年轻的时候完成自己的种种心愿,你必须把这些行为养成一种习惯直到你老去。
|
||||
|
||||
有种说法是中年人锻炼身体的最佳时机是他进入中年的 30 年前。我以为同样的方法,坚持我以上所说的习惯能让你在 56 岁,甚至 65 岁的时候仍然保持灵活的头脑。挑战你的极限,使不断地挑战自己成为一种习惯。立刻离开安乐窝,由此当你以后真正需要它的时候你可以建立起自己的安乐窝。
|
||||
|
||||
你必须要清楚的了解这点;还有一个可选择的挑战是你选择一个可以实现的目标并且为了这个目标不断努力。这个月我要学习 Go 语言。不是指游戏,我早就玩儿过了(虽然玩儿的不是太好)。并不是因为工作需要,而是因为我觉得是时候来扩展下我自己了。
|
||||
|
||||
保持这个习惯。永远不要放弃。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://esr.ibiblio.org/?p=6485
|
||||
|
||||
作者:[Eric Raymond][a]
|
||||
译者:[Stevearzh](https://github.com/Stevearzh)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://esr.ibiblio.org/?author=2
|
66
translated/talk/20141127 What Makes a Good Programmer.md
Normal file
66
translated/talk/20141127 What Makes a Good Programmer.md
Normal file
@ -0,0 +1,66 @@
|
||||
什么造就一个优秀的程序员?
|
||||
|
||||
================================================================================
|
||||
是什么造成一个优秀的程序员?首先问问你自己吧,这会是个有趣的问题。它让你反思自己软件开发的能力。这个问题也适合问问你的同事。它可以带来一些关于如何协同工作的有趣讨论。下面是五个我认为成为一个优秀程序员必备的重要技能。
|
||||
|
||||
### 1. 分解问题 ###
|
||||
|
||||
编程是为了解决问题,但在你开始写代码前,需要明白如何解决问题。优秀程序员的一项技能是把大的问题逐层分解成一个个更小的部分,直到每一部分都可以很容易解决。但找到解决问题的方式往往并没有那么简单。优秀程序员能找到方法去建立问题模型,这种方法使得输出结果的程序容易解释、实现和测试。
|
||||
|
||||
我写过的某些最复杂的程序在局部上都是难懂的,因为代码实现并不能很好地描述问题,也就导致了编写的代码难以理解。当问题很好建模的时候,我赞同伯尼·科赛尔所说的话(取自著名的[程序员在工作][1]中的访谈记录):
|
||||
|
||||
> “……很少有本质上很难的程序。如果你盯着某一块代码,它看起来确实很难;如果你无法理解某件事情应该产生什么结果,这基本上就暗示这件事情很难思考清楚了。在这个时候,你不应该卷起袖子,尝试修复代码;你需要只是往回一步,再仔细考虑清楚。当你已经深思熟虑后,你会发现问题变得很简单”。
|
||||
|
||||
### 2. 场景分析 ###
|
||||
|
||||
优秀开发者能考虑到如何使程序适合多种不同的场景。这项能力既适用于处理程序本身的逻辑,又适用于处理发生的外部和内部事件。为了考虑逻辑上的不同思路,他们问自己这样的问题:如果这个参数为空会发生什么?如果所有条件都为假呢?这个方法在线程上是安全的吗?为了发现软件需要处理的各种类型的事件,他们问自己这样的问题:如果队列占满了会怎样?如果请求收不到响应会怎样?如果在这台服务器重启的同时另外一台服务器也重启了会怎样?
|
||||
|
||||
优秀程序员问他们自己:如何打破自己的程序?换句话说,他们有能力像测试人员一样思考。相反,缺少经验的程序员通常只考虑正确的路径——在一切都按照预期进行时正常的控制流(当然这也是程序在大部分时候做的事情)。当然,异常不可避免要发生,所以需要程序能处理这些情况。
|
||||
|
||||
### 3. 命名 ###
|
||||
|
||||
编程由大量的命名对象组成:类、方法和变量。当编码完成时,程序也具备了自我描述的能力,也就是说通过阅读源代码可以清楚地明白程序中函数的含义。自描述代码的一个好处就是很自然地产生许多体积更小的方法,而不是少数体积大的方法,因为你有更多空间去放置有意义的名字(还有[其它原因][2]解释为什么短小方法更好)。
|
||||
|
||||
想出好的名字比它听起来更困难一些。我喜欢这段引用(来自菲尔·卡尔顿):“在计算机科学领域只有两件困难的事情:缓存失效和命名对象。”命名在一定程度上很困难是因为你需要清楚地明白每一个名字究竟要代表什么。有时候命名不是清楚,只有随着软件开发进展才会慢慢显现。因此,重命名和命名一样重要。
|
||||
|
||||
命名对象也包含提出要用的概念和这些概念该如何称呼。通过深思熟虑,清楚命名所使用的惯用概念(在程序中和与程序员、非程序员讨论时使用),这使得编写程序变得更加容易。
|
||||
|
||||
### 4. 一致性 ###
|
||||
|
||||
也许编程中最大的挑战是管理复杂性。保持一致性是处理复杂性的一种方法。它通过允许我们看到对象命名、使用和处理所采用的模式和推理来降低了某些复杂性。有了一致性,我们就无需用脑袋去记住异常和随机变量。取而代之,我们可以更关注[程序本身的复杂性,而不是偶然产生的复杂性][3]。
|
||||
|
||||
保持一致性是很重要的。它应用在变量名字和分组、方法命名、模块划分、目录结构、GUI、错误处理、日志输出和文档等很多方面。比如,如果某些变量是的相关,并一起出现(在声明、方法调用或数据库中的列),而且总是以相同的顺序使用它们。那么当其中一个消失或者整体被打乱时,你就会很容易发现。对于一个操作,如果在一个地方叫delete,就不要在另一个地方叫remove:务必使用相同的名字。史蒂夫·麦克奈尔在[代码大全][4]中对于使用相反命名有相同的建议。比如,begin和end是相反的,就如同start和stop一样。当使用相反对时不要混用不同对的名字(比如使用begin和stop)。
|
||||
|
||||
当修改一段程序时可能会引入非一致性。粗心大意的程序员不会注意到他们添加的代码是否和已有的代码保持一致。优秀程序员会严苛地确保在这些看似很小的细节上都要做得恰到好处。他们知道保持一致性对于在软件开发的整个过程中处理复杂性是多么的重要。
|
||||
|
||||
### 5. 学习能力 ###
|
||||
|
||||
作为一名软件开发者,你需要持续学习。在为软件添加一项新功能前,你必须明白为什么要这么做。在给一个已有程序添加代码前,你通常必须学习已有代码在做什么,以便合适地嵌入新功能。你还需要学习相关系统,以便正确地与它们交互。因此,快速学习的能力使你成为一名更加高效的开发者。
|
||||
|
||||
而且,因为软件工程领域的开发速度是如此的快速,所以新的编程语言、工具、技术和框架需要学习层出不穷。这是好还是坏,就看你怎么看。佛瑞德·布鲁克斯把学习能力列为[技能的快乐之一][5],对此我深表赞同。学习新事物本身就是令人心满意足的,它也意味着开发者的生活从不无聊。
|
||||
|
||||
### 总结 ###
|
||||
|
||||
上面所有的技能都是通用的——它们中没有一项是针对某种语言、某个框架或某种技术。如果你拥有它们,你就能快速学习一门新的语言或工具,在新的环境下写出优秀的软件。而且,因为它们在本质上是通用的,所以不会在若干年以后变得不实用。
|
||||
|
||||
这就是我对什么因素造就一个优秀程序员的回答。你认为造就一个优秀程序员的因素是哪些?在评论里让我知道吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://henrikwarne.com/2014/06/30/what-makes-a-good-programmer/
|
||||
|
||||
作者:[Henrik Warne][a]
|
||||
译者:[KayGuoWhu](https://github.com/KayGuoWhu)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://henrikwarne.com/about/
|
||||
[1]:http://www.amazon.com/review/R2OV0TG7MJGXGL
|
||||
[2]:http://henrikwarne.com/2013/08/31/7-ways-more-methods-can-improve-your-program/
|
||||
[3]:http://faculty.salisbury.edu/~xswang/Research/Papers/SERelated/no-silver-bullet.pdf
|
||||
[4]:http://www.amazon.com/review/R269BBARXH1V6R/
|
||||
[5]:http://henrikwarne.com/2012/06/02/why-i-love-coding/
|
||||
|
||||
|
||||
|
@ -0,0 +1,75 @@
|
||||
安卓编年史
|
||||
================================================================================
|
||||
![新版安卓市场——黑色比重减少,白色和绿色增多。](http://cdn.arstechnica.net/wp-content/uploads/2013/12/marketab2.png)
|
||||
新版安卓市场——黑色比重减少,白色和绿色增多。
|
||||
Ron Amadeo供图
|
||||
|
||||
###安卓1.6,Donut——CDMA支持将安卓带给了各个运营商###
|
||||
|
||||
安卓的第四个版本——1.6,甜甜圈——在2009年9月发布,这时是在纸杯蛋糕面世的5个月后。尽管有无数更新,谷歌仍然在给安卓添加基本的功能。甜甜圈带来了对不同屏幕尺寸和CDMA的支持,还有一个文本语音转换引擎。
|
||||
|
||||
安卓1.6是个很好的更新例子,要在今天的话,它将没什么理由作为一个独立更新存在。主要的改进基本上可以总结为新版安卓市场,相机以及YouTube。从这一年起,像这样的应用已经从系统分离开来,并且谷歌任何时候都能升级它们。然而在完成所有的这些模块化功能工作之前,看起来甚至是一个微小的应用更新似乎都需要完整的系统更新。
|
||||
|
||||
另一个重大改进——CDMA支持——也表明了除了版本号之外,谷歌仍然在忙于将基本功能带到安卓上来。
|
||||
|
||||
安卓市场被标注为版本“1.6”,并且得到了一个彻底的改进。原本的全黑设计被抛弃,转向带有绿色高亮的白色应用设计——安卓的设计师很明显使用了安卓吉祥物来获得灵感。
|
||||
|
||||
新的市场对谷歌来说一定是个新的应用设计风格。屏幕顶部的五分之一用于显示横幅logo,表明了这个应用确实是“安卓市场”。在横幅之下是应用,游戏以及下载按钮,一个搜索按钮被安置在横幅的右侧。在导航键下面显示这特色应用的快照,可以在它们之间滑动。再下面是个垂直滚动列表,显示了更多的特色应用。
|
||||
|
||||
![新的市场设计,展示了:带有截图的应用页面,应用分类页面,应用榜,下载。](http://cdn.arstechnica.net/wp-content/uploads/2013/12/marketpages.png)
|
||||
新的市场设计,展示了:带有截图的应用页面,应用分类页面,应用榜,下载。
|
||||
Ron Amadeo供图
|
||||
|
||||
市场最大的新增内容是包含应用截图。安卓用户终于可以在安装之前看到应用长什么样子——之前他们只能看到简短的描述和用户评论。你的个人星级评价和评论被放在显著位置,随后是描述,最后是截图。查看截图常常需要一点点滚动来查看——如果你想要找个设计尚佳的应用,那可要费一番功夫了。
|
||||
|
||||
点击应用或游戏按钮会打开一个分类列表,就像你在上面第二张图看到的那样。选择一个类别之后,更多的导航显示在了屏幕顶部,用户可以看到“热门付费”,“热门免费”,或“热门新品”分类里看到各自的应用。尽管这些看起来像是会加载出新页面的按钮,实际上它们仅仅是个笨拙的标签页。每个按钮边有个绿色小灯指示现在哪个标签处于活跃状态。这个界面最赞的地方是应用列表是无穷滚动的(滚动加载)——一旦你到达列表底部的时候,它将加载更多应用。这个特性使得查看应用列表变得轻松,但是你点开任意一个应用再返回的话将会丢失你在列表里的位置——你得从头开始查看。下载部分可以做一些连新的Google Play商店都做不到的事:不过是显示一个已购买应用列表而已。
|
||||
|
||||
尽管新的市场看起来无疑比旧的好多了,但应用间的一致性更糟糕了。看起来就像是每个应用都是由不同团队制作的,但他们之间从没沟通过所有的安卓应用应该有的样子。
|
||||
|
||||
![相机取景窗,照片回看界面,菜单。](http://cdn.arstechnica.net/wp-content/uploads/2013/12/device-2013-12-27-145949.png)
|
||||
相机取景窗,照片回看界面,菜单。
|
||||
Ron Amadeo供图
|
||||
|
||||
举个例子,相机应用从全屏,最小化设计变成一个盒状的边缘带控制的取景窗。在相机应用中,谷歌着手引入拟物化,将应用包装成一个大致复刻皮革纹经典相机的样子。在相机和摄像机之间切换通过一个缺乏想象力的开关完成,下面是个触摸快门按钮。
|
||||
|
||||
点击最近照片快照不再会打开相册,但一个定制的照片查看器内建在了相机应用内。当你查看照片的时候,皮革质感的控制区从相机操作键变成图片操作键,你可以在这里删除,共享照片,或者把照片设置成壁纸或联系人图像。这里图片之间依然没有滑动操作——切换照片还是要通过照片两侧的箭头按钮完成。
|
||||
|
||||
第二张截图展示的是设计师减少对菜单按钮依赖的例子之一,因为安卓团队慢慢开始意识到其在可发现性上的糟糕表现。许多的应用设计者(包括那些在谷歌的)使用菜单作为所有种类的控制和导航元素的集中处。但大多数用户没想过点击菜单按钮,也从没看到这些指令。
|
||||
|
||||
未来版本的安卓的共有主题会将选项从菜单移到主要屏幕上,使得整个系统对用户更加友好。菜单按钮在安卓4.0中被完全移除,并且它只在传统应用中被支持。
|
||||
|
||||
![电池以及文本语音转换引擎设置。](http://cdn.arstechnica.net/wp-content/uploads/2013/12/settings1.png)
|
||||
电池以及文本语音转换引擎设置。
|
||||
Ron Amadeo供图
|
||||
|
||||
甜甜圈是第一个持续追踪电池使用量的安卓版本。在“关于手机”菜单里有个选项“电池使用”,它会以百分比的方式显示应用以及硬件功能的电池用量。点击一项会打开一个单独的相关状态页面。硬件项目有个按钮可以直接跳转到它们的设置界面,所以,举个例子,如果你觉得显示的电池用量太高你可以更改显示的屏幕超时。
|
||||
|
||||
安卓1.6同样是第一个支持文本语音转换引擎(TTS)的版本,这意味着系统以及应用能够用机器合成声音来回应你。“语音合成器”选项允许你设置语言,选择语速,以及从安卓市场安装语音数据(慎重)。今天,谷歌在安卓上部署它自己的TTS引擎,但是似乎甜甜圈是通过硬编码的方式使用了来自SVOX的TTS引擎。但SVOX的引擎并未部署在甜甜圈上,所以点击“安装语音数据”会链接到安卓市场的一个应用。(甜甜圈的全盛期几年后,这个应用已被撤下。看起来似乎安卓1.6再也不能说话了。)
|
||||
|
||||
![从左到右:新的小部件,搜索栏界面,新清除通知按钮,新相册控件。](http://cdn.arstechnica.net/wp-content/uploads/2013/12/grabbag16.png)
|
||||
从左到右:新的小部件,搜索栏界面,新清除通知按钮,新相册控件。
|
||||
Ron Amadeo供图
|
||||
|
||||
前端小部件部分花了更多的功夫。甜甜圈带来了全新的叫做“电量控制”小部件。它包含了常见耗电功能的开关:Wi-Fi,蓝牙,GPS,同步(同谷歌服务器之间),以及亮度。
|
||||
|
||||
搜索小部件同样经过了重新设计,变得更加纤细,并且内置了一个麦克风按钮用于语音搜索。它现在有了些实质界面并且够实时搜索,不仅仅是搜索互联网,还能搜索你的应用和历史。
|
||||
|
||||
“清除通知”按钮大幅缩水并且去掉了“通知”字样。在稍晚些的安卓后续版本总它还会缩减成仅仅是个方形按钮。相册继续遵循了把功能从菜单里拿出来的趋势,并且将它们放在用户面前——单张图片查看界面得到了“设置为”,“分享”,以及“删除”按钮。
|
||||
|
||||
----------
|
||||
|
||||
![Ron Amadeo](http://cdn.arstechnica.net/wp-content//uploads/authors/ron-amadeo-sq.jpg)
|
||||
|
||||
[Ron Amadeo][a] / Ron是Ars Technica的评论编缉,专注于安卓系统和谷歌产品。他总是在追寻新鲜事物,还喜欢拆解事物看看它们到底是怎么运作的。
|
||||
[@RonAmadeo][t]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://arstechnica.com/gadgets/2014/06/building-android-a-40000-word-history-of-googles-mobile-os/9/
|
||||
|
||||
译者:[alim0x](https://github.com/alim0x) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://arstechnica.com/author/ronamadeo
|
||||
[t]:https://twitter.com/RonAmadeo
|
@ -1,129 +0,0 @@
|
||||
用"Avconv"工具录制你的桌面视频和音频
|
||||
================================================================================
|
||||
**Libav**是一款跨平台的工具库,能够用来处理多媒体文件,流和协议,最初是fork自ffmpeg.Libav包含了子工具,比如:
|
||||
|
||||
- **Avplay**: 一款视频音频播放器.
|
||||
- **Avconv**: 能够记录多个设备输入源的一个多媒体转换器和视频音频录制器.
|
||||
- **Avprobe**: 一个连接多媒体文件流并且返回关于这个文件流的统计信息的工具.
|
||||
- **Libavfilter**:一个Libav工具的过滤器(filtering)API.
|
||||
|
||||
接下来,我们就要展示如何通过'Avconv'程序在**Debian/Ubuntu/Linux Mint**发行版上录制Linux桌面视频音频.
|
||||
### 步奏 1:下载 Avconv 工具 ###
|
||||
|
||||
**1.** **avconv**是 “**libav-tools**” 的一部分, 可以通过官方的基于debian的仓库下载,比如Mint,Ubuntu.输入下面命令即可:
|
||||
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install libav-tools
|
||||
|
||||
![Install Avconv Tool](http://www.tecmint.com/wp-content/uploads/2014/11/Install-avconv-tool.jpeg)
|
||||
|
||||
下载Avconv工具
|
||||
|
||||
**注意**: 如果从默认仓库下载的话 ‘**avconv**‘ 的版本可能比较老. 因此我们推荐你拉取最新的git官方版本.
|
||||
|
||||
$ sudo apt-get install yasm
|
||||
$ git clone git://git.libav.org/libav.git
|
||||
$ cd libav
|
||||
$ ./configure
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
||||
**注意**: 你必须运行 “**./configure –help**” 去列出所有的可选配置选项并且安装相应的解码器和库,你还需要做很多去下载依赖.
|
||||
同样注意,如果你是从源代码编译的,就需要使用**sudo avconv**而不是**avconv**来运行这个工具.
|
||||
|
||||
### 步奏 2:开启桌面录制 ###
|
||||
|
||||
**2.**你已经准备好了,现在可以通过运行下面的命令录制你的视频了:
|
||||
|
||||
$ avconv -f x11grab -r 25 -s 1920x1080 -i :0.0 -vcodec libx264 -threads 4 $HOME/output.avi
|
||||
|
||||
简单解释一下这个命令:
|
||||
|
||||
- **avconv -f x11grab** 默认从x服务捕捉画面.
|
||||
- **-r 25** 这是视频的帧率,可以自行设置.
|
||||
- **-s 1920×1080** 是你的画面分辨率,要设置成你当前画面的分辨率,这一点非常重要.
|
||||
- **-i :0.0** 记录的起点,设置成这样就可以了.
|
||||
- **-vcodec libx264** 我们用来录制视频的解码器.
|
||||
- **-threads 4**线程数, 可以根据情况更改.
|
||||
- **$HOME/output** 目标文件路径.
|
||||
- **.avi**视频格式,可以转换成 “flv”, “mp4″, “wmv”, “mov”, “mkv”.
|
||||
|
||||
**3.**在运行命令之后,录像机就会打开,并且在terminal上自动运行,按"Ctrl+C"建来终止.
|
||||
|
||||
![Record Desktop Screen](http://www.tecmint.com/wp-content/uploads/2014/11/Record-Desktop-Screen.jpeg)
|
||||
|
||||
录制桌面视频
|
||||
|
||||
**4.** 你可能需要使用VLC或者其他的播放器,或者你需要使用"avplay",这是一个Libav包里的播放器.
|
||||
|
||||
$ avplay $HOME/output.avi
|
||||
|
||||
**注意:** 别忘了替换输出文件的路径,录制效果还是很好的.
|
||||
|
||||
![Play Recorded Video](http://www.tecmint.com/wp-content/uploads/2014/11/Play-Recorded-Video.jpeg)
|
||||
|
||||
播放录制的文件
|
||||
|
||||
这有一段我用 “**avconv**” 录制的视频.
|
||||
|
||||
[视频地址](http://www.youtube.com/embed/g1FEh4wByGE)
|
||||
|
||||
<iframe width="640" height="380" frameborder="0" allowfullscreen="allowfullscreen" src="//www.youtube.com/embed/g1FEh4wByGE"></iframe>
|
||||
|
||||
### 步奏 3: 开始桌面音频和视频录制 ###
|
||||
|
||||
**5.** 如果想录制音频,先运行这个命令,列出所有的音频输入源:
|
||||
|
||||
$ arecord -l
|
||||
|
||||
如果结果是这样的
|
||||
|
||||
![Check Audio Input](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Audio-Input.png)
|
||||
|
||||
检查音频输入源
|
||||
|
||||
在我的例子中,我只有一个音频输入源,所以数量是**1**,这就是为什么我使用下面的命令来捕捉我的视频以及麦克风的音频了.
|
||||
|
||||
$ avconv -f alsa -i hw:1 -f x11grab -r 25 -s 1920x1080 -i :0.0 -vcodec libx264 -threads 4 output-file2.avi
|
||||
|
||||
看黄色的部分:那是我修改了的地方,下面做个简短的解释:
|
||||
- **-f** alsa 一个从alsa设备捕捉声音的选项.
|
||||
- **-i** hw:1 是一个从 “hw:1” 设备捕捉画面的选项,这个设备是我电脑上仅有的一个设备.
|
||||
|
||||
**注意**: 别忘了替换 “**1**”,如果你想用**arecord -l**显示的**1**之外的设备的话.
|
||||
|
||||
结束录制, 再来一次“**Ctrl + C**” 就可以.
|
||||
|
||||
### 步奏 4:开始桌面音频的录制 ###
|
||||
|
||||
**6.** 如果只想录制音频的话,使用下面的命令.
|
||||
|
||||
$ avconv -f alsa -i hw:1 out.wav
|
||||
|
||||
**7.** 替换成 **.mp3** Libav支持的格式都可以,播放 **out.wav**就能听到你自己的声音了
|
||||
|
||||
![Record Desktop Audio](http://www.tecmint.com/wp-content/uploads/2014/11/Record-Desktop-Audio.png)
|
||||
|
||||
录制桌面音频
|
||||
|
||||
###最后 ###
|
||||
|
||||
“**avconv**” 工具可以用来做很多其他事情,不仅仅是录制桌面视频,更多的教程和文档请移步到官网.
|
||||
|
||||
- [https://libav.org/avconv.html][1]
|
||||
|
||||
你对"avconv"的体验如何,你使用过其他工具录制桌面视频么?在评论里面和我们分享吧.
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/record-ubuntu-desktop-screen-using-avconv/
|
||||
|
||||
作者:[Hanny Helal][a]
|
||||
译者:[ggaaooppeenngg](https://github.com/ggaaooppeenngg)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/hannyhelal/
|
||||
[1]:https://libav.org/avconv.html
|
@ -0,0 +1,77 @@
|
||||
|
||||
如何从Ubuntu的声音菜单中移除音乐播放器
|
||||
================================================================================
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/music-players.jpg)
|
||||
|
||||
|
||||
**自从2010年的介绍一来,Ubuntu声音菜单已经被证明是最流行和个性的统一桌面之一.**
|
||||
|
||||
随着音乐播放器与音量程序合成小体积的应用程序-即集成,其中一个希望找到与声音相关的蠢事-通过标准接口的灵感。人们不禁要问,为什么其它操作系统没有效仿这种做法!
|
||||
|
||||
#### 冗长的 ####
|
||||
|
||||
|
||||
尽管它看起来很方便,但是这个小应用当前存在一个问题:相当多的东西集在一起看起来想一个MP3,是否真正的把想要的东西都放在里面了。虽然有用,但是一个无所不再的应用程序清单已经安装了,这让一些不经常适用的人看着很累赘和反感。
|
||||
|
||||
|
||||
我将要打赌上面的截图看起来一定很熟悉,你们中的很多人一定阅读过吧!不要害怕,**dconf-editor **就在这里。
|
||||
|
||||
|
||||
|
||||
### 从Ubuntu 声音菜单中移除播放器 ###
|
||||
|
||||
|
||||
#### 第一部分: 基础知识 ####
|
||||
|
||||
最快速和最简单地从声音菜单中移除播放器的方法就是卸载相关的应用程序。但这是极端的方式,我的意思是指你也许想要保留应用程序,但是不需要它集成。
|
||||
|
||||
只删除播放器但是保留我们需要的应用程序,我们用到一个看起来令人惊讶的工具叫“dconf-editor”.
|
||||
|
||||
你可能已经安装了,如果没有安装的话,那么你从Ubuntu软件中心找出。
|
||||
|
||||
|
||||
- [在Ubuntu中点击安装Dconf-Editor][1]
|
||||
|
||||
一旦安装完毕,找到Unity Dash并打开。打开的时候不要惊慌;你不会再回到2002年了,它确实是这样子的。
|
||||
|
||||
|
||||
使用右侧菜单栏,你需要从导航到 com > canonical > indicator > sound.下面的面板将会出现。
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/dconf-editor.jpg)
|
||||
|
||||
双击靠近interested-media-players的比括号并删除你希望从声音菜单里移除掉的播放器,但需要保留在方括号中,且不要删除任何你想保留逗号或者撇号。
|
||||
|
||||
|
||||
举个例子,我移除掉这些
|
||||
|
||||
‘**rhythmbox.desktop**’, ‘**pithos.desktop**’, ‘**clementine.desktop**’,
|
||||
|
||||
这样就好留了一行如下:
|
||||
|
||||
['tomahawk.desktop']
|
||||
|
||||
现在,当我再打开声音菜单时,我只看到Tomahawk:
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/11/music-players-2.jpg)
|
||||
|
||||
#### 第二部分:黑名单 ####
|
||||
|
||||
等等!还不能关闭dconf-editor。尽管上面的步骤看起来把事情处理得干净利落,但是一些播放器在打开时会立即重新加载到声音菜单。为了避免重复这个过程,将它们添加到**媒体播放器黑名单**中。
|
||||
|
||||
记得每个在撇括号里的播放器都用逗号分隔多个条目。他们也必须在方括号内,所以在退出之前请务必仔细检查。
|
||||
|
||||
最终结果如下:
|
||||
|
||||
![](http://www.omgubuntu.co.uk/wp-content/uploads/2014/10/from-to-.jpg)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.omgubuntu.co.uk/2014/11/remove-players-ubuntu-sound-menu
|
||||
|
||||
作者:[Joey-Elijah Sneddon][a]
|
||||
译者:[disylee](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]:apt://dconf-editor
|
@ -0,0 +1,266 @@
|
||||
15条Linux下的‘pwd’命令(打印工作目录)示例
|
||||
================================================================================
|
||||
对于那些使用Linux命令行的人来说,‘**pwd**‘命令是非常有用的,它告诉你你现在在那个目录,从根目录(**/**)开始。特别对于或许会在目录的切换间容易糊涂的Linux新手而言,‘**pwd**‘ 可以拯救他们。
|
||||
|
||||
![15 pwd Command Examples](http://www.tecmint.com/wp-content/uploads/2014/11/pwd-command.png)
|
||||
|
||||
15 pwd 命令示例
|
||||
|
||||
### 什么是pwd? ###
|
||||
|
||||
‘**pwd**‘ 代表的是‘**Print Working Directory**’(打印当前目录)。如它的名字那样,‘**pwd**’会打印出当前工作目录或仅是目录用户。它会打印出以root (**/**)为起始的完整目录名。这条命令是一条shell内建命令,并且在大多数shell中都可以使用,如bash、Bourne shell,ksh、zsh等等。
|
||||
|
||||
#### pwd的基本语法: ####
|
||||
|
||||
# pwd [OPTION]
|
||||
|
||||
#### pwd的选项 ####
|
||||
|
||||
<table border="0" cellspacing="0">
|
||||
<colgroup width="126"></colgroup>
|
||||
<colgroup width="450"></colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td height="21" align="LEFT" style="border: 1px solid #000000;"><b><span style="font-size: small;"> 选项</span></b></td>
|
||||
<td align="LEFT" style="border: 1px solid #000000;"><b><span style="font-size: small;"> 描述</span></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="19" align="LEFT" style="border: 1px solid #000000;"><span style="font-family: Liberation Serif,Times New Roman; font-size: small;"> -L (logical)</span></td>
|
||||
<td align="LEFT" style="border: 1px solid #000000;"><span style="font-family: Liberation Serif,Times New Roman; font-size: small;"> 使用环境中的路径,即使包含了符号链接</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="19" align="LEFT" style="border: 1px solid #000000;"><span style="font-family: Liberation Serif,Times New Roman; font-size: small;"> -P (physical)</span></td>
|
||||
<td align="LEFT" style="border: 1px solid #000000;"><span style="font-family: Liberation Serif,Times New Roman; font-size: small;"> 避免所有的符号链接</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="19" align="LEFT" style="border: 1px solid #000000;"><span style="font-family: Liberation Serif,Times New Roman; font-size: small;"> –help </span></td>
|
||||
<td align="LEFT" style="border: 1px solid #000000;"><span style="font-family: Liberation Serif,Times New Roman; font-size: small;"> 显示帮助并退出</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="19" align="LEFT" style="border: 1px solid #000000;"><span style="font-family: Liberation Serif,Times New Roman; font-size: small;"> –version</span></td>
|
||||
<td align="LEFT" style="border: 1px solid #000000;"><span style="font-family: Liberation Serif,Times New Roman; font-size: small;"> 输出版本信息并退出</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
如果同时使用了‘**-L**‘和‘**-P**‘,‘**-L**‘会有更高的优先级。如果没有指定参数,pwd会避开所有的软链接,也就是说会使用‘**-P**‘参数。
|
||||
|
||||
pwd的退出状态:
|
||||
|
||||
<table border="0" cellspacing="0">
|
||||
<colgroup width="128"></colgroup>
|
||||
<colgroup width="151"></colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td height="19" align="CENTER" style="border: 1px solid #000000;"><span style="font-size: small;">0</span></td>
|
||||
<td align="CENTER" style="border: 1px solid #000000;"><span style="font-size: small;">成功</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td height="19" align="CENTER" style="border: 1px solid #000000;"><span style="font-size: small;">Non-zero</span></td>
|
||||
<td align="CENTER" style="border: 1px solid #000000;"><span style="font-size: small;">失败</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
本篇的目的是采用例子让你对‘**pwd**‘有更深入的领悟。
|
||||
|
||||
**1.** 打印放钱工作目录.
|
||||
|
||||
avi@tecmint:~$ /bin/pwd
|
||||
|
||||
/home/avi
|
||||
|
||||
![Print Working Directory](http://www.tecmint.com/wp-content/uploads/2014/11/pwd.gif)
|
||||
|
||||
打印工作目录
|
||||
|
||||
**2.** 为文件夹创建一个符号链接(比如说在home目录下创建一个**htm**链接指向**/var/www/html**)。进入新创建的目录并打印出含有以及不含符号链接的目录。
|
||||
|
||||
在home目录下创建一个htm链接指向/var/www/html,并进入。
|
||||
|
||||
avi@tecmint:~$ ln -s /var/www/html/ htm
|
||||
avi@tecmint:~$ cd htm
|
||||
|
||||
![Create Symbolic Link](http://www.tecmint.com/wp-content/uploads/2014/11/Create-Symbolic-Link.gif)
|
||||
|
||||
创建符号链接
|
||||
|
||||
**3.** 从当前环境中答应目录即使它含有符号链接。
|
||||
|
||||
avi@tecmint:~$ /bin/pwd -L
|
||||
|
||||
/home/avi/htm
|
||||
|
||||
![Print Current Working Directory](http://www.tecmint.com/wp-content/uploads/2014/11/Print-Working-Directory.gif)
|
||||
|
||||
打印工作目录
|
||||
|
||||
**4.** 解析符号链接并打印出物理目录。
|
||||
|
||||
avi@tecmint:~$ /bin/pwd -P
|
||||
|
||||
/var/www/html
|
||||
|
||||
![Print Physical Working Directory](http://www.tecmint.com/wp-content/uploads/2014/11/Print-Physical-Working-Directory.gif)
|
||||
|
||||
打印物理工作目录
|
||||
|
||||
**5.** 查看一下“**pwd**”和“**pwd -P**”的输出是否一致,也就是说,如果没有跟上选项,“**pwd**”时候会自动采用**-P**选项。
|
||||
|
||||
avi@tecmint:~$ /bin/pwd
|
||||
|
||||
/var/www/html
|
||||
|
||||
![Check pwd Output](http://www.tecmint.com/wp-content/uploads/2014/11/Check-pwd-Output.gif)
|
||||
|
||||
检查pwd输出
|
||||
|
||||
**结论:** 上面例子4和5的输出很明显(结果相同),当你“**pwd**”后面不带参数时,pwd会使用“**-P**”选项。
|
||||
|
||||
**6.** 打印pwd命令的版本。
|
||||
|
||||
avi@tecmint:~$ /bin/pwd --version
|
||||
|
||||
pwd (GNU coreutils) 8.23
|
||||
Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law.
|
||||
|
||||
Written by Jim Meyering.
|
||||
|
||||
![Check pwd Version](http://www.tecmint.com/wp-content/uploads/2014/11/Check-pwd-Version.gif)
|
||||
|
||||
检查pwd命令版本
|
||||
|
||||
**注意:** ‘pwd’ 通常不带选项运行,且没有任何参数
|
||||
|
||||
**重要:** 你可能注意到我们刚才运行的都是 “**/bin/pwd**” 而不是 “**pwd**”。
|
||||
|
||||
这有什么区别呢?直接使用“**pwd**”意味着使用shell内置的pwd。你的shell可能有不同版本的pwd。具体请参考手册。当你使用的是**/bin/pwd**时,我们调用的是二进制版本的命令。虽然二进制的版本有更多的选项,但是它们两者都能打印当前的目录。
|
||||
|
||||
**7.** 打印所有含有可执行pwd的路径
|
||||
|
||||
avi@tecmint:~$ type -a pwd
|
||||
|
||||
pwd is a shell builtin
|
||||
pwd is /bin/pwd
|
||||
|
||||
![Print Executable Locations](http://www.tecmint.com/wp-content/uploads/2014/11/Print-Executable-Locations.gif)
|
||||
|
||||
打印可执行文件路径
|
||||
|
||||
**8.** 存储“**pwd**”命令的值到变量中(比如说:**a** ),并从中打印i变量的值(对于观察shell脚本很重要)。
|
||||
|
||||
avi@tecmint:~$ a=$(pwd)
|
||||
avi@tecmint:~$ echo "Current working directory is : $a"
|
||||
|
||||
Current working directory is : /home/avi
|
||||
|
||||
![Store Pwd Value in Variable](http://www.tecmint.com/wp-content/uploads/2014/11/Store-Pwd-Value-in-Variable.gif)
|
||||
|
||||
存储pwd的值到变量中。
|
||||
|
||||
下面的例子中也可以用**printf**来替代。
|
||||
|
||||
**9.** 将工作路径切换到其他地方(比如说 **/home**),并在命令行中显示。通过执行命令(比如说 ‘**ls**‘)来验证一切**OK**。
|
||||
|
||||
avi@tecmint:~$ cd /home
|
||||
avi@tecmint:~$ PS1='$pwd> ' [Notice single quotes in the example]
|
||||
> ls
|
||||
|
||||
![Change Current Working Directory](http://www.tecmint.com/wp-content/uploads/2014/11/Change-Current-Working-Directory.gif)
|
||||
|
||||
改变当前工作路径
|
||||
|
||||
**10.** 设置多行显示 (就像下面这样),
|
||||
|
||||
/home
|
||||
123#Hello#!
|
||||
|
||||
接着执行命令(比如说 **ls**)来检验一切**OK**。
|
||||
|
||||
avi@tecmint:~$ PS1='
|
||||
> $PWD
|
||||
$ 123#Hello#!
|
||||
$ '
|
||||
|
||||
/home
|
||||
123#Hello#!
|
||||
|
||||
![Set Multi Commandline Prompt](http://www.tecmint.com/wp-content/uploads/2014/11/Set-Multi-Commandline-Prompt.gif)
|
||||
|
||||
设置多行显示
|
||||
|
||||
**11.** 一下子检查当前工作路径以及先前的工作路径。
|
||||
|
||||
avi@tecmint:~$ echo “$PWD $OLDPWD”
|
||||
|
||||
/home /home/avi
|
||||
|
||||
![Check Present Previous Working Directory](http://www.tecmint.com/wp-content/uploads/2014/11/Check-Present-Previous-Working-Directory.gif)
|
||||
|
||||
Check Present Previous Working Directory
|
||||
检查当前工作路径
|
||||
|
||||
**12.** pwd文件的绝对路径(以**/**开始)。
|
||||
|
||||
/bin/pwd
|
||||
|
||||
**13.** pwd源文件文件的绝对路径(以**/**开始)。
|
||||
|
||||
/usr/include/pwd.h
|
||||
|
||||
**13.** 打印pwd手册的绝对路径(以**/**开始)。
|
||||
|
||||
/usr/share/man/man1/pwd.1.gz
|
||||
|
||||
**15.** 写一个shell脚本分析home目录下的一个目录(比如**tecmint**)。如果当前目录是**tecmint**就输出“**Well! You are in tecmint directory**”接着输出“**Good Bye**”,不然就在**tecmint**下面创建一个目录并提示你cd进入它。
|
||||
|
||||
让我们首先创建一个‘tecmint’目录,在下面创建一个名为‘pwd.sh’的脚本文件。
|
||||
|
||||
avi@tecmint:~$ mkdir tecmint
|
||||
avi@tecmint:~$ cd tecmint
|
||||
avi@tecmint:~$ nano pwd.sh
|
||||
|
||||
接下来在pwd.sh中加入下面的脚本。
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
x="$(pwd)"
|
||||
if [ "$x" == "/home/$USER/tecmint" ]
|
||||
then
|
||||
{
|
||||
echo "Well you are in tecmint directory"
|
||||
echo "Good Bye"
|
||||
}
|
||||
else
|
||||
{
|
||||
mkdir /home/$USER/tecmint
|
||||
echo "Created Directory tecmint you may now cd to it"
|
||||
}
|
||||
fi
|
||||
|
||||
给予他执行权限并运行。
|
||||
|
||||
avi@tecmint:~$ chmod 755 pwd.sh
|
||||
avi@tecmint:~$ ./pwd.sh
|
||||
|
||||
Well you are in tecmint directory
|
||||
Good Bye
|
||||
|
||||
#### 总结 ####
|
||||
|
||||
**pwd**是一个最简单且会广泛用到的命令。掌握好pwd是使用Linux终端的基础。就是这些了。我很快会再带来另外有趣的注意,请不要走开继续关注Tecmint。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/pwd-command-examples/
|
||||
|
||||
作者:[Avishek Kumar][a]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.tecmint.com/author/avishek/
|
@ -0,0 +1,110 @@
|
||||
用 Linux blkid 命令查找块设备详情
|
||||
================================================================================
|
||||
今天我们将会向你展示如何使用 **lsblk** 和 **blkid** 工具来查找关于块设备的信息,我们使用的是一台安装了 CentOS 7.0 的机器。
|
||||
|
||||
**lsblk** 是一个 Linux 工具,它会显示有关你系统里所有可用块设备的信息。它从 [sysfs 文件系统][1] 中获取信息。默认情况下,这个工具将会以树状格式显示(除了内存虚拟磁盘外的)所有块设备。
|
||||
|
||||
### lsblk 默认输出 ###
|
||||
|
||||
默认情况下 lsblk 会将块设备输出为树状格式:
|
||||
|
||||
**NAME**
|
||||
|
||||
—— 设备的名称
|
||||
|
||||
**MAJ:MIN**
|
||||
|
||||
—— Linux 操作系统中的每个设备都以一个文件表示,对块(磁盘)设备来说,这里用主次设备编号来描述设备。
|
||||
|
||||
**RM**
|
||||
|
||||
—— 可移动设备。如果这是一个可移动设备将显示 1,否则显示 0。
|
||||
|
||||
**TYPE**
|
||||
|
||||
—— 设备的类型
|
||||
|
||||
**MOUNTPOINT**
|
||||
|
||||
—— 设备挂载的位置
|
||||
|
||||
**RO**
|
||||
|
||||
—— 对于只读文件系统,这里会显示 1,否则显示 0。
|
||||
|
||||
**SIZE**
|
||||
|
||||
—— 设备的容量
|
||||
|
||||
![](http://blog.linoxide.com/wp-content/uploads/2014/10/lsblk.jpg)
|
||||
|
||||
### 显示设备的所有者 ###
|
||||
|
||||
若想显示设备所有者相关的信息,包括文件的所属用户、所属组以及文件系统挂载的模式,你可以使用 -m 选项,像这样:
|
||||
|
||||
lsblk -m
|
||||
|
||||
![](http://blog.linoxide.com/wp-content/uploads/2014/10/lsblk-m.jpg)
|
||||
|
||||
### 列出设备块 ###
|
||||
|
||||
如果你只想要列出设备,而不想让他们以树状输出,你可以使用 -l 选项:
|
||||
|
||||
lsblk -l
|
||||
|
||||
### 在脚本中使用 ###
|
||||
|
||||
高级技巧:如果你想要在脚本中使用而不希望表头被显示出来,你可以这样使用 -n 选项:
|
||||
|
||||
lsblk -ln
|
||||
|
||||
![](http://blog.linoxide.com/wp-content/uploads/2014/10/lsblk-ln.jpg)
|
||||
|
||||
**blkid** 命令是一个命令行工具,它可以显示关于可用块设备的信息。它可以识别一个块设备内容的类型(如文件系统、交换区)以及从内容的元数据(如卷标或 UUID 字段)中获取属性(如 tokens 和键值对)。它主要有两类作用:用指定的键值对搜索一个设备,或是显示一个或多个设备的键值对。
|
||||
|
||||
### blkid 使用方法 ###
|
||||
|
||||
不添加任何参数直接运行 blkid 将会输出所有可用的设备、它们的通用唯一识别码(UUID)、文件系统类型以及卷标(如果有设置过)。
|
||||
|
||||
# blkid
|
||||
|
||||
![](http://blog.linoxide.com/wp-content/uploads/2014/10/blkid.jpg)
|
||||
|
||||
### 根据名字或 UUID 列出设备 ###
|
||||
|
||||
如果你只想显示一个特定设备的信息,你可以将该设备的名字作为选项添加在 blkid 后面:
|
||||
|
||||
# blkid /dev/sda1
|
||||
|
||||
如果你知道一个设备的 UUID 而想要知道它的设备名,你可以用 -U 选项,像这样:
|
||||
|
||||
# blkid -U d3b1dcc2-e3b0-45b0-b703-d6d0d360e524
|
||||
|
||||
![](http://blog.linoxide.com/wp-content/uploads/2014/10/blkid-uuid.jpg)
|
||||
|
||||
### 详细信息 ###
|
||||
|
||||
如果你想要获取更多详细信息,你可以使用 -p 和 -o udev 选项来将它们用漂亮的格式显示出来,像这样:
|
||||
|
||||
# blkid -po udev /dev/sda1
|
||||
|
||||
![](http://blog.linoxide.com/wp-content/uploads/2014/10/blkid-po.jpg)
|
||||
|
||||
### 重置缓存 ###
|
||||
|
||||
有时候设备列表可能不会更新,如果遇到这种情况你可以使用 -g 选项来清理 blkid 的缓存,从而清除已经不存在的设备。
|
||||
|
||||
# blkid -g
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-command/linux-command-lsblk-blkid/
|
||||
|
||||
作者:[Adrian Dinu][a]
|
||||
译者:[felixonmars](https://github.com/felixonmars)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://linoxide.com/author/adriand/
|
||||
[1]:https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt
|
@ -0,0 +1,67 @@
|
||||
Linux 有问必答 -- 如何从VirtualBox中从主机访问NAT客户机
|
||||
================================================================================
|
||||
> **提问**: 我有一台运行在VirtualBox上的使用NAT的虚拟机。因此虚拟机会被VirtualBox分配一个私有IP地址(10.x.x.x)。如果我想要从主机SSH到虚拟机中,我该怎么做?
|
||||
|
||||
VirtualBox对虚拟机支持几种不同的网络方式,其中一种是NAT网络。当虚拟机启用NAT后,VirtualBox会自动在虚拟机和主机之间进行网络翻译,因此你不于必在虚拟机和主机之间配置任何东西。这也意味着NAT中的虚拟机对于外部网络以及主机本身是不可见的。这会在你想要从主机访问虚拟机时会产生问题(比如SSH)。
|
||||
|
||||
如果你想从VirtualBox的NAT环境的虚拟机,你可以在GUI或者命令行下启用VirtualBox NAT的端口转发。本篇教程将会演示**如何通过启用22端口转发而从主机SSH连接到NAT环境的客户机**。如果你先想要从HTTP访问NAT的客户机,用80端口代替22端口即可。
|
||||
|
||||
### 通过GUI配置VirtualBox端口转发 ###
|
||||
|
||||
在VirtualBox中选择你想要访问的虚拟机,打开虚拟机的“设置”。点击左侧的“网络”菜单,点击网络适配选项的“高级”。
|
||||
|
||||
![](https://farm8.staticflickr.com/7583/15797904856_2753dc785e_z.jpg)
|
||||
|
||||
点击“端口转发”按钮
|
||||
|
||||
![](https://farm8.staticflickr.com/7527/15636152708_cf2be7c7e8_z.jpg)
|
||||
|
||||
你会看到一个配置端口转发规则的窗口。点击右上角的“添加”图标。
|
||||
|
||||
![](https://farm8.staticflickr.com/7489/15636391217_48a9954480_z.jpg)
|
||||
|
||||
就会看到像下面那样的转发规则。
|
||||
|
||||
- **Name**: SSH (可以是任意唯一名)
|
||||
- **Protocol**: TCP
|
||||
- **Host IP**: 127.0.0.1
|
||||
- **Host Port**: 2222 (任何大于1024未使用的端口)
|
||||
- **Guest IP**: 虚拟机IP
|
||||
- **Guest Port**: 22 (SSH 端口)
|
||||
|
||||
![](https://farm6.staticflickr.com/5603/15202135853_02a07c3212_o.png)
|
||||
|
||||
端口转发的规则会自动在你启动虚拟机的时候启用。为了验证。可以在你启用虚拟机后检查端口2222是否被VirtualBox开启了。
|
||||
|
||||
$ sudo netstat -nap | grep 2222
|
||||
|
||||
![](https://farm8.staticflickr.com/7461/15819682411_6bb9707f8a_z.jpg)
|
||||
|
||||
现在端口转发可以使用了,你可以用下面的命令SSH到虚拟机。
|
||||
|
||||
$ ssh -p 2222 <login>@127.0.0.1
|
||||
|
||||
发送到127.0.0.1:2222的登录请求会自动被VirtualBox翻译成10.0.2.15:22,这可以让你SSH到虚拟机中。
|
||||
|
||||
### 通过命令行配置VirtualBox端口转发 ###
|
||||
|
||||
VirtualBox有一个称为VBoxManage的命令行管理工具。使用命令行工具,你也可以为你的虚拟机设置端口转发。
|
||||
|
||||
下面的命令会为IP地址为10.0.2.15的虚拟机设置一个名字为"centos7"的端口转发规则,SSH的端口号为22,映射到本地主机的端口为2222。规则的名字(本例中是SSH)必须是唯一的。
|
||||
|
||||
$ VBoxManage modifyvm "centos7" --natpf1 "SSH,tcp,127.0.0.1,2222,10.0.2.15,22"
|
||||
|
||||
规则创建之后,你可以用下面的命令来验证。
|
||||
|
||||
$ VBoxManage showvminfo "centos7" | grep NIC
|
||||
|
||||
![](https://farm8.staticflickr.com/7559/15636458427_7a0959900c_z.jpg)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/access-nat-guest-from-host-virtualbox.html
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -0,0 +1,39 @@
|
||||
Linux有问必答——如何修复“ImportError: No module named scapy.all”
|
||||
================================================================================
|
||||
> **问题**:当我运行一个Python应用程序时,出现了这个提示消息“ImportError: No module named scapy.all”。我怎样才能修复这个导入错误呢?
|
||||
|
||||
[Scapy][1]是一个用Python写的灵活包生成和嗅探程序。使用Scapy,你可以完成创建专有包,发送上线,从线上或转储文件中读取包,转换包等工作。使用Scapy的通用包处理能力,你可以很容易地完成像SYN扫描、TCP路由跟踪以及OS指纹打印之类的工作。你也可以通过导入,将Scapy整合到其它工具中。
|
||||
|
||||
该导入错误表明:你还没有在你的Linux系统上安装Scapy。下面介绍安装方法。
|
||||
### 安装Scapy到Debian, Ubuntu或Linux Mint ###
|
||||
|
||||
$ sudo apt-get install python-scapy
|
||||
|
||||
### 安装Scapy到Fedora或CentOS/RHEL ###
|
||||
|
||||
在CentOS/RHEL上,你首先需要[启用EPEL仓库][2]。
|
||||
|
||||
$ sudo yum install scapy
|
||||
|
||||
### 源码安装Scapy ###
|
||||
|
||||
如果你的Linux版本没有提供Scapy包,或者你想要试试最新的Scapy,你可以手工使用源码包安装。
|
||||
|
||||
下载[最新版的Scapy][3],然后按照以下步骤安装。
|
||||
|
||||
$ unzip scapy-latest.zip
|
||||
$ cd scapy-2.*
|
||||
$ sudo python setup.py install
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://ask.xmodulo.com/importerror-no-module-named-scapy-all.html
|
||||
|
||||
译者:[GOLinux](https://github.com/GOLinux)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.secdev.org/projects/scapy/
|
||||
[2]:http://xmodulo.com/how-to-set-up-epel-repository-on-centos.html
|
||||
[3]:http://scapy.net/
|
@ -0,0 +1,75 @@
|
||||
如何在 CentOS 7 上安装 Docker
|
||||
================================================================================
|
||||
Docker 是一个开源工具,它可以让创建和管理 **Linux 容器**变得简单。容器就像是轻量级的虚拟机,并且可以以毫秒级的速度来启动或停止。Docker 帮助系统管理员和程序员在容器中开发应用程序,并且可以扩展到成千上万的节点。
|
||||
|
||||
容器和 VM(虚拟机)的主要区别是,容器提供了**基于进程的隔离**,而虚拟机提供了资源的完全隔离。虚拟机可能需要一分钟来启动,而容器只需要一秒钟或更短。容器使用宿主操作系统的内核,而虚拟机使用独立的内核。
|
||||
|
||||
Docker 的局限性之一是,它只能用在 **64 位**的操作系统上。
|
||||
|
||||
在这篇文章中我们将讨论如何在 CentOS 7.x 中安装 docker。
|
||||
|
||||
### CentOS 7 中 Docker 的安装 ###
|
||||
|
||||
Docker 软件包已经包括在默认的 CentOS-Extras 软件源里。因此想要安装 docker,只需要运行下面的 yum 命令:
|
||||
|
||||
[root@localhost ~]# yum install docker
|
||||
|
||||
### 启动 Docker 服务 ###
|
||||
|
||||
安装完成后,使用下面的命令来启动 docker 服务,并将其设置为开机启动:
|
||||
|
||||
[root@localhost ~]# service docker start
|
||||
[root@localhost ~]# chkconfig docker on
|
||||
|
||||
**下载官方的 CentOS 镜像到本地**
|
||||
|
||||
[root@localhost ~]# docker pull centos
|
||||
Pulling repository centos
|
||||
192178b11d36: Download complete
|
||||
70441cac1ed5: Download complete
|
||||
ae0c2d0bdc10: Download complete
|
||||
511136ea3c5a: Download complete
|
||||
5b12ef8fd570: Download complete
|
||||
|
||||
**确认 CentOS 镜像已经被获取:**
|
||||
|
||||
[root@localhost ~]# docker images centos
|
||||
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
|
||||
centos centos5 192178b11d36 2 weeks ago 466.9 MB
|
||||
centos centos6 70441cac1ed5 2 weeks ago 215.8 MB
|
||||
centos centos7 ae0c2d0bdc10 2 weeks ago 224 MB
|
||||
centos latest ae0c2d0bdc10 2 weeks ago 224 MB
|
||||
|
||||
**运行一个 Docker 容器:**
|
||||
|
||||
[root@localhost ~]# docker run -i -t centos /bin/bash
|
||||
[root@dbf66395436d /]#
|
||||
|
||||
我们可以看到,CentOS 容器已经被启动,并且我们得到了 bash 提示符。在 docker 命令中我们使用了 “-i attach 标准输入输出”和 “-t 分配一个终端或控制台”选项。若要断开与容器的连接,输入 exit。
|
||||
|
||||
[root@cd05639b3f5c /]# cat /etc/redhat-release
|
||||
CentOS Linux release 7.0.1406 (Core)
|
||||
[root@cd05639b3f5c /]# exit
|
||||
exit
|
||||
[root@localhost ~]#
|
||||
|
||||
我们还可以搜索基于 Fedora 和 Ubuntu 操作系统的容器。
|
||||
|
||||
[root@localhost ~]# docker search ubuntu
|
||||
[root@localhost ~]# docker search fedora
|
||||
|
||||
**显示当前正在运行容器的列表**
|
||||
|
||||
![](http://www.linuxtechi.com/wp-content/uploads/2014/11/docker-ps.png)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linuxtechi.com/install-docker-on-centos-7/
|
||||
|
||||
作者:[Pradeep Kumar][a]
|
||||
译者:[felixonmars](https://github.com/felixonmars)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.linuxtechi.com/author/pradeep/
|
202
translated/tech/20141127 Some Sentences about Java.md
Normal file
202
translated/tech/20141127 Some Sentences about Java.md
Normal file
@ -0,0 +1,202 @@
|
||||
一些关于Java的句子
|
||||
================================================================================
|
||||
本文并没有什么新鲜的。我只是收集了一些不太重要的语句,
|
||||
但这些语句可能对初级程序员来说很重要。也就是些无聊的旧东西。
|
||||
|
||||
如果以下的这些你都知道的话,那么你比Java的了解已经超过了对一个平常的家庭主妇的了解。我不知
|
||||
道清楚所有的这些是否是有意义的。即使不知道其中的一些特性,你照样也可以成
|
||||
为一个相当不错的Java程序员。然而,本文中许多的新信息可能表明你还有很大
|
||||
的发展空间。
|
||||
|
||||
### Java中有四种不同的访问类型(而不是三种) ###
|
||||
|
||||
这四种类型包括:`private`, package private (包访问权限,无修饰符,又叫
|
||||
default, 译者注)。如果你在类中定义一个元素时并不加任何访问类型修饰符,
|
||||
它将被默认设置为包访问权限(package private),而不是`public`或者`protected`。
|
||||
|
||||
|
||||
![Java中有四种级别的访问类型](http://a3ab771892fd198a96736e50.javacodegeeks.netdna-cdn.com/wp-content/uploads/2014/11/four-levels-of-protection.png)
|
||||
|
||||
Java有四个级别的访问类型。
|
||||
|
||||
从另一方面来说,如果在接口中,你不指定方法的访问修饰符,那么它将是
|
||||
`public`类型的。你也可以显式地指定它为`public`类型, 但这并不符合SONAR
|
||||
(一个开源代码质量管理平台,译者注)的代码质量管理思想。
|
||||
|
||||
![访问类型是传递的](http://a3ab771892fd198a96736e50.javacodegeeks.netdna-cdn.com/wp-content/uploads/2014/11/protection-is-transitive.png)
|
||||
|
||||
访问类型是传递的
|
||||
|
||||
> 我的在Java中允许选择性的在接口的方法中写`public`的观点是一个技术错误。
|
||||
|
||||
同样你也可在接口的字段前写`final`,甚至是`static`。这说明这些字段可以
|
||||
是非静态或非final吗?不是的,接口中的字段中总是final和static的。
|
||||
|
||||
### Protected和package private是不一样的 ###
|
||||
|
||||
Package private(或者default)访问类型可以使得相同包(package)下其他类
|
||||
能够访问这些字段或方法。保护类型(`protected`)的方法和字段可以被相同包
|
||||
下的类使用(这和package private是一样的),同时它也可以被其他类使用,只
|
||||
要那个类继承了这个包含这些`protected`方法或字段的类。
|
||||
|
||||
### Protected是可传递的 ###
|
||||
|
||||
如果有三个包a、b、c,每个包都分别包含A、B、C类,而且B继承A,C继承B,那
|
||||
么C可以访问A中的protected字段和方法。
|
||||
|
||||
package a;
|
||||
|
||||
public class A {
|
||||
protected void a() {
|
||||
|
||||
}
|
||||
}
|
||||
package b;
|
||||
|
||||
import a.A;
|
||||
|
||||
public class B extends A {
|
||||
protected void b() {
|
||||
a();
|
||||
}
|
||||
}
|
||||
package c;
|
||||
|
||||
import b.B;
|
||||
|
||||
public class C extends B {
|
||||
protected void c() {
|
||||
a();
|
||||
}
|
||||
}
|
||||
|
||||
### 接口不能定义protected方法 ###
|
||||
|
||||
很多人认为可以在接口中定义`protected`方法。如果你这么做的话,编译器很
|
||||
快就会毫不留情地给你报错。顺便说下,这也就是我为什么认为允许`public`关键字在接口
|
||||
中是一个技术错误,它会让人觉得还可以写其他访问类型似的。
|
||||
|
||||
![Private is the new public](http://a3ab771892fd198a96736e50.javacodegeeks.netdna-cdn.com/wp-content/uploads/2014/11/private-is-the-new-public.png)
|
||||
|
||||
private是一种新的public
|
||||
|
||||
如果你还想在一个接口的方法中声明protected方法,你可能还不理解封装的含义。
|
||||
### 此private非彼private ###
|
||||
|
||||
私有变量和方法在编译单元内是可见的。如果这听起来太神秘的话,换种说法:几
|
||||
乎就是在同一个Java文件中。这比“在它们被定义的类中”听起来好理解些。它们在
|
||||
同一编译单元的类和接口中也是可见的。嵌套类可以看到类中封装的私有字段和
|
||||
方法。然而,当前封闭类也可以看到该类下任何深度下类中的私有方法和字段。
|
||||
|
||||
package a;
|
||||
|
||||
class Private {
|
||||
private class PrivateInPrivate {
|
||||
private Object object;
|
||||
}
|
||||
|
||||
Object m() {
|
||||
return new PrivateInPrivate().object;
|
||||
}
|
||||
}
|
||||
|
||||
后者并不广为人知,事实上也很少有用到。
|
||||
|
||||
### Private是类的访问级别而不是对象 ###
|
||||
|
||||
如果你可以访问一个变量或方法,那么不管它属于哪个对象你都可以访问它。如
|
||||
果`this.a`可以访问到,那`another.a`也可以访问到,只要它们是同一个类的
|
||||
实例。同一个类的实例对象可以随意调用其他实例的变量或方法。不过这样的代
|
||||
码一般都没有意义。现实生活中异常是`equals()`(由Eclipse生成, 15 - 18行):
|
||||
|
||||
package a;
|
||||
|
||||
public class PrivateIsClass {
|
||||
private Object object;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
PrivateIsClass other = (PrivateIsClass) obj;
|
||||
if (object == null) {
|
||||
if (other.object != null)
|
||||
return false;
|
||||
} else if (!object.equals(other.object))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
###静态(static)类可能有很多实例 ###
|
||||
|
||||
![Protection is not object level. It is class level.](http://a3ab771892fd198a96736e50.javacodegeeks.netdna-cdn.com/wp-content/uploads/2014/11/protection-is-class-feature.png)
|
||||
|
||||
访问类型不是对象级别的而是类级别的。
|
||||
|
||||
那些不支持有任何实例的类,通常被称为实用工具类。它们只包含静态字段和静
|
||||
态方法以及唯一的不被该类的任何静态方法调用的私有构造函数。在Java 8中也
|
||||
可以有这样的一个野兽(这个词翻译不通,译者注)在接口中实现,因为Java 8的
|
||||
接口可以有静态方法。我不觉得我们应该使用这个特性而不是实用工具类。我也
|
||||
不完全确信我们应该使用实用工具类。
|
||||
|
||||
静态类总是在另一个类或接口中。它们是嵌套类。他们是静态的,就像静态方法
|
||||
不能访问类的实例方法和字段一样,静态内部类也不能访问嵌入类的实例方法和
|
||||
字段。这是因为内部类没有嵌入类实例的引用(或者说是指针,如果你喜欢这么
|
||||
叫的话)。内部类(内部类,也即非静态嵌套类, 译者注),而非静态嵌套类, 没
|
||||
有嵌入类的一个实例,它是无法被创建的。每个内部类的实例都具有嵌入类实例
|
||||
的一个引用,因此一个内部类可以访问嵌入类的实例方法和字段。
|
||||
|
||||
因为这个原因,要是没有外部类的一个实例,你就不能创建一个内部类。当然,
|
||||
如果是当前对象,也就是`this`的话,你就可以不需要指定它。在这种情况下你
|
||||
可以使用`new`, 在这种情况下,也就是`this.new`的简式。在一个静态的环境中
|
||||
,例如从一个静态方法,你必须指定内部类应该创建哪个封闭类的实例。见第10
|
||||
行:
|
||||
|
||||
package a;
|
||||
|
||||
class Nesting {
|
||||
static class Nested {}
|
||||
class Inner {}
|
||||
void method(){
|
||||
Inner inner = new Inner();
|
||||
}
|
||||
static void staticMethod(){
|
||||
Inner inner = new Nesting().new Inner();
|
||||
}
|
||||
}
|
||||
|
||||
### 匿名类只能访问final变量 ###
|
||||
|
||||
![Variable has to be effective final](http://a3ab771892fd198a96736e50.javacodegeeks.netdna-cdn.com/wp-content/uploads/2014/11/effective-final.png)
|
||||
|
||||
变量必须是有效的final
|
||||
|
||||
当一个匿名类被定义在一个方法中,它可以访问局部变量如果该变量是`final`的
|
||||
。但这说的有点模糊。它们不得不声明成final,他们还必须是有效final。这也
|
||||
是Java 8中发布的一些特性。你不需要声明这些变量为`final`型,但它们仍然
|
||||
必须是有效的`final`。
|
||||
|
||||
![Java 8 does not require final, only effective final](http://a3ab771892fd198a96736e50.javacodegeeks.netdna-cdn.com/wp-content/uploads/2014/11/java_ee_-_javabeantester_src_main_java_com_javax0_jbt_blog_java_-_eclipse_-__users_verhasp_github_javax_blog.png)
|
||||
|
||||
Java 8并不要求`final`,只要求有效final.
|
||||
|
||||
为什么你需要对一些东西声明`final`,当它被检查必须是这样的。就像方法的参
|
||||
数。它们也必须是`final`的。你说这不是Java所必须的吗?嗯,你是对的。这只
|
||||
是一个良好的编程风格所必须的。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.javacodegeeks.com/2014/11/some-sentences-about-java.html
|
||||
|
||||
作者:[Peter Verhas][a]
|
||||
译者:[a598799539](https://github.com/a598799539)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://www.javacodegeeks.com/author/peter-verhas/
|
Loading…
Reference in New Issue
Block a user