Replacing Ctrl+M with newline
Differences in line endings (CR vs CR+LF vs ...) are a constant PITA. Here's one quick hack I used to fix some Haskell source code copied from StackOverflow and pasted via pbpaste:
cat udp_syslog_server.hs | tr "1" "[\n]"