Fix deploy and generation scripts to be nicer

The generate script wasn't executable; the REMOTEUSERHOME variable
wasn't defined anywhere

Change-Id: Id578c25b46fb93939f712e91c93bd9b43a122fdb