Drupal patching - How to apply patch on Linux

I constantly forget how to properly apply patches to drupal modules and often some patches can be a life saver before official release is made. So if you are on some VPS or Dedicated server, you use your SSH access and go to module directory you wish to patch, then check also if you need to go to this module subdirectory like some "/components" or something, then download file with WGET command from source of the patch, you can copy the source by right clicking on patch and copying location of the link, then just write

patch < name.ofthe.patch  

and if everything is ok you will get success messages, if not you will get error and dump file od that error

Also here is a very good overview of how to patch drupal https://www.previousnext.com.au/blog/introduction-drupal-patch-files