applescript (osascript) for changing Terminal.app profile

$function setTerm() { PROFILE=${1}; echo "tell app \"Terminal\" to set current settings of first window to settings set \"${PROFILE}\""|osascript; };

Source: commandlinefu.com

When you connect to a remote computer using ssh, the terminal.app settings will set according to the remote bash profile. Therefore you need to define the preferred settings on the remote machine first.