Use social anxiety to your advantage in staying on task.
I don't exactly think I have social anxiety, or if I do its perhaps limited in scope. One thing I do know is that I don't like is to browse facebook and twitter in a very public setting and surrounded by people I don't know very well. This also includes looking up random things about TV shows I watch or going on any social message boards. (honestly also facebook newsfeeds show way too many large pictures of people that I am not friends with but often are using the same library spaces as I am, that alone is enough for me to feel weird about it)
For most people, I would say these things constitute a majority of one's distractions while working on a computer. I recognized this, and decided to change up my work environment while at college. I decided that whenever possible, I would do work at the library, on a library computer, in one of the most populated areas with maximum visibility (though in a quiet section.)
What I found was that my desire to not have everyone looking at my screen was stronger than my reasons for going on those sites in the first place, and what ends up happening is that I find myself spending a majority of the time doing the schoolwork I came there to do. I also think that using a library computer rather than my own laptop also helps with this, as it limits my options in a good way.
I don't do this exclusively, but I found it definitely helps, if only as an effective placebo.