collect some useful code from my common life