<commit_before>Development Environment
***********************

.. highlight:: bash

.. note:: For Ubuntu 14.04 LTS

Packages
========

Install the following::

  sudo locale-gen en_GB.utf8
  sudo update-locale en_GB.utf8

Development tools (install ``vim`` or an editor of your choosing)::

  sudo apt-get install mercurial git vim wget

python development::

  sudo apt-get install python3-dev
  # pillow
  sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev \
    libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk
  # if you have issues with setuptools e.g. Requirement.parse('setuptools>=0.8'))
  wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python

Postgres::

  sudo apt-get install postgresql libpq-dev

Redis::

  sudo apt-get install redis-server

bash
====

A simple script for directory based environments (if a directory contains a
``.env`` file it will automatically be executed when you ``cd`` into it)::

  git clone git://github.com/kennethreitz/autoenv.git ~/.autoenv
  echo 'source ~/.autoenv/activate.sh' >> ~/.bashrc

Database
========

Replace ``/etc/postgresql/9.3/main/pg_hba.conf``
with :download:`misc/pg_hba.conf`::

  sudo chown postgres:postgres /etc/postgresql/9.3/main/pg_hba.conf
  sudo chmod 640 /etc/postgresql/9.3/main/pg_hba.conf

Replace ``/etc/postgresql/9.3/main/postgresql.conf``
with :download:`misc/postgresql.conf`::

  sudo chown postgres:postgres /etc/postgresql/9.3/main/postgresql.conf
  sudo chmod 644 /etc/postgresql/9.3/main/postgresql.conf

Re-start Postgres::

  sudo /etc/postgresql/9.3/main/service postgres restart

Create a role for your user name (replace ``patrick`` with your linux user
name)::

  psql -X -U postgres -c "CREATE ROLE patrick WITH NOSUPERUSER CREATEDB NOCREATEROLE LOGIN;"

python
======

.. note:: Refer to your company :doc:`checklist` and replace
          ``devpi.yourbiz.co.uk`` with the name of your ``devpi`` server.
          Do the same for the username and password.

pip
---

.. note:: Check out the ``--set-cfg`` parameter in
          http://doc.devpi.net/latest/userman/devpi_commands.html

Add the following to the ``~/.pip/pip.conf`` file::

  [install]
  download-cache=~/.pip/cache
  index-url = https://devpi.yourbiz.co.uk/kb/dev/+simple/<commit_msg>devpi<commit_after>Development Environment
***********************

.. highlight:: bash

.. note:: For Ubuntu 14.04 LTS

Packages
========

Install the following::

  sudo locale-gen en_GB.utf8
  sudo update-locale en_GB.utf8

Development tools (install ``vim`` or an editor of your choosing)::

  sudo apt-get install mercurial git vim wget

python development::

  sudo apt-get install python3-dev
  # pillow
  sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev \
    libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk
  # if you have issues with setuptools e.g. Requirement.parse('setuptools>=0.8'))
  wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python

Postgres::

  sudo apt-get install postgresql libpq-dev

Redis::

  sudo apt-get install redis-server

bash
====

A simple script for directory based environments (if a directory contains a
``.env`` file it will automatically be executed when you ``cd`` into it)::

  git clone git://github.com/kennethreitz/autoenv.git ~/.autoenv
  echo 'source ~/.autoenv/activate.sh' >> ~/.bashrc

Database
========

Replace ``/etc/postgresql/9.3/main/pg_hba.conf``
with :download:`misc/pg_hba.conf`::

  sudo chown postgres:postgres /etc/postgresql/9.3/main/pg_hba.conf
  sudo chmod 640 /etc/postgresql/9.3/main/pg_hba.conf

Replace ``/etc/postgresql/9.3/main/postgresql.conf``
with :download:`misc/postgresql.conf`::

  sudo chown postgres:postgres /etc/postgresql/9.3/main/postgresql.conf
  sudo chmod 644 /etc/postgresql/9.3/main/postgresql.conf

Re-start Postgres::

  sudo /etc/postgresql/9.3/main/service postgres restart

Create a role for your user name (replace ``patrick`` with your linux user
name)::

  psql -X -U postgres -c "CREATE ROLE patrick WITH NOSUPERUSER CREATEDB NOCREATEROLE LOGIN;"

python
======

pip
---

.. note:: Refer to your company :doc:`checklist` and replace
          ``devpi.yourbiz.co.uk`` with the name of your ``devpi`` server.
          Do the same for the username and password.

.. note:: (to myself) Check out the ``--set-cfg`` parameter in
          http://doc.devpi.net/latest/userman/devpi_commands.html
          It might do the following automatically.

Add the following to the ``~/.pip/pip.conf`` file::

  [install]
  download-cache=~/.pip/cache
  index-url = https://devpi.yourbiz.co.uk/kb/dev/+simple/
{'fraction_non_alphanumeric': 0.1418150611456769, 'fraction_numerical': 0.01630551383823214, 'mean_word_length': 3.6341948310139167, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7442831', 'n_tokens_mistral': 1709, 'n_tokens_neox': 1600, 'n_words': 435}