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

Friday, September 3, 2010

The day it rained

aaj to googly ho gai.....
As it is said..... "khaya peeya kuch nahi glass toda barah ana"
There was similar story for me this day. Holy month of ramadhan and I had already missed last juma prayer.

Well for clarification, there was no tragedy that day it just slipped out of my mind, and just when I was preparing to go on roof for dhuhr prayer, a frnd who himself did not go to prayer for reasons best known to him remind me about friday. And by that time it was too late for anything .. even my FZ would have falied to reach there on time .... Just kidding I love my bike .. bottom line :P

Today.... well as expected I had this thing carved into my mind, today is friday and it being alvida ... I took extra precaution of starting 20 min early just to make sure nothing wrong happens this time. But destiny had better plans for me or to say worse plan.
It was gloomy and dark so chances of rain could not have been overruled, still I zoomed with my FZ towards mosque with my friend as pillion (the same guy who remind me last friday).

I will take this opertunity to describe the scene here .. it was just wonderfully toooooo good had it been some other day.
On the road stretch 100 mts ahead of us it was dry and just beyond that it was raining heavily near the mosque. People were approaching the barrier and returning towards the dry side. We took courage and crossed the barrier and were drenched as expected. We were prepared for that, but what we were not prepared for was to see jamat on the verge of ending salat.
My first reaction was that my clock is stunned and giving wrong time. Already wet tip to toe, we parked beside a dhaba. Still cursing myself that I can not come on time even once a week, I asked a fellow brother if it was early and we got confirmation for it.
They started half an hr behind normal time, I am not sure if it was announced in advance or they did this expecting the lash of the rain. Whatever was the reason, I am disappointed and sad that I missed alvida juma.
I am sitting in office (in ac) dripping with water and writing this blog .... have a meeting at 5 pm hope I am in a situation to attend it...
already started shivering .... hope I can withstand it :)

Saturday, December 19, 2009

cigarette in my hand - gary lawyer

I remember the time I had my first smoke
try it just once friends gently proposed
friends told me yes light a ciggi for a start
you would like the fire in the pretty girls heart
with cigarette in my hand I felt like man 2

My hero look so right with the cig on his lips
could I go wrong if i follow his tips
on the job I learned .....
cigarette had a place in every work day too
cigarette started evey hr of my day
could not get out of habit no way
with cigarette in my hand I felt like man 2

When moments were a little lonesome
cigarette and I happy to sing
cigarette slowly became my cruch
my energy and stamina are lost very much
until one day i couldn't stand on my feet
smoke made me feel real dead piece
then I realized I had payed a price
with cigarette in my hand I was a dead man

Wednesday, April 15, 2009

You Are Being Lied to About Pirates

By Johann Hari

April 12, 2009 "Huffington Post" --- Who imagined that in 2009, the world's governments would be declaring a new War on Pirates? As you read this, the British Royal Navy - backed by the ships of more than two dozen nations, from the US to China - is sailing into Somalian waters to take on men we still picture as parrot-on-the- shoulder pantomime villains. They will soon be fighting Somalian ships and even chasing the pirates onto land, into one of the most broken countries on earth. But behind the arrr-me-hearties oddness of this tale, there is an untold scandal. The people our governments are labeling as "one of the great menace of our times" have an extraordinary story to tell -- and some justice on their side.

Pirates have never been quite who we think they are. In the "golden age of piracy" - from 1650 to 1730 - the idea of the pirate as the senseless, savage thief that lingers today was created by the British government in a great propaganda-heave. Many ordinary people believed it was false: pirates were often rescued from the gallows by supportive crowds. Why? What did they see that we can't? In his book Villains of All nations, the historian Marcus Rediker pores through the evidence to find out. If you became a merchant or navy sailor then - plucked from the docks of London's East End, young and hungry - you ended up in a floating wooden Hell. You worked all hours on a cramped, half-starved ship, and if you slacked off for a second, the all-powerful captain would whip you with the Cat O' Nine Tails. If you slacked consistently, you could be thrown overboard. And at the end of months or years of this, you were often cheated of your wages.

Pirates were the first people to rebel against this world. They mutinied against their tyrannical captains - and created a different way of working on the seas. Once they had a ship, the pirates elected their captains, and made all their decisions collectively. They shared their bounty out in what Rediker calls "one of the most egalitarian plans for the disposition of resources to be found anywhere in the eighteenth century." They even took in escaped African slaves and lived with them as equals. The pirates showed "quite clearly - and subversively - that ships did not have to be run in the brutal and oppressive ways of the merchant service and the Royal navy." This is why they were popular, despite being unproductive thieves.

The words of one pirate from that lost age - a young British man called William Scott - should echo into this new age of piracy. Just before he was hanged in Charleston, South Carolina, he said: "What I did was to keep me from perishing. I was forced to go a-pirating to live." In 1991, the government of Somalia - in the Horn of Africa - collapsed. Its nine million people have been teetering on starvation ever since - and many of the ugliest forces in the Western world have seen this as a great opportunity to steal the country's food supply and dump our nuclear waste in their seas.

Yes: nuclear waste. As soon as the government was gone, mysterious European ships started appearing off the coast of Somalia, dumping vast barrels into the ocean. The coastal population began to sicken. At first they suffered strange rashes, nausea and malformed babies. Then, after the 2005 tsunami, hundreds of the dumped and leaking barrels washed up on shore. People began to suffer from radiation sickness, and more than 300 died. Ahmedou Ould-Abdallah, the UN envoy to Somalia, tells me: "Somebody is dumping nuclear material here. There is also lead, and heavy metals such as cadmium and mercury - you name it." Much of it can be traced back to European hospitals and factories, who seem to be passing it on to the Italian mafia to "dispose" of cheaply. When I asked Ould-Abdallah what European governments were doing about it, he said with a sigh: "Nothing. There has been no clean-up, no compensation, and no prevention."

At the same time, other European ships have been looting Somalia's seas of their greatest resource: seafood. We have destroyed our own fish-stocks by over-exploitation - and now we have moved on to theirs. More than $300m worth of tuna, shrimp, lobster and other sea-life is being stolen every year by vast trawlers illegally sailing into Somalia's unprotected seas. The local fishermen have suddenly lost their livelihoods, and they are starving. Mohammed Hussein, a fisherman in the town of Marka 100km south of Mogadishu, told Reuters: "If nothing is done, there soon won't be much fish left in our coastal waters."

This is the context in which the men we are calling "pirates" have emerged. Everyone agrees they were ordinary Somalian fishermen who at first took speedboats to try to dissuade the dumpers and trawlers, or at least wage a 'tax' on them. They call themselves the Volunteer Coastguard of Somalia - and it's not hard to see why. In a surreal telephone interview, one of the pirate leaders, Sugule Ali, said their motive was "to stop illegal fishing and dumping in our waters... We don't consider ourselves sea bandits. We consider sea bandits [to be] those who illegally fish and dump in our seas and dump waste in our seas and carry weapons in our seas." William Scott would understand those words.

No, this doesn't make hostage-taking justifiable, and yes, some are clearly just gangsters - especially those who have held up World Food Programme supplies. But the "pirates" have the overwhelming support of the local population for a reason. The independent Somalian news-site WardherNews conducted the best research we have into what ordinary Somalis are thinking - and it found 70 percent "strongly supported the piracy as a form of national defence of the country's territorial waters." During the revolutionary war in America, George Washington and America's founding fathers paid pirates to protect America's territorial waters, because they had no navy or coastguard of their own. Most Americans supported them. Is this so different?

Did we expect starving Somalians to stand passively on their beaches, paddling in our nuclear waste, and watch us snatch their fish to eat in restaurants in London and Paris and Rome? We didn't act on those crimes - but when some of the fishermen responded by disrupting the transit-corridor for 20 percent of the world's oil supply, we begin to shriek about "evil." If we really want to deal with piracy, we need to stop its root cause - our crimes - before we send in the gun-boats to root out Somalia's criminals.

The story of the 2009 war on piracy was best summarised by another pirate, who lived and died in the fourth century BC. He was captured and brought to Alexander the Great, who demanded to know "what he meant by keeping possession of the sea." The pirate smiled, and responded: "What you mean by seizing the whole earth; but because I do it with a petty ship, I am called a robber, while you, who do it with a great fleet, are called emperor." Once again, our great imperial fleets sail in today - but who is the robber?

POSTSCRIPT: Some commenters seem bemused by the fact that both toxic dumping and the theft of fish are happening in the same place - wouldn't this make the fish contaminated? In fact, Somalia's coastline is vast, stretching to 3300km. Imagine how easy it would be - without any coastguard or army - to steal fish from Florida and dump nuclear waste on California, and you get the idea. These events are happening in different places - but with the same horrible effect: death for the locals, and stirred-up piracy. There's no contradiction.

Johann Hari is a writer for the Independent newspaper.