Quick bit of Python code that I came up with this evening. I was running into an issue inserting some open-resolv-conf configuration commands to the end of my VPN providers OpenVPN configuration files. These resolv-conf settings are important in order to fix DNS leaks when using a VPN tunnel. The issue was that spaces in the file name don’t play nicely when used in a simple shell script. So I cooked up this Pythonic way to do it.