Useful code and some scripts