At Chancellorsville in 1863, a Confederate sniper was plaguing Union troops until an Army sharpshooter thought of a clever solution:
First he took off his cap, and shoved it over the earthwork. Of course, Johnnie Reb let go at it, thinking to kill the careless man under it. His bullet struck into the bank, and instantly our sharpshooter ran his ramrod down the hole made by the Johnnie’s ball, then lay down on his back and sighted along the ramrod. He accordingly perceived from the direction that his game was in the top of a thick bushy elm tree about one hundred yards in the front. It was then the work of less than a second to aim his long telescopic rifle at that tree and crack she went. Down tumbled Mr. Johnnie like a great crow out of his nest, and we had no more trouble from that source.
Recounted in Adrian Gilbert, Sniper, 1994.