Bleeding refers to letting the pressure out of the keg. I don't know why you would want to shake the keg, that will just stir up the contents and make everything foam more. My recommendation is to let the beer rest for a while (if you shook it really hard, this could mean about 3 hours) while leaving it under a 12 psi load. Then, once it's sat for a while, turn off your CO2 tank, release the pressure inside of the keg, and return a 6 psi load to the keg. If this serves the beer without lots of foam, you can try cranking it up to 8 psi to increase the flow rate (more beer faster) but leaving it lower while serving is a sure fire way to keep the foam minimized.
Don't forget: if you're not drinking it, let it sit at 12 psi. This will maintain the regular carbonation level of the beer.
Since you mentioned it's been out of commission a while, don't forget to clean your beer line! That always helps. Also, pulling the beer tap quickly when you start to pour reduces turbulence at the tap and reduces foam (there are a bunch of tricks online for how to pour a proper pint, there's tons I don't know concerning it). Let me know if you're still having problems and we'll tackle it as best as we can! Cheers!
Two ciders please, I'm thirsty!
On deck: Soon Cider
bottled: Old and dusty something rathers
Kegged: Carbonated Water (enjoying home made soda syrups)