ssh -Y $AWS

# Capture the xauth cookie, for X11 plotting
export xauthout=$(xauth list | grep `echo $DISPLAY | cut -d ':' -f 2 | cut -d '.' -f 1 | sed -e s/^/:/`)

# swith users
su rstudio

# add the coookie
xauth add $xauthout


# reference: 
# http://joelinoff.com/blog/?p=729