<commit_before># ![Overcast Logo](http://i.imgur.com/eCBl2NI.png)

Overcast is an SSH-based devops CLI designed to make it easy to spin up, configure and manage clusters of machines, without the learning curve or complexity of existing devops tools.

![Screenshot](http://i.imgur.com/QviXmMg.gif)

## Concepts

- **Instances** are any machine you can SSH into.
- **Clusters** are sets of instances.

## Features

Create, reboot and destroy instances across DigitalOcean, Linode and Amazon, or locally using Vagrant + Virtualbox:

```sh
# Spin up a new Ubuntu 14.04 instance on DigitalOcean:
$ overcast digitalocean create db-01

# Spin up a new Ubuntu 14.04 instance on Linode:
$ overcast linode create db-02

# Spin up a new Ubuntu 14.04 instance on EC2:
$ overcast aws create db-03 --user ubuntu
$ overcast run db-03 allow_root_access_on_ec2
$ overcast instance update db-03 --user root

# Spin up a new locally-running Ubuntu 14.04 Virtualbox instance:
$ overcast virtualbox create db-04

# Upgrade and install Redis across all of those instances in parallel:
$ overcast run db-* install/core install/redis --parallel
```

Import your already-running machines, wherever they are, using `overcast import` or by editing [`~/.overcast/clusters.json`](https://github.com/andrewchilds/overcast/tree/master/fixtures/example.clusters.json):

```sh
$ overcast import app-01 --ip 1.1.1.1 --ssh-key ~/.ssh/id_rsa
$ overcast import app-02 --ip 2.2.2.2 --ssh-key ~/.ssh/id_rsa
```

Run multiple commands or multiple scripts on any or all of your instances at once, over SSH. Commands can be run sequentially or in parallel using the `--parallel` flag.

```sh
# Run bundled scripts:
$ overcast run db install/core install/apache install/mysql install/php
# Run scripts relative to the current working directory or using absolute path:
$ overcast run app-cluster ./recipes/my-app/install /path/to/script
# Run sequences of commands and scripts across multiple machines in parallel:
$ overcast run db ./script.sh uptime "free -m" "df -h" --parallel
```

Push and pull files between your local machine and any or all of your instances at once. Dynamically rewrite file paths to include the instance name using `{instance}` in either source or destination.

```sh
$ overcast push app nginx/myapp.conf /etc/nginx/sites-enabled/myapp.conf
$ overcast pull all /etc/nginx/sites-enabled/myapp.conf nginx/{instance}.myapp.conf
```

Overcast is a thin wrapper around your native SSH client, and doesn't install or leave anything on the servers you communicate with, so Overcast itself has no real attack surface.

A [script library](https://github.com/andrewchilds/overcast/tree/master/scripts) and [recipe library](https://github.com/andrewchilds/overcast/tree/master/recipes) are included to make it trivial to deploy common software stacks and applications. The libraries were written for and tested against Ubuntu/Debian systems, but you can just as easily run your own custom scripts as well:

```sh
$ overcast run all /absolute/path/to/script ./relative/path/to/other/script
```

## Installation (OS X/Linux)

1. Install [Node.js](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) if not already installed.

2. Install Overcast using npm.

    ```sh
    $ npm -g install overcast
    ```

3. You can now use Overcast from any directory. Running any overcast command will create the ~/.overcast config directory if it doesn't already exist.

    ```sh
    $ overcast list
    ```

4. Add your AWS/DigitalOcean/Linode API keys to `~/.overcast/variables.json` to use their respective commands, either manually or using the `var` command:

    ```sh
    $ overcast var set AWS_KEY my_aws_key
    $ overcast var set AWS_SECRET my_aws_secret
    $ overcast var set DIGITALOCEAN_CLIENT_ID abc123
    $ overcast var set DIGITALOCEAN_API_KEY abc123
    $ overcast var set LINODE_API_KEY abc123
    ```

## Installation (Windows)

Using Overcast on Windows is possible, but **unsupported**. Instructions TBD.

## Uninstallation

Since Overcast is just a wrapper around SSH, there is nothing on your remote machines to uninstall. To uninstall Overcast from your local machine:

```sh
# To remove the Overcast package:
$ npm -g remove overcast
# Optionally delete your Overcast SSH keys and configuration files:
$ rm -rf ~/.overcast
```

## Configuration

Overcast looks for an `.overcast` directory in the current directory, a parent directory, or `~/.overcast`, in that order. This means you can have multiple configurations and treat your server infrastructure like source code.
<commit_msg>Add .bash_profile additions to installation section of README.<commit_after># ![Overcast Logo](http://i.imgur.com/eCBl2NI.png)

Overcast is an SSH-based devops CLI designed to make it easy to spin up, configure and manage clusters of machines, without the learning curve or complexity of existing devops tools.

![Screenshot](http://i.imgur.com/QviXmMg.gif)

## Concepts

- **Instances** are any machine you can SSH into.
- **Clusters** are sets of instances.

## Features

Create, reboot and destroy instances across DigitalOcean, Linode and Amazon, or locally using Vagrant + Virtualbox:

```sh
# Spin up a new Ubuntu 14.04 instance on DigitalOcean:
$ overcast digitalocean create db-01

# Spin up a new Ubuntu 14.04 instance on Linode:
$ overcast linode create db-02

# Spin up a new Ubuntu 14.04 instance on EC2:
$ overcast aws create db-03 --user ubuntu
$ overcast run db-03 allow_root_access_on_ec2
$ overcast instance update db-03 --user root

# Spin up a new locally-running Ubuntu 14.04 Virtualbox instance:
$ overcast virtualbox create db-04

# Upgrade and install Redis across all of those instances in parallel:
$ overcast run db-* install/core install/redis --parallel
```

Import your already-running machines, wherever they are, using `overcast import` or by editing [`~/.overcast/clusters.json`](https://github.com/andrewchilds/overcast/tree/master/fixtures/example.clusters.json):

```sh
$ overcast import app-01 --ip 1.1.1.1 --ssh-key ~/.ssh/id_rsa
$ overcast import app-02 --ip 2.2.2.2 --ssh-key ~/.ssh/id_rsa
```

Run multiple commands or multiple scripts on any or all of your instances at once, over SSH. Commands can be run sequentially or in parallel using the `--parallel` flag.

```sh
# Run bundled scripts:
$ overcast run db install/core install/apache install/mysql install/php
# Run scripts relative to the current working directory or using absolute path:
$ overcast run app-cluster ./recipes/my-app/install /path/to/script
# Run sequences of commands and scripts across multiple machines in parallel:
$ overcast run db ./script.sh uptime "free -m" "df -h" --parallel
```

Push and pull files between your local machine and any or all of your instances at once. Dynamically rewrite file paths to include the instance name using `{instance}` in either source or destination.

```sh
$ overcast push app nginx/myapp.conf /etc/nginx/sites-enabled/myapp.conf
$ overcast pull all /etc/nginx/sites-enabled/myapp.conf nginx/{instance}.myapp.conf
```

Overcast is a thin wrapper around your native SSH client, and doesn't install or leave anything on the servers you communicate with, so Overcast itself has no real attack surface.

A [script library](https://github.com/andrewchilds/overcast/tree/master/scripts) and [recipe library](https://github.com/andrewchilds/overcast/tree/master/recipes) are included to make it trivial to deploy common software stacks and applications. The libraries were written for and tested against Ubuntu/Debian systems, but you can just as easily run your own custom scripts as well:

```sh
$ overcast run all /absolute/path/to/script ./relative/path/to/other/script
```

## Installation (OS X/Linux)

1. Install [Node.js](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) if not already installed.

2. Install Overcast using npm.

    ```sh
    $ npm -g install overcast
    ```

3. You can now use Overcast from any directory. Running any overcast command from anywhere will create the `~/.overcast` config directory if it doesn't already exist. Add your API keys to `~/.overcast/variables.json` to use their respective commands, either manually or using the `var` command:

    ```sh
    $ overcast var set AWS_KEY my_aws_key
    $ overcast var set AWS_SECRET my_aws_secret
    $ overcast var set DIGITALOCEAN_CLIENT_ID abc123
    $ overcast var set DIGITALOCEAN_API_KEY abc123
    $ overcast var set LINODE_API_KEY abc123
    ```

4. To make working with Overcast easier, you can add tab completion and SSH aliases to quickly SSH in to any of your instances, by adding the following to your `.bash_profile`:

    ```sh
    # Overcast SSH aliases
    overcast aliases > $HOME/.overcast_aliases
    source $HOME/.overcast_aliases

    # Overcast Tab completion
    _overcast_completions() {
      local cur=${COMP_WORDS[COMP_CWORD]}
      COMPREPLY=($(compgen -W "`overcast completions`" -- "$cur"))
      return 0
    }
    complete -F _overcast_completions overcast
    ```

## Installation (Windows)

Using Overcast on Windows is possible, but **unsupported**. Instructions TBD.

## Uninstallation

Since Overcast is just a wrapper around SSH, there is nothing on your remote machines to uninstall. To uninstall Overcast from your local machine:

```sh
# To remove the Overcast package:
$ npm -g remove overcast
# Optionally delete your Overcast SSH keys and configuration files:
$ rm -rf ~/.overcast
```

## Configuration

Overcast looks for an `.overcast` directory in the current directory, a parent directory, or `~/.overcast`, in that order. This means you can have multiple configurations and treat your server infrastructure like source code.

{'fraction_non_alphanumeric': 0.08912417763157894, 'fraction_numerical': 0.011615953947368422, 'mean_word_length': 4.1070866141732285, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '3238116', 'n_tokens_mistral': 2967, 'n_tokens_neox': 2764, 'n_words': 1183}