20150407-2 选题

This commit is contained in:
DeadFire 2015-04-07 16:21:31 +08:00
parent 1721eb056f
commit b0138baef8
3 changed files with 395 additions and 0 deletions

View File

@ -0,0 +1,154 @@
10 Truly Amusing Easter Eggs in Linux
================================================================================
![](http://en.wikipedia.org/wiki/File:Adventure_Easteregg.PNG)
The programmer working on Adventure slipped a secret feature into the game. Instead of getting upset about it, Atari decided to give these sorts of “secret features” a name -- “Easter Eggs” because… you know… you hunt for them. Image credit: Wikipedia.
Back in 1979, a video game was being developed for the Atari 2600 -- [Adventure][1].
The programmer working on Adventure slipped a secret feature into the game which, when the user moved an “invisible square” to a particular wall, allowed entry into a “secret room”. That room contained a simple phrase: “Created by [Warren Robinett][2]”.
Atari had a policy against putting author credits in their games, so this intrepid programmer put his John Hancock on the game by being, well, sneaky. Atari only found out about the “secret room” after Warren Robinett had left the company. Instead of getting upset about it, Atari decided to give these sorts of “secret features” a name -- “Easter Eggs” because… you know… you hunt for them -- and declared that they would be putting more of these “Easter Eggs” in future games.
This wasnt the first such “hidden feature” built into a piece of software (that distinction goes to an operating system for the [PDP-10][3] from 1966, but this was the first time it was given a name. And it was the first time it really grabbed the attention of most computer users and gamers.
Linux (and Linux related software) has not been left out. Some truly amusing Easter Eggs have been created for our beloved operating system over the years. Here are some of my personal favorites -- with how to achieve them.
Youll notice, rather quickly, that most of these are experienced via a terminal. Thats on purpose. Because terminals are cool. [I should also take this moment to say that if you try to run an application I list, and you do not have it installed, it will not work. You should install it first. Because… computers.]
### Arch : Pac-Man in pacman ###
Were going to start with one just for the [Arch Linux][4] fans out there. You can add a [Pac-Man][5]-esque character to your progress bars in “[pacman][6]” (the Arch package manager). Why this isnt enabled by default is beyond me.
To do this youll want to edit “/etc/pacman.conf” in your favorite text editor. Under the “# Misc options” section, remove the “#” in front of “Color” and add the line “ILoveCandy”. Because Pac-Man loves candy.
Thats it! Next time you fire up a terminal and run pacman, youll help the little yellow guy get some lunch (or at least some candy).
### GNU Emacs : Tetris and such ###
![emacs Tetris](http://www.linux.com/images/stories/41373/emacsTetris.jpg)
I dont like emacs. Not even a little bit. But it does play Tetris.
I have a confession to make: I dont like [emacs][7]. Not even a little bit.
Some things fill my heart with gladness. Some things take away all my sadness. Some things ease my troubles. Thats [not what emacs does][8].
But it does play Tetris. And thats not nothing. Heres how:
Step 1) Launch emacs. (When in doubt, type “emacs”.)
Step 2) Hit Escape then X on your keyboard.
Step 3) Type “tetris” and hit Enter.
Bored of Tetris? Try “pong”, “snake” and a whole host of other little games (and novelties). Take a look in “/usr/share/emacs/*/lisp/play” for the full list.
### Animals Saying Things ###
The Linux world has a long and glorious history of animals saying things in a terminal. Here are the ones that are the most important to know by heart.
On a Debian-based distro? Try typing “apt-get moo".
![apt-get moo](http://www.linux.com/images/stories/41373/AptGetMoo.jpg)
apt-get moo
Simple, sure. But its a talking cow. So we like it. Then try “aptitude moo”. It will inform you that “There are no Easter Eggs in this program”.
If theres one thing you should know about [aptitude][9], its that its a dirty, filthy liar. If aptitude were wearing pants, the fire could be seen from space. Add a “-v” option to that same command. Keep adding more vs until you force aptitude to come clean.
![](http://www.linux.com/images/stories/41373/AptitudeMoo.jpg)
I think we can all agree, that this is probably the most important feature in aptitude.
I think we can all agree, that this is probably the most important feature in aptitude. But what if you want to put your own words into the mouth of a cow? Thats where “cowsay” comes in.
And, dont let the name “cowsay” fool you. You can put words into so much more than just a cow. Like an elephant, Calvin, Beavis and even the Ghostbusters logo. Just do a “cowsay -l” from the terminal to get a complete list of options.
![](http://www.linux.com/images/stories/41373/cowsay.jpg)
You can put words into so much more than just a cow.
Want to get really tricky? You can pipe the output of other applications into cowsay. Try “fortune | cowsay”. Lots of fun can be had.
### Sudo Insult Me Please ###
Raise your hand if youve always wanted your computer to insult you when you do something wrong. Hell. I know I have. Try this:
Type “sudo visudo” to open the “sudoers” file. In the top of that file youll likely see a few lines that start with “Defaults”. At the bottom of that list add “Defaults insults” and save the file.
Now, whenever you mistype your sudo password, your system will lob insults at you. Confidence boosting phrases such as “Listen, burrito brains, I dont have time to listen to this trash.”, “Are you on drugs?” and “Youre mind just hasnt been the same since the electro-shocks, has it?”.
This one has the side-effect of being a rather fun thing to set on a co-worker's computer.
### Firefox is cheeky ###
Heres one that isnt done from the Terminal! Huzzah!
Open up Firefox. In the URL bar type “about:about”. That will give you a list of all of the “about” pages in Firefox. Nothing too fancy there, right?
Now try “about:mozilla” and youll be greeted with a quote from the “[Book of Mozilla][10]” -- the holy book of web browsing. One of my other favorites, “about:robots”, is also quite excellent.
![](http://www.linux.com/images/stories/41373/About-Mozilla550.jpg)
The “Book of Mozilla” -- the holy book of web browsing.
### Carefully Crafted Calendar Concoctions ###
Tired of the boring old [Gregorian Calendar][11]? Ready to mix things up a little bit? Try typing “ddate”. This will print the current date on the [Discordian Calendar][12]. You will be greeted by something that looks like this:
“Today is Sweetmorn, the 18th day of Discord in the YOLD 3181”
I hear what youre saying, “But, this isnt an Easter Egg!” Shush. Ill call it an Easter Egg if I want to.
### Instant l33t Hacker Mode ###
Want to feel like youre a super-hacker from a movie? Try setting nmap into “[Script Kiddie][13]” mode (by adding “-oS”) and all of the output will be rendered in the most 3l33t [h@x0r-y way][14] possible.
Example: “nmap -oS - google.com”
Do it. You know you want to. Angelina Jolie would be [super impressed][15].
### The lolcat Rainbow ###
Having awesome Easter Eggs and goodies in your Linux terminal is fine and dandy… but what if you want it to have a little more… pizazz? Enter: lolcat. Take the text output of any program and pipe it through lolcat to super-duper-rainbow-ize it.
![](http://www.linux.com/images/stories/41373/lolcat.jpg)
Take the text output of any program and pipe it through lolcat to super-duper-rainbow-ize it.
### Cursor Chasing Critter ###
![oneko cat](http://www.linux.com/images/stories/41373/onekocat.jpg)
“Oneko” -- the Linux port of the classic “Neko”.
“Oneko” -- the Linux port of the classic “[Neko][16]”.
And that brings us to “oneko” -- the Linux port of the classic “Neko”. Basically a little cat that chases your cursor around the screen.
While this may not qualify as an “Easter Egg” in the strictest sense of the word, its still fun. And it feels Easter Egg-y.
You can also use different options (such as “oneko -dog”) to use a little dog instead of a cat and a few other tweaks and options. Lots of possibilities for annoying co-workers with this one.
There you have it! A list of my favorite Linux Easter Eggs (and things of that ilk). Feel free to add your own favorite in the comments section below. Because this is the Internet. And you can do that sort of thing.
--------------------------------------------------------------------------------
via: http://www.linux.com/news/software/applications/820944-10-truly-amusing-linux-easter-eggs-
作者:[Bryan Lunduke][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.linux.com/community/forums/person/56734
[1]:http://en.wikipedia.org/wiki/Adventure_(Atari_2600)
[2]:http://en.wikipedia.org/wiki/Warren_Robinett
[3]:http://en.wikipedia.org/wiki/PDP-10
[4]:http://en.wikipedia.org/wiki/Arch_Linux
[5]:http://en.wikipedia.org/wiki/Pac-Man
[6]:http://www.linux.com/news/software/applications/820944-10-truly-amusing-linux-easter-eggs-#Pacman
[7]:http://en.wikipedia.org/wiki/GNU_Emacs
[8]:https://www.youtube.com/watch?v=AQ4NAZPi2js
[9]:https://wiki.debian.org/Aptitude
[10]:http://en.wikipedia.org/wiki/The_Book_of_Mozilla
[11]:http://en.wikipedia.org/wiki/Gregorian_calendar
[12]:http://en.wikipedia.org/wiki/Discordian_calendar
[13]:http://nmap.org/book/output-formats-script-kiddie.html
[14]:http://nmap.org/book/output-formats-script-kiddie.html
[15]:https://www.youtube.com/watch?v=Ql1uLyuWra8
[16]:http://en.wikipedia.org/wiki/Neko_%28computer_program%29

View File

@ -0,0 +1,156 @@
5 Linux Command Line Based Tools for Downloading Files and Browsing Websites
================================================================================
Linux command-line, the most adventurous and fascinating part of GNU/Linux is very cool and powerful tool. Command line itself is very productive and the availability of various inbuilt and third party command line application makes Linux robust and powerful. The Linux Shell supports a variety of web application of various kind be it torrent downloader, dedicated downloader or Internet Surfing.
![Command Line Internet Tools](http://www.tecmint.com/wp-content/uploads/2014/02/Command-Line-Internet-Tools.jpg)
5 Command Line Internet Tools
Here we are presenting 5 great command line Internet tools, which are very useful and proves to be very handy.
### 1. rTorrent ###
rTorrent is a text­-based Torrent Client which is written in C++ aimed at high performance. It is available for most of the standard Linux Distributions including FreeBSD and Mac OS X.
#### Installation of rTorrent ####
# apt­-get install rtorrent (on APT based System)
----------
# yum install rtorrent (on YUM based System)
Check if rtorrent is installed correctly by running the following command in the terminal.
# rtorrent
![Command line torrent download](http://www.tecmint.com/wp-content/uploads/2014/02/rTorrent.jpeg)
rTorrent Command Line Tool
#### Functioning of rTorrent ####
Some of the useful Key-bindings and their use.
- CTRL+ q Quit rTorrent Application
- CTRL+ s Start Download
- CTRL+ d Stop an active Download or Remove an already stopped Download.
- CTRL+ k Stop and Close an active Download.
- CTRL+ r Hash Check a torrent before Upload/Download Begins.
- CTRL+ q When this key combination is executed twice, rTorrent shutdown without sending a stop Signal.
- Left Arrow Key Redirect to Previous screen.
- Right Arrow Key Redirect to Next Screen
### 2. Wget ###
Wget, is a part of GNU Project, the name is derived from World Wide Web (WWW). Wget is a brilliant tool which is useful for recursive download, offline viewing of HTML from local Server and is available for most of the platforms be it Windows, Mac, Linux. Wget makes it possible to download files over HTTP, HTTPS and FTP. Moreover it can be useful in mirroring the whole website as well as support for proxy browsing, pausing/resuming Downloads.
#### Installation of Wget ####
Wget being a GNU project comes bundled with Most of the Standard Linux Distributions and there is no need to download and install it separately. If in-case, its not installed by default, you can still install it using apt or yum.
# apt­-get install wget (on APT based System)
----------
# yum install wget (on YUM based System)
#### Some Basic Usage of Wget ####
Download a single file using wget.
# wget http://www.website-name.com/file
Download a whole website, recursively.
# wget -r http://www.website-name.com
Download specific type of file (say pdf and png) from a website.
# wget -r -A png,pdf http://www.website-name.com
Wget is a wonderful tool which enables custom and filtered download even on limited resource Machine. A screen shot of wget download, where we are mirroring a website (Yahoo.com).
![Wget Download Files](http://www.tecmint.com/wp-content/uploads/2014/02/Wget.jpeg)
Wget Command Line File Download
For more such wget download examples, read our article that shows [10 Wget Download Command Examples][1].
### 3. cURL ###
cURL is a command line tool for transferring data over a number of protocols. cURL is a client side application which support protocols like FTP, HTTP, FTPS, TFTP, TELNET, IMAP, POP3, etc. cURL is a simple downloader which is different from wget in supporting LDAP, POP3 as compared to others. Moreover Proxy Downloading, pausing download, resuming download are well supported in cURL.
#### Installation of cURL ####
By default cURL is available in most of the distribution either in repository or installed. if its not installed, just do a apt or yum to get a required package from the repository.
# apt­-get install curl (on APT based System)
----------
# yum install curl (on YUM based System)
Basic Usage of cURL
# curl www.tecmint.com
![Curl Download](http://www.tecmint.com/wp-content/uploads/2014/02/Curl.jpeg)
Curl Data Download
![Curl Data Download](http://www.tecmint.com/wp-content/uploads/2014/02/Curl-2.jpeg)
Curl Download
### 4. w3m ###
The w3m is a text based web browser released under GPL. W3m support tables, frames, color, SSL connection and inline images. W3m is known for fast browsing.
#### Installation of w3m ####
Again w3m is available by default in most of the Linux Distribution. If incase, it is not available you can always apt or yum the required package.
# apt­-get install w3m (on APT based System)
----------
# yum install w3m (on YUM based System)
#### Basic Usage of w3m ####
# w3m www.tecmint.com
![Command Line Browser](http://www.tecmint.com/wp-content/uploads/2014/02/w3m.jpeg)
w3m Text Based Web Browser
### 5. Elinks ###
Elinks is a free text-based web browser for Unix and Unix based System. Elinks support HTTP, HTTP Cookies and also support browsing script in Perl and Ruby. Tab based browsing is well supported. The best thing is that it supports Mouse, Display Colours and support a number of Protocols like HTTP, FTP, SMB, Ipv4 and Ipv6.
#### Installation of Elinks ####
By default elinks also available in most of the Linux distributions. If not, install it via apt or yum.
# apt­-get install elinks (on APT based System)
----------
# yum install elinks (on YUM based System)
Basic Usage of Elinks
# elinks www.tecmint.com
![Command Line Internet Browsing](http://www.tecmint.com/wp-content/uploads/2014/02/Elinks.jpeg)
Elinks Command Line Web Browsing
Thats all for now. Ill be here again with an interesting article which you people will love to read. Till then stay tuned and connected to Tecmint and dont forget to give your valuable feedback in comment section.
--------------------------------------------------------------------------------
via: http://www.tecmint.com/linux-command-line-tools-for-downloading-files/
作者:[Avishek Kumar][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.tecmint.com/author/avishek/
[1]:http://www.tecmint.com/10-wget-command-examples-in-linux/

View File

@ -0,0 +1,85 @@
How to secure BGP sessions using authentication on Quagga
================================================================================
The BGP protocol runs over TCP, and as such, it inherits all the vulnerabilities of a TCP connection. For example, within a BGP session, an attacker may impersonate a legitimate BGP neighbor, and convince the BGP routers on the other end to share their routing information with the attacker. The problem occurs when the attacker advertises and injects bogus routes towards neighboring routers. The unsuspecting neighboring routers may then start sending live traffic towards the attacker, which in most cases goes nowhere and simply gets dropped. Back in 2008, YouTube actually [fell victim][1] to such BGP route poisoning, and suffered major outage on their video service for more than an hour. In a far worse case, if the attacker is savvy enough, they can falsely act as a transparent transit router and sniff the transit traffic for any sensitive data. As you can imagine, this can have far reaching consequences.
To protect active BGP sessions against such attacks, many service providers leverage [MD5 checksum and a pre-shared key][2] for their BGP sessions. In a protected BGP session, a BGP router which sends a packet generates an MD5 hash value by using a pre-shared key, portions of the IP and TCP headers and the payload. The MD5 hash is then stored as a TCP option field. Upon receipt of the packet, a receiving router uses the same method to generate its version of the MD5 hash using a pre-shared key. It compares the hash with the one of the received packet to decide whether to accept the packet. For an attacker, it is almost impossible to guess the checksum or the key. For BGP routers, they can be assured that each packet is validated before its content is consumed.
In this tutorial, we will see how we can secure a BGP session between two neighbors using MD5 checksum and a pre-shared key.
### Preparation ###
Securing a BGP session is fairly straightforward. We will use the following routers.
注:表格
<table id="content">
<tbody><tr>
<td><b>Router name</b></td>
<td><b>AS</b></td>
<td><b>IP address</b></td>
</tr>
<tr>
<td>router-A</td>
<td>100</td>
<td>10.10.12.1/30</td>
</tr>
<tr>
<td>router-B</td>
<td>200</td>
<td>10.10.12.2/30</td>
</tr>
</tbody></table>
The stock Linux kernel supports TCP MD5 option natively for IPv4 and IPv6. Thus if you built Quagga router from a brand new [Linux box][3], TCP MD5 capability will be automatically available for Quagga. It'll be just a matter of configuring Quagga to take advantage of the capability. But if you are using a FreeBSD box or built a custom kernel for Quagga, make sure that you enable TCP MD5 support on the kernel (e.g., CONFIG_TCP_MD5SIG kernel option in Linux).
### Configuring Router-A for Authentication ###
We will use the CLI shell of Quagga to configure the routers. The only new command that we will use is 'password'.
[root@router-a ~]# vtysh
router-a# conf t
router-a(config)# router bgp 100
router-a(config-router)# network 192.168.100.0/24
router-a(config-router)# neighbor 10.10.12.2 remote-as 200
router-a(config-router)# neighbor 10.10.12.2 password xmodulo
The pre-shared key in this example is 'xmodulo'. Obviously, in a production environment you need to select a strong key.
**Note**: in Quagga, the 'service password-encryption command is supposed to encrypt all plain-text passwords (e.g., login password) in its configuration file. However, when I use this command, I notice that the pre-shared key in BGP configuration still remains in clear text. I am not sure whether it's a limitation of Quagga, or whether it's a version issue.
### Configuring Router-B for Authentication ###
We will configure router-B in a similar fashion.
[root@router-b ~]# vtysh
router-b# conf t
router-b(config)# router bgp 200
router-b(config-router)# network 192.168.200.0/24
router-b(config-router)# neighbor 10.10.12.1 remote-as 100
router-b(config-router)# neighbor 10.10.12.1 password xmodulo
### Verifying a BGP session ###
If everything has been configured correctly, the BGP session should be up, and both routers should be exchanging routes. At this point, every outgoing packet in a TCP session carries a MD5 digest of the packet contents and a secret key, and the digest is automatically validated by the other end point.
We can verify the active BGP session by viewing BGP summary as usual. MD5 checksum verification occurs transparently within Quagga, so you don't see it at the BGP level.
![](https://farm8.staticflickr.com/7621/16837774368_e9ff66b370_c.jpg)
If you want to test BGP authentication, you can configure one neighbor without a password or deliberately use a wrong pre-shared key and see what happens. You can also use a packet sniffer like tcpdump or Wireshark to analyze the packets that go through the BGP session. For example, tcpdump with "-M <secret>" option will validate the MD5 digests found in TCP option field.
To sum up, in this tutorial we demonstrate how we can easily secure the BGP session between two routers. The process is very straightforward compared to other protocols. It is always recommended to secure your BGP session, especially if you are setting up the BGP session with another AS. The pre-shared key should also be kept safe.
--------------------------------------------------------------------------------
via: http://xmodulo.com/bgp-authentication-quagga.html
作者:[Sarmed Rahman][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/sarmed
[1]:http://research.dyn.com/2008/02/pakistan-hijacks-youtube-1/
[2]:http://tools.ietf.org/html/rfc2385
[3]:http://xmodulo.com/centos-bgp-router-quagga.html