There are chemical repellents out there to deter mice, but a simple natural way to do it is with peppermint. They do not like the smell of it. Soak some cotton balls with peppermint oil and put them...
Rattlesnakes will generally not attack you unless they feel threatened, and have no avenue of escape. Just make plenty of noise and/or racket, just like people do to prevent bear attacks. If you want...