This was my M.O. - something had failed on a ship somewhere or other. Sometimes, it was dockside (Hooray!), more often than not off some disagreeable coast, meaning I'd get airlifted out bringing anything I could conceivably need (and a few things I couldn't, just to make sure!) - then make sure it all worked before I left.
I always carried a couple of USB sticks with software, licences and documentation on them - one in my carry-on, one in a zippered pocket - and extra interface cables &c so that if everything went oops, I could just borrow a laptop at the client end, install my stuff and get going in a few cups of coffee's time.
Most interesting experience: A customer managed to store their spare parts ashore (!), and we found the reason a big oceanographic sampling system didn't work was because a very proprietary plug inside a data acquisition device hadn't been properly inserted during assembly, damaging the connector beyond repair.
We wound up having to disassemble a small DC motor (to get at the lacquer wire - very, very small cross section!) and hand solder jumper wires onto each of the 88 pins on the PCB.
Took us a few hours, each of which cost our client on the order of $7k in fuel and crew wages, but it worked in the end, ship's electrician and I taking turns getting those pesky, small wires in place without upsetting the work we'd already done.
Soldering .02" pitch connectors with a bog standard Weller iron is a character-building experience. It gets better once you've tacked a needle onto the tip, though.
The alternative? Taking the whole vessel back inside helicopter range, then airlift a $5 plug out (Oh, and a crimp tool! Might as well bring a spare plug, too. Just in case.) That would have cost significantly more than the downtime they had while we were soldering.
Having the spares aboard so that we'd be looking at them instead of for them when we figured out what was wrong? Ten minutes of downtime, $5 in parts, done.