Usually power cords are much too long.
You can get the replacement plug in a hardware store or on eBay for ließ than 2$.
While following this guide, keep the cable unplugged at any time! Otherwise you can hurt yourself badly!!!
Cut the cable at the preferred length
Use this part of the cable from here on
Slice open the outer insulation
Cut it off
Remove 1cm of the inner insulation
Take apart the replacement plug
Put the cable through the back end
Attach the cables to the plug. There is no right or wrong: one on one side, the other on the other side.
The little bridge will secure the cable
Close it up
Aaaaand: You're done - Before & After
Before & After
Works like a charm