Adding swap into a Linux server after installation

Currently, I manage no less than 40 virtual servers. One of the most awkward things is that some vendors provide swap memory, others don't. So, the best way to workaround this is adding a swap file into the Linux manually. This is useful when you have a server without space to add a swap partition.

I do the following to have 1 GB of swap. Change the data to fit your needs.