- find the process name of the bomb, say procForkBomb
- stop (freeze) the bomb processes: killall -STOP procForkBomb, and
- terminate them: killall -KILL procForkBomb
A journal on information technology: things I studied, worked, thought, but can't stay in my memory.
Wednesday, December 26, 2012
how to defuse a fork bomb
Defusing a fork bomb can be done in three steps:
how to prevent fork bomb
One way is to limit the maximum number of processes that a single user may own or system may allow.
On FreeBSD, this can be achieved by configuring kernel parameters: kern.maxprocperuid and/or kern.maxproc. It can be done by:
- set respective limit in /boot/loader.conf (or, /etc/login.conf), or
- configure dynamically through command sysctl
error: generic array creation
Java does not support arrays of generic classes. A way to workaround is to use a class that implements java.util.List (ordered collection, or sequence). ArrayList is a good choice. Here is an example:
Let Vertex<E> be some generic class (on type E).
Java doesn't support:
Vertex<String> vertex = new Vertex<String>[10];
A workaround could be:
ArrayList<Vertex<String>> vertex = new ArrayList<Vertex<String>>();
Let Vertex<E> be some generic class (on type E).
Java doesn't support:
Vertex<String> vertex = new Vertex<String>[10];
A workaround could be:
ArrayList<Vertex<String>> vertex = new ArrayList<Vertex<String>>();
Tuesday, December 25, 2012
x forwarding through ssh
X forwarding needs to be enabled on both server and client sides.
On server side:
Client side using ssh connect to the server:
On server side:
- edit the sshd configuration file (/etc/ssh/sshd_config):
X11Forwarding yes - restart the sshd
Client side using ssh connect to the server:
ssh -X server
hooray
It works!
[django + mezzanine + apache2 + wsgi] on fedora 17 and ubuntu 12.04
how to:
[django + mezzanine + apache2 + wsgi] on fedora 17 and ubuntu 12.04
how to:
- collect static files for mezzanine
python manage.py collectstatic - put static and template files under the mezzaine application directory
- configure mod_wsgi (conf.d/wsgi.conf) for apache2
there are examples on site of djangoproject:
https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/
Subscribe to:
Posts (Atom)