Michael Christopher Phondiadi. Diberdayakan oleh Blogger.

Senin, 26 September 2016

Top 10 Linux Easter Eggs


Not a Definitive List...

Often, when you log into your Linux VPS, you are looking to get some work done. However, no one can claim that the thousands of developers who create the software available on a typical Linux machine are always completely serious.

Linux has a history of including some fun "easter eggs" in its software. In this article, we'll tell you about some fun commands and options to lighten up your day. Not all of them are "easter eggs", but we think you'll enjoy them none-the-less.

Text Editors

Vim and Douglas Adams

Those of you familiar with Douglas Adams, writer of The Hitchhiker's Guide to the Galaxy, will appreciate a relevant help option included in the vim text editor.

If you haven't already, install vim. In Ubuntu/Debian, you can type:

sudo apt-get install vim


In CentOS/Fedora, you can type: 
sudo yum install vim

Open the editor from the command line:
vim
 

Type the following to access a special vim help menu: 
:help 42

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

Type the following, twice, to exit vim:
:q
:q
  

Emacs Games

Not to be outdone, Emacs, the text-editor famous for including everything but the kitchen sink, includes a surprising number of games that can be accessed from within the editor itself.

First, install emacs. On Ubunut/Debian, this would be:
sudo apt-get install emacs
 

You can find out what games are available by checking out this directory:
cd /usr/share/emacs/*/lisp/play
ls
 

5x5.elc       decipher.elc    gametree.elc   meese.elc      spook.elc
animate.elc   dissociate.elc  gomoku.elc     morse.elc      studly.elc
blackbox.elc  doctor.elc      handwrite.elc  mpuz.elc       tetris.elc
bruce.el      dunnet.elc      hanoi.elc      pong.elc       yow.elc
bubbles.elc   fortune.elc     landmark.elc   snake.elc      zone.elc
cookie1.elc   gamegrid.elc    life.elc       solitaire.elc
 
To execute them, open Emacs: 
emacs

Next, type the Esc key, followed by x (for execute), and then type the name of the game you wish to start:
Esc-x
pong
 


To quit Emacs when you are finished, type Ctrl, followed by x, and then Ctrl and c:

ctrl-x
ctrl-c

Apt Commands

Apt-get Cows

On Ubuntu and Debian, the apt-get package manager has had an embedded easter egg for a long time now.

If you type the help command for apt-get, you will get a hint:

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.

The last line tells us that the easter egg is active in this version of apt. Type:

apt-get moo


         (__) 
         (oo) 
   /------\/ 
  / |    ||   
 *  /\---/\ 
    ~~   ~~   
...."Have you mooed today?"...

Aptitude Cows?

With apt-get's affinity for cows, users may be curious as to whether aptitude, another apt tool, also implements a fun easter egg.

We can check the help like before:

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.

Well that is disappointing. Let's try it anyways though:

aptitude moo


There are no Easter Eggs in this program.

A fairly straight forward answer. But persistence is important. Let's add some verbosity:

aptitude -v moo


There really are no Easter Eggs in this program.

And again...:

aptitude -vv moo


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

If you keep adding more "verbosity", you will eventually get this:

aptitude -vvvvv moo


All right, you win.

                               /----\
                       -------/      \
                      /               \
                     /                |
   -----------------/                  --------\
   ----------------------------------------------

It doesn't look like too much. Let's add another "v":

aptitude -vvvvvv moo


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

This is a reference to the book The Little Prince by Antoine de Saint-Exupéry.

pv Command

You might have seen simulating text in movies. It appears as, it is being typed in real time. Won’t it be nice, if you can have such an effect in terminal?
This can be achieved, by installing ‘pv‘ command in your Linux system by using ‘apt‘ or ‘yum‘ tool. Let’s install ‘pv‘ command as shown.

# yum install pv   [On RedHat based Systems]
# sudo apt-get install pv         [On Debian based Systems]

Once, ‘pv‘ command installed successfully on your system, let’s try to run the following one liner command to see the real time text effect on the screen.

$ echo "Tecmint[dot]com is a community of Linux Nerds and Geeks" | pv -qL 10 


Note: The ‘q‘ option means ‘quite’, no output information and option ‘L‘ means the Limit of Transfer of bytes per second. The number value can be adjusted in either direction (must be integer) to get desired simulation of text.

toilet Command

How about printing text with border in terminal, using an one-liner script command ‘toilet‘. Again, you must have ‘toilet‘ command installed on your system, if not use apt or yum to install it.

$ while true; do echo “$(date | toilet -f term -F border –Tecmint)”; sleep 1; done


Note: The above script needs to be suspended using ctrl+z key.

rig Command

This command generates a random identity and address, every time. To run, this command you need to install ‘rig‘ using apt or yum.

# rig

aview Command

How about viewing an image in ASCII format on the terminal? We must have a package ‘aview‘ installed, just apt or yum it. I’ve an image named ‘elephant.jpg‘ in my current working directory and I want view it on terminal as ASCII format.

$ asciiview elephant.jpg -driver curses 

xeyes Command

In last article we introduced a command ‘oneko‘ which attaches jerry with mouse pointer and keeps on chasing it. A similar program ‘xeyes‘ which is a graphical programs and as soon as you fire the command you will see two monster eyes chasing your movement.

$ xeyes

cowsay Command

Do you remember last time we introduced command, which is useful in output of desired text with animated character cow. What if you want other animal in place of cow? Check a list of available animals.

$ cowsay -l 

How about Elephant inside ASCII Snake?
$ cowsay -f elephant-in-snake Tecmint is Best 


How about Elephant inside ASCII goat?

$ cowsay -f gnu Tecmint is Best 


That’s all for now. I’ll be here again with another interesting article. Till then stay update and connected to backtrack. Don’t forget to provide us with your valuable feedback in the comments below.

0 komentar:

Posting Komentar