There's one size of bolt that's used all over modern bikes: water bottle mounts and the braze-ons for racks leap to mind. Whenever I need a few, I take one to the hardware store and sift through the boxes of bolts until I find one that matches. I foolishly never write the size down.
What size are they? I'm only concerned with the width and the threads, not the heads or the length.