I've actually had pretty good luck with just showing up on the boat alone, and letting the captain or DM match me up with an insta-buddy. They have done better at this than I would have.
One tip, though--you have a better chance of getting a more experienced diver to buddy with you on a "routine" dive venue than at "once-in-a-lifetime reef", which latter took much time and money to get to. They won't mind 'spending' a common-site dive 'paying it forward' to a beginner buddy, but they will resist it at a rare or difficult site where skill, experience, and really good air-usage is needed.
That's for boat trips you book yourself. For a shop-sponsored trip, I have relied on the owner (who was my instructor) to do it.
Best result? You get to buddy with the DM. Though on some boats, and regions, DMs stay on the boat.
Shore dives? I don't know. I've sought out locals through boards like this, it's worked well.
One final thought--you may seek the 'perfect' buddy, but sometimes you learn more from the less-than-perfect buddy, from the buddy who's 'better' than you are, or even from the newbie buddy if you're the non-newbie. One can teach you by example, the other can teach you how to react and assist if he does something wrong and needs a little help.