<commit_before>Toopaste
========

A simple (and tiny) Pastie clone written in Sinatra and ActiveRecord.
Clone from repo https://github.com/zapnap/toopaste.

## Getting Started

1. Git clone repo:

        git clone https://github.com/budhrg/toopaste

2. Bundle Install:

        bundle install

3. Start the web server as:

        rackup [-p port_number]

4. Using a browser, go to `http://localhost:9292(or port_number)`

### Using Docker

1. Git clone repo:

        git clone https://github.com/budhrg/toopaste

2. Build Image:

        docker build -t toopaste .

3. Run Toopaste as:

       docker run -p <ur_machine_port>:9292 -d toopaste rackup

       or

       docker run -p <ur_machine_port>:port_number -d toopaste rackup -p port_number

4.  Using a browser, go to `http://localhost:<ur_machine_port>`<commit_msg>Updated README to run toopaste by linking with mysql container<commit_after>Toopaste
========

A simple (and tiny) Pastie clone written in Sinatra and ActiveRecord.
Clone from repo https://github.com/zapnap/toopaste.

## Getting Started

1. Git clone repo:

        git clone https://github.com/budhrg/toopaste

2. Bundle Install:

        bundle install

3. Start the web server as:

        rackup [-p port_number]

4. Using a browser, go to `http://localhost:9292(or port_number)`

### Using Docker linking with mysql container

1. Git clone repo:

        git clone https://github.com/budhrg/toopaste

2. Pull mysql image from repo:

        docker pull mysql:5.5

3. Build image of Toopaste:

        docker build -t toopaste .

4. Run Toopaste as:

  4.1 Run mysql container:

        docker run --name <mysql_container_name> -e MYSQL_ROOT_PASSWORD=<password> -d mysql:5.5

    4.2 Run toopaste:

        docker run --name <toopaste_container_name> --link <mysql_container_name>:<alias> -e "DB_PREFIX=<alias>" -p <ur_machine_port>:9292 -d toopaste sh -c "rake db:create && rake db:migrate rackup -o 0.0.0.0"

        or

        docker run --name <toopaste_container_name> --link <mysql_container_name>:<alias> -e "DB_PREFIX=<alias>" -p <ur_machine_port>:port_number -d toopaste sh -c "rake db:create && rake db:migrate rackup -o 0.0.0.0 -p port_number"

  Note: Give alias in capital


5. Using a browser, go to `http://localhost:<ur_machine_port>`
{'fraction_non_alphanumeric': 0.10872424375274002, 'fraction_numerical': 0.021481806225339763, 'mean_word_length': 3.0677361853832443, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1707673', 'n_tokens_mistral': 803, 'n_tokens_neox': 757, 'n_words': 253}