I'm with amok.
Come to think of it I know exactly what I'd do. I'd order some psychotria viridis or mimosa hostilis, do an extraction on them for the DMT, and then, if I knew precisely when I was going to die, I'd inject a massive amount of DMT right beforehand. The previous two weeks would be spent letting everyone in my life know about my fate, and giving all my stuff away to the people I think deserve it.
If I just had a vague knowledge that I was going to die soon, and I couldn't pinpoint it, I'd probably just eat two or three hundred hits of acid and take things as they come.