Merge pull request #13 from LCTT/master

Update My Repository
This commit is contained in:
joeren
2014-06-23 08:42:18 +08:00
25 changed files with 1921 additions and 544 deletions

View File

@@ -1,10 +1,10 @@
使用`NginxApache`安装RainLoop Webmail(一个网页邮件客户端)
在Arch上使用Nginx/Apache安装RainLoop Webmail
================================================================================
Rainloop是一个使用PHP编写的开源免费的网页邮件客户端。他支持包括Google,Yahoo,OutLook在内的主流的邮件服务器当然他也支持你自己的本地邮件服务器。他主要的表现看起来像使用IMAP和SMTP协议的MUA(邮件客户端)。
Rainloop是一个使用PHP编写的开源免费的网页邮件客户端。他支持包括GoogleYahooOutLook在内的主流的邮件服务器当然他也支持你自己的本地邮件服务器。它看起来大致就像使用IMAP和SMTP协议的MUA(邮件客户端)一样
#### RainLoop 示例 ####
可以看一下作者编写的安装文档 [http://demo.rainloop.net/][1].
可以看一下RainLoop作者安装的演示页面 [http://demo.rainloop.net/][1]
![在Arch Linux上安装RainLoop](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux.jpg)
在Arch Linux上安装RainLoop
@@ -17,24 +17,28 @@ If you also need references on installing Rainloop on **Debian** and **Red Hat**
如果你还是需要一篇在**Debian** 和 **Red Hat** 安装 RainLoop Webmail 的教程,你可以看这篇文章:
- [Install RainLoop Webmail on Debian and Red Hat based Systems][2]
- [ Debian RedHat 系的 Linux 上安装 RainLoop Webmail][2]
以及在 **Ubuntu** 服务器中安装 RainLoop Webmail 的教程,你可以看这篇文章:
- [如何在 Ubuntu server 中设置 RainLoop Webmail][8]
### 系统要求 ###
#### 对 Nginx ####
- [Install LEMP (Nginx, PHP, MySQL with MariaDB engine and PhpMyAdmin) in Arch Linux][3]
- [Create Virtual Hosts in Nginx Web Server][4]
- [在 Arch Linux 上安装 LEMP (Nginx, PHP, MySQL/MariaDB PhpMyAdmin)][3]
- [在 Nginx 上创建虚拟主机][4]
#### 对 Apache ####
- [Install LAMP (Linux, Apache, MySQL/MariaDB, and PHP/PhpMyAdmin) in Arch Linux][5]
- [在 Arch Linux 上安装 LAMP (Linux, Apache, MySQL/MariaDB PHP/PhpMyAdmin)][5]
### Step 1: Nginx 或者 Apache 提供虚拟Host###
### Step 1: Nginx 或者 Apache 上创建虚拟主机###
**1.** 假设你已经配置您的服务器(**Nginx**或**Apache**如上面介绍的链接描述的,你需要做的第一件事是在Hosts文件里创建一个指向**的Arch Linux*系统的IP。
**1.** 假设你已经如上面介绍的链接所述,配置好了您的服务器(**Nginx**或**Apache**你需要做的第一件事是在Hosts文件里创建一个原始解析记录,以指向**的Arch Linux**系统的IP。
Linux系统修改 **/etc/hosts** 文件并且在你localhost下添加 Rainloop virtual 域。如下:
Linux系统修改 **/etc/hosts** 文件并且在你localhost条目之下添加 Rainloop 的虚拟域。如下:
127.0.0.1 localhost.localdomain localhost rainloop.lan
192.168.1.33 rainloop.lan
@@ -42,11 +46,11 @@ If you also need references on installing Rainloop on **Debian** and **Red Hat**
![Add Domain Host Entry](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-01.jpg)
添加域信息
对于Windows系统则修改 **C:\Windows\System32\drivers\etc\hosts** 并且将接下来的内容添加到你的文件里:
如果是Windows系统则修改 **C:\Windows\System32\drivers\etc\hosts** 并且将接下来的内容添加到你的文件里:
192.168.1.33 rainloop.lan
**2.** After you verify local domain using **ping** command, create the necessary **Virtual Hosts** and **SSL** configurations for **Apache** or **Nginx**.
**2.** 使用 **ping** 命令确认本地的 Rainloop 域名创建成功之后,然后在 **Apache** **Nginx** 中创建所需的 **虚拟主机** **SSL** 配置。
#### Nginx 虚拟主机 ####
@@ -141,10 +145,10 @@ If you also need references on installing Rainloop on **Debian** and **Red Hat**
$ sudo nginx_gen_ssl.sh
![Generate Certificate and Keys](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-04.jpg\)
![Generate Certificate and Keys](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-04.jpg)
生成证书和密钥
生成证书和SSL密钥后创建Rainloop**根**网络服务器的文件路径Rainloop PHP文件所在的位置然后启用虚拟主机并重新启动Nginx的守护进程应用配置。
生成证书和SSL密钥后创建Rainloop Web服务器**根**的文件路径Rainloop PHP文件所在的位置然后启用虚拟主机并重新启动Nginx的守护进程应用配置。
$ sudo mkdir -p /srv/www/rainloop
$ sudo n2ensite rainloop
@@ -232,7 +236,7 @@ If you also need references on installing Rainloop on **Debian** and **Red Hat**
输入组织信息
After the Certificate and SSL keys are created, add Rainloop **DocumentRoot** path, then enable Virtual Hosts and restart Apache daemon to apply configurations.
在证书和密钥建立之后,添加RainLoop **DocumentRoot**目录之后激活虚拟主机并且重启Apache应用设置。
在证书和密钥建立之后,创建 RainLoop **DocumentRoot** 所指向的目录之后激活虚拟主机并且重启Apache应用设置。
$ sudo mkdir -p /srv/www/rainloop
$ sudo a2ensite rainloop
@@ -244,11 +248,11 @@ After the Certificate and SSL keys are created, add Rainloop **DocumentRoot** pa
### Step 2: 添加必要的PHP支持 ###
**3.** 无论您使用的是**Apache**或**Nginx**Web服务器您需要激活**php.ini**文件下中的PHP扩展包括新的服务器**DocumentRoot**目录。
**3.** 无论您使用的是**Apache**或**Nginx**Web服务器您需要激活**php.ini**文件下中的PHP扩展并将新服务器**DocumentRoot**目录放到 open_basedir 配置中
$ sudo nano /etc/php/php.ini
找到并且取消如下的PHP扩展的注释
找到并且取消如下的PHP扩展的注释LCTT译注即启用这些模块
extension=iconv.so
extension=imap.so
@@ -258,12 +262,11 @@ After the Certificate and SSL keys are created, add Rainloop **DocumentRoot** pa
extension=openssl.so ( enables IMAPS and SMTP SSL protocols on mail servers)
extension=pdo_mysql.so
open_basedir语句应该看起来和这个一样。
open_basedir语句应该看起来类似如下:
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/:/srv/www/
**4.** After the **php.ini** file was modified restart your server than check **phpinfo** file to see if **SSL** protocols are enabled.
**4.** 在修改好**php.ini**之后,重启你得服务器,然后检查 **phpinfo** 文件,去看看**SSL**协议是否已经激活。
**4.** 在修改好**php.ini**之后,重启你的服务器,然后检查 **phpinfo()** 输出,去看看**SSL**协议是否已经激活。
----------对于 Apache Web 服务器----------
$ sudo systemctl restart httpd
@@ -275,22 +278,22 @@ open_basedir语句应该看起来和这个一样。
$ sudo systemctl restart php-fpm
![Check PHP Information](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-10.png)
Check PHP Information
查看 PHP 信息
### Step 3: 下载和安装 RainLoop Webmail ###
**5.**现在是时候从官方网站下载并解压缩Rainloop应用到文档根目录但是需要首先安装**wget的**和**unzip**程序。
**5.**现在可以从官方网站下载Rainloop应用并解压缩到文档根目录,但是需要首先安装**wget的**和**unzip**程序LCTT译注如果你已经有了可以忽略此步
$ sudo pacman -S unzip wget
**6.** 使用**wget**命令或通过使用浏览器导航到[http://rainloop.net/downloads/] [6]下载最新的源码包Rainloop zip归档
**6.** 使用**wget**命令或通过使用浏览器访问[http://rainloop.net/downloads/] [6]下载最新的源码包Rainloop 压缩包
$ wget http://repository.rainloop.net/v1/rainloop-latest.zip
![Download RainLoop Package](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-11.png)
下载 RainLoop 包
**7.** 下载过程完成后解压Rainloop归档到虚拟主机文档根目录路径( **/srv/www/rainloop/** )。
**7.** 下载过程完成后解压Rainloop压缩包到虚拟主机文档根目录路径( **/srv/www/rainloop/** )。
$ sudo unzip rainloop-latest.zip -d /srv/www/rainloop/
@@ -309,7 +312,7 @@ Check PHP Information
**9.** Rainloop应用程序可以通过两种方式进行配置使用浏览器或者系统shell。如果要在终端配置就打开和编辑位于**/ srv/www/rainloop/data/_data_da047852f16d2bc7352b24240a2f1599/_default_/configs/**的application.ini**文件。
**10.** 若要从浏览器访问管理界面使用下面的URL地址** https://rainloop.lan/?admin**,然后提供默认的应用程序用户名密码
**10.** 若要从浏览器访问管理界面使用下面的URL地址** https://rainloop.lan/?admin**,然后提供输入默认的应用程序用户名密码,如下:
User= admin
Password= 12345
@@ -317,7 +320,7 @@ Check PHP Information
![Rainloop Web Interface](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-14.png)
Rainloop Web 界面
**11.** 首次登录后,你被警更改默认密码,所以我劝你做这一点。
**11.** 首次登录后,你被警示需要更改默认密码,所以我劝你做这一点。
![Change Default Password](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-15.png)
修改默认 Password
@@ -325,7 +328,7 @@ Rainloop Web 界面
![Set New Admin Password](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-16.png)
设置新的 Admin Password
**12.** 如果您要启用**Contact**就登录到MySQL数据库并创建上有一个特权用户和一个新的数据库,然后提供**Contacts**字段数据库凭据
**12.** 如果您要启用**Contact**(联系人)功能就登录到MySQL数据库并创建一个新的数据库及其用户,然后提供**Contacts**字段里面输入数据库信息
mysql -u root -p
create database if not exists rainloop;
@@ -338,9 +341,9 @@ Rainloop Web 界面
在 RainLoop 中激活联系人
![Enter Contact Database Details](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-18.png)
添加联系人数据
添加联系人数据库配置
**13.** 默认情况下Rainloop提供** Gmail****Yahoo**和**Outlook**的邮件服务器的配置文件,但是你如果愿意,你也可以添加其他的邮件服务器域。
**13.** 默认情况下Rainloop提供** Gmail****Yahoo**和**Outlook**的邮件服务器的配置文件,但是你如果愿意,你也可以添加其他的邮件服务器域。
![Default Mail Domains](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-19.png)
默认 Mail 域
@@ -348,26 +351,26 @@ Rainloop Web 界面
![Add New Domain](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-20.png)
添加新域
**14.** 登录你的邮件服务器,浏览** https://rainloop.lan**,并提供您的域名服务器验证信息。
**14.** 登录你的邮件服务器,访问** https://rainloop.lan**,并提供您的域名服务器验证信息。
![Login to Mail Domain](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-21.png)
登录到邮件页面
登录到Yahoo邮件页面
![Login to Gmail Domain](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-22.png)
登录Gmail
![RainLoop Email Interface](http://www.tecmint.com/wp-content/uploads/2014/05/Install-RainLoop-in-Arch-Linux-23.png)
RainLoop Email 界面
RainLoop 登录后的Email 界面
想要了解更多的文件,可以访问:[http://rainloop.net/docs/][7].
通过Rainloop你可以从浏览器中访问具有Internet连接的任何邮件服务器。唯一的缺憾就是在Arch Linux下使用Rainloop应用的人缺乏修改电子邮件帐户密码的poppassd插件包。
通过Rainloop你可以从浏览器中访问具有Internet连接的任何邮件服务器。唯一的缺憾就是在Arch Linux下使用Rainloop应用的话,少一个修改电子邮件帐户密码的poppassd插件包。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/install-rainloop-webmail-in-arch-linux/
译者:[MikeCoder](https://github.com/MikeCoder) 校对:[校对者ID](https://github.com/校对者ID)
译者:[MikeCoder](https://github.com/MikeCoder) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
@@ -377,4 +380,5 @@ via: http://www.tecmint.com/install-rainloop-webmail-in-arch-linux/
[4]:http://www.tecmint.com/create-virtual-hosts-using-nginx-on-arch-linux/
[5]:http://www.tecmint.com/install-lamp-in-arch-linux/
[6]:http://rainloop.net/downloads/
[7]:http://rainloop.net/docs/
[7]:http://rainloop.net/docs/
[8]:http://linux.cn/article-2794-1.html

View File

@@ -0,0 +1,140 @@
如何在MacBook Pro Retina上安装Linux
================================================================================
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/linux-macbook-pro-retina-840x420.jpg?ec7b17)
MacBook Pros拥有非常强大的配置但是有些人想强上加强他们想用Linux系统。
不管您是想要更开放和个性化的操作系统又或者是您只想要使用某些在Linux特有的软件您都会想要在您的MacBook上安装Linux。 可惜的是MacBook Pro们可是一块块密不透风砖头让您想装其他系统又无从下手。尤其是Linux比在MacBook上装Windows还难。 Boot Camp对于Linux来说也没有什么用处。 虽然如此,但并不代表您完全不能做到,装机走起!
### 为什么要在MacBook Pro Retina上装Linux ###
买MacBook不就是为了OS X吗为何要装Linux 其实买MacBook的原因不仅仅只是因为它的操作系统 其极致的硬件性能,超长的电池寿命,以及抗操抗造都是购买它的原因。 这些这么好的硬件再加上一块能让您体验到HiDPI的清晰度Retina显示屏其不皆是买入的理由乎
但是如果您对OS X无爱又或者您真心想要使用Linux为何不将这自由、开源、小巧、个性化的Linux塞进您的高大上的硬件呢苹果可能有话要说了可谁在乎呢~
注:在本期教程我们将会使用[最流行的Linux发行版][1] - Ubuntu来作为我们这次安装的选择。您也可以用自己想用的的Linux发行版但相关的步骤会和本教程略有出入。 如果您把自己的系统玩坏了,我们将不承担任何责任。 本教程将教您如何 Linux 和 OS X 双系统启动另外只有在OS X才能升级固件所以我们建议您不要将OS X 删除。
但在我们开始之前请您用您喜欢的方法比如Time Machine 或 CrashPlan将您的电脑彻底备份以防万一。
### 下载 Ubuntu ###
首先您需要下载一份[Ubuntu桌面版安装镜像][2] 。 务必选择64位的桌面版虽然该镜像并不是为Mac提供的。该镜像在BIOS和EFI模式下都能启动而Mac的镜像却只能在BIOS启动。Mac是专门设计成这样的但是我们要使之以EFI模式下启动。
### 写到U盘USB ###
其次, 找个2GB以上的USB 我们将会用该USB作为Ubuntu的安装启动盘。 你可以按照 [Ubuntu官方指导的步骤][3] 或者 [使用专用的图形化工具][4] 来准备安装盘.
### 调整分区大小 ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_disk_utility.jpg?ec7b17)
当你完成上一步后你的Mac Book Pro就做好安装的准备了。 打开Disk Utility磁盘工具 点击左边选择你的硬盘, 选择Partitions分区标签页。 把Mac分区缩小到你喜欢的大小 - 我们将会用新创建的可用空间来安装Ubuntu。
### 启动Ubuntu镜像 ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_boot.jpg?ec7b17)
上述步骤完成后将U盘插入并重启Mac Book Pro。当关机之后屏幕一黑时请按住Option键alt直到你看到不同的启动选项。选择EFI选项如果有两个的话选择左边的哪一个来从USB启动Ubuntu.
当你看到“Try Ubuntu" 和 "Install Ubuntu" 两个选项的时候, 选择 "Try Ubuntu" 因为我们需要在安装完成之后重启之前弄一些其他的东西。
### 安装器 ###
当Ubuntu的桌面加载好之后一路向下走直到你看到分区的这一步。 如果你连接不上WiFi的话就代表你的Ubuntu还暂时不知道如何跟你这位高大上Mac做朋友 不过不用担心, 我们暂时还不需要网络, 在你迟些重启的时候会自动识别你的驱动。
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_installer_partitions.jpg?ec7b17)
到分区这个步骤之后, 选择 "Do Something else" 这个选项。 然后请确保那块大约128MB左右的分区已经被识别为EFI启动分区你可以点击它然后选择Option来确定一下 另外,那个分区应该是 /dev/sda1。下一步 你要在新建的空间里创建一个 ext4分区在其上挂载“/”路径。 如果你知道你自己在干嘛的话也可以创建几个不同的分区切记这不是Windows啊孩纸
在你开始下一步之前请确保你的安装引导程序boot loader是选择了 /dev/sda1GRUB也是装到该分区的。 然后按照平常一样该咋装咋装。
### 修改 EFI 引导 ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_efibootmgr.jpg?ec7b17)
当你的安装器装完Ubuntu之后不要按重启 我们还需要弄这么点东西才能使用GRUB。 请运行下列的指令:
sudo apt-get install efibootmgr
这个将会暂时地安装一个EFI boot的配置工具然后 运行:
sudo efibootmgr
这个将会显示出当前的启动设置, 你应该看到的是 "ubuntu" 和 "Boot0000*"当前的EFI设置是把系统指向 Boot0080*这样的话就会跳过GRUB然后直接跳入OS X所以我们要用以下指令来修复它
sudo efibootmgr -o 0,80
现在就可以重启了!
恭喜你啦~你的Ubuntu现在应该就可以用了哦不过下列的一些调整会让性能提升哦
### 坑爹地调整设置 ###
首先你需要改一下GRUB的设置这样你的SSD盘才不会偶尔死机 在Terminal输入
sudo nano /etc/default/grub
找到 **GRUB\_CMDLINE\_LINUX**那一行 把它改成 **GRUB\_CMDLINE\_LINUX="libata.force=noncq"** 。 按下CTRL + X保存然后按Y来确定保存。 接下来你要在Terminal输入
sudo nano /etc/grub.d/40_custom
打开一个新的文件,请使用真丶精准手指准确地一字一字输入:
menuentry "Mac OS X" {
exit
}
这将会让你boot到你安装好的Mac OS XGRUB的32-bit和64-bit项不能用。然后CTRL+X 和 Y 保存退出,然后输入:
sudo update-grub
最后必须要重启才能生效。
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_small_retina.jpg?ec7b17)
在极其高清的Retina显示屏上神马都这么小坑爹啊啊 去Setting -> Display 里把 Scaling Factor弄大一点吧不然妈妈又要担心你的近视眼了。
你也可能觉得在边边上改变窗口大小是一件极其困难的事情,坑爹啊啊? 去Terminal输入
sudo nano /usr/share/themes/Ambiance/metacity-1/metacity-theme-1.xml
然后在里面修改成下面的参数:
<distance name="left_width" value="4"/>
<distance name="right_width" value="4"/>
<distance name="bottom_height" value="4"/>
如果还是太小把上面的东西改成6吧
最后如果你觉得你的Linux把你那Retina鲜艳的颜色洗掉了请到你的OS X盘找到以下的文件
/Library/ColorSync/Profiles/Displays/Color LCD-xxxxxx.icc
xxxxxx只是一串随机的字符不过这路径应该只有一个文件。把他搬到你Ubuntu的Home folder 然后到 System Settings > Color 选择 Add New Profile 并选择你那刚弄过来的icc文件。
### 总结 ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_final.jpg?ec7b17)
恭喜你啦, 现在终于有一台属于你的Linux MacBook Pro Retina啦如果你想把你的Ubuntu弄得更手熟请按 [让你的Ubuntu 像家一样舒服][5] 尽情地修改配置吧! 该教程也可用于其他的Mac系统当然每种Mac都有不同的好处和坏处。 如果你用的是其他的Mac请翻一翻[这篇为Ubuntu写的文档][6]
另外你还可以看一下其他可以在Mac安装的[Linux 发行包][7]哦!
Image Credits: [K?rlis Dambr?ns][8] Via Flickr
--------------------------------------------------------------------------------
via: http://www.makeuseof.com/tag/install-linux-macbook-pro/
译者:[213edu](https://github.com/213edu) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.makeuseof.com/tag/windows-xp-users-switch-ubuntu-14-04-lts-trusty-tahr/
[2]:http://www.ubuntu.com/download/desktop/
[3]:http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx
[4]:http://www.makeuseof.com/tag/how-to-boot-a-linux-live-usb-stick-on-your-mac/
[5]:http://www.makeuseof.com/tag/11-tweaks-perform-ubuntu-installation/
[6]:https://help.ubuntu.com/community/MacBookPro
[7]:http://www.makeuseof.com/pages/best-linux-distributions
[8]:https://www.flickr.com/photos/janitors/10037346335

View File

@@ -0,0 +1,135 @@
在linux桌面上观看2014年巴西世界杯比赛
================================================================================
足球是世界上受众最广和观众最多的运动现代足球起源于英国。足球运动员平均每场比赛要跑6个多英里。上届南非世界杯有近10亿的电视观众而今年的的观赛数量预计还要增加。
2014年第20界世界杯在巴西举行时间安排为从6月12号开始持续到7月13号共有32个国家参加这项赛事。
爱足球的小伙子们我们将要介绍一款可以提供最新的赛况以及你喜欢的球队的进球数信息的应用程序它叫做“icup 2014 Brazil”。下面让我们介绍它的特点用法和安装等。
![iCup 2014 Brazil](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014.jpeg)
*iCup 2014 Brazil*
### 什么是“icup 2014 Brazil” ###
“icup 2014 Brazil”简单的说是一个应用程序在linux桌面为你提供2014年世界杯的最新比赛赛况。
### “icup 2014 Brazil”的特点###
- 自适应的用户界面,比如自动缩放
- 迅速查看战绩
- 支持Facebook、twitter和Google+社交分享功能
- 支持Retina显示输出
- 实时跟踪比赛结果
- 包括32个国家的国歌小工具配合露天广场效果很不错
- 内置日历和时区工具,实时的显示当天数据,图像化展示最新的战况和得分
- 支持代理
### 平台和框架支持 ###
这款软件可以运行在Mac、windows和linux上特别提醒在Linux上它是为x86的CPU设计的虽然它也可以在x64的平台上安装不过我们需要做一下设置。
#### 在不同平台的技术规范 ####
- 实时结果,日历,数据分组,第二阶段整合,社交网络连接和多语言支持,这些支持全平台
- Retina显示支持这个不支持windows和linux仅支持Mac OS
- 详细的统计-支持linux。在windows和Mac需要捐赠才行
- 声音小工具-支持MAC和linuxwindows不确定
**重要**: 上面的特点都支持一些具体的特性除了linux外都不是免费提供的这是为了支付服务器和带宽费用。对于linux用户来说任何细节不需要关心高兴的用去吧。
### Linux下安装“icup 2014 Brazil” ###
首先去[“icup 2014 Brazil”官方下载页面][1]下载你电脑平台的软件版本
#### 32位下的安装步骤 ####
# cd Downloads/
# tar xvf iCup_2014_FREE-Brazil_1.1_linux.tar.bz2
# cd iCup\ 2014\ FREE\ -\ Brazil\ 1.1/
# chmod 755 iCup\ 2014\ FREE\ -\ Brazil
如上文所说这个应用程序只为X86架构设计为了在64位架构下安装32位的软件我们需要在系统上安装一些软件包**GTK+2**和**libstdc++.so.6**。
不只是这款软件一大堆Linux下的软件不支持64位架构例如**Skype**,我们也需要这样调整我们的系统来安装这些软件。
#### 在64位系统下 ####
安装**GTK+2**和**libstdc++so.6**用如下apt或者yum命令
$ sudo apt-get install libgtk2.0-0 libstdc++6 [在基于Debian系统上执行这个命令]
如果有报错的话,运行下面的命令来解决
$ sudo apt-get -f install
----------
# yum install gtk2 libstdc++ [在基于Redhat系统上执行这个命令]
需要的软件包安装完后就可以在64位系统下安装32位的软件了进入你的下载目录找到“**icup 2014 Brazil**”安装包然后执行下面的命令
# cd Downloads/
# tar xvf iCup_2014_FREE-Brazil_1.1_linux.tar.bz2
# cd iCup\ 2014\ FREE\ -\ Brazil\ 1.1/
# chmod 755 iCup\ 2014\ FREE\ -\ Brazil
然后,进入软件所在目录,双击可执行文件启动软件。下面的截屏图中看不到所有的信息,**因为本文写作时2014年世界杯现在还没开始呢开始后我们就能看到结果了**。
![iCup Brazil 2014](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-01-620x437.jpeg)
iCup Brazil 2014
无具体信息,世界杯尚未开始。
![Match Detailed Information](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-02-620x439.jpeg)
Match Detailed Information
分组和队伍
![Groups and Teams](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-03-620x439.jpeg)
Groups and Teams
第二阶段详细信息
![2nd stage Detailed Information](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-04-620x438.jpeg)
2nd stage Detailed Information
比赛细节,尚未完整
![Match Summary](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-05-620x440.jpeg)
Match Summary
集成语言切换和社交分享按钮
![Language Change](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-06-620x440.jpeg)
Language Change
Linux上捐赠是可选的你可以贡献你的心意。
![Donation](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-07-620x435.jpeg)
Donation
### 总结 ###
上面的这个软件有望成为足球粉丝的一大福利,赶快在线试用吧。
好了我马上又有一个有趣的文章了。请保持关注Tecmint.com。请在评论区对我们的工作给予反馈。
--------------------------------------------------------------------------------
via: http://www.tecmint.com/view-fifa-world-cup-matche-results/
译者:[jiajia9linuxer](https://github.com/jiajia9linuxer) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.e-link.it/icup/brazil2014/icup-brazil-2014-desktop-app.php

View File

@@ -0,0 +1,33 @@
在Linux上用iCup追世界杯
================================================================================
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/06/icup2014-790x389.png)
Linux 极客们,
在本文简短的叙述中我将教您如何在Linux中安装一个非常棒的2014FIFA世界杯APP。这个应用叫iCup支持WindowsMac以及伟大的Linux。
我看足球比赛已经有很长的时间了所以我得在我的电脑上装个这样的应用来保持更新2014世界杯的最新情况。我可不想在我朋友们面前看起来像一无所知的笨货。iCup应用正好提供了每一场赛程、比分、球队教练组等信息。更有提供实时比赛更新给您提供 正在进行的比赛的最新数据。
### 支持以下功能: ###
- 30种语言支持完全本地化使用语言菜单选择
- 独家的灵活界面可随意调整窗口大小
- 可按日期或阶段检索比赛日历
- 可视化分组
- 支持自动转变比赛时间来适应本地时间和格式
- 一键化社交网络发表比赛评论支持FacebookGoogle+和Twitter
- 支持代理(支持基本认证和摘要认证方法)
我已经在Ubuntu12.04LTS上用过而且真的很好用!目前为止,这款软件还没有出错或者崩溃过。通过[官方网站][1]您可以下载到压缩包并且十分轻松地安装这个很棒的应用然后您可以解压到任何您喜欢的地方。解压完成后双击iCup 2014 FREE- Brazil运行。
iCup真心好用我希望您也能用其享受世界杯
--------------------------------------------------------------------------------
via: http://www.unixmen.com/install-icup-2014-linux/
译者:[Vic020](http://www.vicyu.net) 校对:[213edu](http://ryanhu.me/)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.e-link.it/icup/brazil2014/icup-brazil-2014-desktop-app.php

View File

@@ -1,16 +1,17 @@
用笔记本模式工具1.65来延长电池续航
用笔记本模式工具1.65来延长电池续航能力
================================================================================
![](http://i1-news.softpedia-static.com/images/news2/Improve-Battery-Life-with-Laptop-Mode-Tools-1-65-447397-2.jpg)
笔记本模式工具是一个Liunx电工具包它可以让用户以多种方式延长笔记本电池续航现在它已经升级到1.65。
笔记本模式工具是一个Liunx电源管理工具包,它可以让用户以多种方式延长笔记本电池续航能力现在它已经升级到1.65。
笔记本模式工具的版本曾经很少而且间隔很长,但开发者在最新的版本中做了一些很有意思的改变,虽然此次更新与以前不同。
笔记本模式工具的发布的版本曾经很少而且间隔很长,但开发者在最新的版本中做了一些很有意思的改变,虽然此次更新与以前不同。
根据更新日志grep找不到$device/uevent的错误已得到修复、 sysfs/enabled已被"ip link down"所取代、 添加了对iwlwifi的支持运行时电源管理框架现在更健壮并且usb-autosuspend模块已被去除。
此外,当笔记本电脑恢复时,笔记本模式工具将强制以初始化模式运行,最新版本已添加英特尔 PState 驱动程序的模块,并已实现挂起/休眠接口。
用户不须更改自动设置。更改自动设置可能会导致更多的问题但一般准期望他们总是要打开。此外,要注意到每个功能所做的因为你可能会搞出更多问题。
用户不须更改自动设置。更改自动设置可能会导致更多的问题,但通常看来他们总是会去动它。此外,要注意到每个功能究竟是做什么的,否则你可能会搞出更多问题。
看官方[公告][1]来了解更多细节。
@@ -22,7 +23,7 @@
via: http://news.softpedia.com/news/Improve-Battery-Life-with-Laptop-Mode-Tools-1-65-447397.shtml
译者:[2q1w2007](https://github.com/2q1w2007) 校对:[校对者ID](https://github.com/校对者ID)
译者:[2q1w2007](https://github.com/2q1w2007) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@@ -0,0 +1,31 @@
红帽携手eNovance共进OpenStack市场
================================================================================
![](http://farm4.static.flickr.com/3108/3191608123_67e1da2b79_o.jpg)
正在OpenStack峰会于亚特兰大举办的同时红帽确认了数项与OpenStack相关的项目。其中一项是红帽正与开源云计算市场的领导者eNovance进行[合作][1] 。双方将推动网络功能虚拟化Network Functions Virtualization及将电信功能融入OpenStack中。红帽[宣布][2]将以七千万欧元或九千五百万美金的现金和股票投资eNovance。
eNovance 是OpenStack市场上重要的角色 特别以其和电信公司的合作而为人所知。eNovance帮助服务提供商和大型私企搭建部署云基础架构快速且成本低廉。这也将为红帽开创新的产品线。
IDC 分析员 Laura DuBois 和 Ashish Nadkarni 在2014春季OpenStack 峰会上指出 “像eNovance这样的集成商将继续助力云服务提供商和企业建立OpenStack云。OpenStack的前景开起来十分光明。"
eNovance 是OpenStack十大上游贡献者之一, 也是OpenStack 基金唯一的欧洲金牌合作商。 该公司在全球有超过150家客户包括 Alcatel-Lucent、 AXA,、 Cisco、 Cloudwatt 和 Ericsson. 在巴黎、蒙特利尔、班加罗尔、印度,都设有办公室。
2013年红帽和 eNovance 第一次展开[合作][3] 为其共同客户提供OpenStack 部署和集成服务。该服务基于Red Hat Enterprise Linux OpenStack 平台。 今年五月的OpenStack峰会上, 两家公司宣布了[进一步的合作][4] ,推动网络功能虚拟(NFV) 和电信在OpenStack上的创新意在提供业界最完整、电信级的 通讯服务基于Linux、内核级虚拟机 (KVM)和 OpenStack。
eNovance的联合创始人、首席执行官Raphaël Ferreira 在声明中说:
> “和红帽一样eNovance也认为部署和集成OpenStack已成趋势这是企业市场上的变革力量。 我们非常高兴能成为红帽的一部分。红帽不仅仅提供一流的OpenStack发行版本也和我们一样坚信 最好以连续、无缝的方式部署、集成OpenStack。”
--------------------------------------------------------------------------------
via: http://ostatic.com/blog/red-hat-to-acquire-enovance-focus-together-on-openstack
译者:[tengpeng](https://github.com/tengpeng) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.redhat.com/about/news/press-archive/2014/5/red-hat-and-enovance-to-deliver-carrier-grade-openstack
[2]:http://www.marketwatch.com/story/red-hat-to-acquire-enovance-a-leader-in-openstack-integration-services-2014-06-18
[3]:http://cts.businesswire.com/ct/CT?id=smartlink&url=http%3A%2F%2Fwww.redhat.com%2Fabout%2Fnews%2Fpress-archive%2F2013%2F11%2Fred-hat-and-enovance-partner-to-accelerate-adoption-of-red-hat-enterprise-linux-openstack-platform&esheet=50888828&newsitemid=20140618005543&lan=en-US&anchor=first+partnered+in+2013&index=1&md5=1721061ca22652d2a4413085db70361b
[4]:http://cts.businesswire.com/ct/CT?id=smartlink&ppppppppt-pt-lopppppppppptpt-lpt-pt-locapt-pt-ptptppptppppt-ptptptppp

View File

@@ -0,0 +1,34 @@
X 窗口系统已经30岁了
================================================================================
X.org基金会很自豪地宣布一个特别的日子30年前1984年六月19日Bob Scheifler发布了X窗口系统。
有关X窗口系统的介绍参见 [https://en.wikipedia.org/wiki/X11#Introduction][1]
在这30年中X作为UNIX桌面无处不在。在今天数以百万计的用户使用着桌面环境如GNOMEKDEXfceUnityEnlightenment等等而这些都使用X作为其底层技术。
X的开发者们做出了巨大的突破把X从原本为VAX VS100 CPU编写的一个程序发展成为在今天可在笔记本电脑上进行3D渲染的图形用户界面。事实上X的出现早于图形处理单元GPU概念的出现甚至是比推广这项技术公司——于1999上市的Nvidia更早。
![](http://static.cnbetacdn.com/newsimg/2014/0620/77_1403265316.png_600x600.png)
尽管X已经服务了很长时间但是X仍将做出改进并继续陪伴我们。
请不要感到惊奇, X的出现早于:
- Linux, FreeBSD, NetBSD, OpenBSD, Solaris, Microsoft Windows
- POSIX, C89, C99, C++, Java
- 互联网
- GPL 和 FSF
X是第一个主要的开源软件项目比Free Software 和 Open Source Software更早。和我们一起庆祝吧因为没有X桌面就不会是今天这个样子。
- X.Org 品牌总监
--------------------------------------------------------------------------------
via: http://comments.gmane.org/gmane.comp.freedesktop.xorg.announce/2177
译者:[2q1w2007](https://github.com/2q1w2007) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:https://en.wikipedia.org/wiki/X11#Introduction

View File

@@ -0,0 +1,69 @@
使用DNSCrypt来加密您与OpenDNS之间的通信
================================================================================
**正如SSL能将HTTP通信变为加密过的HTTPS通信DNSCrypt, 物如其名, 是一款能加密您电脑与OpenDNS之间的通信的小神器。**
DNSCrypt刚问世的时候官方公布它只是一款Mac才能用的工具但根据最近一篇由OpenDNS发的[文章][1]表明虽然还没有用户界面但其实当Mac版DNSCrypt推出的时候源码已经放到了Github上了 Linux的用户也可以安装以及使用哦
### 为神马要使用 DNSCrypt? ###
**DNSCrypt可以加密您电脑与OpenDNS服务器的所有通信加密可以防止中间人攻击信息窥觑DNS劫持。更能防止网络供应商对某些网站的封锁。**
这是世界上第一款加密DNS通信的工具虽然TOR可以加密DNS的请求但毕竟它们只是在出口节点加密而已。
> 这款工具并不需要对域名或其工作方式做任何的改变它只是提供了个该工具的用户与机房里的DNS服务器之间的加密方式而已。
您可以在[GitHub][3]的[OpenSND DNSCrypt][2]页面阅读更多的相关信息。
### 如何在Linux使用DNSCrypt ###
首先下载安装[Download DNSCrypt][4] 然后在Terminal里输入这个命令:
sudo /usr/sbin/dnscrypt-proxy --daemonize
![](http://4.bp.blogspot.com/-WLefdXHIzwg/Tz45kGKAZdI/AAAAAAAAH0k/KLBnWJom6-g/s1600/edit-network.png)
然后把您的DNS服务器调成"127.0.0.1" - 在GNOME界面下的话只要到Network Connections网络连接选项然后选择"Edit"并在"DNS servers"输入"127.0.0.1"就好了。如果您用的是DHCP的话请选择Automatic (DHCP) addresses only" 这样的话才能输入DNS服务器。然后只要重连网络便可。
您可以访问这条[链接][5]来测试您连接到了OpenDNS了没。
如果您想设置开机启动DNSCrypt可以自建一个init的脚本如果您用的是Ubuntu可以参考下面的。
**Arch Linux的用户可以通过[AUR][6]来安装DNSCrypt-proxy** 内含rc.d脚本
### Ubuntu下的DNSCrypt ###
如果您想在Ubuntu设置开机启动您可以使用这个[Upstart脚本][7]。
注: 在Ubuntu 12.04版在127.0.0.1有个本地的DNS cache 服务器dnsmasq在跑所以已经把改脚本改成让DNSCrypt使用127.0.0.2了, 所以按照上面的教程应该把127.0.0.1换成127.0.0.2了。
要安装此脚本请使用以下的指令(要首先解压下下来的压缩文件):
sudo cp dnscrypt.conf /etc/init/
sudo ln -s /lib/init/upstart-job /etc/init.d/dnscrypt
然后用这个指令来启动:
sudo start dnscrypt
现在DNSCrypt就应该是开机自启了如果您想停止的话可以使用
sudo stop dnscrypt
[下载DNSCrypt][8] (.deb、 .rpm以及源码都可供下载哦)
--------------------------------------------------------------------------------
via: http://www.webupd8.org/2012/02/encrypt-dns-traffic-in-linux-with.html
译者:[213edu](https://github.com/213edu) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:https://blog.opendns.com/2012/02/16/tales-from-the-dnscrypt-linux-rising/
[2]:http://www.opendns.com/technology/dnscrypt/
[3]:https://github.com/opendns/dnscrypt-proxy
[4]:http://download.dnscrypt.org/dnscrypt-proxy/
[5]:http://www.opendns.com/welcome
[6]:http://aur.archlinux.org/packages.php?ID=54702
[7]:http://webupd8.googlecode.com/files/dnscrypt-0.2.tar.gz
[8]:https://github.com/opendns/dnscrypt-proxy/downloads

View File

@@ -1,9 +1,9 @@
如何使用GNOME-Pie桌面环境启动应用程序
Linux桌面上的小饼饼让启动应用分外不同
================================================================================
最近你能听到很多关于Ubuntu新的Unity界面的抱怨。我记得当Unity开始兴起的时候我正好离开Archlinux。然而Unity间接地导致了一个后果随着人们对它不满意人们开始关注其他的桌面环境和Linux发行版。如果你的系统支持Unity没有人会反对安装他
最近你能听到很多关于Ubuntu新的Unity界面的抱怨。我记得当Unity开始兴起的时候我正好离开Archlinux。然而Unity间接地导致了一个后果随着人们对它不满意人们开始关注其他的桌面环境和Linux发行版。如果你的系统支持Unity没有人会反对将它弄得更顺眼些
所以今天我向你推荐一个绝对原创的程序启动器: Gnome-Pie。你们可能会认为他的灵感来自魔兽世界插件"OPie"。因为他们有着相似的概念: 键盘快捷方式可以打开圆形"菜单",您可以从中选择一个应用程序或命令来启动。这种设计背后的主要思想是用户不必记住命令,但需要记住他的方向和操作。它是圆形的事实从指针使每个应用程序在相同的距离。再加上我们得到如此多自定义组合 可以通过快捷键,极大的提高效率并且最大限度地实现了人机工程学。
所以今天我向你推荐一个绝对原创的程序启动器: Gnome-Pie。你们可能会认为他的灵感来自魔兽世界插件"OPie"。因为他们有着相似的概念: 键盘快捷方式可以打开圆形"菜单",您可以从中选择一个应用程序或命令来启动。这种设计背后的主要思想是用户不必记住命令,但需要记住他的方向和操作。它的饼形设计让指针可以用同样的距离启动每个应用程序。再加上我们还有如此多自定义组合键,极大的提高效率并且最大限度地实现了人机工程学。
### 安装Gnome-Pie ###
@@ -17,53 +17,53 @@
$ sudo yum install gnome-pie
对于Archlinux, 你可以在[AUR][1]找到他.
对于Archlinux, 你可以在[AUR][1]找到它。
### Gnome-Pie的基本用法 ###
默认的Gnome-Pie有一个比较可靠的初始配置。首先你可以使用Ctrl + Alt + a呼唤出他的控制界面,他将显示你的系统的基本应用程序。
默认的Gnome-Pie有一个比较可靠的初始配置。首先你可以使用 **Ctrl + Alt + a** 调出,它将显示你的系统的基本应用程序。
![](https://farm3.staticflickr.com/2917/14040269128_6dc6544c14_z.jpg)
接下来, 按下Ctrl+Alt+b, 他将显示你文件管理器的书签。
接下来 按下 **Ctrl+Alt+b** 调出第二个圆,这将显示你文件管理器的书签。
![](https://farm3.staticflickr.com/2903/14040269088_8de29edd18.jpg)
第三个,也许是最有用的,它会显示你的应用程序菜单,按下 Ctrl + Alt + 空格可调
第三个,也许是最有用的,它会显示你的应用程序菜单,按下 **Ctrl + Alt + 空格** 可调
![](https://farm3.staticflickr.com/2903/14040345657_071f40b22f_z.jpg)
第四,你可以完全控制音乐播放器。快捷键是 Ctrl + Alt + m。
第四个,仅用于控制音乐播放器。你可以猜到,快捷键是 **Ctrl + Alt + m**
![](https://farm3.staticflickr.com/2925/14226915065_8b0e3841c6_o.png)
第五,你可以快速访问重新启动、 关机和注销命令 (Ctrl + Alt + qq 为退出,我猜得)。
第五,你可以快速访问重新启动、 关机和注销命令 (**Ctrl + Alt + q**我猜q是代表退出吧)。
![](https://farm3.staticflickr.com/2931/14040303600_5b3a517335_o.png)
最后你可以用Pie来控制窗口可以最小化、 规模、 关闭, 等等. 并且快捷键是Ctrl+Alt+w.
最后,第六个,你可以用Pie来控制窗口可以最小化、 规模、 关闭, 等等. 并且,快捷键是 **Ctrl+Alt+w**
![](https://farm3.staticflickr.com/2904/14226699514_42d364a4d4_o.png)
虽然我发现这种默认设置已经是相当令人满意,几乎和预置的启动器一样好。然而,如果让我鸡蛋里找骨头,我会说一些快捷方式很难用一只手执行。大多数情况是,我们用两只手打开菜单,然后再回到鼠标以选择该选项。太不爽了。
然而,我们在 Linuxer谁会在乎默认设置自定义才是王道。Gnome-Pie将为你提供优良的服务。通过配置你可以编辑现有的Pie,改变程序图标设计自己的Pie改变主题甚至将另外一个Pie菜单作为一个子菜单。
然而,我们在 Linux谁会在乎默认设置自定义才是王道。Gnome-Pie将为你提供优良的服务。通过配置你可以编辑现有的Pie改变程序图标设计自己的Pie改变主题甚至将另外一个Pie菜单作为一个子菜单。
[![](https://farm6.staticflickr.com/5508/14247093043_1fe1188709_z.jpg)][2]
你甚至可以编辑他来启动 URL、 你可以自由设置热键开启这一功能,惟一的缺憾可能是缺少Widgets。
你甚至可以编辑它来访问 URL、 自由设置热键、运行你自己的命令。惟一的缺憾可能是缺少Widgets。
![](https://farm3.staticflickr.com/2927/14040264609_b7aa66f078_z.jpg)
总之相较于传统的基于文本的启动器Gnome-Pie是一个相当有吸引力的可视化应用程序。我很喜欢他的自定义键盘和鼠标组合键让我想起了我在War3或者LOL中的神级操作。如果玩家通过这种方法,它可以为你带来方便和高效。我甚至建议你可以将它放在桌面上,来节省你的空间。我甚至敢说它可以替代Gnome。
总之相较于传统的基于文本的启动器Gnome-Pie是一个相当有吸引力的可视化应用程序。我很喜欢他的自定义键盘和鼠标组合键让我想起了我在War3或者LOL中的神级操作。如果玩家使用这种操作方式,它可以为你带来方便和高效。如果你想节约桌面空间,我甚至建议你不要将预置的启动器放到桌面上。总之,我甚至敢说它可以替代Gnome。
你觉得怎么样你在所有相信世界上有这么好的东西吗或者说随着新的Gnome shell出现Gnome-Pie开始失去竞争欢迎评论。
你觉得怎么样你在所有相信世界上有这么好的东西吗或者说随着新的Gnome shell出现Gnome-Pie开始失去竞争?欢迎评论。
--------------------------------------------------------------------------------
via: http://xmodulo.com/2014/05/launch-applications-differently-gnome-pie-linux-desktop.html
译者:[MikeCoder](https://github.com/MikeCoder) 校对:[校对者ID](https://github.com/校对者ID)
译者:[MikeCoder](https://github.com/MikeCoder) 校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@@ -1,33 +0,0 @@
IPFire 2.13 Core 78 Linux Firewall OS Receives OpenSSL Fixes
================================================================================
![](http://i1-news.softpedia-static.com/images/news2/IPFire-2-13-Core-78-Linux-Firewall-OS-Receives-OpenSSL-Fixes-445876-2.jpg)
**Michael Tremer, a developer for the ipfire.org team, has announced that IPFire 2.13 Core 78, a new stable build of the popular Linux-based firewall distribution, has been released to implement the latest OpenSSL fixes.**
IPFire is a modular Linux distribution, which means that it can be deployed as a firewall, a proxy server, or a VPN gateway. One of the main concerns of the IPFire developers is security, and every step has been taken to ensure users complete security.
“There have been several vulnerabilities discovered in the openssl library which is responsible for implementing the SSL/TLS protocol and other cryptographic tasks. All details about these can be found in the original openssl security advisory,” said the devs on their blog.
They have also explained that all the changes that they planned and built for Core Update 78 have been postponed to Core Update 79. This means that users will have to wait a little longer for a more consistent update.
OpenSSL developers have found another round of OpenSSL problems, but they have been fixed quickly and now the Linux distributions are including it in the latest versions.
The developers recommend all users of IPFire to upgrade their distributions. More details can be found on the official [website][1].
Download IPFire 2.13 Core 78:
- [IPFire 2.15 Core 78 (ISO)][2][iso] [122 MB]
- [IPFire 3.0 Alpha 1 (ISO)][3][iso] [76 MB]
--------------------------------------------------------------------------------
via: http://news.softpedia.com/news/IPFire-2-13-Core-78-Linux-Firewall-OS-Receives-OpenSSL-Fixes-445876.shtml
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.ipfire.org/news/ipfire-2-15-core-update-78-released
[2]:http://downloads.ipfire.org/releases/ipfire-2.x/2.15-core78/ipfire-2.15.i586-full-core78.iso
[3]:http://www.rowie.at/ipfire/iso/ipfire-3.0-alpha1.i686.iso

View File

@@ -0,0 +1,41 @@
Red Hat Revenues Power Forward in 2015
================================================================================
Red Hat reported its first quarter fiscal 2015 revenues on June 18, showing continued demand and momentum for its Linux and open-source technologies. Red Hat has been particularly busy of late, acquiring a pair of companies and launching its Red Hat Enterprise Linux 7 (RHEL) flagship platform.
For the quarter, Red Hat reported revenue of $424 million, which is a 17 percent year-over-year gain.
![](http://www.serverwatch.com/imagesvr_ce/7990/icon-redhatlinux-r.jpg)
"The main driver of our total revenue growth was subscription revenue of $372 million," Red Hat CFO Charlie Peters said during his company's earnings call. "Subscription revenue was up 18 percent year-over-year and it's important to point out that this renewable revenue stream now constitutes 88 percent of total revenue."
Looking forward, Red Hat provided second quarter guidance for approximately $432 million to $436 million in revenue.
One of the key metrics for growth that Red Hat provides is its top 30 deals during a given quarter. Peters noted that for the first time, all of the top 30 deals were valued at over $1 million.
"We also had a Q1 record with four deals that were in excess of $5 million and one that was greater than $10 million," Peters said. "Cross-selling was strong with 65 percent of these deals including one or more components from our group of applications development and emerging technologies offerings."
At the core of Red Hat's product portfolio is the Red Hat Enterprise Linux platform, which hit a major milestone last week with the debut of RHEL 7.
"RHEL 7 is significant because it was designed to meet both modern data center and next generation IT requirements for cloud, Linux containers and Big Data," Red Hat CEO Jim Whitehurst said during the earnings call. "As the worlds of physical, virtual and cloud systems converge Red Hat Enterprise Linux 7 delivers a true foundation for open hybrid cloud that will serve as the backbone for future application architectures."
### Acquisitions and Cloud Provide Opportunities for Further Growth ###
Red Hat has also been busy acquiring a pair of companies that further expand the company's ability to grow. In April, Red Hat acquired Inktank, the lead commercial sponsor behind the Ceph open-source storage filesystem. And on June 18, Red Hat announced the acquisition of OpenStack services vendor eNovance.
"With eNovance as a part of the Red Hat consulting team, we can enhance our consulting resources to be able to reach more customers with world-class OpenStack technologies and implementation services," Whitehurst said.
While cloud remains a growth opportunity for Red Hat, Whitehurst sees growth also coming from continuing to take market share away from other server operating system platforms. In particular, Whitehurst noted that there is still a continued move from mainframe and Unix to Linux.
"I was just on the phone today with a massive European customer that is literally just ready to start on the journey right now," Whitehurst said. "We continue to believe we're taking share from Windows especially with net new workloads."
Another driver of growth for Red Hat is the maturity and expansion of its sales force.
"We definitely have more boots on the street because we have been hiring consistently," Whitehurst said. "But I think our sales guys are more experienced, they are better trained, their confidence level is high and their enthusiasm is high."
--------------------------------------------------------------------------------
via: http://www.serverwatch.com/server-news/red-hat-revenues-power-forward-in-2015.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@@ -1,29 +0,0 @@
Red Hat to Acquire eNovance, Focus Together on OpenStack
================================================================================
![](http://farm4.static.flickr.com/3108/3191608123_67e1da2b79_o.jpg)
In conjunction with the recent OpenStack Summit in Atlanta, Red Hat had confirmed many new OpenStack-centric initiatives, one of which was that the company [is collaborating][1] with eNovance, a leader in the open source cloud computing market, tto drive Network Functions Virtualization (NFV) and telecommunications features into OpenStack. Now, Red Hat has [announced][2] that it will acquire eNovance for about 70 million euros, or $95 million, in cash and stock.
eNovance is an important player on the OpenStack scene, and is especially known for its work with telecommunications companies. eNovance helps service providers and large-scale private enterprises build and deploy cloud infrastructures quickly and cost effectively, and will create new lines of business for Red Hat.
As noted by IDC analysts Laura DuBois and Ashish Nadkarni in their recent recap of the spring 2014 OpenStack Summit, "Integrators such as eNovance will continue to assist cloud service providers and enterprises in building large OpenStack clouds. ... The future for OpenStack is looking very bright."
eNovance is one of the top 10 contributors to the upstream OpenStack project, and is the only European Gold Member company of the OpenStack Foundation. The company has more than 150 global customers, including Alcatel-Lucent, AXA, Cisco, Cloudwatt, and Ericsson. The company has offices in Paris; Montreal; and Bangalore, India.
Red Hat and eNovance [first partnered in 2013][3] to deliver OpenStack implementation and integration services to joint customers, based on the Red Hat Enterprise Linux OpenStack Platform. At OpenStack Summit in May, the two companies announced an [expanded collaboration][4] to drive Network Functions Virtualization (NFV) and telecommunications innovations into OpenStack, aimed at delivering the industrys most complete, carrier-grade telecommunications offering based on Linux, Kernel-based Virtual Machine (KVM), and OpenStack.
Raphaël Ferreira, co-founder & chief executive officer, eNovance, said in a statement:
> “eNovance, like Red Hat, understands the transformative power OpenStack can have on the enterprise market when it is both deployed and integrated in the right fashion. We are excited to become part of Red Hat, a company that not only offers one of the best-in-class OpenStack distributions on the market today, but also which shares our common belief that OpenStack is best deployed and integrated in a continuous and seamless manner."
--------------------------------------------------------------------------------
via: http://ostatic.com/blog/red-hat-to-acquire-enovance-focus-together-on-openstack
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.redhat.com/about/news/press-archive/2014/5/red-hat-and-enovance-to-deliver-carrier-grade-openstack
[2]:http://www.marketwatch.com/story/red-hat-to-acquire-enovance-a-leader-in-openstack-integration-services-2014-06-18
[3]:http://cts.businesswire.com/ct/CT?id=smartlink&url=http%3A%2F%2Fwww.redhat.com%2Fabout%2Fnews%2Fpress-archive%2F2013%2F11%2Fred-hat-and-enovance-partner-to-accelerate-adoption-of-red-hat-enterprise-linux-openstack-platform&esheet=50888828&newsitemid=20140618005543&lan=en-US&anchor=first+partnered+in+2013&index=1&md5=1721061ca22652d2a4413085db70361b
[4]:http://cts.businesswire.com/ct/CT?id=smartlink&url=http%3A%2F%2Fwww.redhat.com%2Fabout%2Fnews%2Fpress-archive%2F2014%2F5%2Fred-hat-and-enovance-to-deliver-carrier-grade-openstack&esheet=50888828&newsitemid=20140618005543&lan=en-US&anchor=expanded+collaboration&index=2&md5=a34aaf179e4aac7417917e55c991ef87

View File

@@ -1,82 +0,0 @@
jiajia translating...
Has Microsoft really changed its attitude toward open source?
================================================================================
> **In today's open source roundup: Microsoft may or may not have a new attitude toward open source. Plus: Android versus Windows, and Cinnamon versus Unity in Ubuntu 14.04**
Microsoft became infamous for its very negative early remarks about open source software. But restructuring at the company may be giving it a more positive attitude toward open source. CNet reports on changes in Microsoft's perceptions and behavior when it comes to open source software.
> According to [CNet][1]:
>
> But Microsoft's feud with open source has been sputtering for quite some time, and the senior managers who led the anti-open source charge are gone from the scene -- or at least no longer in positions of authority. Open source is now routinely used by corporations around the world, and the company's sniffy put-downs only fed into the perception of Microsoft as out of touch.
>
> Some of that new thinking reflects the change at the top of the corporate pyramid, with Satya Nadella replacing Ballmer as CEO in early February. Since taking over, Nadella has talked up his vision of a Microsoft whose future isn't shackled to its Windows past.
>
> [More at CNet][2]
>
> ![](http://www.itworld.com/sites/default/files/microsoft-open-source-communist_1.jpg)
>
> Microsoft and Communist Open Source
> Image credit: [Curako's Blog][3]
Okay, I hate to be a Negative Ned here, but I'm firmly in the "trust but verify" camp when it comes to Microsoft and open source. Yes, a new CEO and other changes may be helping Microsoft to adjust to living in an open source world. But change never comes easy or fast in such a large organization, so I think the jury is still out on whether or not Microsoft has really changed for the better when it comes to open source software.
Also, I've never forgotten the company's "embrace, extend, extinguish" strategy that they used in the past to destroy competitive software products. That alone is reason enough to keep a wary eye on Microsoft's involvement with any open source project. Perhaps the company really has changed, but maybe it hasn't. I think it bears watching for at least another few years to see if enduring change has really set in or not.
### Android versus Windows ###
ZDNet has an article that covers the top end-user Linux distributions. It notes that Windows still rules the desktop for now, but Android may eventually be the big kahuna among end-user operating systems by the end of this year.
> According to [ZDNet][4]:
>
> If smartphones and tablet sales continue to grow as expected, Android tablet vendors continue to erode Apple's market share, and PCs continue their decline, Android may end up being the top end-user operating system by the end of 2014—regardless of what happens with the proposed Android PCs.
>
> Taken as a whole, Android clearly rules the Linux end-user space. No, you may not think of it as a desktop yet —although AMD and Intel would both like you to change your mind about that — but Android is on its way to being the top end-user operating system of all.
>
> [More at ZDNet][4]
>
> ![](http://www.itworld.com/sites/default/files/android-devices-versus-windows-pcs.jpg)
> Image credit: [ZDNet][4]
The numbers mentioned in the article aren't really a surprise, given the mobile revolution that's happened over the last ten years. The desktop just isn't as important as it used to be, and Microsoft just never really mattered in mobile devices. Even now, as they struggle desperately for traction in tablets and phones, Microsoft is still mostly irrelevant in the mobile devices market.
Google has wreaked absolute havoc on Microsoft's efforts in mobile and is now beginning to be a threat to Microsoft in the desktop market. Between Chrome OS and Android, Google has been battering Microsoft on a number of fronts. If you look at Amazon's list of [top selling desktops][5] and [top selling laptops][6], you see plenty of Chrome OS computers and even some Android PCs. So people are actually buying alternatives to Windows computers and aren't bothered in the least by it.
### Cinnamon versus Unity in Ubuntu 14.04 ###
Tech Republic takes a look at whether or not Cinnamon is a viable replacement for Unity in Ubuntu 14.04. The article includes instructions on how to install Cinnamon in Ubuntu 14.04.
> According to [Tech Republic][7]:
>
> If you want a performance-centric desktop that doesn't toss aside feature and customization, Cinnamon is for you. Cinnamon is a straight-forward desktop interface that pretty much anyone can use -- from your IT staff to your grandmother. It really is that easy to use. Cinnamon doesn't surprise you, it doesn't trick you, but it also (in my opinion) doesn't wow you. But that's not what Cinnamon is about. This take on the desktop is all about functionality -- on a standard level. It doesn't break rules, push envelopes, or have new tricks up its sleeve.
>
> Cinnamon is a fairly pedestrian desktop that takes the bits and pieces of what's worked well over the years and cobbles them together into one, well-designed piece. So, if you're okay with using a desktop that looks and feels a bit long in the tooth (but one that functions very, very well), Cinnamon is for you. If you lean towards the bleeding edge of design and prefer a more modern look and feel, Cinnamon will most likely disappoint.
>
> [More at Tech Republic][7]
>
> ![](http://www.itworld.com/sites/default/files/cinnamon-versus-unity-in-ubuntu-1404.jpg)
>
> Image credit: [Tech Republic][7]
I'll have to weigh in on the side of Cinnamon here. While Unity has its pluses, I have never really been able to warm up to it. Cinnamon is closer to a more traditional desktop interface and that seems to work the best for me.
But as always, beauty is in the eye of the beholder. The great thing about Linux is that it offers so many different choices. So you really can't go wrong with Unity or Cinnamon, just use whichever one you like best.
What's your take on all this? Tell me in the comments below.
The opinions expressed by the author do not necessarily reflect the views of ITworld.
--------------------------------------------------------------------------------
via: http://www.itworld.com/open-source/421894/has-microsoft-really-changed-its-attitude-toward-open-source
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.cnet.com/news/dead-and-buried-microsofts-holy-war-on-open-source-software/
[2]:http://www.cnet.com/news/dead-and-buried-microsofts-holy-war-on-open-source-software/
[3]:http://curako.wordpress.com/2010/12/06/the-uneasy-alliance-free-software-vs-open-source/
[4]:http://www.zdnet.com/the-five-most-popular-end-user-linux-distributions-7000030058/http://www.zdnet.com/the-five-most-popular-end-user-linux-distributions-7000030058/
[5]:http://www.amazon.com/Best-Sellers-Electronics-Desktop-Computers/zgbs/electronics/565098/?_encoding=UTF8&camp=1789&creative=390957&linkCode=ur2&tag=fnh-20&linkId=REWXUPB7SQXPDSOL
[6]:http://www.amazon.com/Best-Sellers-Computers-Accessories-Laptop/zgbs/pc/565108/?_encoding=UTF8&camp=1789&creative=390957&linkCode=ur2&tag=fnh-20&linkId=POG3J2CFBHDWBAVL
[7]:http://www.techrepublic.com/article/is-cinnamon-a-worthy-replacement-for-ubuntu-unity/

View File

@@ -0,0 +1,86 @@
How Many Languages Do Developers Need To Know?
================================================================================
![](http://readwrite.com/files/styles/1400_0/public/fields/code%20example%20Flickr%20Ruiwen%20Chua.jpg)
> Big companies like Apple, Facebook and Google are developing their own programming languages, forcing developers to adapt.
At its Worldwide Developer Conference last week, Apple announced its new programming language [Swift][1]. Its the latest in a rash of new languages developed by big tech companies, in some cases for specific use with their own platforms.
Apple has Swift for iOS developers; [Facebook has Hack][2], a language for back-end development. Google, meanwhile, has its own entries—the would-be Javascript replacement Dart and a new general programming language called Go.
This rash of new languages raises a number of issues for developers. Perhaps the most significant is one my colleague [Adriana Lee][3] raised after Apple's Swift announcement:
> (How many languages are devs supposed to learn?)
> — Adriana Lee (@adra_la) [June 2, 2014][4]
### A Computer-Language Babel ###
There are already [hundreds of programming languages][5] in existence, and more are popping into existence all the time. Many are designed for use in a relatively narrow range of applications, and large numbers never catch on beyond small groups of coders.
Similarly, big tech companies have been developing new languages for about as long as there have been big tech companies. The [seminal general-purpose language C][6] originated at AT&T Bell Labs in the early 1970s. Java, now the primary language for development of Android apps, was [born at Sun Microsystems][7] in the 1990s.
What's different these days is the extent to which companies embrace new languages to further their specific business objectives—a process that also has the effect of creating a dedicated base of developers who are effectively "locked in" to a company's particular platform. That sort of dual strategy dates back at least to Sun's introduction of Java, which the company promoted as a way to challenge Microsoft's dominance on the PC desktop. (Things didn't work out the way Sun planned, although Java eventually found a home in enterprise middleware systems before Google adopted it for Android.)
It's also clearly Apple's goal with Swift. Should it live up to the company's early hype, Swift seems likely to simplify iOS app development by filing the rough edges off Objective-C, the current lingua franca of iOS and Mac OS X developers. But it will also require those same developers to learn the ins and outs of a new language that they're unlikely to use anywhere else.
### Why Companies Roll Their Own ###
Which cuts against the ingrained "dont reinvent the wheel” philosophy that animates most developers. So why don't more companies just adopt already existing languages to new uses?
One answer is simply that companies build their own languages because they can. Designing a new language can be complex, but it's not particularly resource-intensive. What's hard is building support for it, both in terms of providing software resources (shared code libraries, APIs, compilers, documentation and so forth) and winning the hearts and minds of developers. Companies are uniquely positioned to do both.
There's also the fact that existing languages are often difficult to shoehorn into today's complex code frameworks. Take, for instance, [Facebook's decision to create Hack][8], a superset of the [scripting language PHP][9] that's commonly used in Web development.
Facebook's main goal with Hack—a common one these days—was to improve code reliability, in this case by enforcing data-type checking before a program is executed. Such checks ensure that a program won't, say, try to interpret an integer as a string of characters, an error that could yield unpredictable results if not caught. In Hack, those checks take place in advance so that programmers can identify such errors long before their code goes live.
According to Julien Verlaguet, a core developer on Facebooks Hack team, the company first looked for an an existing language that might allow for more efficient programming. But much of Facebook was already built on PHP, and the company has built up a substantial software infrastructure to support PHP and its offshoots. While it's possible to make PHP work with code written in a different language, it's not easy—nor is it fast.
“Lets say I try to rewrite our PHP codebase in Scala,” Verlaguet said. “Its a well designed, beautiful language, but its not at all compatible with PHP. Everytime I need to call to PHP from the Scala part of the code base, Ill lose performance speed. We would have liked to use an existing language but for us, it just wasnt an option.”
Instead, Facebook invented Hack, which has enough in common with PHP that it can share the company's existing infrastructure. The vast majority of the Facebook codebase has been migrated from PHP to Hack, said Verlaguet, but the company has open sourced the language in hopes that independent developers will find uses for it outside of Facebook.
“You can still use PHP,” he said. “But were hoping youll want to use Hack.”
### Who Holds The Power ###
Therein lies the balance of power between companies and developers. Companies can make their languages as specific as they like. But if developers dont want to use them, nobody is going to—outside, that is, of anyone who might harbor hopes of one day working at the company that invented the language.
Its not unusual for companies to make it easiest to develop in one language over another. For example, you would use Objective-C to develop iOS apps, but Java to develop Android apps. This has never been a major sticking point with developers because both Objective-C and Java are general purpose object-oriented languages. Theyre useful for a number of purposes.
Hack, Dart, Go, and Swift, however, so far have only proven useful for particular company-designated programming solutions, usually in tandem with that companys programming environment of choice. Granted, it may be too soon to judge. Hack, for example, can be used in several back-end implementations; its just so new that Facebook doesnt yet have any data that people want to use it that way.
Its not that developers arent capable of learning multiple languages. Most already do. Think of them like the Romance languages—if you know Spanish, itll be easier to learn French and so on than if you didnt already know one. Likewise, if you already know Java, itll be easier to learn Ruby or Perl. And if you know PHP, you basically already know Hack.
On the contrary, its more of a question of habit. If Java already solves your specific problems, you dont have any incentive to learn Ruby. And if you are happy coding iOS apps in Objective-C, youre not going to feel very tempted to pick up Swift.
To some developers, though, ecosystem-specific languages just make life harder for everybody. Freelance designer Jack Watson-Hamblin, for instance, told me that initiatives like Apple's Swift risk overburdening programmers and fragmenting the developer community:
> It's important for programmers to know multiple languages, but forcing them to keep up with new languages all the time doesn't make sense. If I'm making a simple cross-platform app, I don't want to have to know four languages to do it. I only want to use the single-purpose language if I really need to.
Watson-Hamblin argues that when companies each build their own language for their own needs, it slows down overall progress both by dividing the attention of coders and by enforcing a monolithic perspective on development within that language. "When companies are in charge of a language vs. an open-source community, it's like the difference between a corporation and a start-up," he said. Communities are more flexible and adaptive by definition.
Of course, Apple had [a lot of very good reasons to start from scratch][10] with Swift, just as Facebook did when it invented Hack. That doesn't mean it's not going to force change on developers—some of it doubtless unwelcome.
“As new languages are invented, it gets more hegemonic,” said Verlaguet. “It can be frustrating to have to keep up. But on the other hand, youre more likely to have a new language to fit your exact problem. Imagine the reverse—a world where programmers used the same language for everything. Itd be a language that could do everything poorly but nothing well.”
Lead image by [Flickr user Ruiwen Chua][11], CC 2.0
--------------------------------------------------------------------------------
via: http://readwrite.com/2014/06/17/apple-swift-facebook-hack-google-dart
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:https://developer.apple.com/swift/
[2]:http://readwrite.com/2014/03/20/facebook-new-programming-language-hack
[3]:http://readwrite.com/author/adriana-lee#awesm=~oGfPbJlSrFBamJ
[4]:https://twitter.com/adra_la/statuses/473537386266112000
[5]:http://en.wikipedia.org/wiki/List_of_programming_languages
[6]:http://en.wikipedia.org/wiki/C_(programming_language)
[7]:http://en.wikipedia.org/wiki/Java_(programming_language)
[8]:http://readwrite.com/2014/03/20/facebook-new-programming-language-hack
[9]:http://en.wikipedia.org/wiki/PHP
[10]:http://blog.erratasec.com/2014/06/why-it-had-to-be-swift.html#.U58BJI1dXtA
[11]:https://www.flickr.com/photos/ruiwen/3260095534

View File

@@ -0,0 +1,120 @@
Linux Poetry Explains the Kernel, Line By Line
================================================================================
> Editor's Note: Feeling inspired? Send your Linux poem to [editors@linux.com][1] for your chance to win a free pass to [LinuxCon North America][2] in Chicago, Aug. 20-22. Be sure to include your name, contact information and a brief explanation of your poem. We'll draw one winner at random from all eligible entries each week through Aug. 1, 2014.
![Software developer Morgan Phillips is teaching herself how the Linux kernel works by writing poetry.](http://www.linux.com/images/stories/41373/Morgan-Phillips-2.jpg)
Software developer Morgan Phillips is teaching herself how the Linux kernel works by writing poetry.
Writing poems about the Linux kernel has been enlightening in more ways than one for software developer Morgan Phillips.
Over the past few months she's begun to teach herself how the Linux kernel works by studying text books, including [Understanding the Linux Kernel][3], Unix Network Programming, and The Unix Programming Environment. But instead of taking notes, she weaves the new terminology and ideas she learns into poetry about system architecture and programming concepts. (See some examples, below, and on her [Linux Poetry blog][4].)
It's a “pedagogical hack” she adopted in college and took up again a few years ago when she first landed a job as a data warehouse engineer at Facebook and needed to quickly learn Hadoop.
“I could remember bits and pieces of information but it was too rote, too rigid in my mind, so I started writing poems,” she said. “It forced me to wrap all of these bits of information into context and helped me learn things much more effectively.”
The Linux kernel's history, architecture, abundant terminology and complex concepts, are rich fodder for her poetry.
“I could probably write thousands of poems about just one subsystem in the kernel,” she said.
### Why learn Linux? ###
![Phillips publishes on her Linux Poetry blog.](http://www.linux.com/images/stories/41373/multiplexing-poem.png)
Phillips publishes on her Linux Poetry blog.
Phillips started her software career through a somewhat unconventional route as a physics major in a research laboratory. Instead of writing journal articles she was writing Python scripts to parse research project data on active galactic nuclei. She never learned the fundamentals of computer science (CS), but picked up the information on the job, as the need arose.
She soon got a job doing network security research for the Army Research Laboratory in Adelphi, Maryland, working with Linux. That was her first foray into the networking stack and the lower levels of the operating system.
Most recently she worked at Facebook until about six months ago when she moved from the Silicon Valley back to Nashville, near her home state of Kentucky, to work for a software startup that helps major record labels manage their business.
“I have all this experience but I suffer from a thing that almost every person who doesnt have an actual background in CS does: I have islands of knowledge with big gaps in between,” she said. “Every time I'd come across some concept, some data structure in the kernel, I'd have to go educate myself on it.”
A few weeks ago her frustration peaked. She was trying to do a form of message passing between web application processes and a web socket server she had written and found herself having to brush up on all the ways she could do interprocess communication.
“I was like, that's it. I'm going to start really learning everything I should have known starting at the bottom up with the Linux kernel,” she said. “So I bought some textbooks and started reading.”
![](http://www.linux.com/images/stories/41373/process-poem.png)
### What she's learned ###
Over the course of a few months of reading books and writing poems she's learned about how the virtual memory subsystem works. She's learned about the data structures that hold process information, about the virtual memory layout and how pages are mapped into memory, and about memory management.
“I hadn't thought about a lot of things, like that a system that's multiprocessing shouldnt bother with semaphores,” she said. “Spin locks are often more efficient.”
Writing poems has also given her insight into her own way of thinking about the world. In some small way she is communicating not just her knowledge of Linux systems, but also the way that she conceptualizes them.
“It's a deep look into my mind,” she said. “Poetry is the best way to share these abstract ideas and things that we can't possibly truly share with other people.”
Writing a Linux poem
The inspiration for her Linux poems starts with reading a textbook chapter. She hones the topics down to the key concepts that she wants to remember and what others might find interesting, as well as things she can “wrap a conceptual bubble around.”
A concept like demand paging is too broad to fit into a single poem, for example. “So I'm working my way down deeper in it,” she said. “Instead I'm looking at writing a poem about the actual data structure where process memory is laid out and then mapped into a page map.”
She hasn't had any formal training writing poetry, but writes the lines so that they are visually appealing and have a nice rhythm when they're read aloud.
In her poem, “The Reentrant Kernel,” Phillips writes about an important property in software that allows a function to be paused and restarted later with the same result. System calls need to have this reentrant property in order to make the scheduler run as efficiently as possible, Phillips explains. The poem also includes a program, written in C style pseudocode, to help illustrate the concept.
Phillips hopes her Linux poetry helps her increase her understanding enough to start contributing to the Linux kernel.
“I've been very intimidated for a long time by the idea of submitting a patch to the kernel, being a kernel hacker,” she said. “To me that's the pinnacle of success.
“My ultimate dream is that I can gain a good enough understanding of the kernel and C to submit a patch and have it accepted.”
The Reentrant Kernel
A reentrant function,
if interrupted,
will return a result,
which is not perturbed.
int global_int;
int is_not_reentrant(int x) {
int x = x;
return global_int + x; },
depends on a global variable,
which may change during execution.
int global_int;
int is_reentrant(int x) {
int saved = global_int;
return saved + x; },
mitigates external dependency,
it is reentrant, though not thread safe.
UNIX kernels are reentrant,
a process may be interrupted while in kernel mode,
so that, for instance, time is not wasted,
waiting on devices.
Process alpha requests to read from a device,
the kernel obliges,
CPU switches into kernel mode,
system call begins execution.
Process alpha is waiting for data,
it yields to the scheduler,
process beta writes to a file,
the device signals that data is available.
Context switches,
process alpha continues execution,
data is fetched,
CPU enters user mode.
注:上面代码内文本发布时请参考原文排版(第一行着重,全部居中)
--------------------------------------------------------------------------------
via: http://www.linux.com/news/featured-blogs/200-libby-clark/777473-linux-poetry-explains-the-kernel-line-by-line/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:editors@linux.com
[2]:http://events.linuxfoundation.org/events/linuxcon-north-america
[3]:http://shop.oreilly.com/product/9780596005658.do
[4]:http://www.linux-poetry.com/

View File

@@ -1,144 +0,0 @@
Translating by CHINAANSHE
How To Install Linux On A MacBook Pro Retina
================================================================================
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/linux-macbook-pro-retina-840x420.jpg?ec7b17)
MacBook Pros come with some very nice hardware, but some people want more. Some people want Linux.
Whether youd like a more open and customizable operating system or simply need to dual-boot in order to access certain software, you might want Linux on your MacBook. The thing is, MacBook Pros are also pretty closed-down pieces of hardware that make installing other operating systems difficult Linux more so than Windows. Boot Camp wont help you with Linux, even though it doesnt mean its impossible. Heres how to do it.
### Why Install Linux On A MacBook Pro Retina? ###
The reasoning for installing Linux on a MacBook Pro might seem a bit strange at first isnt OS X one of the main reasons to get a Mac? That might be true, but another great reason to get a Mac is the hardware. They offer excellent performance, superb battery life, and long durability. For the ones with a Retina display, youre also wanting a HiDPI experience for ultra-crisp photos and text.
But if you dont like Mac OS X, or simply need to use Linux, you may want to put another operating system on that Mac hardware. Linux is lean, open, and highly customizable. Who says that you cant bring the two together in a happy marriage? Well, Apple might have a word to say about that, but you probably dont care anyways.
Note: For the purposes of this tutorial, well be using Ubuntu, the [most popular Linux distribution][1], as our preferred choice. Youre free to choose a different distribution, but you can then only follow these steps are generic guidelines and not exact instructions. We claim no responsibility for any damage that is done to your system. Additionally, this tutorial assumes that you want to dual-boot between Linux and Mac OS X. Its recommended to keep Mac OS X on the hard drive so that you can update the firmware if needed — something you cannot do in Linux.
Before we even start with the first step, make sure that your computer is backed up in case anything goes wrong. How you do this is up to you, so feel free to use Time Machine, CrashPlan, or whatever else you might prefer.
### Download Ubuntu ###
First, youll want to get a [copy of the Ubuntu desktop ISO image][2]. Be sure to choose the 64-bit desktop flavor, and not the image made for Macs. The regular image can boot up in BIOS and EFI modes, while the Mac image can only boot up in BIOS mode. This was done on purpose for some Macs, but we want to be able to boot it up in EFI mode.
### Write to USB Drive ###
Next, grab a USB flash drive that is at least 2GB large well use this to boot up the Ubuntu installer on. To make this drive you can follow [the official Ubuntu steps][3], or [use the dedicated GUI tool for the job][4].
### Resize Partitions ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_disk_utility.jpg?ec7b17)
nce youve done that, you can get your MacBook Pro ready for the installation. Open up the Disk Utility, click on your hard drive on the left side, and then choose the Partitions tab. Resize the Mac partition to whatever size youd like it to be — well use the newly created free space to install Ubuntu.
### Boot Up Ubuntu Image ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_boot.jpg?ec7b17)
After thats completed, plug in the USB flash drive you prepared and restart your MacBook Pro. Be sure to hold down the Options button from when the screen blanks out for a second to when you see a screen with various boot options. Choose the EFI option (the left one in case you see two of them) to boot up your Ubuntu USB flash drive.
When prompted to choose between “Try Ubuntu” and “Install Ubuntu”, choose “Try Ubuntu” because well need to perform a step after the installer completes but before you restart the system.
### Installer ###
Once the Ubuntu desktop loads, start the installer and go through it normally until you reach the partitioning step. If you cannot access WiFi, its because Ubuntu currently doesnt recognize your WiFi chipset. Dont worry we dont need to have Internet access right now, and itll detect the right driver to use whenever you boot up into your new installation later on.
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_installer_partitions.jpg?ec7b17)
Once you come to the partitioning step, choose to “Do something else”. Then, make sure that the small partition thats ~128MB large is recognized as an EFI boot partition (you can check by clicking on it and choosing Options; additionally, that should be /dev/sda1). Next, you can create an ext4 partition in the new space and have the path “/” be mounted to it. You can also create multiple partitions here if you prefer that and know what youre doing.
Before you continue to the next step, make sure that the bootloader installation location says /dev/sda1, as you want GRUB to be installed into that partition. Then, finish off the installation like normal.
### EFI Boot Fix ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_efibootmgr.jpg?ec7b17)
When the installer completes, dont restart just yet! We still need to do one more thing so that well be able to use GRUB. Run the following command:
sudo apt-get install efibootmgr
This will temporarily install a configuration tool for EFI boot setups. Next, run
sudo efibootmgr
This will print out the current boot configuration to your screen. In this, you should be able to see “ubuntu” and “Boot0000*”. Currently, the EFI system will point to Boot0080*, which skips GRUB and goes directly to Mac OS X. To fix this, run the command
sudo efibootmgr -o 0,80`
Now you can restart!
Congratulations! Your Ubuntu installation should now be working! However, there are a few tweaks that you can perform to have a better experience.
### Various Tweaks ###
First, youll need to make a quick change to a GRUB setting so that the SSD wont occasionally freeze. Type
sudo nano /etc/default/grub
in a terminal, and then find the line with **GRUB_CMDLINE_LINUX** and change it to **GRUB_CMDLINE_LINUX="libata.force=noncq"**. Hit CTRL+X to save, and Y then Enter to confirm. Then, youll want to type
sudo nano /etc/grub.d/40_custom
into the terminal, which will open up a new file. In it, type this exactly:
menuentry "Mac OS X" {
exit
}
This will allow you to boot into your Mac OS X installation (the 32-bit and 64-bit entries in GRUB do not work). Do the same thing to save and exit, then type in
sudo update-grub
for the changes to go into effect. Finally, restart your system for good measure.
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_small_retina.jpg?ec7b17)
As you can see, everything is ridiculously small on the Retina display. To fix this, System Settings > Display and change the scaling factor to something larger. On the Retina screen, everything will look extremely tiny and it will make your life much more difficult if you dont change it to something you like.
You may also find that its difficult to grab the edges of a window for resizing. This can also be changed. Type
sudo nano /usr/share/themes/Ambiance/metacity-1/metacity-theme-1.xml
into a terminal, and then change these values appropriately:
<distance name="left_width" value="4"/>
<distance name="right_width" value="4"/>
<distance name="bottom_height" value="4"/>
If thats not big enough, you can also change those values to “6″ instead.
Finally, if you experience any washed out colors, you can grab the display color profile from Mac OS X and use it in Ubuntu. Mount your Mac OS X drive and navigate to
/Library/ColorSync/Profiles/Displays/Color LCD-xxxxxx.icc
where xxxxxx is some random string (there should only be one file anyways, but this string gets randomized). Copy it into your Ubuntu home folder, and then go to System Settings > Color and choose Add New Profile and choose the profile you saved in your home folder.
### Conclusion ###
![](http://main.makeuseoflimited.netdna-cdn.com/wp-content/uploads/2014/05/mac_linux_final.jpg?ec7b17)
Congratulations! You now have a great working Linux installation on your MacBook Pro Retina! Feel free to make additional tweaks to [make Ubuntu feel more like home][5]. Im sure that these instructions can be applied to other Mac systems, but each new release has its own pitfalls and advantages. If you use a different machine, its a good idea to look up some documentation first, such as [this][6] for Ubuntu.
Additionally, feel free to check out [other great Linux distros][7] that you can install to your Mac!
Have you installed Linux on a Mac? What problems did you encounter and how did you solve it? Let us know in the comments!
Image Credits: [K?rlis Dambr?ns][8] Via Flickr
--------------------------------------------------------------------------------
via: http://www.makeuseof.com/tag/install-linux-macbook-pro/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.makeuseof.com/tag/windows-xp-users-switch-ubuntu-14-04-lts-trusty-tahr/
[2]:http://www.ubuntu.com/download/desktop/
[3]:http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx
[4]:http://www.makeuseof.com/tag/how-to-boot-a-linux-live-usb-stick-on-your-mac/
[5]:http://www.makeuseof.com/tag/11-tweaks-perform-ubuntu-installation/
[6]:https://help.ubuntu.com/community/MacBookPro
[7]:http://www.makeuseof.com/pages/best-linux-distributions
[8]:https://www.flickr.com/photos/janitors/10037346335

View File

@@ -1,127 +0,0 @@
jiajia translating...
Cup 2014 Brazil: Watch FIFA World Cup 2014 Competition in Your Linux Desktop
================================================================================
Football is the most played and most watched sports on Earth. The present form of football originated in Britain. Football players run an average of more than six miles during a single match. Over one billion fans watched last world cup football matches on Television. This figure is estimated to rise on an above note, this year.
Yeah! 2014 FIFA World Cup is going to start from 12th of June and will last on 13th of July. This will be the 20th FIFA World Cup, which is scheduled to be played in Brazil. A total of 32 countries are participating in this event.
For the fan-boys of football, here we are going to throw light on an application software called “icup 2014 Brazil”, which will update you with latest scores, keep tracks of the match score of your favourite team. Here in this article we will be discussing its features, usages, installation, etc.
![iCup 2014 Brazil](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014.jpeg)
iCup 2014 Brazil
### What is icup 2014 Brazil? ###
icup 2014 Brazil is an application which is capable of keeping a track of match results of the FIFA world cup 2014 into your Linux desktop, starting shortly.
### Features of icup 2014 Brazil ###
- Adaptive User Interface, i.e., auto-resize of user interface.
- Fast Access to Statistics.
- Social Network Sharing Enabled, which extends to Facebook, Twitter and Google+.
- Latest one is Retina display Support.
- Detailed data with time events and Statistics related to match and Team.
- Audio Kit which comprise of the National-Anthem of all the participating countries (32) in high quality effect along with the stadium background sound which makes the whole thing real.
- An inbuilt calendar with the support of time zone for better understanding of events in local time zone, grouping of data and statistics for real time comparison groupable by day or stage, Graphical 2nd stage table, Result and Scores of Teams in real time.
- Proxy support.
### Platforms and Architecture Supported ###
The application is designed to run on all major platforms including **Mac**, **Windows** and **Linux**. For the point of Linux, it is important to mention that the application is designed for **x86** processor only. However installing an **x86** application on **x86_64** architecture is possible. We have to tweak a little to make it work **x86_64** systems.
#### An insight of the Technical Specification on different Platforms ####
- Live Result, Calendar, Grouping of Data, 2nd stage Table, Social Network Linking and Multi-language support Available for all supported platform.
- Retina Display No support in Windows and Linux, however supported in Mac OS.
- Detailed Statistics Supported in Linux. Donation-ware for Windows and Mac.
- Audio Kit Supported in Mac and Linux. Unknown for Windows.
**Important**: As visible in the above specification, some of the features like detailed specification are not available on platform other than Linux, for free. It is just to support Server and Bandwidth cost. For a Linux user, nothing needs to be cared about as far as detailed statistics are concerned, a proud moment.
### Installing iCup 2014 Brazil in Linux ###
First go to official [iCup 2014 Brazil download][1] page and download application according to your platform and architecture.
#### On 32-Bit System ####
# cd Downloads/
# tar xvf iCup_2014_FREE-Brazil_1.1_linux.tar.bz2
# cd iCup\ 2014\ FREE\ -\ Brazil\ 1.1/
# chmod 755 iCup\ 2014\ FREE\ -\ Brazil
As I said above, this application is designed for x86 systems only. In order to Install a 32 bit application on 64 bit architecture, we need to prepare our system by installing some packages **GTK+2** and **libstdc++.so.6**.
Well not for this Application only, but there are a whole lot of application in Linux which is not supported in 64-bit e.g., **Skype**. We need to build our System to install those applications.
#### On 64-Bit Systems ####
Install **GTK+2** and **libstdc++so.6**, using apt or yum command as shown below.
$ sudo apt-get install libgtk2.0-0 libstdc++6 [on Debian based systems]
If you get any dependency error, run the following command to resolve those dependencies
$ sudo apt-get -f install
----------
# yum install gtk2 libstdc++ [on RedHat based systems]
Once all the required packages are installed. Now the System is capable of running 32 bit applications on 64-bit systems, now go the directory where youve downloaded **iCup 2014 Brazil** package and run the following commands to install it.
# cd Downloads/
# tar xvf iCup_2014_FREE-Brazil_1.1_linux.tar.bz2
# cd iCup\ 2014\ FREE\ -\ Brazil\ 1.1/
# chmod 755 iCup\ 2014\ FREE\ -\ Brazil
Next, move to the directory and double click the executable to start the application. In the below screen-shot you may not get the full information since the FIFA 2014 has not started till now. Although the glimpse of what we can get once the event starts.
![iCup Brazil 2014](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-01-620x437.jpeg)
iCup Brazil 2014
No detailed Information : World cup hasnt started Yet.
![Match Detailed Information](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-02-620x439.jpeg)
Match Detailed Information
Groups and Teams
![Groups and Teams](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-03-620x439.jpeg)
Groups and Teams
2nd stage Detailed Information
![2nd stage Detailed Information](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-04-620x438.jpeg)
2nd stage Detailed Information
Match Details. Seems incomplete now.
![Match Summary](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-05-620x440.jpeg)
Match Summary
Language Change window and Social share button Integrated.
![Language Change](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-06-620x440.jpeg)
Language Change
Donation is optional for Linux. You can always contribute.
![Donation](http://www.tecmint.com/wp-content/uploads/2014/06/Football-World-Cup-2014-07-620x435.jpeg)
Donation
### Conclusion ###
The above Application seems promising and may prove to be a boon for those Football fan-wall who can now remain connected.
Thats all for now. Ill be here again with another interesting article soon. In that mean keep connected to Tecmint.com. Dont forget to provide us with your valuable feedback in the comment section below.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/view-fifa-world-cup-matche-results/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.e-link.it/icup/brazil2014/icup-brazil-2014-desktop-app.php

View File

@@ -0,0 +1,203 @@
translating by johnhoow...
给linux用户的11个高级MySQL数据库面试问题和答案
================================================================================
我们已经发表了两篇MySQL的文章,非常感谢Tecmint社区的大力支持.这是MySQL面试系列的第三篇文章,并且在面试专栏中排第16.
- [15个基本的MySQL面试问题][1]
- [给中级人员的10个MySQL面试问题][1]
![11个MySQL面试问题](http://www.tecmint.com/wp-content/uploads/2014/06/MySQL-Interview-Questions.jpeg)
感谢你们这一路上对我们的支持.这篇文章主要针对MySQL的实用性,讲面试方面的问题.
### 1. 如何使用SELECT语句找到你正在运行的服务器的版本并打印出当前数据库的名称? ###
**答案**:下面的语句的结果会显示服务器的版本和当前的数据库名称
mysql> SELECT VERSION(), DATABASE();
+-------------------------+------------+
| VERSION() | DATABASE() |
+-------------------------+------------+
| 5.5.34-0ubuntu0.13.10.1 | NULL |
+-------------------------+------------+
1 row in set (0.06 sec)
在Database一栏中显示**NULL**是因为我们当前没有选择任何数据库.因此,使用下面的语句先选择一个数据库,就能看到相应的结果.
mysql> use Tecmint;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
----------
mysql> select VERSION(), DATABASE();
+-------------------------+------------+
| VERSION() | DATABASE() |
+-------------------------+------------+
| 5.5.34-0ubuntu0.13.10.1 | tecmint |
+-------------------------+------------+
1 row in set (0.00 sec)
### 2. 使用非运算符(!)从表"Tecmint"中列出除了user等于"SAM"的所有记录
**答案**:使用下面的语句
mysql> SELECT * FROM Tecmint WHERE user !=SAM;
+---------------------+---------+---------+---------+---------+-------+
| date | user | host | root | local | size |
+---------------------+---------+---------+---------+---------+-------+
| 2001-05-14 14:42:21 | Anthony | venus | barb | venus | 98151 |
| 2001-05-15 08:50:57 | TIM | venus | phil | venus | 978 |
+---------------------+---------+---------+---------+---------+-------+
### 3. 是否能够使用非运算符(!)来实现'AND'运算
**答案**: The AND operator is used when we use (=) and the operator OR is used when we use (!=). An example of (=) with AND Operator.
**答案**:
mysql> SELECT * FROM mail WHERE user = SAM AND root = phil
An Example of (!=) with OR Operator.
mysql> SELECT * FROM mail WHERE user != SAM OR root != phil
+---------------------+---------+---------+---------+---------+-------+
| date | user | host | root | local | size |
+---------------------+---------+---------+---------+---------+-------+
| 2001-05-14 14:42:21 | Anthony | venus | barb | venus | 98151 |
+---------------------+---------+---------+---------+---------+-------+
- = : means Equal to
- != : Not Equal to
- ! : represents NOT Operator
The AND & OR are treated as joining operators in MySQL.
### 4. What IFNULL() statement is used for in MySQL? ###
**Ans**: The Query in MySQL can be written precisely using **IFNULL()** statement. The IFNULL() statement test its first argument and returns if its not NULL, or returns its second argument, otherwise.
mysql> SELECT name, IFNULL(id,'Unknown') AS 'id' FROM taxpayer;
+---------+---------+
| name | id |
+---------+---------+
| bernina | 198-48 |
| bertha | Unknown |
| ben | Unknown |
| bill | 475-83 |
+---------+---------+
### 5. You want to see only certain rows from a result set from the beginning or end of a result set. How will you do it? ###
**Ans**: We need to use **LIMIT** clause along with ORDER BY to achieve the above described scenario.
#### Show 1 Record ####
mysql> SELECT * FROM name LIMIT 1;
+----+------+------------+-------+----------------------+------+
| id | name | birth | color | foods | cats |
+----+------+------------+-------+----------------------+------+
| 1 | Fred | 1970-04-13 | black | lutefisk,fadge,pizza | 0 |
+----+------+------------+-------+----------------------+------+
#### Show 5 Record ####
mysql> SELECT * FROM profile LIMIT 5;
+----+------+------------+-------+-----------------------+------+
| id | name | birth | color | foods | cats |
+----+------+------------+-------+-----------------------+------+
| 1 | Fred | 1970-04-13 | black | lutefisk,fadge,pizza | 0 |
| 2 | Mort | 1969-09-30 | white | burrito,curry,eggroll | 3 |
| 3 | Brit | 1957-12-01 | red | burrito,curry,pizza | 1 |
| 4 | Carl | 1973-11-02 | red | eggroll,pizza | 4 |
| 5 | Sean | 1963-07-04 | blue | burrito,curry | 5 |
+----+------+------------+-------+-----------------------+------+
----------
mysql> SELECT * FROM profile ORDER BY birth LIMIT 1;
+----+------+------------+-------+----------------+------+
| id | name | birth | color | foods | cats |
+----+------+------------+-------+----------------+------+
| 9 | Dick | 1952-08-20 | green | lutefisk,fadge | 0 |
+----+------+------------+-------+----------------+------+
### 6. Oracle Vs MySQL. Which one and Why? ###
**Ans**: Well both has its advantages and disadvantages. As a matter of time I prefer MySQL.
#### Reason for Selection MySQL Over oracle ####
- Mysql is FOSS.
- MySQL is portable.
- MYSQL supports both GUI as well as Command Prompt.
- MySQL Administration is supported over Query Browser.
### 7. How will you get current date in MySQL? ###
**Ans**: Getting current date in MySQL is as simple as executing the below SELECT Statement.
mysql> SELECT CURRENT_DATE();
+----------------+
| CURRENT_DATE() |
+----------------+
| 2014-06-17 |
+----------------+
### 8. How will you export tables as an XML file in MySQL? ###
**Ans**: We use -e (export) option to export MySQL table or the whole database into an XML file. With large tables we may need to implement it manually but for small tables, applications like phpMyAdmin can do the job.
A native command of MySQL can do it.
mysql -u USER_NAME xml -e 'SELECT * FROM table_name' > table_name.xml
Where USER_NAME is username of Database, table_name is the table we are exporting to XML and table_name.xml is the xml file where data is stored.
### 9. What is MySQL_pconnect? And how it differs from MySQL_connect? ###
**Ans**: MySQL_pconnect() opens a connection that is persistent to the MySQL Database which simply means that the database is not opened every-time the page loads and hence we can not use MySQL_close() to close a persistent connection.
A brief difference between MySQL_pconnect and MySQL_connect are.
Unlike MySQL_pconnect, MySQL_connect Opens the Database every-time the page is loaded which can be closed any-time using statement MySQL_close().
### 10. You need to show all the indexes defined in a table say user of Database say mysql. How will you achieve this? ###
**Ans**: The following command will show all the indexes of a table user.
mysql> show index from user;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| user | 0 | PRIMARY | 1 | Host | A | NULL | NULL | NULL | | BTREE | | |
| user | 0 | PRIMARY | 2 | User | A | 4 | NULL | NULL | | BTREE | | |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
2 rows in set (0.00 sec)
### 11. What are CSV tables? ###
**Ans**: CSV stands for Comma-Separated Values aka Character-Separated Values. CSV table stores data in plain text and tabular format. It typically contains one record per line.
Each record is separated by specific delimiters (Comma, Semi-colon, …) where each record has same sequence of field. CSV tables are most widely used to store phone contacts to Import and Export and can be used to store any sort of plain text data.
Thats all for now. Ill be here again with another Interesting article, you people will love to read. Till then stay tuned and connected to Tecmint and Dont forget to provide us with your valuable feedback in the comment section below.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/mysql-advance-interview-questions/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.tecmint.com/basic-mysql-interview-questions-for-database-administrators/
[2]:http://www.tecmint.com/10-mysql-database-interview-questions-for-beginners-and-intermediates/

View File

@@ -0,0 +1,159 @@
[Translating] --213edu
How to enable testing and unstable repository on Debian
================================================================================
Testing/Unstable sources
The testing and unstable repositories of Debian provide with a higher version of software applications than what is present in the stable repository. Note that these names are actually aliases such that the stable repository points to the current Debian stable release and the Testing repository is what is going to be part of the next Debian stable release. So at the time of this post, Wheezy 7.x is the Stable release and Jessie is the Testing source which is going to be the next stable release.
At times, when you need to get a more recent version of a particular application, then the testing/unstable repository is a good option. I had the task of installing Apache 2.4.x onto a Debian wheezy system. But the repo had only 2.2.x and the testing repo had the required 2.4.x version. So the solution is to grab it from the testing repo.
Most of the time, when looking for newer versions of software applications, we would fiddle with the "Testing" repository only.
This post is going to show you how to setup the Testing and Unstable sources on a Debian system and how to install software from them, without breaking your existing system.
> Stable < Testing < Unstable
> Wheezy < Jessie < Sid
### 1. Setup the apt sources for testing/unstable repo ###
The first step is to add the testing/unstable sources to your sources.list file. The /etc/apt/sources.list file on a Debian wheezy system looks something like this by default.
$ cat /etc/apt/sources.list
----------
...
deb http://security.debian.org/ wheezy/updates main
deb http://http.us.debian.org/debian/ wheezy main
deb-src http://security.debian.org/ wheezy/updates main
...
Note down the url of the repository server - http://http.us.debian.org/debian/
This repository server is a mirror that is located nearest to you. It shall be different in your sources.list file. The same shall be used in the next steps
To add the testing and unstable sources you need to add something like this to your sources.list file
# Testing repository - main, contrib and non-free branches
deb http://http.us.debian.org/debian testing main non-free contrib
deb-src http://http.us.debian.org/debian testing main non-free contrib
# Testing security updates repository
deb http://security.debian.org/ testing/updates main contrib non-free
deb-src http://security.debian.org/ testing/updates main contrib non-free
# Unstable repo main, contrib and non-free branches, no security updates here
deb http://http.us.debian.org/debian unstable main non-free contrib
deb-src http://http.us.debian.org/debian unstable main non-free contrib
The format is
deb <respository server/mirror> <repository name> <sub branches of the repo>
Instead of testing/unstable the corresponding codenames jessie and sid can also be used
deb http://http.us.debian.org/debian jessie main non-free contrib
deb http://security.debian.org/ jessie/updates main contrib non-free
deb http://http.us.debian.org/debian sid main non-free contrib
### 2. Do some apt pinning - Important ! ###
> After adding the testing and unstable repos, if you update the system then all available updates for all installed applications would be installed right away, leading the system to an unpredictable state.
Therefore some rules have to be setup in order to restrict the package selection during regular updates/upgrades.
This is done through "apt pinning" where we tell the apt system to use only the stable system as always, but we may select to install a particular package from the testing or unstable repository if we wish to.
The apt pinning preferences can be configured into either of the following 2 files.
/etc/apt/preferences
OR
/etc/apt/preferences.d/my_preferences
Open either of the 2 locations (create one if it does not exist) and fill the following into the file
Package: *
Pin: release a=stable
Pin-Priority: 700
Package: *
Pin: release a=testing
Pin-Priority: 650
Package: *
Pin: release a=unstable
Pin-Priority: 600
Mentioned earlier, stable will point to your current debian version, testing to the next, and unstable would be further away in future. Main thing to note is the priority. The stable/current version has been given the highest priority which means that for regular tasks apt-get will install packages only from the current stable repository (wheezy in this case).
#### Update the package cache ####
After adding the new repository and specify the pinning rules, update the package cache.
$ sudo apt-get update
#### Confirm the apt policy ####
We must ensure that the pinning configuration is correct and that the priorities are met correctly. Check the effective apt policy with the apt-cache command
$ apt-cache policy apache2
apache2:
Installed: (none)
Candidate: 2.2.22-13
Version table:
2.4.7-1 0
600 http://http.us.debian.org/debian/ unstable/main amd64 Packages
2.4.6-3 0
650 http://http.us.debian.org/debian/ testing/main amd64 Packages
2.2.22-13 0
700 http://http.us.debian.org/debian/ wheezy/main amd64 Packages
The above output confirms that version 2.2.22 ( the wheezy main/stable ) repository is selected, its on highest priority.
### 3. Install apps from testing/unstable source ###
Now its time to pick a particular package out from the testing or unstable repo and install it. So lets say we want to install apache2 from testing source.
There are 2 ways to do it and each has a different effect.
#### Method 1 ####
# apt-get install apache2/testing
The above command will install the apache2 package from the testing source and install dependencies from stable source (or whatever the apt policy holds). This command fail in situations where the dependencies are outdated compared to what the installation package (apache2) needs.
#### Method 2 ####
# apt-get -t testing install apache2
The above command will install apache2 from testing source and install all dependencies from testing source as well. This should work better than the above command.
So to install newer version of any package, simply head towards the testing/unstable sources and enjoy. Note that the priority numbers are not just plain numbers, but have special meanings. Check the man page on apt preferences to learn more about them
$ man 5 apt_preferences
### Summary ###
Using the testing/unstable repository with pinning is an easy way to get newer versions of packages, but it is not recommended. If done wrong, it can mess up the system by pulling packages from different branches that may not be compatible.
A more recommended method to install updated packages is using the backports repository. It provides newer versions of selected packages from testing/unstable repo, but compiled for the current stable version. So on debian wheezy you can use wheezy-backports repository. Check out http://backports.debian.org/ for more information.
### Resources ###
- [https://wiki.debian.org/AptPreferences][1]
- [https://wiki.debian.org/DebianTesting][2]
- [https://www.debian.org/security/][3]
--------------------------------------------------------------------------------
via: http://www.binarytides.com/enable-testing-repo-debian/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://wiki.debian.org/AptPreferences
[2]:http://wiki.debian.org/DebianTesting
[3]:http://www.debian.org/security/

View File

@@ -0,0 +1,190 @@
hyaocuk is translating
10 Tips to Push Your Git Skills to the Next Level
================================================================================
Recently we published a couple of tutorials to get you familiar with [Git basics][1] and [using Git in a team environment][2]. The commands that we discussed were about enough to help a developer survive in the Git world. In this post, we will try to explore how to manage your time effectively and make full use of the features that Git provides.
> Note: Some commands in this article include part of the command in square brackets (e.g. `git add -p [file_name]`). In those examples, you would insert the necessary number, identifier, etc. without the square brackets.
### 1. Git Auto Completion ###
If you run Git commands through the command line, its a tiresome task to type in the commands manually every single time. To help with this, you can enable auto completion of Git commands within a few minutes.
To get the script, run the following in a Unix system:
cd ~
curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
Next, add the following lines to your ~/.bash_profile file:
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
Although I have mentioned this earlier, I can not stress it enough: If you want to use the features of Git fully, you should definitely shift to the command line interface!
### 2. Ignoring Files in Git ###
Are you tired of compiled files (like `.pyc`) appearing in your Git repository? Or are you so fed up that you have added them to Git? Look no further, there is a way through which you can tell Git to ignore certain files and directories altogether. Simply create a file with the name `.gitignore` and list the files and directories that you dont want Git to track. You can make exceptions using the exclamation mark(!).
*.pyc
*.exe
my_db_config/
!main.pyc
### 3. Who Messed With My Code? ###
Its the natural instinct of human beings to blame others when something goes wrong. If your production server is broke, its very easy to find out the culprit — just do a `git blame`. This command shows you the author of every line in a file, the commit that saw the last change in that line, and the timestamp of the commit.
git blame [file_name]
![git blame demonstration](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946443git-ninja-01.png)
And in the screenshot below, you can see how this command would look on a bigger repository:
![git blame on the ATutor repository](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946441git-ninja-02.png)
### 4. Review History of the Repository ###
We had a look at the use of `git log` in a previous tutorial, however, there are three options that you should know about.
- **--oneline** Compresses the information shown beside each commit to a reduced commit hash and the commit message, all shown in a single line.
- **--graph** This option draws a text-based graphical representation of the history on the left hand side of the output. Its of no use if you are viewing the history for a single branch.
- **--all** Shows the history of all branches.
Heres what a combination of the options looks like:
![Use of git log with all, graph and oneline](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946444git-ninja-03.png)
### 5. Never Lose Track of a Commit ###
Lets say you committed something you didnt want to and ended up doing a hard reset to come back to your previous state. Later, you realize you lost some other information in the process and want to get it back, or at least view it. This is where `git reflog` can help.
A simple `git log` shows you the latest commit, its parent, its parents parent, and so on. However, `git reflog` is a list of commits that the head was pointed to. Remember that its local to your system; its not a part of your repository and not included in pushes or merges.
If I run `git log`, I get the commits that are a part of my repository:
![Project history](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946446git-ninja-04.png)
However, a `git reflog` shows a commit (`b1b0ee9` `HEAD@{4}`) that was lost when I did a hard reset:
![Git reflog](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946447git-ninja-05.png)
### 6. Staging Parts of a Changed File for a Commit ###
It is generally a good practice to make feature-based commits, that is, each commit must represent a feature or a bug fix. Consider what would happen if you fixed two bugs, or added multiple features without committing the changes. In such a situation situation, you could put the changes in a single commit. But there is a better way: Stage the files individually and commit them separately.
Lets say youve made multiple changes to a single file and want them to appear in separate commits. In that case, we add files by prefixing `-p` to our add commands.
git add -p [file_name]
Lets try to demonstrate the same. I have added three new lines to `file_name` and I want only the first and third lines to appear in my commit. Lets see what a `git diff` shows us.
![Changes in repo](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946449git-ninja-06.png)
And lets see what happes when we prefix a `-p` to our `add` command.
![Running add with -p](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946450git-ninja-07.png)
It seems that Git assumed that all the changes were a part of the same idea, thereby grouping it into a single hunk. You have the following options:
- Enter y to stage that hunk
- Enter n to not stage that hunk
- Enter e to manually edit the hunk
- Enter d to exit or go to the next file.
- Enter s to split the hunk.
In our case, we definitely want to split it into smaller parts to selectively add some and ignore the rest.
![Adding all hunks](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946452git-ninja-08.png)
As you can see, we have added the first and third lines and ignored the second. You can then view the status of the repository and make a commit.
![Repository after selectively adding a file](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946454git-ninja-09.png)
### 7. Squash Multiple Commits ###
When you submit your code for review and create a pull request (which happens often in open source projects), you might be asked to make a change to your code before its accepted. You make the change, only to be asked to change it yet again in the next review. Before you know it, you have a few extra commits. Ideally, you could squash them into one using the rebase command.
git rebase -i HEAD~[number_of_commits]
If you want to squash the last two commits, the command that you run is the following.
git rebase -i HEAD~2
On running this command, you are taken to an interactive interface listing the commits and asking you which ones to squash. Ideally, you `pick` the latest commit and `squash` the old ones.
![Git squash interactive](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946455git-ninja-10.png)
You are then asked to provide a commit message to the new commit. This process essentially re-writes your commit history.
![Adding a commit message](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946457git-ninja-11.png)
### 8. Stash Uncommitted Changes ###
Lets say you are working on a certain bug or a feature, and you are suddenly asked to demonstrate your work. Your current work is not complete enough to be committed, and you cant give a demonstration at this stage (without reverting the changes). In such a situation, `git stash` comes to the rescue. Stash essentially takes all your changes and stores them for further use. To stash your changes, you simply run the following-
git stash
To check the list of stashes, you can run the following:
git stash list
![Stash list](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946458git-ninja-12.png)
If you want to un-stash and recover the uncommitted changes, you apply the stash:
git stash apply
In the last screenshot, you can see that each stash has an indentifier, a unique number (although we have only one stash in this case). In case you want to apply only selective stashes, you add the specific identifier to the apply command:
git stash apply stash@{2}
![After un-stashing changes](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946461git-ninja-13.png)
### 9. Check for Lost Commits ###
Although `reflog` is one way of checking for lost commits, its not feasible in large repositories. That is when the `fsck` (file system check) command comes into play.
git fsck --lost-found
![Git fsck results](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946463git-ninja-14.png)
Here you can see a lost commit. You can check the changes in the commit by running git show [commit_hash] or recover it by running `git merge [commit_hash]`.
`git fsck` has an advantage over `reflog`. Lets say you deleted a remote branch and then cloned the repository. With `fsck` you can search for and recover the deleted remote branch.
### 10. Cherry Pick ###
I have saved the most elegant Git command for the last. The `cherry-pick` command is by far my favorite Git command, because of its literal meaning as well as its utility!
In the simplest of terms, `cherry-pick` is picking a single commit from a different branch and merging it with your current one. If you are working in a parallel fashion on two or more branches, you might notice a bug that is present in all branches. If you solve it in one, you can cherry pick the commit into the other branches, without messing with other files or commits.
Lets consider a scenario where we can apply this. I have two branches and I want to cherry-pick the commit `b20fd14: Cleaned junk` into another one.
![Before cherry pick](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946465git-ninja-15.png)
I switch to the branch into which I want to cherry-pick the commit, and run the following:
git cherry-pick [commit_hash]
![After cherry pick](http://dab1nmslvvntp.cloudfront.net/wp-content/uploads/2014/06/1402946467git-ninja-16.png)
Although we had a clean `cherry-pick` this time, you should know that this command can often lead to conflicts, so use it with care.
### Conclusion ###
With this, we come to the end of our list of tips that I think can help you take your Git skills to a new level. Git is the best out there and it can accomplish anything you can imagine. Therefore, always try to challenge yourself with Git. Chances are, you will end up learning something new!
--------------------------------------------------------------------------------
via: http://www.sitepoint.com/10-tips-git-next-level/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.sitepoint.com/git-for-beginners/
[2]:http://www.sitepoint.com/getting-started-git-team-environment/

View File

@@ -0,0 +1,82 @@
微软真的改变对开源软件的态度了吗?
================================================================================
> **在今天的开源软件摘要中微软或许没有对开源软件有一个新的态度就像安卓和windows的对抗Cinnamon和Unity在Ubuntu14.04的对抗。**
微软因为以前对开源软件的态度而臭名昭著但是公司改建后对开源软件发出了积极的信号。CNet报道了微软对开源软件认知的行为的改变。
> [CNet][1]消息:
> 微软自助开源软件有一些时间了,那些曾经反对开源软件的领导者们已经退出了或者不在位了。开软软件现在用在遍布全世界的公司当中,这些公司有些自命不凡但这只是在认识到微软帝国之外的事。
> 一些新的想法反映了企业顶层的一些变化今年二月初Satya Nadella代替鲍尔默成为了微软CEONadella已经给微软带来了一些新的东西改变了微软以前的一些束缚。
>
> [更多报道][2]
>
> ![](http://www.itworld.com/sites/default/files/microsoft-open-source-communist_1.jpg)
>
> 微软和开源社区
> Image credit: [Curako's Blog][3]
我是一个持悲观态度的人但是我认为微软和开源软件之间的信任关系是有待确定的。一个新的CEO和些许改变或许会改变微软在开源世界中的存在状态但是对于微软这么大的企业来说改变并不容易所以对于开源的世界来说微软是否真的改变还有待确定。
我也从来不会忘记微软“欢迎,扩大,压死”的策略来打翻其他的竞争软件,光这一条凡是微软参合的开源项目就必须多一只谨慎的眼,或许这家公司真的改了,但如果没有呢!我们还是用几年时间来观察下吧。
### 安卓对抗windows ###
ZDNet曾经报道过使用数量最多的Linux发行版本但是现在桌面环境仍然是windows的天下但是安卓今年很可能会是用户数量最大的用户终端操作系统。
> [ZDNet][4]报道:
>
> 如果桌面和平板依旧像预期增长的销量安卓平板渐渐蚕食苹果的市场PC市场继续萎缩安卓在2014年末很有可能成为终端用户数量最多的操作系统而且不算安卓PC。
>
> 总而言之安卓几乎统治了Linux终端用户。你可能不会想到它作为桌面使用尽管Intel和AMD努力在让它变成现实但是安卓正在变成使用量第一的终端操作系统。
>
> [更多消息][4]
>
> ![](http://www.itworld.com/sites/default/files/android-devices-versus-windows-pcs.jpg)
> Image credit: [ZDNet][4]
上面提到的并不算真的惊喜移动终端的革命发展了接近10年了。桌面依然还像原来那样重要微软也确实没有真正的在乎过移动设备。即使现在微软在艰难的推他的手机和平板他仍旧认为移动终端市场并不重要。
谷歌严重的破坏了微软在移动领域的努力而现在他在桌面市场又对微软发起了挑战。从chrome OS到安卓谷歌给微软一连串的打击如果你查看下Amazon最受欢迎的[台式机][5]和[笔记本][6]的话你会看到很多chrome OS的电脑甚至是装有安卓的PC。所以人们的购买需求在变得多样化并不局限在windows一家了。
### Cinnamon和Unity在Ubuntu14.04上的对抗 ###
Tech Republic发表了一篇文章介绍了如何在Ubuntu14.04上安装cinnamon研究了一下Ubuntu14.04上用cinnamon替换unity的可行性。
> [Tech Republic][7]报道:
>
> 如果你寻求性能为主不需要其他有特色的可自定义的桌面cinnamon适合你。Cinnamon是一个直观简洁的桌面任何人都可以使用不论你是IT工作者还是你的老妈妈。它非常的简单易用。Cinnamon很平淡不会和你开什么玩笑也不会让你感到有惊奇的感觉但这就是它所注重的。它只会给桌面带来在标准层面上带来实用性它不求突破不耍花招不加条条框框。
>
> Cinnamon是一个很平凡的桌面它只集成了最好的功能并且把它们集成到一起完美整合到一块。如果你可以用一个看起来和用起来都点老掉牙但是性能很好的桌面的话cinnamon完全适合你。如果你喜欢各种花哨的界面和看起来很现代的感觉cinnamon可能就不适合你了。
> [ 更多消息][7]
>
> ![](http://www.itworld.com/sites/default/files/cinnamon-versus-unity-in-ubuntu-1404.jpg)
>
> Image credit: [Tech Republic][7]
我是站在cinnamon这边的,unity有自己的长处但是我从来没用习惯过。Cinnamon更接近传统桌面我用起来不错
但是在别人眼里漂亮的桌面总是很受欢迎。Linux最大的特色就是提供很多很多不同的选择如果你真不知道unity和cinnamon该选择谁你就用自己最喜欢的就行了。
你赞成那些呢?请在下方留下你的评论吧
作者的观点和ITworld无关
--------------------------------------------------------------------------------
via: http://www.itworld.com/open-source/421894/has-microsoft-really-changed-its-attitude-toward-open-source
译者:[jiajia9linuxer](https://github.com/jiajia9linuxer) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.cnet.com/news/dead-and-buried-microsofts-holy-war-on-open-source-software/
[2]:http://www.cnet.com/news/dead-and-buried-microsofts-holy-war-on-open-source-software/
[3]:http://curako.wordpress.com/2010/12/06/the-uneasy-alliance-free-software-vs-open-source/
[4]:http://www.zdnet.com/the-five-most-popular-end-user-linux-distributions-7000030058/http://www.zdnet.com/the-five-most-popular-end-user-linux-distributions-7000030058/
[5]:http://www.amazon.com/Best-Sellers-Electronics-Desktop-Computers/zgbs/electronics/565098/?_encoding=UTF8&camp=1789&creative=390957&linkCode=ur2&tag=fnh-20&linkId=REWXUPB7SQXPDSOL
[6]:http://www.amazon.com/Best-Sellers-Computers-Accessories-Laptop/zgbs/pc/565108/?_encoding=UTF8&camp=1789&creative=390957&linkCode=ur2&tag=fnh-20&linkId=POG3J2CFBHDWBAVL
[7]:http://www.techrepublic.com/article/is-cinnamon-a-worthy-replacement-for-ubuntu-unity/

View File

@@ -1,14 +1,14 @@
Linux 平台七大桌面环境
================================================================================
通常的 Linux 发行版都使用 KDE 或者 GNOME 作为默认的桌面环境。它们都给用户提供了一个易用的并且有吸引力的桌面,并且内置了各式各样的多媒体软件、系统程序、游戏、实用程序、网页开发工具、编程工具等等。这两个桌面致力于提供给用户一个拥有类似于 Windows 操作系统体验的尖端计算环境,而忽略了最小化它们所占用的系统资源。
通常的 Linux 发行版都使用 KDE 或者 GNOME 作为默认的桌面环境。它们都给用户提供了一个原始的并且有吸引力的桌面,并且内置了各式各样的多媒体软件、系统程序、游戏、实用程序、网页开发工具、编程工具等等。这两个桌面致力于提供给用户一个拥有类似于 Windows 操作系统体验的尖端计算环境,而忽略了最小化它们所占用的系统资源。
如果你正在使用 Ubuntu (或者其他Linux发行版) 并且疲于始终使用 Unity 桌面,那么你应该看看这些可以替代 Unity 的选择。我收集了 7 种桌面环境。它们都很棒。在你读完这篇文章之后,请试着使用它们吧。
如果你正在使用 Ubuntu (或者其他Linux发行版) 并且厌倦始终使用 Unity 桌面,那么你应该看看这些可以替代 Unity 的选择。我收集了 7 种桌面环境。它们都很棒。在你读完这篇文章之后,请试着使用它们吧。
### [Mate][1] ###
![](http://i0.wp.com/pulpybucket.com/wp-content/uploads/2014/06/mate.png)
MATE 是 GNOME2 的一个分支。它提供了一个自然且吸引人的桌面环境。它是 Linux 和其 Unix-like 工作环境中的传统工作框架的代表。MATE 正在改善以使用新的技术来保留传统的桌面体验。
MATE 是 GNOME2 的一个分支。它提供了一个自然且吸引人的桌面环境。它是 Linux 和其它类 Unix 工作环境中的传统工作框架的代表。MATE 正在改善以使用新的技术来保留传统的桌面体验。
在 Ubuntu 14.04 中,可以直接从 Ubuntu 软件中心获取 MATE 桌面。
@@ -16,19 +16,19 @@ MATE 是 GNOME2 的一个分支。它提供了一个自然且吸引人的桌面
![](http://i2.wp.com/pulpybucket.com/wp-content/uploads/2014/06/Kubuntu-9.04-DesktopEffects.png)
KDE 是一个类似于 GNOME 一样的重量级桌面环境。它在本文章所提及的7种桌面环境中被认为是最华丽最重量级的一个。它同样是一个类似于 Windows 的桌面,在这一点上没有什么特殊的变化。不过 KDE 非常有特点,但是随之而来的是大量的设置来提升你的桌面体验。同样的,有很多关于 KDE 的话题。所以真的可以从 KDE 的特点中获益,并且保持你所想的外观。
KDE 是一个类似于 GNOME 一样的重量级桌面环境。它在本文章所提及的7种桌面环境中被认为是最华丽最重量级的一个。它同样是一个类似于 Windows 的桌面,在这一点上没有什么特殊的变化。不过 KDE 非常有特点,但是随之而来的是大量的设置来提升你的桌面体验。同样的,有很多关于 KDE 的话题。所以真的可以从 KDE 的特点中获益,并且保持你所想的外观。
### [Cinnamon][3] ###
![](http://i1.wp.com/pulpybucket.com/wp-content/uploads/2014/06/WD9O-C08B-ESP5.jpg)
Cinnamon 是一个基于 Gtk+ 的环境。它最初作为 GNOME Shell 的一个用户界面分支,由 Linux Mint 创造。 Cinnamon 本质上是为了推行使用终端和定点装置。无论是使用鼠标,还是使用触摸屏都可以获得同样便捷的操作。不像 KDE Plasma 工作空间, 只有一种 GUI。 当前版本—— Cinnamon 2.0 展示于2013年10月10日。
Cinnamon 是一个基于 Gtk+ 的环境。它最初作为 GNOME Shell 的一个用户界面分支,由 Linux Mint 创造。 Cinnamon 本质上是为了推行使用终端和定点装置。无论是使用鼠标,还是使用触摸屏都可以获得同样便捷的操作。不像 KDE Plasma 工作空间,只有一种 GUI。 当前版本—— Cinnamon 2.0 于2013年10月10日发布
### [Unity][4] ###
![](http://i1.wp.com/pulpybucket.com/wp-content/uploads/2014/06/Ubuntu_13.10_Desktop.png)
Unity 是 GNOME 桌面环境的一个界面,由 Canonical 公司创建,使用于 Ubuntu 系统中。Unity 最初现身于 Ubuntu 10.10 的上网本版本中。它起初打算充分利用上网本的屏幕空间例如一个被称为启动器的垂直应用切换器a vertical app switcher called launcher和一个节省垂直空间的多功能顶部菜单栏。Unity 不像 GNOME , KDE, Xfce 或者 LXDE 是许多软件的合集,它是作为使用实用程序而开发的it is developed to use available utilities
Unity 是 GNOME 桌面环境的一个界面,由 Canonical 公司创建,使用于 Ubuntu 系统中。Unity 最初现身于 Ubuntu 10.10 的上网本版本中。它起初打算充分利用上网本的屏幕空间例如一个被称为启动器的垂直应用切换器a vertical app switcher called launcher和一个节省垂直空间的多功能顶部菜单栏。Unity 不像 GNOMEKDE Xfce 或者 LXDE 是许多软件的合集,它是作为使用实用功能而开发的。
### [GNOME Shell][5] ###
@@ -36,25 +36,25 @@ Unity 是 GNOME 桌面环境的一个界面,由 Canonical 公司创建,使
GNOME 提供了桌面核心接口例如交换窗口启动应用程序以及显示提示。它利用先进图形硬件来实现吸引人的创新的界面思想提供了愉悦简单的用户体验。GNOME Shell 定义了 GNOME 3 的客户体验。
作为 GNOME 的一个重要组成部分, GNOME Shell 的稳定版本首次发布于 2011年3月3日。
作为 GNOME 的一个重要组成部分, GNOME Shell 的稳定版本首次发布于2011年3月3日。
### [Xfce][6] ###
![](http://i0.wp.com/pulpybucket.com/wp-content/uploads/2014/06/New-Picture1.jpg)
Xfce 是一个轻量级的桌面环境,围绕 GTK 框架实现。看起来很像 Gnome 2 或者 MATE然而 Xfce 是它们的轻量级替代品。相较于 KDE 和 GNOME 3 而言Xfce 非常轻量级,所以它是运行小工具或者那些希望实现最大执行效率的框架理想环境。它还不是可以获得的最轻量级的选择 - 请继续往下看 - 然而Xfce 的确完成了执行效率和功能的平衡。
Xfce 是一个轻量级的桌面环境,围绕 GTK 框架实现。看起来很像 Gnome 2 MATE然而 Xfce 是它们的轻量级替代品。相较于 KDE 和 GNOME 3 而言Xfce 非常轻量级,所以它对于运行轻量级的工具或者那些希望实现最大执行效率的框架使用者来说是理想环境。它还不是可以获得的最轻量级的选择 - 请继续往下看 - 然而Xfce 的确完成了执行效率和功能的平衡。
### [LXDE][7] ###
![](http://i2.wp.com/pulpybucket.com/wp-content/uploads/2014/06/LXDE_desktop_full.png)
LXDE 显然是桌面环境中最轻量级的选择,至少在消费级的桌面标准中是这样。这个基于 GTK 的桌面环境使用了很多轻量级的选择替代了默认的应用(例如 Abiword, Gnumeric, 而不是 LibreOffice。它提供了无闪烁的视觉冲击 - 总体感觉也没有很不错,没有复杂的设置。但是LXDE 仍然提供了漂亮的桌面和完整的功能。当你需要快速简洁时,它就是你需要的选择。
LXDE 显然是桌面环境中最轻量级的选择,至少在传统的桌面标准中是这样。这个基于 GTK 的桌面环境使用了很多轻量级的选择替代了默认的应用(例如 Abiword, Gnumeric, 而不是 LibreOffice。它没有提供 flash 视觉冲击 总体感觉也不是特别的棒,没有高级的设置。但是LXDE 仍然提供了漂亮的桌面和完整的功能。当你需要快速简洁时,它就是你的选择。
--------------------------------------------------------------------------------
via: http://pulpybucket.com/top-7-desktop-environment-linux/
译者:[wwhio](https://github.com/wwhio) 校对:[校对者ID](https://github.com/校对者ID)
译者:[wwhio](https://github.com/wwhio) 校对:[Caroline](https://github.com/carolinewuyan)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
@@ -65,3 +65,4 @@ via: http://pulpybucket.com/top-7-desktop-environment-linux/
[5]:http://www.gnome.org/
[6]:http://xfce.org/
[7]:http://lxde.org/

View File

@@ -1,33 +0,0 @@
用iCup在linux追世界杯
================================================================================
![](http://180016988.r.cdn77.net/wp-content/uploads/2014/06/icup2014-790x389.png)
Linux 极客们,
在本文简短的叙述中我将教你如何在Linux中安装一个非常棒的2014FIFA世界杯APP。这个应用叫iCup支持WindowsMac以及伟大的Linux。
我看足球比赛已经有很长的时间了所以我得我的电脑上安装这样的应用来保持更新2014世界杯的最新情况。我不想在我朋友们面前看起来一无所知。iCup应用正好提供了每一场赛程、比分、球队教练组等信息。更有提供实时比赛更新给你正在进行的比赛的最新数据。
### 支持一下功能: ###
- 30种语言支持完全本地化使用语言菜单选择
- 可以随意调整窗口大小的独家灵活的界面
- 可按天、阶段检索的比赛日历
- 可视化分组
- 支持自动转变比赛时间来适应本地时间和格式
- 一键化社交网络发表比赛评论支持FacebookGoogle+和Twitter
- 支持代理(支持基本认证和摘要认证方法)
我已经在Ubuntu12.04LTS上测试并且运很好!目前为止,我没有经历过任何错误或崩溃。你可以十分轻松地安装这个很棒的应用,通过[官方网站][1]你可以得到压缩包然后你可以解压到任何你喜欢的地方。解压完成后双击iCup 2014 FREE- Brazil运行。
iCup 对我非常有用,我希你也能享受到。
--------------------------------------------------------------------------------
via: http://www.unixmen.com/install-icup-2014-linux/
译者:[Vic020](http://www.vicyu.net) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.e-link.it/icup/brazil2014/icup-brazil-2014-desktop-app.php

View File

@@ -1,13 +1,12 @@
-------------translating by tenght~
9 commands to check hard disk partitions and disk space on Linux
查看Linux硬盘分区和磁盘空间的9个命令
================================================================================
In this post we are taking a look at some commands that can be used to check up the partitions on your system. The commands would check what partitions there are on each disk and other details like the total size, used up space and file system etc.
Commands like fdisk, sfdisk and cfdisk are general partitioning tools that can not only display the partition information, but also modify them.
在这篇文章中,我们将看看用来检查你的系统分区的一些命令,这些命令将检查每个磁盘的分区情况和其他细节,例如总大小,用完的空间和文件系统等。
像fdisksfdisk和cfdisk命令是一般分区工具不仅可以显示分区信息还可以修改。
### 1. fdisk ###
Fdisk is the most commonly used command to check the partitions on a disk. The fdisk command can display the partitions and details like file system type. However it does not report the size of each partitions.
Fdisk是检查磁盘上分区的最常用命令fdisk命令可以显示分区和细节如文件系统类型但是它并不报告每个分区的大小。
$ sudo fdisk -l
@@ -36,11 +35,10 @@ Fdisk is the most commonly used command to check the partitions on a disk. The f
Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 7907327 3952640 b W95 FAT32
Each device is reported separately with details about size, seconds, id and individual partitions.
单独显示了每个设备的详细信息大小ID和单个分区。
### 2. sfdisk ###
Sfdisk is another utility with a purpose similar to fdisk, but with more features. It can display the size of each partition in MB.
Sfdisk是另一种跟fdisk目的相似的实用工具但具有更多的功能。它可以以MB为单位显示每个分区的大小。
$ sudo sfdisk -l -uM
@@ -75,20 +73,20 @@ Sfdisk is another utility with a purpose similar to fdisk, but with more feature
### 3. cfdisk ###
Cfdisk is a linux partition editor with an interactive user interface based on ncurses. It can be used to list out the existing partitions as well as create or modify them.
Cfdisk是一个基于ncurses提供字符终端处理库包括面板和菜单的带有交互式用户界面的Linux分区编辑器它可以用来列出现有分区以及创建或修改这些分区。
Here is an example of how to use cfdisk to list the partitions.
下面是一个如何使用Cfdisk来列出分区的例子。
![linux cfdisk disk partitions](http://www.binarytides.com/blog/wp-content/uploads/2014/06/linux-cfdisk.png)
Cfdisk works with one partition at a time. So if you need to see the details of a particular disk, then pass the device name to cfdisk.
Cfdisk工作在同一个分区所以如果你需要看某一磁盘的细节可以把设备名传给Cfdisk。
$ sudo cfdisk /dev/sdb
### 4. parted ###
Parted is yet another command line utility to list out partitions and modify them if needed.
Here is an example that lists out the partition details.
Parted是另一个命令行实用程序用来列出分区,如果需要的话,也可进行修改。
下面是一个例子,列出了详细的分区信息。
$ sudo parted -l
Model: ATA ST3500418AS (scsi)
@@ -115,9 +113,9 @@ Here is an example that lists out the partition details.
### 5. df ###
Df is not a partitioning utility, but prints out details about only mounted file systems. The list generated by df even includes file systems that are not real disk partitions.
Df是不是一个分区工具但它打印出挂装文件系统的细节Df可以列出甚至不是真实的磁盘分区的文件系统。
Here is a simple example
这里是个简单的例子:
$ df -h
Filesystem Size Used Avail Use% Mounted on
@@ -131,16 +129,16 @@ Here is a simple example
/dev/sda8 196G 154G 33G 83% /media/13f35f59-f023-4d98-b06f-9dfaebefd6c1
/dev/sda5 98G 37G 62G 38% /media/4668484A68483B47
Only the file systems that start with a /dev are actual devices or partitions.
文件系统只有以 /dev 开始的,是实际设备或分区。
Use grep to filter out real hard disk partitions/file systems.
使用grep命令来筛选出实际的硬盘分区或文件系统。
$ df -h | grep ^/dev
/dev/sda6 97G 43G 49G 48% /
/dev/sda8 196G 154G 33G 83% /media/13f35f59-f023-4d98-b06f-9dfaebefd6c1
/dev/sda5 98G 37G 62G 38% /media/4668484A68483B47
To display only real disk partitions along with partition type, use df like this
为了只显示真正的磁盘分区与分区类型可以这样使用Df
$ df -h --output=source,fstype,size,used,avail,pcent,target -x tmpfs -x devtmpfs
Filesystem Type Size Used Avail Use% Mounted on
@@ -148,11 +146,11 @@ To display only real disk partitions along with partition type, use df like this
/dev/sda8 ext4 196G 154G 33G 83% /media/13f35f59-f023-4d98-b06f-9dfaebefd6c1
/dev/sda5 fuseblk 98G 37G 62G 38% /media/4668484A68483B47
Note that df shows only the mounted file systems or partitions and not all.
请注意Df只显示已挂载的文件系统或分区并不是所有。
### 6. pydf ###
Improved version of df, written in python. Prints out all the hard disk partitions in a easy to read manner.
用Python写的Df的改进版本以一个易于阅读的方式打印出所有磁盘分区。
$ pydf
Filesystem Size Used Avail Use% Mounted on
@@ -160,12 +158,13 @@ Improved version of df, written in python. Prints out all the hard disk partitio
/dev/sda8 195G 153G 32G 78.4 [#######..] /media/13f35f59-f023-4d98-b06f-9dfaebefd6c1
/dev/sda5 98G 36G 61G 37.1 [###......] /media/4668484A68483B47
Again, pydf is limited to showing only the mounted file systems.
另外pydf限制为仅显示已挂载的文件系统
### 7. lsblk ###
Lists out all the storage blocks, which includes disk partitions and optical drives. Details include the total size of the partition/block and the mount point if any.
Does not report the used/free disk space on the partitions.
列出了所有的存储块,包括磁盘分区和光盘驱动器。细节包括所有分区/块总大小和挂载点。
不报告分区上的已使用和空闲磁盘空间。
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
@@ -180,13 +179,14 @@ Does not report the used/free disk space on the partitions.
└─sdb1 8:17 1 3.8G 0 part
sr0 11:0 1 1024M 0 rom
If there is no MOUNTPOINT, then it means that the file system is not yet mounted. For cd/dvd this means that there is no disk.
Lsblk is capbale of displaying more information about each device like the label and model. Check out the man page for more information
如果没有挂载点这就意味着文件系统未安装对于cd/dvd这意味着没有磁盘。
lsblk能够显示每个设备的更多信息如标签和模型更多请查看信息手册。
### 8. blkid ###
Prints the block device (partitions and storage media) attributes like uuid and file system type. Does not report the space on the partitions.
打印块设备分区和存储介质属性例如UUID和文件系统类型不报告分区空间。
$ sudo blkid
/dev/sda1: UUID="5E38BE8B38BE6227" TYPE="ntfs"
@@ -198,7 +198,7 @@ Prints the block device (partitions and storage media) attributes like uuid and
### 9. hwinfo ###
The hwinfo is a general purpose hardware information tool and can be used to print out the disk and partition list. The output however does not print details about each partition like the above commands.
hwinfo是一个通用的硬件信息的工具,可以用来打印出磁盘和分区表,输出不再像上面的命令那样打印每个分区的详细信息。
$ hwinfo --block --short
disk:
@@ -216,17 +216,18 @@ The hwinfo is a general purpose hardware information tool and can be used to pri
/dev/sr0 SONY DVD RW DRU-190A
### Summary ###
### 总结 ###
The output of parted is concise and complete to get an overview of different partitions, file system on them and the total space. Pydf and df are limited to showing only mounted file systems and the same on them.
parted的输出简洁而完整的得到不同分区的概述、上面的文件系统以及总空间。pydf和df被限制为只显示和他们一样的已挂载的文件系统。
Fdisk and Sfdisk show a whole lot of information that can take sometime to interpret whereas, Cfdisk is an interactive partitioning tool that display a single device at a time.
fdisk和sfdisk显示完整的大量的可以花些时间来解释的信息cfdisk是一个互动的分区工具每次显示一个单一的设备。
So try them out, and do not forget to comment below.
来尝试下吧,别忘了在下面评论哟!
--------------------------------------------------------------------------------
via: http://www.binarytides.com/linux-command-check-disk-partitions/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
译者:[tenght](https://github.com/tenght) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@@ -0,0 +1,495 @@
如何编写你的第一个Linux内核模块
================================================================================
>你是否曾经想过开始去攻击一个内核?然而却不知道从何开始?让我们来告诉你该怎么做…
内核程序通常被视为一个黑色魔术。从Arthur C Clarke的理念来说确实是这样。Linux内核与用户空间的确存在很多不同许多抽象的东西被搁置你需要格外小心当一个bug存在代码中时将会影响到整个系统。这不是一个简单的方法去改浮点数堆栈既被固定了而且很小你写的代码通常是异步的所以你需要考虑到并发性的问题。尽管如此Linux内核是一个庞大且复杂的C程序对每个人都提供开源阅读、学习和改进你也可以成为其中的一份子。
> “The easiest way to start kernel programming
> is to write a module a piece of code that
> can be dynamically loaded into the kernel.”
> “最简单的方法来开始写内核程序
> 就是写一个内核模块 - 这段代码
> 可以动态加载到内核中。”
可能开始学习内核程序的最简单方式来就是先编写一个模块——一段代码可以动态加载到你的内核和卸载。但是也存在一些限制比如说什么模块可以这样做——例如它们不能添加或者删除常用数据结构的一些字段例如过程描述。但是在其它方面它们是成熟的内核级别代码根据需要并经常被编译到内核中因此删除所有受限。在Linux源代码树开发和编译一个模块这不出乎医疗应该成为out-of-tree构建是完全有可以的如果你只想玩一下而不去提交你主线内核的改动这是非常方便的。
在这个教程中,我们将开发一个简单的内核模块,创建**/dev/reverse**设备。当字符写到这个设备就回次序颠倒读出来就像“Hello World”会变成“World Hello”。这是一个很受欢迎的程序员面试难题当你利用自己的能力在内核级别实现这个功能时可以使你得到一些加分。在我们开始之前会有一句提示有一个bug寸在你的模块有可能导致你的系统崩溃不太可能但是可能和数据丢失。
###尽可能避开root用户 ###
>默认情况下,**/dev/reverse**只能对根用户可用,所以你只能通过**sudo**来运行你的测试程序。为了修复这个问题,创建一个**/lib/udev/rules.d/99-reverse.rules**文件,其中包含:
>
> SUBSYSTEM=="misc", KERNEL=="reverse", MODE="0666"
>不要忘记重新插入模块。通常来说使设备接点可访问对非根用户来说通常不是一个好主意,但是在开发过程中的确非常有用。更不值得一提的是作为根用户运行测试二进制文件也不是一个好主意。
#### 关于模块的剖析 ####
由于大多数Linux内核模块都是用C编写的除了底层的特定于体系结构的部分所以建议把你的内核保存在一个独立的文件中叫做reverse.c).我们会将整份源代码放在GitHub中——在这里不我们可以看到一些小片段。首先我们要把一些常见的头文件和描述该模块使用预定义的宏包含进来
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Valentine Sinitsyn <valentine.sinitsyn@gmail.com>");
MODULE_DESCRIPTION("In-kernel phrase reverser");
这一切其实都很简单,除了**MODULE_LICENSE()**之外这不是一个纯粹的标记。内核尤其钟情于GPLcompatible 代码所以如果你设置一些非GPL兼容的认证也就是说“私有认证”某些特定的内核功能在你的模块中将不可用。
### 什么时候不该一个内核模块 ###
>- 你开发一个USB驱动时 - 需要查阅[libusb][1].
>- 你开发一个系统文件时 - 试试 [FUSE][2].
>- 你扩展Netfilter - [libnetfilter_queue][3] 也许能够对你有所帮助。
>通常,本地代码会运行得更好,但是很多程序来说这种情况并不是至关重要的。
由于内核程序通常是异步的,它并没有 **main()** 功能Linux是按顺序运行你的模块。取而代之你将会提供各种事件的回滚例如
static int __init reverse_init(void)
{
printk(KERN_INFO "reverse device has been registered\n");
return 0;
}
static void __exit reverse_exit(void)
{
printk(KERN_INFO "reverse device has been unregistered\n");
}
module_init(reverse_init);
module_exit(reverse_exit);
这里,我们定义的函数被称为模块的插入和删除。只有第一个是必要的。目前,他们简单地发送一条内核指令给缓存中(可以通过用户界面发送 **dmesg** 命令);**KERN_INFO**是一个日至级别(切记这里没有逗号).**__init** 和 **__exit** 都是特性 - 把元数据添加到函数或者变量。在用户界面中C代码的属性是很罕见的但是在内核中却很普遍。标有**__init**都会经过初始化以后被回收(要记得之前释放未使用的内核内寸...这条消息?)。**__exit** 表示,当代码静态构建到内核中时,函数会安全地优化。最后,**module_init()** 和**module_exit()**宏设置**reverse_init()** 和 **reverse_exit()**作为我们模块生命周期的回滚。实际的函数名称并不重要;你可以按着你的想法命名为**init()** 和**exit()** 或者 **start()****stop()**。他们都是静态声明,你在外部模块是看不到的。实际上,许多内核中的模块是可视的除非是明显的导出。然而,在函数前面添加你的函数作为前缀通常是内核程序员约定俗成的做法。
这些都是些基本概念 - 让我们来做更多有趣的事情吧。模块可以添加参数,例如:
# modprobe foo bar=1
**modinfo**显示了所有模块可以接受的参数,这些也可以在**/sys/module//parameters**文件中找到。我们的模块需要一个缓存区来存储参数 - 让我们来调整大小使用户可配置。在**MODULE_DESCRIPTION()**添加如下三行:
static unsigned long buffer_size = 8192;
module_param(buffer_size, ulong, (S_IRUSR | S_IRGRP | S_IROTH));
MODULE_PARM_DESC(buffer_size, "Internal buffer size");
这里我们定义一个变量来存储值封装成一个参数使得每个人都可以通过sysfs对其进行阅读。这个参数的描述在最后一行出现在modinfo的输出里。
由于用户可以直接设置**buffer_size**,我们需要在**reverse_init()**中对其进行清理。你应该经常检查来自内核意外数据 - 付过你不这样做,你将是在给自己制造内核异常甚至是安全漏洞。
static int __init reverse_init()
{
if (!buffer_size)
return -1;
printk(KERN_INFO
"reverse device has been registered, buffer size is %lu bytes\n",
buffer_size);
return 0;
}
来自模块初始化函数的非0返回值意味着执行失败。
### 导航 ###
>当你正在开发模块时linux内核就是无限的源头。然而它确实很大你也许在寻找的过程中会遇到很多困难。幸运的是在庞大的代码库面前有许多工具使这个过程变得简单。首先有一个叫Cscope的工具——在终端运行中一个比较经典的工具。简单地运行**make cscope && cscope**在源代码一级目录。Cscope很好地集成了Vim和Emacs于是你又可以不离开你喜爱地编辑工具。
>基于终端工具的使用也许不是你的强项,请访问[http://lxr.free-electrons.com][4].这是一个基于网站的内核导航工具没有太多的类似Cscope的特性例如你不能轻易地查找函数的用法但是它还是可以给你提供快速的查找。
现在,是时候编译模块了。你需要你正在运行的内核版本头文件(**linux-headers**或者同等包)和**build-essential** 或者类是。接下来是时候创建一个叫Makefile的样板
obj-m += reverse.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
现在,使用**make**来创建你的第一个模块。如果你正确输入,你将会找到在当前目录里找到 **reverse.ko**。插入**sudo insmod reverse.ko**并运行:
$ dmesg | tail -1
[ 5905.042081] reverse device has been registered, buffer size is 8192 bytes
祝贺你!可是,现在这一行告诉你一个假象 —— 这里并不存在设备接点。让我们修复它吧。
#### 混杂设备 ####
在Linux中有一种特殊的字符设备类型成为“miscellaneous”简写“misc”。这是专为单点小型设备驱动而涉及的而且能恰好满足我们的需求。所有的misc设备共享相同的主设备号10所以一个驱动程序(**drivers/char/misc.c**)可以查看到他们的所有设备,你可以从他们的次设备号分辨出他们。从其他意义来说,他们也只是普通的字符设备。
为了给设备注册一个次要设备号(和一个接入点),你需要先声明**struct misc_device**,填写字段(注意语法),并调用**misc_register()**这个结构的指针。为此,你还需要把**linux/miscdevice.h** 头文件包含进去:
static struct miscdevice reverse_misc_device = {
.minor = MISC_DYNAMIC_MINOR,
.name = "reverse",
.fops = &reverse_fops
};
static int __init reverse_init()
{
...
misc_register(&reverse_misc_device);
printk(KERN_INFO ...
}
在这里我们要求第一个可用的动态的次设备号命名为“reverse”;省略号表示已经省略了的代码,这些省略了的代码是我们之前看过的。别忘了在模块卸载后注销该设备:
static void __exit reverse_exit(void)
{
misc_deregister(&reverse_misc_device);
...
}
fop字段存储了一个指向**file_operations**在linux/fs.h中声明结构的指针这是指向我们模块的接入点。**reverse_fops**定义如下:
static struct file_operations reverse_fops = {
.owner = THIS_MODULE,
.open = reverse_open,
...
.llseek = noop_llseek
};
另外,**reverse_fops**包含了一组将要执行的回调函数(也成为方法),当用户空间代码打开了一个设备,从中进行读写或者关闭文件描述。如果你忽略了这些,那么将会有一个只能的回退来取代它。这就是我们要明确地给**noop_llseek()**设置**llseek**的方法,(顾名思义)而它却什么都不干。默认地实现是改变了文件的指针,我们也不想我们的设备被识别(这将是你们今天的家庭作业)。
#### 在结束时开启 ####
让我们来实现这个方法。我们将会为每一个文件描述的打开分配一个新的缓冲区来给它自由关闭。这确实是不安全:如果一个用户空间应用的漏洞描述(或者是故意的),但它可能占用着内存,导致系统无法正常使用。在真实应用中,你应该经常考虑到这些可能性。但是在本教程中,这个方法是可接受的。
我们需要一个结构来描述缓冲区。内核提供了许多通用的数据结构链表双键链表哈希表树等等。然而缓冲区通常从零开始实现的。我们将调用我们的“struct buffer”:
struct buffer {
char *data, *end, *read_ptr;
unsigned long size;
};
**data**是一个寸在缓冲区指向字符串的指针数据,而结尾是在字符串结束后的第一个字节。缓冲区的大小是为完整性而存储的 —— 目前,我们不使用该字段。你不应该认为你的用户结构会正确地初始化所有这些,所以你应更好地在函数中封装缓冲区和重新分配分配。他们通常命名为**buffer_alloc()****buffer_free()**.
static struct buffer *buffer_alloc(unsigned long size)
{
struct buffer *buf;
buf = kzalloc(sizeof(*buf), GFP_KERNEL);
if (unlikely(!buf))
goto out;
...
out:
return buf;
}
Kernel memory is allocated with **kmalloc()** and freed with **kfree()**; the **kzalloc()** flavour sets the memory to all-zeroes. Unlike standard **malloc()**, its kernel counterpart receives flags specifying the type of memory requested in the second argument. Here, **GFP_KERNEL** means we need a normal kernel memory (not in DMA or high-memory zones) and the function can sleep (reschedule the process) if needed. **sizeof(*buf)** is a common way to get the size of a structure accessible via pointer.
内核内存使用通过**kmalloc()**来分配并**kfree()**来释放内存;**kzalloc()**会将内存设置为全零。不像标准的**malloc()**,它的内核版本接收标志在第二个参数指定内存的类型。这里,**GFP_KERNEL**意味着我们需要一个正常的内核内存(并非直接内存存取或者高内存区)以及函数可以按需休眠(重新安排流程)。**sizeof(*buf)**是一种常用的方式通过指针来获取结构的大小。
你应该经常检查**kmalloc()**的返回值;非空指针将会导致内核崩溃。另外还要注意到**unlikely()**宏的用法。它(与**likely()**宏相反)广泛用于表示内核中判断条件几乎是真(或假)。它不影响流控制,但是有助于现代处理器提高分支预测的性能。
最后,注意**gotos**。他们通常被认为是邪恶的然而在Linux内核中和一些其它系统软件利用他们集中实现函数退出。这将导致更少的深度嵌套和可读代码就更像**try-ctach**块中使用的更高级语言。
有**buffer_alloc()** 和 **buffer_free()**的存在,**open** 和 **close**的方法就回变得非常简单。
static int reverse_open(struct inode *inode, struct file *file)
{
int err = 0;
file->private_data = buffer_alloc(buffer_size);
...
return err;
}
**struct file**是一个标准的内核数据结构,用于存储关于打开的文件信息,例如当前文件位置(**file->f_pos**),标志(**file->f_flags**),或者打开方式(**file->f_mode**).另外一个字段, **file->private_data**常用于关联文件和一些任意数据。它的类型是void *,但是对内核意外的文件拥有者是不透明的。我们将把它存储在缓冲区内。
如果缓存区分配失败,我们通过返回负值显示调用用户空间代码(**-ENOMEM**).C库中利用**open(2)**系统调用(可能是, **glibc**)将会进行检测并适当地设置**errno** 。
#### 学习如何读和写 ####
读和写的方法才是真正工作的完成。当数据在缓冲区被读和写时,我们放弃之前的内容和反向地存储该字段,不需要任何临时存储。读的方法是简单地复制内核缓冲区到用户空间。但是如果还是没有数据在缓冲区时,什么是**reverse_read()**方法应该做的呢?在用户空间,**read()**调用会阻塞,知道数据可用。在内核中,你需要等待。幸运的是,有一个叫做“等待列队”的机制。
这个想法是很简单的。如果一个当前的进程需要等待一些事件,它的描述(a **struct task_struct** 存储为 ‘当前’)被放在非运行状态sleeping并添加到队列。接着**schedule()**会计划选择另一个进程来运行。生成事件的代码通过使用队列把等待事件放进**TASK_RUNNING** 状态来唤醒它们。调度表会选择在未来的某个点选择它们中的一个。Linux有许多非运行进程状态尤其是**TASK_INTERRUPTIBLE**(睡眠状态可以被一个信号中断)和**TASK_KILLABLE**(正在睡眠状态的进程可以被阻断)。所有这些都会被正确把握,而等待队列将会为你安排好这一切。
存储我们的读写队列头的一个天然场所是结构缓存区,所以通过添加**wait_queue_head_t read_queue**字段开始。你将会将**linux/sched.h**包含其中。一个等待队列将会通过DECLARE_WAITQUEUE()宏被静态声明。在我们的例子中,是需要动态初始化的,于是我们添加**buffer_alloc()**这一行:
init_waitqueue_head(&buf->read_queue);
我们等待可用数据;或者**read_ptr != end**条为真时。我们需要等待可终端例如通过Ctrl+C).所以读的方法应该这样开始:
static ssize_t reverse_read(struct file *file, char __user * out,
size_t size, loff_t * off)
{
struct buffer *buf = file->private_data;
ssize_t result;
while (buf->read_ptr == buf->end) {
if (file->f_flags & O_NONBLOCK) {
result = -EAGAIN;
goto out;
}
if (wait_event_interruptible
(buf->read_queue, buf->read_ptr != buf->end)) {
result = -ERESTARTSYS;
goto out;
}
}
...
我们会进行循环,直到有可用数据出现,并且在如果不是的情况下使用**wait_event_interruptible()**(这是一个宏,不是一个函数,这就是为什么队列要通过一个值来传送)来等待。如果是**wait_event_interruptible()**的情况下,很好,会中断,并返回一个非零值,我们将它翻译为**-ERESTARTSYS**.这段代码意味着系统调用将会重启。**file->f_flags**在一个非阻塞模式检查打开的文件数量:如果没有数据,我们会返回**-EAGAIN**.
我们不能使用**if()**来取代**while()**,由于还有许多进程正在等待数据。当**write**方法唤醒他们,调度表会用不可预知的方法来选择一个运行,那么这段代码将在适时有一个机会执行,缓冲区会再次清空。现在我们需要从**buf->data**复制数据到用户空间。**copy_to_user()**内核函数是实现如下:
size = min(size, (size_t) (buf->end - buf->read_ptr));
if (copy_to_user(out, buf->read_ptr, size)) {
result = -EFAULT;
goto out;
}
如果用户空间指针是错误的,这个调用将可能失败;如果发生这种情况,我们会返回**-EFAULT**.切记不要相信任何来自内核意外的东西!
buf->read_ptr += size;
result = size;
out:
return result;
}
为了使数据在任意块可读,简单的算法往往是必要的。这个方法返回了读或者一段错误代码的字节数。
这个写的方法更简单和更简短。首先,我们检查缓冲区是否有足够的空间,接着我们使用**copy_from_userspace()**功能来获取数据。接着**read_ptr**和结束指针重置和缓冲区内容是相反的:
buf->end = buf->data + size;
buf->read_ptr = buf->data;
if (buf->end > buf->data)
reverse_phrase(buf->data, buf->end - 1);
这里,**reverse_phrase()**干了所有重活。这有赖于**reverse_word()**函数,既简短有可以做内联标记。这是另一种常见的优化;然而,你不应该过度使用它,因为内敛使用会使内核镜像变得不必要的大。
最后,我们需要唤醒正在**read_queue**等待数据的进程,正如先前面熟。**wake_up_interruptible()**实现如下:
wake_up_interruptible(&buf->read_queue);
喲!你现在拥有一个至少可以成功调试的内核模块。现在是时候来测试它了。
### 调试内核代码 ###
>也许在内核中大多数常用的调试方法是打印。你可以使用纯**printk()**(大概和**KERN_DEBUG**日志级别相似)如果你愿意。然而,也有更好的方法。使用**pr_debug()** 或者 **dev_dbg()**,如果你正在写一个有“struct device”设备驱动他们支持动态调试(**dyndbg**)特征并可以启用或者禁止请求(请看**Documentation/dynamic-debug-howto.txt**)。对于纯开发的信息,使用**pr_devel()**除非DEBUG被定义这将成为一个空操作。要为我们的模块启用DEBUG包括
>
> CFLAGS_reverse.o := -DDEBUG
>
>在 Makefile中。在这之后使用**dmesg**来查看通过**pr_debug()** 或者 **pr_devel()**生成调试信息。
>或者,你可以通过发送调试信息到控制台。做这一步,你也可以设置**console_loglevel**内核变量为8甚至更高(**echo 8 /proc/sys/kernel/printk**)或者临时在日志级别高的问题上打印调试信息例如**KERN_ERR**.自然而然,你将会在你发布代码之前删除这类调试语句。
>注意内核在控制台出现的内核信息并不是像Xterm的一个在终端模拟窗口这就是为什么你会发现建议不要在X环境下开发内核。
### 惊喜,惊喜! ###
编译模块并加载大内核:
$ make
$ sudo insmod reverse.ko buffer_size=2048
$ lsmod
reverse 2419 0
$ ls -l /dev/reverse
crw-rw-rw- 1 root root 10, 58 Feb 22 15:53 /dev/reverse
一切似乎都就绪了。现在,来测试模块如何工作,我们将要写一段小程序来反转第一个命令行参数。在**main()**函数(sans error checking)你可以看到如下:
int fd = open("/dev/reverse", O_RDWR);
write(fd, argv[1], strlen(argv[1]));
read(fd, argv[1], strlen(argv[1]));
printf("Read: %s\n", argv[1]);
像这样运行:
$ ./test 'A quick brown fox jumped over the lazy dog'
Read: dog lazy the over jumped fox brown quick A
它正常工作了!玩得跟尽兴一点:尝试传递一个单词或者一个字母的字符串,空的或者是非英语字符串(如果你有一个键盘布局设置)以及其它人和东西。
现在让我们把事情变得更棘手一点。我们将要创建2个进程用于共享文件描述因此还有内核缓冲区。一个将持续写字符串到设备中去而另一个回去读取它们。**fork(2)**系统笤俑在下面例子中用到,但是线程还是会很好地工作。我也省略了开关设备的代码和错误检查(再次提到):
char *phrase = "A quick brown fox jumped over the lazy dog";
if (fork())
/* Parent is the writer */
while (1)
write(fd, phrase, len);
else
/* child is the reader */
while (1) {
read(fd, buf, len);
printf("Read: %s\n", buf);
}
你希望这段程序输出什么呢?下面是我从我的笔记本电脑上获得的:
Read: dog lazy the over jumped fox brown quick A
Read: A kcicq brown fox jumped over the lazy dog
Read: A kciuq nworb xor jumped fox brown quick A
Read: A kciuq nworb xor jumped fox brown quick A
...
这里接下来会发生什么?这是一场比赛。我们认为**read**和**write**是原子,或者从一开始到结束执行一个指令。然而内核是一个并发的猛兽,它可以很轻易地重新安排在内核**write**操作部分运行的进程,这个进程在**reverse_phrase()**函数中。如果进程是在作者有机会完成之前,**read()**是按计划执行的,它将会看到数据处于不一致的状态。这些错误真的很难调试出来。那么要如何修复它呢?
基本上,我们需要确保没有**read**方法可以被执行知道写方法有返回。如果你曾经设定一个多线程应用你可能已经看到原始同步像互斥锁和信号。Linux也同样有这些但是存在细微差别。内核代码可以运行进程上下文用户空间代码的“代表”工作就像我们使用的方法和终端上下文例如一个IRQ处理线程。如果你已经在进程上下文中和你所需要的锁你只需要简单地睡眠和重试直到成功位置。在终端上下文时你不能处于休眠状态因此代码会在一个循环中运行直到锁是可使用。相应的原子成为自旋锁但在我们的例子中是一个简单的互斥 —— 这个对象只有一个进程可以在特定的时间“hold”住 —— 这就足够了。根据性能因素,在现实的代码中也可以使用读写信号。
锁通常用来保护一些数据(在我们的例子中,一个“就够缓冲区”实例),是一种非常常见的嵌入结构。所以我们结构缓冲区中添加一个互斥锁(‘结构互斥锁’).我们必须初始化使用**mutex_init()**对锁进行初始化;**buffer_alloc()**恰好用来处理这个。这段代码使用锁也必须包含**linux/mutex.h**.
一个锁就像一个交通灯 ——除非司机看它和遵守信号否则将起不了作用。所以我们需要升级**reverse_read()** 和 **reverse_write()** 来确保在对缓冲区做任何事情或者释放时完成获得互斥锁。让我们来看一看**read**方法 —— **write**也是用同样的方式工作的:
static ssize_t reverse_read(struct file *file, char __user * out,
size_t size, loff_t * off)
{
struct buffer *buf = file->private_data;
ssize_t result;
if (mutex_lock_interruptible(&buf->lock)) {
result = -ERESTARTSYS;
goto out;
}
我们需要在每个函数的开始有锁。**mutex_lock_interruptible()**也可以获取锁或者将进程返回至休眠状态,直到锁是可利用。正如之前,**_interruptible**后缀意味着休眠状态也可以被一个信号阻断。
while (buf->read_ptr == buf->end) {
mutex_unlock(&buf->lock);
/* ... wait_event_interruptible() here ... */
if (mutex_lock_interruptible(&buf->lock)) {
result = -ERESTARTSYS;
goto out;
}
}
下面是”我们等待数据“的循环。当有互斥锁时,你不应该处于休眠状态,或可能发生一种情况叫”死锁“。所以,如果没有数据,我们要释放锁并调用**wait_event_interruptible()**.当它返回时,我们需要锁并继续和往常一样:
if (copy_to_user(out, buf->read_ptr, size)) {
result = -EFAULT;
goto out_unlock;
}
...
out_unlock:
mutex_unlock(&buf->lock);
out:
return result;
最后,当函数结束时互斥对象已经被解锁了或者当一个错误发生时互斥锁被持有。重新编译模块(不要忘记重新加载它)并再次运行第二个测试。现在你应该看到没有损坏的数据了。
### 接下来做什么呢? ###
现在你已经尝试了做内核黑客了。我们只是触及表面的话题还有更多呢。我们的第一个模块是特意设成简单的然而你学到的概念将在更复杂的场景中保持不变。并发性、方法表、注册回调将进程设置成睡眠状态和唤醒它们是每个内核黑客需要使用的现在你已经看到它们所有都在行动啦。也许总有一天内核代码会在主线Linux代码树上 —— 如果这一天到来,请联系我们!
--------------------------------------------------------------------------------
via: http://www.linuxvoice.com/be-a-kernel-hacker/
译者disylee(https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.libusb.org/
[2]:http://fuse.sf.net/
[3]:http://www.linuxvoice.com/be-a-kernel-hacker/www.netfilter.org/projects/libnetfilter_queue
[4]:http://lxr.free-electrons.com/