Your post highlights the core of the problem. Ultimately, productivity solutions have to include a recognition that technology can only enhance your self-control; it can't replace it. I, like you, have spent days trying to optimize my work space and computer for productivity. It was a waste of time.
The best way to get work done is to get somewhere where you can focus. This includes not just location, but also mindset. If I really want to focus, I have to train myself to avoid thoughts like, "it would be nice if those exceptions that I just added to my hosts file would update themselves based on my browsing habits..."
I go somewhere alone, pop in ear buds playing some type of non-distracting noise, shutdown my email client, turn off my phone, and go to work.