The best you can do is to stop the virtuous circle!
1. Stop taking pain killers on every day basis. They cause medication induced head aches and will not help you anymore.
2. Do sports on a regular basis (3 times a week for 30 minutes endurance sport (running, swimming, bicycle etc.)
3. Stop smoking and / or taking other drugs.
4. Try to relax as often as possible and think about positive things that make you happy
5. Pay attention to your sleep. Regular sleep (same time) with good duration in a healthy environment will help you.
6. Try to avoid trigger factors
To learn more about head ache, come to Greece for sailing holidays and find a good mixture between exercise and relaxation.