Step 1: Quickie Connector
But even with good technique, they're kind of fragile, and the exposed pins are just begging for an electrical accident. The cable end really needs some mechanical and electrical protection.
Step 2: Ugly Way - Hot Melt
But keeping it from dripping requires some skilled holding and turning. It's very difficult to actively shape the mass of hot glue, although keeping your finger tips wet with cold water allows you to touch it briefly without having it stick to your fingers. That technique unfortunately leaves fingerprints in the surface of the hot melt, making it even uglier.
The hot melt approach is quite functional (and cheap!), but seriously ugly.
Step 3: Sugru Is Better!
And if some gets where you didn't want it, it's easy to clean it off with no time pressures.
Thanks to "Sugru Build Night" at Workshop 88 for the chance to discover this valuable new technique!