Fix localurl and remoteurl for mac osx

Also add shebang to all scripts.

Change-Id: I829b059bc64f0f7ff8c0debf9e4c10faa0dcb548
Merge "Fix localurl and remoteurl for mac osx"