I have found that it is the rifle 90% or ,ore of the time. I used to build a lot of custom rifles, and in the last decade built many .22 target rifles. Getting the scope on paper was the single biggest problem I always had. I use a one piece bench rest bench for testing, and simply hold on the bull, fire a round, recenter the gun on the bullet hole and while holding the gun down firmly, I move the reticle back to the bull, then shoot again. I seldom even fire a third shot. This is actually called the "Sighting in with 2 Shots" technique. I remember as a kid reading articles in Sports Afield and Outdoor Life on the subject.Before starting, I bore sight and adjust the reticle to the bull. If I can't get it adjusted, I don't even start shooting.

I have found over the years it is usually the gun barrell/reciever/sight base holes in misallignment. Occasionally it is a bad scope. It is occassional a damaged barrel, but I have only ever seen one bad base/ring. It was on a Ruger No.1 two or three years ago and I swapped 2 or 3 other bases with it and the one was always off. Incidentally, if you are using one of the pricier Leupolds. be careful about crakking them to the max or min. They work by friction and will stick either up or down and won't move at all, even when the knob is turning.

As to what to use for shims, Brownells used to sell them by the package. They came in 0.50 and 0.866 hole spacing (the standard) and a few thickness. They were made of blued spring steel and matched a standard scope base. I could never even tell they were in place. I suppose they may still sell them. I bought a supply 30 years ago and still using them.

If windage is the problem (which is about half the time something's wrong) then you will need to go to a Leupold style ring/base with windage adjustment. They are heavier and bulkier, but the easiest to adjust.