How do you survive of shark infested waters on board ships?

I'm not sure what you mean by «board ships».

Assuming you are talking about surfboards, the best way to survive from a shark attack is to keep calm.

DON'T PANIC!

Avoid sudden swimming mouvements, but GO TO THE NEAREST BEACH as fast as you can, WITHOUT making unnecessary splash mouvents with your arms and legs while swimming.

You will have a great chance of survival in shark infested waters if you don't panic.