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;
done

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

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

Reference:
How to disable auto power off of usb devices like usb mouse?
http://askubuntu.com/a/301416