sudoto restart my web server or install various things. For obvious reasons, I can't give you the literal shell alias I use in OS X Terminal for that, but I can give you a censored version.
alias slice="echo $PASSWORD | pbcopy && ssh -p $PORT_NUMBER $USERNAME@$IP_ADDRESS"
First I put the password I'll need, if I use
sudo, into the OS X clipboard using
pbcopy; then I
sshinto the server as normal. When Ubuntu asks me my password, I just hit
⌘-V. And boom. It just works.