<commit_before>No Root Setup:
==============

What system you install to is your choice, but this setup assumes a CloudLinux OS without root access and with both
Python and MySQL installed. Everything is run from terminal (ssh compatible).

.. note::

    If you have multiple Python versions, replace ``python`` and ``pip`` with your version, e.g.,
    ``python2.7 get-pip.py --user``, ``pip2.7 install --user -U pip wheel``.

Since root is not available, pip needs to be installed locally. ::

    wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py --user

To ``~/.bashrc``, add ``PATH=$PATH:~/.local/bin`` and ``PYTHONPATH=$PYTHONPATH:~/.local/lib/python/site-packages/``,
then run ``source ~./bashrc`` to apply changes.

Next, update pip and wheel, then install a few dependencies. ::

    pip install --user -U pip wheel
    pip install --user -U setuptools
    pip install --user -U ndg-httpsclient
    pip install --user praw

From within the MySQL prompt, setup the database itself. ::

    CREATE DATABASE db_name;
    USE db_name;
    CREATE TABLE message_table (id INT UNSIGNED NOT NULL AUTO_INCREMENT, permalink VARCHAR(100), message VARCHAR(100),
    new_date DATETIME, userID VARCHAR(20), PRIMARY KEY(id));
    ALTER TABLE message_table AUTO_INCREMENT=1;
    CREATE TABLE comment_table (id MEDIUMINT NOT NULL, list VARCHAR(35), PRIMARY KEY(id));
    INSERT INTO comment_table VALUES (1, "'0'");
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON db_name.*
    TO 'botname'@localhost IDENTIFIED BY 'password';

Now that MySQL is setup, install more dependencies. ::

    pip install --user MySQL-python
    pip install  --user pytz
    pip install --user parsedatetime

Start, redirect output, and background process. ::

    nohup python clashcallerbot_reply.py > /dev/null 2>&1 &
    nohup python clashcallerbot_search.py > /dev/null 2>&1 &


.. tip::

    Alternatively, use `systemd service <https://stackoverflow.com/a/30189540)>`_.
<commit_msg>Update no_root_setup.rst removed references to setuptools and ndg-httpsclient<commit_after>No Root Setup:
==============

What system you install to is your choice, but this setup assumes a CloudLinux OS without root access and with both
Python and MySQL installed. Everything is run from terminal (ssh compatible).

.. note::

    If you have multiple Python versions, replace ``python`` and ``pip`` with your version, e.g.,
    ``python2.7 get-pip.py --user``, ``pip2.7 install --user -U pip wheel``.

Since root is not available, pip needs to be installed locally. ::

    wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py --user

To ``~/.bashrc``, add ``PATH=$PATH:~/.local/bin`` and ``PYTHONPATH=$PYTHONPATH:~/.local/lib/python/site-packages/``,
then run ``source ~./bashrc`` to apply changes.

Next, update pip and wheel, then install a few dependencies. ::

    pip install --user -U pip wheel
    pip install --user praw

From within the MySQL prompt, setup the database itself. ::

    CREATE DATABASE db_name;
    USE db_name;
    CREATE TABLE message_table (id INT UNSIGNED NOT NULL AUTO_INCREMENT, permalink VARCHAR(100), message VARCHAR(100),
    new_date DATETIME, userID VARCHAR(20), PRIMARY KEY(id));
    ALTER TABLE message_table AUTO_INCREMENT=1;
    CREATE TABLE comment_table (id MEDIUMINT NOT NULL, list VARCHAR(35), PRIMARY KEY(id));
    INSERT INTO comment_table VALUES (1, "'0'");
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON db_name.*
    TO 'botname'@localhost IDENTIFIED BY 'password';

Now that MySQL is setup, install more dependencies. ::

    pip install --user MySQL-python
    pip install  --user pytz
    pip install --user parsedatetime

Start, redirect output, and background process. ::

    nohup python clashcallerbot_reply.py > /dev/null 2>&1 &
    nohup python clashcallerbot_search.py > /dev/null 2>&1 &


.. tip::

    Alternatively, use `systemd service <https://stackoverflow.com/a/30189540)>`_.

{'fraction_non_alphanumeric': 0.11818406118924253, 'fraction_numerical': 0.014310387367382186, 'mean_word_length': 3.7415204678362572, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '404765', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1221, 'n_words': 467}