The second one is correct. If you were being specific about what you were shaking it by the other option could work: I shook it by the tail a little bit - for example.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.