Sexual Desire, Masturbating and Asuba Bawana I have been wanting to ask this question for some time.

So basically caught up in the social norms, i used to watch porn videos and masturbate and got a bit attached to it. Kept on doing it for a few years. 

And 2 years back I met a girlfriend and we were so in love and also did different sexual activity (Apart from sex). But our relationship broke one year back when i got to know that she had cheated with another person as a tool to solve certain problems and not for love. When i got to know about it (She herself revealed it) i asked about her whole life story and i got upset by it and sympathized her. Knowing that my mother would not approve her since she also know what happened, I taught her the path of dhamma. Created a path for her to move on through dhamma.To be a better person. And she is still engaging in that path.

So after the break up I was mentally broken down and I somehow needed to satisfy my sexual desire. So i started watching more and more porn and satisfied myself. But it became very upsetting for me due to the breakup.

So one day i decided to start meditating every day and i have been continuing since then. After 2 weeks of meditation i realized that i should stop masturbating and watching porn and i just stopped it then and there. But the following few weeks were very hard. My body was rebelling to watch porn or to at least to satisfy myself. But i fought and fought. There was a time where my body was literally shaking. 

And i continued that for six months. There were times where i saw some sexual dreams and i ejaculated. But i didn't do it intentionally.

I meditated different practices and I did a lot of Asuba bawana to control my sexual desire. And I was doing well.

But since recently I have been getting flashbacks of my sexual activities with my ex. And i get these strong urges to masturbate and get it over with. I spoke this with my ex (Since we actually understand each other a lot) and she told me to just do it and accept it.

I have no intention of being a monk at the moment or to live a celibacy life. Whereas i have expectations to find a girlfriend and marry and move on. But i don't feel like masturbating at the moment cause i feel it's just a waste of time and empty since it would make more meaning if i have a girlfriend. So i won't be continuing the anti-masturbating till i find a girlfriend (Why i mentioned this cause by choosing a normal life you will be engaging in these sort pf sexual activities.)

I know for a fact that I will not be watching porn again. Since Stopping it actually made my mind peaceful and to respect women more and to see the beauty in them than to see things perversely.

My question is this

Since I am doing Asuba Bawana if i get an urge to satisfy i would usually try to kill that thought. But there are times where it becomes a big problem in the mind and sometimes my head hurts trying to kill it. Literally.

What should i do at such times? Should i just satisfy myself mindfully or just keep killing the thoughts?
So basically caught up in the social norms, i used to watch porn videos and masturbate and got a bit attached to it. Kept on doing it
  for a few years.


Do not underestimate the harm &amp; addictive character of pornography. Buddhism calls it a 'road to ruin' (DN 31). To ask your questions, you have been learning this via personal experience. 


  And 2 years back I met a girlfriend and we were so in love and also did different sexual activity (Apart from sex). But our relationship
  broke one year back when i got to know that she had cheated with
  another person as a tool to solve certain problems and not for love.


Buddhism explains a successful relationship will occur when two people are both moral (AN 4.55 &amp; AN 4.53). Since both you &amp; your girlfriend did not have strong foundations in morality, naturally problems were expected to occur. In other words, your girlfriend was probably not really "in love" but probably clinging to something. 


  When i got to know about it (She herself revealed it) i asked about her whole life story and i got upset by it and sympathized her.


Very good.


  Knowing that my mother would not approve her since she also know what happened, I taught her the path of dhamma. Created a path for her
  to move on through dhamma.To be a better person. And she is still
  engaging in that path.


Very good. But also difficult. 


  So after the break up I was mentally broken down and I somehow needed to satisfy my sexual desire. So i started watching more and
  more porn and satisfied myself. But it became very upsetting for me
  due to the breakup.


Bad strategy. Instead, try to understand that women with a history often have emotional issues which are difficult to resolve. Such women can try very hard to "love" you &amp; make you attached to them because they are often desperate. Their capacity to truly love &amp; bond does not function well. They need lots of love, trust &amp; counselling. 


  So one day i decided to start meditating every day and i have been continuing since then. After 2 weeks of meditation i realized that i
  should stop masturbating and watching porn and i just stopped it then
  and there.


Please stop the porn. It is poison that goes deep inside the neurology of the body &amp; mind. This is why so many people have serious problems with it. Please look upon pornography as though it is heroin or cocaine because it is that dangerous. 


  But the following few weeks were very hard. My body was rebelling to watch porn or to at least to satisfy myself. But i fought and fought.
  There was a time where my body was literally shaking.


Your priority should be to avoid the pornography because the pornography is a very strong sense stimulus. 

As for the masturbation, this is less serious. Just stop the porn. Put a internet blocker on your computer to stop the porn. 


  And i continued that for six months. There were times where i saw some sexual dreams and i ejaculated. But i didn't do it
  intentionally.


There is nothing wrong with sexual dreams &amp; nocturnal emission. Just stop the porn.  


  I meditated different practices and I did a lot of Asuba bawana to control my sexual desire. And I was doing well.


Good. 


  But since recently I have been getting flashbacks of my sexual
  activities with my sex.


No problem. This is normal. 


  And i get these strong urges to masturbate and get it over with. I spoke this with my ex (Since we actually understand each other a lot)
  and she told me to just do it and accept it.


Masturbation is not a sin or grave danger in Buddhism because it is your own mind creating the sense stimuli.

But pornography is the explicit vision of other people engaging in sex and this is a very strong stimuli designed by experts to addict people. Just avoid the porn at all costs. 


  I have no intention of being a monk at the moment or to live a celibacy life.


No problem.


  Whereas i have expectations to find a girlfriend and marry and move on.


No problem. But to be successfully married requires firm moral values and particularly clear insight into the advantages &amp; necessity of sexual fidelity. 


  So i won't be continuing the anti-masturbating till i find a
  girlfriend (Why i mentioned this cause by choosing a normal life you
  will be engaging in these sort pf sexual activities.)


No problem. 


  I know for a fact that I will not be watching porn again.


Thank you. Please do not. Please have clear wisdom about this. 


  Since Stopping it actually made my mind peaceful and to respect women more and to see the beauty in them than to see things perversely.


Most excellent. Beautifully spoken. Pornography misrepresents women. Natural women want to love &amp; be loved and want fidelity (AN 6.52). Pornography is a lie &amp; deception. It does not represent reality. 


  My question is this Since I am doing Asuba Bawana if i get an urge to satisfy i would usually try to kill that thought. But there are
  times where it becomes a big problem in the mind and sometimes my head
  hurts trying to kill it. Literally. What should i do at such times? Should i just satisfy myself mindfully or just keep killing the thoughts?


'Mindfulness' means 'to remember' the Dhamma path (MN 117). It does not mean to 'observe'. Therefore, if the asuba path is your goal, it is not possible to masturbate mindfully. 

If you are really dedicated to this asuba path, when the sexual urges arise &amp; is difficult to control, possibly consider doing some exercise, such as jogging. 

Otherwise, just scream out the urges into a pillow or, otherwise, let the thoughts run (but do not act upon them) until the thoughts lose their energy. 

In summary, to have a successful relationship &amp; marriage in Buddhism, what is required is a strong understanding of why sexual fidelity is important. 

Generally, masturbation occurs with sexual fantasies. Try investigating &amp; analysing those sexual fantasies, to discern how their content is not really moral (harmless) since such fantasies are based on self-indulgent erotic behaviour rather than long term commitment to a woman. 

You already had a girlfriend with many problems. Try to discern with wisdom how sexual objectification of women results in women accumulating emotional problems. If you think more about what loving a woman truly means, your sexual energy may become more pure.

It sounds like you are doing very well, practising with courage &amp; integrity. Best wishes. May you fulfil your aspirations for a truly happy, humane &amp; purposeful life.