Ruby check if gem is loadable

Sometimes you want to only execute a given piece of code if a specific gem has is available. Testing if a constant is defined doesn't aslways work when using autoloading.


Rsync error SuSE when using an old algorithm

Running a rsync command to an old server, specifying a different HostKeyAlgorithm fails very strangely on OpenSuSE

rsync -av --stats --delete '-oHostKeyAlgorithms=+ssh-dss'  root@ /local/path/
rsync: [Receiver] Failed to exec yAlgorithms=+ssh-dss: No such file or directory (2)
rsync error: error in IPC code (code 14) at pipe.c(85) [Receiver=3.2.3]
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in IPC code (code 14) at io.c(228) [Receiver=3.2.3]

No such file or directory.... IPC code (code 14)
What? 🤔

I don't know exactly what's causing this, but a workaround seems to be to use the -e option and to supply this command to your ssh shell

rsync -av --stats --delete -e "ssh -o HostKeyAlgorithms=+ssh-dss" root@ /local/path/