As a young first officer I too had problems staying awake in the wee hours until a senior captain was good enough to let me in on one of the tricks of the trade.
"Feeling sleepy there are we young XL5? Well, autopilot off, thumb in some nose down trim and hand fly. Should you drift off the yoke will slip from your fingers and the free-fall sensation of negative g will immediately bring you fully awake".
Sound advice, and I've successfully used this technique now for many years.