Friday, September 19, 2008

VIM text editor highlighted..


If you are Ubuntu user, you are by default using vim text editor without highlighting. Well, if you have used openSUSE before, then you will notice that its vim editor comes with this feature out-of-the-box.

We managed to see Ubuntu easier and more eye-candy than other Linux distros, so, why this feature is absent from Ubuntu while it is a nice and eye-candy one.

Lets go ahead and enable it together, it is easy:

1. Open a shell ..
2. Type this:
sudo gedit /etc/vim/vimrc
(Install vim if it is not already installed, just type: sudo aptitude install vim).
3. Search for: "syntax"
4. You will see this line commented:
#syntax on
5. Remove the # sign (uncomment the line).
6. Save and exit gedit.
7. We are done, enjoy vim highlighted.


Wednesday, September 10, 2008

Enjoy man pages colorized

Hi everyone,

Linux users know that manual pages (aka man pages), is initially black and white.

Yet, we can colorize them with two simple steps: (I use Linux mint/ubuntu here)

-- Open a shell and execute this:
sudo aptitude install most
-- After application is installed successfully, execute the following:
sudo update-alternatives --set pager /usr/bin/most

That is it, now enjoy a beautiful colored man pages..


Sunday, September 7, 2008

How to look up in the dictionary, via CLI (Command Line Interpreter)


Have you been in a problem, when you don't have a GUI, and want to look up a word in the dictionary.

Here is how to do it, so let's begin:

Everybody heard about Oh, you did not! so let me tell you, is a WWW interface to several freely available on-line dictionaries.

This is the first resource, second, is DICT protocol, which is a protocol to access dictionary services on the Internet (like www, a protocol to access hyper-text transfer services on the Internet, i.e. web browsing).

So, we need a combination, to make DICT to transfer data from via CLI. Yes, we have curl.

CURL, is a tool to transfer data from or to a server, using one of the supported protocols HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE). The command is designed to work without user interaction.

Now, how to use curl to transfer dictionary queries from to our CLI, here is how:

curl dict://<word_to_look_in_the_dictionary>

for example: curl dict://, will give the following results:

220 dictd 1.9.15/rf on Linux 2.6.18-6-k7 <>
250 ok
150 1 definitions retrieved
151 "Lion" gcide "The Collaborative International Dictionary of English v.0.48"
Lion \Li"on\ (l[imac]"[u^]n), n. [F. lion, L. leo, -onis, akin
to Gr. le`wn. Cf. {Chameleon}, {Dandelion}, {Leopard}.]
1. (Zool.) A large carnivorous feline mammal ({Panthera leo},
formerly {Felis leo}), found in Southern Asia and in most
parts of Africa, distinct varieties occurring in the
different countries. The adult male, in most varieties,
has a thick mane of long shaggy hair that adds to his
apparent size, which is less than that of the largest
tigers. The length, however, is sometimes eleven feet to
the base of the tail. The color is a tawny yellow or
yellowish brown; the mane is darker, and the terminal tuft
of the tail is black. In one variety, called the {maneless
lion}, the male has only a slight mane.
[1913 Webster]

2. (Astron.) A sign and a constellation; Leo.
[1913 Webster]

3. An object of interest and curiosity, especially a person
who is so regarded; as, he was quite a lion in London at
that time.
[1913 Webster]

Such society was far more enjoyable than that of
Edinburgh, for here he was not a lion, but a man.
[1913 Webster]

{American lion} (Zool.), the puma or cougar.

{Lion ant} (Zool.), the ant-lion.

{Lion dog} (Zool.), a fancy dog with a flowing mane, usually
clipped to resemble a lion's mane.

{Lion lizard} (Zool.), the basilisk.

{Lion's share}, all, or nearly all; the best or largest part;
-- from Aesop's fable of the lion hunting in company with
certain smaller beasts, and appropriating to himself all
the prey.

{Lion of Lucerne}, a famous sculptured lion at Lucerne,
Switzerland, designed by Thorwaldsen and dedicated in 1821
as a memorial to the Swiss Guards who fell defending Louis
XVI. in the attack of the mob on the Tuileries, Aug. 10,
1792. The animal, which is hewn out of the face of a rock,
is represented as transfixed with a broken spear and
dying, but still trying to protect with its paw a shield
bearing the fleur-de-lis of France.

{Lion of St. Mark}, a winged lion, the emblem of the
evangelist Mark, especially that of bronze surmounting a
granite column in the Piazzetta at Venice, and holding in
its fore paws an open book representing St. Mark's Gospel.

{Lion of the North}, Gustavus Adolphus (1594-1632), King of
Sweden, the hero of the Protestant faith in the Thirty
Years' War.
[1913 Webster + Webster 1913 Suppl.]
250 ok [d/m/c = 1/0/17; 0.000r 0.000u 0.000s]
221 bye [d/m/c = 0/0/0; 0.000r 0.000u 0.000s]

Thank you for viewing,