Ubuntu: external screen goes black, but ubuntu is still using 2 screens

Today I had the problem that my external screen was only showing a nice shade of black. However, several programs were running on that screen, and I could not just reboot the laptop without losing much work.

To fix this (it did fix it for me, your mileage may vary), open a terminal window (Ctrl + Alt + t) and type the following command:


After this, I had my second screen back.