It's very difficult to break free, as you know. I encourage you to make a clean break not just from pornography and masturbation, but from the Internet. Lots of people can enjoy the Internet and use it without being tempted by all the junk that's out there, but right now you can't. If you don't absolutely need to be on the Net for your work or your studies, stay off it. You'll find it much easier to resist temptation if you don't go near it.
Accountability can be a big help.
That's why I'd also advise you to get involved in an accountability group. Sin thrives in secret. You need someone, or a small group of someones, who will meet with you daily or weekly for frank confession, encouragement and prayer. It will take a load off your mind. It will help you start to put your life back on the right path.