Add pacman-optimize to sudo aliases
Use $SSH_CLIENT instead of hostname