<commit_before># Simple ommysql log viewer

Designed to be used as a companion app to [ec2-cfengine37](https://github.com/ecs-hk/ec2-cfengine37#promise-logging-to-a-mysql-db-eg-aws-rds).

## Synopsis

Web app for viewing CFEngine loggine and EC2 instance metadata. Built with Node.js, Express.js, EJS, Bootstrap, and several Javascript libraries.

![Screenshot](/README.md-img/srv-info.png?raw=true)

![Screenshot](/README.md-img/cfe-logs.png?raw=true)

Tested with Node.js v4.4.* LTS.

* https://nodejs.org/
* http://getbootstrap.com/
* https://bootswatch.com/

## Use the app

### One-time preparation

* Download and install Node.js
* Set up your environment, e.g.:
```
export NODE_PATH=/path/to/node-v4.x.y/lib/node_modules
export PATH=/path/to/node-v4.x.y/bin:$PATH
```
* Install dependences, e.g.:
```
cd simple-ommysql-viewer
npm install
```

### Run it

* Set up your environment (if you haven't already), a la:
```
export NODE_PATH=/path/to/node-v4.x.y/lib/node_modules
export PATH=/path/to/node-v4.x.y/bin:$PATH
```
* Launch it using node
```
cd simple-ommysql-viewer
node app.js
```

## Integrate with Apache HTTP Server

Just make life easy and front-end your Node.js app with Apache HTTP Server. Then your app can make its RDS calls over EC2 VPC, and you can let Apache deal with TLS / x509 certs et al.

```<commit_msg>Clarify README<commit_after># Simple ommysql log viewer

Companion app for [ec2-cfengine37](https://github.com/ecs-hk/ec2-cfengine37#promise-logging-to-a-mysql-db-eg-aws-rds).

## Synopsis

Web app for viewing CFEngine logging and EC2 instance metadata. Built with Node.js, Express.js, EJS, Bootstrap / Bootswatch, and several Javascript libraries.

![Screenshot](/README.md-img/srv-info.png?raw=true)

![Screenshot](/README.md-img/cfe-logs.png?raw=true)

Tested with Node.js v4.4.* LTS.

* https://nodejs.org/
* http://getbootstrap.com/
* https://bootswatch.com/

## Use the app

### One-time preparation

* Download and install Node.js LTS
* Set up your environment, e.g.:
```
export NODE_PATH=/path/to/node-v4.x.y/lib/node_modules
export PATH=/path/to/node-v4.x.y/bin:$PATH
```
* Install dependences:
```
cd simple-ommysql-viewer
npm install
```
* Set up RDS connection info:
```
cd simple-ommysql-viewer/config
cp mysql-creds.json.EXAMPLE mysql-creds.json
vi mysql-creds.json
```

### Run it

* Set up your environment (if you haven't already), a la:
```
export NODE_PATH=/path/to/node-v4.x.y/lib/node_modules
export PATH=/path/to/node-v4.x.y/bin:$PATH
```
* Launch it using node
```
cd simple-ommysql-viewer
node app.js
```

## Integrate with Apache HTTP Server

Just make life easy and front-end your Node.js app with Apache HTTP Server. Then your app can make its RDS calls over EC2 VPC, and you can let Apache deal with TLS / x509 certs et al.

```
{'fraction_non_alphanumeric': 0.14342058085335246, 'fraction_numerical': 0.012190749372534958, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1901197', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1005, 'n_words': 280}