Here's an easy little lesson for doing this rub-a-dub business in a musical context, using the tune Equinox by John Coltrane. Equinox is based on some very common jazz rhythmic figures, so this should be useful for doing this in context generally.
An addition: as explained by Chris Smith, rub-a-dub is normally an 8th note thing, but there is also an easy triplet equivalent, which is illustrated in the pdf. I've written out the exercise in both 8th note and triplet form. Keep in mind, this is not about how to play Equinox— it's an exercise for practicing this idea.
Swing the 8th notes. Learn to play each version as written, then begin to improvise moving both hands around the drums and cymbals, maintaining the written sticking. The accented notes are the important accents in the tune, so try to keep those on the cymbals.
Get the pdf
I made up a practice loop of the head of the tune, for you to play along with: