Linux的10个经典彩蛋

发表于:2014-7-15 09:25

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:有孚    来源:51Testing软件测试网

  要退出Emacs的话,同时按下ctrl键和x,然后是ctrl+c:
  Ctrl-x
  Ctrl-c
  Apt命令
  apt-get的超级牛力
  在Ubuntu和Debian上,apt-get这个包管理器很久以来一直都内嵌着一个彩蛋。
  如果你输入一个apt-get的帮助命令,你会得到个这样的提示:
  apt-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.
  这个APT有着超级牛力。
  如果看到最后一行的提示说明这个版本的apt是支持这个彩蛋的。再输入一个:
  apt-get moo
  (__)
  (oo)
  /------\/
  / |    ||
  *  /\---/\
  ~~   ~~
  ...."Have you mooed today?"…
  Aptitude的呢?
  看到apt-get和牛的暧昧关系,用户不禁会想,另一个apt工具aptitude是不是也有这个有趣的彩蛋呢?
  我们像之前那样再试一下:
  aptitude 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.
  这个aptitude没有超级牛力。
  太令人失望了。再试下别的方式:
  aptitude moo
  There are no Easter Eggs in this program(这个程序没有彩蛋).
  太直白了吧。不过坚持很重要。我们再试下有没有更多信息:
  aptitude -v moo
  There really are no Easter Eggs in this program.(这个程序真的没有彩蛋)
  再来:
  aptitude -vv moo
  Didn't I already tell you that there are no Easter Eggs in this program?
  我不是告诉过你这个程序没有彩蛋了吗?
  不过你再不停的加v的话,最终你会看到这个:
  aptitude -vvvvv moo
  All right, you win.好吧,你贏了。
  /----\
  -------/      \
  /               \
  /                |
  -----------------/                  --------\
  ----------------------------------------------
  不过这看着不大像。我们再加一个v:
  aptitude -vvvvvv moo
  What is it?  It's an elephant being eaten by a snake, of course.
  这是什么?这就是一条蛇吞了一只大象.(看不懂的请自觉搜索小王子)
  这里引用了Antoine de Saint-Exupéry的《小王子》书里的一句话。
  常见程序的另类参数
  在一些常见的程序中也有些奇怪的参数,这你一定会很好奇。
  用sudo来羞辱用户
  你可以配置sudo(用来给命令授权的),来羞辱那些输错密码的用户。
  想这么做的话,先用个visudo的工具编辑下sudoers文件,这个工具用来编辑sudo配置文件并且进行修改的校验。
  sudo visudo
  在文件顶部,加上这么一行:
  Defaults insults
  然后保存并且关闭文件。
  然后,清空密码的缓存,然后在sudo命令里输入错的密码:
  sudo -k
  sudo ls
  [sudo] password for demo: # 输入一个错的密码
  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输出
  Nmap是一款网络检测工具,它可以用来进行系统的安全检查。
  在Ubuntu/Dedian上安装一下它:
  sudo apt-get install nmap
  在CentOS/Fedora上面这样:
  sudo yum install nmap
  Nmap提供了这么一个选项,让它能把数据输出成“脚本小子”的那种格式。
  我们先来看下正常的格式是什么样的,用Nmap来检测下它自己的网站:
  nmap scanme.nmap.org
  Starting Nmap 5.21 ( http://nmap.org ) at 2013-09-18 17:43 UTC
  Nmap scan report for scanme.nmap.org (74.207.244.221)
  Host is up (0.072s latency).
  Not shown: 998 closed ports
  PORT   STATE SERVICE
  22/tcp open  ssh
  80/tcp open  http
  Nmap done: 1 IP address (1 host up) scanned in 1.40 seconds
  我们来加个选项调整下输出的格式:
  $tart|ng NMap 5.21 ( http://Nmap.org ) at 2013-09-18 17:45 UTC
  Nmap $cAn r3p0rt F0r scanM3.nmaP.oRg (74.207.244.221)
  Ho$t 1z Up (0.071z laT3ncy).
  Not sh0wN: 998 cl0$Ed p0rt$
  POrT   ST4TE $ERV!C3
  22/tcp opEn  Ssh
  80/tcP 0p3n  HtTp
  Nmap d0n3: 1 iP AddrESz (1 h0$t Up) $canNed !n 1.34 secondz
  其实它就是用看起来相近的字符替换了原有的字符,让结果看起来更有“黑客范”一点。
  命令行的星球大战
  终端里就有两款网络版的命令行的星球大战。
  用telnet观看ASCII版的星球大战影片
  Simon Jansen, Sten Spans, 和Mike Edwards用ASCII模拟了一个完整的星球大战影片,你可以用telnet来观看它。 首先,如果没有安装的话,下载一下telnet,它是ssh的先驱:
  在Ubuntu/Debian上面:
  sudo apt-get install telnet
  在CentOS/Fedora上面:
  sudo yum install telnet
  然后你只要连上正确的服务器就可以了:
telnet towel.blinkenlights.nl
/~\
R2-D2!                   |oo )
Where are you?         #     _\=/_    #
\\  /  _  \  //
\\//|/.\|\\//
\/  \_/  \/
|\ /|
\_ _/
| | |
| | |
[]|[]
| | |
_______________________________/_]_[_\_____________________________
  如果你不想看了,按下ctrl+]。会有一个提示,然后你输入”close”就行了:
  Ctrl-]
  close
  星球大战版traceroute
  还有一份献礼是Ryan Werber送上的,他把网络的节点全都命名成特殊的地址了。
  如果你运行traceroute,一个跟踪网络包到远程机器的路径的程序,你会在网络节点名上看到星球大战的介绍。
  就敲一下:
  traceroute -m 254 -q1 obiwan.scrye.net
  路由信息就会不断产生了。经过几跳后,奇迹发生了:
. . .
. . .
15  Episode.IV (206.214.251.1)  77.506 ms
16  A.NEW.HOPE (206.214.251.6)  87.194 ms
17  It.is.a.period.of.civil.war (206.214.251.9)  77.699 ms
18  Rebel.spaceships (206.214.251.14)  78.171 ms
19  striking.from.a.hidden.base (206.214.251.17)  87.624 ms
20  have.won.their.first.victory (206.214.251.22)  86.249 ms
21  against.the.evil.Galactic.Empire (206.214.251.25)  77.505 ms
22  During.the.battle (206.214.251.30)  85.622 ms
23  Rebel.spies.managed (206.214.251.33)  78.121 ms
24  to.steal.secret.plans (206.214.251.38)  77.049 ms
. . .
. . .
  在第4,5,6幕介绍完后,Ryan开始自娱自乐起来了:
  99  Were.no.strangers.to.love (206.214.251.206)  77.472 ms
  100  You.know.the.rules.and.so.do.I (206.214.251.209)  78.054 ms
  101  A.full.commitments.what.Im.thinking.of (206.214.251.214)  78.512 ms
  102  I.just.wanna.tell.you.how.Im.feeling (206.214.251.217)  79.884 ms
  103  Gotta.make.you.understand (206.214.251.222)  79.427 ms
  104  Never.gonna.give.you.up (206.214.251.225)  77.032 ms
  105  Never.gonna.let.you.down (206.214.251.230)  78.909 ms
  106  Never.gonna.run.around.and.desert.you (206.214.251.233)  80.286 ms
  纯粹找乐子的程序
  还有些程序是你压根儿不需要的,不过有时候可以拿来打发打发时间。
32/3<123>
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号