Pages

Showing posts with label number. Show all posts
Showing posts with label number. Show all posts

Thursday, July 13, 2017

Display File Content with Colors and Line Number Alternative to cat Ubuntu

Display File Content with Colors and Line Number Alternative to cat Ubuntu


Sometimes you may want to quickly display the contents of a file directly on the command line with the `cat` command. And sometimes the contents of that file is the source code of a program.

If you want to display the source code markup with colors and line numbers, then this trick is what you are looking for.

What you need to do first is install Pygments, a python syntax highlighter.

sudo apt-get install python-pygments python3-pygments

After installing pygments, you can now view source code with colored markups. just run the ff:

pygmentize testfile.rb

Now for the line numbers, you will have to pipe the `nl` command

pygmentize testfile.rb | nl --body-numbering=a

The option
--body-numbering
means it will accept a style for line numbering and it is any of the ff:

a - number all lines
t - number only nonempty lines
n - number no lines

I used a so that everything will be numbered including empty lines.

We can actually add nl options in bash alias so that we do not have to type it everytime.

alias nl=nl --body-number=a

While at it, lets also shorten the pygmentize command.

alias ccat=pygmentize

Now the source code syntax will be highlighted everytime we ran this command:

ccat testfile.rb | nl




Read more »

Thursday, June 15, 2017

Djuice FnF! How to Add fnf Number in Telenor DJuice TalkShawk

Djuice FnF! How to Add fnf Number in Telenor DJuice TalkShawk


Djuice is popular cellular brand by Telenor exclusively for youth nation of Pakistan. It offers best affordable Voice Calling, Internet and SMS packages at very reasonable prices. There are many DJuice Weekly Offers for Internet and Call Packages including the offer to make or build your own bundle plan package. To Check the Telenor DJuice Packages Dial *345*123#.

Many people are in search of that:

*  How to Add fnf in Telenor DJuice
*  How to Add fnf Number in Telenor TalkShawk
*  Djuice fnf Call Package 2017
*  Telenor fnf Add Code

If you are looking for the short code for Add, Delete or Check your Friends and Family (FnF) Numbers, then just Dial this short code *7777# or send SMS to 7777 or *7777*1*1#
Read more »