Note to myself how the mysql PASSWORD() function works as a one-liner:

echo -n foobar | openssl sha1 -binary | openssl sha1 -hex | sed 's/(stdin)= /*/' | tr '[:lower:]' '[:upper:]'