text:
# Notes on Rasa `2.x / 1.x`

1. The `main` branch of this repo is compatible with Rasa Open Source **version 2.x**
2. The bot for **Rasa 1.x** can be found in the [rasa-1 branch](https://github.com/RasaHQ/financial-demo/tree/rasa-1).

# Financial Services Example Bot

This is an example chatbot demonstrating how to build AI assistants for financial services and banking. This starter pack can be used as a base for your own development or as a reference guide for implementing common banking-industry features with Rasa. It includes pre-built intents, actions, and stories for handling conversation flows like checking spending history and transferring money to another account.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

  - [Install dependencies](#install-dependencies)
  - [Run the bot](#run-the-bot)
  - [Overview of the files](#overview-of-the-files)
  - [Things you can ask the bot](#things-you-can-ask-the-bot)
  - [Handoff](#handoff)
    - [Try it out](#try-it-out)
    - [How it works](#how-it-works)
    - [Bot-side configuration](#bot-side-configuration)
  - [Testing the bot](#testing-the-bot)
  - [Rasa X Deployment](#rasa-x-deployment)
  - [Action Server Image](#action-server-image)
- [CI/CD](#cicd)
  - [Summary](#summary)
  - [GitHub Secrets](#github-secrets)
      - [AWS IAM User API Keys:](#aws-iam-user-api-keys)
      - [AWS Elastic IP:](#aws-elastic-ip)
      - [Rasa Enterprise License:](#rasa-enterprise-license)
      - [Helm chart Credentials](#helm-chart-credentials)
  - [AWS Preparation](#aws-preparation)
    - [IAM User API Keys](#iam-user-api-keys)
    - [SSH Key Pair](#ssh-key-pair)
    - [Local AWS CLI](#local-aws-cli)
      - [Install AWS CLI v2](#install-aws-cli-v2)
      - [Configure your AWS CLI](#configure-your-aws-cli)
    - [ECR repository & S3 bucket](#ecr-repository--s3-bucket)
  - [EKS production cluster](#eks-production-cluster)
    - [Preparation](#preparation)
      - [Install eksctl](#install-eksctl)
      - [Install kubectl](#install-kubectl)
      - [Install helm](#install-helm)
      - [Install jp](#install-jp)
      - [Set environment variables](#set-environment-variables)
    - [Create the EKS cluster](#create-the-eks-cluster)
    - [Configure `kubeconfig`](#configure-kubeconfig)
    - [Install/Upgrade Rasa Enterprise](#installupgrade-rasa-enterprise)
      - [Build & push action server docker image](#build--push-action-server-docker-image)
      - [Install/Upgrade Rasa Enterprise](#installupgrade-rasa-enterprise-1)
    - [Train, test & upload model to S3](#train-test--upload-model-to-s3)
    - [Deploy, Tag & Smoketest the trained model](#deploy-tag--smoketest-the-trained-model)
    - [DNS](#dns)
  - [Appendix A: The AWS EKS cluster](#appendix-a-the-aws-eks-cluster)
  - [Appendix B: Manual Cleanup of AWS resources](#appendix-b-manual-cleanup-of-aws-resources)
  - [Appendix C: OCTANT](#appendix-c-octant)
    - [Install Octant](#install-octant)
      - [Install on Ubuntu](#install-on-ubuntu)
    - [Run Octant](#run-octant)
  - [Appendix D: AWS EKS references](#appendix-d-aws-eks-references)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Install dependencies

Run:
```bash
pip install -r requirements.txt
```

To install development dependencies:

```bash
pip install -r requirements-dev.txt
pre-commit install
python -m spacy download en_core_web_md en
python -m spacy link en_core_web_md en
```

> With pre-commit installed, the `black` and `doctoc` hooks will run on every `git commit`.
> If any changes are made by the hooks, you will need to re-add changed files and re-commit your changes.

## Run the bot

Use `rasa train` to train a model.

Then, to run, first set up your action server in one terminal window, listening on port 5056:
```bash
rasa run actions --port 5056
```

Note that port 5056 is used for the action server, to avoid a conflict when you also run the helpdesk bot as described below in the `handoff` section.

In another window, run the duckling server (for entity extraction):

```bash
docker run -p 8000:8000 rasa/duckling
```

Then to talk to the bot, run:
```
rasa shell --debug
```

Note that `--debug` mode will produce a lot of output meant to help you understand how the bot is working
under the hood. To simply talk to the bot, you can remove this flag.

You can also try out your bot locally using Rasa X by running
```
rasa x
```

Refer to our guided workflow in the [Wiki page](https://github.com/RasaHQ/financial-demo/wiki/Using-Rasa-X-with-the-Financial-Demo) for how to get started with Rasa X in local mode.

## Overview of the files

`data/nlu/nlu.yml` - contains NLU training data

`data/nlu/rules.yml` - contains rules training data

`data/stories/stories*.yml` - contains stories training data

`actions.py` - contains custom action/api code

`domain.yml` - the domain file, including bot response templates

`config.yml` - training configurations for the NLU pipeline and policy ensemble

`tests/` - end-to-end tests

## Things you can ask the bot

The bot currently has five skills. You can ask it to:
1. Transfer money to another person
2. Check your earning or spending history (with a specific vendor or overall)
3. Answer a question about transfer charges
4. Pay a credit card bill
5. Tell you your account balance

It also has a limited ability to switch skills mid-transaction and then return to the transaction at hand.

For the purposes of illustration, the bot recognises the following fictional credit card accounts:

- `emblem`
- `justice bank`
- `credit all`
- `iron bank`

It recognises the following payment amounts (besides actual currency amounts):

- `minimum balance`
- `current balance`

It recognises the following vendors (for spending history):

- `Starbucks`
- `Amazon`
- `Target`

You can change any of these by modifying `actions.py` and the corresponding NLU data.

If configured, the bot can also hand off to another bot in response to the user asking for handoff. More [details on handoff](#handoff) below.

## Handoff

This bot includes a simple skill for handing off the conversation to another bot or a human.
This demo relies on [this fork of chatroom](https://github.com/RasaHQ/chatroom) to work, however you
could implement similar behaviour in another channel and then use that instead. See the chatroom README for
more details on channel-side configuration.

Using the default set up, the handoff skill enables this kind of conversation with two bots:

<img src="./handoff.gif" width="200">

### Try it out

The simplest way to use the handoff feature is to do the following:

1. Clone [chatroom](https://github.com/RasaHQ/chatroom) and [Helpdesk-Assistant](https://github.com/RasaHQ/helpdesk-assistant) alongside this repo
2. In the chatroom repo, install the dependencies:
```bash
yarn install
```
3. In the chatroom repo, build and serve chatroom:
```bash
yarn build
yarn serve
```
4. In the Helpdesk-Assistant repo, install the dependencies and train a model (see the Helpdesk-Assistant README)
5. In the Helpdesk-Assistant repo, run the rasa server and action server at the default ports (shown here for clarity)
   In one terminal window:
    ```bash
    rasa run --enable-api --cors "*" --port 5005 --debug
    ```
    In another terminal window:
    ```bash
    rasa run actions --port 5055 --debug
    ```
6. In the Financial-Demo repo (i.e. this repo), run the rasa server and action server at **the non-default ports shown below**
   In one terminal window:
    ```bash
    rasa run --enable-api --cors "*" --port 5006 --debug
    ```
    In another terminal window:
    ```bash
    rasa run actions --port 5056 --debug
    ```
7. Open `chatroom_handoff.html` in a browser to see handoff in action

### How it works

Using chatroom, the general approach is as follows:

1. User asks original bot for a handoff.
2. The original bot handles the request and eventually
   sends a message with the following custom json payload:
    ```
        {
            "handoff_host": "<url of handoff host endpoint>",
            "title": "<title for bot/channel handed off to>"
            }
    ```
    This message is not displayed in the Chatroom window.
3. Chatroom switches the host to the specified `handoff_host`
4. The original bot no longer receives any messages.
5. The handoff host receives the message `/handoff{"from_host":"<original bot url">}`
6. The handoff host should be configured to respond to this message with something like,
   "Hi, I'm <so and so>, how can I help you??"
7. The handoff host can send a message in the same format as specified above to hand back to the original bot.
   In this case the same pattern repeats, but with
   the roles reversed. It could also hand off to yet another bot/human.

### Bot-side configuration

The "try it out" section doesn't require any further configuration; this section is for those
who want to change or further understand the set up.

For this demo, the user can ask for a human, but they'll be offered a bot (or bots) instead,
so that the conversation looks like this:

For handoff to work, you need at least one "handoff_host". You can specify any number of handoff hosts in the file `actions/handoff_config.yml`.
```
handoff_hosts:
    helpdesk_assistant:
      title: "Helpdesk Assistant"
      url: "http://localhost:5005"
    ## you can add more handoff hosts to this list e.g.
    # moodbot:
    #   title: "MoodBot"
    #   url: "http://localhost:5007"
```

Handoff hosts can be other locally running rasa bots, or anything that serves responses in the format that chatroom
accepts. If a handoff host is not a rasa bot, you will of course want to update the response text to tell the user
who/what they are being handed off to.

The [Helpdesk-Assistant](https://github.com/RasaHQ/helpdesk-assistant) bot has been set up to handle handoff in exactly the same way as Helpdesk-Assistant,
so the simplest way to see handoff in action is to clone Financial-Demo alongside this repo.

If you list other locally running bots as handoff hosts, make sure the ports on which the various rasa servers & action servers are running do not conflict with each other.

## Testing the bot

You can test the bot on the test conversations by:

- start duckling
- running  `rasa test`.

This will run [end-to-end testing](https://rasa.com/docs/rasa/user-guide/testing-your-assistant/#end-to-end-testing) on the conversations in `tests/test_stories.yml`.

All tests must pass.

## Rasa X Deployment

To [deploy financial-demo](https://rasa.com/docs/rasa/user-guide/how-to-deploy/), it is highly recommended to make use of the [one line deploy script](https://rasa.com/docs/rasa-x/installation-and-setup/one-line-deploy-script/) for Rasa X.

As part of the deployment, you'll need to set up [git integration](https://rasa.com/docs/rasa-x/installation-and-setup/integrated-version-control/#connect-your-rasa-x-server-to-a-git-repository) to pull in your data and configurations, and build or pull an action server image.

## Action Server Image

You will need to have docker installed in order to build the action server image. If you haven't made any changes to the action code, you can also use the [public image on Dockerhub](https://hub.docker.com/r/rasa/financial-demo) instead of building it yourself.

To build & tag the image, run:

```bash
export ACTION_SERVER_DOCKERPATH=<dockerID>/<name-of-image>:<tag-of-image>
make docker-build
```

Run the action server container:

```bash
make docker-run
```

Perform a smoke test on the health endpoint:

```bash
make docker-test
```

Once you have confirmed that the container is working, push the container image to a registry:

```bash
# login to a container registry with your credentials
docker login

# check the registry logged into
docker system info | grep Registry

# push the action server image
make docker-push
```

# CI/CD

## Summary

As explained in the [Setting up CI/CD](https://rasa.com/docs/rasa/setting-up-ci-cd) section of the Rasa documentation, Continous Integration (**CI**) is the practice of merging in code changes frequently and automatically testing changes as they are committed. Continuous Deployment (**CD**) means automatically deploying integrated changes to a staging or production environment. Together, they allow you to make more frequent improvements to your assistant and efficiently test and deploy those changes.

A CI/CD pipeline is used to test, build and deploy the financial-demo bot to AWS EKS.

The pipeline uses GitHub Actions, defined in  `.github/workflows/cicd.yml`. It includes these jobs:

![](images/cicd.png)

**[params](https://github.com/RasaHQ/financial-demo/blob/d40467b4fb2a7d4fb072b86a2828a8cec662eb63/.github/workflows/cicd.yml#L26)**

- Defines parameters for use by downstream jobs

**[params_summary](https://github.com/RasaHQ/financial-demo/blob/d40467b4fb2a7d4fb072b86a2828a8cec662eb63/.github/workflows/cicd.yml#L125)**

- Prints the value of the parameters.

**[action_server](https://github.com/RasaHQ/financial-demo/blob/d40467b4fb2a7d4fb072b86a2828a8cec662eb63/.github/workflows/cicd.yml#L156)**

- Builds & Tests the docker image of the action server with tag: `<branch-name>`
- Uploads the docker image to the AWS ECR repository: `financial-demo`

**[rasa_model](https://github.com/RasaHQ/financial-demo/blob/d40467b4fb2a7d4fb072b86a2828a8cec662eb63/.github/workflows/cicd.yml#L203)**

- Trains & Tests the rasa model with name: `models/<branch-name>.tar.gz
- Uploads the trained model to the AWS S3 bucket: `rasa-financial-demo`

**[aws_eks_create_test_cluster](https://github.com/RasaHQ/financial-demo/blob/d40467b4fb2a7d4fb072b86a2828a8cec662eb63/.github/workflows/cicd.yml#L242)**

- If not existing yet, creates an AWS EKS cluster with name: `financial-demo-<branch-name>`

**[deploy_to_test_cluster](https://github.com/RasaHQ/financial-demo/blob/d40467b4fb2a7d4fb072b86a2828a8cec662eb63/.github/workflows/cicd.yml#L266)**

- Installs/Updates Rasa Enterprise, with the docker image created by the **action_server** job.
- Deploys the rasa model, trained by the **rasa_model** job.
- Performs smoke tests to ensure basic operations are all OK.

**[deploy_to_prod_cluster](https://github.com/RasaHQ/financial-demo/blob/d40467b4fb2a7d4fb072b86a2828a8cec662eb63/.github/workflows/cicd.yml#L353)**

- Runs when pushing to the `main` branch, and all previous steps are successful.
- Installs/Updates Rasa Enterprise, with the docker image created by the **action_server** job.
- Deploys the rasa model, trained by the **rasa_model** job.
- Performs smoke tests to ensure basic operations are all OK.

## GitHub Secrets

Secrets can be added to your GitHub repository by going to `Settings > Secrets` and selecting `New repository secret`.

When entering values, be sure to omit quotes.

#### AWS IAM User API Keys:

To configure the aws cli in Github Actions, create IAM User API Keys as described below, and add them as GitHub secrets to the repository:

- AWS_ACCESS_KEY_ID = `Access key ID`
- AWS_SECRET_ACCESS_KEY = `Secret access key`

#### Rasa Enterprise License:

To define a pull secret in Github Actions for the private GCR repo, you'll need to retrieve the private values from your Rasa Enterprise license file ([docs](https://rasa.com/docs/rasa-x/installation-and-setup/install/helm-chart#5-configure-rasa-x-image)) and add them as GitHub secrets to the repository:

- GCR_AUTH_JSON_PRIVATE_KEY_ID = `private_key_id`
- GCR_AUTH_JSON_PRIVATE_KEY = `private_key`
- GCR_AUTH_JSON_CLIENT_EMAIL = `client_email`
- GCR_AUTH_JSON_CLIENT_ID = `client_id`

An alternative approach to GCR repo authentication would be with the [gcloud credential helper](https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud-helper).

#### Helm chart Credentials

To use safe_credentials in Github Actions through `values.yml` ([docs](https://rasa.com/docs/rasa-x/installation-and-setup/install/helm-chart#3-configure-credentials)), add following GitHub Secrets to the repo, replacing each `<safe credential>` with a different alphanumeric string and choosing a `<username>` for the initial user.

*(Please use **safe credentials** to avoid data breaches)*

- GLOBAL_POSTGRESQL_POSTGRESQLPASSWORD = `<safe credential>`
- GLOBAL_REDIS_PASSWORD = `<safe credential>`
- RABBITMQ_RABBITMQ_PASSWORD = `<safe credential>`
- RASAX_INITIALUSER_USERNAME = `<username>`
- RASAX_INITIALUSER_PASSWORD = `<safe credential>`
- RASAX_JWTSECRET = `<safe credential>`
- RASAX_PASSWORDSALT = `<safe credential>`
- GLOBAL_POSTGRESQL_POSTGRESQLPASSWORD = `<safe credential>`
- GLOBAL_POSTGRESQL_POSTGRESQLPASSWORD = `<safe credential>`

## AWS Preparation

The CI/CD pipeline of financial-demo uses AWS for all the storage & compute resources.

After cloning or forking the financial-demo GitHub repository you must set up the following items before the pipeline can run.

### IAM User API Keys

The CI/CD pipeline uses the [aws cli](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html#cliv2-linux-install).

The [aws cli](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html#cliv2-linux-install) needs a set of IAM User API keys for authentication & authorization:

In your AWS Console, go to the IAM dashboard to create a new set of API keys:

  - Click on Users

  - Click on Add user

    - User name = findemo  *(The actual name is not important, we will never use this name directly)*

      Choose "**programmatic access**." This allows you to use the aws cli to interact with AWS.

    - Click on Next: Permissions

      - Click on *Attach existing policies directly*

        For IAM access, you can choose “**AdministratorAccess**”, or limit access to only what is needed by the CD pipeline.

    - Click on Next: Tags

    - Click on Next: Review

    - Click on Create user

    - Store in a safe location: `Access key ID` & `Secret access key`

### SSH Key Pair

To SSH into the EC2 worker nodes of the EKS cluster, you'll need an SSH Key Pair

- In your AWS Console, go to **EC2 > Key Pairs**, and create a Key Pair with the name `findemo`, and download the file `findemo.pem` which contains the private SSH key.
  **Note that the name `findemo` is important, since it is used by the CI/CD pipeline when the cluster is created.**

### Local AWS CLI

Before the CI/CD pipeline can run, you will use the AWS CLI locally to create some resources and need to install & configure the CLI locally.

#### Install AWS CLI v2

See the [installation instructions](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html).

#### Configure your AWS CLI

```bash
# AWS CLI version 2.1.26 or later
aws --version

# Configure AWS CLI
aws configure
AWS Access Key ID [None]: -----          # See above: IAM User API Keys
AWS Secret Access Key [None]: -------    # See above: IAM User API Keys
Default region name [None]: us-west-2    # The CI/CD pipeline uses us-west-2
Default output format [None]:

# Check your configuration
aws configure list [--profile profile-name]

# verify it works
aws s3 ls
```

### ECR repository & S3 bucket

The CI pipeline creates two artifacts:

- An action server docker **image**, which is pushed to an **AWS ECR** repository.
- A trained rasa **model**, which is copied to an **AWS S3** bucket

Run these commands to create the storage for these artifacts. These commands run the AWS CLI and create an ECR repository and an S3 bucket:

```bash
# create ECR repository with name `financial-demo`
make aws-ecr-create-repository

# create S3 bucket with name `rasa-financial-demo`
make aws-s3-create-bucket
```

## EKS production cluster

If the production cluster is already set up, you can skip this section.

This section describes the initial deployment of the financial-demo bot on an EKS production cluster.

This initial deployment is done manually. After that, the deployment is maintained & upgraded automatically by the CI/CD pipeline.

### Preparation

Before you can create or interact with an EKS cluster, you must install  `eksctl`, `kubectl`, `helm`, `jp`, and define some environment variables.

#### Install eksctl

See the [installation instructions](https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html)

If you use Ubuntu, you can issue the command:

```bash
make install-eksctl
```

#### Install kubectl

See the [installation instructions](https://kubernetes.io/docs/tasks/tools/#kubectl)

If you use Ubuntu, you can issue the command:

```bash
make install-kubectl
```

#### Install helm

See the [installation instructions](https://helm.sh/docs/intro/install/)

If you use Ubuntu, you can issue the command:

```bash
make install-helm
```

#### Install jp

See the [installation instructions](https://github.com/jmespath/jp#installing)

If you use Ubuntu, you can issue the command:

```bash
make install-jp
```

#### Set environment variables

There are many ways to set the required environment variables in your local environment.

One way is to create a file  `./secret/envs_export`, with this content:

```bash
# source this file to set the environment variables the same as the GitHub secrets.
export GCR_AUTH_JSON_PRIVATE_KEY_ID=...
export GCR_AUTH_JSON_PRIVATE_KEY='-----BEGIN PRIVATE KEY-...-END PRIVATE KEY-----\n'
export GCR_AUTH_JSON_CLIENT_EMAIL='...'
export GCR_AUTH_JSON_CLIENT_ID=...
export GLOBAL_POSTGRESQL_POSTGRESQLPASSWORD=...
export GLOBAL_REDIS_PASSWORD=...
export RABBITMQ_RABBITMQ_PASSWORD=...
export RASAX_DEBUG_MODE=false
export RASAX_INITIALUSER_USERNAME=admin
export RASAX_INITIALUSER_PASSWORD=...
export RASAX_JWTSECRET=...
export RASAX_PASSWORDSALT=...
export RASAX_TOKEN=...
export RASA_TOKEN=...
```

Then, create the environment variables with the command:

```bash
source ./secret/envs_export
```

### Create the EKS cluster

Create the EKS production cluster, with name `financial-demo-production`:

```bash
make aws-eks-cluster-create AWS_EKS_CLUSTER_NAME=financial-demo-production
```

Some other useful 'Makefile functions' to interact with an EKS cluster:

```bash
make aws-eks-cluster-list-all

# in commands below, default name of cluster = financial-demo-<current branch name>
#
make aws-eks-cluster-describe AWS_EKS_CLUSTER_NAME=<name of cluster>
make aws-eks-cluster-describe-stacks AWS_EKS_CLUSTER_NAME=<name of cluster>
make aws-eks-cluster-delete AWS_EKS_CLUSTER_NAME=<name of cluster>
```

### Configure `kubeconfig`

Add the EKS  cluster information to `~/.kube/config`, and set the `current-context` to that cluster:

```bash
make aws-eks-cluster-update-kubeconfig AWS_EKS_CLUSTER_NAME=financial-demo-production

# make sure kubectl is now looking at the correct EKS cluster
make kubectl-config-current-context
```

### Install/Upgrade Rasa Enterprise

### Versions

#### Select compatible versions

Get compatible versions for rasa-x, rasa and rasa-sdk from [compatibility matrix](https://rasa.com/docs/rasa-x/changelog/compatibility-matrix/)

For the rasa-x-helm chart, the latest version should work. When installing a very old version, you might need to use an older  helm chart version, selected with:

```bash
#.............NAME   URL
helm repo add rasa-x https://rasahq.github.io/rasa-x-helm
helm repo update

# .................NAME  /CHARTNAME
$ helm search repo rasa-x/rasa-x --versions
NAME         	CHART VERSION	APP VERSION	DESCRIPTION
rasa-x/rasa-x	2.0.0        	0.41.1     	Rasa X Helm chart for Kubernetes / Openshift
rasa-x/rasa-x	1.16.0       	0.40.1     	Rasa X Helm chart for Kubernetes / Openshift
..
rasa-x/rasa-x	1.7.0        	0.33.0     	Rasa X Helm chart for Kubernetes / Openshift
rasa-x/rasa-x	1.6.13       	0.30.1     	Rasa X Helm chart for Kubernetes / Openshift
# NOTE: APP VERSION = Rasa X version
```

#### rasa & rasa-sdk

```bash
# file: requirements.txt
rasa[spacy]==2.5.2
rasa-sdk==2.5.0

# file: Dockerfile
FROM rasa/rasa-sdk:2.5.0
```

#### rasa-x & rasa-x-helm

```yaml
# file: Makefile

RASAX_TAG := 0.39.3
RASAX_HELM_CHART_VERSION := 2.0.0
```

#### Build & push action server docker image

Build, run, test & push the action docker server image, with name:

- `<ECR URI>/financial-demo:<current branch name>`

```bash
# check out the `main` branch.
# -> the branch name is used as the image tag
git checkout main

# build the image
make docker-build

# test it
make docker-run
make docker-test
make docker-stop

# Login & push the docker image to the AWS ECR repository
make aws-ecr-docker-login
make docker-push
```

#### Install/Upgrade Rasa Enterprise

Install/Upgrade Rasa Enterprise, using the action server docker image that was uploaded to the ECR repository:

```bash
# make sure kubectl is looking at the correct EKS cluster
make aws-eks-cluster-update-kubeconfig AWS_EKS_CLUSTER_NAME=financial-demo-production
# check it
make kubectl-config-current-context  AWS_EKS_CLUSTER_NAME=financial-demo-production

# check out the `main` branch.
# -> The action server docker image with tag = current branch name will be installed
git checkout main

# if you want to re-install rasa enterprise completely from scratch:
make rasa-enterprise-uninstall
make rasa-enterprise-delete-pvc-all
make aws-eks-namespace-delete

# create namespace `my-namespace`
make aws-eks-namespace-create

# create/refresh gcr-pull-secret, for Rasa Enterprise image
make pull-secret-gcr-create

# create/refresh ecr-pull-secret, for action server image
make pull-secret-ecr-create

# Install/Upgrade Rasa Enterprise with the action server
make rasa-enterprise-install

# Check Rasa Enterprise Health
make rasa-enterprise-check-health

# To troubleshoot, highly recommended to use OCTANT, see Appendix C
```

### Train, test & upload model to S3

```bash
# check out the `main` branch.
git checkout main

# Train the model: `models/<current branch>.tar.gz`
make rasa-train

# In another window, start duckling server
docker run -p 8000:8000 rasa/duckling

# Run the end-to-end tests
make rasa-test

# Upload `models/<current branch>.tar.gz` to S3
# Note: This does not mean the model is deployed to Rasa Enterprise,
#       which is done in the next step.
make aws-s3-upload-rasa-model
```

### Deploy, Tag & Smoketest the trained model

```bash
# Configure ~/.kube/config and set current_context
make aws-eks-cluster-update-kubeconfig  AWS_EKS_CLUSTER_NAME=financial-demo-production

# Deploy rasa model
make aws-s3-download-rasa-model
make rasa-enterprise-model-delete
make rasa-enterprise-model-upload
make rasa-enterprise-model-tag

# Wait about 1 minute, so rasa-production can download, upack & load the model

# Smoketest
make rasa-enterprise-smoketest
```

### DNS

Optionally, if you want to access Rasa Enterprise at your own (sub)-domain name, define a DNS record of type CNAME with your domain service provider:

- **name of sub-domain**:  `aws-financial-demo`

  *==> This example name will resolve to `aws-financial-demo.my-domain.com`*

- **Type**: `CNAME`

- **Content**: `--------.us-west-2.elb.amazonaws.com`

  *==> This is the hostname of the External Application Load Balancer that AWS EKS created during the deployment. You can get this hostname with the command:*

  ```bash
  make rasa-enterprise-get-loadbalancer-hostname
  ```

- **TTL (Time to Live)**: 1 Hour

- **Priority**:

It might take some time for things to propagate, but you can verify it with commands like nslookup & dig:

```bash
########################################################################
# use `nslookup -type`
nslookup -type=CNAME aws-financial-demo.my-domain.com
aws-financial-demo.my-domain.com canonical name = ---.us-west-2.elb.amazonaws.com.

########################################################################
# use `dig`
dig CNAME aws-financial-demo.my-domain.com
...
;; ANSWER SECTION:
aws-financial-demo.my-domain.com. ---- IN CNAME ---.us-west-2.elb.amazonaws.com.

```

Once propagated, you can access Rasa Enterprise at **http://aws-financial-demo.my-domain.com**

## Trouble Shooting

If something goes wrong with the CI/CD pipeline, you should:

- Browse the [workflow logs](https://github.com/RasaHQ/financial-demo/actions)
- Peek in [.github/workflows/cicd.yml](https://github.com/RasaHQ/financial-demo/blob/main/.github/workflows/cicd.yml) to see what the pipeline is doing at the moment of trouble
- Trouble shoot it from your local computer

The following steps will most likely reveal what is going wrong:

- Before you can use the Makefile commands locally, follow the [Preparation](#preparation) steps:

  - Install eksctl, kubectl, helm, jp
  - Set the environment variables

- Then, configure kubectl, so you are looking at the correct EKS cluster.

  - To troubleshoot the EKS test cluster for your current branch

    ```bash
    make aws-eks-cluster-update-kubeconfig
    ```

  - To Troubleshoot the EKS production cluster

    ```bash
    make aws-eks-cluster-update-kubeconfig AWS_EKS_CLUSTER_NAME=financial-demo-production
    ```

- Make sure you are now looking at the correct cluster by checking the current context:

  ```bash
  make kubectl-config-current-context
  ```

- Then, issue these commands to check things out.

  - Trouble shoot the EKS cluster

    ```bash
    # Check the available commands for the `aws-eks` cluster:
    $ make aws-eks # Do NOT press `Enter`, but press the `Tab` key twice
    aws-eks-cluster-create                    aws-eks-cluster-info
    aws-eks-cluster-delete                    aws-eks-cluster-list-all
    aws-eks-cluster-describe                  aws-eks-cluster-status
    aws-eks-cluster-describe-stacks           aws-eks-cluster-update-kubeconfig
    aws-eks-cluster-exists                    aws-eks-namespace-create
    aws-eks-cluster-get-certificateAuthority  aws-eks-namespace-delete
    aws-eks-cluster-get-endpoint

    # Trouble shoot the cluster
    make aws-eks-cluster-exists
    make aws-eks-cluster-status
    make aws-eks-cluster-info
    ```

  - Trouble shoot the S3 storage of the trained model

    ```bash
    # Check the available commands for the `aws-s3` bucket:
    make aws-s3 # Do NOT press `Enter`, but press the `Tab` key twice
    aws-s3-create-bucket        aws-s3-list-rasa-models
    aws-s3-delete-bucket        aws-s3-rasa-model-exists
    aws-s3-download-rasa-model  aws-s3-upload-rasa-model

    # Trouble shoot the S3 storage of the trained model
    make aws-s3-list-rasa-models
    make aws-s3-rasa-model-exists
    ```

  - Trouble shoot the ECR storage of the action server image

    ```bash
    # Check the available commands for the `aws-ecr` repository:
    make aws-ecr # Do NOT press `Enter`, but press the `Tab` key twice
    aws-ecr-create-repository        aws-ecr-get-repositoryUri
    aws-ecr-docker-login             aws-ecr-image-exists
    aws-ecr-get-authorization-token  aws-ecr-list-images

    # First, login to the ECR (This expires after a while, so redo it)
    make aws-ecr-docker-login

    # Then, Troubleshoot the ECR storage of the action server image
    make aws-ecr-list-images
    make aws-ecr-image-exists
    ```

  - Trouble shoot the Rasa Enterprise deployment

    ```bash
    # Check the available commands for the `rasa-enterprise` deployment:
    $ make rasa-e # Do NOT press `Enter`, but press the `Tab` key twice
    rasa-enterprise-check-health               rasa-enterprise-get-secrets-rabbit
    rasa-enterprise-get-access-token           rasa-enterprise-get-secrets-redis
    rasa-enterprise-get-base-url               rasa-enterprise-install
    rasa-enterprise-get-chat-token             rasa-enterprise-model-delete
    rasa-enterprise-get-loadbalancer-hostname  rasa-enterprise-model-tag
    rasa-enterprise-get-login                  rasa-enterprise-model-upload
    rasa-enterprise-get-pods                   rasa-enterprise-smoketest
    rasa-enterprise-get-secrets-postgresql     rasa-enterprise-uninstall

    # Trouble shoot the rasa enterprise deployment
    make rasa-enterprise-get-pods
    make rasa-enterprise-check-health
    make rasa-enterprise-smoketest
    ```

## Cleanup of AWS resources

The CI/CD pipeline creates unique artifacts and infrastructure for each branch. This is all cleaned up once a branch is deleted, by a special workflow `.github/workflows/cleanup.yml`.

You can also do a manual cleanup, either from the AWS CLI, or from the AWS Console.

### From the command line:

- AWS ECR:

  ```bash
  # list the action server images in the ECR
  make aws-ecr-list-images

  # delete the action server image of current branch
  make aws-ecr-delete-image

  # delete an action server image created by another branch
  make aws-ecr-delete-image GIT_BRANCH_NAME=my_other_branch
  ```

- AWS S3:

  ```bash
  # list the rasa models in the S3 bucket
  make aws-s3-list-rasa-models

  # delete the rasa model of current branch
  make aws-s3-delete-rasa-model

  # delete a rasa model created by another branch
  make aws-s3-delete-rasa-model GIT_BRANCH_NAME=my_other_branch
  ```

- AWS EKS:

  ```bash
  # list the EKS clusters
  make aws-eks-cluster-list-all

  # to delete ALL the test clusters
  make aws-eks-cluster-delete-all-test-clusters

  # delete the test cluster of the current branch
  make aws-eks-cluster-delete

  # delete a test cluster created by another branch
  make aws-eks-cluster-delete GIT_BRANCH_NAME=my_other_branch
  ```

### From the **AWS console**:

- AWS ECR:

  In the AWS Console, go to the ECR repository `financial-demo`, and delete the action server images.

- AWS S3:

  In the AWS Console, go to the S3 bucket `rasa-financial-demo` , and delete the rasa models.

- AWS EKS:

  In the AWS Console, go to CloudFormation, and delete all the stacks in reverse order as created by the `eksctl` command.

  When a stack fails to delete due to dependencies, you have two options:

    - Option 1: Manually delete the resources that the stack is not able to delete. (**RECOMMENDED**)

      You can do this by drilling down into the **CloudFormation stack delete events** messages and deleting items bottom-up the dependency tree.

      One example of a bottom-up delete sequence is when deletion of the VPC fails:

      - **EC2 > Load Balancers**: first, delete the ELB load balancer of the cluster. Look at the Tags to see what cluster a loadbalancer belongs to.
      - **VPC > Virtual Private Cloud: Subnets**: then, delete the two subnets of the cluster.  Look at the Name to see what cluster a subnet belongs to.
        - This will also delete the EC2 > Network interfaces, named `eni-xxxx`
        - You cannot delete Subnets until the ELB load balancers are deleted
      - **VPC > Virtual Private Cloud: Your VPCs**: finally, delete the VPC of the cluster. Look at the Name to see what cluster a VPC belongs to.
        - This will also delete all associated:
          - security groups (`sg-xxx`)
          - internet gateways (`igw-xxx`)
          - subnets (`subnet-xxx`)

      After cleaning up, try again to delete the **AWS CloudFormation** stack.

      If it still does not delete, iterate the manual cleanups until it does.

      Again, this can be a painful process, but once the CloudFormation stacks delete properly, you are guaranteed that you have cleaned up all the EKS related resources created by the CI/CD pipeline.

  - Option 2: Select to retain the resources that have dependency errors. (**NOT RECOMMENDED**)

    The stack delete operation will simply skip deleting them. This is NOT recommended, because you will clutter up your AWS account with many unused resources.

## Appendix A: The AWS EKS cluster

We use *eksctl* to create the clusters. It creates many AWS resources with CloudFormation templates.

Some of these AWS resources are:

- A VPC with
  - Public & private subnets
  - Internet & NAT Gateways
  - Route Tables
- An IAM EKS service role
- An EKS Cluster Control Plane
- An EKS Managed nodegroup of EC2 instances

The cluster context is also added to the `~/.kube/config` file.

The VPC created looks something like this:

![](images/financial-demo-eks-test-vpc.png)

The EKS Control Plane interacts with the the EKS Data Plane (the nodes), like this:

![img](https://d2908q01vomqb2.cloudfront.net/fe2ef495a1152561572949784c16bf23abb28057/2020/04/10/subnet_pubpri.png)

## Appendix B: OCTANT

[Octant](https://octant.dev/) is a useful open sourced tool for visualizing workloads inside the cluster and troubleshooting issues when they arise.

### Install Octant

[Installation instructions](https://github.com/vmware-tanzu/octant#installation)

#### Install on Ubuntu

```bash
cd ~
mkdir octant
cd octant
wget https://github.com/vmware-tanzu/octant/releases/download/v0.20.0/octant_0.20.0_Linux-64bit.deb
sudo dpkg -i octant_0.20.0_Linux-64bit.deb
```

### Run Octant

```bash
# #################################################### #
# Configure kubectl to look at the correct EKS cluster #
# #################################################### #

# -> for a feature branch test cluster
git checkout my-feature-branch

# -> for the production cluster
git branch production # create temporary, local `production` branch
git checkout production

# Configure kubeconfig for the correct EKS cluster
make aws-eks-cluster-update-kubeconfig

# make sure kubectl is now looking at the correct EKS cluster
make kubectl-config-current-context

# #################################################### #
# Run Octant on default port 7777 and open the browser #
# #################################################### #
OCTANT_LISTENER_ADDR=<IP_ADDRESS>:7777 octant &

# Within octant, select the namespace `my-namespace`
```

## Appendix D: AWS EKS references

There are two commands to create AWS EKS clusters;  `eksctl` & `aws eks`.

- The `eksctl` cli is the most complete, and it is what we ended up using.

- The `aws eks` cli does not support to launch worker nodes to the cluster control plane. This has to be done manually from the AWS Console, which makes it unsuited for a CI/CD pipeline where everything needs to be done via scripting (=> infrastructure as code).

The following references are useful for learning about AWS EKS, and it is highly recommended to manually build test-clusters with both the `eksctl` & `aws eks` commands to help demystify the AWS resources that are being generated:

- [eksctl – the EKS CLI](https://aws.amazon.com/blogs/opensource/eksctl-eks-cli/)
- [Getting started with Amazon EKS - eksctl](https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html)
- [Blog: EKS Cluster with One Command](https://aws.amazon.com/blogs/opensource/eksctl-eks-cluster-one-command/)
- [Blog: Demystifying cluster networking for EKS worker nodes](https://aws.amazon.com/blogs/containers/de-mystifying-cluster-networking-for-amazon-eks-worker-nodes/)
- https://docs.aws.amazon.com/eks/latest/userguide/create-public-private-vpc.html
- https://docs.aws.amazon.com/eks/latest/userguide/eks-compute.html
- https://logz.io/blog/amazon-eks-cluster/amp/
- https://www.eksworkshop.com/
- [aws eks - Command Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/eks/index.html)  (Not used)

gha_language: Python


text:
---
author: dealingwith
date: '2005-11-12 12:31:00'
layout: post
slug: idolatry
status: publish
title: iDolatry
wordpress_id: '713'
categories:
 - ipod
 - itunes
 - mp3 the format
 - podcast
---

lazyweb: i am beginning to seriously consider an iPod or somesuch, but here
are my requirements:

- I don't want to have to use any particular software to get stuff on the
device, especially iTunes. I want to be able to access the device like an
external harddrive or memory device, but also want to be able to load stuff
onto it with software that supports RSS enclosures (that's another question:
which readers {for Win} can do this?).

- I want it (relatively) cheap and simple. I don't need video, or a huge
amount of storage (a gig would be nice). I don't want it too big, but I don't
want it so small I lose or break it.

- The battery must not die after a year. Or two. It can start degrading in the
third year. I'll forgive it that. Then, this battery must be easy to replace.

I think that's about it. Please help!

Update: Just stole the title from [smallritual][1]. Funny, there the iPod
ownership is a given, even the latest greatest. Priorities I guess. That and
brand loyalty ;)

   [1]: http://smallritual.blogs.com/small_ritual/2005/11/idolatry.html

license: MIT

repository: dealingwith/poole

branch_name: refs/heads/master

extension: markdown

gha_language: CSS

license_type: permissive

repo_name: dealingwith/poole


text:
# Protocol Multiplexing using rpc-style protobufs with libp2p

This example shows how to use protobufs to encode and transmit information between libp2p hosts using libp2p Streams.
This example expects that you are already familiar with the [echo example](https://github.com/libp2p/go-libp2p/tree/master/examples/echo).

## Build

From the `go-libp2p/examples` directory run the following:

```sh
> cd multipro/
> go build
```

## Usage

```sh
> ./multipro
```

## Details

The example creates two libp2p Hosts supporting 2 protocols: ping and echo.

Each protocol consists of RPC-style requests and responses and each request and response is a typed protobufs message (and a go data object).

This is a different pattern than defining a whole p2p protocol as one protobuf message with lots of optional fields (as can be observed in various p2p-lib protocols using protobufs such as dht).

The example shows how to match async received responses with their requests. This is useful when processing a response requires access to the request data.

The idea is to use libp2p protocol multiplexing on a per-message basis.

### Features
1. 2 fully implemented protocols using an RPC-like request-response pattern - Ping and Echo
2. Scaffolding for quickly implementing new app-level versioned RPC-like protocols
3. Full authentication of incoming message data by author (who might not be the message's sender peer)
4. Base p2p format in protobufs with fields shared by all protocol messages
5. Full access to request data when processing a response.

## Author
@avive

extension: md

gha_language: Go

gha_license_id: MIT


text:
# README Generator

  ![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)

  [Link to the MIT License OpenSource Documentation](https://opensource.org/licenses/MIT)

  ## Description

  Using a command-line prompt, the user can create a professional looking README file by answering a few questions.

  ## Table of Contents

  * [Installation](#installation)

  * [Usage](#usage)

  * [License](#license)

  * [Contributing](#contributing)

  * [Tests](#tests)

  * [Questions](#questions)

  ## Installation

  To install necessary dependencies for this app, run the following command:
  ~~~
  npm i
  ~~~
  ## Usage

  To use this repository, run the 'npm i' command to install dependencies, and then run 'node index' to begin creating the README file by answering the command-line prompts.

  ## Contributing

  For any questions regarding contributing the the project, you can contact via email or GitHub profile.

  ## Tests

  To run tests, run the following command:
  ~~~
  npm test
  ~~~
  ## Questions

  If you have any quesitons about this repository, open an issue, or contact me directly at [dan.c.shoup@gmail.com](mailto:dan.c.shoup@gmail.com). You can find more of my work on my GitHub page at: [danshoup](https://github.com/danshoup).

  ## License

  Usage of this application is covered under the **MIT** license.

  [Click here to read more about the MIT license.](https://opensource.org/licenses/MIT)

  Copyright 2021; Daniel Shoup

  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: danshoup/README-generator

branch_name: refs/heads/main

repo_name: danshoup/README-generator


text:
# Images

1. Words in image file names MUST be separated with hyphens (-).
1. Images SHOULD be compressed to the smallest possible size without compromising on clarity.
1. JPEG file format MUST be used only for an image that is or contains photography except in the case of (4).
1. PNG file format MUST be used for any image requiring transparency.


text:
Package: alinex-monitor-sensor
=================================================

[![Build Status](https://travis-ci.org/alinex/node-monitor-sensor.svg?branch=master)](https://travis-ci.org/alinex/node-monitor-sensor)
[![Coverage Status](https://coveralls.io/repos/alinex/node-monitor-sensor/badge.png?branch=master)](https://coveralls.io/r/alinex/node-monitor-sensor?branch=master)
[![Dependency Status](https://gemnasium.com/alinex/node-monitor-sensor.png)](https://gemnasium.com/alinex/node-monitor-sensor)

This module is part of the [Monitoring](http://alinex.github.io/node-monitor)
modules and applications but can be used as standalone module in other projects,
too.

- it has multiple sensors
- runs completely asynchronous
- collects all the data
- supports verbose mode and debugging
- calculates the status

Some sensors and parts of it are specifically for Linux/Unix/OSX systems. If you
have windows you may help to improve this.

It is one of the modules of the [Alinex Universe](http://alinex.github.io/node-alinex)
following the code standards defined there.

Install
-------------------------------------------------

The easiest way is to let npm add the module directly:

    > npm install alinex-monitor-sensor --save

[![NPM](https://nodei.co/npm/alinex-monitor-sensor.png?downloads=true&stars=true)](https://nodei.co/npm/alinex-monitor-sensor/)

Usage
-------------------------------------------------

To use one of the sensors you have to load the sensors collection:

    var sensor = require('alinex-monitor-sensor');

Or you may only load one specific sensor class:

    var Ping = require('alinex-monitor-sensor/lib/ping');

In the further documentation i will show usage with the sensor collection.

### Sensor run

To use any sensor you have to instantiate and configure it:

    var ping = new sensor.Ping({
      ip: '<IP_ADDRESS>'
    });

You may also give a [alinex-config](http://alinex.github.io/node-config) object
here.

Now you can start it using a callback method:

    ping.run(function(err, sensor) {
      // do something with result in ping object
      console.log(sensor);
    });

Or alternatively you may use an event based call:

    ping.run();
    ping.on 'end', function() {
      // do something with result in ping object
      console.log(ping);
    });

The `ping` object looks like:

    { config: { verbose: false, timeout: 1, ip: '<IP_ADDRESS>' },
      result:
      { date: Tue Jul 22 2014 14:08:34 GMT+0200 (CEST),
        status: 'fail',
        data: '1 packets transmitted, 0 received, 100% packet loss, time 0ms',
        message: 'Ping exited with code 1'
      }
    }

Status
-------------------------------------------------
The sensors uses the following status:

- __running__ if the sensor is already analyzing, you have to wait
- __ok__ if everything is perfect, there nothing have to be done
- __warn__ if the sensor reached the warning level, know you have to keep an eye on it
- __fail__ if the sensor failed and there is a problem

Each sensor will automatically fail if an timeout occurred. Else the defined
checks will be used.

Most checks will collect different values which may be used to specify the status.
Therefore you may write a rule for `fail` or `warn` status in logical form, use
a simple expression syntax:

    fail: 'free < 5%'
    warn: 'free < 20% and cpu > 50%'

### Warn/Fail rules

You may use different mathematical and logical operators together with braces.
Allowed are:

- comparison: <, >, <=, >=, ==, !=
- calculation: +, -, *, /
- logic: and, or, is, isnt, not
- braces: (, )
- all the data value names of the sensor
- array access on some data values: `match[1]`
- object access on some data values: `match.title`

More complexer examples are:

    fail: "match.title isnt 'heise Developer'"
    warn: "free < 10% or swapFree < 50%"
    fail: "statuscode < 200 or statuscode >= 400"

Public API
-------------------------------------------------

### Sensor classes

The following list contains the possible sensors, look into each other to get
all the specific information:

- [Cpu](src/type/cpu.coffee) - cpu activity check
- [Load](src/type/load.coffee) - cpu load check
- [Memory](src/type/memory.coffee) - check free memory
- [IO](src/type/io.coffee) - disk io check
- [Net](src/type/net.coffee) - network io check
- [Diskfree](src/type/diskfree.coffee) - free disk space
- [Time](src/type/time.coffee) - check local time
- [Upgrade](src/type/upgrade.coffee) - check for package upgrades
- [Ping](src/type/ping.coffee) - network ping test
- [Socket](src/type/socket.coffee) - test port connectivity
- [Http](src/type/http.coffee) - try requesting an url

#### Methods

- `run(cb)` - start a new analyzation with optional callback
- `format()` - give a human readable output in markdown syntax

#### Events

- `error` - then the sensor could not work properly
- `start` - sensor has started
- `end` - sensor ended analysis
- `ok` - no problems found
- `warn` - warning means high load or critical state
- `fail` - not working correctly

#### Class properties

- `meta` - some meta data for this test type
  - `name` - title of the test
  - `description` - short description what will be checked
  - `category` - to group similiar tests together
  - `level` - gives a hint if it is a low level or higher level test
- `values` - meta information for the measurement values
- `config` - the default configuration
  (each entry starting with underscore gives the help text for that value)
- `check` - check function for the configuration values (alinex-config
  style)

#### Properties

- `config` - configuration (given combined with defaults)
- `result` - the results:
  - `date` - start date of last or current run
  - `range` - if set this will give the time range (start/end date in an array)
    this measurement includes
  - `status` - status of the last or current run (ok, warn, fail)
  - `message` - error message of the last or current run
  - `values` - map of measured values
  - `analysis` - additional analysis data

License
-------------------------------------------------

Copyright 2014 Alexander Schilling

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

>  <http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

repository: alinex/node-monitor-sensor

gha_language: CoffeeScript

repo_name: alinex/node-monitor-sensor


text:
# PulbishArticleArchiveByMonth
A Plugin for Publish to generate a article archive page by month

![Demo](publish-3-dateAchive.png)

add `makeDateArchive` after `addMarkdownFiles`

```swift
        .addMarkdownFiles(),
        .makeDateArchive(),
```

I wrote a blog to discuss how to write theme and plugin for Publish.
[My Blog](https://www.fatbobman.com/posts/publish-1/)


text:
# PIC Assembly MIDI eXPerience
Various MPLAB-X home projects to learn Mid-Range PICmicro assembly programming of MIDI protocol.

## Contents of the repository

### MIDI Echo
* [xp-pic-asm-midi-echo](xp-pic-asm-midi-echo.X/)
A minimal MIDI In/Out echo application.


text:
# My Tweets with React

> A React project

## Build Setup

``` bash
# install dependencies
npm install

# serve with hot reload at localhost:3000
npm start

# build for production
npm run build
```

For detailed explanation on how things work, checkout the [create-react-app guide](https://github.com/facebookincubator/create-react-app)

repository: bpetetot/js-frameworks-test-apps

repo_name: bpetetot/js-frameworks-test-apps


text:
---
layout: post
title: "Gang of Four - Observer and Mediator Pattern"
date: 2016-03-16 13:32
comments: true
categories: books
---

## Observer

  - subject is a logical place to keep track of the collection of the observers
    - the upside is the observers needing to check with the subject via something like long-polling versus the subject notifying the owners
  - ActiveRecord before_actions and after_actions are a ruby implementation of the observer pattern
  - How does JS does this?
    - functions are first class object, easy to pass around

## Mediator

  - what's the difference between mediator and observer
    - Define an object that encapsulates how a set of objects interact.
    - Mediator is a little more specific, it avoids having classes communicate directly but instead through a mediator. This helps the Single Responsibility principle by allowing communication to be offloaded to a class that just handles that.
  - replaces many to many interactions with one to many interactions.

repository: adamjonas/blog

repo_name: adamjonas/blog


text:
# Overview

This is a yet another implementation of a markdown blog engine based on **Web Dev Simplified** [tutorial](https://www.youtube.com/watch?v=1NrHkjlWVhM) and customised (try to find my own NodeJS style...) by me.

The project's features:

* its frontend made with `Bootstrap` and `EJS` templates;
* stores data in `MongoDB` via `mongoose` library;
* runs `ESLint` before the tests;
* it has the tests with power of `Jest` and `supertest` (for API checks);
* uses `nodemon` for automaticaly restarting app during the development;
* it uses `Docker` and `docker-compose` tools for distribution, local launch and testing.

## Launch

### Docker compose

To run the project with a `docker-compose` tool, just type the following in a terminal:

```bash
$> docker-compose up --detach
Creating mongodb ... done
Creating markdown-blog ... done
```

To stop the project:

```bash
$> docker-compose stop
Stopping markdown-blog ... done
Stopping mongodb       ... done
```

### Developer mode

To run the project in develop mode, start a **MongoDB** database, for example via a **Docker**:

```bash
$> docker run -p 27017:27017 mongo:4.2.3
...
```

Then, start the project itself:

```bash
$> npm run start:dev

><EMAIL_ADDRESS>start-dev /markdown-blog
> nodemon main.js

[nodemon] 2.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node main.js`
...
```

Open [localhost:5000](http://localhost:5000) in your web browser and see something like the screenshots below.

**Main page**:

![all articles](https://github.com/xxlabaza/nodejs-markdown-blog/blob/master/.screenshots/screenshot-1.png?raw=true)

**Read an article**:

![view article](https://github.com/xxlabaza/nodejs-markdown-blog/blob/master/.screenshots/screenshot-2.png?raw=true)

**Edit an article**:

![edit article](https://github.com/xxlabaza/nodejs-markdown-blog/blob/master/.screenshots/screenshot-3.png?raw=true)

repository: xxlabaza/nodejs-markdown-blog

gha_language: JavaScript

repo_name: xxlabaza/nodejs-markdown-blog


text:
# Reliable service communications with a service bus

It's common for services to communicate with each other over HTTP. However this isn't always the best technology choice, and integrating services (or even parts of the same service) using a message bus is much simpler and reliable than you may think.

The following examples use [@node-ts/bus](https://github.com/node-ts/bus) as the service bus.

## Sending

Consider the need to register a new product for our retail business. This might be modelled like so:

```typescript
const registerProduct = new RegisterProduct('abc-123', name: 'product a', price: 100)

// Sending the command using an HTTP based API endpoint:
await request('https://<IP_ADDRESS>:8080/product', registerProduct)

// Sending the same command using a service bus:
await bus.send(registerProduct)
```

### Service discovery

When dealing with an HTTP endoint, how do we know that the server is at `<IP_ADDRESS>`, listening on port `8080`?

  - We might build in a service discovery mechanism. Perhaps build a load balancer and tell it that `/product` requests need to be routed to a certain cluster of services.
  - Maybe replace the fixed IP with a local DNS entry to make this more reliable
  - Inject or set the configuration of this address per environment

When using messaging, the message is ultimately routed to a queue where it will be processed when the service monitoring that queue is ready. Your app doesn't need to know or care where that consumer is, it just needs to send out the command and know that it will eventually be processed.

### Service Availability

So what happens when the service that processes the request/message is unavailable?

Our HTTP request will just fail even though there's nothing wrong with whatever we used to make the request. We've done our work and just want the product to be registered, but now we have to deal with a `5xx` error in the code.

When working with messaging, commands are generally executed quickly - sub 10ms. If the service that processes this command does go down, then the command will sit in the queue until the service is ready and starts processing it again. No changes need to happen to the requesting process, it's fire and forget.

## Receiving

Consider processing the above command:

```typescript
import { productService } from './product-service'

// Using an HTTP based API endpoint
@Controller('POST', '/product')
const controller = (request, response, next) => {
  try {
    const command = request.body as RegisterProduct
    productService.registerProduct(command)
    response.status(204).end()
  } catch (err) {
    next(err)
  }
}

// Using a message handler
@HandlesMessage(RegisterProduct)
class RegisterProductHandler {
  handler (command: RegisterProduct): void {
    productService.registerProduct(command)
  }
}
```

### Verbs and Intent

`HTTP Services` should ususally conform to the technical specification on what different verbs mean. `POST`, `PUT`, `PATCH` and `DELETE` are all write operations that create, update or delete resources. This sometimes has the undesired effect of turning APIs into an anemic CRUD system that can discard the rich domain language used by your business.

`Messaging` doesn't have these concepts. In fact it's useful to only have two types of intents: read and write, aka events and commands. In the above messaging example, a function receives an intent to perform an action (`RegisterProduct`) and it does that one thing. The name of the command is understandable even by non-technical users.

### Response Statuses

A key difference between HTTP APIs and fire and forget messaging is that the former is generally a synchronous technology, whereas the latter is asynchronous. As such, messaging doesn't need to worry about return statuses because there's nobody to notify.

`HTTP services` on the other hand needs to use the set of HTTP status codes provided by the specification. Although most APIs use a small subset, they must indicate to the requestor what the outcome of processing was so that the requestor can then decide on the next step to take.

## Error Handling

What happens when the `productService` in the above example throws an error during processsing? For instance let's say that it tries to insert a record in a database that was being patched.

`HTTP Services` would error out and possibly return a `503 Service Unavailable` response. The requestor would then need to handle this response, and maybe throw an error of its own to indicate its work can't be completed, sending errors everywhere up the chain. This is made worse if the requestor already had completed half of a larger operation where the data is now in an incomplete state.

`Messaging` by nature provides retries when errors occur. If the command is processed and an error is thrown due to the database being unavailable, the error is logged and the message is placed back on the queue. It's then picked up, and the same operation retried with a progressive delay between attempts. Eventually the database patching will finish and the next time the command is retried the process will complete sucessfully.

Using this approach, the requestor doesn't need to build in error handling for each command it sends out. Systems can go offline for days, but will resume normally once they're turned back on without any data loss.

repository: Zehelein/bus

repo_name: Zehelein/bus


text:
# Week12

1. Write your explanation in the README.md file of your weekly repo.

2. For each task you will create a .js file to write the code examples with comments provided for each line of code.

3. An executable code files MUST be provided.

4. For each explanation in your README.md file you write you MUST provide pseudocode and diagrams.

5. For each task you will explain in your own words.

6. You can research and use any suitable resources you need to complete this activity. Make sure you reference your resources using APA style in the README.md.

1. Write an introduction of JavaScript Data Structure stores Hash Tables & Dictionaries and explain each one of them. (Provide with your explanation pseudocodes, diagrams and executable code)

Hash Tables

Hash Table is a data structure which stores data in an associative manner. In a hash table, data is stored in an array format, where each data value has its own unique index value. Access of data becomes very fast if we know the index of the desired data.

Thus, it becomes a data structure in which insertion and search operations are very fast irrespective of the size of the data. Hash Table uses an array as a storage medium and uses hash technique to generate an index where an element is to be inserted or is to be located from.

![image](https://upload.wikimedia.org/wikipedia/commons/7/7d/Hash_table_3_1_1_0_1_0_0_SP.svg)

Dictionaries

The Dictionary object is used to store information in name/value pairs (referred to as key and item). The Dictionary object might seem similar to Arrays, however, the Dictionary object is a more desirable solution to manipulate related data.

Comparing Dictionaries and Arrays:

    Keys are used to identify the items in a Dictionary object
    You do not have to call ReDim to change the size of the Dictionary object
    When deleting an item from a Dictionary, the remaining items will automatically shift up
    Dictionaries cannot be multidimensional, Arrays can
    Dictionaries have more built-in functions than Arrays
    Dictionaries work better than arrays on accessing random elements frequently
    Dictionaries work better than arrays on locating items by their content

Resources:
“Data Structure and Algorithms - Hash Table - Tutorialspoint.” Tutorialspoint.Com, 2020, www.tutorialspoint.com/data_structures_algorithms/hash_data_structure.htm.

freeCodeCamp.org. “Hash Tables - Beau Teaches JavaScript.” YouTube, 2020, www.youtube.com/watch?v=F95z5Wxd9ks. Accessed 25 May 2020.


text:
# Facade pattern

* Wraps set of interfaces behind a unified interface making it easier for the clients to use the subsystem.

* Facade **does not hide the subsystem** and make itself the only way to access to subsystem. Facade object should just be a facilitator and not a **god** object.

![Facade pattern](./facade.png)

## Example implementation

```Python
"""
Provide a unified interface to a set of interfaces in a subsystem.
Facade defines a higher-level interface that makes the subsystem easier
to use.
"""

class Facade:
    """
    Know which subsystem classes are responsible for a request.
    Delegate client requests to appropriate subsystem objects.
    """

    def __init__(self):
        self._subsystem_1 = Subsystem1()
        self._subsystem_2 = Subsystem2()

    def operation(self):
        self._subsystem_1.operation1()
        self._subsystem_1.operation2()
        self._subsystem_2.operation1()
        self._subsystem_2.operation2()

class Subsystem1:
    """
    Implement subsystem functionality.
    Handle work assigned by the Facade object.
    Have no knowledge of the facade; that is, they keep no references to
    it.
    """

    def operation1(self):
        pass

    def operation2(self):
        pass

class Subsystem2:
    """
    Implement subsystem functionality.
    Handle work assigned by the Facade object.
    Have no knowledge of the facade; that is, they keep no references to
    it.
    """

    def operation1(self):
        pass

    def operation2(self):
        pass

def main():
    facade = Facade()
    facade.operation()

if __name__ == "__main__":
    main()
```

## Rules of thumb

* Facade deals with providing simpler interface while adapter provides client compatible interface.

* Facade objects are often singletons.

* Subsystem classes are unaware of the existance of a facade.

## References

* [Facade design pattern](https://sourcemaking.com/design_patterns/facade)
* [Python3 Object oriented programming by Dusty Phillips](https://www.amazon.in/dp/B005O9OFWQ/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1)
* [Facade pattern example](https://github.com/faif/python-patterns/blob/master/patterns/structural/facade.py)


text:
**Note:** This was the way we used to approach writing CSS at Segment.io and it inspired us to make [Myth](https://github.com/segmentio/myth), which is where future development for this idea will be happening.

---

# rework-pure-css

  A collection of pure-CSS Rework plugins, so you can write bleeding-edge, spec-compliant CSS and it will get transformed for browsers that haven't caught up yet.

  This is nice because it lets you write pure CSS, and as browser support improves you don't have to change a thing.

  _Note: some things aren't spec'd yet but are extremely obvious candidates, like certain pseudo-elements. It doesn't include controversial features like `extend`._

## Installation

    $ npm install rework-pure-css

## Example

```js
var pure = require('rework-pure-css');

rework(css)
  .use(pure)
  .toString();
```

## Plugins

  - [variables](https://github.com/visionmedia/rework-vars)
  - [prefixes](https://github.com/ai/autoprefixer)
  - [pseudo elements](https://github.com/yields/rework-pseudos)
  - [font-variant](https://github.com/ianstormtaylor/rework-font-variant)

## License

  MIT

repository: ianstormtaylor/rework-pure-css

repo_name: ianstormtaylor/rework-pure-css


text:
# This repository holds the Landingpage of X

## Setup

1. Install Docker
2. Checkout repository
3. run ```docker-compose up``` inside of the repository folder
4. In our browser navigate to: [http://localhost:4000](http://localhost::4000)

## Make Changes

1. Create [fork](https://help.github.com/articles/about-forks/)
2. Make Changes (see [Setup](#setup) for details)
3. run ```docker-compose run jekyll build```
4. Create [pullrequest](https://help.github.com/articles/about-pull-requests/) to your upstream repository

repository: youtopi/youtopi-www

repo_name: youtopi/youtopi-www


text:
---
layout: post
title:  "Image based Plant Growth Analysis System"
comments: true
---

This project is the part of some Smart Farm Projects. It is developed by using TensorFlow open-source software and Python OpenCV. It took 2 months to finish the main module parts and 1 month for the Web UI. In this post, only the main module part will be described.

## Problem Statement

The goal of this project is to extract some plant features from images without measuring each plant by human hands to observe the growth of the plants. To solve this, some object detection and computer vision techniques are going to be used.

## Dataset

There are about 200 images for each section with some labels but labels are uncertain, so it is decided to use images for training without the given labels (date, weather info, count, length). Given images contains compare-objects to measure real length of the plants.

* Tomato Plants
* Tomato Stems
* Tomato Flowers
* Tomato Fruits

**⚠  All the sample images are made from Google images because of the copy right issues.**

These are samples of each datasets:

![Sample Images](/img/tomato/sample.png){:width="600"}

## Length and Thickness of the Stem

**1) Object Detection**

In tomato plant images, there are black tapes which farmers put. This has to be clearly detected to measure the length of the tomato plants. At first, color filtering and edge detection were applied. It seemed working, but it failed when the brightness of images is different. To solve this problem, [TensorBox](https://github.com/Russell91/TensorBox), which is TensorFlow opensource Object Detection using GoogLeNet-OverFeat algorithm was tried. With this Object Detection, black tapes were extremely well detected regardless of the brightness or any other factors.

For the stem, it was same as Black Tape Detection, but after the detection, the stem was cropped and with this cropped image, edge detection was applied.

Red Circle Detection was also achieved by [TensorBox](https://github.com/Russell91/TensorBox), but after detection, because the bounding box of the detector was too large, so the result of the image was cropped and some circle detection in Python OpenCV was applied.

![Sample Images](/img/tomato/plant2_1.jpg){:width="600"}
![Sample Images](/img/tomato/stem2_1.jpg){:width="600"}
![Sample Images](/img/tomato/stem2_2.jpg){:width="600"}

**2) Exception Handling and Results**

There were some multiple object predictions on one object, so the object that had higher confidence had to be chosen. As a result, in one image, one red circle and two black tapes were detected. After that, since the length of the red circle is known, the length of the tomato plant in the image can be calculated by counting pixels and comparing with detected red circle.

![Sample Images](/img/tomato/plant2_2.jpg){:width="600"}
![Sample Images](/img/tomato/stem2_3.jpg){:width="600"}

---

## Flower and Fruit Detection

**1) Object Detection**

[TensorBox](https://github.com/Russell91/TensorBox) is used for detecting all the flowers and fruits in a image. In this time, multiple objects have to be detected. However, some other objects were detected during the test. Other objects were including leaves, bud, unripe fruits, some other things. In this detection, the number of flowers and fruits were uncertain because of the detection of other objects.

![Sample Images](/img/tomato/fruit2.jpg){:width="600"}
![Sample Images](/img/tomato/flower2.jpg){:width="600"}

**2) CNN**

To get rid of other objects in the detection process, CNN technique was applied to distinct the flowers and fruits. For the CNN, TensorFlow [Slim](https://github.com/tensorflow/models/tree/master/research/slim) is used and especially, for the pre-trained weight, Inception-ResNet-v2 model was tried to get more high accuracy. In the training, cropped images after the object detection was used and there are two classes including fruit and others. for the flowers, it is assumed that there are flowers and candidates including bud and others. After CNN could get rid of non flowers and non fruits, flowers and fruits were detected better than just applying the object detection.

- **fruit results of CNN**

![Sample Images](/img/tomato/tomato_fruit.png){:width="600"}

- **flower results of CNN**

![Sample Images](/img/tomato/tomato_flower.png){:width="600"}

**3) Semantic Segmentation**

To figure out the shape of flowers and fruits, Semantic Segmentation is used. In here, [KittiSeg](https://github.com/MarvinTeichmann/KittiSeg) TensorFlow opensource software was applied. Trained with masked images from cropped flowers and fruits in object detection. Although the color of fruits and stems were very similar, this could segment only fruits. It was also worked even there was an overlay between multiple fruits and flowers.

- **fruit results of Segmentation**

![Sample Images](/img/tomato/tomato_fruit_seg.png){:width="600"}

- **flower results of Segmentation**

![Sample Images](/img/tomato/tomato_flower_seg.png){:width="600"}

---

{% if page.comments %}

  Please enable JavaScript to view the comments powered by Disqus.
  {% endif %}


text:
# ShellKit

Access local shell as well as remote over SSH for Swift NIO applications

### Install using SPM

```swift
.package(url: "https://github.com/Einstore/ShellKit.git", from: "1.0.0")
```

### Usage

#### Connect to a local terminal

```swift
let shell = try Shell(.local, on: eventLoop)
let futureResponse = shell.run(bash: "ls -a").map { output in
   print(output)
   return output
}
```

#### Connect to a remote service

```swift
let shell = try Shell(
    .ssh(
        host: "12<IP_ADDRESS>",
        username: "root",
        password: "sup3rS3cr3t"
    ),
    on: eventLoop
)
let futureResponse = shell.run(bash: "ls -a")
```

> Other means of SSH authentication are available!

#### Example

```swift
let eventLoop = EmbeddedEventLoop()
let shell = try Shell(.local, on: eventLoop)
let futureResponse = shell.run(bash: "cd /tmp/ ; pwd").map { output in
   print(output)
   return output
}.flatMapError { error in
   print(error)
   return error.localizedDescription
}
let out: String = try futureResponse.wait()
print(out)
```

### Using `CommandKit`

Access commands through

**Example:**
```swift
shell.cmd.pwd().map { currentPath in
   print(currentPath)
}
```

> Discover more commands under `shell.cmd` and `shell.cmd.install`

### Author

Ondrej Rafaj @rafiki270

### License

MIT; Copyright 2019 - Einstore

repository: Einstore/ShellKit

repo_name: Einstore/ShellKit


text:
# Hugh
AI for StarCraft: Brood War

## About
Hugh is the little brother of [Locutus](https://github.com/bmnielsen/Locutus). Hugh was created for the [AI TinyCraft Tournament](https://sites.google.com/view/mcrave/aitt), so called as participating bots consist of a single C++ header file not exceeding 3000 bytes.

As Hugh includes some hard-coded position information, it can only play the maps in the AITT map pool.

Hugh.h is the file with comments and line breaks that I used while developing, and Hugh.min.h is the version submitted for the tournament that has comments and unnecessary whitespace removed.

## Building

1. Download BWAPI 4.2.0
2. Rename Hugh.h to ExampleAIModule.h and overwrite the ExampleAIModule.h in the BWAPI example projects
3. Remove ExampleAIModule.cpp from the BWAPI example projects
4. Build the BWAPI example projects

Hugh will now be built to ExampleAIModule.dll.

## Feature costs

I was curious about how much each feature "cost" in terms of file size, so I did a byte count.

|Feature|Size|
|-------|----|
|Forge expand build: hard-coded building locations and the code needed to decode them|508|
|Target queue|323|
|Mining (keeping track of resources, worker micro, mineral locking, etc.)|313|
|Basic build logic (build pylons and gateways appropriately, build worker micro, etc.)|305|
|Forge expand build: the build order and logic needed to follow it|256|
|Goon-specific micro (not cancelling attacks, kiting)|174|
|Read/write to learning file|159|
|Basic micro (attack move)|141|
|Worker defense|124|
|Training units|103|
|Uncategorized|594|

repository: bmnielsen/Hugh

repo_name: bmnielsen/Hugh


text:
# Elementor - Daytoday

Elementor - Daytoday is a plugin for [Wordpress](https://wordpress.org/) which is designed to work with [Elementor](https://elementor.com/) page builder. This plugin includes widgets which are used in web development frequently.

## Features
  - Elementor dropdown widget with customizable styles

## Installation

##### Automatic installation
- Goto worpress plugin installation page and select choose file
- Select the `elementor-daytoday.zip` which is located on dist directory
- Activate the plugin from wordpress plugins list
- Find the newly installed widgets in elementor widgets genaral section

##### Manual installaion
- Create a directory named `elementor-daytoday` inside the `WORDPRESS_SITE_ROOT/wp-content/plugins`
- Copy following files and directories into the newly created `elementor-daytoday` directory
```
assets/
widgets/
index.php
elementor-daytoday.php
plugin.php
```
- Activate the plugin from wordpress plugins list
- Find the newly installed widgets in elementor widgets genaral section

## Prerequisite

Elementor-daytoday has following limitations.

| Versions |
| ------ |
| PHP  >= 7.0 |
| Elementor >= 2.0.0|

Note: This plugin is tested with **PHP-7.2.6, Wordpress-5.1.1, Elementor-2.5.10**

### Development

Want to contribute? Great!

 - Read the [wordpress plugin development docs](https://developer.wordpress.org/plugins/intro/)
 - Read about [elementor widgtes](https://developers.elementor.com/elementor-widgets/)
 - Start contributing

#### Building for source
You can create a zip file with following directories and files and place it in the dist directory.
```
assets/
widgets/
index.php
elementor-daytoday.php
plugin.php
```
**Note: Your zip file must be named as  `elementor-daytoday.zip`.**

### Todos

 - Create more widgets
 - Add more customizability
 - Add more styling options

License
----

MIT

**Free Software, Hell Yeah!**

repository: csranasinghe/elementor-daytoday

repo_name: csranasinghe/elementor-daytoday


text:
# CLX000 Exporter
Exports in the CLX000 file format. Additional options can be added by placing a CLX000 config file with the name
`mdf2clx000_config.ini` in the same directory as the executable. Default options are:
* Value separator: " "
* Time format: 4
* Time separator: ""
* Time separator ms: ""
* Date separator: ""
* Time and date separator: "T"

Selected columns are:
* Timestamp
* ID
* Data


text:
---
type: rule
archivedreason:
title: Do you keep \images folder image only?
guid: 6a343e6a-4723-4a83-9e9f-35cb69ecd8ee
uri: do-you-keep-images-folder-image-only
created: 2009-05-05T05:59:38.0000000Z
authors:
- title: Adam Cogan
  url: https://ssw.com.au/people/adam-cogan
- title: Ryan Tee
  url: https://ssw.com.au/people/ryan-tee
  noimage: true
related: []
redirects: []

---

We want to keep clear and simple file structure in our solution. Never put any files other than images file in \images folder.
<!--endintro-->

::: bad
![Bad example - HTML file in \Images Folder.](OnlyImageBad.gif)
:::

::: good
![Good example - Images only, clean \Images folder.](OnlyImageGood.gif)
:::

| We have a program called [SSW Code Auditor](http://www.ssw.com.au/ssw/CodeAuditor/Default.aspx) to check for this rule. |
| --- |

gha_language: TSQL


text:
---
type: "copy"
name: "services__bio"
title: ""
---

Therapy is a dedicated time to explore, understand and challenge certain thoughts, emotions and behaviours with an experienced professional. It requires commitment and investment which is not always an easy journey, but an important one. Therapy typically can cover the following areas:

- Mental health conditions (Anxiety, Depression, OCD, Phobias, Eating Disorders, Schizophrenia, Psychosis)
- Personality Disorders (Borderline, OCD, Narcissistic, Antisocial)
- Stress
- Grief/Loss
- Emotional dysregulation
- Self-esteem
- Autism Spectrum Disorder
- Self-harm
- Suicidality
- Parenting
- Attachment difficulties
- Complex Trauma

I provide both face-to-face in Reading and London; for clinic location please see details below. I also provide online therapy which can be accessed internationally, at a time and place convenient for you. I am available for therapy sessions on weekday evenings, and Saturday morning through to the afternoon.

I also provide psychoeducational workshops on mental wellbeing, parenting and attachment difficulties. If you would like to host a workshop for your particular organisation, please enquire for further information.

repository: cortehz/liberty-magnify

repo_name: cortehz/liberty-magnify


text:
English description | Описание на русском

![Yellfy](https://cloud.githubusercontent.com/assets/7034281/13556752/b408c3bc-e3f2-11e5-9936-cb3cc02fb7de.png)

## Yellfy

**Yellfy** — is a project template for your new web application or website based on my personal preferences in the field of automation of the development process. The project is not a universal solution and is not intended to meet the needs of all developers. For this there is a Yeoman. However, feedback and comments are always welcome in the issues.

[![devDependency Status](https://img.shields.io/david/dev/mrmlnc/yellfy.svg?style=flat-square)](https://david-dm.org/mrmlnc/yellfy#info=devDependencies)

## Features

| Feature      | Summary                                                                                |
|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Automation   | Yellfy optimized for continuous development. Just run Yellfy and write code. The process of adding images into the build, creating sprites, compiling preprocessor files and many other processes will be automatically performed.     |
| Modularity   | Yellfy aims to make the project modular. Template files and styles files are divided into modules, so you can copy them from project to the project when necessary. Style files will be picked up and are compiled automatically.      |
| Adaptability | Yellfy built with [Normalize.css](http://necolas.github.io/normalize.css/) and includes a small CSS framework that combines only the most necessary: typography, lists, buttons, forms and tables.                                     |
| Friendliness | Yellfy created by people for people who make mistakes. Therefore, almost any errors that occur during the development process, will be processed and displayed in a concise and easy for understanding form.                           |

## Requirements

Yellfy requires a modern version of [Node.js](http://nodejs.org/) (only v6.0.0+) and globally installed [Gulp](http://gulpjs.com/) and [Bower](http://bower.io/).

```
$ npm i -g gulp-cli bower
```

## Installation

To install Yellfy, you can use a command-line utility [yellfy-cli](https://www.npmjs.com/package/yellfy-cli):

```
$ npm i -g yellfy-cli && yellfy -h
```

Or Git:

```
$ git clone git://github.com/mrmlnc/yellfy project-name && npm i
```

## Run

Just run the following command at your console:

```
$ gulp
```

## Description of tasks

| Task                | Description                                                            |
|---------------------|------------------------------------------------------------------------|
| `$ gulp`            | A full cycle of build the project and run the server on `8000` port.   |
| `$ gulp build`      | A full cycle of build the project and minification compiled files.     |
| `$ gulp clean`      | Cleaning the temporary directory and directory of builds.              |
| `$ gulp sync`       | One-way synchronization of core project files that cannot be compiled. |
| `$ gulp sync-bower` | Creating symlink of Bower dependencies to the directory of build.      |
| `$ gulp xo`         | Linting scripts.                                                       |
| `$ gulp scripts`    | Creating script bundle with Rollup.                                    |
| `$ gulp test`       | Run mocha tests.                                                       |
| `$ gulp styles`     | Compile Less files, add vendor prefixes to rules.                      |
| `$ gulp templates`  | Compile Pug files, inject Bower components.                            |
| `$ gulp compress`   | Compression of the generated files.                                    |

For a complete list of the commands, run the following command:

```
$ gulp --tasks
```

## Browser support

Yellfy uses **flexbox** for more efficient distribution of information in blocks that imposes some restrictions:

  * Chrome 34+
  * Android WebView 4+
  * Firefox 30+
  * Safari 7+
  * iOS 7+
  * Opera 12+
  * Internet Explorer 10+
  * Internet Explorer Mobile 10+
  * Edge 12+
  * Blackberry browser 10+

## How to write tasks?

See [wiki](https://github.com/mrmlnc/yellfy/wiki/how-to-write-tasks) page.

## Technology

See [package.json](https://github.com/mrmlnc/yellfy/blob/master/package.json).

## License

MIT

repository: and-tol/yellfy

repo_name: and-tol/yellfy


text:
# [LIGHTIFY](http://alexa.amazon.com/#skills/amzn1.ask.skill.2fad1853-1fc7-40dc-a99c-b8a5ccaa5657)
![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png) 0

Start making your home more intelligent and use LIGHTIFY as a new dimension of light. Smart connected LED lamps or luminaires can be controlled through your smartphone or tablet using the LIGHTIFY app. Now you can use Alexa to control your LIGHTIFY smart lamps, luminaires, flexible LED strips for indoors and Gardenspots for outdoors.

Individually or grouped together, fully automated or manually controlled, just the way you need it. Discover completely new lighting possibilities and stay connected wherever you go. Customize your home according to your moods and wishes. Transform an evening with friends into an unforgettable experience for everyone or make use of your lights to calm down after an exhausting working day.

With the LIGHTIFY skill and Alexa, you can now interact with your LIGHTIFY lights by voice.

Setup

To get started, select the ‘Enable Skill’ button in the Alexa App to link your LIGHTIFY account and discover your device(s). More information: http://amzn.to/291lR7u

Giving Names

When using the skill, you need to specify by name which device to use. There are two ways to define this/these names:
	- Use the name(s) you set up already – these are shown in the LIGHTIFY app and can be changed, or
	- Create an Alexa group, like Bedroom or Downstairs, and add the device to the group. More information: http://amzn.to/2965dCE

Give it a try!

Once you know the name or group of your device(s), you can say the following:
	- If you have switches or non-dimmable lights, you can turn them on/off, for example: “Alexa, turn on Bedroom”.
	- If you have dimmable lights, you can change the brightness, for example: “Alexa, set Downstairs to 60 percent", or "Alexa, brighten Living Room".

If you have any questions, please also visit the LIGHTIFY FAQ: http://www.osram.com/osram_com/tools-and-services/tools/lightify---smart-connected-light/lightify-for-home---what-is-light-to-you/faqs/index.jsp

***

### Skill Details

* **Invocation Name:** null
* **Category:** null
* **ID:** amzn1.ask.skill.2fad1853-1fc7-40dc-a99c-b8a5ccaa5657
* **ASIN:** B01MQ4O95Q
* **Author:** OSRAM LIGHTIFY
* **Release Date:** December 14, 2016 @ 16:49:18
* **Privacy Policy:** http://www.osram.com/osram_com/landingpage/osram-lightify-privacy-policy/index.jsp?mkturl=lightify-privacy-policy
* **Terms of Use:** http://www.osram.com/osram_com/landingpage/osram-lightify-terms-of-use/index.jsp?mkturl=lightify-terms-of-use
* **Account Linking Domains:** lightify-api.org, eu.lightify-api.org
* **In-App Purchasing:** No