Vibrating plumbing pipes are not usually a cause for alarm, although it may not seem that way when they wake you up in the middle of the night. The vibrations are usually caused by undersized water pipes or thin-walled waste lines, but they can also be caused by poor venting. If they're disturbing enough, there are a few things you can do short of retrofitting your plumbing.
When pressurised water tries to flow through a pipe or fitting that is too small, it will cause the pipe to vibrate. It's usually easy to tell which pipes are at fault, because the vibrating will start when you turn on a particular shower or tub valve, or flush a toilet. The most effective way to correct the problem is to replace the vibrating pipes with larger ones, but this isn't always practical. One easier solution is to install a water hammer arrester somewhere in the vibrating line. Another is to install a pressure regulator at the point where water enters your house. If you have a regulator already, check it. It may be broken.
Plumbers have been using ABS plastic waste lines since the 1970s instead of cast iron. ABS is cheap and easily installed, but its walls are much thinner than those of cast iron. As a result, you can often hear water flowing through them when a toilet is flushed. If there is a tee or elbow in the line, and it's located directly underneath a toilet, the force of the falling water can cause the fitting to vibrate. If there is a long run of pipe attached to the fitting that is poorly supported, it will also vibrate.
When water flows through a drain pipe, it creates a vacuum behind it. Vents are incorporated into your waste system to allow air into the lines to fill this vacuum. If the vents get blocked, the force of the vacuum can begin to suck water out of the P-traps of fixtures connected to the waste line. As air enters through the P-traps, the water moves back to where it was until the vacuum sucks it out again. This cycle can cause the P-traps to vibrate. You can correct this problem by checking the vents for obstructions and removing them.
All the waste and water lines in your house should be clamped to the framing, or supported with hangers or metal plumber's tape. If these clamps come loose or were installed incorrectly, even small vibrations can produce loud sounds as the pipes hit repeatedly against the surfaces to which they are imperfectly attached. This problem is easily corrected by reattaching the clamps or adding new ones. If the pipes are behind a finished wall, you'll have the added inconvenience of removing and replacing a section of wall covering before you can re-clamp the pipes and stop them from waking you up.