How to survive a plague