....I thought having a dog with it helps to scare away snake.
Not replying directly to you phlfly, but I've seen dogs mentioned a few times in this thread and I felt it important to mention -- Dogs are wonderful travel companions, but I wouldn't trust a dog to know "snakes = bad" without training. In fact, a dog's curiosity is very likely to increase the risk that it gets bit. I think folks should train their dogs about snakes if they plan to travel where poisonous snakes reside. You can use a dummy snake or a harmless one with some rewards for avoiding it. If you want to be fancy, train it to alert when it sees a snake. The key thing is: TRAINING. Train it to act the way you want it to, don't just assume it will. Of course, if the dog was raised around snakes it may well know better, but most city-based dogs never get that experience.
Yes, dogs have instincts that may in some cases tell them snakes are bad. But those same instincts tell them to eat excrement, so...training is better. I've been told there are Rattle snake vaccines for dogs, too, so if you are travelling in a place with snakes it may be worth seeing about vaccinating them. My wife is an expert on vet medicine so she may chime in later.
In terms of how we deal with them we've never given them much thought. Snakes, wolves, bears -- the general rule applies to all animals: They are more afraid of us than we are of them. Make a little bit of noise while hiking, keep an eye where you are putting your feet, and you are probably going to be OK. If there is one around, a long stick or shovel can encourage it to move on. Snakes do not prey on humans (folklore and outliers aside), so once the threat to them is minimized, they will go on about their business.
The shotgun or weapon approach may work fine in the lower 48 or Alaska, but it's not generally an option for travel to the rest of the world.