Unix: Increase Limit of Concurrent Connections

From http://nichol.as/benchmark-of-python-web-servers:

    echo “10152 65535″ > /proc/sys/net/ipv4/ip_local_port_range
    sysctl -w fs.file-max=128000
    sysctl -w net.ipv4.tcp_keepalive_time=300
    sysctl -w net.core.somaxconn=250000
    sysctl -w net.ipv4.tcp_max_syn_backlog=2500
    sysctl -w net.core.netdev_max_backlog=2500
    ulimit -n 10240

Alfred App: Search Django Docs

Screen_shot_2011-01-09_at_5

If you want to search the django docs via Alfred App, you can set up a custom search using django.me.

Go to Features -> Custom Searches and enter the settings as shown in the screenshot above.

Now you can launch Alfred App and enter "django filters". This will redirect you to the built-in filters page of the django docs. If no redirect URL could be found, django.me will ask you to provide one. Please make sure to create a proper link to corresponding Django docs page.

Python: Pydoc in a Virtual Environment

Pydoc can be used to search documentation of Python modules:

pydoc os.path

However, this won’t work in a virtual environment since the pydoc command uses the system library and won’t include the ve’s site-packages. To fix this, use the following cmd:

python -m pydoc BeautifulSoup

PS.: Pydoc can also serve documentation on a local webserver (python -m pydoc -p 8000)