Skip to content

Instantly share code, notes, and snippets.

@chreekat
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chreekat/652d66e1a915b878b819 to your computer and use it in GitHub Desktop.
Save chreekat/652d66e1a915b878b819 to your computer and use it in GitHub Desktop.
Set APPDATA (needed for logging in via ssh)
_sid=$(grep "^$USER:" /etc/passwd | sed -e 's/[^:]*:[^:]*:[^:]*:[^:]*:[^:]*,\(S-1-5-[^:]*\):.*/\1/')
_prof=$(cat /proc/registry/HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows\ NT/CurrentVersion/ProfileList/${_sid}/ProfileImagePath)
export APPDATA="${_prof}\\AppData\\Roaming"
unset _sid
unset _prof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment