Tuesday, October 11, 2011

Vim and Sed

A tutorial on things that you could do with sed on vim.
  1. Search and replace pattern
  • Replace one pattern in a given line

Take the cursor to the desired line, press ESC and then colon sign and fire the following command

:s/OLD/NEW

  • Replace all pattern in a given line

Take the cursor to the desired line, press ESC and then colon sign and fire the following command

:s/OLD/NEW/g

  • Replace all pattern withn a given range of lines

Press ESC, colon sign, give range of line and then sed command. LINE_START is start line while LINE_END is end line between which all occurances of OLD will be replaced by NEW

:LINE_START,LINE_END s/OLD/NEW/g

  • Replace all pattern in the file

Press ESC, colon, line range and then sed commnad. 1,$ indicated first line and last line of the file

:1,$ s/OLD/NEW/g

Sunday, July 10, 2011

Babbar Sheeeerrrr

Woh to Mashooq hia har bat pe roothenge jigar;
Tum na ghabra ke kahin unse khafa ho jana


###########################################

Kyun tu acha lagta he waqt mila tu sochain gaye
Tujh main kia kia dekha he waqt mila tu sochain gaye

Abhi tu uljhe raastay ki gird pari he ankhoon main
Kiss raastay pe jana he waqt mila tu sochain gaye

Abhi tu gham-e-shiddat se khushk hue hain ansoo bhi
Kiss ki yaad main roona he waqt mila tu sochain gaye

Hum ne uss ko likha tha kuch milne ki tadbeer karoo
Uss ne likh kar bheja he waqt mila tu sochain gaye

Abhi tu zinda rahne ka ik bahana he tu bhi
Kiss ki khatir marna he waqt mila tu sochain gaye

Yaa tu apne dill ki mano yaa phir dunya waloon ki
Mashwara uss ka acha he waqt mila tu sochain gaye

###############################################################

KION TU ACHA LAGTA HAI, WAQT MILA TO SOCHENGE
TUJH MEI KIA KIA DEKHA HAI WAQT MILA TO SOCHENGE



SARA SHEHER SHANASAI KA, DAWEDAR TO HAI LEKIN
KON HAMARA APNA HAI, WAQT MILA TO SOCHENGE



HUM NE USKO LIKHA THA, KUCH MILNE KI TADBEER KARO
US NE LIKH KER BHEJA HAI, WAQT MILA TO SOCHENGE



MOSAM KHUSHBU BAAD-E-SABA CHAND SHAFAQ AUR TARON MEI
KON TUMHARE JAISA HAI ,WAQT MILA TO SOCHENGE



YA TO APNE DIL KI MANO, YA PHIR DUNIA WALON KI
MASHWARA USKA ACHA HAI WAQT,WAQT MILA TO SOCHENGE
#############################################################


Monday, February 28, 2011

Are you a hypocrite

Well....
how do you define a hypocrite, as per the dictionary
A person who professes beliefs and opinions that he or she does not hold in order to conceal his or her real feelings or motives

The definition seems so broad that it seems there is a part of it in all of us, but the question that I ask is, Is it all that bad?
We can say loads of stuffs in favor of the above question, but I will give my argument, why I do not think such a person is always an evil.
We do all sorts of evil things in daily life, hurt people, abuse people, do things which are considered as unethical immoral in any culture, civilization and religion. Yet we proud ourselves by saying, I am what I am and not what you or so to speak the society wants me to be. It is good to some extent because at least one would know what to expect from him. But then think it this way you are actually creating examples for people that this also a way of life and being bad in not that bad, Its just about what you want. They thus suck docile people into there act, and make a bigger pool of the type.
So my point is you can be bad, but boosting your evil in public is worse.
Point is if you think your act is good and it will spread good in the society be as straight forward as you can, be as vocal as you can. But if it is otherwise, keep you bad acts private to you, at-least do not spread the virus to others. In that scenario I feel being a hypocrite is not that bad, if you can not change you evil ways at least do not show it in public.
This might draw criticism that I am supporting the idea of doing bad things in private and being a good face in public. But the point is it can check the spread of evil to some extent.

Hope I am able to convey

Sunday, January 16, 2011

Haleem for all the novices like me :)

Ingredients:
  • Meat 1/2 kg (mutton/beef) - 1/2 Kg
  • Jao (Barley whole) - 100 grms
  • Wheat - Gehun (whole grain) - 100 grms
  • Rice 200 grms
  • Chana dal (split chickpeas) 200grms
  • Garam Masala ( Dal chini, badi elaiche, zera, golki and dhania ) accordingly
  • Green Chillies
  • Adrak
  • Lahson
  • Nimboo (For serving)
  • Dhania patta (For Serving)
Part 1: for those who hate to wait hours for haleem :)
  • Jao and gehun in equal proportion, wash it put it in a cooker water atleast 5-10 times amount of jao+gehun.
  • Add to it, onion (sliced is better others works as well)
  • Add lahsan, adrak, garam masala (powder or peaces ur choice)
  • Namak and chillies ( green is suggested, red works as well)
  • cook it with lid closed for atleas 30-40 minutes.
  • Remove the lid add some water and start stirring.
  • If you have not used garam masala powder then hand pick and remove (badi elaiche and dal chini)
  • Make a paste of it by stirring continuosly for hours or be intelligent and use a mixer grinder.
  • What ever you use make sure u end up with a tick paste and are not able to see any thing solid or granular.


Part 2
  • Take Chana dal in quantity equal to sum of jao and gehun.
  • Add same quantity of rice
  • Water 5-8 time the combined volume of chana dal and rice.
  • Add salt, mirch, haldi and put in cooker for atleast 30 min.
  • Take the gas out and use mixer grinder to make paste out of it or else if you are strong enough keep stirring
  • The mixture till u are able to make a paste out of it.
  • Again The final solution should not have any granuality or solid part should be thick and viscous

Part 3

  • Take water in a utensil ( For 1 kg meat water should be atleast 2 ltrs)
  • Add dalchini, badi elaichi, zeera, golki, dhania, tez patta
  • Boil it and then add meat to it
  • Add namak, mirch, haldi, and leave it to cook.
  • Keep stirring time to time so that it does not stick to the bottom.
  • When become soft, take out meat and remove bones from it.
  • Put boneless meat back in the utensil and then put the complete solution in pressure cooker.
  • cook for atleast 30-40 min. Take out meat and mash completly with spoon aur hand if you are heat proof ;)
  • Now put mashed meat back in utensil.

Final product
  • Now all the three portions are ready and now its time to make the final solution.
  • Mix all the three solutions in a utelnsil
  • Heat it and keep stirring (10-15 min) till the solutin is uniform and viscous.

Now the good news is that Haleem is ready to be served.

Serving
  • Normally used as a starter but can be used as main course as we do :)
  • Serve in a bowl, top up with sliced dhania, hari mirch, sliced adrak and lemon .

Special thanks to beenish siddiqui for her valuable inputs

PS: All valuable inputs will be most obliged with