I do that by breaking the boring task into chunks of size one - one page, one text file, one paragraph - and doing that one chunk in between tasks I enjoy. Enjoyable task for half hour, 5 minutes on next chunk, enjoyable task for half hour, 5 minutes on next chunk...
"One" is the magic number for me, make it anything greater and my brain seems incapable of understanding 2/3/4 != infinity, collapsing itself into the procrastination pit.