Stop the annoying usb autosuspend under Ubuntu/Linuxmint

Got a problem that the usb mouse will been poweroff/suspend randomly(or periodically?) on Linuxmint 17 when the notebook is not in ac mode, here is a quick fix.

Disabling auto suspending USB:
for i in /sys/bus/usb/devices//power/autosuspend;
do echo 2 > $i;

Disable USB autosuspend:
for foo in /sys/bus/usb/devices/
do echo on > $foo;

If it works, also put them in /etc/rc.local to make it reboot-persistent/permanent.

How to disable auto power off of usb devices like usb mouse?