Cooked or Raw - Shrimp peeling
I was always taught to take the head and tail between your fingers of each hand, pull it out straight, push together slightly, then pull apart. That should pull the whole carapace back off the body. Then you can pull off the head (and legs if they're still there) and you're done.

However, I've seldom gotten it to work when raw, and less so when cooked.

I agree, cooked shrimp are harder to peel, and just add an unwanted challenge to the diner when included in most dishes.