20140828-2 选题

This commit is contained in:
DeadFire 2014-08-28 11:06:26 +08:00
parent 91602a4a9e
commit 24cedf7bdc
2 changed files with 223 additions and 0 deletions

View File

@ -0,0 +1,85 @@
Interesting facts about Linux
================================================================================
Today, August, 25th, is the 23rd birthday of Linux. The modest [Usenet post][1] made by a 21 year old student at the University of Helsinki on August 25th, 1991, marks the birth of the venerable Linux as we know it today.
Fast forward 23 years, and now Linux is everywhere, not only installed on end user desktops, [smartphones][2] and embedded systems, but also fulfilling the needs of [leading enterprises][3] and powering mission-critical systems such as [US Navy's nuclear submarines][4] and [FAA's air traffic control][5]. Entering the era of ubiquitous cloud computing, Linux is continuing [its dominance][6] as by far the most popular platform for the cloud.
Celebrating the 23rd birthday of Linux today, let me show you **some interesting facts and history you may not know about Linux**. If there is anything to add, feel free to share it in the comments. In this article, I will use the terms "Linux", "kernel" or "Linux kernel" interchangeably to mean the same thing.
1. There is a never-ending debate on whether or not Linux is an operating system. Technically, the term "Linux" refers to the kernel, a core component of an operating system. Folks who argue that Linux is not an operating system are operating system purists who think that the kernel alone does not make the whole operating system, or free software ideologists who believe that the largest free operating system should be named "[GNU/Linux][7]" to give credit where credit is due (i.e., [GNU project][8]). On the other hand, some developers and programmers have a view that Linux qualifies as an operating system in a sense that it implements the [POSIX standard][9].
2. According to openhub.net, the majority (95%) of Linux is written in C language. The second popular language for Linux is assembly language (2.8%). The dominance of C lanaguage over C++ is no surprise given Linus's stance on C++. Here is the programming language breakdown for Linux.
![](https://farm4.staticflickr.com/3845/15025332121_055cfe3a2c_z.jpg)
3. Linux has been built by a total of [13,036 contributors][10] worldwide. The most prolific contributor is, of course, Linus Torvalds himself, who has committed code more than 20,000 times over the course of the lifetime of Linux. The following figures show the all-time top-10 contributors of Linux in terms of commit counts.
![](https://farm4.staticflickr.com/3837/14841786838_7a50625f9d_b.jpg)
4. The total source lines of code (SLOC) of Linux is over 17 million. The estimated cost for the entire code base is 5,526 person-years, or over 300M USD according to [basic COCOMO model][11].
5. Enterprises have not been simply consumers of Linux. Their employees have been [actively participated][12] in the development of Linux. The figure below shows the top-10 corporate sponsors of Linux kernel development, in terms of total commit counts from their employees, as of year 2013. They include commercial Linux distributors (Red Hat, SUSE), chip/embedded system makers (Intel, Texas Instruments, Wolfson), non-profits (Linaro), and other IT power houses (IBM, Samsung, Google).
![](https://farm6.staticflickr.com/5573/14841856427_a5a1828245_o.png)
6. The official mascot of Linux is "Tux", a friendly penguin character. The idea of using a cuddly penguin as a mascot/logo was in fact [first conceived and asserted][13] by Linus himself. Why penguin? Personally Linus is fond of penguins, despite the fact that he once was bitten by a ferocious penguin, causing him infected with a disease.
7. A Linux "distribution" contains the Linux kernel, supporting GNU utilities/libraries, and other third-party applications. According to [distrowatch.com][14], there are a total of 286 actively maintained Linux distrutions. The oldest among them is [Slackware][15] whose very first release 1.0 became available in 1993.
8. Kernel.org, which is the main repository of Linux source code, was [compromised][16] by an unknown attacker in August, 2011, who managed to tamper with several kernel.org's servers. In an effort to tighten up access policies of the Linux kernel, Linux foundation recently [turned on][17] two-factor authentication at the official Git repositories hosting the Linux kernel.
9. The dominance of Linux on top 500 supercomputers [continues to rise][18]. As of June 2014, 97% of the world-fastest computers are powered by Linux.
10. Spacewatch, a research group of Lunar and Planetary Laboratory at the University of Arizona, named several asteroids ([9793 Torvalds][19], [9882 Stallman][20], [9885 Linux][21] and [9965 GNU][22]) after GNU/Linux and their creators, in recognition of the free operating system which was instrumental in their asteroid survey activities.
11. In the modern history of Linux kernel development, there was a big jump in kernel version: from 2.6 to 3.0. The [renumbering to version 3][23] actually did not signify any major restructuring in kernel code, but was simply to celebrate the 20 year milestone of the Linux kernel.
12. In 2000, Steve Jobs at Apple Inc. [tried to hire][24] Linus Torvalds to have him drop Linux development and instead work on "Unix for the biggest user base," which was OS X back then. Linus declined the offer.
13. The [reboot()][25] system call in the Linux kernel requires two magic numbers. The second magic number comes from the [birth dates][26] of Linus Torvalds and his three daughters.
14. With so many fans of Linux around the world, there are [criticisms][27] on current Linux distributions (mainly desktops), such as limited hardware support, lack of standardization, instability due to short upgrade/release cycles, etc. During the [Linux kernel panel][28] at LinuxCon 2014, Linus was quoted as saying "I still want the desktop" when asked where he thinks Linux should go next.
If you know any interesting facts about Linux, feel free to share them in the comments.
Happy birthday, Linux!
--------------------------------------------------------------------------------
via: http://xmodulo.com/2014/08/interesting-facts-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]:https://groups.google.com/forum/message/raw?msg=comp.os.minix/dlNtH7RRrGA/SwRavCzVE7gJ
[2]:http://developer.android.com/about/index.html
[3]:http://fortune.com/2013/05/06/how-linux-conquered-the-fortune-500/
[4]:http://www.linuxjournal.com/article/7789
[5]:http://fcw.com/Articles/2006/05/01/FAA-manages-air-traffic-with-Linux.aspx
[6]:http://thecloudmarket.com/stats
[7]:http://www.gnu.org/gnu/why-gnu-linux.html
[8]:http://www.gnu.org/gnu/gnu-history.html
[9]:http://en.wikipedia.org/wiki/POSIX
[10]:https://www.openhub.net/p/linux/contributors/summary
[11]:https://www.openhub.net/p/linux/estimated_cost
[12]:http://www.linuxfoundation.org/publications/linux-foundation/who-writes-linux-2013
[13]:http://www.sjbaker.org/wiki/index.php?title=The_History_of_Tux_the_Linux_Penguin
[14]:http://distrowatch.com/search.php?ostype=All&category=All&origin=All&basedon=All&notbasedon=None&desktop=All&architecture=All&status=Active
[15]:http://www.slackware.com/info/
[16]:http://pastebin.com/BKcmMd47
[17]:http://www.linux.com/news/featured-blogs/203-konstantin-ryabitsev/784544-linux-kernel-git-repositories-add-2-factor-authentication
[18]:http://www.top500.org/statistics/details/osfam/1
[19]:http://ssd.jpl.nasa.gov/sbdb.cgi?sstr=9793
[20]:http://ssd.jpl.nasa.gov/sbdb.cgi?sstr=9882
[21]:http://ssd.jpl.nasa.gov/sbdb.cgi?sstr=9885
[22]:http://ssd.jpl.nasa.gov/sbdb.cgi?sstr=9965
[23]:https://lkml.org/lkml/2011/5/29/204
[24]:http://www.wired.com/2012/03/mr-linux/2/
[25]:http://lxr.free-electrons.com/source/kernel/reboot.c#L199
[26]:http://www.nndb.com/people/444/000022378/
[27]:http://linuxfonts.narod.ru/why.linux.is.not.ready.for.the.desktop.current.html
[28]:https://www.youtube.com/watch?v=8myENKt8bD0

View File

@ -0,0 +1,138 @@
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.
![](https://farm6.staticflickr.com/5552/14993320301_58e58b5810_z.jpg)
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.
![](https://farm6.staticflickr.com/5559/14993326991_ccdffd0fa6_z.jpg)
### 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