Fix Wifi after suspend (Ubuntu 16.04 / ‘Device not ready’)

On Ubuntu 16.04, Wifi occasionally gets stuck after suspend on my laptop.
Running sudo systemctl restart network-manager.service fixes it.

To have this run automatically after resume, open a command line and type:
sudo nano /etc/systemd/system/wifi-resume.service
Now paste the below script in there with a right click, and exit by pressing CTRL + X and press Y to save.

Now to activate the service:
sudo systemctl enable wifi-resume.service

Found here