Synthesis of inorganic nanoparticles and their applications in cancer therapy and as antibacterial agents