This is what I would do in your situation
"It randomly shuts off while im doing something..."
*as if i just unplugged it.
First(if possible) get to XTerm, mess with preferences and create an infinite scrollable history. (click edit -> profiles -> highligh default -> edit -> scrolling -> check unlimited scroll.
(if you already know how to do this, so sorry for the redundancy)
Then type "dmesg" enter (maybe sudo su first) What I would do, Is scroll through it until i see an event I recognize, like "Starcraft 2 running" in my case, or something.
****Beyond this line on is bonus extras you dont have to read.******
READ ALL QUESTIONS BEFORE TRYING ANYTHING
These are troubleshooting steps
Question: Is it a power fluctuation?
How to answer: Change outlets to see if it still happens, perhaps theres a short that has occurred recently.
Question: Could it be power management?
To solve this, go into your bios and disable all power management functions (and overclocking if applicable) this is stuff like "tristate" "ddr power down" "c6" "apm" etc...
Also look for any "shutdown on temperature or (any event) like fan speed running at Xrpm.
If you add more detailed information, I might be able to help better.
This answer might not be what you wanted, but you have a very non-specific issue. and i understand. But you have to eliminate possibilities.