<commit_before># bitpocket

## About

**bitpocket** is a small but smart script that does 2-way directory
synchronization. It uses _rsync_ to do efficient data transfer and tracks local
file creation/removal to avoid known rsync problem when doing 2-way syncing
with deletion.

## Installation

Clone repository and symlink `bitpocket` bin to sth in your `$PATH`:

    $ git clone git://github.com/sickill/bitpocket.git
    $ ln -s `pwd`/bitpocket/bin/bitpocket ~/bin/bitpocket

Or download script and place it in a directory in your `$PATH`:

    $ curl -sL https://raw.github.com/sickill/bitpocket/master/bin/bitpocket > ~/bin/bitpocket
    $ chmod +x ~/bin/bitpocket


## Setting up master

Create empty directory on some host that will be the master copy of your files:

    $ ssh <EMAIL>
    $ mkdir ~/BitPocketMaster


## Setting up slaves

On each machine you want to synchronize initialize empty directory as your bitpocket:

    $ mkdir ~/BitPocket
    $ cd ~/BitPocket
    $ bitpocket init <EMAIL>:~/BitPocketMaster


### Manual sync

Now whenever you want to sync with master just run _bitpocket sync_ inside your
bitpocket directory:

    $ cd ~/BitPocket
    $ bitpocket sync


### Automatic sync with cron

Add following line to your crontab to run bitpocket every 5 minutes:

    */5 * * * * cd ~/BitPocket && nice ~/bin/bitpocket cron

Note that cron usually has very limited environment and your ssh keys with
passhrases won't work in cron jobs as ssh-agents/keyrings don't work there.
Thus it's preferable to generate passphrase-less ssh key for bitpocket
authentication:

    $ cd ~/BitPocket
    $ ssh-keygen -t rsa -C bitpocket-`hostname` -N '' -f .bitpocket/id_rsa
    $ ssh-copy-id -i .bitpocket/id_rsa <EMAIL>

and uncomment line with `RSYNC_SSH` in _.bitpocket/config_ file.

<commit_msg>Words<commit_after># bitpocket

## About

**bitpocket** is a small but smart script that does 2-way directory
synchronization. It uses _rsync_ to do efficient data transfer and tracks local
file creation/removal to avoid known rsync problem when doing 2-way syncing
with deletion.

## Installation

Clone repository and symlink `bitpocket` bin to sth in your `$PATH`:

    $ git clone git://github.com/sickill/bitpocket.git
    $ ln -s `pwd`/bitpocket/bin/bitpocket ~/bin/bitpocket

Or download script and place it in a directory in your `$PATH`:

    $ curl -sL https://raw.github.com/sickill/bitpocket/master/bin/bitpocket > ~/bin/bitpocket
    $ chmod +x ~/bin/bitpocket


## Setting up master

Create empty directory on some host that will be the master copy of your files:

    $ ssh <EMAIL>
    $ mkdir ~/BitPocketMaster


## Setting up slaves

On each machine you want to synchronize initialize empty directory as your bitpocket:

    $ mkdir ~/BitPocket
    $ cd ~/BitPocket
    $ bitpocket init <EMAIL>:~/BitPocketMaster


### Manual sync

Now whenever you want to sync with master just run _bitpocket sync_ inside your
bitpocket directory:

    $ cd ~/BitPocket
    $ bitpocket sync


### Automatic sync with cron

Add following line to your crontab to synchronize every 5 minutes:

    */5 * * * * cd ~/BitPocket && nice ~/bin/bitpocket cron

Note that cron usually has very limited environment and your ssh keys with
passhrases won't work in cron jobs as ssh-agents/keyrings don't work there.
Thus it's preferable to generate passphrase-less ssh key for bitpocket
authentication:

    $ cd ~/BitPocket
    $ ssh-keygen -t rsa -C bitpocket-`hostname` -N '' -f .bitpocket/id_rsa
    $ ssh-copy-id -i .bitpocket/id_rsa <EMAIL>

and uncomment line with `RSYNC_SSH` in _.bitpocket/config_ file.


{'fraction_non_alphanumeric': 0.084070796460177, 'fraction_numerical': 0.0022123893805309734, 'mean_word_length': 3.5439698492462313, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '4766062', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1100, 'n_words': 445}