mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-09 01:30:10 +08:00
commit
9b446c6f8f
@ -1,45 +1,27 @@
|
||||
2q1w2007翻译中
|
||||
Wine 1.7.21 (开发者版本) 发布 – 在基于RedHat或Debian的系统上安装
|
||||
在基于RedHat或Debian的系统上安装 Wine 1.7
|
||||
================================================================================
|
||||
Wine,Linux上最流行也是最有力的软件, 用来不出问题的在Linux平台上运行Windows程序和游戏。
|
||||
Wine,Linux上最流行也是最有力的软件, 可以顺利地在Linux平台上运行Windows程序和游戏。
|
||||
|
||||

|
||||

|
||||
|
||||
在Linux上安装Wine(开发者版本)
|
||||
这篇文章教你怎么在像CentOS, Fedora, Ubuntu, Linux Mint一样基于**Red Hat**和**Debian**的系统上安装最新的**Wine 1.7**。
|
||||
|
||||
**WineHQ** 团队, 最近发布了一个新的开发者版本**Wine 1.7.21**,带来了许多新特性和几个修正。
|
||||
### 在Linux安装 Wine 1.7 ###
|
||||
|
||||
Wine的团队, 坚持每周更新开发者版本并带来了许多新特性和修正。 每个新版本都带来对新程序和游戏的支持,这让Wine成为最流行的也是想在Linux平台运行基于Windows的软件的用户的必备工具.
|
||||
|
||||
根据changelog, 该版本有如下关键的新特性:
|
||||
|
||||
- C runtime中添加临界区的支持.
|
||||
- Unicode 升级到 Unicode 7.
|
||||
- 新增交错 PNG 编码支持.
|
||||
- Packager 库初始化 stub
|
||||
- 修改了几个bug.
|
||||
|
||||
更多深度的改变信息在 [changelog][1] .
|
||||
|
||||
这篇文章教你怎么在像CentOS, Fedora, Ubuntu, Linux Mint一样基于**Red Hat**和**Debian**的系统上安装最新的**Wine 1.7.21**。
|
||||
|
||||
### 在Linux安装 Wine 1.7.21 开发者版本 ###
|
||||
|
||||
不幸的, 在基于**Red Hat**的系统上没有官方的 Wine 仓库,所以唯一的安装方式是从源码编译。你需要安装一些依赖的包比如gcc, flex, bison, libX11-devel freetype-devel 和 Development Tools,这些包用来从源码编译Wine。我们可以用**YUM**命令安装他们。
|
||||
不幸的, 在基于**Red Hat**的系统上没有官方的 Wine 仓库,所以唯一的安装方式是从源码编译。你需要安装一些依赖的包比如gcc, flex, bison, libX11-devel freetype-devel 和 Development Tools,这些包用来从源码编译Wine。我们可以用**yum**命令安装他们。
|
||||
|
||||
#### 在 RedHat, Fedora 和 CentOS 上 ####
|
||||
|
||||
# yum -y groupinstall 'Development Tools'
|
||||
# yum -y install flex bison libX11-devel freetype-devel
|
||||
|
||||
接下来,下载最新的开发者版本(即**1.7.21**)并用下面的命令提取出来。
|
||||
接下来,下载最新的开发版本(如**1.7.21**)并用下面的命令解压。
|
||||
|
||||
$ cd /tmp
|
||||
$ wget http://citylan.dl.sourceforge.net/project/wine/Source/wine-1.7.21.tar.bz2
|
||||
$ tar -xvf wine-1.7.21.tar.bz2 -C /tmp/
|
||||
|
||||
现在,是时候以普通用户身份编译并搭建Wine的安装程序了。(**注意**: 根据机器性能和网络速度的不同,安装过程需要 **15-20** 分钟,安装过程中会要求输入 **root** 密码。)
|
||||
|
||||
现在,要以普通用户身份编译并搭建Wine的安装程序。(**注意**: 根据机器性能和网络速度的不同,安装过程需要 **15-20** 分钟,安装过程中会要求输入 **root** 密码。)
|
||||
|
||||
**32位系统上**
|
||||
|
||||
@ -61,15 +43,13 @@ Wine的团队, 坚持每周更新开发者版本并带来了许多新特性和
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install wine 1.7 winetricks
|
||||
|
||||
**注意**: 写这篇文章的时候版本是 **1.7.20** 新版本还没上传到仓库,但当新版本可用时上面的命令将安装 **1.7.21** 。
|
||||
|
||||
一旦装完了,你可以以如下方式运行基于Windows的软件和游戏。
|
||||
|
||||
$ wine notepad
|
||||
$ wine notepad.exe
|
||||
$ wine c:\\windows\\notepad.exe
|
||||
|
||||
**注意**: 请记住,这是个开发者版本,不要用在生产环境。 建议此版本只用在测试用途
|
||||
**注意**: 请记住,如果是开发版本不要用在生产环境。 建议只用在测试用途
|
||||
|
||||
如果你想安装最近的稳定版Wine, 请看下面的文章, 在文章里介绍了在几乎所以Linux系统中安装Wine的方法
|
||||
|
||||
@ -80,21 +60,11 @@ Wine的团队, 坚持每周更新开发者版本并带来了许多新特性和
|
||||
|
||||
- [WineHQ Homepage][4]
|
||||
|
||||
----------
|
||||
|
||||

|
||||
|
||||
#### Ravi Saive ####
|
||||
|
||||
Owner at [TecMint.com][5]
|
||||
|
||||
Simple Word a Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.tecmint.com/install-wine-in-linux/
|
||||
|
||||
译者:[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/) 荣誉推出
|
||||
|
@ -1,37 +1,111 @@
|
||||
如何为Linux系统中的SSH添加双重认证
|
||||
================================================================================
|
||||
近来很多知名企业都出现了密码泄露,业内对多重认证的呼声也越来越高。在这种多重认证的系统中,用户需要通过两种不同的认证程序:提供他们知道的信息(如 用户名/密码),再借助其他工具提供用户所不知道的信息(如 用手机生成的一次性密码)。这种组合方式常叫做双因子认证或者两阶段验证。
|
||||
|
||||
为了鼓励广泛采用双因子认证的方式,Google公司发布了[Google Authenticator][1],一款开源的,可基于开放规则(如 HMAP/基于时间)生成一次性密码的软件。这是一款跨平台软件,可运行在Linux, [Android][2], [iOS][3]。Google公司同时也支持插件式鉴别模块PAM(pluggable authentication module),使其能和其他也适用PAM进行验证的工具(如OpenSSH)协同工作。
|
||||
在本教程中,我们将叙述集成OpenSSH和Google提供的认证器实现**如何为SSH服务设置双因子认证**。我将使用一款[Android][4]设备来生成一次性密码,本教程中需要两样兵器:(1)一台运行着OpenSSH服务的Linux终端,(2)一台安卓设备。
|
||||
|
||||
在本教程中,我们将叙述集成OpenSSH和Google提供的认证器实现**如何为SSH服务设置双因子认证**。我将使用一款[Android][4]设备来生成一次性密码,本教程中需要两样武器:(1)一台运行着OpenSSH服务的Linux终端,(2)一台安卓设备。
|
||||
|
||||
### 在Linux系统中安装Google Authenticator ###
|
||||
|
||||
第一步需要在运行着OpenSSH服务的Linux主机上安装Google认证器。按照[安装指南] [5]的步骤安装Google认证器及其PAM模块。
|
||||
第一步需要在运行着OpenSSH服务的Linux主机上安装Google认证器。按照如下步骤安装Google认证器及其PAM模块。
|
||||
|
||||
#### 用安装包安装 Google Authenticator ####
|
||||
|
||||
如果你不想自己构建 Google Authenticator,在几个 Linux 发行版上有已经编译好的安装包。安装包里面包含 Google Authenticator 二进制程序和 PAM 模块。
|
||||
|
||||
在 Ubuntu 上安装 Google Authenticator:
|
||||
|
||||
$ sudo apt-get install libpam-google-authenticator
|
||||
|
||||
在 Fedora 上安装 Google Authenticator:
|
||||
|
||||
$ sudo yum install google-authenticator
|
||||
|
||||
在 CentOS 上安装 Google Authenticator ,需要首先启用 EPEL 软件库,然后运行如下命令:
|
||||
|
||||
$ sudo yum install google-authenticator
|
||||
|
||||
如果不想使用已经编译好的安装包,或者你的 Linux 发行版不在此列,可以自行编译:
|
||||
|
||||
#### 在 Linux 上 Google Authenticator ####
|
||||
|
||||
首先,安装构建 Google Authenticator 所需的软件包。
|
||||
|
||||
在 Debian、 Ubuntu 或 Linux Mint 上:
|
||||
|
||||
$ sudo apt-get install wget make gcc libpam0g-dev
|
||||
|
||||
在 CentOS、 Fedora 或 RHEL上:
|
||||
|
||||
$ sudo yum install wget make gcc pam-devel
|
||||
|
||||
然后下载 Google Authenticator 的源代码,并按如下命令编译。
|
||||
|
||||
$ wget https://google-authenticator.googlecode.com/files/libpam-google-authenticator-1.0-source.tar.bz2
|
||||
$ tar xvfvj libpam-google-authenticator-1.0-source.tar.bz2
|
||||
$ cd libpam-google-authenticator-1.0
|
||||
$ make
|
||||
|
||||
如果构建成功,你会在目录中看到 pam_google_authenticator.so 和 google-authenticator 两个文件。
|
||||
|
||||
最后,将 Google Authenticator 安装到合适位置
|
||||
|
||||
$ sudo make install
|
||||
|
||||
|
||||
#### 排错 ####
|
||||
|
||||
当编译 Google Authenticator 时出现如下错误:
|
||||
|
||||
fatal error: security/pam_appl.h: No such file or directory
|
||||
|
||||
要修复这个问题,请安装如下依赖包。
|
||||
|
||||
在 Debian、 Ubuntu 或 Linux Mint 上:
|
||||
|
||||
$ sudo apt-get install libpam0g-dev
|
||||
|
||||
在 CentOS、 Fedora 或 RHEL 上:
|
||||
|
||||
$ sudo yum install pam-devel
|
||||
|
||||
|
||||
当Google认证器安装好后,你需要在Linux主机上创建验证密钥,并且在安卓设备上注册,注意这项配置操作是一次性的。我们将详细叙述如何完成这些操作:
|
||||
|
||||
### 生成验证密钥 ###
|
||||
|
||||
在Linux主机上运行Google认证器
|
||||
|
||||
$ google-authenticator
|
||||
|
||||
你将看到一个QR码,它使用图形保存了我们数字形态的密钥。一会我们要用到它在安卓设备上完成配置。
|
||||
你将看到一个QR码,它使用如下图形表示我们数字形态的密钥。一会我们要用到它在安卓设备上完成配置。
|
||||
|
||||

|
||||

|
||||
|
||||
Google认证器会问一些问题,如果你不确定,就回答"Yes"。这个应急备用验证码(图中 emergency scratch codes)可以在你丢失被绑定的安卓设备的情况下恢复访问,并且设备也不再生成一次性密码。所以最好将应急备用验证码妥善保存。
|
||||
Google认证器会问一些问题,如果你不确定,就回答"Yes"。这个应急备用验证码(图中 emergency scratch codes)可以在你由于丢失了绑定的安卓设备的情况下(所以不能得到生成的一次性密码)恢复访问。最好将应急备用验证码妥善保存。
|
||||
|
||||
### 在安卓设备上运行Google认证器 ###
|
||||
|
||||
我们需要在安卓设备上安装[Google Authenticator app][6]才能完成双因子认证,到Google Play下载并安装一个。在安卓设备上运行Google认证器,找到下图所示中的配置菜单。
|
||||
|
||||

|
||||
|
||||
你可以选择"Scan a barcode" 或者"Enter provided key"选项。"Scan a barcode"允许你扫描QR码来完成密钥的输入,在此可能需要先安装扫描软件[Barcode Scanner app][7]。如果选择"Enter provided key"选项,你可以使用键盘输入验证密钥,如下图所示:
|
||||
|
||||

|
||||
|
||||
无论采用上述两种选项的任何方式,一旦成功,你将看到注册成功提示和一次性密码,如下图所示:
|
||||
|
||||

|
||||
|
||||
### 为SSH服务器用Google认证器 ###
|
||||
|
||||
最终我们需要修改两个文件来完成集成Google认证器和OpenSSH服务这临门一脚。
|
||||
|
||||
首先,修改PAM配置文件,命令和需添加的内容如下:
|
||||
|
||||
$ sudo vi /etc/pam.d/sshd
|
||||
|
||||
----------
|
||||
@ -39,6 +113,7 @@ Google认证器会问一些问题,如果你不确定,就回答"Yes"。这个
|
||||
auth required pam_google_authenticator.so
|
||||
|
||||
然后打开SSH配置文件,找到参数ChallengeResponseAuthentication,并启用它。
|
||||
|
||||
$ sudo vi /etc/ssh/sshd_config
|
||||
|
||||
----------
|
||||
@ -47,35 +122,40 @@ ChallengeResponseAuthentication yes
|
||||
|
||||
|
||||
最后,重启SSH服务。
|
||||
在 Ubuntu, Debian, Linux Mint:
|
||||
|
||||
在 Ubuntu、 Debian 和 Linux Mint 上:
|
||||
|
||||
$ sudo service ssh restart
|
||||
|
||||
在Fedora:
|
||||
在Fedora (或 CentOS/RHEL 7)上:
|
||||
|
||||
$ sudo systemctl restart sshd
|
||||
|
||||
在CentOS 或 RHEL:
|
||||
在CentOS 6.x或 RHEL 6.x上:
|
||||
|
||||
$ sudo service sshd restart
|
||||
|
||||
### 验证双因子认证 ###
|
||||
|
||||
在绑定的安卓设备上运行Google认证器,获得一个一次性验证码,该验证码30秒内有效,一旦过期,将重新生成一个新的验证码。
|
||||
|
||||

|
||||
|
||||
现在和往常一样,使用SSH登录终端
|
||||
|
||||
$ ssh user@ssh_server
|
||||
|
||||
当提示你输入验证码的时候,输入我们刚获得的验证码。验证成功后,再输入SSH的登录密码。
|
||||
|
||||

|
||||
|
||||
双因子认证通过在用户密码前新增一层来有效的保护我们脆弱的用户密码。你可以使用Google认证器来保护我们其他的密码,如Google账户, WordPress.com, Dropbox.com, Outlook.com等等。是否使用这项技术,取决于我们自己,但采用双因子认证已经是行业的大趋势了。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/2014/07/two-factor-authentication-ssh-login-linux.html
|
||||
|
||||
译者:[nd0104](https://github.com/nd0104) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[nd0104](https://github.com/nd0104) 校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,7 +1,8 @@
|
||||
在Linux中模拟击键和鼠标移动
|
||||
================================================================================
|
||||
<pre><code>
|
||||
你是否曾经拥有一个梦
|
||||
——你的计算机
|
||||
——你的计算机`
|
||||
可以自动为你干活?
|
||||
或许,并非因为
|
||||
你刚看了终结者。
|
||||
@ -27,9 +28,10 @@
|
||||
xdotool可以通过读取文本文件
|
||||
模拟击键的旋律
|
||||
以及鼠标的曼舞
|
||||
|
||||
</code></pre>
|
||||
|
||||
### 让Xdotool在Linux定居 ###
|
||||
|
||||
对于Ubuntu,Debian或者Linux Mint,你能够只做:
|
||||
|
||||
$ sudo apt-get install xdotool
|
||||
@ -64,7 +66,7 @@
|
||||
|
||||
$ xdotool type ''
|
||||
|
||||
这些对于基本的击键而言已经足够了。但是,xdotool的众多长处之一,就是它可以获取特定窗口的焦点。它可以获取右边的窗口,然后在里面输入,同时阻止所有你记录的按键,让那些动作随风而逝吧。要获得该功能,一个简单的命令可以搞定:
|
||||
这些对于基本的击键而言已经足够了。但是,xdotool的众多长处之一,就是它可以获取特定窗口的焦点。它可以获取右边的窗口,然后在里面输入,所有你记录下的按键都不会人间蒸发,而是老老实实的如你所愿的出现在那里。要获得该功能,一个简单的命令可以搞定:
|
||||
|
||||
$ xdotool search --name [name of the window] key [keys to press]
|
||||
|
||||
@ -80,7 +82,7 @@
|
||||
|
||||
这会让鼠标移动到(x,y),然后点击鼠标左键。“1”代表鼠标左键,“2”则是滚轮,“3”则是右键。
|
||||
|
||||
最后,一旦你这些命令根植于你脑海,你也许想要实际转储于文件来编辑并试着玩玩。鉴于此,就会有超过一个语句以上的内容了。你可以写的就是一个bash脚本了:
|
||||
最后,一旦你这些命令根植于你脑海,你也许想要实际转储于文件来编辑并试着玩玩。鉴于此,就会有超过一个语句以上的内容了。你需要的就是写一个bash脚本了:
|
||||
|
||||
#!/bin/bash
|
||||
|
||||
@ -96,7 +98,7 @@
|
||||
|
||||
### 意外收获 ###
|
||||
|
||||
作为本文的一个意外收获,这里是xdotool的一个具体实例。你可能听说过,也可能没听说过Bing,微软的搜索引擎。在后面的实例中,你从没听过Bing奖励吧:一个程序,可以让你用Bing积分兑取亚马逊的礼物卡和其它的一些礼物卡。要赚取这些积分,你可以每天在Bing上搜索累计达30次,每次搜索你都会获得0.5个积分。换句话说,你必须把Bing设为默认搜索引擎,并每天使用它。
|
||||
作为本文的一个意外收获,这里是xdotool的一个具体实例。你可能听说过,也可能没听说过Bing —— 微软的搜索引擎。在后面的实例中,你会看到你可能从没听过Bing奖励:一个程序,可以让你用Bing积分兑取亚马逊的礼物卡和其它的一些礼物卡。要赚取这些积分,你可以每天在Bing上搜索累计达30次,每次搜索你都会获得0.5个积分。换句话说,你必须把Bing设为默认搜索引擎,并每天使用它。
|
||||
|
||||
或者,你可以使用xdotool脚本,在这个脚本中,会自动聚焦到Firefox(你可以用你喜欢的浏览器来取代它),并使用fortune命令生成一些随机单词来实施搜索。大约30秒之内,你的日常搜索任务就完成了。
|
||||
|
||||
@ -115,7 +117,7 @@
|
||||
done
|
||||
|
||||
|
||||
下面来个小结吧:我真的很喜欢xdotool,即便它完整功能超越了本文涵盖的范围。这对于脚本和任务自动化而言,确实是种平易的方式。负面的问题是,它可能不是最有效率的一个。但我要再说一遍,它忠于职守了,而且学习起来也不是那么麻烦。
|
||||
下面来个小结吧:我真的很喜欢xdotool,即便它的完整功能超越了本文涵盖的范围。这对于脚本和任务自动化而言,确实是种平易的方式。负面的问题是,它可能不是最有效率的一个。但我要再说一遍,它忠于职守了,而且学习起来也不是那么麻烦。
|
||||
|
||||
你对xdotool怎么看呢?你是否更喜欢另外一个自动化工具,而不是它呢?为什么呢?请在评论中告诉我们吧。
|
||||
|
||||
@ -123,7 +125,7 @@
|
||||
|
||||
via: http://xmodulo.com/2014/07/simulate-key-press-mouse-movement-linux.html
|
||||
|
||||
译者:[GOLinux](https://github.com/GOLinux) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
译者:[GOLinux](https://github.com/GOLinux) 校对:[ wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
@ -1,69 +0,0 @@
|
||||
chi1shi2 is translating.
|
||||
|
||||
China Will Change The Way All Software Is Bought And Sold
|
||||
================================================================================
|
||||

|
||||
|
||||
> It's all about open source.
|
||||
|
||||
**China doesn't need you. Not your software. Not your** programmers. Not anything you have to offer.
|
||||
|
||||
China mints over 100,000 new software engineers each year. Those engineers are writing an incredible volume of great software. What software China doesn't develop, it pirates, to the tune of 77% of all software used in China as of 2012. For Western technology vendors already struggling to meet the challenges of open source and cloud, China just made things harder.
|
||||
|
||||
Much harder.
|
||||
|
||||
China is challenging the way Western firms make money in China and everywhere else. For those companies that manage to figure out how to do business in China, their future looks very, very bright.
|
||||
|
||||
### Resisting China ###
|
||||
|
||||
Not everyone wants to play along, of course. Microsoft, for example, has opted to [use U.S. state attorneys general to block Chinese firms][1] from doing business in their states unless they pay for their Microsoft licenses. It's clever, and it may generate billions of dollars for Microsoft, but it ultimately feels like Microsoft is trying to fit a square peg in a round hole.
|
||||
|
||||
China, quite simply, doesn't think about IP in the same way that Microsoft does.
|
||||
|
||||
As [I've noted][2], "like their Indian counterparts, Chinese enterprises seem inclined to pay for complex, proprietary enterprise software that's more advanced than domestic firms have yet developed." But this won't last, as China's software industry is in warp speed and showing no signs of slowing. China pirates until it can build its own.
|
||||
|
||||
But even then, it charges for software differently than in the U.S. Software is either delivered in appliances, the cloud or firms simply charge for support. None of these things can be pirated.
|
||||
|
||||
And each, not surprisingly, is how companies make money with open source.
|
||||
|
||||
### Open Sourcing China ###
|
||||
|
||||
As captured in [J. Aaron Farr's report][3] on open source in China, Hu Ke, an analyst for CCID, notes that "China's open source communities are relatively small and don't have much influence. There is a lack of big projects, few participants, and little money."
|
||||
|
||||
That's the bad news.
|
||||
|
||||
The good news is that companies like Huawei view open source as a strategic priority. For example, while [Huawei's open source page][4] is outdated and weak, it belies what's actually going on in the technology behemoth. In conversations with the company and with consultants engaged with it, they cite a great deal of knowledge about open source within Huawei, though still a decided lack of know-how when it comes to engaging with open-source communities.
|
||||
|
||||
That isn't likely to last.
|
||||
|
||||
For one thing, Chinese biggest Web companies actively embrace open source, a sign of what's to come. Talk to anyone at Baidu, Alibaba, Weibo and you'll discover that their software stacks are open source, top to bottom, running on homegrown hardware, not Western name brands.
|
||||
|
||||
In other words, exactly like in the United States and Western Europe.
|
||||
|
||||
Take a look at [what software the industry's hottest startups use today][5] and you'll get a good sense of what China's mainstream enterprises will use tomorrow, just as is happening in the Western world. And, not surprisingly, much of it is open source.
|
||||
|
||||
### Selling To China ###
|
||||
|
||||
All of which means the future of China's software industry will necessarily look nothing like the history of the U.S. software industry. There won't be companies making billions of dollars selling proprietary shelfware. Intellectual property, in the Western sense, simply won't factor into China's tech economy.
|
||||
|
||||
Instead, vendors will need to find a way to sell something other than software. Cloud services will succeed. Hardware appliances will, too. Ditto support and consulting services (though at lower margins). Basically, China's software industry will look like an industry filled with open source and no easy, proprietary crutches.
|
||||
|
||||
Lead image by [hackNY.org][6]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://readwrite.com/2014/08/12/china-opensource-software-ip-programmers-united-states
|
||||
|
||||
作者:[Matt Asay][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://readwrite.com/author/matt-asay
|
||||
[1]:http://readwrite.com/2014/03/17/microsoft-anti-piracy-strategy-china
|
||||
[2]:http://readwrite.com/2014/04/11/india-starts-paying-for-software-china-it
|
||||
[3]:http://cdn.oreillystatic.com/en/assets/1/event/12/Open%20Source%20in%20China%20Presentation%201.pdf
|
||||
[4]:http://huawei.com/en/about-huawei/Partner/openathuawei/index.htm
|
||||
[5]:http://codingvc.com/which-technologies-do-startups-use-an-exploration-of-angellist-data
|
||||
[6]:https://www.flickr.com/photos/hackny/8675057448/
|
@ -1,139 +0,0 @@
|
||||
translating by cvsher(2014-08-30)
|
||||
How to listen to Internet radio from the command line on Linux
|
||||
================================================================================
|
||||
For those of you system admins and Linux aficionados who spend a great deal of your time in front of Linux screen, do you know that ambient noise from online/local radio station can actually be a productivity booster? Believe or not, it is known that moderate level of ambient sound such as music or chatter can actually fuel your creativity at your workplace. If you like the idea of working with music on, maybe this tutorial is useful to you, as I am going to show you **how to listen to Pandora online radio from the command lin**e.
|
||||
|
||||
As you already know, Pandora is one of the most well-known Internet radio services, streaming tons of different genres of music for free, with its powerful music recommendation engine. While Pandora can be accessed in different ways such as via web browser, desktop clients or mobile apps, the open-source community has come up with yet another way to access Pandora: Linux command-line.
|
||||
|
||||
[pianobar][1] is an open-source CLI music player for Pandora Internet radio. It comes with a simple terminal interface for playing and managing music stations. Other features include song rating, upcoming song list, song history, custom keybindings, remote control, etc. For those listeners who live in the region where Pandora is not available (i.e., outside US, Australia and New Zealand), pianobar also comes with proxy support.
|
||||
|
||||
### Install Pianobar on Linux ###
|
||||
|
||||
On Debian and other Debian-derivatives such as Ubuntu or Linux Mint, pianobar comes as a pre-built package, so installation is as easy as typing:
|
||||
|
||||
$ sudo apt-get install pianobar
|
||||
|
||||
On Fedora, pianobar is not available in base repositories. So you need to build it from the source. The whole installation process is a bit involved, but the following instructions will do it. The instructions were tested on fresh Fedora 20.
|
||||
|
||||
First, compile and install FFmpeg from the source using [this guide][2].
|
||||
|
||||
Next, [enable RPM Fusion repo][3], and install other prerequisites:
|
||||
|
||||
$ sudo yum install wget gcc-c++ pkgconfig gnutls-devel json-c-devel libgcrypt-devel make libao-devel faad2-devel libmad-devel libao faad2-libs
|
||||
|
||||
Compile and install pianobar:
|
||||
|
||||
$ wget http://6xq.net/projects/pianobar/pianobar-2014.06.08.tar.bz2
|
||||
$ tar xvfvj pianobar-2014.06.08.tar.bz2
|
||||
$ cd pianobar-2014.06.08
|
||||
$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH make
|
||||
$ sudo make install
|
||||
|
||||
Finally, to allow pianobar to load shared FFmpeg libraries installed in /usr/local/lib, add the following line in /etc/ld.so.conf:
|
||||
|
||||
/usr/local/lib
|
||||
|
||||
and reload all shared libraries:
|
||||
|
||||
That's it.
|
||||
|
||||
### Listen to Pandora from the Command Line ###
|
||||
|
||||
The basic usage of pianobar is as simple as typing the command:
|
||||
|
||||
$ pianobar
|
||||
|
||||
You will be asked to log in to Pandora, and choose a station from your personalized station list. Once you pick a station, music streaming will start automatically.
|
||||
|
||||

|
||||
|
||||
Pressing '?' key during streaming will show you a list of available command keys. Some of them are:
|
||||
|
||||
- s: change to a different station.
|
||||
- u: view a list of upcoming songs.
|
||||
- h: view plaback history.
|
||||
- n: go to the next song.
|
||||
- b: bookmark a song or an artist.
|
||||
- ( or ): decrease or increase music volume.
|
||||
- S: pause streaming.
|
||||
- P: resume streaming.
|
||||
- v: create a new station from song or artist.
|
||||
- + or -: thumb up or down a song.
|
||||
- a: add music to a station.
|
||||
- q: quit pianobar.
|
||||
|
||||

|
||||
|
||||
### Configure Pianobar for Automatic Setup ###
|
||||
|
||||
You can define various default settings of pianobar in a separate configuration file. For example, you can put your Pandora login information in the configuration file, so you don't have to type it manually. Here is how to create a sample configuration file.
|
||||
|
||||
$ mkdir -p ~/.config/pianobar
|
||||
|
||||
----------
|
||||
|
||||
$ vi ~/.config/pianobar/config
|
||||
|
||||
----------
|
||||
|
||||
# Example pianobar configuration file
|
||||
|
||||
# Pandora login info
|
||||
user = your@email_address
|
||||
password = plaintext_password
|
||||
|
||||
# Users who cannot access Pandora in their region can set a proxy.
|
||||
control_proxy = http://user:password@host:port/
|
||||
|
||||
# Initial volume in dB: between -30 and +5
|
||||
volume = 0
|
||||
|
||||
# Audio quality: high, medium or low
|
||||
audio_quality = high
|
||||
|
||||
For full configuration options, refer to its man page.
|
||||
|
||||
$ man pianobar
|
||||
|
||||
### Remote Control Pianobar ###
|
||||
|
||||
Another excellent feature of pianobar is remote control support. You can send a command to a running instance of pianobar via a named pipe (FIFO). Here is how to remote control pianobar.
|
||||
|
||||
First create a FIFO in ~/.config/pianobar:
|
||||
|
||||
$ mkfifo ~/.config/pianobar/ctl
|
||||
|
||||
Then launch pianobar.
|
||||
|
||||
Now you can send any single-character command key to pianobar by using echo command. For example, to go to the next song:
|
||||
|
||||
$ echo -n 'n' > ~/.config/pianobar/ctl
|
||||
|
||||
You can easily extend this setup to a remote machine. When pianobar is running on host X, you can remote control pianobar from another host Y over SSH as follows.
|
||||
|
||||
On host Y, run:
|
||||
|
||||
$ ssh user@host_X "echo -n 'n' > ~/.config/pianobar/ctl"
|
||||
|
||||
Of course, you want to [enable key authentication][4] for SSH login to host X, so that you don't have to type an SSH password.
|
||||
|
||||
This remote control feature can come in handy when you want to set up a remote controllable Internet radio player on [Raspberry Pi][5].
|
||||
|
||||
Hope you enjoy pianobar as much as I do. Let me know what you think of it in the comments.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/2014/08/listen-to-internet-radio-command-line-linux.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
||||
[1]:http://6xq.net/projects/pianobar/
|
||||
[2]:http://ask.xmodulo.com/compile-ffmpeg-centos-fedora-rhel.html
|
||||
[3]:http://xmodulo.com/2013/06/how-to-install-rpm-fusion-on-fedora.html
|
||||
[4]:http://xmodulo.com/2012/04/how-to-enable-ssh-login-without.html
|
||||
[5]:http://xmodulo.com/go/raspberrypi
|
@ -0,0 +1,67 @@
|
||||
中国将要改变软件购买和销售的方式
|
||||
================================================================================
|
||||

|
||||
|
||||
> 这一切都是关于“开源”.
|
||||
|
||||
**中国并不需要开源,也不需要你的软件。具体说来,中国市场并不需要你的工程师日以继夜的工作,也不需要你提供的任何东西。
|
||||
|
||||
中国每年会产生超过100000名新软件工程师们,这些工程师会写出一大批令人惊叹的奇妙软件。如果有中国市场上尚未出现的软件,中国的工程师们就会从国外“借鉴”。在2012年,这样的软件掠夺达到了77%之多。对于那些已经面对着开源和云服务的挑战的软件卖家来说,中国无疑让他们的日子更苦难了。
|
||||
|
||||
不止是更困难,简直是举步维艰。
|
||||
|
||||
中国正在挑战西方公司在中国或者其他地方赚钱的模式。对于那些已经明白如何在中国运营的公司来说,他们的未来看起来一片光明。
|
||||
|
||||
### 抵制中国模式 ###
|
||||
|
||||
当然,并非每家公司都会坐以待毙。以微软为例,微软通用美国的国家司法权力来禁止中国公司做生意——除非他们像微软购买许可证。这是一种很聪明的做法,而且它可能会为微软创造数以十亿计的价值。但是最终这一做法看起来与中国市场格格不入。
|
||||
|
||||
原因很简单,中国与微软对待知识产权的态度十分不同。
|
||||
|
||||
正如 [我所提到的][2],“中国的企业更倾向于购买复杂的,面向企业的软件。因为这种软件比服务大众的公司设计出来的软件更先进,就像同在亚洲的印度。”但这种形势不会持续太久,因为中国的软件产业正在以一种惊人的速度前进,并毫无颓势。中国一定会坚持向西方国家“借鉴”代码直到有一天有足够的能力可以创造出有创新能力的软件。
|
||||
|
||||
但是即使这样,中国的软件公司与美国软件的运营模式还是有所不同,美国的软件大多都已经捆绑在设备、架构在云端或者公司只因为提供软件支持而要价。而这些运营模式中国是无法克隆的。
|
||||
|
||||
不出所料的,每一个收费模式是公司门使用“开源”进行盈利。
|
||||
|
||||
### 开源化中国 ###
|
||||
|
||||
正如CCID的分析师在 [J. Aaron Farr 的关于中国开源化报告][3] 中指出的,中国的开源社区规模很小而且没什么影响力。开源社区们没有大项目、参与者稀少而且资金匮乏。
|
||||
|
||||
这真是个坏消息。
|
||||
|
||||
好消息是,像华为这样的公司就把开源作为一种战略前景。具体而言,当华为的开源项目过时或者不是很强势的时候,这种现象就证明了他们的科技步伐是错误的。在与参与了开源项目的华为公司内部顾问的谈话中,虽然华为对如何参与到开源社区还处于摸索阶段,但他们总是对华为的开源项目赞不绝口。
|
||||
|
||||
这种无人关注开源的现象不会长久地持续下去。
|
||||
|
||||
从一件事就可以看出端倪。中国最大的互联网公司们都纷纷以积极地姿态拥抱开源,这意味着中国开源时代的到来。你若是和任意一位在百度、阿里巴巴、微博的员工谈话,你会发现他们的软件项目都是彻底开源的。这些开源的软件都是运行在这些公司自己研发的硬件上而不是西方的硬件上。
|
||||
|
||||
换句话说,这样的模式已经和西方的运营模式如出一辙了。
|
||||
|
||||
抬头看看 [现金软件行业内最炙手可热的新公司][5], 你就会知道中国的互联网公司未来的主流趋势,正如发生在西方世界的一样。不出意料的,许多都是关于“开源”。
|
||||
|
||||
### 销售给中国 ###
|
||||
|
||||
所有的一切都表明中国的软件行业不会像美国的软件行业发展历史一般发展。中国不会产生在柜台上卖卖软件就赚上亿美元的公司。因为西方对于知识产权的观念就是不适于中国的科技经济。
|
||||
|
||||
所以,软件卖家们需要售卖币软件更丰富的产品。云服务是一大前景。硬件设施看起来也是前途璀璨。软件支持和咨询服务(虽然有一些非主流)也很被公司门看好。总而言之,中国的软件行业会充满了开源味道,而不能靠着简单的售卖专柜软件的形式赚钱。
|
||||
|
||||
图片由 [hackNY.org][6] 提供。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
原文: http://readwrite.com/2014/08/12/china-opensource-software-ip-programmers-united-states
|
||||
|
||||
作者:[Matt Asay][a]
|
||||
译者:[chi1shi2](https://github.com/chi1shi2)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://readwrite.com/author/matt-asay
|
||||
[1]:http://readwrite.com/2014/03/17/microsoft-anti-piracy-strategy-china
|
||||
[2]:http://readwrite.com/2014/04/11/india-starts-paying-for-software-china-it
|
||||
[3]:http://cdn.oreillystatic.com/en/assets/1/event/12/Open%20Source%20in%20China%20Presentation%201.pdf
|
||||
[4]:http://huawei.com/en/about-huawei/Partner/openathuawei/index.htm
|
||||
[5]:http://codingvc.com/which-technologies-do-startups-use-an-exploration-of-angellist-data
|
||||
[6]:https://www.flickr.com/photos/hackny/8675057448/
|
@ -0,0 +1,136 @@
|
||||
如何在Linux命令行下收听网络电台
|
||||
========================================================================
|
||||
对于系统管理员和Linux爱好者来说,我们花大量的时间在Linux屏幕前,但是你们知道网络/本地电台上的音乐可以极大的提高我们的生产力吗?不管你相信与否,在工作环境中有适当的声音,如音乐或者喋喋不休的声音都可以提高我们的创造力。如果你喜欢在音乐环境中工作,这个教程也许会对你有用。我将会向你展示**如何在命令行中收听潘多拉(Pandora)在线电台**(LCTT译注:Pandora Internet Radio是一个仅为美国、澳大利亚和新西兰提供自动音乐推荐的系统。详细介绍[Prandoea电台][1])
|
||||
|
||||
正如你已经知道的,Pandora是最有名的在线电台服务之一,它包含无数的不同种类的免费音乐流,同时它还有一个强大的音乐推荐引擎。Pandora可以通过不同的方法访问,如:浏览器,桌面客户端或者手机Apps,开源社区还给出了另一种访问Pandora音乐服务的方法:Linux命令行。
|
||||
|
||||
[pianobar][2]是一个播放Pandora在线电台音乐的开源命令行音乐播放器。它有一个简单的人机接口,用于播放和管理音乐电台。同时还有其他包括歌曲评价,即将上线音乐列表,播放历史,自定义快捷键绑定,远程控制等功能。对于那些居住在不可访问Pandora音乐服务区域的用户(即美国、澳大利亚和新西兰以外的用户)。Pianobar还配置了代理服务的支持。
|
||||
|
||||
###在Linux中安装Pianobar###
|
||||
在Debian或者其他Debian的衍生品,如Ubuntu或LinuxMint中,Pianobar是一个已经编译好的软件包,因此安装Pianobar只是简单的输入如下命令:
|
||||
|
||||
$ sudo apt-get install pianobar
|
||||
|
||||
在Fedora中,Pianobar并不包含在基础的软件库中。因此,你需要通过源代码编译安装Pianobar。整个安装过程会有点麻烦,但是下面的教程将会实现Pianobar在Frdora系统中编译安装。该教程在Fedora20版本中测试通过。
|
||||
|
||||
首先,根据[FFmpeg安装教程][3]编译并安装FFmpeg。
|
||||
|
||||
然后,[启用RPM Fusion源][4],并安装其他依赖软件:
|
||||
|
||||
$ sudo yum install wget gcc-c++ pkgconfig gnutls-devel json-c-devel libgcrypt-devel make libao-devel faad2-devel libmad-devel libao faad2-libs
|
||||
|
||||
编译并安装Pianobar
|
||||
|
||||
$ wget http://6xq.net/projects/pianobar/pianobar-2014.06.08.tar.bz2
|
||||
$ tar xvfvj pianobar-2014.06.08.tar.bz2
|
||||
$ cd pianobar-2014.06.08
|
||||
$ PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH make
|
||||
$ sudo make install
|
||||
|
||||
最后允许Paniobar加载安装在/usr/local/lib目录下的FFmpeg共享库,在/etc/ld.so.conf配置文件中添加下面一行:
|
||||
|
||||
>/usr/local/lib
|
||||
|
||||
重载所有的共享库
|
||||
|
||||
就这样,Pianobar已经在Fedora系统中安装完成。
|
||||
|
||||
###在命令行中收听Pandora音乐###
|
||||
|
||||
paniobar的基本用法是输入如下命令:
|
||||
|
||||
> $ pianobar
|
||||
|
||||
该命令将会要求你登录到Pandora并从你的个性化电台列表中选择要收听的电台。在你选择电台后,音乐就开始自动播放。
|
||||
|
||||

|
||||
|
||||
按‘?’按键pianobar会列出一系列可用个命令,其中一些如下:
|
||||
>- s: 更换电台
|
||||
- u: 查看即将上线音乐列表
|
||||
- h: 查看播放历史
|
||||
- n: 播放下一首
|
||||
- b: 收藏歌曲或艺术家
|
||||
- ( 或者 ): 减少或增加播放音量
|
||||
- S: 暂停播放
|
||||
- P: 恢复播放
|
||||
- V:为当前收听的歌曲或者艺术家创建一个电台
|
||||
- +或者-:查看上一首或者下一首歌曲
|
||||
- a:添加音乐到电台
|
||||
- q:退出pianobar
|
||||
|
||||

|
||||
|
||||
###将Pianobar配置为自动登录###
|
||||
你可以再一个单独的配置文件中配置Pianobar的各项默认配置。例如:你可以将你的登录信息配置到配置文件中,这样你就不用每次都要手动输入。下面是如何创建一个配置文件的示例:
|
||||
|
||||
> $ mkdir -p ~/.config/pianobar
|
||||
|
||||
----------
|
||||
|
||||
> $ vi ~/.config/pianobar/config
|
||||
|
||||
----------
|
||||
|
||||
> # Example pianobar configuration file
|
||||
>
|
||||
> # Pandora login info
|
||||
user = your@email_address
|
||||
password = plaintext_password
|
||||
>
|
||||
> # Users who cannot access Pandora in their region can set a proxy.
|
||||
control_proxy = http://user:password@host:port/
|
||||
>
|
||||
> # Initial volume in dB: between -30 and +5
|
||||
volume = 0
|
||||
>
|
||||
> # Audio quality: high, medium or low
|
||||
audio_quality = high
|
||||
|
||||
如需了解完整的配置选项,请参阅其man手册页。
|
||||
|
||||
$ man pianobar
|
||||
|
||||
###远程控制Pianobar###
|
||||
|
||||
Pianobar的另一个优秀的特性是支持远程控制,你可以通过命令管道(FIFO)为Pianobar的一个运行实例发送命令。下面是远程控制Pianobar的示例:
|
||||
|
||||
首先在目录~/.config/pianobar下创建一个FIFO命令管道
|
||||
|
||||
> $ mkfifo ~/.config/pianobar/ctl
|
||||
|
||||
然后运行Pianobar
|
||||
|
||||
现在,你可以通过使用echo命令发送任何的单字符命令键到Pianobar中,例如:播放下一首歌曲:
|
||||
|
||||
> $ echo -n 'n' > ~/.config/pianobar/ctl
|
||||
|
||||
你可以很容易的将此配置扩展到远程计算机中,当Pianobar在主机X上运行,你可以从远程主机Y中通过SSH控制Pianobar,如下所示:
|
||||
|
||||
在主机Y中,运行:
|
||||
|
||||
> $ ssh user@host_X "echo -n 'n' > ~/.config/pianobar/ctl"
|
||||
|
||||
当然,你希望为登录到主机X的SSH登录认证[启用秘钥认证][5],这样你就不用每次都输入SSH密码。
|
||||
|
||||
当你想在[树莓PI][6]上设置一个可以远程控制的在线电台播放器时,Pianobar的远程控制特性将会让你非常方便的实现该需求。
|
||||
|
||||
希望你像我一样喜欢Pianobar,若有什么想法,请在评论中告诉我。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/2014/08/listen-to-internet-radio-command-line-linux.html
|
||||
|
||||
作者:[Dan Nanni][a]
|
||||
译者:[cvsher](https://github.com/cvsher)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:http://xmodulo.com/author/nanni
|
||||
[1]:http://zh.wikipedia.org/wiki/Pandora%E7%94%B5%E5%8F%B0
|
||||
[2]:http://6xq.net/projects/pianobar/
|
||||
[3]:http://ask.xmodulo.com/compile-ffmpeg-centos-fedora-rhel.html
|
||||
[4]:http://xmodulo.com/2013/06/how-to-install-rpm-fusion-on-fedora.html
|
||||
[5]:http://xmodulo.com/2012/04/how-to-enable-ssh-login-without.html
|
||||
[6]:http://xmodulo.com/go/raspberrypi
|
Loading…
Reference in New Issue
Block a user