<commit_before>#DeviceHive Cloud Gateway D-Bus Daemon 

##Decription
Devicehive-cloud provides d-bus interface to access DeviceHive cloud server. It can also serves as a refrence implementation of general purpose cloud conntectivity service for (ex: PubNub). As a binary it starts as a daemon loading cloud configuration from .yml file. While running it maintains cloud connectivity and responds to d-bus API calls from client applications, as well as notifies applications of incoming messages or status changes. 

## Installation
### Ubuntu Snappy Core
Ubuntu Snappy Core runs Raspberry Pi 2, Beagle Bone Black, and a veriety of ARM and x86 devices, so it can be a good choice for hassle free deployment for a frameowrk.

Steps:
* Install Ubuntu Snappy Core on your favorite system: https://developer.ubuntu.com/en/snappy/start/
* Once Snappy is up and running on your device, install DeviceHive IoT Toolkit:
* Download IoT Toolkit snap from: https://github.com/devicehive/IoT-framework/releases/download/1.0.0-RC1/devicehive-iot-toolkit_1.0.0_multi.snap
* Copy it on your Snappy Device: 
```
scp *.snap ubuntu@snappy-host:~
```
* Install snaps using the following command:
```
sudo snappy install devicehive-iot-toolkit_1.0.0_multi.snap  --allow-unauthenticated
```
If any issues occur during snaps install you can check syslog for details:
```
sudo tail -n 100 /var/log/syslog
```

## Configuration
If you are running devicehive-cloud as a part of Snappy Framework you can run ```sudo snappy config devicehive-cloud config.yml```, or if you are running it on other system as a standalone binary, a configuration file can be supplied in ```--conf``` parameter. 

Sample config:
```
URL: http://172.16.17.32:8080/dh/rest
AccessKey: <KEY>

DeviceID: 0B24431A-EC99-4887-8B4F-38C3CEAF1D03
DeviceName: snappy-go-gateway

SendNotificatonQueueCapacity: 2047	# Optional: default value is 2048
LoggingLevel: verbose               # Optional: can be 'info', 'verbose', 'debug'
                                    # Default: 'info'
```

## API Reference
TBD

## Building and running it yourself
###How to make a binary?
```
go get github.com/devicehive/IoT-framework/tree/master/devicehive-cloud
cd $GOPATH/src/github.com/devicehive/IoT-framework/tree/master/devicehive-cloud
go install
```
###How to run?<commit_msg>Added Ubuntu dbus configuration instructions<commit_after>#DeviceHive Cloud Gateway D-Bus Daemon 

##Decription
Devicehive-cloud provides d-bus interface to access DeviceHive cloud server. It can also serves as a refrence implementation of general purpose cloud conntectivity service for (ex: PubNub). As a binary it starts as a daemon loading cloud configuration from .yml file. While running it maintains cloud connectivity and responds to d-bus API calls from client applications, as well as notifies applications of incoming messages or status changes. 

## Installation
### Ubuntu Snappy Core
Ubuntu Snappy Core runs Raspberry Pi 2, Beagle Bone Black, and a veriety of ARM and x86 devices, so it can be a good choice for hassle free deployment for a frameowrk.

Steps:
* Install Ubuntu Snappy Core on your favorite system: https://developer.ubuntu.com/en/snappy/start/
* Once Snappy is up and running on your device, install DeviceHive IoT Toolkit:
* Download IoT Toolkit snap from: https://github.com/devicehive/IoT-framework/releases/download/1.0.0-RC1/devicehive-iot-toolkit_1.0.0_multi.snap
* Copy it on your Snappy Device: 
```
scp *.snap ubuntu@snappy-host:~
```
* Install snaps using the following command:
```
sudo snappy install devicehive-iot-toolkit_1.0.0_multi.snap  --allow-unauthenticated
```
If any issues occur during snaps install you can check syslog for details:
```
sudo tail -n 100 /var/log/syslog
```

## Configuration
If you are running devicehive-cloud as a part of Snappy Framework you can run ```sudo snappy config devicehive-cloud config.yml```, or if you are running it on other system as a standalone binary, a configuration file can be supplied in ```--conf``` parameter. 

Sample config:
```
URL: http://172.16.17.32:8080/dh/rest
AccessKey: <KEY>

DeviceID: 0B24431A-EC99-4887-8B4F-38C3CEAF1D03
DeviceName: snappy-go-gateway

SendNotificatonQueueCapacity: 2047	# Optional: default value is 2048
LoggingLevel: verbose               # Optional: can be 'info', 'verbose', 'debug'
                                    # Default: 'info'
```

## Dbus configuration for Ubuntu
In ``/etc/dbus-1/system.conf`` you should replace:
```
<deny own="*"/>
<deny send_type="method_call"/>
```
on
```
<allow own="*"/>
<allow send_type="method_call"/>
```

## API Reference
TBD

## Building and running it yourself
###How to make a binary?
```
go get github.com/devicehive/IoT-framework/tree/master/devicehive-cloud
cd $GOPATH/src/github.com/devicehive/IoT-framework/tree/master/devicehive-cloud
go install
```
###How to run?
{'fraction_non_alphanumeric': 0.0968872397443826, 'fraction_numerical': 0.02370645227788085, 'mean_word_length': 4.285403050108933, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2613423', 'n_tokens_mistral': 1593, 'n_tokens_neox': 1424, 'n_words': 555}