I've written this far too many times. Here's a reusable config for CS/RQ/BB/M.