十大 Linux 复活节彩蛋

没有明确的名单......


通常情况下,当你登录你的LinuxVPS时,你想完成一些工作,但是没有人可以声称那些在典型的Linux机器上创建软件的数千名开发人员总是完全认真的。

Linux在其软件中包含了一些有趣的复活节蛋的历史,在本文中,我们将告诉您一些有趣的命令和选项,以使您的日子更轻松。

文本编辑


维姆和道格拉斯·亚当斯


那些熟悉The Hitchhiker's Guide to the Galaxy的作者(Douglas Adams)的人将欣赏vim文本编辑器中包含的相关帮助选项。

如果你还没有,安装vim. 在Ubuntu/Debian中,你可以输入:

1sudo apt-get install vim

在 CentOS/Fedora 中,您可以键入:

1sudo yum install vim

从命令行打开编辑器:

1vim

输入以下内容以访问特殊的 vim 帮助菜单:

1:help 42

1What is the meaning of life, the universe and everything?  *42*
2Douglas Adams, the only person who knew what this question really was about is
3now dead, unfortunately. So now you might wonder what the meaning of death
4is...

输入以下,两次,以退出 vim:

1:q
2:q

Emacs 游戏


不要超越,Emacs,文本编辑器以包括除了厨房洗碗机之外的一切而闻名,包括一个惊人的数量的游戏,可以从编辑器本身访问。

首先,安装 emacs. 在 Ubunut/Debian 上,这将是:

1sudo apt-get install emacs

在 CentOS/Fedora 上,执行以下命令:

1sudo yum install emacs

您可以通过查看此目录来了解哪些游戏可用:

1cd /usr/share/emacs/*/lisp/play
2ls

15x5.elc decipher.elc gametree.elc meese.elc spook.elc
2animate.elc dissociate.elc gomoku.elc morse.elc studly.elc
3blackbox.elc doctor.elc handwrite.elc mpuz.elc tetris.elc
4bruce.el dunnet.elc hanoi.elc pong.elc yow.elc
5bubbles.elc fortune.elc landmark.elc snake.elc zone.elc
6cookie1.elc gamegrid.elc life.elc solitaire.elc

要执行它们,打开 Emacs:

1emacs

接下来,输入Esc键,然后输入x键(执行),然后输入你想要开始的游戏的名称:

1Esc-x
2pong
Emacs pong

要结束 Emacs 完成后,键入Ctrl,然后是x,然后是Ctrlc:

1Ctrl-x
2Ctrl-c

八大命令


Apt-Get 牛


在Ubuntu和Debian上,apt-get包管理器已经嵌入了复活节蛋很长一段时间了。

如果您键入 apt-get 的帮助命令,您将收到一个提示:

1apt-get help
. . .
. . .
  -c=? Read this configuration file
  -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp
See the apt-get(8), sources.list(5) and apt.conf(5) manual
pages for more information and options.
                       This APT has Super Cow Powers.

最后一行告诉我们,复活节蛋在这个版本中是活跃的。

1apt-get moo

1(__) 
2         (oo) 
3   /------\/ 
4  / |    ||   
5 *  /\---/\ 
6    ~~   ~~   
7...."Have you mooed today?"...

牛的能力?


随着apt-get对奶牛的亲密关系,用户可能对另一个apt工具aptitude是否也实现了一个有趣的复活节蛋感到好奇。

我们可以像以前一样检查帮助:

1aptitude help
. . .
. . .
 -u Download new package lists on startup.
                  (terminal interface only)
 -i Perform an install run on startup.
                  (terminal interface only)

                  This aptitude does not have Super Cow Powers.

这是一个令人失望的例子,不管怎样,我们还是试试吧:

1aptitude moo

1There are no Easter Eggs in this program.

一个相当直接的答案,但坚持很重要,让我们添加一些词汇性:

1aptitude -v moo

1There really are no Easter Eggs in this program.

又一次:

1aptitude -vv moo

1Didn't I already tell you that there are no Easter Eggs in this program?

如果你继续添加更多的词汇,你最终会得到这个:

1aptitude -vvvvv moo

1All right, you win.
2
3                               /----\
4                       -------/      \
5                      /               \
6                     /                |
7   -----------------/                  --------\
8   ----------------------------------------------

它看起来不太好,我们再加上一个v:

1aptitude -vvvvvv moo

1What is it?  It's an elephant being eaten by a snake, of course.

这是安东尼·德·圣·埃克斯佩里(Antoine de Saint-Exupéry)的《小王子》(The Little Prince)一书的引用。

常见程序的奇怪选项


有一些奇怪的选项在一些常见的程序,你可能想检查。

利用 Sudo 侮辱用户


您可以配置sudo,用于提高命令的权限,以在输入错误密码时侮辱用户。

要做到这一点,用一个名为visudo的工具编辑 sudoers 文件,该工具会编辑和验证 sudo 配置文件的更改。

1sudo visudo

靠近顶部,添加一个字符串,上面写着:

1Defaults insults

保存并关闭文件。

接下来,清空存储密码的缓存,然后错误键入 sudo 命令的密码:

1sudo -k
2sudo ls
[sudo] password for demo: # Type an incorrect password here
Have you considered trying to match wits with a rutabaga?
[sudo] password for demo: 
My pet ferret can type better than you!
[sudo] password for demo:
Wrong!  You cheating scum!

用于 Nmap 的 Kiddie 输出


Nmap 是一个常用的网络勘探工具,可以用来对您的系统进行安全审核。

在 Ubuntu/Debian 上安装,使用以下命令:

1sudo apt-get install nmap

在CentOS/Fedora上,通过输入:

1sudo yum install nmap

Nmap为您提供了能够以kiddie格式输出数据的异常选项。

让我们先看看正常输出看起来是什么样子,通过对Nmap网站本身运行命令:

1nmap scanme.nmap.org

1Starting Nmap 5.21 ( http://nmap.org ) at 2013-09-18 17:43 UTC
2Nmap scan report for scanme.nmap.org (74.207.244.221)
3Host is up (0.072s latency).
4Not shown: 998 closed ports
5PORT STATE SERVICE
622/tcp open ssh
780/tcp open http
8
9Nmap done: 1 IP address (1 host up) scanned in 1.40 seconds

现在,让我们通过这些选项启用替代输出:

1nmap -oS - scanme.nmap.org

1$tart|ng NMap 5.21 ( http://Nmap.org ) at 2013-09-18 17:45 UTC
2Nmap $cAn r3p0rt F0r scanM3.nmaP.oRg (74.207.244.221)
3Ho$t 1z Up (0.071z laT3ncy).
4Not sh0wN: 998 cl0$Ed p0rt$
5POrT ST4TE $ERV!C3
622/tcp opEn Ssh
780/tcP 0p3n HtTp
8
9Nmap d0n3: 1 iP AddrESz (1 h0$t Up) $canNed !n 1.34 secondz

基本上,它用类似的字符代替某些字母以模仿黑客语言或 leet-speak

星球大战指挥线


有两个不同的网络可访问的命令行星大战礼物可从您的终端访问。

ASCII《星球大战通过Telnet》


Simon Jansen, Sten Spans,和Mike Edwards创建了一个完整的星球大战纪念在ASCII(文本)动画艺术通过telnet。

首先,下载telnet,如果尚未安装,则是SSH的前身:

在 Ubuntu/Debian 上:

1sudo apt-get install telnet

关于CentOS/Fedora:

1sudo yum install telnet

从这里开始,你只需要点 telnet 到正确的服务器:

1telnet towel.blinkenlights.nl

 1/~\                               
 2         R2-D2!                   |oo )                              
 3     Where are you?         #     _\=/_    #                         
 4                             \\  /  _  \  //                         
 5                              \\//|/.\|\\//                          
 6                               \/  \_/  \/                           
 7                                  |\ /|                              
 8                                  \_ _/                              
 9                                  | | |                              
10                                  | | |                              
11                                  []|[]                              
12                                  | | |                              
13  _______________________________/_]_[_\_____________________________

当你有足够的时间时,按住Ctrl],你会得到一个提示,你可以输入关闭:

1Ctrl-]
2close

星球大战 Traceroute


一个更新的荣誉星球大战已获得由Ryan Werber(http://beaglenetworks.net/post/44380286301/special-treat-new-star-wars-traceroute)通过命名网络跳跃到一个特定的地址。

如果你运行traceroute,一个跟踪包到远程主机的路径的程序,你将看到路途中的网络名称中星球大战的介绍。

简单的类型:

1traceroute -m 254 -q1 obiwan.scrye.net

路线将开始挤满,几次停车后,你将开始看到魔法:

 1. . .
 2. . .
 315 Episode.IV (206.214.251.1)  77.506 ms
 416 A.NEW.HOPE (206.214.251.6)  87.194 ms
 517 It.is.a.period.of.civil.war (206.214.251.9)  77.699 ms
 618 Rebel.spaceships (206.214.251.14)  78.171 ms
 719 striking.from.a.hidden.base (206.214.251.17)  87.624 ms
 820 have.won.their.first.victory (206.214.251.22)  86.249 ms
 921 against.the.evil.Galactic.Empire (206.214.251.25)  77.505 ms
1022 During.the.battle (206.214.251.30)  85.622 ms
1123 Rebel.spies.managed (206.214.251.33)  78.121 ms
1224 to.steal.secret.plans (206.214.251.38)  77.049 ms
13. . .
14. . .

在經歷了第四集、第五集和第六集的介紹後,瑞安繼續與其他娛樂途徑:

199 Were.no.strangers.to.love (206.214.251.206)  77.472 ms
2100 You.know.the.rules.and.so.do.I (206.214.251.209)  78.054 ms
3101 A.full.commitments.what.Im.thinking.of (206.214.251.214)  78.512 ms
4102 I.just.wanna.tell.you.how.Im.feeling (206.214.251.217)  79.884 ms
5103 Gotta.make.you.understand (206.214.251.222)  79.427 ms
6104 Never.gonna.give.you.up (206.214.251.225)  77.032 ms
7105 Never.gonna.let.you.down (206.214.251.230)  78.909 ms
8106 Never.gonna.run.around.and.desert.you (206.214.251.233)  80.286 ms

安装更多乐趣


有几个程序,你可能不需要任何其他目的,但如果你有时间,可以有趣。

从你的类型学习


如果你曾经意外地键入sl,当你打算列出一个目录的内容为ls,那么你可能想要安装一个程序sl

在 Ubuntu/Debian 上:

1sudo apt-get install sl

关于CentOS/Fedora:

1sudo yum install sl

现在,每当你意外地键入sl而不是ls,你将不得不微笑:

1sl

 1(  ) (@@) ( )  (@)  ()    @@    O     @     O     @
 2                     (@@@)
 3                 (    )
 4              (@@@@)
 5
 6            (   )
 7        ====        ________ ___________
 8    _D _|  |_______/        \__I_I_____===__|_________|
 9     |(_)---  |   H\________/ |   |        =|___ ___|      _________________
10     /     |  |   H  |  |     |   |         ||_| |_||     _|                \___
11    |      |  |   H  |__--------------------| [___] |   =|
12    | ________|___H__/__|_____/[][]~\_______|       |   -|
13    |/ |   |-----------I_____I [][] []  D   |=======|____|______________________
14  __/ =| o |=-~~\  /~~\  /~~\  /~~\ ____Y___________|__|________________________
15   |/-=|___|=O=====O=====O=====O   |_____/~\___/          |_D__D__D_|  |_D__D__D
16    \_/      \__/  \__/  \__/  \__/      \_/               \_/   \_/    \_/   \

一列火车每次都会穿过你的屏幕。

与Cowsay和财富的乐趣


如果你在命令行上需要一些更便宜的娱乐,并且没有从适当的复活节鸡蛋中得到你的奶牛填充,你可以下载牛肉幸运

在 Ubuntu/Debian 上:

1sudo apt-get install fortune cowsay

One CentOS / 费多拉:

1sudo yum install fortune cowsay

Cowsay将任何输入插入到一个单词泡沫中,并引用一个ASCII牛来与你交谈:

1cowsay "hello, I'm a cow"

1__________________
2< hello, I'm a cow >
3 ------------------
4        \   ^__^
5         \  (oo)\_______
6            (__)\       )\/\
7                ||----w |
8                ||     ||

财富计划喷出引用,财富,笑话,无聊,可以被导入牛排:

1fortune | cowsay

 1________________________________________
 2/ Q: What looks like a cat, flies like a \
 3| bat, brays like a donkey, and          |
 4|                                        |
 5\ plays like a monkey? A: Nothing.       /
 6 ----------------------------------------
 7        \   ^__^
 8         \  (oo)\_______
 9            (__)\       )\/\
10                ||----w |
11                ||     ||

如果你不太喜欢牛,你也可以得到其他字符:

1fortune | cowsay -f tux

 1_____________________________________
 2/ You never know how many friends you \
 3| have until you rent a house on the  |
 4\ beach.                              /
 5 -------------------------------------
 6   \
 7    \
 8        .--.
 9       |o_o |
10       |:_/ |
11      //   \ \
12     (|     | )
13    /'\_ _/`\
14    \___)=(___/

要查看可用的字符的完整列表,键入:

1cowsay -l

1Cow files in /usr/share/cowsay/cows:
2apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon default
3dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep
4ghostbusters gnu head-in hellokitty kiss kitty koala kosh luke-koala
5mech-and-cow meow milk moofasa moose mutilated pony pony-smaller ren sheep
6skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey
7turtle tux unipony unipony-smaller vader vader-koala www

我个人最喜欢的就是Stegosaurus。

1fortune | cowsay -f stegosaurus

 1_________________________________________
 2/ Q: What lies on the bottom of the ocean \
 3\ and twitches? A: A nervous wreck.       /
 4 -----------------------------------------
 5\                             .       .
 6 \                           / `.   .' " 
 7  \                  .---.  <    > <    >  .---.
 8   \                 |    \  \ - ~ ~ - /  /    |
 9         _____          ..-~             ~-..-~
10        |     |   \~~~\.'                    `./~~~/
11       ---------   \__/                        \__/
12      .'  O    \     /               /       \  " 
13     (_____,    `._.'               |         }  \/~~~/
14      `----.          /       }     |        /    \__/
15            `-.      |       /      |       /      `. ,~~|
16                ~-.__|      /_ - ~ ^|      /- _      `..-'   
17                     |     /        |     /     ~-.     `-. _ _ _
18                     |_____|        |_____|         ~ - . _ _ _ _ _>

正如你所看到的,不是非常有用的,但相当有趣。

结论


这个指南可能没有传达任何必要的知识或提高你的Linux能力,但希望它帮助你放松,也许甚至探索你的系统一点点。

让我们在评论中告诉我们,如果你有其他好的复活节蛋或不寻常的,有趣的命令。

By Justin Ellingwood
Published At
Categories with 技术
comments powered by Disqus