This is similar to the very same issues that I struggle with from time to time. I have found, however, that the best way to counter such feelings is to change your mindset. While easier said than done, changing your mindset to a more positive one will do wonders while allowing you to accept the fact that, while you won't be the very best, you are indeed capable of getting close. It boils down to putting on metaphorical 'blinders'. Don't worry so much about what others are doing, but worry about what you're doing. Get passionate about what you do or a project that you are working on. If your projects or ideas consume your mind there's no place for worry.
I've also found that talking to others about your ideas that may not totally understand the tech world and explaining to them in terms they'll understand will help in boosting morale. Often times, people will see with fresh eyes what others (such as those of us here) would overlook otherwise.