https://stackoverflow.com/a/10544688/30225
I answered this question a long time ago pointing to an answer on SuperUser. I felt that that q/a offered many solutions and perhaps a link to the QA is better than me copying each answer?
What's the best solution in this case - noting that the answer was created many years ago and that rules/processes are now likely different?