<commit_before>cgminer-sh
==========

CGMiner API access using BASH and a short Python script.

Requires Python 2.x (tested on 2.6) and BASH 4.x (tested on 4.2).

## Overview
This is a small framework to access the CGMiner API from the Linux shell.

It provides call.sh, which takes a single parameter of an API call as defined in the [CGMiner documentation](https://github.com/ckolivas/cgminer/blob/master/API-README).
Example command:
```
call.sh summary
```

This would call "summary" on the API, giving some basic statistics.

## Example Usage
There is an example script in the scripts folder which checks that CGMiner is still running correctly. I run this as a cron job every 10 minutes.

## License<commit_msg>Added installation section to README.md<commit_after>cgminer-sh
==========

CGMiner API access using BASH and a short Python script.

Requires Python 2.x (tested on 2.6) and BASH 4.x (tested on 4.2).

## Overview
This is a small framework to access the CGMiner API from the Linux shell.

It provides call.sh, which takes a single parameter of an API call as defined in the [CGMiner documentation](https://github.com/ckolivas/cgminer/blob/master/API-README).
Example command:
```
call.sh summary
```

This would call "summary" on the API, giving some basic statistics.

## Installation
The user the miner runs as needs sudo permissions for /sbin/shutdown, so the script can reboot the machine if things have gone really wrong. To do this, add the following lines using visudo on the machine:
```
username ALL=/sbin/shutdown
username ALL=NOPASSWD: /sbin/shutdown
```
Just replace username with the user that's running the miner application.

To set this up as a cron job every 10 minutes, enter the following into /etc/cron.d/cgminer-monitor:
```
*/10 * * * username /bin/bash /path/to/cgminer-sh/scripts/01-restart_if_dead.sh
```
As before, replace username with the name of the user the miner runs as.

## Example Usage
There is an example script in the scripts folder which checks that CGMiner is still running correctly. I run this in a cron job to automate.

## License
{'fraction_non_alphanumeric': 0.0852082336045955, 'fraction_numerical': 0.009573958831977022, 'mean_word_length': 4.238095238095238, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3967755', 'n_tokens_mistral': 632, 'n_tokens_neox': 595, 'n_words': 291}