Limit processes in Ubuntu based OSes (protection via Forkbombs)

Very useful especially if you are learning how to use fork() to create multiprocess applications.

Edit the following file:


Then add the line:

*    hard     nproc     X

Where X is the maximum number of processes you want.

A number around 400-500 is pretty much okay.