Preparation of nanoparticles by green synthesis and a study on their antibacterial and anticancer properties