Remove your incentive (masturbation)
Here's one guy's creative solution to getting past the first few days of withdrawal cravings
I made quite a few attempts at "rebooting", but ultimately couldn't make it past first four full days. Until I tried a different approach, similar to what I used when I was trying to stop myself from (1) constantly drinking excessive amounts of coffee and (2) playing computer games.
I replaced normal coffee with decaffeinated so I wouldn't get the buzz I liked so much and I redirected all game saves to null device so I couldn't save the progress and would have to start over and over again until I eventually got bored.
What I did is instead of putting blocks on porn sites (which doesn't work well simply because of something that is best described with the joke "the internet is for porn"), I made my target the motivation for watching porn, just as I did with motivation to drink coffee or motivation to play games. Namely, I removed it, that is, removed the pleasure part that motivated my addictive behavior. In case of porn that is the masturbation/orgasm part. To help myself I completely removed the blinds from my huge windows that face the street.
Results: Since I stopped masturbating in response to porn, the link porn->masturbation->orgasm/pleasure started falling apart and the nagging of my brain to search for and watch porn has got weaker and weaker. Then, when I did watch it I just wasn't "into it" at all. Now I finally made it past the four full days without p/m/o and the urge to either masturbate or watch porn keeps growing weaker, though I still have problems with insomnia.
Maybe one day, once I feel that new behavior has settled, I'll put my blinds back. Or maybe not—I'm starting getting used to it :)