These days if I need to do some focussed work, a combination of between 0 and 200 mg of modafinil with between 0 and 5 mg (maybe up to 10mg) of dexamphetamine generally works. I find that modafinil is much 'cleaner' than dex - with less side effects such as appetite loss, euphoria, and wanting to smoke. The dex helps me remain focussed on what I should be doing, while on modafinil by itself I can get distracted by other things (such as drug forums).
Other things that can help me focus include closing web browsers (or tuning off the computer if it is not needed); and if I am getting too distracted, moving to another location (e.g. from the office to the library, or vice-versa) helps.
Other things that can help me focus include closing web browsers (or tuning off the computer if it is not needed); and if I am getting too distracted, moving to another location (e.g. from the office to the library, or vice-versa) helps.