print every nth line

Some time back I was working with lot of data and wanted to analyze only the every 10 line sometimes and sometimes every 20th line. I had to keep doing these changes in vim or otherwise so finally I wrote a program to do this for me. If you need such a program then here it is:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash -
#===============================================================================
#
#          FILE:  print_nth_line.sh
#
#         USAGE:  ./print_nth_line.sh
#
#   DESCRIPTION:  Print every nth line
#
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR:   (),
#       COMPANY:
#       VERSION:  1.0
#       CREATED:  12/08/2010 05:36:53 PM IST
#      REVISION:  ---
#===============================================================================

if [ x"$1" == "x" ]
then
echo "Please provide the line numbers to print .. .ex 3 will print 3,6,9"
exit -1;
fi
if [ x"$2" == "x" ]
then
echo "Please provide the filename"
exit -2;
fi
awk 'temp++ { if ( temp % '$1' == 0) print $1};' $2
Enhanced by Zemanta

Photo Editing with nice border and preparing for print.

Working with photos in Linux is very easy with lots of viewers/editors/managers and what not. Not that there are not many options in Windows but most of them are not free. BEST case scenario is that you might get a evaluation version (i.e. if you do not use pirated/cracked version) of software‘s. Me, being completely against pirated and cracked version or evaluation version (if not, planning to buy the same) like the freedom of choice with Linux.

Now, this freedom also means that there are some features in one software that is not there in others. So, here is one more for the enthusiastic one’s to play around with. This one does not do much 🙂

Here is the info on the software itself:

PhotoPrint is a utility designed to assist in the process of printing digital photographs. PhotoPrint can do the following:

* Print photographs 1-up, 2-up, 4-up or with any user-selectable number of rows and columns.
* Create posters, split over several pages.
* Arrange images into a sort of Carousel, fading from one to another.  (Ideal for CD labels)
* Crop images to fit a specific frame.
* Apply a decorative border to an image.
* Make use of ICC colour profiles to provide accurate output.
* Send 16-bit data to the printer, to avoid “contouring” problems in smooth gradients.
* Apply a handful of effecs to an image, including sharpening, removing colour and adjusting colour temperature (ideal for cooling or warming black-and-white prints).

Okay, I know this does not look very promising until you are planning to get some prints. Don’t get started with flaming me but wait there’s more. There are some borders available to be used with this with description:

PhotoPrint Borders are the printing frames for use with PhotoPrint utility

Now, this is something that we can use to make our photos more beautiful. So, lets give it a try. Install both of these with the below command:

1
 sudo yum install photoprint-borders

Don’t worry we don’t need to worry about installation of photoprint as photoprint-borders has a dependency on the same, so it will be installed when you run the above. Once installed, fire it up with

1
photoprint

.

To get to what we want we will use 1 column and 1 row setup and then add the picture and add a frame and be done with it.

Here is the snapshot of the window:

Screenshot-photoprint 0.4.0
Screenshot-photoprint 0.4.0

To show you the effect, here is the original and the modified images:

Original Image of Hand
Original Image of Hand
Modified Image of Hand
Modified Image of Hand
Enhanced by Zemanta

[Movie Review]RANN- predictable from Puttu

IdealisticHarshvardhan mallik( B) and his son Jay(Sudeep), find their channel loosing out on popularity ratings for a rival channel smartly run by his X-employee Mohnish Behl. Jay is provoked and hence in an attempt to rebuild and regain the foothold,he plans a sting operationwith aspiring PM Manoj Pandey(Paresh Rawal) and his Co-Bro industrialistRajat Kapoor. Everybody gets their share,but end up gobbling the truth. How is that revealed and what are theirrepurcussions forms the rest.

Frankly this aint a media centric movie, it is just a common thing among all the characters. It doesn\’t give an insight or per se the background processing of how print media sell news and grab people\’s attention. Okay we even despise this fact, since movies are not meant to educate, but to entertain. Then in that case Rann aint such a bad movie. Infact its a movie wherein conflicting characters are caught in different situations and the way they react to it. Though predictable for most part, it keeps youinterested because of RGV\’s styleof framing.

For example, a scene where Paresh Rawal bursts into different gigglesby looking at her grandmotherwhile negotiating with Mohnish Behl, is endearing to watch.

In another scene, involving him he delivers following line to display his ferociousness “Kuch to vajay hogi ki hum Manoj pandey hain”..

Sudeep as Jay has mighty role, but he hams it up at one point and alleviates at another. Watch him in that scene where he tries to convince Bof the sting operation.

Paresh rawal (last seen in Daud), as usual is a irresistable to watch indhoti clad goonda..

Rajpal yadav as wannabe CD perfectlydescribes the nuts runningbehind breaking news.

Riteish deshmukh(Parag shastry, find out what his role is) an ardent fan of Harshvardhan mallik, plays a straight faced journalist with little effect.

Mohnish behl looks unreal andovercooks himself.

Big B is mechanical throughout,other than the the final act. Watch him closely in that terrifically rendered confession cum monologue at the end, u see trembling hands.

Dont expect a complete parda-fash or revelation of how media mis-use,glorify and magnify the news. The film explains the effect that media has on the ppl involved in a capsulic way,including us – the couch potatoes, but never explains the effect on media itself.And that is an irony.

As mentioned above its not “Not-watchable” kinda of movie in its entirety, but give it a shot if u have an appetite for RGV\’s trademark narration and and his team\’s technical brilliance.

The review is done by Prashant Prahlad Abkari, who is a collegue and good friend of mine.

\"Reblog