Hardware tip, not code
Coupled with a USB battery like this, this will enable you to move your RasPi without having to power it down. Plug the second USB plug into the battery, and remove the the first from the PSU - instant mobile RasPi!. Plug it back in in its new location and you're done.
You can also use the lead with 2 USB PSUs for twice the current, to run bus-powered accessories.