<commit_before>Installation, setup, and user guide
===================================

### Raspberry Pi Setup ###
  * [Raspberry PI Quick Start Guide][]
  * To first configure the Raspberry Pi which will be used to make the image to clone onto all the other Raspberry PIs follow this documentation: [Raspberry Pi Installing Operating Systems][]
  * I used [debian jessie][] and would recommend it.
  * To avoid problems in the future, make sure that your SD card used for cloning is the smallest SD card you have. Even if they claim to be of the same size -- 8 GBs is not the same across all SD cards.
      * Linux Terminal: `df -h` check /dev/root and look for the Size parameter.
      * Windows: Go into Windows Explorer, Right click the SD card and check the capacity.
  * Setting up your Raspberry Pi:
      * Log in to the Original Raspberry PI using a usb mouse and keyboard and an HDMI capable monitor.
      * WiFi:
          * Set up the network following instructions for GUI: [GUI WiFi Setup][]
          * If using the command line follow this set of instructions: [Raspberry PI CLI setup][]
      * Hostname:
          * [Change hostname using command line][]
          * Make sure to give your Raspberry PI a unique hostname.
              * Ours go from ShakoorCamera11 to ShakoorCamera190 so that they do not conflict.
              * We also gave ours static IP addresses from 10.9.0.11 to 10.9.0.190.
              * Given the density of our bramble we had to provide static IP addresses, but it may not be necessary otherwise.
              * Static IP Addresses are a bit more complicated but they are documented [here][].
                  * The previous GUI WiFi Setup also includes some information on static IP addresses.
              * Also take a look at the file in [pi_config/dhcpcd.conf][] for an idea of what to put in your dhcpcd.conf
                  * Your `domain_name_servers`, `ip_address`, `routers`, and `hostname` will be different
      * Wireless Transmit Power:
          * Go to a terminal and type:
              * `sudo nano /etc/network/interfaces` under wlan0 type: `wireless-power off`
              * exit and save the file using Ctrl+X and agreeing to all prompts.
              * This removes all wireless power management which prevents random disconnects.
          * If you want to change it to a lower transmit power to avoid WiFi interferences, use the `interfaces` file in [pi_config/interfaces][].
          * Generally unnecessary, but if you experience communication issues having a lower transmit power may be useful.
          * The ansible playbook `wireless-power.yml` will copy the file over if you need to change it after all the rPIs are set up.
              * Look at [playbooks folder](playbooks) for more information.
  * Cloning your Raspberry Pi:
      * After setting up the first Raspberry Pi, you will want to clone the image and copy it onto all your other Raspberry PI SD Cards.
      * Follow any of these guides to backup then restore (clone) your Raspberry PI Image.
          * [Cloning Your Raspberry PI (Windows)][]
          * [Clone Raspberry PI All Operating Systems][]
          * In general, backup the image then use that image to restore it onto all the other SD cards. You can use Win32DiskImager on Windows or the `dd` tool in Linux.

[this documentation.]: https://www.raspberrypi.org/documentation/linux/filesystem/backup.md

[Cloning Your Raspberry PI (Windows)]: http://lifehacker.com/how-to-clone-your-raspberry-pi-sd-card-for-super-easy-r-1261113524

[Clone Raspberry PI All Operating Systems]: http://www.htpcguides.com/easy-resize-and-back-up-raspberry-pi-sd-card-with-ubuntu/

### Ansible Setup ###
  * Depending on the setup of the centralized server that will be launching Ansible, you will need to pick what is best for you from the [Ansible installation documentation][].
  * I have installed ansible from source using github for a rootless installation.

[Raspberry Pi Installing Operating Systems]: https://www.raspberrypi.org/documentation/installation/installing-images/

[debian jessie]: https://www.raspberrypi.org/downloads/raspbian/

[Raspberry PI CLI setup]: https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md

[Raspberry PI Quick Start Guide]: https://www.raspberrypi.org/help/quick-start-guide/

[GUI WiFi Setup]: https://www.raspberrypi.org/blog/another-raspbian-desktop-user-interface-update/

[Change hostname using command line]: http://www.howtogeek.com/167195/how-to-change-your-raspberry-pi-or-other-linux-devices-hostname/

[here]: http://sizious.com/2015/08/28/setting-a-static-ip-on-raspberry-pi-on-raspbian-20150505/

[pi_config/dhcpcd.conf]: pi_config/dhcpcd.conf

[pi_config/interfaces]: pi_config/interfaces

[Ansible installation documentation]: http://docs.ansible.com/ansible/intro_installation.html
<commit_msg>More information added to overall guide<commit_after>Installation, setup, and user guide
===================================

### Raspberry Pi Setup ###
  * [Raspberry PI Quick Start Guide][]
  * To first configure the Raspberry Pi which will be used to make the image to clone onto all the other Raspberry PIs follow this documentation: [Raspberry Pi Installing Operating Systems][]
  * I used [debian jessie][] and would recommend it.
  * To avoid problems in the future, make sure that your SD card used for cloning is the smallest SD card you have. Even if they claim to be of the same size -- 8 GBs is not the same across all SD cards.
      * Linux Terminal: `df -h` check /dev/root and look for the Size parameter.
      * Windows: Go into Windows Explorer, Right click the SD card and check the capacity.
  * Setting up your Raspberry Pi:
      * Log in to the Original Raspberry PI using a usb mouse and keyboard and an HDMI capable monitor.
      * WiFi:
          * Set up the network following instructions for GUI: [GUI WiFi Setup][]
          * If using the command line follow this set of instructions: [Raspberry PI CLI setup][]
      * Hostname:
          * [Change hostname using command line][]
          * Make sure to give your Raspberry PI a unique hostname.
              * Ours go from ShakoorCamera11 to ShakoorCamera190 so that they do not conflict.
              * We also gave ours static IP addresses from 10.9.0.11 to 10.9.0.190.
              * Given the density of our bramble we had to provide static IP addresses, but it may not be necessary otherwise.
              * Static IP Addresses are a bit more complicated but they are documented [here][].
                  * The previous GUI WiFi Setup also includes some information on static IP addresses.
              * Also take a look at the file in [pi_config/dhcpcd.conf][] for an idea of what to put in your dhcpcd.conf
                  * Your `domain_name_servers`, `ip_address`, `routers`, and `hostname` will be different
      * Wireless Transmit Power:
          * Go to a terminal and type:
              * `sudo nano /etc/network/interfaces` under wlan0 type: `wireless-power off`
              * exit and save the file using Ctrl+X and agreeing to all prompts.
              * This removes all wireless power management which prevents random disconnects.
          * If you want to change it to a lower transmit power to avoid WiFi interferences, use the `interfaces` file in [pi_config/interfaces][].
          * Generally unnecessary, but if you experience communication issues having a lower transmit power may be useful.
          * The ansible playbook `wireless-power.yml` will copy the file over if you need to change it after all the rPIs are set up.
              * Look at [playbooks folder](playbooks) for more information.
  * Cloning your Raspberry Pi:
      * After setting up the first Raspberry Pi, you will want to clone the image and copy it onto all your other Raspberry PI SD Cards.
      * Follow any of these guides to backup then restore (clone) your Raspberry PI Image.
          * [Cloning Your Raspberry PI (Windows)][]
          * [Clone Raspberry PI All Operating Systems][]
          * In general, backup the image then use that image to restore it onto all the other SD cards. You can use Win32DiskImager on Windows or the `dd` tool in Linux.

[this documentation.]: https://www.raspberrypi.org/documentation/linux/filesystem/backup.md

[Cloning Your Raspberry PI (Windows)]: http://lifehacker.com/how-to-clone-your-raspberry-pi-sd-card-for-super-easy-r-1261113524

[Clone Raspberry PI All Operating Systems]: http://www.htpcguides.com/easy-resize-and-back-up-raspberry-pi-sd-card-with-ubuntu/

### Ansible Setup ###
  * Depending on the setup of the centralized server that will be launching Ansible, you will need to pick what is best for you from the [Ansible installation documentation][].
  * I have installed ansible from source using github for a rootless installation.
  * Ansible setup is rather straightforward and should not be very problematic.
  
### Using Ansible To Manage The Bramble ###
  * So, you've setup your Raspberry PIs and you have installed Ansible, now you need to clone this github repository if you haven't already.
  * First, a GitHub primer to get you started: [GitHub Introduction: Hello World!][]
  * Then, once you are finished with that type:
  * `git clone <EMAIL>:calizarr/EPSCOR_Bramble_GH9C.git` to clone this repository into a folder named EPSCOR\_Bramble\_GH9C.
  * The files you'll need from this repository aren't many.
      * All of the playbooks (yml files) assume that the rPI image directory is `/home/pi/Images/`.
      * [hosts](hosts) -- [Ansible Inventory][] and needs to be configured for your setup.
          * I find it useful to declare the localhost as its own group in the inventory file. In this case, it is `clizarraga_chronos` and some of the playbooks use it later. You can change it to your preference or keep using my name for it although I suggest changing it.
      * ansible.cfg -- should be completely configured for your own setup.
          * Use it as a guide, but don't copy directly. Generally just stick to ansible defaults unless you need to change them.
      * Playbooks:
          * Before changing any playbooks, please read the [ansible playbooks documentation][].
          * All of the playbooks will need their hosts variable changed, please do so before attempting to run any of them.
          * copy-pictures.yml -- needs some changes to be useful to your setup.
              * `img_dir` and `local_dir` need to be changed.
                  * `img_dir` needs to be changed only if you're not using `/home/pi/Images` on the rPIs as your image destination.
                  * `local_dir` needs to be changed to where the image files will be stored not on the rPIs.
          * sudo-plays.yml -- contains true/false variables that need to be changed depending on context.
              * You might need to change the `Add hourly cron job from 5 AM to 9 PM` task.
                  * To understand more about cron, read `man cron` and the [Ansible cron module][].
              * Change the `src:` variable on the `Send camera_single.py to the rPIs` task to the destination of camera_single.py of this repository.

[Raspberry Pi Installing Operating Systems]: https://www.raspberrypi.org/documentation/installation/installing-images/

[debian jessie]: https://www.raspberrypi.org/downloads/raspbian/

[Raspberry PI CLI setup]: https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md

[Raspberry PI Quick Start Guide]: https://www.raspberrypi.org/help/quick-start-guide/

[GUI WiFi Setup]: https://www.raspberrypi.org/blog/another-raspbian-desktop-user-interface-update/

[Change hostname using command line]: http://www.howtogeek.com/167195/how-to-change-your-raspberry-pi-or-other-linux-devices-hostname/

[here]: http://sizious.com/2015/08/28/setting-a-static-ip-on-raspberry-pi-on-raspbian-20150505/

[pi_config/dhcpcd.conf]: pi_config/dhcpcd.conf

[pi_config/interfaces]: pi_config/interfaces

[Ansible installation documentation]: http://docs.ansible.com/ansible/intro_installation.html

[GitHub Introduction: Hello World!]: https://guides.github.com/activities/hello-world/

[Ansible Inventory]: http://docs.ansible.com/ansible/intro_inventory.html

[ansible playbooks documentation]: http://docs.ansible.com/ansible/playbooks_intro.html

[Ansible cron module]: http://docs.ansible.com/ansible/cron_module.html

{'fraction_non_alphanumeric': 0.08362817626246381, 'fraction_numerical': 0.009006111289803796, 'mean_word_length': 3.223089983022071, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 13, 'lorem ipsum': 0, 'www.': 16, 'xml': 0}, 'pii_count': 4, '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': '1949846', 'n_tokens_mistral': 3566, 'n_tokens_neox': 3298, 'n_words': 1487}